本文整理汇总了PHP中nav函数的典型用法代码示例。如果您正苦于以下问题:PHP nav函数的具体用法?PHP nav怎么用?PHP nav使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nav函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nav
function nav($menu_items, $child = false)
{
$output = '';
if (count($menu_items) > 0) {
$output .= $child === false ? '<ul>' : '<ul>';
foreach ($menu_items as $nav_item) {
if (!empty($nav_item['target'])) {
$nav_target = 'target="' . $nav_item['target'] . '"';
} else {
$nav_target = "";
}
if (strpos($nav_item['url'], "http://") !== false or strpos($nav_item['url'], "https://") !== false) {
$nav_url = $nav_item['url'];
} else {
$nav_url = "" . Configure::read('BASE_URL') . "" . $nav_item['url'] . "";
}
$output .= '<li>';
$output .= '<a href="' . $nav_url . '" ' . $nav_target . '>' . $nav_item['title'] . '</a>';
//check if there are any children
if (isset($nav_item['children']) && count($nav_item['children'])) {
$output .= nav($nav_item['children'], true);
}
$output .= '</li>';
}
$output .= '</ul>';
}
return $output;
}
示例2: startjournal
function startjournal($sitename, $user)
{
global $module_name;
$user = filter($user, "nohtml");
$sitename = filter($sitename, "nohtml");
if (is_user($user)) {
$j_user1 = "<center>[ <a href=\"modules.php?name={$module_name}\">" . _JOURNALDIR . "</a> | <a href=\"modules.php?name={$module_name}&file=edit\">" . _YOURJOURNAL . "</a> ]</center>";
$j_user2 = "";
} else {
$j_user1 = "<center>[ <a href=\"modules.php?name={$module_name}\">" . _JOURNALDIR . "</a> | <a href=\"modules.php?name=Your_Account&op=new_user\">" . _CREATEACCOUNT . "</a> ]</center>";
$j_user2 = "<br><center><font class=\"tiny\">" . _MEMBERSCAN . "</font></center>";
}
title("{$sitename}: " . _USERSJOURNAL . "");
if (is_user($user)) {
include "modules/Your_Account/navbar.php";
OpenTable();
nav();
CloseTable();
echo "<br>";
}
OpenTable();
echo "<center><img src=modules/{$module_name}/images/bgimage.gif><br><font class=title><b>" . _USERSJOURNAL . "</b></font></center>";
echo "{$j_user1}";
echo "{$j_user2}";
CloseTable();
}
示例3: template_init
function template_init()
{
document_open();
page_header();
nav();
page();
page_footer();
document_close();
}
示例4: navigation
function navigation($is_authed)
{
if ($is_authed) {
$str = a('Current', '/') . ' ' . a('Create Trick', '/trick/create') . ' ' . a('All Tricks', '/tricks') . ' ' . a('Create Tag', '/tag/create') . ' ' . a('All Tags', '/tags') . ' ' . a('Logout', '/auth/delete') . ' ';
} else {
$str = a('Sign In/Up', '/auth/create') . ' ';
}
return nav($str . a('About', '/about'));
}
示例5: simple_pages_navigation
/**
* Returns a nested unordered list of SimplePage links
*
* @uses simple_pages_get_links_for_children_pages()
* @uses nav()
* @param integer|null The id of the parent page. If null, it uses the current simple page
* @param string The method by which you sort pages. Options are 'order' (default) and 'alpha'.
* @param boolean Whether to return only published pages.
* @return string
*/
function simple_pages_navigation($parentId = 0, $sort = 'order', $requiresIsPublished = true)
{
$html = '';
$childPageLinks = simple_pages_get_links_for_children_pages($parentId, $sort, $requiresIsPublished);
if ($childPageLinks) {
$html .= '<div class="simple-pages-navigation">' . "\n";
$html .= nav($childPageLinks);
$html .= '</div>' . "\n";
}
return $html;
}
示例6: nav
function nav(array $data)
{
$nav = "<ul>";
foreach($data as $key => $val) {
if(is_array($val)) {
$nav .= "<li>$key" . nav($val) . "</li>";
} else {
$nav .= "<li><a href='$val'>$key</a></li>";
}
}
return $nav . "</ul>";
}
示例7: __whenReady
public function __whenReady()
{
// Check Migrations Done
if ($this->module->migrationsDone()) {
// Add Permission
addAdminPermission("manage_users", "Manage Users");
// Add Permission
addAdminPermission("maintainance_mode", "Maintainance Mode Access");
// Add Permission
addAdminPermission("manage_acl", "Manage Groups and Permissions");
// Add the Required Styles and Scripts
registerAdminStyle("auth-admin", __DIR__ . "/styles/auth.css");
registerAdminScript("auth-admin", __DIR__ . "/scripts/auth.js");
setAdminStyleToUse("auth-admin");
// Listen Controller Ready Event
$this->app["events"]->listen("admin.controller.ready", function () {
// Check Nav
if ($nav = nav(adminNavGroup())) {
// Add Logout Link
$nav->addMenuItem("logout", trans("auth-module::menu_item.logout"), urlRoute(UserItem::logoutRoute(), UserItem::logoutRouteParams()), null, null, 1000);
// Add My Account Link
$nav->addSubMenuItem(ADMIN_NAV_DASHBOARD, "my_account", trans("auth-module::menu_item.my_account"), urlRoute("my_account"), null, null, 1);
// Check Permission
if (userHasPermission("manage_acl")) {
// Add ACL Navigation Items
$nav->detectAddSubMenuItem(ADMIN_NAV_ADMINISTRATION, "acl", trans("auth-module::menu_item.acl"), urlRoute("groups"));
$nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "acl", "groups", trans("auth-module::menu_item.groups"), urlRoute("groups"), array("include" => array("/create_group/i", "/edit_group\\/(.*)/i")));
$nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "acl", "permissions", trans("auth-module::menu_item.permissions"), urlRoute("permissions"), array("include" => array("/create_permission/i", "/edit_permission\\/(.*)/i")));
}
// Check Permission
if (userHasPermission("manage_users")) {
// Add User Navigation Items
$nav->detectAddSubMenuItem(ADMIN_NAV_ADMINISTRATION, "users", trans("auth-module::menu_item.users"), urlRoute("users"));
$nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "users", "create_user", trans("auth-module::menu_item.add_new_user"), urlRoute("create_user"));
$nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "users", "users", trans("auth-module::menu_item.view_users"), urlRoute("users"), array("include" => array("/edit_user\\/(.*)/i")));
}
// Get Groups with Interfaces
$groups = GroupItem::hasInterface()->get();
// Loop Each Groups
foreach ($groups as $group) {
// Check Routes & Langs
if ($group->hasValidInterface() && (!$group->group_permission || userHasPermission($group->group_permission))) {
// Add Navigation Items
$nav->detectAddSubMenuItem(ADMIN_NAV_ADMINISTRATION, $group->getRoute("list"), $group->getLang("menu_list"), urlRoute($group->getRoute("list")));
$nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, $group->getRoute("list"), $group->getRoute("create"), $group->getLang("menu_add_new"), urlRoute($group->getRoute("create")));
$nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, $group->getRoute("list"), $group->getRoute("list"), $group->getLang("menu_view_list"), urlRoute($group->getRoute("list")), array("include" => array("/" . $group->getRoute("edit") . "\\/(.*)/i")));
}
}
}
});
}
}
示例8: html_header
function html_header($title = 'Nix', $style = false, $desc = false)
{
define('css_directory', 'style/');
define('main_style_file', 'style_main.css');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="robots" content="all, index, follow" />
<meta name="language" content="fr-FR" />
<meta name="keywords" content="nix, Nix, serveur, Minecraft, rp, roleplay, jeu de rôle, magie, mystère, neige, nord, nordique, aventure, savoir" />
<meta name="description" content="<?php
echo $desc ? $desc : 'Nix est un serveur français de roleplay sur Minecraft, se déroulant dans une région enneigée et remplit de mystères.';
?>
" />
<title><?php
echo htmlentities($title);
?>
</title>
<?php
if ($style) {
?>
<link rel="stylesheet" href="<?php
echo css_directoy . $style;
?>
" />
<?php
}
?>
<link rel="stylesheet" href="<?php
echo css_directory . main_style_file;
?>
" />
</head>
<body>
<header>
</header>
<?php
include 'includes/nav.php';
nav();
?>
<section id="main_content">
<?php
}
示例9: nav
function nav($menu_items, $child = false)
{
$output = '';
if (count($menu_items) > 0) {
$output .= $child === false ? '<ul class="nav navbar-nav">' : '<ul class="dropdown-menu">';
foreach ($menu_items as $nav_item) {
if (!empty($nav_item['target'])) {
$nav_target = 'target="' . $nav_item['target'] . '"';
} else {
$nav_target = "";
}
if (strpos($nav_item['url'], "http://") !== false or strpos($nav_item['url'], "https://") !== false) {
$nav_url = $nav_item['url'];
} else {
$nav_url = "" . BASE_URL . "" . $nav_item['url'] . "";
}
//check if there are any children
if (isset($nav_item['children']) && count($nav_item['children'])) {
$children = 1;
} else {
$children = 0;
}
if ($children == 1) {
$output .= '<li class="dropdown">';
$output .= '<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" href="' . $nav_url . '" ' . $nav_target . '>' . $nav_item['title'] . ' <span class="caret"></span></a>';
} else {
$output .= '<li' . nav_active($nav_url) . '>';
$output .= '<a href="' . $nav_url . '" ' . $nav_target . '>' . $nav_item['title'] . '</a>';
}
//loop
if ($children == 1) {
$output .= nav($nav_item['children'], true);
}
$output .= '</li>';
}
$output .= '</ul>';
}
return $output;
}
示例10: title
<link href="jQuery%20Sortable_files/vendor.css" rel="stylesheet">
<link href="jQuery%20Sortable_files/application.css" rel="stylesheet">
<link rel="stylesheet" href="test_files/css3menu13/style.css" type="text/css" /><style type="text/css">._css3m{display:none}</style>
<link rel="shortcut icon" href="icon.ico">
<script src="http://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="./jQuery Sortable_files/application.js"></script>
<!-- Site Header Content //-->
</head>
<?php
title($_SESSION['ta_name']);
?>
<body>
<?php
nav("MathCode.php");
?>
<h3> <center> Please use the following form to <font color="red">rank</font> your preferences in courses and times </center></h3>
<br />
<div>
<p><b><center>Note: The following preferences are stored from previous quarters. You can reset them with the button at the bottom left of the page.</center></b> </p>
<br>
</div>
<div style="float:left;width:24%">
<h4>List of Courses <!--<i class="icon-info-sign" data-toggle="tooltip" data-title="Drag any of the following courses into the black box of preferred courses or disliked courses" id='example'></i>--></h4>
示例11: array
<nav id="section-nav" class="navigation vertical" role="navigation">
<?php
$navArray = array(array('label' => __('Themes'), 'uri' => url('themes'), 'resource' => 'Themes', 'privilege' => 'edit'), array('label' => __('Navigation'), 'uri' => url('appearance/edit-navigation')), array('label' => __('Settings'), 'uri' => url('appearance/edit-settings')));
echo nav($navArray, 'admin_navigation_settings');
?>
</nav>
示例12: array
</script>
<?php
if (!is_admin_theme()) {
?>
<div class="container-twelve">
<?php
}
?>
<ul id='section-nav' class='navigation tabs'>
<?php
$typesNav = array();
foreach ($profile_types as $index => $type) {
$typesNav[$type->label] = array('label' => $type->label, 'uri' => url('user-profiles/profiles/user/id/' . $user->id . '/type/' . $type->id));
}
echo nav($typesNav, 'user_profiles_types_user_edit');
?>
</ul>
<?php
echo flash();
?>
<div id="primary">
<section class="seven columns alpha">
<?php
if (empty($userprofilesprofile)) {
?>
<p><?php
echo __('No public profile');
示例13: nav
$this.addClass('no-top-margin');
}
}
});
});
</script>
</head>
<body>
<div id="wrapper">
<div id="header">
<h1>Hôtel-Pensao Sol Na Baïa à Brava</h1>
</div>
<div id="main">
<div id="navigation">
<?php
echo nav();
?>
</div>
<div id="content">
<div class="gutter">
<h2><?php
echo title();
?>
</h2>
<div class="page" style="position:relative;"><?php
echo content();
?>
</div>
<div class="clear"></div>
</div>
</div>
示例14: css
css("signup");
if (!$isParticipant) {
facebookMeta(4);
} else {
facebookMeta(3);
}
?>
</head>
<body id="page-top" class="index hackathon">
<!-- Navigation -->
<?php
include "../includes/nav-simple.php";
nav(true);
?>
<section id="signup" class="bg-trianglePurple">
<div class="container">
<div class="row">
<div class="column12">
<div class="signupTitle">
<h1>Sign-up for T9Hacks</h1>
</div>
</div>
</div>
示例15: nav
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700,300italic' rel='stylesheet' type='text/css'>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script src="/includes/js/toolbelt.js"></script>
<script src="jquery.transit.min.js"></script>
<link rel="stylesheet" type="text/css" href="reset.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<meta charset="UTF-8">
<meta name="description" content="Testing a modal">
<meta name="keywords" content="Modal">
<meta name="author" content="Jason">
</head>
<body>
<?php
nav("1");
?>
<div id="container" style="width:70%; height:100%; margin:auto;">
<div>
<h1 class="orange">Styles Page h1</h1>
<h2 class="orange">Styles Page h2</h2>
<h3 class="orange">Styles Page h3</h3>
<a class="toggleButton"><strong>Open Modal</strong></a>
<br><br>
<img class="fancyIMG" width="562px" height="280px" src="includes/images/img1.jpg"></img>