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.bo.inc.php,1.5,1.


From: Patrick Walsh <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.bo.inc.php,1.5,1.6
Date: Sat, 14 Sep 2002 03:25:23 -0400

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

Modified Files:
        class.bo.inc.php 
Log Message:
Fixed up table of contents and index, plus some relocate code


Index: class.bo.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.bo.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.bo.inc.php    5 Sep 2002 06:57:52 -0000       1.5
--- class.bo.inc.php    14 Sep 2002 07:25:21 -0000      1.6
***************
*** 1,12 ****
  <?php
!       
/***************************************************************************\
!       * phpGroupWare - Web Content Manager                                    
    *
!       * http://www.phpgroupware.org                                           
    *
!       * -------------------------------------------------                     
    *
!       * This program is free software; you can redistribute it and/or modify 
it   *
!       * under the terms of the GNU General Public License as published by the 
    *
!       * Free Software Foundation; either version 2 of the License, or (at 
your    *
!       * option) any later version.                                            
    *
!       
\***************************************************************************/
        /* $Id$ */
  
--- 1,12 ----
  <?php
!       
/*************************************************************************\
!       * phpGroupWare - Web Content Manager                                    
  *
!       * http://www.phpgroupware.org                                           
  *
!       * -------------------------------------------------                     
  *
!       * This program is free software; you can redistribute it and/or modify 
it *
!       * under the terms of the GNU General Public License as published by the 
  *
!       * Free Software Foundation; either version 2 of the License, or (at 
your  *
!       * option) any later version.                                            
  *
!       
\*************************************************************************/
        /* $Id$ */
  
***************
*** 40,60 ****
                        $this->page->subtitle = '';
                        $indexarray = $this->getIndex();
!                       $content = "\n".'<ul>';
                        $catname = '';
                        foreach($indexarray as $page)
                        {
                                if ($catname!=$page['catname']) //category name 
change
                                {
                                        if ($catname!='') //not the first name 
change
                                        {
!                                               $content .= '</ol><br></li>';
                                        }
                                        $catname = $page['catname'];
!                                       $content .= 
"\n".'<li><b>'.$catname.'</b><br><i>'.
!                                               
$page['catdescrip'].'</i>'."\n".'<ol>';
                                }
!                               $content .= 
"\n".'<li>'.$page['pagelink'].'</li>';
                        }
