phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site config.inc.php,NONE,1.1 fun


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/sitemgr-site config.inc.php,NONE,1.1 functions.inc.php,1.3,1.4 index.php,1.5,1.6 config.inc.php.template,1.6,NONE
Date: Thu, 16 Jan 2003 22:37:55 -0500

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

Modified Files:
        functions.inc.php index.php 
Added Files:
        config.inc.php 
Removed Files:
        config.inc.php.template 
Log Message:
First commit of a new modularized architecture for sitemgr 


--- NEW FILE ---
<?php
        /***********************************************************\
        * Edit the values in the following array to configure       *
        * the site generator.                                       *
        \***********************************************************/
        $sitemgr_info = array(
                // add trailing slash
                'phpgw_path'           => '../../',
                'htaccess_404'         => 'disabled'
        );

        /***********************************************************\
        * Leave the rest of this file alone.                        *
        \***********************************************************/

                if (!file_exists($sitemgr_info['phpgw_path'] . 
'header.inc.php'))
                {
                        die("Header file not found.  Either your path to 
phpGroupWare in the config.inc.php file is bad, or you have not setup 
phpGroupWare.");
                }

                include($sitemgr_info['phpgw_path'] . 'header.inc.php');

                $GLOBALS['phpgw_info']['flags']['currentapp'] = 'login';
                include(PHPGW_SERVER_ROOT . '/phpgwapi/inc/functions.inc.php');
                $GLOBALS['phpgw_info']['flags']['currentapp'] = 'sitemgr-site';

                $pref = CreateObject('sitemgr.sitePreference_SO');
                $sitemgr_info = array_merge($sitemgr_info,$pref->getallprefs());
                unset($pref);
                $sitemgr_info['sitelanguages'] = 
explode(',',$sitemgr_info['sitelanguages']);

                //this is useful when you changed the API session class to not 
overgeneralize the session cookies
                if ($GLOBALS['HTTP_GET_VARS']['PHPSESSID'])
                {
                        
$GLOBALS['phpgw']->session->phpgw_setcookie('PHPSESSID',$GLOBALS['HTTP_GET_VARS']['PHPSESSID']);
                }


                if (! $GLOBALS['phpgw']->session->verify())
                {
                        $GLOBALS['sessionid'] = 
$GLOBALS['phpgw']->session->create($sitemgr_info['anonymous-user'],$sitemgr_info['anonymous-passwd'],
 'text');
                        if (!$GLOBALS['sessionid'])
                        {
                                die(lang('NO ANONYMOUS USER ACCOUNTS INSTALLED. 
 NOTIFY THE ADMINISTRATOR.'));
                                //exit;
                        }
                        
//$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link($sitemgr_url . 
'index.php'));
                }
                ?>

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/functions.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** functions.inc.php   5 Dec 2002 22:15:00 -0000       1.3
--- functions.inc.php   17 Jan 2003 03:37:52 -0000      1.4
***************
*** 14,22 ****
        function sitemgr_link2($url, $extravars = '')
        {
!               // humor me with this wrapper function...
!               return sitemgr_link($url, $extravars);
        }
  
!       function sitemgr_link($url, $extravars = '')
        {
                $kp3 = $GLOBALS['HTTP_GET_VARS']['kp3'] ? 
$GLOBALS['HTTP_GET_VARS']['kp3'] : $GLOBALS['HTTP_COOKIE_VARS']['kp3'];
--- 14,23 ----
        function sitemgr_link2($url, $extravars = '')
        {
!               //I remove the URL argument for sitemgr_link,since it should 
always be index.php
!               //which shouldn't be needed since the webserver interprets '/' 
as '/index.php'.
!               return sitemgr_link($extravars);
        }
  
!       function sitemgr_link($extravars = '')
        {
                $kp3 = $GLOBALS['HTTP_GET_VARS']['kp3'] ? 
$GLOBALS['HTTP_GET_VARS']['kp3'] : $GLOBALS['HTTP_COOKIE_VARS']['kp3'];
***************
*** 37,42 ****
                $page_name = $extravars['page_name'];
  
!               if (($url == '' || $url == '/' || $url == '/index.php') &&
!                       !$page_name == '' &&
                        $GLOBALS['sitemgr_info']['htaccess_404']=='enabled')
                {
--- 38,42 ----
                $page_name = $extravars['page_name'];
  
!               if (!$page_name == '' &&
                        $GLOBALS['sitemgr_info']['htaccess_404']=='enabled')
                {
***************
*** 51,60 ****
                        }
                        $extravars = $newextravars;
                }
  
!               // In certain instances a url may look like this: 
'http://xyz//hi.php' or
                // like this: '//index.php?blahblahblah' -- so the code below 
will remove
                // the inappropriate double slashes and leave appropriate ones
!               $url = $GLOBALS['sitemgr_info']['sitemgr-site_url'] . $url;
                $url = substr(ereg_replace('([^:])//','\1/','s'.$url),1);
  
--- 51,62 ----
                        }
                        $extravars = $newextravars;
+ 
                }
  
!               // In certain instances (wouldn't it be better to fix these 
instances? MT)
!               // a url may look like this: 'http://xyz//hi.php' or
                // like this: '//index.php?blahblahblah' -- so the code below 
will remove
                // the inappropriate double slashes and leave appropriate ones
!               $url = $GLOBALS['sitemgr_info']['sitemgr-site-url'] . $url;
                $url = substr(ereg_replace('([^:])//','\1/','s'.$url),1);
  
***************
*** 69,73 ****
                                        $new_extravars .= '&';
                                }
!                               $new_extravars .= "$key=$value";
                        }
                        // This needs to be explictly reset to a string 
variable type for PHP3
--- 71,75 ----
                                        $new_extravars .= '&';
                                }
!                               $new_extravars .= (($value == '') ? $key : 
"$key=$value");
                        }
                        // This needs to be explictly reset to a string 
variable type for PHP3

Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/sitemgr-site/index.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** index.php   5 Dec 2002 22:15:00 -0000       1.5
--- index.php   17 Jan 2003 03:37:52 -0000      1.6
***************
*** 35,46 ****
        require_once('./functions.inc.php');
  
        include './inc/class.ui.inc.php';
        include './inc/class.bo.inc.php';
!       include './inc/class.so.inc.php';
!       include './inc/class.Template2.inc.php';
! 
  
        $objui = new ui;
  
  
        $page_id = $_GET['page_id'];
--- 35,50 ----
        require_once('./functions.inc.php');
  
+       $Common_BO = CreateObject('sitemgr.Common_BO',True);
+ 
        include './inc/class.ui.inc.php';
        include './inc/class.bo.inc.php';
!       include './inc/class.Template3.inc.php';
  
        $objui = new ui;
+       //I move the creation of the bo here, so that in the template we have 
access to it without creating it a second time
+       $objbo = new bo;
+       $objbo->setsitemgrPreferredLanguage();
  
+       $page = CreateObject('sitemgr.Page_SO');
  
        $page_id = $_GET['page_id'];
***************
*** 62,70 ****
                $objui->displayPage($page_id);
        }
!       elseif ($index)
        {
                $objui->displayIndex();
        }
!       elseif ($toc)
        {
                $objui->displayTOC();
--- 66,74 ----
                $objui->displayPage($page_id);
        }
!       elseif (isset($index))
        {
                $objui->displayIndex();
        }
!       elseif (isset($toc))
        {
                $objui->displayTOC();
***************
*** 81,84 ****
--- 85,89 ----
                else
                {
+                       $index = 1; 
                        $objui->displayIndex();
                }

--- config.inc.php.template DELETED ---





reply via email to

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