• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CMenu类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CMenu的典型用法代码示例。如果您正苦于以下问题:PHP CMenu类的具体用法?PHP CMenu怎么用?PHP CMenu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CMenu类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: init

 /**
  *
  */
 public function init()
 {
     if ($this->cssFile === null) {
         $file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'responsiveCMenu.css';
         $this->cssFile = Yii::app()->getAssetManager()->publish($file);
     }
     Yii::app()->clientScript->registerCssFile($this->cssFile);
     parent::init();
 }
开发者ID:ChristopheBrun,项目名称:hLib,代码行数:12,代码来源:ResponsiveCMenu.php


示例2: GetMessage

        }
    }
    $pageTitle = GetMessage("PAGE_NEW_DEFAULT_TITLE") . ($fileNumber != "" ? " (" . $fileNumber . ")" : "");
    $editAfterSave = true;
    $addToMenu = true;
    $menuName = "";
    $menuType = false;
    $menuItemPosition = -1;
    $pageTags = "";
}
//Get Menu
$arMenu = array();
if (IsModuleInstalled("fileman") && $USER->CanDoOperation("fileman_add_element_to_menu")) {
    $arMenuTypes = GetMenuTypes($site);
    foreach ($arMenuTypes as $type => $name) {
        $menu = new CMenu($type);
        $menu->Init($path);
        $actualDir = $menu->MenuDir;
        $currentDir = rtrim($path, "/") . "/";
        if (strlen($actualDir) > 0) {
            $actualMenuFile = $actualDir . "." . $type . ".menu.php";
            $fileOperation = $io->FileExists($documentRoot . $actualMenuFile) ? "fm_edit_existent_file" : "fm_create_new_file";
            if (!$USER->CanDoFileOperation("fm_add_to_menu", array($site, $actualMenuFile)) || !$USER->CanDoFileOperation($fileOperation, array($site, $actualMenuFile))) {
                $actualDir = false;
            }
        } else {
            $actualDir = false;
        }
        $currentMenuFile = $currentDir . "." . $type . ".menu.php";
        $fileOperation = $io->FileExists($documentRoot . $currentMenuFile) ? "fm_edit_existent_file" : "fm_create_new_file";
        if (!$USER->CanDoFileOperation('fm_add_to_menu', array($site, $currentMenuFile)) || !$USER->CanDoFileOperation($fileOperation, array($site, $currentMenuFile))) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:file_new.php


示例3: _SetSelectedItems

 function _SetSelectedItems(&$arResult, $bMultiSelect = false)
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     $cur_page = $APPLICATION->GetCurPage(true);
     $cur_page_no_index = $APPLICATION->GetCurPage(false);
     $cur_selected = -1;
     $cur_selected_len = -1;
     foreach ($arResult as $iMenuItem => $MenuItem) {
         $LINK = $MenuItem['LINK'];
         $ADDITIONAL_LINKS = $MenuItem['ADDITIONAL_LINKS'];
         $SELECTED = false;
         $all_links = array();
         if (is_array($ADDITIONAL_LINKS)) {
             foreach ($ADDITIONAL_LINKS as $link) {
                 $tested_link = trim($link);
                 if (strlen($tested_link) > 0) {
                     $all_links[] = $tested_link;
                 }
             }
         }
         $all_links[] = $LINK;
         if ($MenuItem['PERMISSION'] != 'Z') {
             foreach ($all_links as $tested_link) {
                 if ($tested_link == '') {
                     continue;
                 }
                 $SELECTED = CMenu::IsItemSelected($tested_link, $cur_page, $cur_page_no_index);
                 if ($SELECTED) {
                     $arResult[$iMenuItem]['SELECTED'] = true;
                     break;
                 }
             }
         }
         if ($SELECTED && !$bMultiSelect) {
             /** @noinspection PhpUndefinedVariableInspection */
             $new_len = strlen($tested_link);
             if ($new_len > $cur_selected_len) {
                 if ($cur_selected !== -1) {
                     $arResult[$cur_selected]['SELECTED'] = false;
                 }
                 $cur_selected = $iMenuItem;
                 $cur_selected_len = $new_len;
             } elseif ($new_len > 1) {
                 $arResult[$iMenuItem]['SELECTED'] = false;
             }
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:49,代码来源:functions.php


示例4: GetMenu

 function GetMenu($type = "left", $bMenuExt = false, $template = false, $sInitDir = false)
 {
     $menu = new CMenu($type);
     if ($sInitDir === false) {
         $sInitDir = $this->GetCurDir();
     }
     if (!$menu->Init($sInitDir, $bMenuExt, $template)) {
         $menu->MenuDir = $sInitDir;
     }
     return $menu;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:11,代码来源:main.php


示例5: init

 public function init()
 {
     parent::init();
     $this->activateParents = true;
     $this->htmlOptions = array('class' => 'nav nav-list');
     $this->submenuHtmlOptions = array('class' => 'nav nav-list');
 }
开发者ID:kumarsivarajan,项目名称:yii-user-management,代码行数:7,代码来源:YumMenu.php


示例6: init

 public function init()
 {
     if (!empty($this->class)) {
         $this->htmlOptions['class'] = $this->class;
     }
     parent::init();
 }
开发者ID:nickgr6,项目名称:Datepicker,代码行数:7,代码来源:DMenu.php


示例7: init

 public function init()
 {
     $assets = Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets', false, -1, true);
     $cs = Yii::app()->getClientScript();
     $cs->registerCssFile($assets . '/emenu.css');
     parent::init();
 }
开发者ID:BGCX261,项目名称:zoomtyre-svn-to-git,代码行数:7,代码来源:EMenu.php


示例8: init

 public function init()
 {
     parent::init();
     $cs = Yii::app()->clientScript;
     $cs->registerScriptFile(Yii::app()->theme->baseUrl . '/js/bootstrap.js', CClientScript::POS_END);
     Yii::app()->clientScript->registerCoreScript('jquery');
 }
开发者ID:rzamarripa,项目名称:masoftproyectos,代码行数:7,代码来源:BMenu.php


示例9: renderMenuItem

 protected function renderMenuItem($item)
 {
     if (isset($item['icon'])) {
         $item['label'] .= Theme::img('icons/' . $item['icon'] . '.png');
     }
     return parent::renderMenuItem($item);
 }
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:7,代码来源:Menu.php


示例10: init

 public function init()
 {
     // Here we define query conditions.
     $criteria = new CDbCriteria();
     $criteria->limit = 2;
     $criteria->condition = '`status` = 1';
     //$criteria->order = '`position` ASC';
     $items = CmsPages::model()->findAll($criteria);
     //echo "items"."<pre>";print_r($items);die;
     foreach ($items as $item) {
         $this->items[] = array('label' => $item->title, 'url' => Yii::app()->createUrl("user/pages", array('id' => $item->id)));
     }
     // footer
     /* $criteria1 = new CDbCriteria;
             
             $criteria1->condition = '`status` = 1';
             //$criteria->order = '`position` ASC';
     
             $footeritems = CmsPages::model()->findAll($criteria1);
             //echo "items"."<pre>";print_r($footeritems);die;
             foreach ($footeritems as $footer)
                 $this->items[] = array('label'=>$footer->title, 'url'=>Yii::app()->createUrl("user/pages",array('id'=>$footer->id)));
              */
     parent::init();
 }
开发者ID:KaranSofat,项目名称:yii,代码行数:25,代码来源:ActiveMenu.php


示例11: init

 function init()
 {
     parent::init();
     if (!empty($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] .= ' iconized';
     } else {
         $this->htmlOptions['class'] = 'iconized';
     }
     Yii::app()->clientScript->registerCssFile(Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets/iconizedMenu.css'));
     if ($this->useSprites) {
         $domains = array();
         foreach ($this->items as $item) {
             $components = parse_url($item['url']);
             $domains[] = $components['host'];
         }
         $spriteUrl = $this->yandexBaseUrl . implode('/', $domains);
         $offset = 0;
         foreach ($this->items as &$item) {
             $item['linkOptions']['style'] = "background-image: url({$spriteUrl}); background-position: 0 {$offset}px";
             $offset -= 16;
         }
     } else {
         foreach ($this->items as &$item) {
             $components = parse_url($item['url']);
             $iconUrl = $this->iconizerBaseUrl . $components['host'];
             $item['linkOptions']['style'] = "background-image: url({$iconUrl})";
         }
     }
 }
开发者ID:sinelnikof,项目名称:yiiext,代码行数:29,代码来源:EIconizedMenu.php


示例12: init

 public function init()
 {
     $this->htmlOptions = array('class' => 'profile-sidebar-menu');
     $this->id = 'profile-sidebar-menu';
     $this->activeCssClass = 'active';
     parent::init();
 }
开发者ID:stormrage-project,项目名称:valkyrie-yii,代码行数:7,代码来源:WProfileSidebarMenu.php


示例13: init

 public function init()
 {
     $class = array('dropdown');
     $cssFile;
     if ($this->vertical) {
         $class[] = 'dropdown-vertical';
         if ($this->rtl) {
             $class[] = 'dropdown-vertical-rtl';
             $cssFile = 'dropdown.vertical.rtl.css';
         } else {
             $cssFile = 'dropdown.vertical.css';
         }
     } else {
         if ($this->upward) {
             $class[] = 'dropdown-upward';
             $cssFile = 'dropdown.upward.css';
         } else {
             $class[] = 'dropdown-horizontal';
             $cssFile = 'dropdown.css';
         }
     }
     $this->htmlOptions['class'] = implode(' ', $class);
     $basedir = dirname(__FILE__) . '/free-css-drop-down-menu';
     $baseUrl = Yii::app()->getAssetManager()->publish($basedir);
     // echo $baseUrl;
     // yii::app()->end();
     if ($this->themeCssFile == '') {
         switch ($this->theme) {
             case 'adobe':
                 $this->themeCssFile = 'adobe.com/default.css';
                 break;
             case 'flikr':
                 $this->themeCssFile = 'flikr.com/default.css';
                 break;
             case 'lwis':
                 $this->themeCssFile = 'lwis.celebrity/default.css';
                 break;
             case 'mtv':
                 $this->themeCssFile = 'mtv.com/default.css';
                 break;
             case 'nvidia':
                 $this->themeCssFile = 'nvidia.com/default.css';
                 break;
             case 'vimeo':
                 $this->themeCssFile = 'vimeo.com/default.css';
                 break;
             case 'default':
             default:
                 $this->themeCssFile = 'default/default.css';
                 break;
         }
     }
     Yii::app()->getClientScript()->registerCSSFile($baseUrl . '/css/dropdown/' . $cssFile)->registerCSSFile($baseUrl . '/css/dropdown/themes/' . $this->themeCssFile);
     //  Yii::app()->getClientScript()->registerScriptFile($baseUrl.'/js/jqueryslidemenu.js');
     // Yii::app()->getClientScript()->registerCSSFile($baseUrl.'/css/jqueryslidemenu.css');
     //ToDo: these should added just for IE7, i don't know how to do this
     //            Yii::app()->getClientScript()->registerCoreScript('jquery')
     //                                            ->registerScriptFile($baseUrl.'/js/jquery.dropdown.js');
     parent::init();
 }
开发者ID:hipogea,项目名称:zega,代码行数:60,代码来源:EMenu.php


示例14: init

 public function init()
 {
     $model = MenuModel::model()->enabled()->findAll();
     $result = array();
     foreach ($model as $item) {
         $result[] = array('label' => $item->label, 'url' => $item->url, 'active' => $this->isActive($item->url));
     }
     $this->items = CMap::mergeArray($result, $this->items);
     parent::init();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:10,代码来源:MenuWidget.php


示例15: init

 public function init()
 {
     for ($i = 2013; $i <= date("Y"); $i++) {
         if ($i == $this->id_select) {
             echo "<option value='" . $i . "' selected>" . $i . "</option>";
         } else {
             echo "<option value='" . $i . "'>" . $i . "</option>";
         }
     }
     parent::init();
 }
开发者ID:robebeye,项目名称:sim-kk,代码行数:11,代码来源:SelectOpTahun.php


示例16: init

 public function init()
 {
     // Here we define query conditions.
     $criteria = new CDbCriteria();
     //$criteria->condition = '`status` = 1';
     $criteria->order = '`id` ASC';
     $items = CmsvideoMenu::model()->findAll($criteria);
     foreach ($items as $item) {
         $this->items[] = array('label' => $item->menu_text, 'url' => $item->menu_link);
     }
     parent::init();
 }
开发者ID:videocms,项目名称:videocms-test,代码行数:12,代码来源:ActiveMenu.php


示例17: init

 public function init()
 {
     $items = SideBarMenu::model()->findAll();
     foreach ($items as $item) {
         if ($item->id_parent == 0) {
             //  $categories[(int)$item->id] =  array((int)$item->id=>array('name'=>$item->name)) ; // рабочее
             $this->items[$item->id] = array('label' => ' <i class="' . $item->icon_class . '"></i><span>' . $item->name . '</span>', 'url' => array($item->url));
         } else {
             //   $categories[(int)$item->id_parent][(int)$item->id]=array($item->name) ; // рабочее
             $this->items[$item->id_parent]['items'][] = array('label' => $item->name, 'url' => array($item->url), 'submenuOptions' => array('class' => 'has-child', 'style' => 'display: list-item;'));
         }
     }
     parent::init();
 }
开发者ID:ZloyBarsuk,项目名称:synapsis,代码行数:14,代码来源:ActiveMenu.php


示例18: init

 public function init()
 {
     if (!$this->getId(false)) {
         $this->setId('nav');
     }
     // add the script
     $cs = Yii::app()->getClientScript();
     $cs->registerCoreScript('jquery');
     $this->nljs = "\n";
     $this->items = $this->cssParentItems($this->items);
     $js = $this->createJsCode();
     $cs->registerScript('mainmenu_' . $this->getId(), $js, CClientScript::POS_READY);
     parent::init();
 }
开发者ID:ngdvan,项目名称:lntguitar,代码行数:14,代码来源:MainMenu.php


示例19: init

 public function init()
 {
     if ($this->name) {
         $menu = Menu::model()->findByAttributes(array('name' => $this->name));
     } elseif ($this->id) {
         $menu = Menu::model()->findByPk($this->id);
     } elseif ($menu = Menu::model()->findByAttributes(array('name' => 'Main'))) {
         //NOP, assignment done within the codition above
     } else {
         //find the first one
         $menu = Menu::model()->find();
     }
     if (!$menu) {
         return false;
         //throw new CHttpException(404, 'The specified menu (id=' . $this->id . ') cannot be found.');
     }
     $class = array('dropdown', $menu->theme . '-theme');
     if ($menu->vertical) {
         $class[] = 'dropdown-vertical';
         if ($menu->rtl) {
             $class[] = 'dropdown-vertical-rtl';
             $cssFile = 'dropdown.vertical.rtl.css';
         } else {
             $cssFile = 'dropdown.vertical.css';
         }
     } else {
         if ($menu->upward) {
             $class[] = 'dropdown-upward';
             $cssFile = 'dropdown.upward.css';
         } else {
             $class[] = 'dropdown-horizontal';
             $cssFile = 'dropdown.css';
         }
     }
     $this->htmlOptions['class'] = implode(' ', $class);
     //print_r($menu->items);
     $items = $menu->items;
     $this->items = array_merge($items, $this->append);
     //        $this->items = $menu->items;
     //print_r($this->items);
     $basedir = dirname(__FILE__) . '/../assets/frontend';
     $baseUrl = Yii::app()->getAssetManager()->publish($basedir);
     Yii::app()->getClientScript()->registerCSSFile($baseUrl . '/css/' . $cssFile)->registerCSSFile($baseUrl . '/themes/' . $menu->theme . '/default.css');
     //ToDo: these should added just for IE7, i don't know how to do this
     //            Yii::app()->getClientScript()->registerCoreScript('jquery')
     //                                            ->registerScriptFile($baseUrl.'/js/jquery.dropdown.js');
     parent::init();
 }
开发者ID:awecode,项目名称:awecms,代码行数:48,代码来源:MenuRenderer.php


示例20: init

 /**
  * Initialize the widget
  */
 public function init()
 {
     if (!$this->getId(false)) {
         $this->setId('cssmenu');
     }
     $this->nljs = "\n";
     $defaultItems = array('system' => array('label' => Yii::t('app', 'SYSTEM'), 'icon' => 'fa-gear'), 'modules' => array('label' => Yii::t('app', 'MODULES'), 'icon' => 'fa-bars'));
     $cacheID = self::CACHE_ID . '-' . Yii::app()->language;
     // $items = Yii::app()->cache->get($cacheID);
     // if ($items === false) {
     $found = $this->findMenu();
     //  unset($found['system'],$found['users']);
     //}
     $items = CMap::mergeArray($defaultItems, $found);
     $this->items = $this->cssParentItems($items);
     parent::init();
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:20,代码来源:AdminMenu.php



注:本文中的CMenu类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CModel类代码示例发布时间:2022-05-23
下一篇:
PHP CMediusers类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap