summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-16 14:57:35 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-16 14:57:35 -0800
commitade642cff4a4ca810f468723b04efc6f229916d8 (patch)
tree8fd9948212f4f28cc51e7d6e8c76b3cdd1388a87 /modules
parent78b6da12aa08aad0fbae74bc03c1afddb609c150 (diff)
parentbf4c518bb56917b9960c67afe2893da4569a3938 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/gallery_task.php18
-rw-r--r--modules/gallery/libraries/drivers/Cache/Database.php2
-rw-r--r--modules/gallery/views/simple_uploader.html.php24
3 files changed, 29 insertions, 15 deletions
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php
index 95216cf0..e0b03682 100644
--- a/modules/gallery/helpers/gallery_task.php
+++ b/modules/gallery/helpers/gallery_task.php
@@ -120,15 +120,16 @@ class gallery_task_Core {
$errors = array();
try {
$start = microtime(true);
- $dirs = $task->get("dirs");
- $files = $task->get("files");
- $cache = $task->get("cache", array());
+ $data = Cache::instance()->get("update_l10n_cache:{$task->id}");
+ if ($data) {
+ list($dirs, $files, $cache) = unserialize($data);
+ }
$i = 0;
switch ($task->get("mode", "init")) {
case "init": // 0%
$dirs = array("gallery", "modules", "themes", "installer");
- $files = array();
+ $files = $cache = array();
$task->set("mode", "find_files");
$task->status = t("Finding files");
break;
@@ -194,9 +195,12 @@ class gallery_task_Core {
$task->percent_complete = 100;
}
- $task->set("files", $files);
- $task->set("dirs", $dirs);
- $task->set("cache", $cache);
+ if ($task->percent_complete < 100) {
+ Cache::instance()->set("update_l10n_cache:{$task->id}",
+ serialize(array($dirs, $files, $cache)));
+ } else {
+ Cache::instance()->delete("update_l10n_cache:{$task->id}");
+ }
} catch (Exception $e) {
$task->done = true;
$task->state = "error";
diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php
index 43f4e38a..7e2aeabc 100644
--- a/modules/gallery/libraries/drivers/Cache/Database.php
+++ b/modules/gallery/libraries/drivers/Cache/Database.php
@@ -60,6 +60,8 @@ class Cache_Database_Driver implements Cache_Driver {
if (!empty($tags)) {
// Escape the tags, adding brackets so the tag can be explicitly matched
$tags = "<" . implode(">,<", $tags) . ">";
+ } else {
+ $tags = null;
}
// Cache Database driver expects unix timestamp
diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php
index 10e748b6..80dcc5bc 100644
--- a/modules/gallery/views/simple_uploader.html.php
+++ b/modules/gallery/views/simple_uploader.html.php
@@ -1,4 +1,17 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
+<style>
+#g-uploadifyUploader {
+ left: -50px;
+ position: relative;
+ z-index: 100;
+}
+#g-add-photos-button {
+ left: 55px;
+ position: relative;
+ top: -15px;
+ z-index: -1;
+}
+</style>
<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script>
<script type="text/javascript" src="<?= url::file("lib/uploadify/jquery.uploadify.min.js") ?>"></script>
<script type="text/javascript">
@@ -15,8 +28,8 @@
cancelImg: "<?= url::file("lib/uploadify/cancel.png") ?>",
buttonText: <?= t("Select Photos ...")->for_js() ?>,
simUploadLimit: 10,
- //wmode: "transparent",
- hideButton: false, /* should be true */
+ wmode: "transparent",
+ hideButton: true, /* should be true */
auto: true,
multi: true,
onAllComplete: function(filesUploaded, errors, allbytesLoaded, speed) {
@@ -78,11 +91,6 @@
return true;
}
});
-
- // @todo figure out how to actually get the offset or why it comes back 0 0
- var offset = $("#g-add-photos-button").offset();
- //$("#g-uploadifyUploader").css({top: "97px", position: "absolute", left: "198px"});
- //$("#g-add-photos-button").height("40px").width("120px");
});
</script>
@@ -115,7 +123,7 @@
</div>
<div id="g-add-photos-canvas" style="text-align: center;">
- <!-- a id="g-add-photos-button" class="ui-corner-all" style="padding-bottom: 1em;" href="#"><?= t("Select Photos...") ?></a -->
+ <a id="g-add-photos-button" class="ui-corner-all" style="padding-bottom: 1em;" href="#"><?= t("Select Photos...") ?></a>
<span id="g-uploadify"></span>
</div>
<div id="g-add-photos-status" style="text-align: center;">