Dotclear


Ignore:
Timestamp:
05/04/11 13:26:40 (13 years ago)
Author:
xave <xave@…>
Branch:
userprefs
Message:

Back where we started!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/index.php

    r130 r139  
    4444 
    4545# Check dashboard module prefs 
    46 $core->auth->user_prefs->loadPrefs(); 
    47       
    48      // Set favorites menu 
    49      $ws = $core->auth->user_prefs->addWorkspace('favorites'); 
    50      $count = 0; 
    51      foreach ($ws->dumpPrefs() as $k => $v) { 
    52           // User favorites only 
    53           if (!$v['global']) { 
    54                $count++; 
    55                $fav = unserialize($v['value']); 
    56                $_menu['Favorites']->addItem($fav['title'],$fav['url'],$fav['small-icon'], 
    57                     preg_match('/'.$fav['url'].'(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    58                     (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)),$fav['id'],$fav['class']); 
    59           } 
    60      }     
    61      if (!$count) { 
    62           // Global favorites if any 
    63           foreach ($ws->dumpPrefs() as $k => $v) { 
    64                $count++; 
    65                $fav = unserialize($v['value']); 
    66                $_menu['Favorites']->addItem($fav['title'],$fav['url'],$fav['small-icon'], 
    67                     preg_match('/'.$fav['url'].'(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    68                     (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)),$fav['id'],$fav['class']); 
    69           } 
    70      } 
    71      if (!$count) { 
    72           // No user or global favorites, add "new entry" fav 
    73           $_menu['Favorites']->addItem(__('New entry'),'post.php','images/menu/edit.png', 
    74                preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 
    75                $core->auth->check('usage,contentadmin',$core->blog->id),'menu-new-post',null); 
    76      } 
    7746$core->auth->user_prefs->addWorkspace('dashboard'); 
    7847if (!$core->auth->user_prefs->dashboard->prefExists('doclinks')) { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map