Cheetah
ChBaseMenuBottom.php
Go to the documentation of this file.
1 <?php
2 
8  ch_import('ChWsbMenuBottom');
9 
14  {
18  function __construct()
19  {
20  parent::__construct();
21  }
22 
23  function getItems()
24  {
25  $sContent = parent::getItems();
26  $sContent .= $this->getSwitcherLanguage();
27  $sContent .= $this->getSwitcherTemplate();
28  return $sContent;
29  }
30 
32  {
33  $sContent = '';
34 
35  $iLangsCount = count(getLangsArr());
36  if($iLangsCount <= 1)
37  return '';
38 
39  $sLangName = getCurrentLangName();
40 
41  $aTmplVars = array();
42  $aTmplVars[] = array(
43  'caption' => _t('_sys_bm_language', $sLangName),
44  'link' => 'javascript:void(0)',
45  'script' => 'onclick="javascript:showPopupLanguage()"',
46  'target' => ''
47  );
48 
49  $sContent .= $GLOBALS['oSysTemplate']->parseHtmlByName('extra_' . $this->sName . '_menu.html', array('ch_repeat:items' => $aTmplVars));
50  $sContent .= $GLOBALS['oFunctions']->getLanguageSwitcher($sLangName);
51 
52  return $sContent;
53  }
54 
56  {
57  $sContent = '';
58  if(getParam('enable_template') != 'on')
59  return $sContent;
60 
61  $iTmplsCount = count(get_templates_array());
62  if($iTmplsCount <= 1)
63  return $sContent;
64 
65  $sTemplName = $GLOBALS['oSysTemplate']->getCode();
66 
67  $aTmplVars = array();
68  $aTmplVars[] = array(
69  'caption' => _t('_sys_bm_design', $sTemplName),
70  'link' => 'javascript:void(0)',
71  'script' => 'onclick="javascript:showPopupTemplate()"',
72  'target' => ''
73  );
74 
75  $sContent .= $GLOBALS['oSysTemplate']->parseHtmlByName('extra_' . $this->sName . '_menu.html', array('ch_repeat:items' => $aTmplVars));
76  $sContent .= $GLOBALS['oFunctions']->getTemplateSwitcher($sTemplName);
77 
78  return $sContent;
79  }
80  }
getCurrentLangName
if(!defined('CH_SKIP_INSTALL_CHECK')) getCurrentLangName($isSetCookie=true)
Definition: languages.inc.php:36
ChBaseMenuBottom
Definition: ChBaseMenuBottom.php:14
ChBaseMenuBottom\__construct
__construct()
Definition: ChBaseMenuBottom.php:18
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
php
get_templates_array
get_templates_array($isAllParams=false)
Definition: utils.inc.php:573
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
ChWsbMenuBottom
Definition: ChWsbMenuBottom.php:26
getLangsArr
getLangsArr( $bAddFlag=false, $bRetIDs=false)
Definition: languages.inc.php:155
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChBaseMenuBottom\getSwitcherTemplate
getSwitcherTemplate()
Definition: ChBaseMenuBottom.php:55
ChBaseMenuBottom\getSwitcherLanguage
getSwitcherLanguage()
Definition: ChBaseMenuBottom.php:31
$sTemplName
$sTemplName
Definition: ChTemplName.php:8
ChBaseMenuBottom\getItems
getItems()
Definition: ChBaseMenuBottom.php:23
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10