diff --git a/modules/moduleorder/controllers/admin_moduleorder.php b/modules/moduleorder/controllers/admin_moduleorder.php index 9dd30b03..05b8efa0 100644 --- a/modules/moduleorder/controllers/admin_moduleorder.php +++ b/modules/moduleorder/controllers/admin_moduleorder.php @@ -24,12 +24,14 @@ class Admin_Moduleorder_Controller extends Admin_Controller { private function _get_view() { $view = new Admin_View("admin.html"); - $view->page_title = t("Manage Module Order"); + $view->page_title = t("Manage module order"); $view->content = new View("admin_moduleorder.html"); $view->content->csrf = access::csrf_token(); $view->content->available = new View("admin_moduleorder_blocks.html"); $view->content->active = new View("admin_moduleorder_blocks.html"); - $view->content->available->modules = $this->_get_modules(); + if (module::get_version("gallery") > 31) { + $view->content->available->modules = $this->_get_modules(); + } return $view; } @@ -74,7 +76,7 @@ class Admin_Moduleorder_Controller extends Admin_Controller { private function _get_modules() { $active_blocks = array(); - $available_modules = module_manager::get_available_site_modules(); + $available_modules = moduleorder::get_available_site_modules(); return $available_modules; } } diff --git a/modules/moduleorder/helpers/module_manager.php b/modules/moduleorder/helpers/moduleorder.php similarity index 97% rename from modules/moduleorder/helpers/module_manager.php rename to modules/moduleorder/helpers/moduleorder.php index b26d5f76..3b7820a0 100644 --- a/modules/moduleorder/helpers/module_manager.php +++ b/modules/moduleorder/helpers/moduleorder.php @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -class module_manager_Core { +class moduleorder_Core { static function get_available_site_modules() { return self::_get_modules(); } @@ -29,4 +29,4 @@ class module_manager_Core { } return $modules; } -} \ No newline at end of file +} diff --git a/modules/moduleorder/helpers/moduleorder_event.php b/modules/moduleorder/helpers/moduleorder_event.php index 5fdcc923..84773db1 100644 --- a/modules/moduleorder/helpers/moduleorder_event.php +++ b/modules/moduleorder/helpers/moduleorder_event.php @@ -18,11 +18,22 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class moduleorder_event_Core { + static function module_change($changes) { + // Gallery version must be >= 32 + if (module::get_version("gallery") < 32) { + site_status::warning( + t("The module 'Module Order' requires Gallery core version of 32 or higher."), + "moduleorder_needs_higherversion"); + } else { + site_status::clear("moduleorder_needs_higherversion"); + } + } + static function admin_menu($menu, $theme) { $menu->get("settings_menu") ->append(Menu::factory("link") ->id("moduleorder_menu") - ->label(t("Manage Module Order")) + ->label(t("Module order")) ->url(url::site("admin/moduleorder"))); } } diff --git a/modules/moduleorder/helpers/moduleorder_installer.php b/modules/moduleorder/helpers/moduleorder_installer.php new file mode 100644 index 00000000..51d08031 --- /dev/null +++ b/modules/moduleorder/helpers/moduleorder_installer.php @@ -0,0 +1,38 @@ + + if (module::get_version("gallery") > 31): ?> + endif ?>
+ = t("You must have Gallery core version of 32 or higher installed to use this module. Please update your installation.") ?> +
+ else: ?>= t("Select and drag blocks to change the order. Click 'Save' to save your changes.") ?>
-- = t("You will only need to change this order in rare circumstances (e.g. if two modules display content at the bottom of the image and you want to change the order in which this content is being shown). If everything on your Gallery Site is looking normal then please do not touch this.") ?> -
+= t("The core module ('gallery') and the identity provider module (default is 'user') cannot be sorted and are therefore hidden from this list.") ?>
diff --git a/modules/moduleorder/views/admin_moduleorder_blocks.html.php b/modules/moduleorder/views/admin_moduleorder_blocks.html.php index 43735a87..b7d9458f 100644 --- a/modules/moduleorder/views/admin_moduleorder_blocks.html.php +++ b/modules/moduleorder/views/admin_moduleorder_blocks.html.php @@ -1,9 +1,10 @@ $indent_provider = module::get_var("gallery", "identity_provider") ?> foreach ($modules as $ref => $text): ?> - if ($text == "gallery" || $text == $indent_provider): ?> + $moduleinfo = module::info($text) ?> + if ($text == "gallery" || $text == $indent_provider || $moduleinfo->name == ""): ?> else: ?> -