Merge branch 'master' of github.com:gallery/gallery3-contrib
This commit is contained in:
commit
5103ffce45
@ -24,12 +24,14 @@ class Admin_Moduleorder_Controller extends Admin_Controller {
|
|||||||
|
|
||||||
private function _get_view() {
|
private function _get_view() {
|
||||||
$view = new Admin_View("admin.html");
|
$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 = new View("admin_moduleorder.html");
|
||||||
$view->content->csrf = access::csrf_token();
|
$view->content->csrf = access::csrf_token();
|
||||||
$view->content->available = new View("admin_moduleorder_blocks.html");
|
$view->content->available = new View("admin_moduleorder_blocks.html");
|
||||||
$view->content->active = 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;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +76,7 @@ class Admin_Moduleorder_Controller extends Admin_Controller {
|
|||||||
|
|
||||||
private function _get_modules() {
|
private function _get_modules() {
|
||||||
$active_blocks = array();
|
$active_blocks = array();
|
||||||
$available_modules = module_manager::get_available_site_modules();
|
$available_modules = moduleorder::get_available_site_modules();
|
||||||
return $available_modules;
|
return $available_modules;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* 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() {
|
static function get_available_site_modules() {
|
||||||
return self::_get_modules();
|
return self::_get_modules();
|
||||||
}
|
}
|
||||||
@ -29,4 +29,4 @@ class module_manager_Core {
|
|||||||
}
|
}
|
||||||
return $modules;
|
return $modules;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -18,11 +18,22 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
class moduleorder_event_Core {
|
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) {
|
static function admin_menu($menu, $theme) {
|
||||||
$menu->get("settings_menu")
|
$menu->get("settings_menu")
|
||||||
->append(Menu::factory("link")
|
->append(Menu::factory("link")
|
||||||
->id("moduleorder_menu")
|
->id("moduleorder_menu")
|
||||||
->label(t("Manage Module Order"))
|
->label(t("Module order"))
|
||||||
->url(url::site("admin/moduleorder")));
|
->url(url::site("admin/moduleorder")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
38
modules/moduleorder/helpers/moduleorder_installer.php
Normal file
38
modules/moduleorder/helpers/moduleorder_installer.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
|
* Gallery - a web based photo album viewer and editor
|
||||||
|
* Copyright (C) 2000-2010 Bharat Mediratta
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
class moduleorder_installer {
|
||||||
|
static function install() {
|
||||||
|
// Set the module's version number.
|
||||||
|
module::set_version("moduleorder", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function upgrade($version) {
|
||||||
|
module::set_version("moduleorder", $version = 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function deactivate() {
|
||||||
|
// Clear the require higher core version message.
|
||||||
|
site_status::clear("moduleorder_needs_higherversion");
|
||||||
|
}
|
||||||
|
|
||||||
|
static function uninstall() {
|
||||||
|
module::delete("moduleorder");
|
||||||
|
}
|
||||||
|
}
|
@ -1,8 +1,6 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<? if (module::get_version("gallery") > 31): ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
|
||||||
$(".g-admin-blocks-list").height($(".g-admin-blocks-list").height());
|
|
||||||
});
|
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$(".g-admin-blocks-list ul").sortable({
|
$(".g-admin-blocks-list ul").sortable({
|
||||||
@ -23,23 +21,27 @@
|
|||||||
document.moduleorder.submit();
|
document.moduleorder.submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<? endif ?>
|
||||||
|
|
||||||
<div id="g-block-admin" class="g-block ui-helper-clearfix">
|
<div id="g-block-admin" class="g-block ui-helper-clearfix">
|
||||||
<h1> <?= t("Manage Module Order") ?> </h1>
|
<h1> <?= t("Manage module order") ?> </h1>
|
||||||
|
<? if (module::get_version("gallery") < 32): ?>
|
||||||
|
<h2> <?= t("Warning") ?> </h2>
|
||||||
|
<p>
|
||||||
|
<?= t("You must have Gallery core version of 32 or higher installed to use this module. Please update your installation.") ?>
|
||||||
|
</p>
|
||||||
|
<? else: ?>
|
||||||
<p>
|
<p>
|
||||||
<?= t("Select and drag blocks to change the order. Click 'Save' to save your changes.") ?>
|
<?= t("Select and drag blocks to change the order. Click 'Save' to save your changes.") ?>
|
||||||
</p>
|
</p>
|
||||||
<h2> <?= t("Important notes") ?> </h2>
|
<h2> <?= t("Notes") ?> </h2>
|
||||||
<p>
|
|
||||||
<?= 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.") ?>
|
|
||||||
</p>
|
|
||||||
<p>
|
<p>
|
||||||
<?= t("The core module ('gallery') and the identity provider module (default is 'user') cannot be sorted and are therefore hidden from this list.") ?>
|
<?= t("The core module ('gallery') and the identity provider module (default is 'user') cannot be sorted and are therefore hidden from this list.") ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="g-block-content">
|
<div class="g-block-content">
|
||||||
<div id="g-site-blocks">
|
<div id="g-site-blocks">
|
||||||
<div class="g-admin-blocks-list g-left">
|
<div class="g-admin-blocks-list g-left" style="float: none !important;">
|
||||||
<h3><?= t("Installed Modules") ?></h3>
|
<h3><?= t("Installed Modules") ?></h3>
|
||||||
<div>
|
<div>
|
||||||
<ul id="g-active-blocks" class="g-sortable-blocks">
|
<ul id="g-active-blocks" class="g-sortable-blocks">
|
||||||
@ -48,9 +50,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<form name="moduleorder" action="<?= url::site("admin/moduleorder/update?csrf={$csrf}") ?>" method="post">
|
||||||
|
<input type="hidden" name="modulelist" value="">
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<form name="moduleorder" action="<?= url::site("admin/moduleorder/update?csrf={$csrf}") ?>" method="post">
|
<a class="ui-state-default ui-corner-all" style="padding: 5px;" href="javascript: buildmodulelist()">Save</a>
|
||||||
<input type="hidden" name="modulelist" value="">
|
<? endif ?>
|
||||||
</form>
|
|
||||||
<a class="ui-state-default ui-corner-all" style="padding: 5px;" href="javascript: buildmodulelist()">Save</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
<? $indent_provider = module::get_var("gallery", "identity_provider") ?>
|
<? $indent_provider = module::get_var("gallery", "identity_provider") ?>
|
||||||
<? foreach ($modules as $ref => $text): ?>
|
<? foreach ($modules as $ref => $text): ?>
|
||||||
<? if ($text == "gallery" || $text == $indent_provider): ?>
|
<? $moduleinfo = module::info($text) ?>
|
||||||
|
<? if ($text == "gallery" || $text == $indent_provider || $moduleinfo->name == ""): ?>
|
||||||
<li style="background-color:#A8A8A8; margin:0.5em; padding:0.3em 0.8em; display: none" ref="<?= $ref ?>"><?= $text ?></li>
|
<li style="background-color:#A8A8A8; margin:0.5em; padding:0.3em 0.8em; display: none" ref="<?= $ref ?>"><?= $text ?></li>
|
||||||
<? else: ?>
|
<? else: ?>
|
||||||
<li class="g-draggable" ref="<?= $ref ?>"><?= $text ?></li>
|
<li class="g-draggable" ref="<?= $ref ?>"><?= $moduleinfo->name ?></li>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
<? endforeach ?>
|
<? endforeach ?>
|
||||||
|
Reference in New Issue
Block a user