14 parent::__construct();
20 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'quick_links_list.html', array(
'content' => $this->
genQuickLinks()));
25 $aQlinksUnits = array();
26 foreach ($this->aTopMenu
as $iItemID => $aItem) {
27 if ($aItem[
'BQuickLink'] !=
'1' || $aItem[
'Type'] ==
'system')
32 list($aItem[
'Link']) = explode(
'|', $aItem[
'Link']);
35 $aItem[
'Onclick'] = $this->
replaceMetas($aItem[
'Onclick']);
36 $aItem[
'Caption'] = $this->
replaceMetas($aItem[
'Caption']);
38 $sPicture = isset($aItem[
'Icon']) && !
empty($aItem[
'Icon']) ? $aItem[
'Icon'] : $aItem[
'Picture'];
39 if (!$sPicture && $aItem[
'Parent']) {
40 $aItemRoot = $this->aTopMenu[$aItem[
'Parent']];
41 $sPicture = isset($aItemRoot[
'Icon']) && !
empty($aItemRoot[
'Icon']) ? $aItemRoot[
'Icon'] : $aItemRoot[
'Picture'];
44 $aQlinksUnits[
_t($aItem[
'Caption'])] = $this->
genQuickLink(
_t($aItem[
'Caption']), $aItem[
'Link'], $aItem[
'Onclick'], $iItemID, $sPicture);
48 return implode(
'', $aQlinksUnits);
51 function genQuickLink ($sText, $sLink, $sOnclick, $iItemID, $sPictureVal)
53 $sOnclick = $sOnclick ? (
' onclick="' . $sOnclick .
'" ') :
'';
55 if (strpos($sLink,
'http://') ===
false && strpos($sLink,
'https://') ===
false && !$sOnclick)
56 $sLink = CH_WSB_URL_ROOT . $sLink;
58 $sScriptAction = (!$sOnclick ?
" onclick=\"window.open ('{$sLink}','_self');\" " : $sOnclick);
60 $isFontIcon = (
false === strpos ($sPictureVal,
'.'));
61 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'quick_link.html', array(
62 'ch_if:icon' => array(
63 'condition' => !$isFontIcon,
64 'content' => array(
'picture' =>
getTemplateIcon($sPictureVal),
'caption' => $sText,
'action' => $sScriptAction),
66 'ch_if:texticon' => array(
67 'condition' => $isFontIcon,
68 'content' => array(
'picture' => $sPictureVal,
'caption' => $sText,
'action' => $sScriptAction),
70 'action' => $sScriptAction,