本文整理汇总了PHP中generateNavigation函数的典型用法代码示例。如果您正苦于以下问题:PHP generateNavigation函数的具体用法?PHP generateNavigation怎么用?PHP generateNavigation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generateNavigation函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateNavigation
/**
* Recusively generates the navigation from a special navigation xml
* @param {simplexml_load_file} $location
* @return {string} that is the entire generated navigation including the #navigation wrapper
*/
function generateNavigation($location)
{
$tmpData = '';
$result = '';
foreach ($location->link as $link) {
$result .= '<li title="' . $link->title . '">';
$tmpData = $link->linkId;
// Determin if this links to a page or is just a section title
if ($tmpData == '') {
$result .= '<a href="#">';
} else {
$result .= '<a href="' . $tmpData . '">';
}
// Determin if this link should have a Font Awesome icon displayed
$tmpData = $link->icon;
if ($tmpData != '') {
$result .= '<i class="fa fa-' . $tmpData . ' nav-icon"></i><span>' . $link->title . '</span></a>';
} else {
$result .= '<span>' . $link->title . '</span></a>';
}
// Recursive call to handle children
if ($link->children != '') {
$result .= '<ul>';
$result .= generateNavigation($link->children);
$result .= '</ul>';
}
$result .= '</li>';
}
// Send back the entire generation
return $result;
}
示例2: set_page_message
set_page_message(tr('Could not create domain alias. An unexpected error occurred.'), 'error');
return false;
}
return true;
}
/***********************************************************************************************************************
* Main
*/
require_once 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart);
check_login('user');
customerHasFeature('domain_aliases') or showBadRequestErrorPage();
$mainDmnProps = get_domain_default_props($_SESSION['user_id']);
$domainAliasesCount = get_domain_running_als_cnt($mainDmnProps['domain_id']);
if ($mainDmnProps['domain_alias_limit'] != 0 && $domainAliasesCount >= $mainDmnProps['domain_alias_limit']) {
set_page_message(tr('You have reached the maximum number of domain aliasses allowed by your subscription.'), 'warning');
redirectTo('domains_manage.php');
}
if (!empty($_POST) && addDomainAlias()) {
redirectTo('domains_manage.php');
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/alias_add.tpl', 'page_message' => 'layout', 'shared_mount_point_domain' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Client / Domains / Add Domain Alias'), 'TR_DOMAIN_ALIAS' => tr('Domain alias'), 'TR_DOMAIN_ALIAS_NAME' => tr('Domain alias name'), 'TR_DOMAIN_ALIAS_NAME_TOOLTIP' => tr("You must omit 'www'. It will be added automatically."), 'TR_SHARED_MOUNT_POINT' => tr('Shared mount point'), 'TR_SHARED_MOUNT_POINT_TOOLTIP' => tr('Allows to share the mount point of another domain.'), 'TR_URL_FORWARDING' => tr('URL forwarding'), 'TR_URL_FORWARDING_TOOLTIP' => tr('Allows to forward any request made to this domain alias to a specific URL. Be aware that when this option is in use, no Web folder is created for the domain alias.'), 'TR_FORWARD_TO_URL' => tr('Forward to URL'), 'TR_YES' => tr('Yes'), 'TR_NO' => tr('No'), 'TR_HTTP' => 'http://', 'TR_HTTPS' => 'https://', 'TR_FTP' => 'ftp://', 'TR_ADD' => tr('Add'), 'TR_CANCEL' => tr('Cancel')));
generateNavigation($tpl);
generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
示例3: generateNavigation
echo $product_name;
?>
</span> <?php
echo $product_desc;
?>
</h1>
</div>
<div class="page">
<!--========================================================
HEADER
=========================================================-->
<header>
<nav class="nav">
<ul class="menu" data-type="navbar">
<?php
echo generateNavigation($sections, $lang, $section_param);
?>
</ul>
</nav>
</header>
<!--========================================================
CONTENT
=========================================================-->
<main id="main">
<div class="container">
<?php
include_once 'section.php';
?>
</div>
</main>
示例4: admin_generateCustomerAcountDeletionValidationPage
/**
* Generates customer account deletion validation page.
*
* @param int $userId Customer account unique identifier
* @return iMSCP_pTemplate
*/
function admin_generateCustomerAcountDeletionValidationPage($userId)
{
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
$stmt = exec_query('SELECT admin_name FROM admin WHERE admin_id = ?', $userId);
if (!$stmt->rowCount()) {
showBadRequestErrorPage();
}
$adminName = decode_idna($stmt->fields['admin_name']);
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'admin/user_delete.tpl', 'page_message' => 'layout', 'mail_list' => 'page', 'mail_item' => 'mail_list', 'ftp_list' => 'page', 'ftp_item' => 'ftp_list', 'dmn_list' => 'page', 'dmn_item' => 'dmn_list', 'als_list' => 'page', 'als_item' => 'als_list', 'sub_list' => 'page', 'sub_item' => 'sub_list', 'db_list' => 'page', 'db_item' => 'db_list'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Admin / Users / Overview / Delete Customer'), 'TR_ACCOUNT_SUMMARY' => tr('Customer account summary'), 'TR_EMAILS' => tr('Emails'), 'TR_FTP_ACCOUNTS' => tr('Ftp accounts'), 'TR_DOMAINS' => tr('Domains'), 'TR_DOMAIN_ALIASES' => tr('Domain aliases'), 'TR_SUBDOMAINS' => tr('Subdomains'), 'TR_DATABASES' => tr('SQL databases'), 'TR_REALLY_WANT_TO_DELETE_CUSTOMER_ACCOUNT' => tr("Do you really want to delete the entire %s customer account? This operation cannot be undone.", "<strong>{$adminName}</strong>"), 'USER_ID' => $userId, 'TR_YES_DELETE_ACCOUNT' => tr('Yes, delete this account.'), 'TR_DELETE' => tr('Delete'), 'TR_CANCEL' => tr('Cancel')));
generateNavigation($tpl);
// Checks for mail accounts
$stmt = exec_query('
SELECT
mail_type, mail_addr
FROM
mail_users
WHERE
domain_id IN (SELECT domain_id FROM domain WHERE domain_admin_id = ?)
', $userId);
if ($stmt->rowCount()) {
while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
$mailTypes = explode(',', $row['mail_type']);
$mailTypesdisplayArray = array();
foreach ($mailTypes as $mtype) {
$mailTypesdisplayArray[] = user_trans_mail_type($mtype);
}
$mailTypesdisplayTxt = implode(', ', $mailTypesdisplayArray);
$addr = explode('@', $row['mail_addr']);
$tpl->assign(array('MAIL_ADDR' => tohtml($addr[0] . '@' . decode_idna($addr[1])), 'MAIL_TYPE' => $mailTypesdisplayTxt));
$tpl->parse('MAIL_ITEM', '.mail_item');
}
} else {
$tpl->assign('MAIL_LIST', '');
}
// Checks for FTP accounts
$stmt = exec_query('SELECT userid, homedir FROM ftp_users WHERE admin_id = ?', $userId);
if ($stmt->rowCount()) {
while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
$username = explode('@', $row['userid']);
$tpl->assign(array('FTP_USER' => tohtml($username[0] . '@' . decode_idna($username[1])), 'FTP_HOME' => tohtml(substr($row['homedir'], strlen($cfg->USER_WEB_DIR)))));
$tpl->parse('FTP_ITEM', '.ftp_item');
}
} else {
$tpl->assign('FTP_LIST', '');
}
// Check for domains
// NOTE: Currently, each customer has only one domain but that will change in near future
$stmt = exec_query('SELECT domain_id, domain_name FROM domain WHERE domain_admin_id = ?', $userId);
$domainId = $stmt->fields['domain_id'];
$domainName = tohtml(decode_idna($stmt->fields['domain_name']));
$tpl->assign('DOMAIN_NAME', $domainName);
$tpl->parse('DMN_ITEM', '.dmn_item');
// Checks for domain's aliases
$aliasIds = array();
$stmt = exec_query('SELECT alias_id, alias_name, alias_mount FROM domain_aliasses WHERE domain_id = ?', $domainId);
if ($stmt->rowCount()) {
while ($data = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
$aliasIds[] = $data['alias_id'];
$tpl->assign(array('ALS_NAME' => tohtml(decode_idna($data['alias_name'])), 'ALS_MNT' => tohtml($data['alias_mount'])));
$tpl->parse('ALS_ITEM', '.als_item');
}
} else {
$tpl->assign('ALS_LIST', '');
}
// Checks for subdomains
$stmt = exec_query('SELECT subdomain_name, subdomain_mount FROM subdomain WHERE domain_id = ?', $domainId);
if ($stmt->rowCount()) {
while ($data = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
$tpl->assign(array('SUB_NAME' => tohtml(decode_idna($data['subdomain_name'])), 'SUB_MNT' => tohtml($data['subdomain_mount'])));
$tpl->parse('SUB_ITEM', '.sub_item');
}
} else {
$tpl->assign('SUB_LIST', '');
}
// Checks subdomain_alias
if (count($aliasIds)) {
$aliasIds = implode(',', $aliasIds);
$stmt = execute_query("SELECT subdomain_alias_name, subdomain_alias_mount FROM subdomain_alias WHERE alias_id IN ({$aliasIds})");
if ($stmt->rowCount()) {
while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
$tpl->assign(array('SUB_NAME' => tohtml(decode_idna($row['subdomain_alias_name'])), 'SUB_MNT' => tohtml($row['subdomain_alias_mount'])));
$tpl->parse('SUB_ITEM', '.sub_item');
}
}
}
// Checks for databases and SQL users
$stmt = exec_query('SELECT sqld_id, sqld_name FROM sql_database WHERE domain_id = ?', $domainId);
if ($stmt->rowCount()) {
while ($row = $stmt->fetchRow(PDO::FETCH_ASSOC)) {
$stmt2 = exec_query('SELECT sqlu_name FROM sql_user WHERE sqld_id = ?', $row['sqld_id']);
$sqlUsersList = array();
//.........这里部分代码省略.........
示例5: generateNavigation
?>
</h1>
<div class="tm-title-caption"><?php
echo $projectTitleCaption;
?>
</div>
</div>
<div class="page">
<!--========================================================
HEADER
=========================================================-->
<header>
<nav class="nav">
<ul class="menu" data-type="navbar">
<?php
echo generateNavigation($sections, $lang, $section_param, $project, $defaultProject);
?>
</ul>
</nav>
</header>
<!--========================================================
CONTENT
=========================================================-->
<main id="main">
<div class="container">
<?php
include_once get_path('/section.php', true);
?>
</div>
</main>
示例6: generateNavigation
<div class="container">
<div class="row">
<div class="span11 offset1">
<a href="/">
<img src="img/appc.png">
<h1>Anvil</h1>
</a>
</div>
</div>
</div>
</header>
<div class="container" id="content">
<div class="span3 offset1">
<?php
generateNavigation();
?>
</div>
<div class="span12" id="reports_container">
<h2 id="performance_title"><?php
echo $_GET["branch"];
?>
Branch Performance</h2>
<a href="runs.php?branch=<?php
echo $_GET['branch'];
?>
">Runs</a> | <a href="performance.php?branch=<?php
echo $_GET['branch'];
?>
">Performance</a>