本文整理汇总了PHP中load_menu函数的典型用法代码示例。如果您正苦于以下问题:PHP load_menu函数的具体用法?PHP load_menu怎么用?PHP load_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_menu函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_menu
/**
* Renders a custom menu
* @param string $menu
*/
function render_menu($menu = null)
{
if (is_null($menu)) {
$menu = load_menu('menu.php');
}
$nav = '<ul class="navbar menu">';
foreach ($menu as $child) {
if (sfContext::getInstance()->getUser()->hasCredential($child->getCredentials())) {
$nav .= '<li class="menu-item ' . ($child->hasChildren() ? 'has-sub-menu' : '') . '" id="' . Scss::slugify($child->getName()) . '-menu-item">' . $child->renderLink();
//link_to($child->getName(),$child->getRoute(),$child->getLinkOptions());
if ($child->hasChildren()) {
$nav .= '<ul class="sub-menu">';
foreach ($child as $baby) {
if ($baby->checkUserAccess()) {
$nav .= '<li class="menu-item" id="' . Scss::slugify($baby->getName()) . '">' . link_to($baby->getName(), $baby->getRoute(), $baby->getLinkOptions()) . '</li>';
}
}
$nav .= '</ul>';
}
$nav .= '</li>';
}
}
$nav .= '</ul>';
print_r($nav);
}
示例2: sdrn_init
/**
* Loads all Mobile.Nav components
*/
function sdrn_init()
{
if (load_menu()) {
add_action('wp_enqueue_scripts', 'sdrn_frontend_scripts_and_styles');
add_filter('body_class', 'sdrn_body_classes');
add_action('wp_footer', 'sdrn_menu', 100);
add_filter('nav_menu_link_attributes', 'sdrn_item_attributes', 10, 3);
add_action('wp_head', 'sdrn_header_styles');
}
}
示例3: load_menu
function load_menu($parent_id, $items) {
echo '<ul>';
foreach ($items as $item) {
if ($item->parent_id == $parent_id) {
if ($item->parent_id == 0) {
echo "<li class='catalog-cat-item' tab='".$item->id."'>";
}
else {
echo "<li>";
}
echo "<a href='/products/show/".$item->id."'>", $item->name, "<br><span>", $item->description, "</span></a>";
// echo "<a href='/products/show/".$item->id."'>", $item->name, "</a>";
load_menu($item->id, $items);
echo "</li>";
}
};
echo "</ul>";
};
示例4: load_menu
********************************************************************************/
require_once 'XTemplate/xtpl.php';
require_once "include/utils/mvc_utils.php";
global $currentModule;
global $moduleList;
global $theme, $action;
$theme_path = "themes/" . $theme . "/";
////SNIPPET REMOVED FOR TEMPLATING
//$image_path=$theme_path."images/";
/////END SNIPPET REMOVED FOR TEMPLATING
require_once $theme_path . 'layout_utils.php';
require_once "include/globalControlLinks.php";
require $theme_path . 'config.php';
global $app_strings;
$module_path = "modules/" . $currentModule . "/";
load_menu($module_path);
$default_charset = $sugar_config['default_charset'];
$xtpl = new XTemplate($theme_path . "header.html");
$xtpl->assign("APP", $app_strings);
if (isset($app_strings['LBL_CHARSET'])) {
$xtpl->assign("LBL_CHARSET", $app_strings['LBL_CHARSET']);
} else {
$xtpl->assign("LBL_CHARSET", $default_charset);
}
//////SNIPPET ADDED FOR TEMPLATING
$image_server = '';
if (defined('TEMPLATE_URL')) {
$image_server = TEMPLATE_URL . '/';
}
$xtpl->assign("IMAGE_SERVER", $image_server);
///////END SNIPPET FOR TEMPLATING
示例5: return_module_language
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Menu for the Import module. Just inherits the menu used in
* whatever module is being imported into.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
********************************************************************************/
global $sugar_config, $mod_strings;
// hide current module strings since we'll be overwriting them
$old_mod_strings = $mod_strings;
// grab the current module's mod_strings and process it's menu
$mod_strings = return_module_language($GLOBALS['current_language'], $_REQUEST['import_module']);
$module_menu = load_menu("modules/{$_REQUEST['import_module']}/");
// reset current mod_strings
$mod_strings = $old_mod_strings;
示例6: elseif
print $output['content'];
} elseif ($route->controller == 'input' && $route->action == 'post') {
print $output['content'];
} elseif ($route->controller == 'input' && $route->action == 'bulk') {
print $output['content'];
} else {
print json_encode($output['content']);
}
} else {
if ($route->format == 'html') {
// Select the theme
$themeDir = "Theme/" . $theme . "/";
if ($embed == 1) {
print view($themeDir . "embed.php", $output);
} else {
$menu = load_menu();
$output['mainmenu'] = view($themeDir . "menu_view.php", array());
print view($themeDir . "theme.php", $output);
}
} else {
if ($route->format == 'text' || $route->format == 'text/plain') {
header('Content-Type: text');
print $output['content'];
} else {
header($_SERVER["SERVER_PROTOCOL"] . " 406 Not Acceptable");
print "URI not acceptable. Unknown format '" . $route->format . "'.";
}
}
}
$ltime = microtime(true) - $ltime;
// if ($session['userid']>0) {
示例7: link_to
echo link_to('Settings', '/settings/account');
?>
</li>
<li><?php
echo $sf_user->isAuthenticated(true) ? link_to('Log Out', '@sf_guard_signout') : link_to('Sign Up', '@sf_guard_signup');
?>
</li>
</ul>
<div id="logo">
<?php
echo link_to('summercamp<span>schedulingsystem</span>', $sf_user->isAuthenticated() ? '@dashboard' : '@homepage');
?>
<sup>BETA</sup>
</div>
<?php
$menu = load_menu('menu.php');
$menu->render();
?>
</div>
</div>
<div id="main-content" class="container">
<?php
echo $sf_content;
?>
<br /> <br /> <br /><br /><br /><br />
</div>
<div id="footer">
<div class="copyright">© 2010, 2011 SCSS; all rights reserved</div>
<div class="footer-links">
<span class="about-tab">About SCSS</span> |
<span class="privacy-tab">Privacy Policy</span> |
示例8: load_menu
<!--Start. Top menu and authentication data block-->
<div class="menu-header">
<div class="container">
<nav class="left-header f_l">
<ul class="nav">
<?php
echo load_menu('top_menu');
?>
</ul>
</nav>
<div class="right-header f_r">
<?php
$this->include_shop_tpl('auth_data', '/home/igor/sites/skidka-shop.com.ua/www/templates/lightVertical');
?>
</div>
</div>
</div>
<!--End. Top menu and authentication data block-->
<div class="content-header">
<div class="container">
<!-- Logo-->
<div class="left-content-header">
<div class="header-left-content-header t-a_j">
<?php
if ($CI->uri->uri_string() == '') {
?>
<span class="logo">
<img src="<?php
echo siteinfo('siteinfo_logo_url');
?>
示例9: Array
var texts = new Array(
"<font color='{COLOR}' ><?php
echo $header;
?>
</font>"
);
var bgcolor = "#FF0000"; // background color, must be valid browser hex color (not color names)
var fcolor = "#FFFF66"; // foreground or font color
var steps = 60; // number of steps to fade
var show = 500; // milliseconds to display message
var sleep = 600; // milliseconds to pause inbetween messages
var loop = stop; // true = continue to display messages, false = stop at last message
</SCRIPT>
<script language="JavaScript" src="fader.js"></script>
<body class="yui-skin-sam" style="padding:0; margin:0;" onLoad="animate();progres_bar();fade();">
<?php
$menus = load_menu();
if (b_logged()) {
theme_main_page();
} else {
theme_login_page();
}
include "form_dialog.php";
?>
</body>
</html>
示例10: displayHeader
/**
* Determine whether or not to dispay the header on the page.
*/
function displayHeader()
{
global $theme;
global $max_tabs;
global $app_strings;
global $current_user;
global $sugar_config;
global $app_list_strings;
$GLOBALS['app']->headerDisplayed = true;
if (!function_exists('get_new_record_form') && (file_exists('modules/' . $this->module . '/metadata/sidecreateviewdefs.php') || file_exists('custom/modules/' . $this->module . '/metadata/sidecreateviewdefs.php'))) {
require_once 'include/EditView/SideQuickCreate.php';
}
if (!$this->_menuExists($this->module) && !empty($GLOBALS['mod_strings']['LNK_NEW_RECORD'])) {
$GLOBALS['module_menu'][] = array("index.php?module={$this->module}&action=EditView&return_module={$this->module}&return_action=DetailView", $GLOBALS['mod_strings']['LNK_NEW_RECORD'], "{$GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']}{$this->module}", $this->module);
$GLOBALS['module_menu'][] = array("index.php?module={$this->module}&action=index", $GLOBALS['mod_strings']['LNK_LIST'], $this->module, $this->module);
}
$themeObject = SugarThemeRegistry::current();
$theme = $themeObject->__toString();
$ss = new Sugar_Smarty();
$ss->assign("APP", $app_strings);
$ss->assign("THEME", $theme);
$ss->assign("MODULE_NAME", $this->module);
// get css
$css = $themeObject->getCSS();
if ($this->_getOption('view_print')) {
$css .= '\\n<link rel="stylesheet" type="text/css" href="' . $themeObject->getCSSURL('print.css') . '" media="all" />';
}
$ss->assign("SUGAR_CSS", $css);
// get javascript
ob_start();
$this->renderJavascript();
$ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
ob_end_clean();
// get favicon
$user_module_favicon = $current_user->getPreference('module_favicon');
if (!isset($user_module_favicon) && isset($GLOBALS['sugar_config']['default_module_favicon'])) {
$user_module_favicon = $GLOBALS['sugar_config']['default_module_favicon'];
} elseif (!isset($user_module_favicon)) {
$user_module_favicon = false;
}
$favicon = $themeObject->getImageURL($this->module . '.gif', false);
if (!sugar_is_file($favicon) || !$user_module_favicon) {
$favicon = $themeObject->getImageURL('sugar_icon.ico', false);
}
$ss->assign('FAVICON_URL', getJSPath($favicon));
// get the module menu
$shortcut_menu = array();
$module_menu = load_menu("modules/" . $this->module . "/");
foreach ($module_menu as $key => $menu_item) {
$shortcut_menu[$key] = array("URL" => $menu_item[0], "LABEL" => $menu_item[1], "MODULE_NAME" => $menu_item[2], "IMAGE" => $themeObject->getImage($menu_item[2], "alt='" . $menu_item[1] . "' border='0' align='absmiddle'"));
}
$ss->assign("SHORTCUT_MENU", $shortcut_menu);
// handle rtl text direction
if (isset($_REQUEST['RTL']) && $_REQUEST['RTL'] == 'RTL') {
$_SESSION['RTL'] = true;
}
if (isset($_REQUEST['LTR']) && $_REQUEST['LTR'] == 'LTR') {
unset($_SESSION['RTL']);
}
if (isset($_SESSION['RTL']) && $_SESSION['RTL']) {
$ss->assign("DIR", 'dir="RTL"');
}
// handle resizing of the company logo correctly on the fly
$companyLogoURL = $themeObject->getImageURL('company_logo.png', false);
$ss->assign("COMPANY_LOGO_URL", getJSPath($companyLogoURL));
$company_logo_attributes = sugar_cache_retrieve('company_logo_attributes');
if (!empty($company_logo_attributes) && md5_file($companyLogoURL) == $company_logo_attributes[0]) {
$ss->assign("COMPANY_LOGO_WIDTH", $company_logo_attributes[1]);
$ss->assign("COMPANY_LOGO_HEIGHT", $company_logo_attributes[2]);
} else {
list($width, $height) = getimagesize($companyLogoURL);
if ($width > 212 || $height > 40) {
$resizePctWidth = ($width - 212) / 212;
$resizePctHeight = ($height - 40) / 40;
if ($resizePctWidth > $resizePctHeight) {
$resizeAmount = $width / 212;
} else {
$resizeAmount = $height / 40;
}
$ss->assign("COMPANY_LOGO_WIDTH", round($width * (1 / $resizeAmount)));
$ss->assign("COMPANY_LOGO_HEIGHT", round($height * (1 / $resizeAmount)));
sugar_cache_put('company_logo_attributes', array(md5_file($companyLogoURL), $ss->get_template_vars("COMPANY_LOGO_WIDTH"), $ss->get_template_vars("COMPANY_LOGO_HEIGHT")));
} else {
$ss->assign("COMPANY_LOGO_WIDTH", $width);
$ss->assign("COMPANY_LOGO_HEIGHT", $height);
}
}
// get the global links
$gcls = array();
$global_control_links = array();
require "include/globalControlLinks.php";
foreach ($global_control_links as $key => $value) {
if ($key == 'users') {
//represents logout link.
$ss->assign("LOGOUT_LINK", $value['linkinfo'][key($value['linkinfo'])]);
$ss->assign("LOGOUT_LABEL", key($value['linkinfo']));
//key value for first element.
//.........这里部分代码省略.........
示例11: load_menu
<?php
/* @var $_settings PIASettings */
/* @var $_pia PIACommands */
/* @var $_files FilesystemOperations */
/* @var $_services SystemServices */
$disp_body = "<body>\n";
//$disp_body .= "<h1>PIA-Tunnel Management Interface</h1>";
/* always include the menu on top of the page */
$disp_body .= load_menu();
$disp_body .= "<div class=\"content\">\n";
/* check which pages needs to be processed */
$plen = mb_strlen($_REQUEST['page']);
//sanity check
if ($plen > 1 && $plen < 20 && isset($_REQUEST['page'])) {
switch ($_REQUEST['page']) {
case 'config':
require_once $inc_dir . 'logic_config.php';
break;
case 'tools':
require_once $inc_dir . 'logic_tools.php';
break;
case 'setup-admin_account':
require_once $inc_dir . 'logic_admin_account.php';
break;
case 'logout':
require_once $inc_dir . 'logic_logout.php';
break;
case 'setup-wizard':
require_once $inc_dir . 'logic_wizard.php';
break;
示例12: load_menu
public function load_menu($level, $id = FALSE)
{
$query = $this->db->select("A.`" . self::ID_MENU . "` AS ID, A.`level`, B.`name`")->from("`" . self::MENU . "` AS A")->join("`" . self::MENU_DESC . "` AS B", "B.`" . self::ID_MENU . "` = A.`" . self::ID_MENU . "` && B.`" . self::ID_LANGS . "` = " . $this->id_langs, "left")->where("A.`id_users`", $this->id_users)->where("A.`level`", $level);
if ($id) {
$query = $query->where("A.`" . self::ID_MENU . "` <>", $id);
}
$query = $query->get();
if ($query->num_rows() > 0) {
foreach ($query->result_array() as $ms) {
$data[$ms['ID']] = 'ID: ' . $ms['ID'] . ' - ' . $ms['name'];
}
}
$this->load->helper('menu/menu_helper');
load_menu($data);
}
示例13: displayHeader
/**
* Determine whether or not to dispay the header on the page.
*/
function displayHeader()
{
global $theme;
global $max_tabs;
global $app_strings;
global $current_user;
global $sugar_config;
global $app_list_strings;
$GLOBALS['app']->headerDisplayed = true;
if (!function_exists('get_new_record_form') && (file_exists('modules/' . $this->module . '/metadata/sidecreateviewdefs.php') || file_exists('custom/modules/' . $this->module . '/metadata/sidecreateviewdefs.php'))) {
require_once 'include/EditView/SideQuickCreate.php';
}
if (!$this->_menuExists($this->module) && !empty($GLOBALS['mod_strings']['LNK_NEW_RECORD'])) {
$GLOBALS['module_menu'][] = array("index.php?module={$this->module}&action=EditView&return_module={$this->module}&return_action=DetailView", $GLOBALS['mod_strings']['LNK_NEW_RECORD'], "{$GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL']}{$this->module}", $this->module);
$GLOBALS['module_menu'][] = array("index.php?module={$this->module}&action=index", $GLOBALS['mod_strings']['LNK_LIST'], $this->module, $this->module);
}
$themeObject = SugarThemeRegistry::current();
$theme = $themeObject->__toString();
$ss = new Sugar_Smarty();
$ss->assign("APP", $app_strings);
$ss->assign("THEME", $theme);
$ss->assign("THEME_IE6COMPAT", $themeObject->ie6compat ? 'true' : 'false');
$ss->assign("MODULE_NAME", $this->module);
// get css
$css = $themeObject->getCSS();
if ($this->_getOption('view_print')) {
$css .= '<link rel="stylesheet" type="text/css" href="' . $themeObject->getCSSURL('print.css') . '" media="all" />';
}
$ss->assign("SUGAR_CSS", $css);
// get javascript
ob_start();
$this->renderJavascript();
$ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
ob_end_clean();
// get favicon
if (isset($GLOBALS['sugar_config']['default_module_favicon'])) {
$module_favicon = $GLOBALS['sugar_config']['default_module_favicon'];
} else {
$module_favicon = false;
}
$favicon = '';
if ($module_favicon) {
$favicon = $themeObject->getImageURL($this->module . '.gif', false);
}
if (!sugar_is_file($favicon) || !$module_favicon) {
$favicon = $themeObject->getImageURL('sugar_icon.ico', false);
}
$ss->assign('FAVICON_URL', getJSPath($favicon));
// get the module menu
$shortcut_menu = array();
$module_menu = load_menu("modules/" . $this->module . "/");
foreach ($module_menu as $key => $menu_item) {
$shortcut_menu[$key] = array("URL" => $menu_item[0], "LABEL" => $menu_item[1], "MODULE_NAME" => $menu_item[2], "IMAGE" => $themeObject->getImage($menu_item[2], "alt='" . $menu_item[1] . "' border='0' align='absmiddle'"));
}
$ss->assign("SHORTCUT_MENU", $shortcut_menu);
// handle rtl text direction
if (isset($_REQUEST['RTL']) && $_REQUEST['RTL'] == 'RTL') {
$_SESSION['RTL'] = true;
}
if (isset($_REQUEST['LTR']) && $_REQUEST['LTR'] == 'LTR') {
unset($_SESSION['RTL']);
}
if (isset($_SESSION['RTL']) && $_SESSION['RTL']) {
$ss->assign("DIR", 'dir="RTL"');
}
// handle resizing of the company logo correctly on the fly
$companyLogoURL = $themeObject->getImageURL('company_logo.png');
$companyLogoURL_arr = explode('?', $companyLogoURL);
$companyLogoURL = $companyLogoURL_arr[0];
$company_logo_attributes = sugar_cache_retrieve('company_logo_attributes');
if (!empty($company_logo_attributes)) {
$ss->assign("COMPANY_LOGO_MD5", $company_logo_attributes[0]);
$ss->assign("COMPANY_LOGO_WIDTH", $company_logo_attributes[1]);
$ss->assign("COMPANY_LOGO_HEIGHT", $company_logo_attributes[2]);
} else {
// Always need to md5 the file
$ss->assign("COMPANY_LOGO_MD5", md5_file($companyLogoURL));
list($width, $height) = getimagesize($companyLogoURL);
if ($width > 212 || $height > 40) {
$resizePctWidth = ($width - 212) / 212;
$resizePctHeight = ($height - 40) / 40;
if ($resizePctWidth > $resizePctHeight) {
$resizeAmount = $width / 212;
} else {
$resizeAmount = $height / 40;
}
$ss->assign("COMPANY_LOGO_WIDTH", round($width * (1 / $resizeAmount)));
$ss->assign("COMPANY_LOGO_HEIGHT", round($height * (1 / $resizeAmount)));
} else {
$ss->assign("COMPANY_LOGO_WIDTH", $width);
$ss->assign("COMPANY_LOGO_HEIGHT", $height);
}
// Let's cache the results
sugar_cache_put('company_logo_attributes', array($ss->get_template_vars("COMPANY_LOGO_MD5"), $ss->get_template_vars("COMPANY_LOGO_WIDTH"), $ss->get_template_vars("COMPANY_LOGO_HEIGHT")));
}
$ss->assign("COMPANY_LOGO_URL", getJSPath($companyLogoURL) . "&logo_md5=" . $ss->get_template_vars("COMPANY_LOGO_MD5"));
// get the global links
//.........这里部分代码省略.........
示例14: load_menu
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Kevin Yeh <kevin.y@integralemr.com>
* @link http://www.open-emr.org
*/
require_once "menu_data.php";
require_once "menu_updates.php";
require_once "menu_db.php";
$menu_parsed = load_menu("default");
if (count($menu_parsed) == 0) {
$menu_parsed = json_decode($menu_json);
}
menu_update_entries($menu_parsed);
$menu_restrictions = array();
menu_apply_restrictions($menu_parsed, $menu_restrictions);
?>
<script type="text/javascript">
function menu_entry(object)
{
var self=this;
self.label=ko.observable(object.label);
self.header=false;