Dotclear

Changeset 2159:d709a73eb75b for inc


Ignore:
Timestamp:
09/30/13 09:51:02 (12 years ago)
Author:
Nicolas <nikrou77@…>
Branch:
default
Message:

blog_count was only set when getPermissions was called.
Add a new method (getBlogCount()) that used blog_count param or retrieved it from database.
close 1545

Location:
inc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r2113 r2159  
    5454 
    5555          # List of user's blogs 
    56           if ($core->auth->blog_count == 1 || $core->auth->blog_count > 20) 
     56          if ($core->auth->getBlogCount() == 1 || $core->auth->getBlogCount() > 20) 
    5757          { 
    5858               $blog_box = 
     
    6060               html::escapeHTML($core->blog->name).'</strong>'; 
    6161 
    62                if ($core->auth->blog_count > 20) { 
     62               if ($core->auth->getBlogCount() > 20) { 
    6363                    $blog_box .= ' - <a href="blogs.php">'.__('Change blog').'</a>'; 
    6464               } 
  • inc/admin/prepend.php

    r2062 r2159  
    351351          preg_match('/blogs.php$/',$_SERVER['REQUEST_URI']), 
    352352          $core->auth->isSuperAdmin() || 
    353           $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->blog_count > 1); 
     353          $core->auth->check('usage,contentadmin',$core->blog->id) && $core->auth->getBlogCount() > 1); 
    354354 
    355355     if (!$user_ui_nofavmenu) { 
  • inc/core/class.dc.auth.php

    r1179 r2159  
    377377               return $this->blogs[$blog_id]; 
    378378          } 
    379            
    380           if ($this->blog_count === null) { 
    381                $this->blog_count = $this->core->getBlogs(array(),true)->f(0); 
    382           } 
    383            
     379 
    384380          if ($this->user_admin) { 
    385381               $strReq = 'SELECT blog_id '. 
     
    404400          return $this->blogs[$blog_id]; 
    405401     } 
     402 
     403    public function getBlogCount() { 
     404          if ($this->blog_count === null) { 
     405               $this->blog_count = $this->core->getBlogs(array(),true)->f(0); 
     406          } 
     407 
     408        return $this->blog_count; 
     409    } 
    406410      
    407411     public function findUserBlog($blog_id=null) 
Note: See TracChangeset for help on using the changeset viewer.

Sites map