本文整理汇总了PHP中PageRenderer类的典型用法代码示例。如果您正苦于以下问题:PHP PageRenderer类的具体用法?PHP PageRenderer怎么用?PHP PageRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PageRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PageRenderer
}
if (@$_GET['sort_by'] == 'alphabetic') {
$obj->sort_by = 'U.login_name';
$obj->direction = 'ASC';
} else {
$obj->sort_by = 'U.created';
$obj->direction = 'DESC';
}
$obj->Paging["page"] = $paging["page"];
$obj->Paging["show"] = 10;
$obj->network_info = PA::$network_info;
$obj->super_user_and_mothership = $super_user_and_mothership;
break;
}
}
$page = new PageRenderer("setup_module", PAGE_NETWORK_MANAGE_USERS, "Manage Registered User", 'container_two_column.tpl', 'header.php', PUB, HOMEPAGE, PA::$network_info);
if (@$_GET['msg']) {
require_once 'web/languages/english/MessagesHandler.php';
$msg_obj = new MessagesHandler();
$message = $msg_obj->get_message($_GET['msg']);
}
if (@$message) {
$msg_tpl = new Template(CURRENT_THEME_FSPATH . "/display_message.tpl");
$msg_tpl->set('message', $message);
$m = $msg_tpl->fetch();
$page->add_module("middle", "top", $m);
}
$page->html_body_attributes = 'class="hold-transition skin-blue sidebar-collapse sidebar-mini"';
$css_array = get_network_css();
if (is_array($css_array)) {
foreach ($css_array as $key => $value) {
示例2: startup
<?php
// ############## Include Files ################ //
require_once 'includes/configuration.php';
require_once 'includes/db_connection.php';
require_once 'includes/functions.php';
require_once 'includes/pageRenderer.php';
// ############## Finish Includes ############### //
startup();
$page = new PageRenderer();
// grab request URI and clean it up to only contain the static url/path segments
$requestUri = urldecode($_SERVER['REQUEST_URI']);
$scriptInfo = pathinfo($_SERVER['SCRIPT_NAME']);
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING'])) {
$requestUri = substr($requestUri, 0, (strlen($_SERVER['QUERY_STRING']) + 1) * -1);
}
// detect if running in a subdirectory and not webroot and fix static segments in that case
if ($scriptInfo['dirname'] != DIRECTORY_SEPARATOR) {
$requestUri = str_replace($scriptInfo['dirname'], '', $requestUri);
}
// remove trailing and ending slashes
if ($requestUri[0] == '/') {
$requestUri = substr($requestUri, 1);
}
if (substr($requestUri, -1) == '/') {
$requestUri = substr($requestUri, 0, -1);
}
// define default action and controller
$controllerAndAction = $configuration['routes']['_default'];
$pathSegments = array();
// check for action requested via URL
示例3: PageRenderer
$obj->album_id = $album_id;
if (isset($_GET['album_id']) && (!empty($_GET['album_id']))) {
$obj->album_id = $_GET['album_id'];
}
}
if (!empty($login_user)) {
$title = User::get_login_name_from_id($uid)." - ";
} else {
$title = "";
}
$title .= "Media Gallery - $network_info->name";
// fetching the data from the Constants.php and Rendering the data of the page
// at present we are setting the value of setting data
$page = new PageRenderer("setup_module", PAGE_MEDIA_GALLERY, $title, "container_one_column_media_gallery.tpl", "header_user.tpl", PUB, NULL, $network_info, null, $setting_data);
/* To avoding javascript select value function alert */
if(!isset($_GET['msg_rep'])) {
if (!empty($msg) || !empty($_GET['msg_id'])) {
$msg_obj = new MessagesHandler();
$msg_id = ($_GET['msg_id']) ? $_GET['msg_id']: $msg;
$dynamic_msg = ($msg_id == 2007)?substr ($type,0,5):NULL;
$msg = $msg_obj->get_message($msg_id,$dynamic_msg);
if ($msg) {
$msg_tpl = & new Template(CURRENT_THEME_FSPATH."/display_message.tpl");
$msg_tpl->set('message', $msg);
$page->add_module("middle", "top", $msg_tpl->fetch());
}
}
}
// Jtip is shown when user watching the image media
示例4: setup_module
$groups->load($_REQUEST['gid']);
$group_type = $groups->group_type;
}
function setup_module($column, $module, $obj)
{
global $login_uid, $paging, $page_uid, $super_groups_available, $user_type, $group_type;
switch ($module) {
case 'AddGroupModule':
if (!empty($_REQUEST['gid'])) {
$obj->id = $_REQUEST['gid'];
}
break;
}
}
$setting_data = ModuleSetting::load_setting(PAGE_ADDGROUP, PA::$login_uid);
$page = new PageRenderer("setup_module", PAGE_ADDGROUP, "{$title} - " . PA::$network_info->name, 'container_three_column.tpl', $header, PRI, HOMEPAGE, PA::$network_info, NULL, $setting_data);
$page->add_header_js('addgroup.js');
if (!empty($_REQUEST['msg'])) {
$message = null;
} else {
if (!empty($_REQUEST['error_msg'])) {
$message = null;
} else {
$message = null;
}
}
uihelper_error_msg($message);
if ($edit) {
uihelper_get_group_style($_REQUEST['gid']);
} else {
uihelper_get_network_style();
示例5: PageRenderer
$obj->uid = $uid;
$obj->media_data = $show_media;
$obj->contentcollection_type = $cc_info->type;
break;
case 'right':
$obj->uid = $uid;
if ($moduleName == 'UserPhotoModule') {
$obj->block_type = 'UserPhotoBlock';
}
if ($moduleName != 'AdsByGoogleModule') {
$obj->block_type = HOMEPAGE;
}
break;
}
}
$page = new PageRenderer("setup_module", PAGE_EDIT_MEDIA, "Edit Media", "container_three_column.tpl", "header.tpl", PUB, HOMEPAGE, $network_info);
if (!empty($error)) {
$msg_tpl =& new Template(CURRENT_THEME_FSPATH . "/display_message.tpl");
$msg_tpl->set('message', $error);
$page->add_module("middle", "top", $msg_tpl->fetch());
}
$css_array = get_network_css();
if (is_array($css_array)) {
foreach ($css_array as $key => $value) {
$page->add_header_css($value);
}
}
$css_data = inline_css_style();
if (!empty($css_data['newcss']['value'])) {
$css_data = '<style type="text/css">' . $css_data['newcss']['value'] . '</style>';
$page->add_header_html($css_data);
示例6: render_debug_sidebar
// --- left sidebar (debugging)
function render_debug_sidebar() {
global $user;
ob_start();
echo "<p>badges: "; var_dump($user->list_widgets()); echo "</p>";
try {
$default_badge = $user->load_widget("default");
echo "<p>default badge: "; var_dump($default_badge); echo "</p>";
} catch (PAException $e) {
echo "<p>no default badge available.</p>";
}
$debug_sidebar = ob_get_contents();
ob_end_clean();
return $debug_sidebar;
}
// ---
$page = new PageRenderer(NULL, PAGE_BADGE_CREATE, sprintf(__("%s - My Widgets - %s"), $login_user->get_name(), PA::$network_info->name), "container_three_column.tpl", 'header_user.tpl');
$page->onload = "badge.update();";
$page->add_header_css(PA::$theme_url . "/badge_create.css");
$page->add_module("left", "top", render_left_sidebar());
//$page->add_module("left", "top", render_debug_sidebar()); // debugging
$page->add_module("middle", "top", $page_html);
$page->add_module("right", "top", render_right_sidebar());
uihelper_set_user_heading($page);
echo $page->render();
?>
示例7: catch
//refreshing the network_info after saving it.
//set $form_data['reciprocated_relationship']if reciprocated relationship is saved
$form_data['reciprocated_relationship'] = $network_basic_controls['reciprocated_relationship'];
$form_data['email_validation'] = $network_basic_controls['email_validation'];
$form_data['top_navigation_bar'] = $network_basic_controls['top_navigation_bar'];
$form_data['network_content_moderation'] = $network_basic_controls['network_content_moderation'];
$error_msg = 'Network Information Successfully Updated';
} catch (PAException $e) {
$error = TRUE;
$error_msg = "{$e->message}";
}
}
}
//...$_POST if ends
//render the page
$page = new PageRenderer("setup_module", PAGE_NETWORK_STATISTICS, sprintf(__("Network Statistics - %s"), $network_info->name), 'container_two_column.tpl', 'header.tpl', PRI, HOMEPAGE, $network_info);
$error_msg = !empty($error_msg) ? $error_msg : @$permission_denied_msg;
uihelper_error_msg($error_msg);
uihelper_get_network_style();
$page->html_body_attributes = 'class="no_second_tier network_config"';
$css_path = $current_theme_path . '/admin2.css';
$page->add_header_css($css_path);
//..end render the page
/* ---------- FUNCTION DEFINITION ------------------*/
//call back function
function setup_module($column, $module, $obj)
{
global $form_data, $error, $error_msg, $configure_permission, $network_info;
if (!$configure_permission) {
return 'skip';
}
示例8: RegistrationPage
}
if (isset($rp->reg_user)) {
$obj->array_of_errors = @$rp->reg_user->array_of_errors;
}
}
break;
case 'right':
$obj->mode = PRI;
if ($moduleName != 'AdsByGoogleModule') {
$obj->block_type = HOMEPAGE;
}
break;
}
}
$rp = new RegistrationPage();
try {
$rp->main();
$msg = !empty($rp->reg_user->msg) ? nl2br($rp->reg_user->msg) : @$rp->inv_error;
} catch (PAException $e) {
$msg = $e->getMessage();
}
$page = new PageRenderer("setup_module", PAGE_REGISTER, "Registration Page", "container_three_column.tpl", "header.tpl", PUB, HOMEPAGE, PA::$network_info);
// added by Zoran Hron: JQuery validation & AJAX file upload --
$page->add_header_html(js_includes('jquery.validate.js'));
$page->add_header_html(js_includes('jquery.metadata.js'));
$page->add_header_html(js_includes('ajaxfileupload.js'));
$page->add_header_html(js_includes('user_registration.js'));
uihelper_error_msg($msg);
uihelper_get_network_style();
$page->html_body_attributes = ' id="registration_page"';
echo $page->render();
示例9: PageRenderer
case 'middle':
$obj->get_user_albums();
$obj->author_id = $_SESSION['user']['id'];
$content_type = 'BlogPost';
require_once "web/includes/blocks/createcontent.php";
if (!empty($cid)) {
$obj->set_id($cid);
}
if (strlen($error) > 0) {
$obj->set_error_msg($error, $data_array);
}
$obj->display = 'blog';
$obj->targets = $targets;
$obj->show_external_blogs = $show_external_blogs;
$obj->is_edit = $is_edit;
$obj->permission_to_post = $permission_to_post;
$obj->parent_collection_id = @$obj_content_type->parent_collection_id;
$obj->ccid = $obj->parent_collection_id ? $obj->parent_collection_id : $ccid;
break;
}
}
$page = new PageRenderer("setup_module", PAGE_POSTCONTENT, "Create content", "container_one_column_postcontent.tpl", "header.tpl", PRI, HOMEPAGE, PA::$network_info);
// load JQuery forms Plugin
$page->add_header_html(js_includes('forms.js'));
// and the modal overlay functions
$page->add_header_html(js_includes('attach_media_modal.js'));
$css_path = PA::$theme_url . '/modal.css';
$page->add_header_css($css_path);
uihelper_error_msg($post_err);
uihelper_get_network_style();
echo $page->render();
示例10: PageRenderer
case 'left':
$obj->mode = PUB;
if ($moduleName == 'RecentCommentsModule') {
$obj->cid = $_REQUEST['cid'];
$obj->block_type = HOMEPAGE;
$obj->mode = PRI;
}
break;
case 'middle':
$obj->mode = PUB;
$obj->orientation = CENTER;
$obj->content_id = $_REQUEST['cid'];
$obj->mode = PUB;
$obj->uid = $_SESSION['user']['id'];
$obj->block_type = 'media_management';
break;
case 'right':
$obj->mode = PRI;
if ($moduleName != 'AdsByGoogleModule') {
$obj->block_type = HOMEPAGE;
}
break;
}
}
$page = new PageRenderer("setup_module", PAGE_MEDIA_MANAGEMENT, "Media Management", "media_gallery_pa.tpl", "header.tpl", PUB, HOMEPAGE, PA::$network_info);
if (!empty($msg1)) {
$msg_tpl = new Template(CURRENT_THEME_FSPATH . "/display_message.tpl");
$msg_tpl->set('message', $msg1);
$page->add_module("middle", "top", $msg_tpl->fetch());
}
echo $page->render();
示例11: empty
if (@$_GET['view'] == 'Conversations') {
$obj->mode = 'view_conversations';
}
$obj->folder_name = $folder_name = empty($_GET['folder']) ? INBOX : $_GET['folder'];
$obj->page = empty($_GET['page']) ? 1 : (int) $_GET['page'];
$obj->Paging = $paging;
if (isset($_GET['q'])) {
$obj->search_string = $_GET['q'];
}
}
}
//check if user is checking out only his content
if ($uid != $login_uid) {
throw new PAException(OPERATION_NOT_PERMITTED, "You cant access other user's messages.");
}
$page = new PageRenderer("setup_module", PAGE_MESSAGE, sprintf(__("%s - Private Messages - %s"), $login_user->get_name(), $network_info->name), "container_one_column.tpl", 'header_user.tpl', PRI, HOMEPAGE, $network_info);
/*$css_path = $current_theme_path.'/layout.css';
$page->add_header_css($css_path);
$css_path = $current_theme_path.'/network_skin.css';
$page->add_header_css($css_path);
$css_path = $current_theme_path.'/edit_skin.css';
$page->add_header_css($css_path);*/
// Currently using the CSS from the live site, due to some problem in merging local and server CSS.
$theme_details = get_user_theme($uid);
if (is_array($theme_details['css_files'])) {
foreach ($theme_details['css_files'] as $key => $value) {
$page->add_header_css($value);
}
}
if (!empty($_GET['msg'])) {
$message = MessagesHandler::get_message($_GET['msg']);
示例12: PageRenderer
FileCache::store($cache_id, $dynamic_page, 1200);
}
// Force login if we're on a private network, unless we're on login.php, register.php or cnuser_login_index.php
$login_required = $page_settings['page_mode'] != 'public' ? true : false;
if (!$login_required && PA::$network_info->is_private() && !$login_never_required) {
$login_required = TRUE;
}
// Check user session / login status, and redirect to login page (or
// request page, for private networks) if required.
if (!check_session($login_required, $page_redirect_function)) {
if ($login_required) {
exit;
}
}
$use_theme = $page_settings['page_theme'];
$page = new PageRenderer('setup_module', $page_settings['page_id'], sprintf(__('%s - %s'), __($page_settings['page_name']), PA::$network_info->name), $page_settings['page_template'], $page_settings['header_template'], $page_settings['page_mode'], $page_settings['block_type'], PA::$network_info, NULL, NULL);
if (isset($page_settings['body_attributes'])) {
$page->html_body_attributes = $page_settings['body_attributes'];
}
if (isset($page_settings['javascripts'])) {
if (is_array($page_settings['javascripts'])) {
foreach ($page_settings['javascripts'] as $js_file) {
$page->add_header_html(js_includes($js_file));
}
} else {
$page->add_header_html(js_includes($page_settings['javascripts']));
}
}
if (isset($page_settings['page_css'])) {
if (is_array($page_settings['page_css'])) {
foreach ($page_settings['page_css'] as $css_file) {
示例13: PageRenderer
if (!empty($user)) {
$obj->page_user = $user->get_name();
}
break;
case 'right':
$obj->mode = PRI;
if ($moduleName != 'AdsByGoogleModule') {
$obj->block_type = HOMEPAGE;
}
if (!empty($_GET['gid'])) {
if ($moduleName == 'RecentPostModule') {
$obj->type = 'group';
$obj->gid = $_GET['gid'];
}
}
break;
}
}
$page = new PageRenderer("setup_module", PAGE_VIEW_ALL_MEMBERS, $page_name, "container_three_column.php", $header_tpl, PUB, HOMEPAGE, PA::$network_info);
$page->add_header_html(js_includes('common.js'));
if ($_GET['gid']) {
uihelper_get_group_style($_GET['gid']);
} else {
if (!empty($_GET['uid'])) {
//applying the user theme
uihelper_set_user_heading($page);
} else {
uihelper_get_network_style();
}
}
echo $page->render();
示例14: js_includes
*
*/
$login_required = TRUE;
//for session protection pages
$use_theme = 'Beta';
include "includes/page.php";
$parameter = '';
$parameter .= js_includes('common.js');
global $query_count_on_page, $page_uid;
$query_count_on_page = 0;
/**
* Function : setup_module()
* Purpose : call back function to set up variables
* used in PageRenderer class
* To see how it is used see api/PageRenderer/PageRenderer.php
* @param $column - string - contains left, middle, right
* position of the block module
* @param $moduleName - string - contains name of the block module
* @param $obj - object - object reference of the block module
* @return type string - returns skip means skip the block module
* returns rendered html code of block module
*/
function setup_module($column, $moduleName, $obj)
{
}
$page = new PageRenderer("setup_module", PAGE_USER_COMMENT, 'Write comment', "container_three_column.tpl", "header.tpl", PUB, HOMEPAGE, $network_info);
uihelper_error_msg($error_message);
$page->add_header_html($parameter);
$page->html_body_attributes = 'class="no_second_tier" id="pg_homepage"';
uihelper_set_user_heading($page);
echo $page->render();
示例15: get_login_user
// for query count
global $query_count_on_page;
$query_count_on_page = 0;
$user = get_login_user();
function setup_module($column, $module, $obj)
{
global $user;
switch ($module) {
case 'EventCalendarModule':
$obj->title = __('Personal Events');
$obj->assoc_type = 'user';
$obj->assoc_id = (int) $_SESSION['user']['id'];
$obj->may_edit = true;
// user may edit own events, right? ;)
$obj->assoc_title = $user->login_name;
break;
}
$obj->mode = PUB;
}
global $msg;
$page = new PageRenderer("setup_module", PAGE_USER_CALENDAR, __("My Events"), "container_one_column.php", "header_user.php", PRI, NULL, PA::$network_info);
$css_path = PA::$theme_url . '/css/calendar.css';
$page->add_header_css($css_path);
$page->add_header_html(js_includes('calendar.js'));
$page->add_header_html(js_includes('date.js'));
$page->add_header_html(js_includes('jquery.dimensions.min.js'));
$page->add_header_html(js_includes('jquery.datePicker.js'));
$page->add_header_html($parameter);
uihelper_error_msg($msg);
uihelper_set_user_heading($page);
echo $page->render();