本文整理汇总了PHP中Navigation::get_links方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::get_links方法的具体用法?PHP Navigation::get_links怎么用?PHP Navigation::get_links使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::get_links方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Template
$setting_data = ModuleSetting::load_setting(PAGE_GROUPS_CATEGORY, $uid);
$leftModulesFromDB = $setting_data['left'];
$middleModulesFromDB = $setting_data['middle'];
$rightModulesFromDB = $setting_data['right'];
$page = new Template(CURRENT_THEME_FSPATH . "/groups.tpl");
$page->set('current_theme_path', PA::$theme_url);
//header of group page
$optional_parameters = "onload=\"{$onload}\"";
html_body($optional_parameters);
//header of group page
$header = new Template(CURRENT_THEME_FSPATH . "/header.tpl");
$header->set('current_theme_path', PA::$theme_url);
$header->set('current_theme_rel_path', PA::$theme_rel);
// find navigation link for header
$navigation = new Navigation();
$navigation_links = $navigation->get_links();
$header->set('navigation_links', $navigation_links);
$header->set('onload', $onload);
$header->tier_one_tab = $main_tier;
$header->tier_two_tab = $second_tier;
$header->tier_three_tab = $third_tier;
if (PA::$network_info) {
$header->set_object('network_info', PA::$network_info);
}
// This block of code has to be removed when this page will be rendered using PageRenderer.
$top_navigation_bar = new Template(CURRENT_THEME_FSPATH . "/top_navigation_bar.tpl");
$top_navigation_bar->set('navigation_links', $navigation_links);
//left of group page
foreach ($leftModulesFromDB as $leftModule) {
$file = PA::$blockmodule_path . "/{$leftModule}/{$leftModule}.php";
require_once $file;
示例2: isset
function __construct($cb, $page_id, $title, $page_template = "homepage_pa.tpl", $header_template = "header.tpl", $default_mode = PRI, $default_block_type = HOMEPAGE, $network_info_ = NULL, $onload = NULL, $setting_data = NULL)
{
global $app, $page;
if (PA::$profiler) {
PA::$profiler->startTimer('PageRenderer_init');
}
// we may want to know the page_tpe elsewhere too
PA::$config->page_type = $page_id;
// NOTE: PA::$config->page_type var = $page_id and should be removed!
$this->page_id = $page_id;
$this->debugging = isset($_GET['debug']);
$this->page_template = $page_template;
$this->top_navigation_template = 'top_navigation_bar.tpl';
//TO DO: Remove this hardcoded text afterwards
$this->header_template = $header_template;
//settings for current network
$this->network_info = $network_info_ ? $network_info_ : PA::$network_info;
//FIXME: does this have to be a parameter? can't we just always use the global PA::$network_info?
$this->module_arrays = array();
// the function hide_message_window is added here
// so whenever html page is loaded the message window's ok button gets focus
// here if previouly some function is defined as
// onload = "ajax_call_method(ajax_titles, $uid, ajax_urls);"
// now it will look like
// onload = "ajax_call_method(ajax_titles, $uid, ajax_urls); hide_message_window();"
$this->onload = "{$onload} hide_message_window('confirm_btn');";
$this->page_title = $title;
$this->html_body_attributes = "";
// default settings for the tiers
$this->main_tier = @$_GET['tier_one'];
$this->second_tier = @$_GET['tier_two'];
$this->third_tier = @$_GET['tier_three'];
$navigation = new Navigation();
$this->navigation_links = $navigation->get_links();
$this->message_count = null;
if (!isset(PA::$login_uid)) {
PA::$login_uid = @$_SESSION['user']['id'];
}
if (PA::$login_uid) {
$this->message_count = Message::get_new_msg_count(PA::$login_uid);
}
if (!isset($dynamic_page)) {
$dynamic_page = new DynamicPage($this->page_id);
if (!is_object($dynamic_page) or !$dynamic_page->docLoaded) {
throw new Exception("Page XML config file for page ID: {$page_id} - not found!");
}
$dynamic_page->initialize();
}
if (false !== strpos($dynamic_page->page_type, 'group') && (!empty($_REQUEST['gid']) || !empty($_REQUEST['ccid']))) {
// page is a group page - get group module settings
$_gr_id = !empty($_REQUEST['gid']) ? $_REQUEST['gid'] : $_REQUEST['ccid'];
$this->setting_data = ModuleSetting::load_setting($this->page_id, $_gr_id, 'group');
$this->page_template = $this->setting_data['page_template'];
if (empty($this->setting_data['access_permission'])) {
// no permissions required to access page
$access_permission = true;
} else {
$access_permission = PermissionsHandler::can_group_user(PA::$login_uid, $_gr_id, array('permissions' => $this->setting_data['access_permission']));
}
} else {
if (false !== strpos($dynamic_page->page_type, 'user') && !empty(PA::$login_uid)) {
// page is an user page - get user module settings
// echo "POSTING TO USER PAGE"; die();
$this->setting_data = ModuleSetting::load_setting($this->page_id, PA::$login_uid, 'user');
$this->page_template = $this->setting_data['page_template'];
if (empty($this->setting_data['access_permission'])) {
// no permissions required to access page
$access_permission = true;
} else {
$access_permission = PermissionsHandler::can_user(PA::$login_uid, array('permissions' => $this->setting_data['access_permission']));
}
} else {
// page is a network page - get network module settings
$this->setting_data = ModuleSetting::load_setting($this->page_id, PA::$network_info->network_id, 'network');
$this->page_template = $this->setting_data['page_template'];
if (empty($this->setting_data['access_permission'])) {
// no permissions required to access page
$access_permission = true;
} else {
$access_permission = PermissionsHandler::can_network_user(PA::$login_uid, PA::$network_info->network_id, array('permissions' => $this->setting_data['access_permission']));
}
}
}
$this->page = new Template(CURRENT_THEME_FSPATH . "/" . $this->page_template);
$this->page->set('current_theme_path', PA::$theme_url);
$this->page->set('current_theme_rel_path', PA::$theme_rel);
// Loading the templates variables for the Outer templates files
$this->page->set('outer_class', get_class_name(PA::$config->page_type));
$this->top_navigation_bar = new Template(CURRENT_THEME_FSPATH . "/" . $this->top_navigation_template);
$this->top_navigation_bar->set('current_theme_path', PA::$theme_url);
$this->top_navigation_bar->set('current_theme_rel_path', PA::$theme_rel);
$this->top_navigation_bar->set('navigation_links', $this->navigation_links);
$this->setHeader($this->header_template);
$this->footer = new Template(CURRENT_THEME_FSPATH . "/footer.tpl");
$this->footer->set('current_theme_path', PA::$theme_url);
$this->footer->set('page_name', $title);
$page = $this;
$this->preInitialize($this->setting_data);
$this->initNew($cb, $default_mode, $default_block_type, $this->setting_data);
if (!$access_permission) {
//.........这里部分代码省略.........
示例3: isset
function __construct($cb, $page_type, $title, $page_template = "homepage_pa.tpl", $header_template = "header.tpl", $default_mode = PRI, $default_block_type = HOMEPAGE, $network_info_ = NULL, $onload = NULL, $setting_data = NULL)
{
global $login_uid, $page_uid, $uid, $path_prefix, $current_theme_path, $current_theme_rel_path, $base_url, $network_info, $current_blockmodule_path;
$this->debugging = isset($_GET['debug']);
$this->page_template = $page_template;
$this->top_navigation_template = 'top_navigation_bar.tpl';
//TO DO: Remove this hardcoded text afterwards
$this->header_template = $header_template;
//settings for current network
$this->network_info = $network_info_ ? $network_info_ : $network_info;
//FIXME: does this have to be a parameter? can't we just always use the global $network_info?
// the function hide_message_window is added here
// so whenever html page is loaded the message window's ok button gets focus
// here if previouly some function is defined as
// onload = "ajax_call_method(ajax_titles, $uid, ajax_urls);"
// now it will look like
// onload = "ajax_call_method(ajax_titles, $uid, ajax_urls); hide_message_window();"
$this->onload = "{$onload} hide_message_window('confirm_btn');";
$this->page_title = $title;
$this->html_body_attributes = "";
// default settings for the tiers
$this->main_tier = @$_GET['tier_one'];
$this->second_tier = @$_GET['tier_two'];
$this->third_tier = @$_GET['tier_three'];
$navigation = new Navigation();
$navigation_links = $navigation->get_links();
$message_count = null;
if ($login_uid) {
$message_count = Message::get_new_msg_count($login_uid);
}
// load all templates
$this->page =& new Template(CURRENT_THEME_FSPATH . "/" . $this->page_template);
$this->page->set('current_theme_path', $current_theme_path);
$this->page->set('current_theme_rel_path', $current_theme_rel_path);
$this->page->set('base_url', $base_url);
// Loading the templates variables for the Outer templates files
$this->page->set('outer_class', get_class_name($page_type));
$this->top_navigation_bar =& new Template(CURRENT_THEME_FSPATH . "/" . $this->top_navigation_template);
$this->top_navigation_bar->set('current_theme_path', $current_theme_path);
$this->top_navigation_bar->set('current_theme_rel_path', $current_theme_rel_path);
$this->top_navigation_bar->set('navigation_links', $navigation_links);
$this->header =& new Template(CURRENT_THEME_FSPATH . "/" . $this->header_template);
$this->header->set('current_theme_path', $current_theme_path);
$this->header->set('current_theme_rel_path', $current_theme_rel_path);
$this->header->set('base_url', $base_url);
$this->header->set_object('network_info', $this->network_info);
$this->header->set('message_count', $message_count['unread_msg']);
$this->header->set('navigation_links', $navigation_links);
$this->footer =& new Template(CURRENT_THEME_FSPATH . "/footer.tpl");
$this->footer->set('current_theme_path', $current_theme_path);
$this->footer->set('page_name', $title);
// load module settings
// if we want to change the Module's arrangement then we give the setting_data to this function or we want to change the Ordering of the Modules ...
if ($setting_data) {
$this->setting_data = $setting_data;
} else {
$this->setting_data = !$page_type ? NULL : ModuleSetting::load_setting($page_type, $uid);
}
// render all modules
$this->module_arrays = array();
foreach (array("left", "middle", "right") as $module_column) {
$modulesFromDB = !$page_type ? NULL : @$this->setting_data[$module_column];
$array_modules = array();
// render all modules
if ($modulesFromDB) {
foreach ($modulesFromDB as $moduleName) {
if (!$moduleName) {
continue;
}
$file = "{$current_blockmodule_path}/{$moduleName}/{$moduleName}.php";
try {
require_once $file;
} catch (Exception $e) {
echo "<p>Failed to require_once {$file}.</p>";
throw $e;
}
$obj = new $moduleName();
$obj->login_uid = (int) $login_uid;
// uid of logged in user
$obj->page_uid = (int) $page_uid;
// uid specified in URL
// standard column-specific initialization
switch ($module_column) {
case 'left':
case 'right':
if ($default_mode) {
$obj->mode = $default_mode;
}
// some modules don't like to be set as PRI/HOMEPAGE
switch ($moduleName) {
case 'LogoModule':
case 'AdsByGoogleModule':
case 'GroupAccessModule':
case 'GroupStatsModule':
break;
default:
if ($default_block_type) {
$obj->block_type = $default_block_type;
}
}
//.........这里部分代码省略.........