mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 04:09:56 +03:00
store display order of plugins_new in a session var
git-svn-id: http://piwigo.org/svn/trunk@11222 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
0af1d99ebf
commit
d2fa16a7f5
3 changed files with 20 additions and 1 deletions
|
@ -44,6 +44,13 @@ check_status(ACCESS_ADMINISTRATOR);
|
||||||
// | Direct actions |
|
// | Direct actions |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|
||||||
|
// save plugins_new display order (AJAX action)
|
||||||
|
if (isset($_GET['plugins_new_order']))
|
||||||
|
{
|
||||||
|
pwg_set_session_var('plugins_new_order', $_GET['plugins_new_order']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// theme changer
|
// theme changer
|
||||||
if (isset($_GET['change_theme']))
|
if (isset($_GET['change_theme']))
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,8 +94,19 @@ $template->assign('order_options',
|
||||||
// | start template output |
|
// | start template output |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
if ($plugins->get_server_plugins(true))
|
if ($plugins->get_server_plugins(true))
|
||||||
|
{
|
||||||
|
/* order plugins */
|
||||||
|
if (pwg_get_session_var('plugins_new_order') != null)
|
||||||
|
{
|
||||||
|
$order_selected = pwg_get_session_var('plugins_new_order');
|
||||||
|
$plugins->sort_server_plugins($order_selected);
|
||||||
|
$template->assign('order_selected', $order_selected);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$plugins->sort_server_plugins('date');
|
$plugins->sort_server_plugins('date');
|
||||||
|
$template->assign('order_selected', 'date');
|
||||||
|
}
|
||||||
|
|
||||||
foreach($plugins->server_plugins as $plugin)
|
foreach($plugins->server_plugins as $plugin)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@ jQuery(document).ready(function(){
|
||||||
jQuery('select[name="selectOrder"]').change(function() {
|
jQuery('select[name="selectOrder"]').change(function() {
|
||||||
sortOrder = this.value;
|
sortOrder = this.value;
|
||||||
$('.pluginBox').sortElements(sortPlugins);
|
$('.pluginBox').sortElements(sortPlugins);
|
||||||
|
$.get("admin.php?plugins_new_order="+sortOrder);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
{/literal}{/footer_script}
|
{/literal}{/footer_script}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue