[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] sitemgr/sitemgr-site index.php,1.7.2.2.4.1
From: |
skwashd |
Subject: |
[Phpgroupware-cvs] sitemgr/sitemgr-site index.php,1.7.2.2.4.1 |
Date: |
Sat, 12 Nov 2005 14:15:00 +0100 |
Update of sitemgr/sitemgr-site
Modified Files:
Branch: skwashd-16-compat
index.php lines: +19 -15
Log Message:
added default page per cat
====================================================
Index: sitemgr/sitemgr-site/index.php
diff -u sitemgr/sitemgr-site/index.php:1.7
sitemgr/sitemgr-site/index.php:1.7.2.2.4.1
--- sitemgr/sitemgr-site/index.php:1.7 Sat Jan 18 04:30:34 2003
+++ sitemgr/sitemgr-site/index.php Sat Nov 12 13:15:38 2005
@@ -21,66 +21,67 @@
'noapi' => True,
'nonavbar' => True
);
- require_once('./security.inc.php');
if (file_exists('./config.inc.php'))
{
- require_once('./config.inc.php');
+ include('./config.inc.php');
}
else
{
die ("You need to copy config.inc.php.template to
config.inc.php and edit the file before continuing.");
}
- require_once('./functions.inc.php');
-
- $Common_BO = CreateObject('sitemgr.Common_BO',True);
+ include('./functions.inc.php');
include './inc/class.ui.inc.php';
- include './inc/class.bo.inc.php';
+ include './inc/class.sitebo.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;
+
+ $Common_BO = CreateObject('sitemgr.Common_BO');
+ $objbo = new sitebo;
+ $Common_BO->sites->set_currentsite($site_url,$objbo->getmode());
+ $sitemgr_info =
array_merge($sitemgr_info,$Common_BO->sites->current_site);
+ $sitemgr_info['sitelanguages'] =
explode(',',$sitemgr_info['site_languages']);
$objbo->setsitemgrPreferredLanguage();
+ $objui = new ui;
$page = CreateObject('sitemgr.Page_SO');
- $page_id = $_GET['page_id'];
- $page_name = $_GET['page_name'];
- $category_id = $_GET['category_id'];
- $toc = $_GET['toc'];
- $index = $_GET['index'];
-
- if ($page_name)
+ if ( isset($_GET['page_name']) && $_GET['page_name'] )
{
- $objui->displayPageByName($page_name);
+ $objui->displayPageByName($_GET['page_name']);
}
- elseif($category_id)
+ elseif ( isset($_GET['category_id']) && $_GET['category_id'] )
{
- $objui->displayTOC($category_id);
+ $cat = $Common_BO->cats->getCategory($_GET['category_id']);
+ if ( isset($cat->def_page) && $cat->def_page )
+ {
+ $page = $Common_BO->pages->getPage($cat->def_page);
+ if ( isset($page->id) && $page->id )
+ {
+ $objui->displayPage($page->id);
+ exit;
+ }
+ }
+ $objui->displayTOC($_GET['category_id']);
}
- elseif ($page_id)
+ elseif ( isset($_GET['page_id']) && $_GET['page_id'])
{
- $objui->displayPage($page_id);
+ $objui->displayPage($_GET['page_id']);
}
- elseif (isset($index))
+ elseif (isset($_GET['index']))
{
$objui->displayIndex();
}
- elseif (isset($toc))
+ elseif (isset($_GET['toc']))
{
$objui->displayTOC();
}
else
{
- $objsp_so = CreateObject('sitemgr.sitePreference_SO');
- $home_page = $objsp_so->getPreference('home-page-id');
- unset($objsp_so);
- if ($home_page)
+ if ($sitemgr_info['home_page_id'])
{
- $objui->displayPage($home_page);
+ $objui->displayPage($sitemgr_info['home_page_id']);
}
else
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] sitemgr/sitemgr-site index.php,1.7.2.2.4.1,
skwashd <=