Changeset 22253 for extensions/bmp_description/initadmin.php
- Timestamp:
- Apr 17, 2013, 1:34:12 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/bmp_description/initadmin.php
r22247 r22253 10 10 11 11 function BMPD_add_batch_manager_prefilters($prefilters) 12 { 12 {load_language('plugin.lang', BMPD_PATH); 13 13 array_push($prefilters, array( 14 14 'ID' => 'BMPD', 15 'NAME' => l10n('With outdescription'),15 'NAME' => l10n('With no description'), 16 16 )); 17 17 return $prefilters; … … 60 60 } 61 61 62 63 add_event_handler('loc_end_element_set_global', 'BMPD_loc_end_element_set_global'); 64 add_event_handler('element_set_global_action', 'BMPD_element_set_global_action', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 65 66 function BMPD_loc_end_element_set_global() 67 { 68 global $template; 69 70 $template->append('element_set_global_plugins_actions', array( 71 'ID' => 'BMPD3', 72 'NAME' => l10n('Set description'), 73 'CONTENT' => ' 74 <input type="checkbox" name="check_BMPD4"> '.l10n('remove description').'<br> 75 <textarea rows="5" cols="50" class="description" name="BMPD3" id="BMPD3">'.l10n('Type here the description').'</textarea> 76 <input type="checkbox" name="check_BMPD"> '.l10n('confirm').' 77 ', 78 )); 79 } 80 81 function BMPD_element_set_global_action($action, $collection) 82 { 83 if ($action == 'BMPD3') 84 { 85 global $page; 86 87 if (empty($_POST['check_BMPD'])) 88 { 89 array_push($page['warnings'], l10n('You need to confirm')); 90 } 91 else 92 { 93 94 if (isset($_POST['check_BMPD4'])) 95 { 96 $_POST['BMPD3'] = null; 97 } 98 99 $datas = array(); 100 foreach ($collection as $image_id) 101 { 102 array_push( 103 $datas, 104 array( 105 'id' => $image_id, 106 'comment' => $_POST['BMPD3'] 107 ) 108 ); 109 } 110 111 mass_updates( 112 IMAGES_TABLE, 113 array('primary' => array('id'), 'update' => array('comment')), 114 $datas 115 ); 116 117 } 118 } 119 } 120 62 121 ?>
Note: See TracChangeset
for help on using the changeset viewer.