phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: wcm/inc class.bosite.inc.php,1.1.1.1,1.2 class.b


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: wcm/inc class.bosite.inc.php,1.1.1.1,1.2 class.bowcm.inc.php,1.1.1.1,1.2 class.soelement.inc.php,1.1.1.1,1.2 class.sopage.inc.php,1.1.1.1,1.2 class.sosite.inc.php,1.1.1.1,1.2 class.uisite.inc.php,1.1.1.1,1.2
Date: Sun, 03 Feb 2002 12:37:41 -0500

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

Modified Files:
        class.bosite.inc.php class.bowcm.inc.php 
        class.soelement.inc.php class.sopage.inc.php 
        class.sosite.inc.php class.uisite.inc.php 
Log Message:
Change to not make a copy of the db object; fix for adding new sites



Index: class.bosite.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.bosite.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.bosite.inc.php        3 Feb 2002 15:16:22 -0000       1.1.1.1
--- class.bosite.inc.php        3 Feb 2002 17:37:38 -0000       1.2
***************
*** 17,23 ****
                var $public_functions = array(
                        'list_sites' => True,
!                       'read'         => True,
!                       'edit'         => True,
!                       'delete'       => True
                );
  
--- 17,23 ----
                var $public_functions = array(
                        'list_sites' => True,
!                       'read'       => True,
!                       'edit'       => True,
!                       'delete'     => True
                );
  
***************
*** 99,103 ****
                }
  
!               function read($id)
                {
                        if(is_array($id))
--- 99,103 ----
                }
  
!               function read($id,$full=False)
                {
                        if(is_array($id))
***************
*** 105,109 ****
                                $id = $id['site_id'];
                        }
!                       return $this->so->read($id);
                }
  
--- 105,109 ----
                                $id = $id['site_id'];
                        }
!                       return $this->so->read($id,$full);
                }
  

Index: class.bowcm.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.bowcm.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.bowcm.inc.php 3 Feb 2002 15:16:22 -0000       1.1.1.1
--- class.bowcm.inc.php 3 Feb 2002 17:37:38 -0000       1.2
***************
*** 15,17 ****
--- 15,39 ----
        class bowcm
        {
+               var $site_name = '';
+               var $site_id   = 0;
+ 
+               function bowcm($site_name='')
+               {
+                       $this->wcm = CreateObject('wcm.bosite');
+                       $this->site_name = $site_name;
+                       $this->site_id   = 
$this->wcm->name2id($this->site_name);
+ 
+                       if($this->site_name)
+                       {
+                               return $this->read();
+                       }
+               }
+ 
+               function read()
+               {
+                       if($this->site_id)
+                       {
+                               return $this->wcm->read($this->site_id,True);
+                       }
+               }
        }

Index: class.soelement.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.soelement.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.soelement.inc.php     3 Feb 2002 15:16:17 -0000       1.1.1.1
--- class.soelement.inc.php     3 Feb 2002 17:37:38 -0000       1.2
***************
*** 22,26 ****
                function soelement()
                {
-                       $this->db = $GLOBALS['phpgw']->db;
                }
  
--- 22,25 ----
***************
*** 64,75 ****
                        }
                        $sql = "SELECT * FROM $this->table WHERE element_id=" . 
intval($elementid);
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
!                               $this->element['element_name']    = 
$this->db->f('element_name');
!                               $this->element['element_title']   = 
$this->db->f('element_title');
!                               $this->element['element_type']    = 
$this->db->f('element_type');
!                               $this->element['element_source']  = 
$this->db->f('element_source');
!                               $this->element['element_version'] = 
$this->db->f('element_version');
                        }
                        return $this->element;
--- 63,74 ----
                        }
                        $sql = "SELECT * FROM $this->table WHERE element_id=" . 
intval($elementid);
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
!                               $this->element['element_name']    = 
$GLOBALS['phpgw']->db->f('element_name');
!                               $this->element['element_title']   = 
$GLOBALS['phpgw']->db->f('element_title');
!                               $this->element['element_type']    = 
$GLOBALS['phpgw']->db->f('element_type');
!                               $this->element['element_source']  = 
$GLOBALS['phpgw']->db->f('element_source');
!                               $this->element['element_version'] = 
$GLOBALS['phpgw']->db->f('element_version');
                        }
                        return $this->element;
