summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-30 15:52:18 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-30 15:52:18 -0800
commitd50b7531993fcf7dee2542255f11b20257db737d (patch)
treeea76324fe18732954de0c3ea314ba805591ec0ad /modules
parent2e98825c25c540dfc2555a2f36bc3b9e2f80db54 (diff)
parent7af844606d79d1f987c6d754f5c5db64d86acc47 (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/controllers/file_proxy.php8
-rw-r--r--modules/gallery/views/form_uploadify.html.php16
-rw-r--r--modules/server_add/controllers/server_add.php4
3 files changed, 20 insertions, 8 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 65c0cb50..72c4e104 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -99,6 +99,12 @@ class File_Proxy_Controller extends Controller {
throw new Kohana_404_Exception();
}
+ // Check that the content hasn't expired or it wasn't changed since cached
+ if (($last_modified = expires::get()) !== false &&
+ $item->updated < $last_modified) {
+ expires::check(2592000);
+ }
+
// Don't try to load a directory
if ($type == "albums" && $item->is_album()) {
throw new Kohana_404_Exception();
@@ -111,6 +117,8 @@ class File_Proxy_Controller extends Controller {
// We don't need to save the session for this request
Session::abort_save();
+ expires::set(2592000); // 30 days
+
// Dump out the image. If the item is a movie, then its thumbnail will be a JPG.
if ($item->is_movie() && $type != "albums") {
header("Content-type: image/jpeg");
diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php
index d856c464..43b73033 100644
--- a/modules/gallery/views/form_uploadify.html.php
+++ b/modules/gallery/views/form_uploadify.html.php
@@ -1,15 +1,19 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<style>
#g-add-photos-canvas object {
- left: -50px;
+ height: 33px;
+ left: -60px;
position: relative;
z-index: 100;
}
#g-add-photos-button {
- left: 55px;
+ float: left;
+ left: 175px;
+ padding-bottom: .5em;
+ padding-top: .5em;
position: relative;
- top: -15px;
- z-index: -1;
+ width: 110px;
+ z-index: 1;
}
</style>
<script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script>
@@ -23,7 +27,6 @@
fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4",
fileDesc: <?= t("Photos and movies")->for_js() ?>,
cancelImg: "<?= url::file("lib/uploadify/cancel.png") ?>",
- buttonText: <?= t("Select photos...")->for_js() ?>,
simUploadLimit: <?= $simultaneous_upload_limit ?>,
wmode: "transparent",
hideButton: true, /* should be true */
@@ -77,7 +80,6 @@
$("#g-add-photos-status ul").append(
"<li class=\"g-error\">" + fileObj.name + msg + "</li>");
$("#g-uploadify" + queueID).remove();
- //return false;
},
onSelect: function(event) {
if ($("#g-upload-cancel-all").hasClass("ui-state-disabled")) {
@@ -114,7 +116,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" href="#"><?= t("Select photos...") ?></a>
<span id="g-uploadify"></span>
</div>
<div id="g-add-photos-status" style="text-align: center;">
diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php
index 6ff00812..f6e3a4dd 100644
--- a/modules/server_add/controllers/server_add.php
+++ b/modules/server_add/controllers/server_add.php
@@ -42,13 +42,15 @@ class Server_Add_Controller extends Admin_Controller {
// Make a tree with the parents back up to the authorized path, and all the children under the
// current path.
+ Kohana_Log::add("error", $path);
if (server_add::is_valid_path($path)) {
$tree->parents[] = $path;
while (server_add::is_valid_path(dirname($tree->parents[0]))) {
array_unshift($tree->parents, dirname($tree->parents[0]));
}
- foreach (glob("$path/*") as $file) {
+ $glob_path = str_replace(array("{", "}", "[", "]"), array("\{", "\}", "\[", "\]"), $path);
+ foreach (glob("$glob_path/*") as $file) {
if (!is_readable($file)) {
continue;
}