2009-04-06 08:53:37 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.");
|
|
|
|
|
/**
|
2009-04-03 00:50:43 +00:00
|
|
|
* Gallery - a web based photo album viewer and editor
|
2010-03-03 10:15:34 -08:00
|
|
|
* Copyright (C) 2000-2010 Bharat Mediratta
|
2009-04-03 00:50:43 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
|
* your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
2009-07-28 13:47:22 -07:00
|
|
|
class organize_event_Core {
|
|
|
|
|
static function site_menu($menu, $theme) {
|
2009-04-03 00:50:43 +00:00
|
|
|
$item = $theme->item();
|
|
|
|
|
|
2009-08-31 21:05:21 -07:00
|
|
|
if ($item && $item->is_album() && access::can("edit", $item)) {
|
2009-04-03 00:50:43 +00:00
|
|
|
$menu->get("options_menu")
|
2009-08-06 14:55:03 -07:00
|
|
|
->append(Menu::factory("dialog")
|
2009-08-31 23:27:46 -07:00
|
|
|
->id("organize")
|
2009-10-25 18:34:36 -06:00
|
|
|
->label(t("Organize album"))
|
2010-03-01 17:23:56 +01:00
|
|
|
->css_id("g-menu-organize-link")
|
2009-08-31 23:27:46 -07:00
|
|
|
->url(url::site("organize/dialog/{$item->id}")));
|
2009-04-03 00:50:43 +00:00
|
|
|
}
|
2009-04-06 08:53:37 +00:00
|
|
|
}
|
2009-08-31 21:05:21 -07:00
|
|
|
|
|
|
|
|
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"))
|
2010-03-01 17:23:56 +01:00
|
|
|
->css_class("ui-icon-folder-open g-organize-link")
|
2009-08-31 21:05:21 -07:00
|
|
|
->url(url::site("organize/dialog/{$item->id}")));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-09 20:39:31 -07:00
|
|
|
static function pre_deactivate($data) {
|
|
|
|
|
if ($data->module == "rest") {
|
|
|
|
|
$data->messages["warn"][] = t("The Organize module requires the Rest module.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static function module_change($changes) {
|
|
|
|
|
if (!module::is_active("rest") || in_array("rest", $changes->deactivate)) {
|
|
|
|
|
site_status::warning(
|
2010-06-15 15:29:45 -07:00
|
|
|
t("The Organize module requires the Rest module. " .
|
2010-05-09 20:39:31 -07:00
|
|
|
"<a href=\"%url\">Activate the Rest module now</a>",
|
|
|
|
|
array("url" => html::mark_clean(url::site("admin/modules")))),
|
|
|
|
|
"organize_needs_rest");
|
|
|
|
|
} else {
|
|
|
|
|
site_status::clear("organize_needs_rest");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-03 00:50:43 +00:00
|
|
|
}
|