***************
*** 91,95 ****
                                        . "element_version='" . 
$this->element['element_version'] . "' "
                                        . "WHERE element_id=" . 
intval($elementid);
!                               $this->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
--- 90,94 ----
                                        . "element_version='" . 
$this->element['element_version'] . "' "
                                        . "WHERE element_id=" . 
intval($elementid);
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
***************
*** 108,118 ****
                                . $element_info['element_type'] . "','"
                                . $element_info['element_source'] . "','" . 
$element_info['element_version'] . "')";
!                       $this->db->query($sql,__LINE__,__FILE__);
  
                        $sql = "SELECT element_id FROM $this->table WHERE 
element_name='" . $element_info['element_name'] . "'";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
!                               $element_info['element_id'] = $this->db->f(0);
                                $this->elementid = $element_info['element_id'];
                                $this->element   = $element_info;
--- 107,117 ----
                                . $element_info['element_type'] . "','"
                                . $element_info['element_source'] . "','" . 
$element_info['element_version'] . "')";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
  
                        $sql = "SELECT element_id FROM $this->table WHERE 
element_name='" . $element_info['element_name'] . "'";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
!                               $element_info['element_id'] = 
$GLOBALS['phpgw']->db->f(0);
                                $this->elementid = $element_info['element_id'];
                                $this->element   = $element_info;
