Changeset 9068


Ignore:
Timestamp:
02/02/11 21:55:25 (9 years ago)
Author:
rvelices
Message:

allow to include batch_manager with a mode <> than global/unit (don't create tabsheet and dont include global/unit.php); used by rv_gmaps to batch edit lat/lon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager.php

    r8728 r9068  
    5151{ 
    5252  // echo '<pre>'; print_r($_POST); echo '</pre>'; 
    53    
     53 
    5454  $_SESSION['bulk_manager_filter'] = array(); 
    5555 
     
    6060    { 
    6161      $_SESSION['bulk_manager_filter']['prefilter'] = $_POST['filter_prefilter']; 
    62     }     
     62    } 
    6363  } 
    6464 
     
    162162 ;'; 
    163163    $all_elements = array_from_query($query, 'id'); 
    164   
     164 
    165165    $query = ' 
    166166 SELECT id 
     
    221221    // image_ids but it would not be compatible with PostgreSQL, so let's 
    222222    // perform 2 queries instead. We hope there are not too many duplicates. 
    223      
     223 
    224224    $query = ' 
    225225SELECT file 
     
    229229;'; 
    230230    $duplicate_files = array_from_query($query, 'file'); 
    231      
     231 
    232232    $query = ' 
    233233SELECT id 
     
    246246{ 
    247247  $categories = array(); 
    248    
     248 
    249249  if (isset($_SESSION['bulk_manager_filter']['category_recursive'])) 
    250250  { 
     
    255255    $categories = array($_SESSION['bulk_manager_filter']['category']); 
    256256  } 
    257    
     257 
    258258  $query = ' 
    259259 SELECT DISTINCT(image_id) 
     
    327327  ); 
    328328 
    329 if (isset($_GET['mode']) and in_array($_GET['mode'], $tab_codes)) 
     329if (isset($_GET['mode'])) 
    330330{ 
    331331  $page['tab'] = $_GET['mode']; 
     
    336336} 
    337337 
    338 $tabsheet = new tabsheet(); 
    339 foreach ($tabs as $tab) 
    340 { 
    341   $tabsheet->add( 
    342     $tab['code'], 
    343     $tab['label'], 
    344     get_root_url().'admin.php?page='.$_GET['page'].'&amp;mode='.$tab['code'] 
    345     ); 
    346 } 
    347 $tabsheet->select($page['tab']); 
    348 $tabsheet->assign(); 
     338if (in_array($page['tab'], $tab_codes)) 
     339{ 
     340  $tabsheet = new tabsheet(); 
     341  foreach ($tabs as $tab) 
     342  { 
     343    $tabsheet->add( 
     344      $tab['code'], 
     345      $tab['label'], 
     346      get_root_url().'admin.php?page='.$_GET['page'].'&amp;mode='.$tab['code'] 
     347      ); 
     348  } 
     349  $tabsheet->select($page['tab']); 
     350  $tabsheet->assign(); 
    349351 
    350352// +-----------------------------------------------------------------------+ 
     
    352354// +-----------------------------------------------------------------------+ 
    353355 
    354 include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php'); 
     356  include(PHPWG_ROOT_PATH.'admin/batch_manager_'.$page['tab'].'.php'); 
     357} 
    355358?> 
Note: See TracChangeset for help on using the changeset viewer.