本文整理汇总了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'));
}
}
}
示例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 -->
示例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");
示例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);
}
示例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;