Cheetah
design.php
Go to the documentation of this file.
1 <?php
2 
8 // select menu items and set title header
9 
10 require_once(CH_DIRECTORY_PATH_INC . 'db.inc.php');
11 require_once(CH_DIRECTORY_PATH_INC . 'params.inc.php');
12 require_once(CH_DIRECTORY_PATH_INC . 'design.inc.php');
13 require_once(CH_DIRECTORY_PATH_CLASSES . 'ChWsbPageView.php');
14 
15 $aForum = array ();
16 if (isset($_GET['action']) && 'goto' == $_GET['action'] && $_GET['forum_id']) {
17  $aForum = $GLOBALS['f']->fdb->getForumByUri (process_db_input(rawurldecode($_GET['forum_id'])));
18  $GLOBALS['oTopMenu']->setCustomVar('ch_events_view_uri', $aForum['forum_uri']);
19  $GLOBALS['oTopMenu']->setCustomSubHeader($aForum['forum_title']);
20 } elseif (isset($_GET['action']) && 'goto' == $_GET['action'] && $_GET['topic_id']) {
21  $aTopic = $GLOBALS['f']->fdb->getTopicByUri (process_db_input(rawurldecode($_GET['topic_id'])));
22  $aForum = $GLOBALS['f']->fdb->getForum ($aTopic['forum_id']);
23  $GLOBALS['oTopMenu']->setCustomVar('ch_events_view_uri', $aTopic['forum_uri']);
24  $GLOBALS['oTopMenu']->setCustomSubHeader($aTopic['forum_title']);
25 } else {
26  $GLOBALS['oTopMenu']->setCustomVar('ch_events_view_uri', '../');
27 }
28 
29 if ((isset($_GET['action']) && 'goto' == $_GET['action'] && $_GET['forum_id']) || (isset($_GET['action']) && 'goto' == $_GET['action'] && $_GET['topic_id'])) {
30  $oModuleMain = ChWsbModule::getInstance('ChEventsModule');
31  if ($oModuleMain && $aForum) {
32  $GLOBALS['oTopMenu']->setCustomSubHeaderUrl(CH_WSB_URL_ROOT . $oModuleMain->_oConfig->getBaseUri() . 'view/' . $aForum['forum_uri']);
33  $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(
34  _t('_ch_events') => CH_WSB_URL_ROOT . $oModuleMain->_oConfig->getBaseUri() . 'home/',
35  $aForum['forum_title'] => CH_WSB_URL_ROOT . $oModuleMain->_oConfig->getBaseUri() . 'view/' . $aForum['forum_uri'],
36  _t('_ch_events_menu_view_forum') => '',
37  ));
38  }
39 }
40 
41 // use default cheetah design
42 
43 $aPathInfo = pathinfo(__FILE__);
44 require_once ($aPathInfo['dirname'] . '/../base/design.php');
45 
46 // do not show forum index page - always select Events category at least
47 
48 if (!isset($_GET['action']) && !isset($_POST['action'])) {
49  $_GET['action'] = 'goto';
50  $_GET['cat_id'] = 'Events';
51 }
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
ChWsbModule\getInstance
static getInstance($sClassName)
Definition: ChWsbModule.php:89
$aForum
$aForum
Definition: design.php:15
php
$_GET
$_GET['debug']
Definition: index.php:67
$aPathInfo
$aPathInfo
Definition: design.php:10
$GLOBALS
$GLOBALS['name_index']
Definition: design.php:87
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509