phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: sitemgr/modules class.module_toc.inc.php,1.3,1.4


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/modules class.module_toc.inc.php,1.3,1.4
Date: Fri, 30 May 2003 19:17:48 -0400

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

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


Index: class.module_toc.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/modules/class.module_toc.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.module_toc.inc.php    30 May 2003 04:01:43 -0000      1.3
--- class.module_toc.inc.php    30 May 2003 23:17:46 -0000      1.4
***************
*** 13,64 ****
                {
                        global $objbo;
                        $category_id = $arguments['category_id'];
                        if ($category_id)
                        {
!                               if($objbo->acl->can_read_category($category_id))
                                {
!                                       $links = 
$objbo->getPageLinks($category_id,true);
!                                       $cat = 
$objbo->getcatwrapper($category_id);
!                                       $content = '';
!                                       if ($cat)
                                        {
!                                               $content .= '<b><a 
href="'.sitemgr_link2('/index.php','toc=1').'">' . lang('Up to table of 
contents') . '</a></b>';
!                                               if ($cat->depth > 1)
!                                               {
!                                                       $content .= ' | <b><a 
href="'.sitemgr_link2('/index.php','category_id='.$cat->parent).'">' . lang('Up 
to parent') . '</a></b>';
!                                               }
!                                               $children = 
$objbo->getCatLinks((int) $category_id,false);
!                                               if (count($children))
                                                {
!                                                       $content .= 
'<br><br><b>' . lang('Subcategories') . ':</b><br>';
!                                                       foreach ($children as 
$child)
!                                                       {
!                                                               $content .= 
'<br>&nbsp;&nbsp;&nbsp;&middot;&nbsp;<b>'.
!                                                                       
$child['link'].'</b> &ndash; '.$child['description'];
!                                                       }
                                                }
!                                               $content .= '<br><br><b>' . 
lang('Pages') . ':</b><br>';
!                                               $links = 
$objbo->getPageLinks($category_id,true);
!                                               if (count($links)>0)
                                                {
!                                                       foreach($links as $pg)
                                                        {
!                                                               $content .= 
"\n<br>".
!                                                                       
'&nbsp;&nbsp;&nbsp;&middot;&nbsp;'.$pg['link'];
!                                                               if 
(!empty($pg['subtitle']))
!                                                               {
!                                                                       
$content .= ' &ndash; <i>'.$pg['subtitle'].'</i>';
!                                                               }
!                                                               $content .= '';
                                                        }
!                                               }
!                                               else
!                                               {
!                                                       $content .= '<li>' . 
lang('There are no pages in this section') . '</li>';
                                                }
                                        }
                                        else
                                        {
!                                               $content = lang('There was an 
error accessing the requested page. Either you do not have permission to view 
this page, or the page does not exist.');
                                        }
                                }
--- 13,58 ----
                {
                        global $objbo;
+                       global $page;
                        $category_id = $arguments['category_id'];
                        if ($category_id)
                        {
!                               $cat = $objbo->getcatwrapper($category_id);
!                               if ($cat)
                                {
!                                       $page->title = lang('Category').' 
'.$cat->name;
!                                       $page->subtitle = 
'<i>'.$cat->description.'</i>';
!                                       $content = '<b><a 
href="'.sitemgr_link2('/index.php','toc=1').'">' . lang('Up to table of 
contents') . '</a></b>';
!                                       if ($cat->depth > 1)
                                        {
!                                               $content .= ' | <b><a 
href="'.sitemgr_link2('/index.php','category_id='.$cat->parent).'">' . lang('Up 
to parent') . '</a></b>';
!                                       }
!                                       $children = $objbo->getCatLinks((int) 
$category_id,false);
!                                       if (count($children))
!                                       {
!                                               $content .= '<br><br><b>' . 
lang('Subcategories') . ':</b><br>';
!                                               foreach ($children as $child)
                                                {
!                                                       $content .= 
'<br>&nbsp;&nbsp;&nbsp;&middot;&nbsp;<b>'.
!                                                               
$child['link'].'</b> &ndash; '.$child['description'];
                                                }
!                                       }
!                                       $content .= '<br><br><b>' . 
lang('Pages') . ':</b><br>';
!                                       $links = 
$objbo->getPageLinks($category_id,true);
!                                       if (count($links)>0)
!                                       {
!                                               foreach($links as $pg)
                                                {
!                                                       $content .= "\n<br>".
!                                                               
'&nbsp;&nbsp;&nbsp;&middot;&nbsp;'.$pg['link'];
!                                                       if 
(!empty($pg['subtitle']))
                                                        {
!                                                               $content .= ' 
&ndash; <i>'.$pg['subtitle'].'</i>';
                                                        }
!                                                       $content .= '';
                                                }
                                        }
                                        else
                                        {
!                                               $content .= '<li>' . 
lang('There are no pages in this section') . '</li>';
                                        }
                                }





reply via email to

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