From 6495263fd499ed6a9b9020865f84b1c0e4ca171e Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 31 Dec 2010 15:06:36 +0000 Subject: feature 2089: Batch Manager, switch from global to unit mode with tabs git-svn-id: http://piwigo.org/svn/trunk@8413 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/batch_manager.php | 54 ++++++-- admin/batch_manager_global.php | 9 -- .../default/template/batch_manager_global.tpl | 4 - .../themes/default/template/batch_manager_unit.tpl | 144 +++++++++++++++++++++ 4 files changed, 185 insertions(+), 26 deletions(-) create mode 100644 admin/themes/default/template/batch_manager_unit.tpl diff --git a/admin/batch_manager.php b/admin/batch_manager.php index a608a9bf5..89a1b8bc1 100644 --- a/admin/batch_manager.php +++ b/admin/batch_manager.php @@ -33,6 +33,7 @@ if (!defined('PHPWG_ROOT_PATH')) } include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); +include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); // +-----------------------------------------------------------------------+ // | Check Access and exit when user status is not ok | @@ -268,22 +269,49 @@ else } // +-----------------------------------------------------------------------+ -// | open specific mode | +// | Tabs | // +-----------------------------------------------------------------------+ -$_GET['mode'] = !empty($_GET['mode']) ? $_GET['mode'] : 'global'; +$tabs = array( + array( + 'code' => 'global', + 'label' => l10n('global mode'), + ), + array( + 'code' => 'unit', + 'label' => l10n('unit mode'), + ), + ); + +$tab_codes = array_map( + create_function('$a', 'return $a["code"];'), + $tabs + ); -switch ($_GET['mode']) +if (isset($_GET['mode']) and in_array($_GET['mode'], $tab_codes)) { - case 'global' : - { - include(dirname(__FILE__).'/batch_manager_global.php'); - break; - } - case 'unit' : - { - include(PHPWG_ROOT_PATH.'admin/element_set_unit.php'); - break; - } + $page['tab'] = $_GET['mode']; +} +else +{ + $page['tab'] = $tabs[0]['code']; } + +$tabsheet = new tabsheet(); +foreach ($tabs as $tab) +{ + $tabsheet->add( + $tab['code'], + $tab['label'], + get_root_url().'admin.php?page='.$_GET['page'].'&mode='.$tab['code'] + ); +} +$tabsheet->select($page['tab']); +$tabsheet->assign(); + +// +-----------------------------------------------------------------------+ +// | open specific mode | +// +-----------------------------------------------------------------------+ + +include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php'); ?> diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index 1a6f1130a..c9305488d 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -314,17 +314,8 @@ $base_url = get_root_url().'admin.php'; $template->assign( array( 'filter' => $_SESSION['bulk_manager_filter'], - 'selection' => $collection, - 'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')), - - 'U_UNIT_MODE' - => - $base_url - .get_query_string_diff(array('mode','display')) - .'&mode=unit', - 'F_ACTION'=>$base_url.get_query_string_diff(array('cat')), ) ); diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index c62092c19..1fb57289a 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -329,10 +329,6 @@ a.removeFilter:hover {background: url(admin/themes/default/icon/remove_filter_ho {/literal} -

- Switch to unit mode -

-

{'Batch Manager'|@translate}

diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl new file mode 100644 index 000000000..44ac226e5 --- /dev/null +++ b/admin/themes/default/template/batch_manager_unit.tpl @@ -0,0 +1,144 @@ + +{include file='include/autosize.inc.tpl'} +{include file='include/datepicker.inc.tpl'} + +{combine_script id='jquery.fcbkcomplete' load='async' require='jquery' path='themes/default/js/plugins/jquery.fcbkcomplete.js'} +{footer_script require='jquery.fcbkcomplete'} +var tag_boxes_selector = ""; +{foreach from=$elements item=element name=element} +{if $smarty.foreach.element.first} +var prefix = ""; +{else} +prefix = ", "; +{/if} + tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID}; +{/foreach} +{literal} +jQuery(document).ready(function() { + $(tag_boxes_selector).fcbkcomplete({ + json_url: "admin.php?fckb_tags=1", + cache: false, + filter_case: false, + filter_hide: true, + firstselected: true, + filter_selected: true, + maxitems: 100, + newel: true + }); +}); +{/literal}{/footer_script} + +

{'Batch Manager'|@translate}

+ + +
+ {'Display options'|@translate} +

{'elements per page'|@translate} : + 5 + | 10 + | 50 + | {'all'|@translate} +

+ +
+ +{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} + +{if !empty($elements) } +
+{foreach from=$elements item=element} +
+ {$element.LEGEND} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{'Name'|@translate}
{'Author'|@translate}
{'Creation date'|@translate} + + + + + + + + {footer_script} + pwg_initialization_datepicker("#date_creation_day-{$element.ID}", "#date_creation_month-{$element.ID}", "#date_creation_year-{$element.ID}", "#date_creation_linked_date-{$element.ID}", "#date_creation_action_set-{$element.ID}"); + {/footer_script} +
{'Who can see this photo?'|@translate} + +
{'Tags'|@translate} + + + +
{'Description'|@translate}
+ +
+{/foreach} + +

+ + +

+{/if} + +
+ + -- cgit v1.2.3