***************
*** 131,135 ****
                        {
                                $sql = "DELETE FROM $this->table WHERE 
element_id=$elementid";
!                               $this->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
--- 130,134 ----
                        {
                                $sql = "DELETE FROM $this->table WHERE 
element_id=$elementid";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
***************
*** 158,180 ****
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
!                       $this->db->query($sql,__LINE__,__FILE__);
                        
!                       while ($this->db->next_record())
                        {
                                if($simple)
                                {
!                                       
$this->elements[$this->db->f('element_id')] = $this->db->f('element_name');
                                }
                                else
                                {
!                                       
$this->elements[$this->db->f('element_name')]['element_id']   = 
$this->db->f('element_id');
!                                       
$this->elements[$this->db->f('element_name')]['element_name'] = 
$this->db->f('element_name');
!                                       
$this->elements[$this->db->f('element_name')]['element_title'] = 
$this->db->f('element_title');
!                                       
$this->elements[$this->db->f('element_name')]['element_type'] = 
$this->db->f('element_type');
!                                       
$this->elements[$this->db->f('element_name')]['element_source'] = 
$this->db->f('element_source');
!                                       
$this->elements[$this->db->f('element_name')]['element_version']  = 
$this->db->f('element_version');
                                }
                        }
!                       $this->total = $this->db->num_rows();
                        $total = $this->total;
                        return $this->elements;
--- 157,179 ----
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                        
!                       while ($GLOBALS['phpgw']->db->next_record())
                        {
                                if($simple)
                                {
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_id')] = 
$GLOBALS['phpgw']->db->f('element_name');
                                }
                                else
                                {
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_name')]['element_id']   = 
$GLOBALS['phpgw']->db->f('element_id');
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_name')]['element_name'] = 
$GLOBALS['phpgw']->db->f('element_name');
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_name')]['element_title'] = 
$GLOBALS['phpgw']->db->f('element_title');
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_name')]['element_type'] = 
$GLOBALS['phpgw']->db->f('element_type');
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_name')]['element_source'] = 
$GLOBALS['phpgw']->db->f('element_source');
!                                       
$this->elements[$GLOBALS['phpgw']->db->f('element_name')]['element_version']  = 
$GLOBALS['phpgw']->db->f('element_version');
                                }
                        }
!                       $this->total = $GLOBALS['phpgw']->db->num_rows();
                        $total = $this->total;
                        return $this->elements;
***************
*** 228,235 ****
                        {
                                $sql = "SELECT element_id FROM $this->table 
WHERE element_name='$element_name'";
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               if($this->db->next_record())
                                {
!                                       $elementid = $this->db->f(0);
                                        return $elementid;
                                }
--- 227,234 ----
                        {
                                $sql = "SELECT element_id FROM $this->table 
WHERE element_name='$element_name'";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                               if($GLOBALS['phpgw']->db->next_record())
                                {
!                                       $elementid = 
$GLOBALS['phpgw']->db->f(0);
                                        return $elementid;
                                }
***************
*** 261,268 ****
                        {
                                $sql = "SELECT element_name FROM $this->table 
WHERE element_id=$elementid";
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               if($this->db->next_record())
                                {
!                                       $element_name = $this->db->f(0);
                                        return $element_name;
                                }
--- 260,267 ----
                        {
                                $sql = "SELECT element_name FROM $this->table 
WHERE element_id=$elementid";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                               if($GLOBALS['phpgw']->db->next_record())
                                {
!                                       $element_name = 
$GLOBALS['phpgw']->db->f(0);
                                        return $element_name;
                                }
***************
*** 288,293 ****
                        }
                        $sql = "SELECT element_id FROM $this->table WHERE 
element_name='$element_name'";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
                                return True;
--- 287,292 ----
                        }
                        $sql = "SELECT element_id FROM $this->table WHERE 
element_name='$element_name'";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
                                return True;

Index: class.sopage.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.sopage.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.sopage.inc.php        3 Feb 2002 15:16:13 -0000       1.1.1.1
--- class.sopage.inc.php        3 Feb 2002 17:37:38 -0000       1.2
***************
*** 22,26 ****
                function sopage()
                {
-                       $this->db = $GLOBALS['phpgw']->db;
                }
  
--- 22,25 ----
***************
*** 57,61 ****
                }
  
!               function read_repository($pageid='')
                {
                        if(!$pageid)
--- 56,60 ----
                }
  
!               function read_repository($pageid='',$full=False)
                {
                        if(!$pageid)
***************
*** 64,78 ****
                        }
                        $sql = "SELECT * FROM $this->table WHERE page_id=" . 
intval($pageid);
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
!                               $this->page['page_name']     = 
$this->db->f('page_name');
!                               $this->page['page_title']    = 
$this->db->f('page_title');
!                               $this->page['page_url']      = 
$this->db->f('page_url');
!                               $tmp = 
unserialize($this->db->f('page_elements'));
                                $this->page['page_elements'] = $tmp ? $tmp : 
array();
!                               $this->page['page_header']   = 
$this->db->f('page_header');
!                               $this->page['page_footer']   = 
$this->db->f('page_footer');
!                               $this->page['page_version']  = 
$this->db->f('page_version');
                        }
                        return $this->page;
--- 63,86 ----
                        }
                        $sql = "SELECT * FROM $this->table WHERE page_id=" . 
intval($pageid);
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
!                               $this->page['page_name']     = 
$GLOBALS['phpgw']->db->f('page_name');
!                               $this->page['page_title']    = 
$GLOBALS['phpgw']->db->f('page_title');
!                               $this->page['page_url']      = 
$GLOBALS['phpgw']->db->f('page_url');
!                               $tmp = 
unserialize($GLOBALS['phpgw']->db->f('page_elements'));
                                $this->page['page_elements'] = $tmp ? $tmp : 
array();
!                               $this->page['page_header']   = 
$GLOBALS['phpgw']->db->f('page_header');
!                               $this->page['page_footer']   = 
$GLOBALS['phpgw']->db->f('page_footer');
!                               $this->page['page_version']  = 
$GLOBALS['phpgw']->db->f('page_version');
!                       }
!                       if($full)
!                       {
!                               $elements = CreateObject('wcm.element');
!                               while(list($key,$value) = 
@each($this->page['page_elements']))
!                               {
!                                       $new[$key] = 
$elements->read_repository($value);
!                               }
!                               $this->page['page_elements'] = $new;
                        }
                        return $this->page;
***************
*** 98,102 ****
                                        . "page_version='"  . 
