Changeset 8413


Ignore:
Timestamp:
Dec 31, 2010, 4:06:36 PM (10 years ago)
Author:
plg
Message:

feature 2089: Batch Manager, switch from global to unit mode with tabs

Location:
trunk/admin
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager.php

    r8408 r8413  
    3434
    3535include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     36include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    3637
    3738// +-----------------------------------------------------------------------+
     
    269270
    270271// +-----------------------------------------------------------------------+
     272// |                                 Tabs                                  |
     273// +-----------------------------------------------------------------------+
     274
     275$tabs = array(
     276  array(
     277    'code' => 'global',
     278    'label' => l10n('global mode'),
     279    ),
     280  array(
     281    'code' => 'unit',
     282    'label' => l10n('unit mode'),
     283    ),
     284  );
     285
     286$tab_codes = array_map(
     287  create_function('$a', 'return $a["code"];'),
     288  $tabs
     289  );
     290
     291if (isset($_GET['mode']) and in_array($_GET['mode'], $tab_codes))
     292{
     293  $page['tab'] = $_GET['mode'];
     294}
     295else
     296{
     297  $page['tab'] = $tabs[0]['code'];
     298}
     299
     300$tabsheet = new tabsheet();
     301foreach ($tabs as $tab)
     302{
     303  $tabsheet->add(
     304    $tab['code'],
     305    $tab['label'],
     306    get_root_url().'admin.php?page='.$_GET['page'].'&mode='.$tab['code']
     307    );
     308}
     309$tabsheet->select($page['tab']);
     310$tabsheet->assign();
     311
     312// +-----------------------------------------------------------------------+
    271313// |                         open specific mode                            |
    272314// +-----------------------------------------------------------------------+
    273315
    274 $_GET['mode'] = !empty($_GET['mode']) ? $_GET['mode'] : 'global';
    275 
    276 switch ($_GET['mode'])
    277 {
    278   case 'global' :
    279   {
    280     include(dirname(__FILE__).'/batch_manager_global.php');
    281     break;
    282   }
    283   case 'unit' :
    284   {
    285     include(PHPWG_ROOT_PATH.'admin/element_set_unit.php');
    286     break;
    287   }
    288 }
     316include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php');
    289317?>
  • trunk/admin/batch_manager_global.php

    r8408 r8413  
    315315  array(
    316316    'filter' => $_SESSION['bulk_manager_filter'],
    317    
    318317    'selection' => $collection,
    319    
    320318    'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')),
    321 
    322     'U_UNIT_MODE'
    323     =>
    324     $base_url
    325     .get_query_string_diff(array('mode','display'))
    326     .'&mode=unit',
    327 
    328319    'F_ACTION'=>$base_url.get_query_string_diff(array('cat')),
    329320   )
  • trunk/admin/themes/default/template/batch_manager_global.tpl

    r8408 r8413  
    330330{/literal}
    331331
    332   <p style="float:left; font-size:90%;margin:5px 0 0 0;padding:0;">
    333     <a href="{$U_UNIT_MODE}">Switch to unit mode</a>
    334   </p>
    335 
    336332<h2>{'Batch Manager'|@translate}</h2>
    337333
  • trunk/admin/themes/default/template/batch_manager_unit.tpl

    r8393 r8413  
    2929{/literal}{/footer_script}
    3030
    31 <h2>{'Batch management'|@translate}</h2>
    32 
    33 <h3>{$CATEGORIES_NAV}</h3>
    34 
    35 <p style="text-align:center;">
    36   <a href="{$U_GLOBAL_MODE}">{'global mode'|@translate}</a>
    37   | {'unit mode'|@translate}
    38 </p>
     31<h2>{'Batch Manager'|@translate}</h2>
    3932
    4033<form action="{$F_ACTION}" method="POST">
Note: See TracChangeset for help on using the changeset viewer.