Dotclear


Ignore:
Timestamp:
05/02/11 13:50:51 (14 years ago)
Author:
xpla@…
Branch:
userprefs
Message:

Bugfix for userprefs load.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/prepend.php

    r85 r106  
    292292          $core->auth->isSuperAdmin() || 
    293293          $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->blog_count > 1); 
    294  
    295      try { 
    296           // Set favorites menu 
    297           $ws = $core->auth->user_prefs->addWorkspace('favorites'); 
    298           $count = 0; 
    299           foreach ($ws->dumpPrefs() as $k => $v) { 
    300                // User favorites only 
    301                if (!$v['global']) { 
    302                     $count++; 
    303                     $fav = unserialize($v['value']); 
    304                     $_menu['Favorites']->addItem($fav['title'],$fav['url'],$fav['small-icon'], 
    305                          preg_match('/'.$fav['url'].'(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    306                          (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)),$fav['id'],$fav['class']); 
    307                } 
    308           }     
    309           if (!$count) { 
    310                // Global favorites if any 
    311                foreach ($ws->dumpPrefs() as $k => $v) { 
    312                     $count++; 
    313                     $fav = unserialize($v['value']); 
    314                     $_menu['Favorites']->addItem($fav['title'],$fav['url'],$fav['small-icon'], 
    315                          preg_match('/'.$fav['url'].'(\?.*)?$/',$_SERVER['REQUEST_URI']), 
    316                          (($fav['permissions'] == '*') || $core->auth->check($fav['permissions'],$core->blog->id)),$fav['id'],$fav['class']); 
    317                } 
    318           } 
    319           if (!$count) { 
    320                // No user or global favorites, add "new entry" fav 
    321                $_menu['Favorites']->addItem(__('New entry'),'post.php','images/menu/edit.png', 
    322                     preg_match('/post.php$/',$_SERVER['REQUEST_URI']), 
    323                     $core->auth->check('usage,contentadmin',$core->blog->id),'menu-new-post',null); 
    324           } 
    325      } catch (Exception $e) { 
    326           $version = $core->getVersion('core'); 
    327           if (version_compare($version,'2.3','<')) { 
    328                ;    // Ignore lack of dc_pref table before the logout following an auto-update 
    329           } else { 
    330                $core->error->add($e->getMessage()); 
    331           } 
    332      } 
    333 } 
     294     } 
    334295?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map