Cheetah
design.php
Go to the documentation of this file.
1 <?php
2 
8 // generate custom $glHeader and $glFooter variables here
9 
10 // ******************* include cheetah header/footer [begin]
11 
12 check_logged();
13 
14 require_once(CH_DIRECTORY_PATH_INC . 'db.inc.php');
15 require_once(CH_DIRECTORY_PATH_INC . 'params.inc.php');
16 require_once(CH_DIRECTORY_PATH_INC . 'design.inc.php');
17 require_once(CH_DIRECTORY_PATH_CLASSES . 'ChWsbPageView.php');
18 
19 
21 {
22  function __construct($sRootPath = CH_DIRECTORY_PATH_ROOT, $sRootUrl = CH_WSB_URL_ROOT)
23  {
24  parent::__construct($sRootPath, $sRootUrl);
25  $this->addLocation('ChWsbOrcaForums', $GLOBALS['gConf']['dir']['base'], $GLOBALS['gConf']['url']['base']);
26  }
27 }
28 
30 {
31  var $sMarker = '-=++=-';
32 
33  function __construct()
34  {
35  parent::__construct('forums_index');
36  }
37 
39  {
40  return $this->sMarker;
41  }
42 }
43 
45 {
46  var $sMarker = '-=++=-';
47 
48  function __construct()
49  {
50  parent::__construct('forums_home');
51  }
52 
54  {
55  $oTemplate = new ChWsbOrcaForumsTemplate();
56  $aVars = array(
57  'base_url_forum' => $GLOBALS['gConf']['url']['base'],
58  );
59  return array($oTemplate->parseHtmlByName('search_block.html', $aVars));
60  }
61 
63  {
64  global $gConf;
65 
66  $s = '<div class="forums_index_short">';
67  $ac = $GLOBALS['f']->fdb->getCategs();
68  foreach ($ac as $c) {
69  $s .= '<div class="forums_index_short_cat ch-def-font-large"><a href="' . $gConf['url']['base'] . sprintf($gConf['rewrite']['cat'], $c['cat_uri'], 0) . '" onclick="return f.selectForumIndex(\'' . $c['cat_uri'] . '\')">'. $c['cat_name'] .'</a></div>';
70  $af = $GLOBALS['f']->fdb->getForumsByCatUri (filter_to_db($c['cat_uri']));
71  foreach ($af as $ff)
72  $s .= '<div class="forums_index_short_forum ch-def-padding-sec-left"><a href="' . $gConf['url']['base'] . sprintf($gConf['rewrite']['forum'], $ff['forum_uri'], 0) . '" onclick="return f.selectForum(\'' . $ff['forum_uri'] . '\', 0)">' . $ff['forum_title'] . '</a></div>';
73  }
74  $s .= '</div>';
75  return array($s);
76  }
77 
78  function getBlockCode_RecentTopics()
79  {
80  return $this->sMarker;
81  }
82 }
83 
84 
85 global $_page, $glHeader, $glFooter, $logged, $_ni;
86 
87 $GLOBALS['name_index'] = $_page['name_index'] = 55;
88 
89 $_page['header'] = $gConf['def_title'];
90 $_page['header_text'] = $gConf['def_title'];
91 
92 $_ni = $_page['name_index'];
93 $_page_cont[$_ni]['page_main_code'] = '-=++=-';
94 
95 global $gConf;
96 
97 $sCssPathUrl = ch_ltrim_str($gConf['url']['css'], CH_WSB_URL_ROOT);
98 $sCssPathDir = ch_ltrim_str("{$gConf['dir']['layouts']}{$gConf['skin']}/css/", CH_DIRECTORY_PATH_ROOT);
99 $GLOBALS['oSysTemplate']->addCss ("{$sCssPathDir}|{$sCssPathUrl}|main.css");
100 
101 $sJsPathUrl = ch_ltrim_str($gConf['url']['js'], CH_WSB_URL_ROOT);
102 $sJsPathDir = ch_ltrim_str($gConf['dir']['js'], CH_DIRECTORY_PATH_ROOT);
103 $GLOBALS['oSysTemplate']->addJs (array(
104  'history.js',
105  "{$sJsPathDir}|{$sJsPathUrl}|util.js",
106  "{$sJsPathDir}|{$sJsPathUrl}|ChError.js",
107  "{$sJsPathDir}|{$sJsPathUrl}|ChXmlRequest.js",
109  "{$sJsPathDir}|{$sJsPathUrl}|ChForum.js",
110  "{$sJsPathDir}|{$sJsPathUrl}|ChHistory.js",
111  "{$sJsPathDir}|{$sJsPathUrl}|ChLogin.js",
112  "{$sJsPathDir}|{$sJsPathUrl}|ChAdmin.js",
113 ));
114 
115 $GLOBALS['ChWsbTemplateInjections']['page_'.$_ni]['injection_body'][] = array('type' => 'text', 'data' => 'id="body" onload="if(!document.body) { document.body = document.getElementById(\'body\'); }; h = new ChHistory(\'' . $gConf['url']['base'] . '\'); document.h = h; return h.init(\'h\'); "');
116 
117 if (CH_ORCA_INTEGRATION == 'cheetah') {
118  $aVars = array ('ForumBaseUrl' => $gConf['url']['base']);
119  $GLOBALS['oTopMenu']->setCustomSubActions($aVars, 'ch_forum_title', false);
120 }
121 
122 if (isLogged()) {
123  ch_import('ChWsbEditor');
124  $oEditor = ChWsbEditor::getObjectInstance();
125  $sEditorId = isset($_REQUEST['new_topic']) ? '#tinyEditor' : '#fakeEditor';
126  if ($oEditor) {
127  if ('sys_tinymce' == $oEditor->getObjectName())
128  $oEditor->setCustomConf('setup :
129 function(ed) {
130  ed.on("init", function(e) {
131  if ("undefined" === typeof(glOrcaSettings))
132  glOrcaSettings = tinyMCE.activeEditor["settings"];
133  orcaInitInstance(ed);
134  });
135 },');
136  $sEditor .= $oEditor->attachEditor ($sEditorId, CH_EDITOR_FULL) . '<div id="fakeEditor" style="display:none;"></div>';
137  }
138 }
139 
140 
141 // add css from pages
142 $sAction = ch_get('action');
143 if ('goto' == $sAction && isset($_GET['index'])) {
144  $o = new ChWsbOrcaForumsIndex();
145  $o->getCode();
146 }
147 elseif (!$sAction) {
148  $o = new ChWsbOrcaForumsHome();
149  $o->getCode();
150 }
151 
152 
153 ob_start();
154 PageCode();
155 $sCheetahDesign = ob_get_clean();
156 
157 $iPos = strpos($sCheetahDesign, '-=++=-');
158 $glHeader = substr ($sCheetahDesign, 0, $iPos) . $sEditor;
159 $glFooter = substr ($sCheetahDesign, $iPos + 6 - strlen($sCheetahDesign));
162 
163 // ******************* include cheetah header/footer [ end ]
164 
document
Output SortAttr HTML Purifier will sort attributes by name before writing them back to the document
Definition: Output.SortAttr.txt:8
$gConf
global $gConf
Definition: design.php:95
ChWsbTemplate
Definition: ChWsbTemplate.php:121
$sRootPath
$sRootPath
Definition: header.inc.php:37
ChWsbOrcaForumsHome\__construct
__construct()
Definition: design.php:48
check_logged
check_logged()
Definition: admin.inc.php:238
ChWsbPageView
Definition: ChWsbPageView.php:99
ChWsbTemplate\addLocation
addLocation($sKey, $sLocationPath, $sLocationUrl)
Definition: ChWsbTemplate.php:290
ChWsbOrcaForumsIndex\getBlockCode_FullIndex
getBlockCode_FullIndex()
Definition: design.php:38
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ch_get
ch_get($sName)
Definition: utils.inc.php:1664
CH_ORCA_INTEGRATION
const CH_ORCA_INTEGRATION
Definition: ChForumSiteMaps.php:10
php
isLogged
isLogged()
Definition: profiles.inc.php:24
ChWsbOrcaForumsIndex\__construct
__construct()
Definition: design.php:33
$iPos
$iPos
Definition: design.php:157
$sJsPathDir
$sJsPathDir
Definition: design.php:102
ChWsbOrcaForumsIndex
Definition: design.php:30
$_GET
$_GET['debug']
Definition: index.php:67
$glHeader
global $glHeader
Definition: design.php:85
ChWsbOrcaForumsTemplate
Definition: design.php:21
ChWsbOrcaForumsHome\$sMarker
$sMarker
Definition: design.php:46
$sCssPathUrl
$sCssPathUrl
Definition: design.php:97
ChWsbEditor\getObjectInstance
static getObjectInstance($sObject=false)
Definition: ChWsbEditor.php:87
$glIndexBegin
$glIndexBegin
Definition: design.php:160
$_REQUEST
$_REQUEST['action']
Definition: cmd.php:11
$sCheetahDesign
$sCheetahDesign
Definition: design.php:155
$GLOBALS
$GLOBALS['name_index']
Definition: design.php:87
ChWsbOrcaForumsHome\getBlockCode_ShortIndex
getBlockCode_ShortIndex()
Definition: design.php:62
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
ChXslTransform
Definition: ChXslTransform.php:19
PageCode
PageCode($oTemplate=null)
Definition: design.inc.php:91
CH_EDITOR_FULL
const CH_EDITOR_FULL
Definition: ChWsbEditor.php:20
$sCssPathDir
$sCssPathDir
Definition: design.php:98
ChWsbOrcaForumsTemplate\__construct
__construct($sRootPath=CH_DIRECTORY_PATH_ROOT, $sRootUrl=CH_WSB_URL_ROOT)
Definition: design.php:22
$aVars
$aVars
Definition: license.php:101
$s
$s
Definition: embed.php:13
$glIndexEnd
$glIndexEnd
Definition: design.php:161
$sJsPathUrl
$sJsPathUrl
Definition: design.php:101
$o
$o
Definition: cmd.php:193
ChWsbOrcaForumsHome
Definition: design.php:45
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
$sAction
if(CH_ORCA_INTEGRATION=='cheetah') if(isLogged()) $sAction
Definition: design.php:142
ChWsbOrcaForumsIndex\$sMarker
$sMarker
Definition: design.php:31
$glFooter
global $glFooter
Definition: design.php:85
ChWsbOrcaForumsHome\getBlockCode_Search
getBlockCode_Search()
Definition: design.php:53