phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: wcm/inc class.boelement.inc.php,1.2,1.3 class.bo


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: wcm/inc class.boelement.inc.php,1.2,1.3 class.bowcm.inc.php,1.3,1.4 class.soelement.inc.php,1.6,1.7 class.sopage.inc.php,1.5,1.6 class.sosite.inc.php,1.4,1.5 class.uielement.inc.php,1.3,1.4 class.uipage.inc.php,1.6,1.7
Date: Sun, 10 Feb 2002 13:21:13 -0500

Update of /cvsroot/phpgroupware/wcm/inc
In directory subversions:/tmp/cvs-serv7987/inc

Modified Files:
        class.boelement.inc.php class.bowcm.inc.php 
        class.soelement.inc.php class.sopage.inc.php 
        class.sosite.inc.php class.uielement.inc.php 
        class.uipage.inc.php 
Log Message:
Fixup for display in website/main.php; add selection of header/footer based on 
element
type and availability



Index: class.boelement.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.boelement.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.boelement.inc.php     4 Feb 2002 01:42:41 -0000       1.2
--- class.boelement.inc.php     10 Feb 2002 18:21:10 -0000      1.3
***************
*** 101,104 ****
--- 101,119 ----
                }
  
+               function list_headers($simple=False)
+               {
+                       return 
$this->so->list_headers(array($this->start,$this->sort,$this->order,$this->query,$this->limit),$this->total,$simple);
+               }
+ 
+               function list_footers($simple=False)
+               {
+                       return 
$this->so->list_footers(array($this->start,$this->sort,$this->order,$this->query,$this->limit),$this->total,$simple);
+               }
+ 
+               function list_normal($simple=False)
+               {
+                       return 
$this->so->list_normal(array($this->start,$this->sort,$this->order,$this->query,$this->limit),$this->total,$simple);
+               }
+ 
                function read($id)
                {

Index: class.bowcm.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.bowcm.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bowcm.inc.php 4 Feb 2002 01:42:41 -0000       1.3
--- class.bowcm.inc.php 10 Feb 2002 18:21:10 -0000      1.4
***************
*** 38,42 ****
                                /*
                                echo 'in read:';
!                               _debug_array($data);
                                echo 'leaving...';
                                */
--- 38,42 ----
                                /*
                                echo 'in read:';
!                               _debug_array($this->site);
                                echo 'leaving...';
                                */

Index: class.soelement.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.soelement.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.soelement.inc.php     9 Feb 2002 03:13:48 -0000       1.6
--- class.soelement.inc.php     10 Feb 2002 18:21:10 -0000      1.7
***************
*** 34,37 ****
--- 34,67 ----
                }
  
