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.4,1.5


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: wcm/inc class.bosite.inc.php,1.4,1.5
Date: Sun, 24 Feb 2002 17:49:56 -0500

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

Modified Files:
        class.bosite.inc.php 
Log Message:
Now publishes each site page using the page_url (should read page_file, e.g. 
index.php)



Index: class.bosite.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/inc/class.bosite.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.bosite.inc.php        24 Feb 2002 22:36:39 -0000      1.4
--- class.bosite.inc.php        24 Feb 2002 22:49:54 -0000      1.5
***************
*** 211,220 ****
                        $this->site = $this->read($siteid,True);
  
-                       $out = $this->phpheader;
- 
                        $elements = CreateObject('wcm.boelement');
  
-                       $page = $this->site['site_pages'][0];
- 
                        $SITE_ROOT = PHPGW_SERVER_ROOT . SEP . 'wcm' . SEP . 
'website' . SEP . 'templates';
                        define('PHPGW_TEMPLATE_DIR', 
ExecMethod('phpgwapi.phpgw.common.get_tpl_dir', 'phpgwapi'));
--- 211,216 ----
***************
*** 245,315 ****
                        $tpl->set_var('right_width',   $site_right ? 
$site_right : '130');
  
!                       /* Read and parse page header */
!                       $header_data = $elements->read($page['page_header']);
!                       $header = $header_data['element_source'];
!                       $tpl->set_var('header',$header ? $header : 
'<html><head>HEADER</head><body>');
  
!                       /* Start of page body */
!                       $out .= $tpl->fp('out','framing_table_start');
  
!                       /* Now parse each top, left, middle, right, and bottom 
element */
!                       $_list = array('top','left','mid','right','bottom');
  
!                       while(list(,$section) = each($_list))
!                       {
!                               $working = '';
  
!                               while(list($key,$val) = 
@each($page['page_elements'][$section]))
                                {
!                                       switch($val['element_type'])
                                        {
!                                               case '4':
!                                               /* Hook */
!                                               
$GLOBALS['phpgw']->hooks->single('website_' . $section, 
$val['element_source'],True);
!                                               $working .= 
$GLOBALS['phpgw_info']['wcm'][$section];
!                                               break;
!                                               case '3':
!                                               case '2':
!                                               /* file/image */
!                                               
if(@stat($val['element_source']))
                                                {
!                                                       $f = 
fopen($val['element_source'],'rb');
!                                                       while($line = 
fgets($f,1024))
                                                        {
!                                                               $working .= 
$line;
                                                        }
!                                                       fclose($f);
!                                                       unset($f);
!                                                       unset($line);
                                                }
-                                               break;
-                                               case '1':
-                                               /* HTML from db */
-                                               $working .= 
$val['element_source'];
-                                               break;
-                                               default:
-                                               break;
                                        }
                                }
  
!                               $tpl->set_var($section . '_content', $working ? 
$working : strtoupper($section));
!                               $out .= $tpl->fp('out', $section . '_start');
!                               $out .= $tpl->fp('out', $section . '_end');
!                       }
  
!                       /* Read and parse page footer */
!                       $footer_data = $elements->read($page['page_footer']);
!                       $footer = $footer_data['element_source'];
!                       $tpl->set_var('footer',$footer ? $footer : 
'FOOTER</body></html>');
  
!                       /* end of page body */
!                       $out .= $tpl->fp('out','framing_table_end');
  
!                       if (PHP_OS != 'Windows' && PHP_OS != 'OS/2')
!                       {
!                               $out = ereg_replace("\r\n","\n",$out);
                        }
! 
!                       return $this->publish_local($out);
                }
  
--- 241,321 ----
                        $tpl->set_var('right_width',   $site_right ? 
$site_right : '130');
  
!                       while(list(,$page) = each($this->site['site_pages']))
!                       {
!                               $outfile = $page['page_url'];
! 
!                               /* add our expiration source code (coming soon) 
*/
!                               $out = $this->phpheader;
  
!                               /* Read and parse page header */
!                               $header_data = 
$elements->read($page['page_header']);
!                               $header = $header_data['element_source'];
!                               $tpl->set_var('header',$header ? $header : 
'<html><head></head><body>');
  
!                               /* Start of page body */
!                               $out .= $tpl->fp('out','framing_table_start');
  
!                               /* Now parse each top, left, middle, right, and 
bottom element */
!                               $_list = 
array('top','left','mid','right','bottom');
  
!                               while(list(,$section) = each($_list))
                                {
!                                       $working = '';
! 
!                                       while(list($key,$val) = 
@each($page['page_elements'][$section]))
                                        {
!                                               switch($val['element_type'])
                                                {
!                                                       case '4':
!                                                       /* Hook */
!                                                       
$GLOBALS['phpgw']->hooks->single('website_' . $section, 
$val['element_source'],True);
!                                                       $working .= 
$GLOBALS['phpgw_info']['wcm'][$section];
!                                                       break;
!                                                       case '3':
!                                                       case '2':
!                                                       /* file/image */
!                                                       
if(@stat($val['element_source']))
                                                        {
!                                                               $f = 
fopen($val['element_source'],'rb');
!                                                               while($line = 
fgets($f,1024))
!                                                               {
!                                                                       
$working .= $line;
!                                                               }
!                                                               fclose($f);
!                                                               unset($f);
!                                                               unset($line);
                                                        }
!                                                       break;
!                                                       case '1':
!                                                       /* HTML from db */
!                                                       $working .= 
$val['element_source'];
!                                                       break;
!                                                       default:
!                                                       break;
                                                }
                                        }
+ 
+                                       $tpl->set_var($section . '_content', 
$working ? $working : strtoupper($section));
+                                       $out .= $tpl->fp('out', $section . 
'_start');
+                                       $out .= $tpl->fp('out', $section . 
'_end');
                                }
  
!                               /* Read and parse page footer */
!                               $footer_data = 
$elements->read($page['page_footer']);
!                               $footer = $footer_data['element_source'];
!                               $tpl->set_var('footer',$footer ? $footer : 
'</body></html>');
  
!                               /* end of page body */
!                               $out .= $tpl->fp('out','framing_table_end');
  
!                               /* Clean out the ^M for unix */
!                               if ((PHP_OS != 'Windows') && (PHP_OS != 'OS/2'))
!                               {
!                                       $out = ereg_replace("\r\n","\n",$out);
!                               }
  
!                               $this->publish_local($outfile,$out);
                        }
!                       return True;
                }
  
***************
*** 327,338 ****
  
                /* Write to a local file */
!               function publish_local($content='')
                {
!                       if(!$content)
                        {
                                return False;
                        }
  
!                       $fp = fopen($this->site['site_puburl'] . 
'/index.php','wb');
                        fwrite($fp,$content);
                        fclose($fp);
--- 333,344 ----
  
                /* Write to a local file */
!               function publish_local($outfile='',$content='')
                {
!                       if(!$content && $outfile)
                        {
                                return False;
                        }
  
!                       $fp = fopen($this->site['site_puburl'] . SEP . 
$outfile,'wb');
                        fwrite($fp,$content);
                        fclose($fp);




reply via email to

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