phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.ph


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.php,1.8,1.9 class.sitebo.inc.php,1.4,1.5
Date: Fri, 30 May 2003 19:17:48 -0400

Update of /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc
In directory subversions:/tmp/cvs-serv23147/sitemgr-site/inc

Modified Files:
        class.Template3.inc.php class.sitebo.inc.php 
Log Message:
attempt at modest optimization


Index: class.Template3.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.Template3.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** class.Template3.inc.php     30 May 2003 04:01:43 -0000      1.8
--- class.Template3.inc.php     30 May 2003 23:17:46 -0000      1.9
***************
*** 163,167 ****
                        $content = '';
  
!                       $blocks = 
$this->bo->getvisibleblockdefsforarea($areaname,$page->cat_id,$page->id,$objbo->is_admin(),$objbo->is_user());
                        // if we are in the center area, we append special 
blocks
                        if ($areaname == "center" && $page->block)
--- 163,167 ----
                        $content = '';
  
!                       $blocks = 
$this->bo->getvisibleblockdefsforarea($areaname,$page->cat_id,$page->id,$objbo->isadmin,$objbo->isuser);
                        // if we are in the center area, we append special 
blocks
                        if ($areaname == "center" && $page->block)
***************
*** 318,339 ****
                        }
                        return $moduleobject;
-               }
- 
-               function block_allowed($view)
-               {
-                       global $objbo;
- 
-                       switch($view)
-                       {
-                               case 0:
-                                       return true;
-                               case 1:
-                                       return $objbo->is_user();
-                               case 2:
-                                       return $objbo->is_admin();
-                               case 3:
-                                       return (! $objbo->is_user());
-                       }
-                       return false;
                }
  
--- 318,321 ----

Index: class.sitebo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.sitebo.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.sitebo.inc.php        30 May 2003 04:01:43 -0000      1.4
--- class.sitebo.inc.php        30 May 2003 23:17:46 -0000      1.5
***************
*** 22,25 ****
--- 22,28 ----
                        $this->pages_bo = &$GLOBALS['Common_BO']->pages;
                        $this->acl = &$GLOBALS['Common_BO']->acl;
+                       $this->isadmin = $this->acl->is_admin;
+                       //$anonymous_user is globally set in config.inc.php
+                       $this->isuser = ($phpgw_info['user']['account_lid'] != 
$anonymous_user);
                }
  
***************
*** 134,158 ****
                        global $page;
  
!                       if ($category_id)
!                       {
!                               if($this->acl->can_read_category($category_id))
!                               {
!                                       $cat = 
$this->getcatwrapper($category_id);
!                                       if ($cat)
!                                       {
!                                               $page->cat_id = $category_id;
!                                               $page->title = 
lang('Category').' '.$cat->name;
!                                               $page->subtitle = 
'<i>'.$cat->description.'</i>';
!                                       }
!                               }
!                       }
!                       else
!                       {
!                               $page->title = lang('Table of Contents');
!                               $page->subtitle = '';
!                               $page->toc = True;
!                               $page->cat_id = 
$GLOBALS['Common_BO']->current_site['site_id'];
! 
!                       }
                        $page->block = CreateObject('sitemgr.Block_SO',True);
                        $page->block->module_name = 'toc';
--- 137,144 ----
                        global $page;
  
!                       $page->title = lang('Table of Contents');
!                       $page->subtitle = '';
!                       $page->toc = True;
!                       $page->cat_id = $category_id ? $category_id : 
CURRENT_SITE_ID;
                        $page->block = CreateObject('sitemgr.Block_SO',True);
                        $page->block->module_name = 'toc';
***************
*** 163,167 ****
                        return true;
                }
!               
                function getPageLinks($category_id, $showhidden=true)
                {
--- 149,153 ----
                        return true;
                }
! 
                function getPageLinks($category_id, $showhidden=true)
                {
***************
*** 200,222 ****
                }
  
- 
-               function is_user()
-               {
-                       global $sitemgr_info,$phpgw_info;
-                       if ($phpgw_info['user']['account_lid'] != 
$sitemgr_info['anonymous_user'])
-                       {
-                               return true;
-                       }
-                       else
-                       {
-                               return false;
-                       }
-               }
- 
-               function is_admin()
-               {
-                       return $this->acl->is_admin();
-               }
- 
                //like $GLOBALS['phpgw']->common->getPreferredLanguage,
                //but compares languages accepted by the user 
--- 186,189 ----
***************
*** 247,251 ****
                        }
                        
!                       if ($this->is_user())
                        {
                                $userlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
--- 214,218 ----
                        }
                        
!                       if ($this->isuser)
                        {
                                $userlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
***************
*** 292,296 ****
                function getmode()
                {
!                       if ($this->is_user())
                        {
                                $postmode = $_GET['administration']['mode'];
--- 259,263 ----
                function getmode()
                {
!                       if ($this->isuser)
                        {
                                $postmode = $_GET['administration']['mode'];





reply via email to

[Prev in Thread] Current Thread [Next in Thread]