本文整理汇总了PHP中renderMenu函数的典型用法代码示例。如果您正苦于以下问题:PHP renderMenu函数的具体用法?PHP renderMenu怎么用?PHP renderMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了renderMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderMenu
function renderMenu($node)
{
if (!$node->hasParent() || !$node->children()->count()) {
return '
<li>
<a href="">' . $node->name . '</a>
</li>';
} else {
$html = '<li >
<a href="#">' . $node->name . '<i class="carret"></i></a>';
$html .= '<ul >';
foreach ($node->children as $child) {
$html .= renderMenu($child);
}
$html .= '</ul>';
$html .= '</li>';
}
return $html;
}
示例2: renderMenu
function renderMenu($items, $level = 0)
{
$menu = '';
if ($level == 1) {
$menu .= CHtml::openTag('div', ['class' => 'menu-catalog-submenu']);
}
$menu .= CHtml::openTag('ul');
foreach ($items as $item) {
$liClass = !empty($item['items']) && $level == 0 ? ['class' => 'has-submenu'] : [];
$menu .= CHtml::openTag('li', $liClass);
$menu .= CHtml::link($item['label'], $item['url']);
if (!empty($item['items'])) {
$menu .= renderMenu($item['items'], $level + 1);
}
$menu .= CHtml::closeTag('li');
}
$menu .= CHtml::closeTag('ul');
if ($level == 1) {
$menu .= CHtml::closeTag('div');
}
return $menu;
}
示例3: renderMenu
function renderMenu($node)
{
?>
<ul><?php
foreach ($node as $id => $item) {
?>
<li style="margin-left:8px;">
<?php
if (empty($item['url'])) {
?>
<span><?php
echo $item['mod_name'];
?>
</span>
<?php
} else {
?>
<a href="<?php
echo $item['url'];
?>
"><?php
echo $item['mod_name'];
?>
</a>
<?php
}
?>
<?php
if (isset($item['children'])) {
renderMenu($item['children']);
}
?>
</li><?php
}
?>
</ul><?php
}
示例4: renderMenu
return $data;
}
//$committee = new committee_crud();
//$committee->add_committee("InternationalPress");
//$committee->add_committee("ExecutiveBooard");
//$committee->add_committee("Delegates");
//$committee = "InternationalPress";
//committee = "ExecutiveBoard";
//$committee = "Delegates";
?>
<body>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("dashboard-admin");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1>Dashboard <small>User Overview</small></h1>
<ol class="breadcrumb">
<li class="active"><i class="fa fa-dashboard"></i> Dashboard</li>
</ol>
示例5: renderMenu
</div>
<div class="header t-number right col m6 l4 hdrContact hide-on-small-only">
<p>Call for a free consultation</p>
<h2>0800 808 9755</h2>
</div>
</div>
</div>
</header>
<nav class="" role="navigation">
<div class="nav-wrapper container">
<div class="row">
<div class="col s2 m3 l9">
<?php
echo renderMenu(5, $pdo, "hide-on-med-and-down", "primary-links", array(array("Types of claims", "6"), array("Contact Us", "7")));
?>
<?php
echo renderMobileMenu(5, $pdo, "side-nav", "nav-mobile", array(array("Types of claims", "6")));
?>
<a href="#" data-activates="nav-mobile" class="toggle-mobile-menu button-collapse"><i class="material-icons"></i></a>
</div>
<div class="col s10 m8 l3 search-field-container right">
<form>
<div class="input-field">
<input type="search" id="search-field" class="field" required maxlength="" placeholder="search...">
<label for="search-field"><i class="mdi-action-search"></i><img src="imgs/search-loading.gif" class="mdi-action-search-loading" /></label>
<i class="mdi-navigation-close close"></i>
</div>
</form>
示例6: test_input
$wid_name = test_input($_POST["widget"]);
}
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("render_publisher");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<h1>Administrator Form</h1>
<p class="lead">Use this document to add to the database.<br></p>
<div class="row">
<div class="col-lg-6">
<form class="form-horizontal" role="form" method="post" action="<?php
示例7: setReferralPage
}
setReferralPage(getAbsoluteDocumentPath(__FILE__));
?>
<!DOCTYPE html>
<html lang="en">
<?php
echo renderAccountPageHeader(array("#SITE_ROOT#" => SITE_ROOT, "#SITE_TITLE#" => SITE_TITLE, "#PAGE_TITLE#" => "Authorization Management"));
?>
<body>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("site-pages");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<div class="row">
<div id='display-alerts-instant' class="col-lg-12">
</div>
</div>
<div class="row">
<div class="col-lg-12">
示例8: renderAccountPageHeader
<!DOCTYPE html>
<html lang="en">
<?php
echo renderAccountPageHeader(array("#SITE_ROOT#" => SITE_ROOT, "#SITE_TITLE#" => SITE_TITLE, "#PAGE_TITLE#" => "Dashboard"));
?>
<body>
<script src="../js/upload-location.js"></script>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("api-docs-view");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-heading">
<h3>Upload Locations</h3>
示例9: test_input
echo "<script type='text/javascript'>alert('{$username},{$vidf},{$vids},{$vidt},{$vcp11},{$vcp12},{$vcp13},{$vcp14},{$vcp15},{$vcp21},{$vcp22},{$vcp23},{$vcp24},{$vcp25},{$vcp31},{$vcp32},{$vcp33},{$vcp34},{$vcp35}');</script>";
}
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("edit_publisher");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<div class="jumbotron">
<h1>Step 1 | Delegate Registrations</h1>
<p class="lead"><br></p>
<p class="lead">Please Select the Position You would Like To Apply For In International Press<br></p>
</div>
<div class="row">
示例10: addAlert
addAlert("danger", "Whoops, looks like you don't have permission to view that page.");
header("Location: index.php");
exit;
}
setReferralPage(getAbsoluteDocumentPath(__FILE__));
?>
<!DOCTYPE html>
<html lang="en">
<?php
echo renderAccountPageHeader(array("#SITE_ROOT#" => SITE_ROOT, "#SITE_TITLE#" => SITE_TITLE, "#PAGE_TITLE#" => "Groups"));
?>
<div id="wrapper">
<?php
echo renderMenu("groups");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<div class='row'>
<div class='col-lg-6'>
<div id='widget-groups'>
</div>
</div>
<div id='info' class='col-lg-6'>
示例11: setReferralPage
}
setReferralPage(getAbsoluteDocumentPath(__FILE__));
?>
<!DOCTYPE html>
<html lang="en">
<?php
echo renderAccountPageHeader(array("#SITE_ROOT#" => SITE_ROOT, "#SITE_TITLE#" => SITE_TITLE, "#PAGE_TITLE#" => "Account Settings"));
?>
<body>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("settings");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<h1>Account Settings</h1>
<div class="row">
<div class="col-lg-6">
<form class="form-horizontal" role="form" name="updateAccount" action="update_user.php" method="post">
<div class="form-group">
<label class="col-sm-4 control-label">Email</label>
示例12: displayLibraryMusicMenu
function displayLibraryMusicMenu($style, $params)
{
echo "<ul class=\"widget-list\"><li>Under Construction</li></ul>";
if ($style == "w") {
$data = array("menu-ar" => array("href" => "#", "onclick" => " onclick=\"" . $params['onclickcmd'] . "('" . $params['wrapper'] . "', '" . $params['harness'] . "', 'ar', 'l|lm', '');\"", "label" => "Artists"), "menu-al" => array("href" => "#", "onclick" => " onclick=\"" . $params['onclickcmd'] . "('" . $params['wrapper'] . "', '" . $params['harness'] . "', 'al', 'l|lm', '');\"", "label" => "Albums"), "menu-so" => array("href" => "#", "onclick" => " onclick=\"" . $params['onclickcmd'] . "('" . $params['wrapper'] . "', '" . $params['harness'] . "', 'so', 'l|lm', '');\"", "label" => "Songs"));
} else {
$data = array("menu-ar" => array("href" => "?style=" . $style . "&a=ar&bc=l|lm", "onclick" => "", "label" => "Artists"), "menu-al" => array("href" => "?style=" . $style . "&a=al&bc=l|lm", "onclick" => "", "label" => "Albums"), "menu-so" => array("href" => "?style=" . $style . "&a=so&bc=l|lm", "onclick" => "", "label" => "Songs"));
}
renderMenu($data);
$anchor = buildBackAnchor($style, "l", $params);
echo "<div class=\"widget-control\">" . $anchor . "</div>\n";
}
示例13: renderMobileMenu
function renderMobileMenu($id, PDO $pdo, $additional_classes = NULL, $list_id = NULL, $parents = NULL)
{
// Get the menu
$sql = "SELECT * FROM menu_groups_items LEFT JOIN menu_items ON menu_groups_items.menuID = menu_items.menuID AND menu_groups_items.groupID = :groupID ORDER BY menu_items.weight ASC";
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':groupID', $id, PDO::PARAM_STR);
$result = $stmt->execute();
if ($result == true) {
$return = '<ul class="' . $additional_classes . '" id="' . $list_id . '">';
$items = $stmt->fetchAll();
foreach ($items as $i) {
if ($i['active'] == 1) {
// Check if it needs to be a parent
if (is_array($parents)) {
foreach ($parents as $p) {
// $p[0] is the parent menu title
// $p[1] is the child menu group ID
if ($p[0] == $i['title']) {
// Render the parent + child menu group
$return .= '<li class="no-padding">';
$return .= '<ul class="collapsible collapsible-accordion">';
$return .= '<li>';
//$return .= '<a class="collapsible-header"><i class="material-icons"></i><i class="material-icons active-only"></i> '.$i['title'].'</a>';
$return .= '<a class="collapsible-header">' . $i['title'] . '</a>';
$return .= '<div class="collapsible-body">';
$return .= renderMenu($p[1], $pdo, "child-menu-mobile", $thisId);
$return .= '</div>';
$return .= '</li>';
$return .= '</ul>';
$return .= '</li>';
} else {
if ($i['target'] == "default") {
$t = "_self";
} else {
$t = $i['target'];
}
if (is_numeric($i['destination'])) {
$return .= '<li><a href="/' . $i['url'] . '" target="' . $t . '">' . $i['title'] . '</a></li>';
} else {
$return .= '<li><a href="/' . $i['destination'] . '" target="' . $t . '">' . $i['title'] . '</a></li>';
}
}
}
}
}
}
$return .= '</ul>';
return $return;
} else {
return set_message("Error retrieving menu...", "danger", "none");
}
}
示例14: renderMenu
function renderMenu($menu = array(), $class = 'menu', $id = 'navigationMenu', $html = '', $level = 0)
{
if ($level == 0) {
$html .= '
<ul id="' . $id . '">';
} elseif ($level == 1) {
$html .= '
<ul class="' . $id . ' first">';
} else {
$html .= '
<ul class="' . $id . ' level' . $level . '">';
}
for ($i = 0; $i < sizeof($menu); $i++) {
$url = '';
if (isset($menu[$i]['url'])) {
if (isset($menu[$i]['modalbox'])) {
$url = 'onClick="openModalBox(\'' . url_for($menu[$i]['url'], true) . '\')"';
} elseif (isset($menu[$i]['mamodalbox'])) {
$url = 'onClick="openMultipleActionModalBox(\'' . url_for($menu[$i]['url'], true) . '\')"';
} else {
$url = 'onClick="location.href=\'' . url_for($menu[$i]['url'], true) . '\'"';
$menu[$i]['title'] = '<a href="' . url_for($menu[$i]['url'], true) . '">' . $menu[$i]['title'] . '</a>';
}
} elseif (isset($menu[$i]['onClick'])) {
$url = 'onClick="' . $menu[$i]['onClick'] . '"';
}
$html .= '
<li>';
if ($i == 0 and $level > 0) {
$html .= '
<div class="' . $class . 'SubHeader"></div>
';
}
$menu_arrow_calss = '';
if (isset($menu[$i]['submenu']) and $level == 0) {
if (count($menu[$i]['submenu']) > 0) {
$menu_arrow_calss = 'class="menuArrowBottom"';
}
}
if (isset($menu[$i]['submenu']) and $level > 0) {
if (count($menu[$i]['submenu']) > 0) {
$menu_arrow_calss = 'class="menuArrowRight"';
}
}
if (!isset($menu[$i]['is_selected'])) {
$menu[$i]['is_selected'] = false;
}
if (!isset($menu[$i]['is_hr'])) {
$menu[$i]['is_hr'] = false;
}
$html .= '
<div class="' . $class . ($level > 0 ? 'Sub' : '') . ($menu[$i]['is_selected'] ? ' selected' : '') . ($menu[$i]['is_hr'] ? ' hr' : '') . '"><div ' . $menu_arrow_calss . ' ' . $url . '>';
if (isset($menu[$i]['icon'])) {
$html .= '<table><tr><td style="padding-right: 5px;">' . image_tag('icons/' . $menu[$i]['icon']) . '</td><td>' . $menu[$i]['title'] . '</td></tr></table>';
} else {
$html .= $menu[$i]['title'];
}
$html .= '</div></div>';
if (isset($menu[$i]['submenu'])) {
$html = renderMenu($menu[$i]['submenu'], $class, $id, $html, $level + 1);
}
if (!isset($menu[$i + 1]) and $level > 0) {
$html .= '
<div class="' . $class . 'SubFooter level' . $level . '"></div>
';
}
$html .= '
</li>' . "\n";
}
$html .= '
</ul>';
return $html;
}
示例15: setReferralPage
setReferralPage(getAbsoluteDocumentPath(__FILE__));
?>
<!DOCTYPE html>
<html lang="en">
<?php
echo renderAccountPageHeader(array("#SITE_ROOT#" => SITE_ROOT, "#SITE_TITLE#" => SITE_TITLE, "#PAGE_TITLE#" => "Dashboard"));
?>
<body>
<div id="wrapper">
<!-- Sidebar -->
<?php
echo renderMenu("dashboard");
?>
<div id="page-wrapper">
<div class="row">
<div id='display-alerts' class="col-lg-12">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h1>Dashboard <small>User Overview</small></h1>
<ol class="breadcrumb">
<li class="active"><i class="fa fa-dashboard"></i> Dashboard</li>
</ol>