Changeset 17302 for trunk/admin/configuration.php
- Timestamp:
- Aug 1, 2012, 9:03:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r16928 r17302 107 107 'privacy_level', 108 108 ); 109 109 110 110 // image order management 111 111 $sort_fields = array( … … 127 127 'rank ASC' => l10n('Manual sort order'), 128 128 ); 129 129 130 130 $comments_order = array( 131 131 'ASC' => l10n('Show oldest comments first'), … … 142 142 { 143 143 case 'main' : 144 { 144 { 145 145 if ( !isset($conf['order_by_custom']) and !isset($conf['order_by_inside_category_custom']) ) 146 146 { … … 159 159 // limit to the number of available parameters 160 160 $order_by = $order_by_inside_category = array_slice($_POST['order_by'], 0, ceil(count($sort_fields)/2)); 161 161 162 162 // there is no rank outside categories 163 163 if ( ($i = array_search('rank ASC', $order_by)) !== false) … … 165 165 unset($order_by[$i]); 166 166 } 167 167 168 168 // must define a default order_by if user want to order by rank only 169 169 if ( count($order_by) == 0 ) … … 171 171 $order_by = array('id ASC'); 172 172 } 173 173 174 174 $_POST['order_by'] = 'ORDER BY '.implode(', ', $order_by); 175 175 $_POST['order_by_inside_category'] = 'ORDER BY '.implode(', ', $order_by_inside_category); … … 181 181 } 182 182 } 183 183 184 184 foreach( $main_checkboxes as $checkbox) 185 185 { … … 190 190 case 'watermark' : 191 191 { 192 include(PHPWG_ROOT_PATH.'admin/include/configuration_watermark_process.inc.php'); 192 include(PHPWG_ROOT_PATH.'admin/include/configuration_watermark_process.inc.php'); 193 193 break; 194 194 } 195 195 case 'sizes' : 196 196 { 197 include(PHPWG_ROOT_PATH.'admin/include/configuration_sizes_process.inc.php'); 197 include(PHPWG_ROOT_PATH.'admin/include/configuration_sizes_process.inc.php'); 198 198 break; 199 199 } … … 303 303 { 304 304 case 'main' : 305 { 306 305 { 306 307 307 function order_by_is_local() 308 308 { … … 312 312 @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR. 'config/config.inc.php'); 313 313 } 314 314 315 315 return isset($conf['order_by']) or isset($conf['order_by_inside_category']); 316 316 } 317 317 318 318 if (order_by_is_local()) 319 319 { 320 320 array_push($page['warnings'], l10n('You have specified <i>$conf[\'order_by\']</i> in your local configuration file, this parameter in deprecated, please remove it or rename it into <i>$conf[\'order_by_custom\']</i> !')); 321 321 } 322 322 323 323 if ( isset($conf['order_by_custom']) or isset($conf['order_by_inside_category_custom']) ) 324 324 { … … 333 333 $order_by = explode(', ', $order_by); 334 334 } 335 335 336 336 $template->assign( 337 337 'main', … … 441 441 ) 442 442 ); 443 443 444 444 foreach ($sizes_checkboxes as $checkbox) 445 445 { … … 452 452 ); 453 453 } 454 454 455 455 // derivatives = multiple size 456 456 $enabled = ImageStdParams::get_defined_type_map(); … … 465 465 { 466 466 $tpl_var = array(); 467 467 468 468 $tpl_var['must_square'] = ($type==IMG_SQUARE ? true : false); 469 469 $tpl_var['must_enable'] = ($type==IMG_SQUARE || $type==IMG_THUMB)? true : false; 470 470 471 471 if ($params = @$enabled[$type]) 472 472 { … … 478 478 $params=@$disabled[$type]; 479 479 } 480 480 481 481 if ($params) 482 482 { … … 496 496 $template->assign('derivatives', $tpl_vars); 497 497 $template->assign('resize_quality', ImageStdParams::$quality); 498 499 $tpl_vars = array(); 500 $now = time(); 501 foreach(ImageStdParams::$custom as $custom=>$time) 502 { 503 $tpl_vars[$custom] = ($now-$time<=24*3600) ? l10n('today') : time_since($time, 'day'); 504 } 505 $template->assign('custom_derivatives', $tpl_vars); 498 506 } 499 507 … … 547 555 $position = 'bottomright'; 548 556 } 549 557 550 558 if ($wm->xrepeat != 0) 551 559 { 552 560 $position = 'custom'; 553 561 } 554 562 555 563 $template->assign( 556 564 'watermark', … … 567 575 ); 568 576 } 569 577 570 578 break; 571 579 }
Note: See TracChangeset
for help on using the changeset viewer.