$this->page['page_version'] . "' "
                                        . "WHERE page_id="  . intval($pageid);
!                               $this->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
--- 106,110 ----
                                        . "page_version='"  . 
$this->page['page_version'] . "' "
                                        . "WHERE page_id="  . intval($pageid);
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
***************
*** 118,128 ****
                                . $page_info['page_header'] . "','" . 
$page_info['page_footer'] . "','"
                                . $page_info['page_version'] . "')";
!                       $this->db->query($sql,__LINE__,__FILE__);
  
                        $sql = "SELECT page_id FROM $this->table WHERE 
page_name='" . $page_info['page_name'] . "'";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
!                               $page_info['page_id'] = $this->db->f(0);
                                $this->pageid = $page_info['page_id'];
                                $this->page   = $page_info;
--- 126,136 ----
                                . $page_info['page_header'] . "','" . 
$page_info['page_footer'] . "','"
                                . $page_info['page_version'] . "')";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
  
                        $sql = "SELECT page_id FROM $this->table WHERE 
page_name='" . $page_info['page_name'] . "'";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
!                               $page_info['page_id'] = 
$GLOBALS['phpgw']->db->f(0);
                                $this->pageid = $page_info['page_id'];
                                $this->page   = $page_info;
***************
*** 141,145 ****
                        {
                                $sql = "DELETE FROM $this->table WHERE 
page_id=$pageid";
!                               $this->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
--- 149,153 ----
                        {
                                $sql = "DELETE FROM $this->table WHERE 
page_id=$pageid";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
***************
*** 169,193 ****
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
!                       $this->db->query($sql,__LINE__,__FILE__);
                        
!                       while ($this->db->next_record())
                        {
                                if($simple)
                                {
!                                       $this->pages[$this->db->f('page_id')] = 
$this->db->f('page_title');
                                }
                                else
                                {
!                                       
$this->pages[$this->db->f('page_name')]['page_id']   = $this->db->f('page_id');
!                                       
$this->pages[$this->db->f('page_name')]['page_name'] = 
$this->db->f('page_name');
!                                       
$this->pages[$this->db->f('page_name')]['page_title'] = 
$this->db->f('page_title');
!                                       
$this->pages[$this->db->f('page_name')]['page_url']  = $this->db->f('page_url');
!                                       
$this->pages[$this->db->f('page_name')]['page_elements']   = 
$this->db->f('page_elements');
!                                       
$this->pages[$this->db->f('page_name')]['page_header'] = 
$this->db->f('page_header');
!                                       
$this->pages[$this->db->f('page_name')]['page_footer'] = 
$this->db->f('page_footer');
!                                       
$this->pages[$this->db->f('page_name')]['page_version']  = 
$this->db->f('page_version');
                                }
                        }
!                       $this->total = $this->db->num_rows();
                        $total = $this->total;
                        return $this->pages;
--- 177,201 ----
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                        
!                       while ($GLOBALS['phpgw']->db->next_record())
                        {
                                if($simple)
                                {
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_id')] = 
$GLOBALS['phpgw']->db->f('page_title');
                                }
                                else
                                {
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_id']   = 
$GLOBALS['phpgw']->db->f('page_id');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_name'] = 
$GLOBALS['phpgw']->db->f('page_name');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_title'] = 
$GLOBALS['phpgw']->db->f('page_title');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_url']  = 
$GLOBALS['phpgw']->db->f('page_url');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_elements']   = 
$GLOBALS['phpgw']->db->f('page_elements');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_header'] = 
$GLOBALS['phpgw']->db->f('page_header');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_footer'] = 
$GLOBALS['phpgw']->db->f('page_footer');
!                                       
$this->pages[$GLOBALS['phpgw']->db->f('page_name')]['page_version']  = 
$GLOBALS['phpgw']->db->f('page_version');
                                }
                        }
!                       $this->total = $GLOBALS['phpgw']->db->num_rows();
                        $total = $this->total;
                        return $this->pages;
***************
*** 241,248 ****
                        {
                                $sql = "SELECT page_id FROM $this->table WHERE 
page_name='$page_name'";
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               if($this->db->next_record())
                                {
!                                       $pageid = $this->db->f(0);
                                        return $pageid;
                                }
--- 249,256 ----
                        {
                                $sql = "SELECT page_id FROM $this->table WHERE 
page_name='$page_name'";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                               if($GLOBALS['phpgw']->db->next_record())
                                {
!                                       $pageid = $GLOBALS['phpgw']->db->f(0);
                                        return $pageid;
                                }
***************
*** 260,267 ****
                        {
                                $sql = "SELECT page_name FROM $this->table 
WHERE page_id=$pageid";
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               if($this->db->next_record())
                                {
!                                       $page_name = $this->db->f(0);
                                        return $page_name;
                                }
--- 268,275 ----
                        {
                                $sql = "SELECT page_name FROM $this->table 
WHERE page_id=$pageid";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                               if($GLOBALS['phpgw']->db->next_record())
                                {
!                                       $page_name = 
$GLOBALS['phpgw']->db->f(0);
                                        return $page_name;
                                }
***************
*** 287,292 ****
                        }
                        $sql = "SELECT page_id FROM $this->table WHERE 
page_name='$page_name'";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
                                return True;
--- 295,300 ----
                        }
                        $sql = "SELECT page_id FROM $this->table WHERE 
page_name='$page_name'";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
                                return True;

Index: class.sosite.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.sosite.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.sosite.inc.php        3 Feb 2002 15:16:29 -0000       1.1.1.1
--- class.sosite.inc.php        3 Feb 2002 17:37:38 -0000       1.2
***************
*** 22,26 ****
                function sosite()
                {
-                       $this->db = $GLOBALS['phpgw']->db;
                }
  
--- 22,25 ----
***************
*** 57,61 ****
                }
  
!               function read_repository($siteid='')
                {
                        if(!$siteid)
--- 56,60 ----
                }
  
!               function read_repository($siteid='',$full=False)
                {
                        if(!$siteid)
***************
*** 64,85 ****
                        }
                        $sql = "SELECT * FROM $this->table WHERE site_id=" . 
intval($siteid);
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
!                               $this->site['site_id']       = 
$this->db->f('site_id');
!                               $this->site['site_name']     = 
$this->db->f('site_name');
!                               $this->site['site_title']    = 
$this->db->f('site_title');
!                               $this->site['site_url']      = 
$this->db->f('site_url');
!                               $this->site['site_root']     = 
$this->db->f('site_root');
!                               $this->site['site_security'] = 
$this->db->f('site_security');
!                               $this->site['username']      = 
$this->db->f('username');
!                               $this->site['password']      = 
$this->db->f('password');
!                               $this->site['admin_name']    = 
$this->db->f('admin_name');
!                               $this->site['admin_email']   = 
$this->db->f('admin_email');
!                               $tmp = unserialize($this->db->f('site_pages'));
                                $this->site['site_pages']    = is_array($tmp) ? 
$tmp : array();
!                               $this->site['site_header']   = 
$this->db->f('site_header');
!                               $this->site['site_footer']   = 
$this->db->f('site_footer');
!                               $this->site['site_version']  = 
$this->db->f('site_version');
                        }
                        return $this->site;
--- 63,93 ----
                        }
                        $sql = "SELECT * FROM $this->table WHERE site_id=" . 
intval($siteid);
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
!                               $this->site['site_id']       = 
$GLOBALS['phpgw']->db->f('site_id');
!                               $this->site['site_name']     = 
$GLOBALS['phpgw']->db->f('site_name');
!                               $this->site['site_title']    = 
$GLOBALS['phpgw']->db->f('site_title');
!                               $this->site['site_url']      = 
$GLOBALS['phpgw']->db->f('site_url');
!                               $this->site['site_root']     = 
$GLOBALS['phpgw']->db->f('site_root');
!                               $this->site['site_security'] = 
$GLOBALS['phpgw']->db->f('site_security');
!                               $this->site['username']      = 
$GLOBALS['phpgw']->db->f('username');
!                               $this->site['password']      = 
$GLOBALS['phpgw']->db->f('password');
!                               $this->site['admin_name']    = 
$GLOBALS['phpgw']->db->f('admin_name');
!                               $this->site['admin_email']   = 
$GLOBALS['phpgw']->db->f('admin_email');
!                               $tmp = 
unserialize($GLOBALS['phpgw']->db->f('site_pages'));
                                $this->site['site_pages']    = is_array($tmp) ? 
$tmp : array();
!                               $this->site['site_header']   = 
$GLOBALS['phpgw']->db->f('site_header');
!                               $this->site['site_footer']   = 
$GLOBALS['phpgw']->db->f('site_footer');
!                               $this->site['site_version']  = 
$GLOBALS['phpgw']->db->f('site_version');
!                       }
!                       if($full)
!                       {
!                               $pages = CreateObject('wcm.sopage');
!                               while(list($key,$value) = 
@each($this->site['site_pages']))
!                               {
!                                       $new[$key] = 
$pages->read_repository($value);
!                               }
!                               $this->site['site_pages'] = $new;
                        }
                        return $this->site;