+               function list_headers($data='',&$total,$simple=False)
+               {
+                       if(is_array($data))
+                       {
+                               if($this->debug) { _debug_array($data); }
+                               list($start,$sort,$order,$query,$limit) = $data;
+                       }
+                       return 
$this->get_list($start,$sort,$order,$query,$limit,$total,$simple,'header');
+               }
+ 
+               function list_footers($data='',&$total,$simple=False)
+               {
+                       if(is_array($data))
+                       {
+                               if($this->debug) { _debug_array($data); }
+                               list($start,$sort,$order,$query,$limit) = $data;
+                       }
+                       return 
$this->get_list($start,$sort,$order,$query,$limit,$total,$simple,'footer');
+               }
+ 
+               function list_normal($data='',&$total,$simple=False)
+               {
+                       if(is_array($data))
+                       {
+                               if($this->debug) { _debug_array($data); }
+                               list($start,$sort,$order,$query,$limit) = $data;
+                       }
+                       return 
$this->get_list($start,$sort,$order,$query,$limit,$total,$simple,'normal');
+               }
+ 
                function read($id)
                {
***************
*** 58,61 ****
--- 88,93 ----
                function read_repository($elementid='')
                {
+                       $this->element = array();
+ 
                        if(!$elementid)
                        {
***************
*** 139,153 ****
                }
  
!               function 
get_list($start='',$sort='',$order='',$query='',$limit='',&$total,$simple=False)
                {
!                       if (!$sort)
                        {
!                               $sort = 'DESC';
                        }
!                       if ($query)
                        {
                                $whereclause = "WHERE element_name LIKE 
'%$query%'"
                                        . "OR element_title  LIKE '%$query%'";
                        }
                        if ($order)
                        {
--- 171,202 ----
                }
  
!               function 
get_list($start='',$sort='',$order='',$query='',$limit='',&$total,$simple=False,$type='')
                {
!                       $this->elements = array();
!                       if($type)
                        {
!                               //echo 'type=' . $type;
!                               switch($type)
!                               {
!                                       case 'header':
!                                               $whereclause = "WHERE 
element_hf='header'";
!                                               break;
!                                       case 'footer':
!                                               $whereclause = "WHERE 
element_hf='footer'";
!                                               break;
!                                       default:
!                                               $whereclause = "WHERE 
element_hf=NULL OR element_hf=''";
!                               }
                        }
!                       elseif ($query)
                        {
                                $whereclause = "WHERE element_name LIKE 
'%$query%'"
                                        . "OR element_title  LIKE '%$query%'";
                        }
+ 
+                       if (!$sort)
+                       {
+                               $sort = 'DESC';
+                       }
                        if ($order)
                        {
***************
*** 160,163 ****
--- 209,213 ----
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
+                       //echo $sql;
                        $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
  

Index: class.sopage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.sopage.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.sopage.inc.php        8 Feb 2002 05:45:11 -0000       1.5
--- class.sopage.inc.php        10 Feb 2002 18:21:10 -0000      1.6
***************
*** 58,61 ****
--- 58,62 ----
                function read_repository($pageid='',$full=False)
                {
+                       $this->page = array();
                        if(!$pageid)
                        {
***************
*** 81,85 ****
                                while(list($key,$value) = 
@each($this->page['page_elements']))
                                {
!                                       $new[$key] = 
$elements->read_repository($value,True);
                                }
                                $this->page['page_elements'] = $new;
--- 82,96 ----
                                while(list($key,$value) = 
@each($this->page['page_elements']))
                                {
!                                       if(is_array($value))
!                                       {
!                                               while(list(,$subval) = 
each($value))
!                                               {
!                                                       $new[$key][] = 
$elements->read_repository($subval,True);
!                                               }
!                                       }
!                                       else
!                                       {
!                                               $new[$key] = $value;
!                                       }
                                }
                                $this->page['page_elements'] = $new;
***************
*** 158,161 ****
--- 169,174 ----
                function 
get_list($start='',$sort='',$order='',$query='',$limit='',&$total,$simple=False)
                {
+                       $this->pages = array();
+ 
                        if (!$sort)
                        {

Index: class.sosite.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.sosite.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.sosite.inc.php        8 Feb 2002 05:45:11 -0000       1.4
--- class.sosite.inc.php        10 Feb 2002 18:21:10 -0000      1.5
***************
*** 58,61 ****
--- 58,63 ----
                function read_repository($siteid='',$full=False)
                {
+                       $this->site = array();
+ 
                        if(!$siteid)
                        {
***************
*** 90,94 ****
                                while(list($key,$value) = 
@each($this->site['site_pages']))
                                {
-                                       echo '<br>reading page: ' . $value;
                                        $new[$key] = 
$pages->read_repository($value,True);
                                }
--- 92,95 ----
***************
*** 178,181 ****
--- 179,184 ----
                function 
get_list($start='',$sort='',$order='',$query='',$limit='',&$total)
                {
+                       $this->sites = array();
+ 
                        if (!$sort)
                        {

Index: class.uielement.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.uielement.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uielement.inc.php     9 Feb 2002 03:13:48 -0000       1.3
--- class.uielement.inc.php     10 Feb 2002 18:21:10 -0000      1.4
***************
*** 99,102 ****
--- 99,128 ----
                }
  
+               function expire_time($time='')
+               {
+                       if($time)
+                       {
+                               $time = intval($time);
+                               if($time >=86400)
+                               {
+                                       $days = (round($time/86400) + 1);
+                               }
+                               else
+                               {
+                                       $days = 0;
+                               }
+                               if($time >= 3600)
+                               {
+                                       $hours   = (round($time/3600) + 1);
+                                       $minutes = ($time - (3600 * $hours));
+                               }
+                               else
+                               {
+                                       $hours   = 0;
+                                       $minutes = (round($time/60) + 1);
+                               }
+                       }
+               }
+ 
                function index()
                {

Index: class.uipage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.uipage.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.uipage.inc.php        8 Feb 2002 15:23:10 -0000       1.6
--- class.uipage.inc.php        10 Feb 2002 18:21:10 -0000      1.7
***************
*** 349,363 ****
                        
$GLOBALS['phpgw']->template->set_var('page_id',$GLOBALS['HTTP_GET_VARS']['page_id']
 ? $GLOBALS['HTTP_GET_VARS']['page_id'] : $page['page_id']);
                        
$GLOBALS['phpgw']->template->set_var('page_pages',$page['page_pages']);
!                       
$GLOBALS['phpgw']->template->set_var('page_header',$page['page_header']);
!                       
$GLOBALS['phpgw']->template->set_var('page_footer',$page['page_footer']);
                        
$GLOBALS['phpgw']->template->set_var('page_version',$page['page_version']);
  
!                       $list_elements = $this->boelements->list_elements(True);
                        for($i=0;$i<8;$i++)
                        {
                                $GLOBALS['phpgw']->template->set_var('num',$i + 
1);
!                               
$GLOBALS['phpgw']->template->set_var('element_left',$this->formatted_list('page_element_left['
 . $i . ']',$list_elements,$page['page_elements']['left'][$i],'---'));
!                               
$GLOBALS['phpgw']->template->set_var('element_mid',$this->formatted_list('page_element_mid['
 . $i . ']',$list_elements,$page['page_elements']['mid'][$i],'---'));
!                               
$GLOBALS['phpgw']->template->set_var('element_right',$this->formatted_list('page_element_right['
 . $i . ']',$list_elements,$page['page_elements']['right'][$i],'---'));
                                
$GLOBALS['phpgw']->template->fp('elements','elem',True);
                        }
--- 349,365 ----
                        
$GLOBALS['phpgw']->template->set_var('page_id',$GLOBALS['HTTP_GET_VARS']['page_id']
 ? $GLOBALS['HTTP_GET_VARS']['page_id'] : $page['page_id']);
                        
$GLOBALS['phpgw']->template->set_var('page_pages',$page['page_pages']);
!                       $headers = $this->boelements->list_headers(True);
!                       $footers = $this->boelements->list_footers(True);
!                       
$GLOBALS['phpgw']->template->set_var('page_header',$this->formatted_list('page_header',$headers,$page['page_header'],'---'));
!                       
$GLOBALS['phpgw']->template->set_var('page_footer',$this->formatted_list('page_footer',$footers,$page['page_footer'],'---'));
                        
$GLOBALS['phpgw']->template->set_var('page_version',$page['page_version']);
  
!                       $list_normal = $this->boelements->list_normal(True);
                        for($i=0;$i<8;$i++)
                        {
                                $GLOBALS['phpgw']->template->set_var('num',$i + 
1);
!                               
$GLOBALS['phpgw']->template->set_var('element_left',$this->formatted_list('page_element_left['
 . $i . ']',$list_normal,$page['page_elements']['left'][$i],'---'));
!                               
$GLOBALS['phpgw']->template->set_var('element_mid',$this->formatted_list('page_element_mid['
 . $i . ']',$list_normal,$page['page_elements']['mid'][$i],'---'));
!                               
$GLOBALS['phpgw']->template->set_var('element_right',$this->formatted_list('page_element_right['
 . $i . ']',$list_normal,$page['page_elements']['right'][$i],'---'));
                                
$GLOBALS['phpgw']->template->fp('elements','elem',True);
                        }




reply via email to

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