Changeset 8422 for trunk/admin/batch_manager_global.php
- Timestamp:
- Jan 1, 2011, 3:35:52 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager_global.php
r8417 r8422 65 65 // +-----------------------------------------------------------------------+ 66 66 67 // $page['prefilter'] is a shortcut to test if the current filter contains a 68 // given prefilter. The idea is to make conditions simpler to write in the 69 // code. 70 $page['prefilter'] = 'none'; 71 if (isset($_SESSION['bulk_manager_filter']['prefilter'])) 72 { 73 $page['prefilter'] = $_SESSION['bulk_manager_filter']['prefilter']; 74 } 75 76 // $page['category'] is a shortcut to test if the current filter contains a 77 // given category. The idea is the same as for prefilter 78 $page['category'] = -1; 79 if (isset($_SESSION['bulk_manager_filter']['category'])) 80 { 81 $page['category'] = $_SESSION['bulk_manager_filter']['category']; 82 } 83 84 $redirect_url = get_root_url().'admin.php?page='.$_GET['page']; 85 67 86 if (isset($_POST['submit'])) 68 87 { … … 86 105 pwg_query($query); 87 106 107 if ('caddie' == $page['prefilter']) 108 { 109 redirect($redirect_url); 110 } 111 88 112 // if we are here in the code, it means that the user is currently 89 113 // displaying the caddie content, so we have to remove the current … … 96 120 $tag_ids = get_fckb_tag_ids($_POST['add_tags']); 97 121 add_tags($tag_ids, $collection); 122 123 if ('with no tag' == $page['prefilter']) 124 { 125 redirect(get_root_url().'admin.php?page='.$_GET['page']); 126 } 98 127 } 99 128 … … 126 155 127 156 // let's refresh the page because we the current set might be modified 128 $redirect_url = get_root_url().'admin.php?page='.$_GET['page']; 129 redirect($redirect_url); 157 if ('with no album' == $page['prefilter']) 158 { 159 redirect($redirect_url); 160 } 161 162 if ('with no virtual album' == $page['prefilter']) 163 { 164 $category_info = get_cat_info($_POST['associate']); 165 if (empty($category_info['dir'])) 166 { 167 redirect($redirect_url); 168 } 169 } 130 170 } 131 171 … … 164 204 165 205 // let's refresh the page because we the current set might be modified 166 $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];167 206 redirect($redirect_url); 168 207 } … … 262 301 $datas 263 302 ); 303 304 if (isset($_SESSION['bulk_manager_filter']['level'])) 305 { 306 if ($_POST['level'] < $_SESSION['bulk_manager_filter']['level']) 307 { 308 redirect($redirect_url); 309 } 310 } 264 311 } 265 312 … … 301 348 array_push($page['errors'], l10n('You need to confirm deletion')); 302 349 } 350 } 351 352 // synchronize metadata 353 if ('metadata' == $action) 354 { 355 $query = ' 356 SELECT id, path 357 FROM '.IMAGES_TABLE.' 358 WHERE id IN ('.implode(',', $collection).') 359 ;'; 360 $id_to_path = array(); 361 $result = pwg_query($query); 362 while ($row = pwg_db_fetch_assoc($result)) 363 { 364 $id_to_path[$row['id']] = $row['path']; 365 } 366 367 update_metadata($id_to_path); 368 369 array_push( 370 $page['infos'], 371 l10n('Metadata synchronized from file') 372 ); 303 373 } 304 374 } … … 478 548 ); 479 549 550 // metadata 551 include_once( PHPWG_ROOT_PATH.'admin/site_reader_local.php'); 552 $site_reader = new LocalSiteReader('./'); 553 $used_metadata = implode( ', ', $site_reader->get_metadata_attributes()); 554 555 $template->assign( 556 array( 557 'used_metadata' => $used_metadata, 558 ) 559 ); 560 480 561 // +-----------------------------------------------------------------------+ 481 562 // | global mode thumbnails |
Note: See TracChangeset
for help on using the changeset viewer.