当前位置: 首页>>代码示例>>PHP>>正文


PHP MenuItem::getAll方法代码示例

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


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

示例1: index

 /**
  * Customize the menu
  */
 public function index()
 {
     $items = MenuItem::getAll();
     $form = new Form(array('id' => 'set-menus-form', 'action' => App::router()->getUri('set-menu'), 'inputs' => array(new HiddenInput(array('name' => 'data', 'default' => json_encode($items, JSON_NUMERIC_CHECK), 'attributes' => array('e-value' => 'JSON.stringify(items.valueOf())'))), new SubmitInput(array('name' => 'valid', 'value' => Lang::get('main.valid-button')))), 'onsuccess' => 'app.refreshMenu()'));
     if (!$form->submitted()) {
         $this->addKeysToJavaScript($this->_plugin . '.plugins-advert-menu-changed');
         return View::make(Plugin::current()->getView('sort-main-menu.tpl'), array('form' => $form));
     } else {
         try {
             $items = MenuItem::getAll('id');
             $data = json_decode($form->getData('data'), true);
             foreach ($data as $line) {
                 $item = $items[$line['id']];
                 $item->set(array('active' => $line['active'], 'parentId' => $line['parentId'], 'order' => $line['order']));
                 $item->save();
             }
             return $form->response(Form::STATUS_SUCCESS, Lang::get($this->_plugin . '.sort-menu-success'));
         } catch (Exception $e) {
             return $form->response(Form::STATUS_ERROR, DEBUG_MODE ? $e->getMessage() : Lang::get($this->_plugin . '.sort-menu-error'));
         }
     }
 }
开发者ID:elvyrra,项目名称:hawk,代码行数:25,代码来源:MenuController.php

示例2: denyDirect

 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$scope = getScope();
$menu = MenuItem::getAll("footer");
$hide_link = Setting::get("hide_socia_link") == "yes" ? true : false;
echo <<<HTML
<nav class="navbar navbar-inverse navbar-fixed-bottom">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:31,代码来源:footer_menu.php

示例3: getSiteURL

                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<?php 
    echo getSiteURL();
    ?>
"><?php 
    echo getSiteName();
    ?>
</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <?php 
    echo MenuItem::getAll("header_left");
    echo Custompage::getMenuItems();
    ?>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <?php 
    echo MenuItem::getAll("header_right");
    ?>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    <?php 
}
echo display("navigation:after");
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:31,代码来源:navigation.php

示例4: getMenuItems

function getMenuItems($menu_name, $item_class = "", $parent = "ul", $child = "li", $child_wrapper = true)
{
    return MenuItem::getAll($menu_name, $item_class, $parent, $child, $child_wrapper);
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:4,代码来源:shortcuts.php

示例5: denyDirect

 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$guid = pageArray(1);
if (!$guid) {
    $guid = getLoggedInUserGuid();
}
$user = getEntity($guid);
$button = NULL;
$icon = $user->icon(EXTRALARGE, "img-responsive");
$extension = display("profile_owner_block_body");
$profile_menu = MenuItem::getAll("profile", "", "", "", NULL);
if ($guid == getLoggedInUserGuid()) {
    $button = "<a href='" . getSiteURL() . "editAvatar' class='btn btn-info edit_avatar_button'><i class='fa fa-pencil'></i></a>";
}
?>
<div class='panel panel-default'>
    <div class="panel-body">
        <div style='position:relative;' id='profile_avatar'>
            <?php 
echo $button;
?>
            <?php 
echo $icon;
?>
            <h2 class='text-center'><?php 
echo $user->full_name;
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:31,代码来源:left.php


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