!                       $content .= "\n".'</ol></li></ul>';
                        if (count($indexarray)==0)
                        {
--- 40,69 ----
                        $this->page->subtitle = '';
                        $indexarray = $this->getIndex();
!                       $content = "\n".'<table border="0" width="100%" 
align="left" cellspacing="1" cellpadding="0"><tr>';
                        $catname = '';
                        foreach($indexarray as $page)
                        {
+                               $buffer = str_pad('', 
$page['catdepth']*24,'&nbsp;');
                                if ($catname!=$page['catname']) //category name 
change
                                {
                                        if ($catname!='') //not the first name 
change
                                        {
!                                               $content .= 
'<br><br></td></tr></table></td></tr><tr>';
                                        }
+                                       $content .= '<td>
+                                       <table border="0" width="100%" 
cellspacing="0" align="left" cellpadding="0">
+                                               <tr><td>'.$buffer.'</td>
+                                               <td width="100%">';
                                        $catname = $page['catname'];
!                                       if ($page['catdepth'])
!                                       {
!                                               $content .= '&middot;&nbsp;';
!                                       }
!                                       $content .= '<b>'.$catname.'</b> 
&ndash; <i>'.
!                                               $page['catdescrip'].'</i>'."\n";
                                }
!                               $content .= 
"\n".'<br>&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;'.$page['pagelink'];
                        }
!                       $content .= "\n".'</td></tr></table></td></tr></table>';
                        if (count($indexarray)==0)
                        {
***************
*** 82,85 ****
--- 91,95 ----
                                                        $index[] = array(
                                                                
'catname'=>$cat['name'],
+                                                               
'catdepth'=>$cat['depth'],
                                                                
'catlink'=>$cat['link'],
                                                                
'catdescrip'=>$cat['description'],
***************
*** 95,101 ****
                                                $index[] = array(
                                                        'catname'=>$cat['name'],
                                                        
'catdescrip'=>$cat['description'],
                                                        'catlink'=>$cat['link'],
!                                                       'pagelink'=>'No pages 
in this section.'
                                                );
                                        }
--- 105,112 ----
                                                $index[] = array(
                                                        'catname'=>$cat['name'],
+                                                       
'catdepth'=>$cat['depth'],
                                                        
'catdescrip'=>$cat['description'],
                                                        'catlink'=>$cat['link'],
!                                                       'pagelink'=>'No pages 
available'
                                                );
                                        }
***************
*** 116,132 ****
                                if($acl->can_read_category($category_id))
                                {
!                                       $links = 
$this->getPageLinks($category_id);
                                        $cat = 
$this->catbo->getCategory($category_id);
                                        if ($cat)
                                        {
!                                               $this->page->title = 'Table of 
Contents: '.$cat->name;
!                                               $this->page->subtitle = '<a 
href="'.sitemgr_link2('/index.php','toc=1').'">Up to table of contents</a>';
!                                               $links = 
$this->getPageLinks($category_id);
!                                               $content = '<ul>';
                                                if (count($links)>0)
                                                {
                                                        foreach($links as $pg)
                                                        {
!                                                               $content .= 
"\n".'<li>'.$pg['link'].'</li>';
                                                        }
                                                }
--- 127,165 ----
                                if($acl->can_read_category($category_id))
                                {
!                                       $links = 
$this->getPageLinks($category_id,true);
                                        $cat = 
$this->catbo->getCategory($category_id);
+                                       $content = '';
                                        if ($cat)
                                        {
!                                               $this->page->title = 'Category 
'.$cat->name;
!                                               $this->page->subtitle = 
'<i>'.$cat->description.'</i>';
!                                               $content .= '<b><a 
href="'.sitemgr_link2('/index.php','toc=1').'">Up to table of contents</a></b>';
!                                               if ($cat->depth)
!                                               {
!                                                       $content .= ' | <b><a 
href="'.sitemgr_link2('/index.php','category_id='.$cat->parent).'">Up to 
parent</a></b>';
!                                               }
!                                               $children = 
$this->getCatLinks((int) $category_id,false);
!                                               if (count($children))
!                                               {
!                                                       $content .= 
'<br><br><b>Subcategories:</b><br>';
!                                                       foreach ($children as 
$child)
!                                                       {
!                                                               $content .= 
'<br>&nbsp;&nbsp;&nbsp;&middot;&nbsp;'.
!                                                                       
$child['link'].' &ndash; '.$child['description'];
!                                                       }
!                                               }
!                                               $content .= 
'<br><br><b>Pages:</b><br>';
!                                               $links = 
$this->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 .= '';
                                                        }
                                                }
***************
*** 135,139 ****
                                                        $content .= '<li>There 
are no pages in this section</li>';
                                                }
-                                               $content .= '</ul>';
                                                $this->page->content=$content;
                                        }
--- 168,171 ----
***************
*** 157,161 ****
                                $this->page->title = 'Table of Contents';
                                $this->page->subtitle = '';
!                               $content = '<ul>';
                                $links = $this->getCatLinks();
                                if (count($links)>0)
--- 189,193 ----
                                $this->page->title = 'Table of Contents';
                                $this->page->subtitle = '';
!                               $content = '<b>Choose a category:</b><br>';
                                $links = $this->getCatLinks();
                                if (count($links)>0)
***************
*** 163,175 ****
                                        foreach($links as $cat)
                                        {
!                                               $content .= 
"\n".'<li>'.$cat['link'].'<br><i>'.$cat['description'].
!                                                       '</i></li>';
                                        }
                                }
                                else
                                {
!                                       $content .= '<li>There are no sections 
available to you.</li>';
                                }
-                               $content .= '</ul>';
                                $this->page->content=$content;
                        }
--- 195,211 ----
                                        foreach($links as $cat)
                                        {
!                                               $buffer = str_pad('', 
$cat['depth']*24,'&nbsp;').'&middot;&nbsp;';
!                                               if (!$cat['depth'])
!                                               {
!                                                       $buffer = 
'<br>'.$buffer;
!                                               }
!                                               $content .= 
"\n".$buffer.$cat['link'].' &mdash; <i>'.$cat['description'].
!                                                       '</i><br>';
                                        }
                                }
                                else
                                {
!                                       $content .= 'There are no sections 
available to you.';
                                }
                                $this->page->content=$content;
                        }





reply via email to

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