Dotclear


Ignore:
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • .hgtags

    r3083 r2959  
    2525c45489df2bde825c7ed9c756e00444b54caf8e10 2.7.3 
    262627e258e592e45b56a803038279adb6faa5865265 2.7.4 
    27 5e377b0f479e0f45cf199b24c3f997449a6f5a8a 2.8.0 
  • inc/admin/class.dc.favorites.php

    r3075 r2725  
    315315                    true, 
    316316                    $v['id'], 
    317                     $v['class'], 
    318                     true 
     317                    $v['class'] 
    319318               ); 
    320319          } 
  • inc/admin/class.dc.menu.php

    r3075 r2566  
    2222          $this->title = $title; 
    2323          $this->itemSpace = $itemSpace; 
    24           $this->pinned = array(); 
    2524          $this->items = array(); 
    2625     } 
    2726 
    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) 
    2928     { 
    3029          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); 
    3731          } 
    3832     } 
    3933 
    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) 
    4135     { 
    4236          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)); 
    4938          } 
    5039     } 
     
    5241     public function draw() 
    5342     { 
    54           if (count($this->items) + count($this->pinned) == 0) { 
     43          if (count($this->items) == 0) { 
    5544               return ''; 
    5645          } 
     
    6150          '<ul>'."\n"; 
    6251 
    63           // 1. Display pinned items (unsorted) 
    64           for ($i=0; $i<count($this->pinned); $i++) 
     52          for ($i=0; $i<count($this->items); $i++) 
    6553          { 
    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]); 
    6856                    $res .= "\n"; 
    6957               } else { 
    70                     $res .= $this->pinned[$i]."\n"; 
     58                    $res .= $this->items[$i]."\n"; 
    7159               } 
    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++; 
    8660          } 
    8761 
  • inc/admin/lib.admincombos.php

    r3082 r3011  
    3737          while ($categories->fetch()) { 
    3838               $categories_combo[] = new formSelectOption ( 
    39                 html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 
     39                    str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 
    4040                    ($use_url ? $categories->cat_url : $categories->cat_id), 
    4141                    ($categories->level-1 ? 'sub-option'.($categories->level-1) : '') 
     
    152152               $editors_combo[$v] = $v; 
    153153          } 
    154  
     154           
    155155          return $editors_combo; 
    156156     } 
  • inc/admin/lib.dc.page.php

    r3086 r3080  
    177177          } 
    178178 
    179           // Display breadcrumb (if given) before any error messages 
     179          // Display breadcrumb (if given) before any error message 
    180180          echo $breadcrumb; 
    181181 
    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>'. 
    195185               $core->error->toHTML(). 
    196186               '</div>'; 
    197                $error_displayed = true; 
    198           } 
    199  
     187          } 
     188 
     189          // Display notices 
     190          echo self::notices(); 
     191     } 
     192 
     193     public static function notices() 
     194     { 
    200195          // return notices if any 
     196          $res = ''; 
    201197          if (isset($_SESSION['notifications'])) { 
     198               $notifications = $_SESSION['notifications']; 
    202199               foreach ($_SESSION['notifications'] as $notification) { 
    203200                    $res .= self::getNotification($notification); 
     
    369366          echo $breadcrumb; 
    370367 
    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          } 
    373374     } 
    374375 
     
    544545     } 
    545546 
    546      public static function cssLoad($src,$media='screen',$v='') 
     547     public static function cssLoad($src, $media='screen') 
    547548     { 
    548549          $escaped_src = html::escapeHTML($src); 
    549550          if (!isset(self::$loaded_css[$escaped_src])) { 
    550551               self::$loaded_css[$escaped_src] = true; 
    551                $escaped_src = self::appendVersion($escaped_src,$v); 
     552               $escaped_src = self::appendVersion($escaped_src); 
    552553 
    553554               return '<link rel="stylesheet" href="'.$escaped_src.'" type="text/css" media="'.$media.'" />'."\n"; 
     
    555556     } 
    556557 
    557      public static function jsLoad($src,$v='') 
     558     public static function jsLoad($src) 
    558559     { 
    559560          $escaped_src = html::escapeHTML($src); 
    560561          if (!isset(self::$loaded_js[$escaped_src])) { 
    561562               self::$loaded_js[$escaped_src] = true; 
    562                $escaped_src = self::appendVersion($escaped_src,$v); 
     563               $escaped_src = self::appendVersion($escaped_src); 
    563564               return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; 
    564565          } 
    565566     } 
    566567 
    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 
    570576          if (defined('DC_DEV') && DC_DEV === true) { 
    571577               $src .= md5(uniqid()); 
    572578          } else { 
    573                $src .= ($v === '' ? DC_VERSION : $v); 
    574           } 
     579               $src .= DC_VERSION; 
     580          } 
     581 
    575582          return $src; 
    576583     } 
  • inc/admin/prepend.php

    r3075 r3059  
    6969 
    7070     $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); 
    7372} 
    7473 
  • inc/core/class.dc.error.php

    r3074 r2566  
    3030     /** @var string HTML error item pattern */ 
    3131     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     } 
    3241 
    3342     /** 
  • inc/prepend.php

    r3081 r3079  
    140140# Constants 
    141141define('DC_ROOT',path::real(dirname(__FILE__).'/..')); 
    142 define('DC_VERSION','2.9-dev'); 
     142define('DC_VERSION','2.8.1'); 
    143143define('DC_DIGESTS',dirname(__FILE__).'/digests'); 
    144144define('DC_L10N_ROOT',dirname(__FILE__).'/../locales'); 
  • plugins/maintenance/index.php

    r3073 r2849  
    158158               html::escapeHTML($task->name())=> '' 
    159159          ) 
    160      ).dcPage::notices(); 
     160     ); 
    161161 
    162162     // content 
     
    193193               __('Maintenance') => '' 
    194194          ) 
    195      ).dcPage::notices(); 
     195     ); 
    196196 
    197197     // Simple task (with only a button to start it) 
Note: See TracChangeset for help on using the changeset viewer.

Sites map