Cheetah
All Classes Namespaces Files Functions Variables Pages
ChWsbMobileTemplate.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbModuleTemplate');
9 
11 {
12  var $_aMobileJs = array ('jquery.js');
13  var $_aMobileCss = array ('default.css', 'mobile.css');
14 
15  /*
16  * Constructor.
17  */
18  function __construct(&$oConfig, &$oDb, $sRootPath = CH_DIRECTORY_PATH_ROOT, $sRootUrl = CH_WSB_URL_ROOT)
19  {
20  parent::__construct($oConfig, $oDb, $sRootPath, $sRootUrl);
21  }
22 
23  function addMobileCss($mixedFiles)
24  {
25  if (is_array($mixedFiles))
26  $this->_aMobileJs = array_merge($this->_aMobileJs, $mixedFiles);
27  else
28  $this->_aMobileJs[] = $mixedFiles;
29  }
30 
31  function addMobileJs($mixedFiles)
32  {
33  if (is_array($mixedFiles))
34  $this->_aMobileCss = array_merge($this->_aMobileCss, $mixedFiles);
35  else
36  $this->_aMobileCss[] = $mixedFiles;
37  }
38 
39  function pageCode ($sTitle, $isDesignBox = true, $isWrap = true)
40  {
41  global $_page;
43 
44  $GLOBALS['ChWsbTemplateJs'] = array ();
45  $GLOBALS['ChWsbTemplateCss'] = array ();
46  $this->addCss($this->_aMobileCss);
47  $this->addJs($this->_aMobileJs);
48 
49  $sOutput = $this->pageEnd();
50 
51  if ($isDesignBox) {
52  $aVars = array ('content' => $sOutput);
53  $sOutput = $this->parseHtmlByName('mobile_box.html', $aVars);
54  }
55 
56  if ($isWrap) {
57  $aVars = array ('content' => $sOutput);
58  $sOutput = $this->parseHtmlByName('mobile_page_padding.html', $aVars);
59  }
60 
61  $iNameIndex = 11;
62  $_page['name_index'] = $iNameIndex;
63  $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
64  $_page_cont[$iNameIndex]['page_main_code'] = $sOutput;
65 
66  PageCode($this);
67  }
68 
69  function displayNoData($sCaption = false)
70  {
71  $this->displayMsg(_t('_Empty'), false, $sCaption);
72  }
73 
74  function displayAccessDenied($sCaption = false)
75  {
76  $this->displayMsg(_t('_Access denied'), false, $sCaption);
77  }
78 
80  {
81  header("HTTP/1.0 404 Not Found");
82  $this->displayMsg(_t('_sys_request_page_not_found_cpt'));
83  }
84 
85  function displayMsg($sMsg, $bTranslateMsg = false, $sTitle = false)
86  {
87  $sMsg = $bTranslateMsg ? _t($sMsg) : $sMsg;
88  $sTitle = $bTranslateMsg ? _t($sTitle) : $sTitle;
89  echo $sMsg;
90  $this->pageCode($sTitle ? $sTitle : $sMsg);
91  }
92 }
header
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
Definition: URI.MungeResources.txt:10
ChWsbMobileTemplate\__construct
__construct(&$oConfig, &$oDb, $sRootPath=CH_DIRECTORY_PATH_ROOT, $sRootUrl=CH_WSB_URL_ROOT)
Definition: ChWsbMobileTemplate.php:18
$sRootPath
$sRootPath
Definition: header.inc.php:37
ChWsbModuleTemplate\pageEnd
pageEnd($isGetContent=true)
Definition: ChWsbModuleTemplate.php:79
$_page
$_page['name_index']
Definition: about_us.php:13
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$_page_cont
$_page_cont[$_ni]['page_main_code']
Definition: about_us.php:24
ChWsbTemplate\addCss
addCss($mixedFiles, $bDynamic=false)
Definition: ChWsbTemplate.php:1114
ChWsbMobileTemplate\displayAccessDenied
displayAccessDenied($sCaption=false)
Definition: ChWsbMobileTemplate.php:74
php
$sMsg
$sMsg
Definition: actions.inc.php:22
ChWsbMobileTemplate\$_aMobileJs
$_aMobileJs
Definition: ChWsbMobileTemplate.php:12
ChWsbMobileTemplate
Definition: ChWsbMobileTemplate.php:11
ChWsbMobileTemplate\displayPageNotFound
displayPageNotFound()
Definition: ChWsbMobileTemplate.php:79
$sTitle
$sTitle
Definition: actions.inc.php:13
$oDb
global $oDb
Definition: db.inc.php:39
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
PageCode
PageCode($oTemplate=null)
Definition: design.inc.php:91
ChWsbMobileTemplate\addMobileJs
addMobileJs($mixedFiles)
Definition: ChWsbMobileTemplate.php:31
$sOutput
$sOutput
Definition: r.php:26
ChWsbMobileTemplate\addMobileCss
addMobileCss($mixedFiles)
Definition: ChWsbMobileTemplate.php:23
$aVars
$aVars
Definition: license.php:101
ChWsbMobileTemplate\pageCode
pageCode($sTitle, $isDesignBox=true, $isWrap=true)
Definition: ChWsbMobileTemplate.php:39
ChWsbTemplate\addJs
addJs($mixedFiles, $bDynamic=false)
Definition: ChWsbTemplate.php:999
ChWsbModuleTemplate
Definition: ChWsbModuleTemplate.php:11
ChWsbMobileTemplate\displayNoData
displayNoData($sCaption=false)
Definition: ChWsbMobileTemplate.php:69
ChWsbMobileTemplate\$_aMobileCss
$_aMobileCss
Definition: ChWsbMobileTemplate.php:13
$sCaption
$sCaption
Definition: tellfriend.php:39
ChWsbMobileTemplate\displayMsg
displayMsg($sMsg, $bTranslateMsg=false, $sTitle=false)
Definition: ChWsbMobileTemplate.php:85
$iNameIndex
$iNameIndex
Definition: admin_tools.php:39
ChWsbTemplate\parseHtmlByName
parseHtmlByName($sName, $aVariables, $mixedKeyWrapperHtml=null, $sCheckIn=CH_WSB_TEMPLATE_CHECK_IN_BOTH)
Definition: ChWsbTemplate.php:660
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10