Changes in [3088:5e6b3da2b372:3087:b739d0de9983]
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
.hgtags
r3083 r2959 25 25 c45489df2bde825c7ed9c756e00444b54caf8e10 2.7.3 26 26 27e258e592e45b56a803038279adb6faa5865265 2.7.4 27 5e377b0f479e0f45cf199b24c3f997449a6f5a8a 2.8.0 -
inc/admin/class.dc.favorites.php
r3075 r2725 315 315 true, 316 316 $v['id'], 317 $v['class'], 318 true 317 $v['class'] 319 318 ); 320 319 } -
inc/admin/class.dc.menu.php
r3075 r2566 22 22 $this->title = $title; 23 23 $this->itemSpace = $itemSpace; 24 $this->pinned = array();25 24 $this->items = array(); 26 25 } 27 26 28 public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null ,$pinned=false)27 public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 29 28 { 30 29 if($show) { 31 $item = $this->itemDef($title,$url,$img,$active,$id,$class); 32 if ($pinned) { 33 $this->pinned[] = $item; 34 } else { 35 $this->items[$title] = $item; 36 } 30 $this->items[] = $this->itemDef($title,$url,$img,$active,$id,$class); 37 31 } 38 32 } 39 33 40 public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null ,$pinned=false)34 public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 41 35 { 42 36 if ($show) { 43 $item = $this->itemDef($title,$url,$img,$active,$id,$class); 44 if ($pinned) { 45 array_unshift($this->pinned,$item); 46 } else { 47 $this->items[$title] = $item; 48 } 37 array_unshift($this->items,$this->itemDef($title,$url,$img,$active,$id,$class)); 49 38 } 50 39 } … … 52 41 public function draw() 53 42 { 54 if (count($this->items) + count($this->pinned)== 0) {43 if (count($this->items) == 0) { 55 44 return ''; 56 45 } … … 61 50 '<ul>'."\n"; 62 51 63 // 1. Display pinned items (unsorted) 64 for ($i=0; $i<count($this->pinned); $i++) 52 for ($i=0; $i<count($this->items); $i++) 65 53 { 66 if ($i+1 < count($this-> pinned) && $this->itemSpace != '') {67 $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this-> pinned[$i]);54 if ($i+1 < count($this->items) && $this->itemSpace != '') { 55 $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->items[$i]); 68 56 $res .= "\n"; 69 57 } else { 70 $res .= $this-> pinned[$i]."\n";58 $res .= $this->items[$i]."\n"; 71 59 } 72 }73 74 // 2. Display unpinned itmes (sorted)75 $i = 0;76 dcUtils::lexicalKeySort($this->items);77 foreach ($this->items as $title => $item)78 {79 if ($i+1 < count($this->items) && $this->itemSpace != '') {80 $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$item);81 $res .= "\n";82 } else {83 $res .= $item."\n";84 }85 $i++;86 60 } 87 61 -
inc/admin/lib.admincombos.php
r3082 r3011 37 37 while ($categories->fetch()) { 38 38 $categories_combo[] = new formSelectOption ( 39 39 str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 40 40 ($use_url ? $categories->cat_url : $categories->cat_id), 41 41 ($categories->level-1 ? 'sub-option'.($categories->level-1) : '') … … 152 152 $editors_combo[$v] = $v; 153 153 } 154 154 155 155 return $editors_combo; 156 156 } -
inc/admin/lib.dc.page.php
r3086 r3080 177 177 } 178 178 179 // Display breadcrumb (if given) before any error message s179 // Display breadcrumb (if given) before any error message 180 180 echo $breadcrumb; 181 181 182 // Display notices and errors 183 echo self::notices(); 184 } 185 186 public static function notices() 187 { 188 global $core; 189 static $error_displayed = false; 190 $res = ''; 191 192 // return error messages if any 193 if ($core->error->flag() && !$error_displayed) { 194 $res .= '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 182 if ($core->error->flag()) { 183 echo 184 '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 195 185 $core->error->toHTML(). 196 186 '</div>'; 197 $error_displayed = true; 198 } 199 187 } 188 189 // Display notices 190 echo self::notices(); 191 } 192 193 public static function notices() 194 { 200 195 // return notices if any 196 $res = ''; 201 197 if (isset($_SESSION['notifications'])) { 198 $notifications = $_SESSION['notifications']; 202 199 foreach ($_SESSION['notifications'] as $notification) { 203 200 $res .= self::getNotification($notification); … … 369 366 echo $breadcrumb; 370 367 371 // Display notices and errors 372 echo self::notices(); 368 if ($core->error->flag()) { 369 echo 370 '<div class="error" role="alert"><strong>'.__('Errors:').'</strong>'. 371 $core->error->toHTML(). 372 '</div>'; 373 } 373 374 } 374 375 … … 544 545 } 545 546 546 public static function cssLoad($src, $media='screen',$v='')547 public static function cssLoad($src, $media='screen') 547 548 { 548 549 $escaped_src = html::escapeHTML($src); 549 550 if (!isset(self::$loaded_css[$escaped_src])) { 550 551 self::$loaded_css[$escaped_src] = true; 551 $escaped_src = self::appendVersion($escaped_src ,$v);552 $escaped_src = self::appendVersion($escaped_src); 552 553 553 554 return '<link rel="stylesheet" href="'.$escaped_src.'" type="text/css" media="'.$media.'" />'."\n"; … … 555 556 } 556 557 557 public static function jsLoad($src ,$v='')558 public static function jsLoad($src) 558 559 { 559 560 $escaped_src = html::escapeHTML($src); 560 561 if (!isset(self::$loaded_js[$escaped_src])) { 561 562 self::$loaded_js[$escaped_src] = true; 562 $escaped_src = self::appendVersion($escaped_src ,$v);563 $escaped_src = self::appendVersion($escaped_src); 563 564 return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; 564 565 } 565 566 } 566 567 567 private static function appendVersion($src,$v='') 568 { 569 $src .= (strpos($src,'?') === false ? '?' : '&').'v='; 568 private static function appendVersion($src) 569 { 570 if (strpos($src,'?')===false) { 571 $src .= '?v='; 572 } else { 573 $src .= '&v='; 574 } 575 570 576 if (defined('DC_DEV') && DC_DEV === true) { 571 577 $src .= md5(uniqid()); 572 578 } else { 573 $src .= ($v === '' ? DC_VERSION : $v); 574 } 579 $src .= DC_VERSION; 580 } 581 575 582 return $src; 576 583 } -
inc/admin/prepend.php
r3075 r3059 69 69 70 70 $url = $core->adminurl->get($adminurl); 71 $_menu[$section]->prependItem($desc,$url,$icon, 72 preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm,null,null,true); 71 $_menu[$section]->prependItem($desc,$url,$icon,preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm); 73 72 } 74 73 -
inc/core/class.dc.error.php
r3074 r2566 30 30 /** @var string HTML error item pattern */ 31 31 protected $html_item = "<li>%s</li>\n"; 32 33 /** 34 * Object constructor. 35 */ 36 public function __construct() 37 { 38 $this->code = 0; 39 $this->msg = ''; 40 } 32 41 33 42 /** -
inc/prepend.php
r3081 r3079 140 140 # Constants 141 141 define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 142 define('DC_VERSION','2. 9-dev');142 define('DC_VERSION','2.8.1'); 143 143 define('DC_DIGESTS',dirname(__FILE__).'/digests'); 144 144 define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); -
plugins/maintenance/index.php
r3073 r2849 158 158 html::escapeHTML($task->name())=> '' 159 159 ) 160 ) .dcPage::notices();160 ); 161 161 162 162 // content … … 193 193 __('Maintenance') => '' 194 194 ) 195 ) .dcPage::notices();195 ); 196 196 197 197 // Simple task (with only a button to start it)
Note: See TracChangeset
for help on using the changeset viewer.