summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2011-10-26 16:22:22 +0000
committerNathan Kinkade <nath@nkinka.de>2011-10-26 16:22:22 +0000
commit963bcf0789148fb3aa9149581cb6d0791d2e641f (patch)
tree5c550f97a4325f67b00e1971ae78e93f87da8452
parent47456c0de8a408bca9b5a02a0fbc835ff1c01a68 (diff)
parent5a11684486e82758a9ea0764e779726252c17dea (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
-rw-r--r--.build_number2
-rw-r--r--modules/gallery/controllers/uploader.php5
-rw-r--r--modules/gallery/libraries/Gallery_View.php14
-rw-r--r--modules/organize/views/organize_frame.html.php20
-rw-r--r--modules/rest/controllers/rest.php1
-rw-r--r--themes/wind/views/page.html.php1
6 files changed, 29 insertions, 14 deletions
diff --git a/.build_number b/.build_number
index a8c3e6c9..5594e328 100644
--- a/.build_number
+++ b/.build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=174
+build_number=178
diff --git a/modules/gallery/controllers/uploader.php b/modules/gallery/controllers/uploader.php
index 9c2bf7d7..05b3bf7b 100644
--- a/modules/gallery/controllers/uploader.php
+++ b/modules/gallery/controllers/uploader.php
@@ -55,6 +55,7 @@ class Uploader_Controller extends Controller {
if ($form->validate() && $file_validation->validate()) {
$temp_filename = upload::save("Filedata");
+ Event::add("system.shutdown", create_function("", "unlink(\"$temp_filename\");"));
try {
$item = ORM::factory("item");
$item->name = substr(basename($temp_filename), 10); // Skip unique identifier Kohana adds
@@ -87,14 +88,10 @@ class Uploader_Controller extends Controller {
Kohana_Log::add("error", "Validation errors: " . print_r($e->validation->errors(), 1));
}
- if (file_exists($temp_filename)) {
- unlink($temp_filename);
- }
header("HTTP/1.1 500 Internal Server Error");
print "ERROR: " . $e->getMessage();
return;
}
- unlink($temp_filename);
print "FILEID: $item->id";
} else {
header("HTTP/1.1 400 Bad Request");
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index e04b9169..9c672770 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -157,7 +157,10 @@ class Gallery_View_Core extends View {
$contents = $cache->get($key);
if (empty($contents)) {
- module::event("before_combine", $type, $this->combine_queue[$type][$group]);
+ $combine_data = new stdClass();
+ $combine_data->type = $type;
+ $combine_data->contents = $this->combine_queue[$type][$group];
+ module::event("before_combine", $combine_data);
$contents = "";
foreach (array_keys($this->combine_queue[$type][$group]) as $path) {
@@ -168,14 +171,17 @@ class Gallery_View_Core extends View {
}
}
- module::event("after_combine", $type, $contents);
+ $combine_data = new stdClass();
+ $combine_data->type = $type;
+ $combine_data->contents = $contents;
+ module::event("after_combine", $combine_data);
- $cache->set($key, $contents, array($type), 30 * 84600);
+ $cache->set($key, $combine_data->contents, array($type), 30 * 84600);
$use_gzip = function_exists("gzencode") &&
(int) ini_get("zlib.output_compression") === 0;
if ($use_gzip) {
- $cache->set("{$key}_gz", gzencode($contents, 9, FORCE_GZIP),
+ $cache->set("{$key}_gz", gzencode($combine_data->contents, 9, FORCE_GZIP),
array($type, "gzip"), 30 * 84600);
}
diff --git a/modules/organize/views/organize_frame.html.php b/modules/organize/views/organize_frame.html.php
index 650574ab..47828944 100644
--- a/modules/organize/views/organize_frame.html.php
+++ b/modules/organize/views/organize_frame.html.php
@@ -109,7 +109,7 @@
item_ids = [];
for (var i = 0; i != nodes.length; i++) {
var node = Ext.fly(nodes[i]);
- item_ids.push(node.getAttribute("rel"));
+ item_ids.push(get_id_from_node(node));
}
start_busy(<?= t("Deleting...")->for_js() ?>);
Ext.Ajax.request({
@@ -127,6 +127,16 @@
});
};
+ var get_id_from_node = function(node) {
+ var id = node.getAttribute("rel");
+ if (!id) {
+ // IE9 has a bug which causes it to be unable to read the "rel" attr
+ // so hack it by extracting the id the CSS class id. This is fragile.
+ // ref: https://sourceforge.net/apps/trac/gallery/ticket/1790
+ return node.getAttribute("id").replace("thumb-", "");
+ }
+ }
+
/*
* ********************************************************************************
* JsonStore, DataView and Panel for viewing albums
@@ -143,7 +153,7 @@
"dblclick": function(v, index, node, e) {
node = Ext.get(node);
if (node.hasClass("thumb-album")) {
- var id = node.getAttribute("rel");
+ var id = get_id_from_node(node);
tree_panel.fireEvent("click", tree_panel.getNodeById(id))
}
},
@@ -218,7 +228,7 @@
var nodes = data.nodes;
source_ids = [];
for (var i = 0; i != nodes.length; i++) {
- source_ids.push(Ext.fly(nodes[i]).getAttribute("rel"));
+ source_ids.push(get_id_from_node(Ext.fly(nodes[i])));
}
start_busy(<?= t("Rearranging...")->for_js() ?>);
target = Ext.fly(target);
@@ -232,7 +242,7 @@
failure: show_generic_error,
params: {
source_ids: source_ids.join(","),
- target_id: target.getAttribute("rel"),
+ target_id: get_id_from_node(target),
relative: this.drop_side, // calculated in onNodeOver
csrf: '<?= access::csrf_token() ?>'
}
@@ -448,7 +458,7 @@
var moving_albums = 0;
for (var i = 0; i != nodes.length; i++) {
var node = Ext.fly(nodes[i]);
- source_ids.push(node.getAttribute("rel"));
+ source_ids.push(get_id_from_node(node));
moving_albums |= node.hasClass("thumb-album");
}
start_busy(<?= t("Moving...")->for_js() ?>);
diff --git a/modules/rest/controllers/rest.php b/modules/rest/controllers/rest.php
index 52d9925b..624a02a0 100644
--- a/modules/rest/controllers/rest.php
+++ b/modules/rest/controllers/rest.php
@@ -69,6 +69,7 @@ class Rest_Controller extends Controller {
$request->params = (object) $input->post();
if (isset($_FILES["file"])) {
$request->file = upload::save("file");
+ Event::add("system.shutdown", create_function("", "unlink(\"{$request->file}\");"));
}
break;
}
diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php
index ca6d2bb1..24d3347e 100644
--- a/themes/wind/views/page.html.php
+++ b/themes/wind/views/page.html.php
@@ -115,6 +115,7 @@
<? if (!$breadcrumb->last): ?> <a href="<?= $breadcrumb->url ?>"><? endif ?>
<?= html::purify(text::limit_chars($breadcrumb->title, module::get_var("gallery", "visible_title_length"))) ?>
<? if (!$breadcrumb->last): ?></a><? endif ?>
+ </li>
<? endforeach ?>
</ul>
<? endif ?>