Dotclear


Ignore:
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • .hgtags

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

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

    r2566 r3075  
    2222          $this->title = $title; 
    2323          $this->itemSpace = $itemSpace; 
     24          $this->pinned = array(); 
    2425          $this->items = array(); 
    2526     } 
    2627 
    27      public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 
     28     public function addItem($title,$url,$img,$active,$show=true,$id=null,$class=null,$pinned=false) 
    2829     { 
    2930          if($show) { 
    30                $this->items[] = $this->itemDef($title,$url,$img,$active,$id,$class); 
     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               } 
    3137          } 
    3238     } 
    3339 
    34      public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null) 
     40     public function prependItem($title,$url,$img,$active,$show=true,$id=null,$class=null,$pinned=false) 
    3541     { 
    3642          if ($show) { 
    37                array_unshift($this->items,$this->itemDef($title,$url,$img,$active,$id,$class)); 
     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               } 
    3849          } 
    3950     } 
     
    4152     public function draw() 
    4253     { 
    43           if (count($this->items) == 0) { 
     54          if (count($this->items) + count($this->pinned) == 0) { 
    4455               return ''; 
    4556          } 
     
    5061          '<ul>'."\n"; 
    5162 
    52           for ($i=0; $i<count($this->items); $i++) 
     63          // 1. Display pinned items (unsorted) 
     64          for ($i=0; $i<count($this->pinned); $i++) 
     65          { 
     66               if ($i+1 < count($this->pinned) && $this->itemSpace != '') { 
     67                    $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->pinned[$i]); 
     68                    $res .= "\n"; 
     69               } else { 
     70                    $res .= $this->pinned[$i]."\n"; 
     71               } 
     72          } 
     73 
     74          // 2. Display unpinned itmes (sorted) 
     75          $i = 0; 
     76          dcUtils::lexicalKeySort($this->items); 
     77          foreach ($this->items as $title => $item) 
    5378          { 
    5479               if ($i+1 < count($this->items) && $this->itemSpace != '') { 
    55                     $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->items[$i]); 
     80                    $res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$item); 
    5681                    $res .= "\n"; 
    5782               } else { 
    58                     $res .= $this->items[$i]."\n"; 
     83                    $res .= $item."\n"; 
    5984               } 
     85               $i++; 
    6086          } 
    6187 
  • inc/admin/lib.admincombos.php

    r3011 r3082  
    3737          while ($categories->fetch()) { 
    3838               $categories_combo[] = new formSelectOption ( 
    39                     str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title).' ('.$categories->nb_post.')', 
     39                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

    r3080 r3086  
    177177          } 
    178178 
    179           // Display breadcrumb (if given) before any error message 
     179          // Display breadcrumb (if given) before any error messages 
    180180          echo $breadcrumb; 
    181181 
    182           if ($core->error->flag()) { 
    183                echo 
    184                '<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</strong></p>'. 
     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>'. 
    185195               $core->error->toHTML(). 
    186196               '</div>'; 
    187           } 
    188  
    189           // Display notices 
    190           echo self::notices(); 
    191      } 
    192  
    193      public static function notices() 
    194      { 
     197               $error_displayed = true; 
     198          } 
     199 
    195200          // return notices if any 
    196           $res = ''; 
    197201          if (isset($_SESSION['notifications'])) { 
    198                $notifications = $_SESSION['notifications']; 
    199202               foreach ($_SESSION['notifications'] as $notification) { 
    200203                    $res .= self::getNotification($notification); 
     
    366369          echo $breadcrumb; 
    367370 
    368           if ($core->error->flag()) { 
    369                echo 
    370                '<div class="error" role="alert"><strong>'.__('Errors:').'</strong>'. 
    371                $core->error->toHTML(). 
    372                '</div>'; 
    373           } 
     371          // Display notices and errors 
     372          echo self::notices(); 
    374373     } 
    375374 
     
    545544     } 
    546545 
    547      public static function cssLoad($src, $media='screen') 
     546     public static function cssLoad($src,$media='screen',$v='') 
    548547     { 
    549548          $escaped_src = html::escapeHTML($src); 
    550549          if (!isset(self::$loaded_css[$escaped_src])) { 
    551550               self::$loaded_css[$escaped_src] = true; 
    552                $escaped_src = self::appendVersion($escaped_src); 
     551               $escaped_src = self::appendVersion($escaped_src,$v); 
    553552 
    554553               return '<link rel="stylesheet" href="'.$escaped_src.'" type="text/css" media="'.$media.'" />'."\n"; 
     
    556555     } 
    557556 
    558      public static function jsLoad($src) 
     557     public static function jsLoad($src,$v='') 
    559558     { 
    560559          $escaped_src = html::escapeHTML($src); 
    561560          if (!isset(self::$loaded_js[$escaped_src])) { 
    562561               self::$loaded_js[$escaped_src] = true; 
    563                $escaped_src = self::appendVersion($escaped_src); 
     562               $escaped_src = self::appendVersion($escaped_src,$v); 
    564563               return '<script type="text/javascript" src="'.$escaped_src.'"></script>'."\n"; 
    565564          } 
    566565     } 
    567566 
    568      private static function appendVersion($src) 
    569      { 
    570           if (strpos($src,'?')===false) { 
    571                $src .= '?v='; 
    572           } else { 
    573                $src .= '&v='; 
    574           } 
    575  
     567     private static function appendVersion($src,$v='') 
     568     { 
     569          $src .= (strpos($src,'?') === false ? '?' : '&').'v='; 
    576570          if (defined('DC_DEV') && DC_DEV === true) { 
    577571               $src .= md5(uniqid()); 
    578572          } else { 
    579                $src .= DC_VERSION; 
    580           } 
    581  
     573               $src .= ($v === '' ? DC_VERSION : $v); 
     574          } 
    582575          return $src; 
    583576     } 
  • inc/admin/prepend.php

    r3059 r3075  
    6969 
    7070     $url = $core->adminurl->get($adminurl); 
    71      $_menu[$section]->prependItem($desc,$url,$icon,preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm); 
     71     $_menu[$section]->prependItem($desc,$url,$icon, 
     72          preg_match('/'.preg_quote($url).'(\?.*)?$/',$_SERVER['REQUEST_URI']),$perm,null,null,true); 
    7273} 
    7374 
  • inc/core/class.dc.error.php

    r2566 r3074  
    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      } 
    4132 
    4233     /** 
  • inc/prepend.php

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

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

Sites map