Changeset 28087
- Timestamp:
- Apr 5, 2014, 9:24:27 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/batch_manager.php
r26461 r28087 86 86 { 87 87 $_SESSION['bulk_manager_filter']['level'] = $_POST['filter_level']; 88 88 89 89 if (isset($_POST['filter_level_include_lower'])) 90 90 { … … 93 93 } 94 94 } 95 95 96 96 if (isset($_POST['filter_dimension_use'])) 97 97 { … … 111 111 } 112 112 } 113 114 if (isset($_POST['filter_search_use'])) 115 { 116 $_SESSION['bulk_manager_filter']['search']['q'] = $_POST['q']; 117 } 113 118 } 114 119 // filters from url 115 else 120 elseif (isset($_GET['filter'])) 116 121 { 117 122 if (!is_array($_GET['filter'])) … … 119 124 $_GET['filter'] = explode(',', $_GET['filter']); 120 125 } 121 126 122 127 $_SESSION['bulk_manager_filter'] = array(); 123 128 124 129 foreach ($_GET['filter'] as $filter) 125 130 { 126 131 list($type, $value) = explode('-', $filter); 127 132 128 133 switch ($type) 129 134 { … … 131 136 $_SESSION['bulk_manager_filter']['prefilter'] = $value; 132 137 break; 133 138 134 139 case 'album': 135 140 if (is_numeric($value)) … … 138 143 } 139 144 break; 140 145 141 146 case 'tag': 142 147 if (is_numeric($value)) … … 146 151 } 147 152 break; 148 153 149 154 case 'level': 150 155 if (is_numeric($value) && in_array($value, $conf['available_permission_levels'])) … … 179 184 ;'; 180 185 $filter_sets[] = array_from_query($query, 'element_id'); 181 186 182 187 break; 183 188 … … 189 194 ;'; 190 195 $filter_sets[] = array_from_query($query, 'image_id'); 191 196 192 197 break; 193 198 … … 207 212 $filter_sets[] = array_from_query($query, 'id'); 208 213 } 209 214 210 215 break; 211 216 … … 235 240 236 241 $filter_sets[] = array_diff($all_elements, $linked_to_virtual); 237 242 238 243 break; 239 244 … … 247 252 ;'; 248 253 $filter_sets[] = array_from_query($query, 'id'); 249 254 250 255 break; 251 256 … … 259 264 ;'; 260 265 $filter_sets[] = array_from_query($query, 'id'); 261 266 262 267 break; 263 268 … … 281 286 ;'; 282 287 $filter_sets[] = array_from_query($query, 'id'); 283 288 284 289 break; 285 290 … … 291 296 292 297 $filter_sets[] = array_from_query($query, 'id'); 293 298 294 299 break; 295 300 } … … 326 331 $operator = '<='; 327 332 } 328 333 329 334 $query = ' 330 335 SELECT id … … 375 380 $where_clause[] = 'width/height < '.($_SESSION['bulk_manager_filter']['dimension']['max_ratio']+0.01); 376 381 } 377 382 378 383 $query = ' 379 384 SELECT id … … 383 388 384 389 $filter_sets[] = array_from_query($query, 'id'); 390 } 391 392 if (isset($_SESSION['bulk_manager_filter']['search'])) 393 { 394 include_once( PHPWG_ROOT_PATH .'include/functions_search.inc.php' ); 395 $res = get_quick_search_results($_SESSION['bulk_manager_filter']['search']['q'], array('permissions'=>false)); 396 $filter_sets[] = $res['items']; 385 397 } 386 398 -
trunk/admin/batch_manager_global.php
r26461 r28087 87 87 88 88 $action = $_POST['selectAction']; 89 89 90 90 if ('remove_from_caddie' == $action) 91 91 { … … 148 148 l10n('Information data registered in database') 149 149 ); 150 150 151 151 // let's refresh the page because we the current set might be modified 152 152 if ('no_album' == $page['prefilter']) … … 172 172 l10n('Information data registered in database') 173 173 ); 174 174 175 175 // let's refresh the page because we the current set might be modified 176 176 if ('no_album' == $page['prefilter']) … … 225 225 l10n('Information data registered in database') 226 226 ); 227 227 228 228 // let's refresh the page because the current set might be modified 229 229 redirect($redirect_url); … … 238 238 $_POST['author'] = null; 239 239 } 240 240 241 241 $datas = array(); 242 242 foreach ($collection as $image_id) … … 262 262 $_POST['title'] = null; 263 263 } 264 264 265 265 $datas = array(); 266 266 foreach ($collection as $image_id) … … 278 278 ); 279 279 } 280 280 281 281 // date_creation 282 282 if ('date_creation' == $action) … … 309 309 ); 310 310 } 311 311 312 312 // privacy_level 313 313 if ('level' == $action) … … 336 336 } 337 337 } 338 338 339 339 // add_to_caddie 340 340 if ('add_to_caddie' == $action) … … 342 342 fill_caddie($collection); 343 343 } 344 344 345 345 // delete 346 346 if ('delete' == $action) … … 665 665 SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation 666 666 FROM '.IMAGES_TABLE; 667 667 668 668 if ($is_category) 669 669 { 670 670 $category_info = get_cat_info($_SESSION['bulk_manager_filter']['category']); 671 671 672 672 $conf['order_by'] = $conf['order_by_inside_category']; 673 673 if (!empty($category_info['image_order'])) -
trunk/admin/themes/default/template/batch_manager_global.tpl
r26179 r28087 666 666 <input type="hidden" name="filter_dimension_max_ratio" value="{$dimensions.selected.max_ratio}"> 667 667 </li> 668 669 <li id="filter_search"{if !isset($filter.search)} style="display:none"{/if}> 670 <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> 671 <input type="checkbox" name="filter_search_use" class="useFilterCheckbox"{if isset($filter.search)} checked="checked"{/if}> 672 {'Search'|@translate} 673 <input name="q" size=40 value="{$filter.search.q|stripslashes|htmlspecialchars}"> 674 {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} 675 <a href="admin/popuphelp.php?page=quick_search"onclick="popuphelp(this.href);return false;" title="{'Help'|@translate}"><span class="icon-help-circled"></span></a> 676 </li> 668 677 </ul> 669 678 … … 677 686 <option value="filter_level" {if isset($filter.level)}disabled="disabled"{/if}>{'Privacy level'|@translate}</option> 678 687 <option value="filter_dimension" {if isset($filter.dimension)}disabled="disabled"{/if}>{'Dimensions'|@translate}</option> 688 <option value="filter_search"{if isset($filter.search)} disabled="disabled"{/if}>{'Search'|@translate}</option> 679 689 </select> 680 690 <a id="removeFilters" href="">{'Remove all filters'|@translate}</a> -
trunk/include/functions_search.inc.php
r28080 r28087 1194 1194 * @return array 1195 1195 */ 1196 function get_quick_search_results($q, $ super_order_by, $images_where='')1196 function get_quick_search_results($q, $options) 1197 1197 { 1198 1198 global $conf; … … 1255 1255 } 1256 1256 1257 $permissions = !isset($options['permissions']) ? true : $options['permissions']; 1258 1257 1259 $where_clauses = array(); 1258 1260 $where_clauses[]='i.id IN ('. implode(',', $ids) . ')'; 1259 if (!empty($ images_where))1261 if (!empty($options['images_where')) 1260 1262 { 1261 1263 $where_clauses[]='('.$images_where.')'; 1262 1264 } 1263 $where_clauses[] = get_sql_condition_FandF( 1264 array 1265 ( 1266 'forbidden_categories' => 'category_id', 1267 'visible_categories' => 'category_id', 1268 'visible_images' => 'i.id' 1269 ), 1270 null,true 1271 ); 1265 if ($permissions) 1266 { 1267 $where_clauses[] = get_sql_condition_FandF( 1268 array 1269 ( 1270 'forbidden_categories' => 'category_id', 1271 'visible_categories' => 'category_id', 1272 'visible_images' => 'i.id' 1273 ), 1274 null,true 1275 ); 1276 } 1272 1277 1273 1278 $query = ' 1274 SELECT DISTINCT(id) 1275 FROM '.IMAGES_TABLE.' i 1276 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id 1279 SELECT DISTINCT(id) FROM '.IMAGES_TABLE.' i'; 1280 if ($permissions) 1281 { 1282 $query .= ' 1283 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id'; 1284 } 1285 $query .= ' 1277 1286 WHERE '.implode("\n AND ", $where_clauses)."\n". 1278 1287 $conf['order_by']; … … 1306 1315 else 1307 1316 { 1308 return get_quick_search_results($search['q'], $super_order_by, $images_where);1317 return get_quick_search_results($search['q'], array('super_order_by'=>$super_order_by, 'images_where'=>$images_where) ); 1309 1318 } 1310 1319 } -
trunk/include/ws_functions/pwg.images.php
r26461 r28087 295 295 * @option string key 296 296 */ 297 function ws_images_addComment($params, &$service)297 function ws_images_addComment($params, $service) 298 298 { 299 299 $query = ' … … 355 355 * @option int comments_per_page 356 356 */ 357 function ws_images_getInfo($params, &$service)357 function ws_images_getInfo($params, $service) 358 358 { 359 359 global $user, $conf; … … 580 580 * @option float rate 581 581 */ 582 function ws_images_rate($params, &$service)582 function ws_images_rate($params, $service) 583 583 { 584 584 $query = ' … … 621 621 * @option string order (optional) 622 622 */ 623 function ws_images_search($params, &$service)623 function ws_images_search($params, $service) 624 624 { 625 625 include_once(PHPWG_ROOT_PATH .'include/functions_search.inc.php'); … … 639 639 $search_result = get_quick_search_results( 640 640 $params['query'], 641 $super_order_by, 642 implode(' AND ', $where_clauses) 641 array( 642 'super_order_by' => $super_order_by, 643 'images_where' => implode(' AND ', $where_clauses) 644 ) 643 645 ); 644 646 … … 705 707 * @option int level 706 708 */ 707 function ws_images_setPrivacyLevel($params, &$service)709 function ws_images_setPrivacyLevel($params, $service) 708 710 { 709 711 global $conf; … … 738 740 * @option int rank 739 741 */ 740 function ws_images_setRank($params, &$service)742 function ws_images_setRank($params, $service) 741 743 { 742 744 // does the image really exist? … … 821 823 * @option int position 822 824 */ 823 function ws_images_add_chunk($params, &$service)825 function ws_images_add_chunk($params, $service) 824 826 { 825 827 global $conf; … … 878 880 * @option string sum 879 881 */ 880 function ws_images_addFile($params, &$service)882 function ws_images_addFile($params, $service) 881 883 { 882 884 ws_logfile(__FUNCTION__.', input : '.var_export($params, true)); … … 971 973 * @option int image_id (optional) 972 974 */ 973 function ws_images_add($params, &$service)975 function ws_images_add($params, $service) 974 976 { 975 977 global $conf, $user; … … 1134 1136 * @option int image_id (optional) 1135 1137 */ 1136 function ws_images_addSimple($params, &$service)1138 function ws_images_addSimple($params, $service) 1137 1139 { 1138 1140 global $conf; … … 1248 1250 * @option string filename_list (optional) 1249 1251 */ 1250 function ws_images_exist($params, &$service)1252 function ws_images_exist($params, $service) 1251 1253 { 1252 1254 ws_logfile(__FUNCTION__.' '.var_export($params, true)); … … 1321 1323 * @option string file_sum 1322 1324 */ 1323 function ws_images_checkFiles($params, &$service)1325 function ws_images_checkFiles($params, $service) 1324 1326 { 1325 1327 ws_logfile(__FUNCTION__.', input : '.var_export($params, true)); … … 1393 1395 * @option string multiple_value_mode 1394 1396 */ 1395 function ws_images_setInfo($params, &$service)1397 function ws_images_setInfo($params, $service) 1396 1398 { 1397 1399 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); … … 1529 1531 * @option string pwg_token 1530 1532 */ 1531 function ws_images_delete($params, &$service)1533 function ws_images_delete($params, $service) 1532 1534 { 1533 1535 if (get_pwg_token() != $params['pwg_token']) … … 1566 1568 * @param mixed[] $params 1567 1569 */ 1568 function ws_images_checkUpload($params, &$service)1570 function ws_images_checkUpload($params, $service) 1569 1571 { 1570 1572 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
Note: See TracChangeset
for help on using the changeset viewer.