当前位置: 首页>>代码示例>>PHP>>正文


PHP admin::get_page_details方法代码示例

本文整理汇总了PHP中admin::get_page_details方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::get_page_details方法的具体用法?PHP admin::get_page_details怎么用?PHP admin::get_page_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在admin的用法示例。


在下文中一共展示了admin::get_page_details方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

// Get page id
if (!isset($_GET['page_id']) || !is_numeric($_GET['page_id'])) {
    header("Location: index.php");
    exit(0);
} else {
    $page_id = $_GET['page_id'];
}
require_once LEPTON_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages_modify');
// Get perms
if (!$admin->get_page_permission($page_id, 'admin')) {
    $admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
}
$sectionId = isset($_GET['wysiwyg']) ? htmlspecialchars($admin->get_get('wysiwyg')) : NULL;
// Get page details
$results_array = $admin->get_page_details($page_id);
// Get display name of person who last modified the page
$user = $admin->get_user_details($results_array['modified_by']);
// Convert the unix ts for modified_when to human a readable form
$modified_ts = $results_array['modified_when'] != 0 ? $modified_ts = date(TIME_FORMAT . ', ' . DATE_FORMAT, $results_array['modified_when']) : 'Unknown';
// Include page info script
$template = new Template(THEME_PATH . '/templates');
$template->set_file('page', 'pages_modify.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_var(array('PAGE_ID' => $results_array['page_id'], 'PAGE_TITLE' => $results_array['page_title'], 'MENU_TITLE' => $results_array['menu_title'], 'ADMIN_URL' => ADMIN_URL, 'LEPTON_URL' => LEPTON_URL, 'LEPTON_PATH' => LEPTON_PATH, 'THEME_URL' => THEME_URL));
$template->set_var(array('MODIFIED_BY' => $user['display_name'], 'MODIFIED_BY_USERNAME' => $user['username'], 'MODIFIED_WHEN' => $modified_ts, 'LAST_MODIFIED' => $MESSAGE['PAGES_LAST_MODIFIED']));
$template->set_block('main_block', 'show_modify_block', 'show_modify');
if ($modified_ts == 'Unknown') {
    $template->set_block('show_modify', '');
    $template->set_var('CLASS_DISPLAY_MODIFIED', 'hide');
} else {
开发者ID:pixelhulk,项目名称:LEPTON,代码行数:31,代码来源:modify.php

示例2: strtoupper

// get request method
$requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']);
$aRequestVars = isset(${$requestMethod}) ? ${$requestMethod} : null;
// Get page id (on error page_id == 0))
$page_id = intval(isset(${$requestMethod}['page_id']) ? ${$requestMethod}['page_id'] : (isset($page_id) ? $page_id : 0));
$requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']);
$section_id = intval(isset(${$requestMethod}['section_id']) ? ${$requestMethod}['section_id'] : (isset($section_id) ? $section_id : 0));
$module_dir = basename(dirname($_SERVER["SCRIPT_NAME"]));
// Create js back link
$js_back = ADMIN_URL . '/pages/sections.php?page_id=' . $page_id;
// Get perms
// unset($admin_header);
if (!is_numeric($page_id)) {
    $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
} elseif ($page_id > 0) {
    $page = $admin->get_page_details($page_id, ADMIN_URL . '/pages/index.php');
} else {
    $admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS'], ADMIN_URL);
}
$old_admin_groups = explode(',', str_replace('_', '', $page['admin_groups']));
$old_admin_users = explode(',', str_replace('_', '', $page['admin_users']));
$in_group = false;
foreach ($admin->get_groups_id() as $cur_gid) {
    if (in_array($cur_gid, $old_admin_groups)) {
        $in_group = true;
    }
}
if (!$in_group && !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
    print $admin->get_group_id() . $admin->get_user_id();
    // print_r ($old_admin_groups);
    $admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
开发者ID:WebsiteBaker-modules,项目名称:WB-Portable,代码行数:31,代码来源:admin.php


注:本文中的admin::get_page_details方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。