本文整理汇总了PHP中admin::correct_theme_source方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::correct_theme_source方法的具体用法?PHP admin::correct_theme_source怎么用?PHP admin::correct_theme_source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::correct_theme_source方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fsize
return 'onmouseover="overlib(\'<img src=\\\'' . $name . '\\\' maxwidth=\\\'200\\\' maxheight=\\\'200\\\'>\',VAUTO, WIDTH)" onmouseout="nd()" ';
} else {
return '';
}
}
function fsize($size)
{
if ($size == 0) {
return "0 Bytes";
}
$filesizename = array(" bytes", " kB", " MB", " GB", " TB");
return round($size / pow(1024, $i = floor(log($size, 1024))), 1) . $filesizename[$i];
}
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('media_browse.htt')));
$template->set_file('page', 'media_browse.htt');
$template->set_block('page', 'main_block', 'main');
// Get the current dir
$currentHome = $admin->get_home_folder();
$directory = ($currentHome and !array_key_exists('dir', $_GET)) ? $currentHome : $admin->strip_slashes($admin->get_get('dir'));
if ($directory == '/' or $directory == '\\') {
$directory = '';
}
$dir_backlink = 'browse.php?dir=' . $directory;
// Check to see if it contains ../
if (!check_media_path($directory)) {
// $admin->print_header();
$admin->print_error($MESSAGE['MEDIA']['DIR_DOT_DOT_SLASH']);
}
if (!file_exists(WB_PATH . MEDIA_DIRECTORY . $directory)) {
示例2: dirname
* @version $Id: index.php 5 2015-04-27 08:02:19Z luisehahne $
* @filesource $HeadURL: https://localhost:8443/svn/wb283Sp4/SP4/branches/wb/admin/access/index.php $
* @lastmodified $Date: 2015-04-27 10:02:19 +0200 (Mo, 27. Apr 2015) $
*
*
*/
if (!defined('WB_PATH')) {
require dirname(dirname(__DIR__)) . '/config.php';
}
if (!class_exists('admin', false)) {
require WB_PATH . '/framework/class.admin.php';
}
$admin = new admin('Access', 'access');
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('access.htt')));
// $template->debug = true;
$template->set_file('page', 'access.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_block('main_block', 'users_block', 'user');
$template->set_block('main_block', 'groups_block', 'group');
// Insert values into the template object
$template->set_var(array('ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL, 'WB_URL' => WB_URL));
/**
* Insert permission values into the template object
* Deprecated - as we are using blocks.
*/
$display_none = "style=\"display: none;\"";
if ($admin->get_permission('users') != true) {
$template->set_var('DISPLAY_USERS', $display_none);
}
示例3: srand
* @requirements PHP 5.2.2 and higher
* @version $Id: index.php 1625 2012-02-29 00:50:57Z Luisehahne $
* @filesource $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/branches/2.8.x/wb/admin/login/index.php $
* @lastmodified $Date: 2012-02-29 01:50:57 +0100 (Mi, 29. Feb 2012) $
*
*/
require_once "../../config.php";
require_once WB_PATH . "/framework/class.login.php";
if (defined('SMART_LOGIN') and SMART_LOGIN == 'enabled') {
// Generate username field name
$username_fieldname = 'username_';
$password_fieldname = 'password_';
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double) microtime() * 1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$username_fieldname = $username_fieldname . $tmp;
$password_fieldname = $password_fieldname . $tmp;
$i++;
}
} else {
$username_fieldname = 'username';
$password_fieldname = 'password';
}
$admin = new admin('Start', '', false, false);
$WarnUrl = str_replace(WB_PATH, WB_URL, $admin->correct_theme_source('warning.html'));
// Setup template object, parse vars to it, then parse it
$ThemePath = dirname($admin->correct_theme_source('login.htt'));
$thisApp = new Login(array('MAX_ATTEMPS' => "3", 'WARNING_URL' => $WarnUrl, 'USERNAME_FIELDNAME' => $username_fieldname, 'PASSWORD_FIELDNAME' => $password_fieldname, 'REMEMBER_ME_OPTION' => SMART_LOGIN, 'MIN_USERNAME_LEN' => "2", 'MIN_PASSWORD_LEN' => "3", 'MAX_USERNAME_LEN' => "30", 'MAX_PASSWORD_LEN' => "30", 'LOGIN_URL' => ADMIN_URL . "/login/index.php", 'DEFAULT_URL' => ADMIN_URL . "/start/index.php", 'TEMPLATE_DIR' => $ThemePath, 'TEMPLATE_FILE' => "login.htt", 'FRONTEND' => false, 'FORGOTTEN_DETAILS_APP' => ADMIN_URL . "/login/forgot/index.php", 'USERS_TABLE' => TABLE_PREFIX . "users", 'GROUPS_TABLE' => TABLE_PREFIX . "groups"));
示例4: serialize
$pathsettings['global']['admin_only'] = $admin->get_post('admin_only') != '' ? 'checked' : '';
$pathsettings['global']['show_thumbs'] = $admin->get_post('show_thumbs') != '' ? 'checked' : '';
$fieldSerialized = serialize($pathsettings);
$database->query("UPDATE " . TABLE_PREFIX . "settings SET `value` = '{$fieldSerialized}' WHERE `name`='mediasettings'");
header("Location: browse.php");
}
include 'parameters.php';
if ($_SESSION['GROUP_ID'] != 1 && $pathsettings['global']['admin_only']) {
echo "Sorry, settings not available";
exit;
}
// Read data to display
$caller = "setparameter";
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('setparameter.htt')));
$template->set_file('page', 'setparameter.htt');
$template->set_block('page', 'main_block', 'main');
if ($_SESSION['GROUP_ID'] != 1) {
$template->set_var('DISPLAY_ADMIN', 'hide');
}
$template->set_var(array('TEXT_HEADER' => $TEXT['TEXT_HEADER'], 'SAVE_TEXT' => $TEXT['SAVE'], 'BACK' => $TEXT['BACK']));
$template->set_block('main_block', 'list_block', 'list');
$row_bg_color = '';
$dirs = directory_list(WB_PATH . MEDIA_DIRECTORY);
$dirs[] = WB_PATH . MEDIA_DIRECTORY;
$array_lowercase = array_map('strtolower', $dirs);
array_multisort($array_lowercase, SORT_ASC, SORT_STRING, $dirs);
foreach ($dirs as $name) {
$relative = str_replace(WB_PATH, '', $name);
$safepath = str_replace(array('/', ' '), '_', $relative);
示例5: gmdate
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS'], ADMIN_URL);
}
}
// Workout if the developer wants to show the info banner
if (isset($print_info_banner) && $print_info_banner == true) {
// Get page details already defined
// Get display name of person who last modified the page
$user = $admin->get_user_details($page['modified_by']);
// Convert the unix ts for modified_when to human a readable form
$modified_ts = 'Unknown';
if ($page['modified_when'] != 0) {
$modified_ts = gmdate(TIME_FORMAT . ', ' . DATE_FORMAT, $page['modified_when'] + TIMEZONE);
}
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('pages_modify.htt')));
// $template->debug = true;
$template->set_file('page', 'pages_modify.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_block('main_block', 'section_block', 'section_list');
$template->set_block('section_block', 'block_block', 'block_list');
$template->set_var(array('PAGE_ID' => $page['page_id'], 'PAGE_IDKEY' => $page['page_id'], 'PAGE_TITLE' => $page['page_title'], 'MENU_TITLE' => $page['menu_title'], 'ADMIN_URL' => ADMIN_URL, 'WB_URL' => WB_URL, '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 {
$template->set_var('CLASS_DISPLAY_MODIFIED', '');
$template->parse('show_modify', 'show_modify_block', true);
}
示例6: admin
$admin = new admin('Access', 'users_modify');
$user_id = intval($admin->checkIDKEY('user_id', 0, $_SERVER['REQUEST_METHOD']));
// Check if user id is a valid number and doesnt equal 1
if ($user_id == 0) {
$admin->print_error($MESSAGE['GENERIC_FORGOT_OPTIONS']);
}
if ($user_id < 2) {
// if($admin_header) { $admin->print_header(); }
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']);
}
// Get existing values
$results = $database->query("SELECT * FROM `" . TABLE_PREFIX . "users` WHERE `user_id` = '" . $user_id . "'");
$user = $results->fetchRow();
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('users_form.htt')));
// $template->debug = true;
$template->set_file('page', 'users_form.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_var(array('ACTION_URL' => ADMIN_URL . '/users/save.php', 'SUBMIT_TITLE' => $TEXT['SAVE'], 'USER_ID' => $user['user_id'], 'USERNAME' => $user['username'], 'DISPLAY_NAME' => $user['display_name'], 'EMAIL' => $user['email'], 'ADMIN_URL' => ADMIN_URL, 'WB_URL' => WB_URL, 'THEME_URL' => THEME_URL));
$template->set_var('FTAN', $admin->getFTAN());
if ($user['active'] == 1) {
$template->set_var('ACTIVE_CHECKED', ' checked="checked"');
} else {
$template->set_var('DISABLED_CHECKED', ' checked="checked"');
}
// Add groups to list
$template->set_block('main_block', 'group_list_block', 'group_list');
$results = $database->query("SELECT group_id, name FROM " . TABLE_PREFIX . "groups WHERE group_id != '1' ORDER BY name");
if ($results->numRows() > 0) {
$template->set_var('ID', '');
示例7: header
header("Location: index.php");
exit(0);
} else {
$file = preg_replace('/[^a-z0-9_-]/i', "", $_POST['file']);
// fix secunia 2010-92-2
}
// Check if the template exists
if (!file_exists(WB_PATH . '/templates/' . $file)) {
header("Location: index.php");
exit(0);
}
// Print admin header
$admin = new admin('Addons', 'templates_view');
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('templates_details.htt')));
// $template->debug = true;
$template->set_file('page', 'templates_details.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_var('FTAN', $admin->getFTAN());
// Insert values
$result = $database->query("SELECT * FROM " . TABLE_PREFIX . "addons WHERE type = 'template' AND directory = '{$file}'");
if ($result->numRows() > 0) {
$row = $result->fetchRow();
}
// check if a template description exists for the displayed backend language
$tool_description = false;
if (function_exists('file_get_contents') && file_exists(WB_PATH . '/templates/' . $file . '/languages/' . LANGUAGE . '.php')) {
// read contents of the template language file into string
$data = @file_get_contents(WB_PATH . '/templates/' . $file . '/languages/' . LANGUAGE . '.php');
// use regular expressions to fetch the content of the variable from the string
示例8: Template
$message = $MESSAGE['FORGOT_PASS_EMAIL_NOT_FOUND'];
// and delete the wrong Email
$email = '';
}
} else {
$email = '';
}
if (!isset($message)) {
$message = $MESSAGE['FORGOT_PASS_NO_DATA'];
$message_color = '000000';
} else {
$message_color = 'FF0000';
}
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('login_forgot.htt')));
$template->set_file('page', 'login_forgot.htt');
$template->set_block('page', 'main_block', 'main');
if (defined('FRONTEND')) {
$template->set_var('ACTION_URL', 'forgot.php');
} else {
$template->set_var('ACTION_URL', 'index.php');
}
$template->set_var('EMAIL', $email);
if (isset($display_form)) {
$template->set_var('DISPLAY_FORM', 'display:none;');
}
$template->set_var(array('SECTION_FORGOT' => $MENU['FORGOT'], 'MESSAGE_COLOR' => $message_color, 'MESSAGE' => $message, 'WB_URL' => WB_URL, 'ADMIN_URL' => ADMIN_URL, 'THEME_URL' => THEME_URL, 'LANGUAGE' => strtolower(LANGUAGE), 'TEXT_EMAIL' => $TEXT['EMAIL'], 'TEXT_SEND_DETAILS' => $TEXT['SEND_DETAILS'], 'TEXT_HOME' => $TEXT['HOME'], 'TEXT_NEED_TO_LOGIN' => $TEXT['NEED_TO_LOGIN']));
if (defined('FRONTEND')) {
$template->set_var('LOGIN_URL', WB_URL . '/account/login.php');
} else {
示例9: gmdate
if ($results->numRows() == 0) {
$admin->print_header();
$admin->print_error($MESSAGE['PAGES_NOT_FOUND']);
}
$results_array = $results->fetchRow(MYSQLI_ASSOC);
// 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
if ($results_array['modified_when'] != 0) {
$modified_ts = gmdate(TIME_FORMAT . ', ' . DATE_FORMAT, $results_array['modified_when'] + TIMEZONE);
} else {
$modified_ts = 'Unknown';
}
// Setup template object, parse vars to it, then parse it
// Create new template object
$template = new Template(dirname($admin->correct_theme_source('pages_settings.htt')));
// $template->debug = true;
$template->set_file('page', 'pages_settings.htt');
$template->set_block('page', 'main_block', 'main');
$template->set_var('FTAN', $admin->getFTAN());
$template->set_var(array('PAGE_ID' => $results_array['page_id'], 'PAGE_IDKEY' => $results_array['page_id'], 'PAGE_TITLE' => $results_array['page_title'], 'MENU_TITLE' => $results_array['menu_title'], 'DESCRIPTION' => $results_array['description'], 'KEYWORDS' => $results_array['keywords'], 'MODIFIED_BY' => $user['display_name'], 'MODIFIED_BY_USERNAME' => $user['username'], 'MODIFIED_WHEN' => $modified_ts, 'ADMIN_URL' => ADMIN_URL, 'WB_URL' => WB_URL, 'THEME_URL' => THEME_URL));
// Work-out if we should show the "manage sections" link
$sql = 'SELECT COUNT(*) FROM `' . TABLE_PREFIX . 'sections` WHERE `page_id`=' . $page_id . ' AND `module`="menu_link"';
$sections_available = intval($database->get_one($sql)) != 0;
if ($sections_available) {
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;');
} elseif (MANAGE_SECTIONS == 'enabled') {
$template->set_var('TEXT_MANAGE_SECTIONS', $HEADING['MANAGE_SECTIONS']);
} else {
$template->set_var('DISPLAY_MANAGE_SECTIONS', 'display:none;');
}
示例10: Template
if (file_exists($template_location)) {
require $template_location;
}
// Check if $menu is set
if (!isset($block[1]) || $block[1] == '') {
// Make our own menu list
$block[1] = $TEXT['MAIN'];
}
/*-- load css files with jquery --*/
// include jscalendar-setup
$jscal_use_time = true;
// whether to use a clock, too
require_once WB_PATH . "/include/jscalendar/wb-setup.php";
// Setup template object, parse vars to it, then parse it
// Create new template object
$tpl = new Template(dirname($admin->correct_theme_source('pages_sections.htt')));
// $template->debug = true;
$tpl->set_file('page', 'pages_sections.htt');
$tpl->set_block('page', 'main_block', 'main');
$tpl->set_block('main_block', 'module_block', 'module_list');
$tpl->set_block('main_block', 'section_block', 'section_list');
$tpl->set_block('section_block', 'block_block', 'block_list');
$tpl->set_block('main_block', 'calendar_block', 'calendar_list');
$tpl->set_var('FTAN', $admin->getFTAN());
// set first defaults and messages
$tpl->set_var(array('PAGE_ID' => $results_array['page_id'], 'PAGE_IDKEY' => $results_array['page_id'], 'TEXT_PAGE' => $TEXT['PAGE'], 'PAGE_TITLE' => $results_array['page_title'], 'MENU_TITLE' => $results_array['menu_title'], 'TEXT_CURRENT_PAGE' => $TEXT['CURRENT_PAGE'], 'HEADING_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'], 'HEADING_MODIFY_PAGE' => $HEADING['MODIFY_PAGE'], 'TEXT_CHANGE_SETTINGS' => $TEXT['CHANGE_SETTINGS'], 'TEXT_ADD_SECTION' => $TEXT['ADD_SECTION'], 'TEXT_ID' => 'ID', 'TEXT_TYPE' => $TEXT['TYPE'], 'TEXT_BLOCK' => $TEXT['BLOCK'], 'TEXT_NAMESECTION' => $TEXT['SECTION'] . ' ' . $TEXT['NAME'], 'TEXT_PUBL_START_DATE' => $TEXT['PUBL_START_DATE'], 'TEXT_PUBL_END_DATE' => $TEXT['PUBL_END_DATE'], 'TEXT_ACTIONS' => $TEXT['ACTIONS'], 'ADMIN_URL' => ADMIN_URL, 'WB_URL' => WB_URL, 'THEME_URL' => THEME_URL));
// Insert variables
$tpl->set_var(array('PAGE_ID' => $results_array['page_id'], 'PAGE_IDKEY' => $results_array['page_id'], 'VAR_PAGE_TITLE' => $results_array['page_title'], 'SETTINGS_LINK' => ADMIN_URL . '/pages/settings.php?page_id=' . $results_array['page_id'], 'MODIFY_LINK' => ADMIN_URL . '/pages/modify.php?page_id=' . $results_array['page_id']));
$sql = 'SELECT * ';
$sql .= 'FROM `' . TABLE_PREFIX . 'sections` ';
$sql .= 'WHERE `page_id` = ' . $page_id . ' ';