***************
*** 111,115 ****
                                        . "site_version='"  . 
$this->site['site_version'] . "' "
                                        . "WHERE site_id="  . intval($siteid);
!                               $this->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
--- 119,123 ----
                                        . "site_version='"  . 
$this->site['site_version'] . "' "
                                        . "WHERE site_id="  . intval($siteid);
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
***************
*** 119,123 ****
                function create($site_info='')
                {
!                       if(is_array($site_info))
                        {
                                return False;
--- 127,131 ----
                function create($site_info='')
                {
!                       if(!is_array($site_info))
                        {
                                return False;
***************
*** 134,144 ****
                                . $site_info['site_header'] . "','"
                                . $site_info['site_footer'] . "','" . 
$site_info['site_version'] . "')";
!                       $this->db->query($sql,__LINE__,__FILE__);
  
                        $sql = "SELECT site_id FROM $this->table WHERE 
site_name='" . $site_info['site_name'] . "'";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
!                               $site_info['site_id'] = $this->db->f(0);
                                $this->siteid = $site_info['site_id'];
                                $this->site   = $site_info;
--- 142,152 ----
                                . $site_info['site_header'] . "','"
                                . $site_info['site_footer'] . "','" . 
$site_info['site_version'] . "')";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
  
                        $sql = "SELECT site_id FROM $this->table WHERE 
site_name='" . $site_info['site_name'] . "'";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
!                               $site_info['site_id'] = 
$GLOBALS['phpgw']->db->f(0);
                                $this->siteid = $site_info['site_id'];
                                $this->site   = $site_info;
***************
*** 157,161 ****
                        {
                                $sql = "DELETE FROM $this->table WHERE 
site_id=$siteid";
!                               $this->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
--- 165,169 ----
                        {
                                $sql = "DELETE FROM $this->table WHERE 
site_id=$siteid";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                                return True;
                        }
***************
*** 187,207 ****
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
!                       $this->db->query($sql,__LINE__,__FILE__);
                        
!                       while ($this->db->next_record())
                        {
!                               
$this->sites[$this->db->f('site_name')]['site_id']       = 
$this->db->f('site_id');
!                               
$this->sites[$this->db->f('site_name')]['site_name']     = 
$this->db->f('site_name');
!                               
$this->sites[$this->db->f('site_name')]['site_title']    = 
$this->db->f('site_title');
!                               
$this->sites[$this->db->f('site_name')]['site_url']      = 
$this->db->f('site_url');
!                               
$this->sites[$this->db->f('site_name')]['site_root']     = 
$this->db->f('site_root');
!                               
$this->sites[$this->db->f('site_name')]['site_security'] = 
$this->db->f('site_security');
!                               
$this->sites[$this->db->f('site_name')]['admin_name']    = 
$this->db->f('admin_name');
!                               
$this->sites[$this->db->f('site_name')]['admin_email']   = 
$this->db->f('admin_email');
!                               
$this->sites[$this->db->f('site_name')]['site_header']   = 
$this->db->f('site_header');
!                               
$this->sites[$this->db->f('site_name')]['site_footer']   = 
$this->db->f('site_footer');
!                               
$this->sites[$this->db->f('site_name')]['site_version']  = 
$this->db->f('site_version');
                        }
!                       $this->total = $this->db->num_rows();
                        $total = $this->total;
                        return $this->sites;
--- 195,215 ----
  
                        $sql = "SELECT * FROM $this->table $whereclause 
$orderclause";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
                        
!                       while ($GLOBALS['phpgw']->db->next_record())
                        {
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_id']       = 
$GLOBALS['phpgw']->db->f('site_id');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_name']     = 
$GLOBALS['phpgw']->db->f('site_name');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_title']    = 
$GLOBALS['phpgw']->db->f('site_title');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_url']      = 
$GLOBALS['phpgw']->db->f('site_url');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_root']     = 
$GLOBALS['phpgw']->db->f('site_root');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_security'] = 
$GLOBALS['phpgw']->db->f('site_security');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['admin_name']    = 
$GLOBALS['phpgw']->db->f('admin_name');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['admin_email']   = 
$GLOBALS['phpgw']->db->f('admin_email');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_header']   = 
$GLOBALS['phpgw']->db->f('site_header');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_footer']   = 
$GLOBALS['phpgw']->db->f('site_footer');
!                               
$this->sites[$GLOBALS['phpgw']->db->f('site_name')]['site_version']  = 
$GLOBALS['phpgw']->db->f('site_version');
                        }
!                       $this->total = $GLOBALS['phpgw']->db->num_rows();
                        $total = $this->total;
                        return $this->sites;
***************
*** 255,262 ****
                        {
                                $sql = "SELECT site_id FROM $this->table WHERE 
site_name='$site_name'";
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               if($this->db->next_record())
                                {
!                                       $siteid = $this->db->f(0);
                                        return $siteid;
                                }
--- 263,270 ----
                        {
                                $sql = "SELECT site_id FROM $this->table WHERE 
site_name='$site_name'";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                               if($GLOBALS['phpgw']->db->next_record())
                                {
!                                       $siteid = $GLOBALS['phpgw']->db->f(0);
                                        return $siteid;
                                }
***************
*** 274,281 ****
                        {
                                $sql = "SELECT site_name FROM $this->table 
WHERE site_id=$siteid";
!                               $this->db->query($sql,__LINE__,__FILE__);
!                               if($this->db->next_record())
                                {
!                                       $site_name = $this->db->f(0);
                                        return $site_name;
                                }
--- 282,289 ----
                        {
                                $sql = "SELECT site_name FROM $this->table 
WHERE site_id=$siteid";
!                               
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                               if($GLOBALS['phpgw']->db->next_record())
                                {
!                                       $site_name = 
$GLOBALS['phpgw']->db->f(0);
                                        return $site_name;
                                }
***************
*** 301,306 ****
                        }
                        $sql = "SELECT site_id FROM $this->table WHERE 
site_name='$site_name'";
!                       $this->db->query($sql,__LINE__,__FILE__);
!                       if($this->db->next_record())
                        {
                                return True;
--- 309,314 ----
                        }
                        $sql = "SELECT site_id FROM $this->table WHERE 
site_name='$site_name'";
!                       $GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
!                       if($GLOBALS['phpgw']->db->next_record())
                        {
                                return True;

Index: class.uisite.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.uisite.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.uisite.inc.php        3 Feb 2002 15:16:27 -0000       1.1.1.1
--- class.uisite.inc.php        3 Feb 2002 17:37:38 -0000       1.2
***************
*** 194,198 ****
                        if ($GLOBALS['HTTP_POST_VARS']['submit'])
                        {
!                               _debug_array($GLOBALS['HTTP_POST_VARS']);
                                $errorcount = 0;
  
--- 194,198 ----
                        if ($GLOBALS['HTTP_POST_VARS']['submit'])
                        {
!                               //_debug_array($GLOBALS['HTTP_POST_VARS']);
                                $errorcount = 0;
  




reply via email to

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