PATH:
home
/
letacommog
/
letaweb
/
admin
/
widgets
/
modules
<?php class CWidgetMenu extends CWidgetModule { public $menu_items; public $rtl; public $dynamic; public $vertical; public $class; protected function decodeData() { $this->dynamic = getIndex($this->module_data, 'dynamic', false, 'boolean'); $this->rtl = getIndex($this->module_data, 'rtl', false, 'boolean'); $this->vertical = getIndex($this->module_data, 'vertical', false, 'boolean'); if (!$this->dynamic) { $this->menu_items = $this->module_data['menu_items']; } $this->class = ''; if ($this->rtl) { $this->class = ' sm-rtl'; } if ($this->vertical) { $this->class = ' sm-vertical'; } } public function createUrl($item) { $link = trim($item['link']); settype($link, 'integer'); $page = BPages::model()->findByPk($link); if (isset($page)) { return URL::createPageURL($page['name'], isset($item['parameters']) ? $item['parameters'] : ''); } return ''; } public function getChildPages($id) { if($id == 0) $pages = BPages::model()->findAll(array('order' => 'priority asc', 'condition' => 'no_display = 0 and (parent_id=:parent_id or parent_id IS NULL)', 'params' => array(':parent_id' => $id))); else $pages = BPages::model()->findAll(array('order' => 'priority asc', 'condition' => 'no_display = 0 and parent_id=:parent_id', 'params' => array(':parent_id' => $id))); return $pages; } public function hasChildPages($id) { if($id == 0) $rs = BPages::model()->exists('no_display = 0 and (parent_id=:parent_id or parent_id IS NULL)', array(':parent_id' => $id)); else $rs = BPages::model()->exists('no_display = 0 and parent_id=:parent_id', array(':parent_id' => $id)); return $rs; } public function renderSystemMenu($id) { $menu_param = 'm'; $s = '<ul class="sm'.$this->class.'">'; $pagename = ''; $i = 0; $j = 0; $pages = $this->getChildPages($id); foreach ($pages as $page) { $active = ''; if (isset($pagename)) { if ($page->name == $pagename) { $active = 'current active'; } } $s = $s.'<li class="top-menu-item menu-item menu-item-'.$i.' '.$active.'">'; $lnk = Yii::app()->createUrl(strtolower($page->name)); $s = $s.'<a rel='.$page['name'].' href="'.$lnk.'" alt="">'.$page['display_name'].'</a>'; $s = $s.$this->renderSystemMenuItem($page['inline_id'], $i); $s = $s.'</li>'; ++$i; ++$j; } $s = $s.'</ul>'; return $s; } public function renderMenu($item) { $menu_param = 'm'; $s = '<ul class="sm'.$this->class.'">'; $pagename = '';// Yii::app()->context->page->name; $i = 0; $j = 0; foreach ($item as $im) { $active = ''; if (isset($pagename)) { if ($im['link'] == $pagename) { $active = 'current active'; } } $s = $s.'<li class="top-menu-item menu-item menu-item-'.$i.' '.$active.'">'; $lnk = $this->createUrl($im); $s = $s.'<a rel='.$im['link'].' href="'.$lnk.'" alt="">'.$im['name'].'</a>'; $items = getIndex($im, 'items', array()); if (is_array($items) && sizeof($items)) { $s = $s.$this->renderMenuItem($items, $i, $j); } $s = $s.'</li>'; ++$i; ++$j; } $s = $s.'</ul>'; return $s; } public function renderSystemMenuItem($id, $iindex) { $pages = $this->getChildPages($id); if (sizeof($pages) == 0) { return ''; } $s = '<ul>'; $index = $iindex; ++$index; foreach ($pages as $page) { $s = $s.'<li class="menu-item menu-item-'.$index.'">'; $lnk = Yii::app()->createUrl($page->name); $s = $s.'<a href="'.$lnk.'" alt="">'.$page['display_name'].'</a>'; $s = $s.$this->renderSystemMenuItem($page['id'], $index); $s = $s.'</li>'; ++$index; } $s = $s.'</ul>'; return $s; } public function renderMenuItem($item, &$index, $root) { $s = '<ul>'; ++$index; foreach ($item as $im) { $s = $s.'<li class="menu-item menu-item-'.$index.'">'; $lnk = $this->createUrl($im); $s = $s.'<a href="'.$lnk.'" alt="">'.$im['name'].'</a>'; if (isset($im['items']) && sizeof($im['items'])) { $s = $s.$this->renderMenuItem($im['items'], $index, $root); } $s = $s.'</li>'; ++$index; } $s = $s.'</ul>'; return $s; } }
[+]
..
[-] CWidgetYoutube.php
[edit]
[-] CWidgetInfobanner.php
[edit]
[-] CWidgetTextimage.php
[edit]
[-] CWidgetShare_buttons.php
[edit]
[-] CWidgetIframe.php
[edit]
[-] CWidgetNewslist.php
[edit]
[-] CWidgetNewsdetail.php
[edit]
[+]
slick
[-] CWidgetNavbar.php
[edit]
[-] CWidgetAlert.php
[edit]
[-] CWidgetFacebookvideo.php
[edit]
[-] CWidgetSlick.php
[edit]
[-] CWidgetTitle.php
[edit]
[-] CWidgetGallery.php
[edit]
[-] CWidgetSocial_buttons.php
[edit]
[-] CWidgetFacebookpage.php
[edit]
[+]
accordion
[-] CWidgetContactform.php
[edit]
[-] CWidgetButton.php
[edit]
[-] CWidgetProgress_bar.php
[edit]
[-] CWidgettestmodule.php
[edit]
[-] CWidgetStatcounter.php
[edit]
[-] CWidgetEmbed.php
[edit]
[-] CWidgetFacebooksend.php
[edit]
[-] CWidgetRecentnews.php
[edit]
[-] CWidgetIcon.php
[edit]
[-] CWidgetNewscomment.php
[edit]
[-] CWidgetFacebookcomment.php
[edit]
[-] CWidgetIhover.php
[edit]
[-] CWidgetMenu.php
[edit]
[+]
tab
[-] CWidgetSpacer.php
[edit]
[-] CWidgetBox.php
[edit]
[-] CWidgetHtml.php
[edit]
[-] CWidgetImage.php
[edit]
[-] CWidgetAudio_player.php
[edit]
[-] CWidgetCountdown.php
[edit]
[-] CWidgetTypedtext.php
[edit]
[-] CWidgetCarousel.php
[edit]
[-] CWidgetText.php
[edit]
[-] CWidgetVideo.php
[edit]
[-] CWidgetFacebookpost.php
[edit]
[-] CWidgetRssfeed.php
[edit]
[-] CWidgetInfobox.php
[edit]
[-] CWidgetInfotable.php
[edit]
[-] CWidgetFancytext.php
[edit]
[-] CWidgetGooglemap.php
[edit]
[-] CWidgetSlideshow.php
[edit]
[-] CWidgetPricetable.php
[edit]
[-] CWidgetNewscategory.php
[edit]
[-] CWidgetLine.php
[edit]
[-] CWidgetModal.php
[edit]
[-] CWidgetMailchimp.php
[edit]
[-] CWidgetFacebooklike.php
[edit]