diff options
Diffstat (limited to 'modules/organize')
-rw-r--r-- | modules/organize/controllers/organize.php | 8 | ||||
-rw-r--r-- | modules/organize/helpers/organize_event.php | 27 | ||||
-rw-r--r-- | modules/organize/helpers/organize_installer.php | 7 | ||||
-rw-r--r-- | modules/organize/lib/Gallery3WebClient.swf | bin | 145197 -> 148799 bytes | |||
-rw-r--r-- | modules/organize/views/organize_dialog.html.php | 16 |
5 files changed, 33 insertions, 25 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index 7b2ba8ef..2b6e4186 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -31,10 +31,9 @@ class Organize_Controller extends Controller { $sort_fields[$field] = (string)$description; } $sort_order = array("ASC" => (string)t("Ascending"), "DESC" => (string)t("Descending")); - $file_filter = json_encode( - array("photo" => array("label" => "Images", - "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), - "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4", "*.m4v")))); + $file_filter = json_encode(array( + "photo" => array("label" => "Images", "types" => array("*.jpg", "*.jpeg", "*.png", "*.gif")), + "movie" => array("label" => "Movies", "types" => array("*.flv", "*.mp4", "*.m4v")))); $v = new View("organize_dialog.html"); $v->album = $album; @@ -43,6 +42,7 @@ class Organize_Controller extends Controller { $v->file_filter = addslashes($file_filter); $v->sort_order = addslashes(json_encode($sort_order)); $v->sort_fields = addslashes(json_encode($sort_fields)); + $v->selected_id = Input::instance()->get("selected_id", null); $v->rest_uri = url::site("rest") . "/"; $v->controller_uri = url::site("organize") . "/"; $v->swf_uri = url::file("modules/organize/lib/Gallery3WebClient.swf?") . diff --git a/modules/organize/helpers/organize_event.php b/modules/organize/helpers/organize_event.php index ae05fb5d..2f997600 100644 --- a/modules/organize/helpers/organize_event.php +++ b/modules/organize/helpers/organize_event.php @@ -32,13 +32,23 @@ class organize_event_Core { } static function context_menu($menu, $theme, $item) { - if ($item->is_album() && access::can("edit", $item)) { - $menu->get("options_menu") - ->append(Menu::factory("dialog") - ->id("organize") - ->label(t("Organize album")) - ->css_class("ui-icon-folder-open g-organize-link") - ->url(url::site("organize/dialog/{$item->id}"))); + if (access::can("edit", $item)) { + if ($item->is_album()) { + $menu->get("options_menu") + ->append(Menu::factory("dialog") + ->id("organize") + ->label(t("Organize album")) + ->css_class("ui-icon-folder-open g-organize-link") + ->url(url::site("organize/dialog/{$item->id}"))); + } else { + $parent = $item->parent(); + $menu->get("options_menu") + ->append(Menu::factory("dialog") + ->id("move") + ->label(t("Move to another album")) + ->css_class("ui-icon-folder-open g-organize-link") + ->url(url::site("organize/dialog/{$parent->id}?selected_id={$item->id}"))); + } } } @@ -51,8 +61,7 @@ class organize_event_Core { static function module_change($changes) { if (!module::is_active("rest") || in_array("rest", $changes->deactivate)) { site_status::warning( - t("The Organize module requires the Rest module. " . - "<a href=\"%url\">Activate the Rest module now</a>", + t("The Organize module requires the Rest module. <a href=\"%url\">Activate the Rest module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "organize_needs_rest"); } else { diff --git a/modules/organize/helpers/organize_installer.php b/modules/organize/helpers/organize_installer.php index bbe6fc65..2faa598b 100644 --- a/modules/organize/helpers/organize_installer.php +++ b/modules/organize/helpers/organize_installer.php @@ -22,12 +22,15 @@ class organize_installer { site_status::clear("organize_needs_rest"); } + static function install() { + module::set_version("organize", $version = 2); + } + static function upgrade($version) { if ($version == 1) { if (!module::is_active("rest")) { site_status::warning( - t("The Organize module requires the Rest module. " . - "<a href=\"%url\">Activate the Rest module now</a>", + t("The Organize module requires the Rest module. <a href=\"%url\">Activate the Rest module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "organize_needs_rest"); } diff --git a/modules/organize/lib/Gallery3WebClient.swf b/modules/organize/lib/Gallery3WebClient.swf Binary files differindex b37a74c3..b82c8a42 100644 --- a/modules/organize/lib/Gallery3WebClient.swf +++ b/modules/organize/lib/Gallery3WebClient.swf diff --git a/modules/organize/views/organize_dialog.html.php b/modules/organize/views/organize_dialog.html.php index 4cc6385e..b76813ad 100644 --- a/modules/organize/views/organize_dialog.html.php +++ b/modules/organize/views/organize_dialog.html.php @@ -1,10 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <script type="text/javascript" src="<?= url::file("lib/swfobject.js") ?>"></script> <style type="text/css" media="screen"> - #flashContent { - //display:none; - } - .g-organize { padding: 0; margins: 0; @@ -21,10 +17,10 @@ </style> <script type="text/javascript"> - $("#g-dialog").bind("dialogclose", function(event, ui) { - // @todo do a call to organize/closing to end the batch - window.location.reload(); - }); + $("#g-dialog").bind("dialogclose", function(event, ui) { + // @todo do a call to organize/closing to end the batch + window.location.reload(); + }); function closeOrganizeDialog() { $("#g-dialog").dialog("close"); @@ -94,6 +90,7 @@ sortOrder: "<?= $sort_order ?>", sortFields: "<?= $sort_fields ?>", albumId: "<?= $album->id ?>", + selectedId: "<?= $selected_id ?>", restUri: "<?= $rest_uri ?>", controllerUri: "<?= $controller_uri ?>" }; @@ -129,8 +126,7 @@ <h1 style="display:none"><?= t("Organize :: %name", array("name" => html::purify($album->title))) ?></h1> <div id="flashContent"> <p> - <?= t("To use the Organize feature, please ensure that Adobe Flash Player version %flash_minimum_version " . - "or greater is installed.", array("flash_minimum_version" => $flash_minimum_version)) ?> + <?= t("Your browser must have Adobe Flash Player version %flash_minimum_version or greater installed to use this feature.", array("flash_minimum_version" => $flash_minimum_version)) ?> </p> <a href="http://www.adobe.com/go/getflashplayer"> <img src="<?= request::protocol() ?>://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" |