本文整理汇总了PHP中admin::print_success方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::print_success方法的具体用法?PHP admin::print_success怎么用?PHP admin::print_success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::print_success方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
{
// Get objects and vars from outside this function
global $admin, $template, $database, $TEXT, $MESSAGE;
// Get page list from database
// $database = new database();
$sql = 'SELECT `page_id` FROM `' . TABLE_PREFIX . 'pages` ' . 'WHERE `parent`=' . (int) $parent;
// Insert values into main page list
if ($get_pages = $database->query($sql)) {
// Insert values into main page list
while ($page = $get_pages->fetchRow(MYSQLI_ASSOC)) {
// Fix page trail
$sql = 'UPDATE `' . TABLE_PREFIX . 'pages` ' . 'SET `page_trail`=\'' . get_page_trail($page['page_id']) . '\' ' . ($root_parent != 0 ? '`root_parent`=' . (int) $root_parent . ', ' : '') . 'WHERE `page_id`=' . (int) $page['page_id'];
$database->query($sql);
// Run this query on subs
fix_page_trail($page['page_id'], $root_parent);
}
}
}
// Fix sub-pages page trail
fix_page_trail($page_id, $root_parent);
/* END page "access file" code */
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error(), $target_url);
} elseif ($bBackLink) {
$admin->print_success($MESSAGE['PAGES_SAVED_SETTINGS'], $pagetree_url);
} else {
$admin->print_success($MESSAGE['PAGES_SAVED_SETTINGS'], $target_url);
}
// Print admin footer
$admin->print_footer();
示例2:
if (!$database->query($sql)) {
$admin->print_error($database->get_error, $js_back);
break;
}
}
}
}
// Query current search settings in the db, then loop through them and update the db with the new value
$sql = 'SELECT `name`, `value` FROM `' . TABLE_PREFIX . 'search` ' . 'WHERE `extra`=\'\'';
if (!($res_search = $database->query($sql))) {
$admin->print_error($database->is_error(), $js_back);
}
while ($search_setting = $res_search->fetchRow()) {
$old_value = $search_setting['value'];
$setting_name = $search_setting['name'];
$post_name = 'search_' . $search_setting['name'];
// hold old value if post is empty
// check search template
$value = $admin->get_post($post_name) == '' && $setting_name != 'template' ? $old_value : $admin->get_post($post_name);
if (isset($value)) {
$value = $database->escapeString($value);
$sql = 'UPDATE `' . TABLE_PREFIX . 'search` ' . 'SET `value`=\'' . $value . '\' ' . 'WHERE `name`=\'' . $setting_name . '\' AND `extra`=\'\'';
if (!$database->query($sql)) {
$admin->print_error(TABLE_PREFIX . 'search :: ' . $MESSAGE['GENERIC_NOT_UPGRADED'] . '<br />' . $database->get_error, $js_back);
break;
}
// $sql_info = mysql_info($database->db_handle); //->> nicht mehr erforderlich
}
}
$admin->print_success($MESSAGE['SETTINGS_SAVED'], $js_back);
$admin->print_footer();
示例3: header
$common_field = 'page_id';
$table = TABLE_PREFIX . 'sections';
} else {
$id = $_GET['page_id'];
$id_field = 'page_id';
$common_field = 'parent';
$table = TABLE_PREFIX . 'pages';
}
} else {
header("Location: index.php");
exit(0);
}
// Create new admin object and print admin header
$admin = new admin('Pages', 'pages_settings');
// Create new order object an reorder
$order = new order($table, 'position', $id_field, $common_field);
if ($id_field == 'page_id') {
if ($order->move_up($id)) {
$admin->print_success($MESSAGE['PAGES_REORDERED']);
} else {
$admin->print_error($MESSAGE['PAGES_CANNOT_REORDER']);
}
} else {
if ($order->move_up($id)) {
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
} else {
$admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/sections.php?page_id=' . $page_id);
}
}
// Print admin footer
$admin->print_footer();
示例4: foreach
if ($list == 0) {
// error while trying to extract the archive (most likely wrong format)
$admin->print_error('UNABLE TO UNZIP FILE' . $archive->errorInfo(true));
}
$sum_files = 0;
// rename executable files!
foreach ($list as $key => $val) {
if ($val['folder'] && change_mode($val['filename'])) {
$sum_dirs++;
} elseif (is_writable($val['filename']) && $val['status'] == 'ok' && change_mode($val['filename'])) {
$sum_files++;
}
}
if (isset($_POST['delzip'])) {
unlink($filename1);
}
$dir = dirname($filename1);
if (file_exists($dir)) {
$array = createFolderProtectFile($dir);
}
}
unset($list);
if ($sum_files == 1) {
$admin->print_success($sum_files . ' ' . $MESSAGE['MEDIA_SINGLE_UPLOADED']);
} elseif ($sum_files > 1) {
$admin->print_success($sum_files . ' ' . $MESSAGE['MEDIA_UPLOADED']);
} else {
$admin->print_error($MESSAGE['MEDIA_NO_FILE_UPLOADED']);
}
// Print admin
$admin->print_footer();
示例5: header
<?php
/*
* @version 0.1
* @author Ruud Eisinga (Ruud)
* @date 2009-04-10
*/
require '../../config.php';
// Get id
if (!isset($_GET['group_id']) or !is_numeric($_GET['group_id'])) {
header("Location: " . ADMIN_URL . "/pages/index.php");
} else {
$group_id = $_GET['group_id'];
}
// Include WB admin wrapper script
require_once WB_PATH . '/framework/class.admin.php';
require_once WB_PATH . '/framework/functions.php';
$admintool_link = ADMIN_URL . '/admintools/index.php';
$module_edit_link = ADMIN_URL . '/admintools/tool.php?tool=capslider';
$admin = new admin('admintools', 'admintools');
$gtable = TABLE_PREFIX . 'mod_capslider_groups';
$database->query("DELETE FROM " . $gtable . " WHERE group_id = '{$group_id}' LIMIT 1");
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error(), $module_edit_link);
} else {
$admin->print_success($TEXT['SUCCESS'], $module_edit_link);
}
// Print admin footer
$admin->print_footer();
示例6: admin
<?php
/*
* @version 0.1.0
* @author Ruud Eisinga (Ruud)
* @date 2009-04-10
*/
require '../../config.php';
require_once WB_PATH . '/framework/class.admin.php';
require_once WB_PATH . '/framework/functions.php';
$admin = new admin('admintools', 'admintools', false, false);
if ($admin->get_permission('admintools') == true) {
$admintool_link = ADMIN_URL . '/admintools/index.php';
$module_edit_link = ADMIN_URL . '/admintools/tool.php?tool=capslider';
$admin = new admin('admintools', 'admintools');
$gtable = TABLE_PREFIX . 'mod_capslider_groups';
$database->query("INSERT INTO " . $gtable . " (group_name) VALUES ('' )");
// Get the id
$group_id = $database->get_one("SELECT LAST_INSERT_ID()");
// Say that a new record has been added, then redirect to modify page
if ($database->is_error()) {
$admin->print_error($database->get_error(), $module_edit_link);
} else {
$admin->print_success($TEXT['SUCCESS'], WB_URL . '/modules/capslider/modify_group.php?group_id=' . $group_id);
}
// Print admin footer
$admin->print_footer();
} else {
die(header('Location: ../../index.php'));
}
示例7: admin
*
*/
require '../../config.php';
require_once WB_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages');
// Include the WB functions file
require_once WB_PATH . '/framework/functions.php';
// Get page list from database
// $database = new database();
$query = "SELECT * FROM " . TABLE_PREFIX . "pages WHERE visibility = 'deleted' ORDER BY level DESC";
$get_pages = $database->query($query);
// Insert values into main page list
if ($get_pages->numRows() > 0) {
while ($page = $get_pages->fetchRow()) {
// Delete page subs
$sub_pages = get_subs($page['page_id'], array());
foreach ($sub_pages as $sub_page_id) {
delete_page($sub_page_id);
}
// Delete page
delete_page($page['page_id']);
}
}
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error());
} else {
$admin->print_success($TEXT['TRASH_EMPTIED']);
}
// Print admin
$admin->print_footer();
示例8: admin
/*
* @version 0.1.0
* @author Ruud Eisinga (Ruud)
* @date 2009-04-10
*/
require '../../config.php';
require_once WB_PATH . '/framework/class.admin.php';
require_once WB_PATH . '/framework/functions.php';
$admin = new admin('admintools', 'admintools', false, false);
if ($admin->get_permission('admintools') == true) {
$admintool_link = ADMIN_URL . '/admintools/index.php';
$module_edit_link = ADMIN_URL . '/admintools/tool.php?tool=capslider';
$admin = new admin('admintools', 'admintools');
$modified_when = time();
$modified_by = $admin->get_user_id();
$btable = TABLE_PREFIX . 'mod_capslider_slide';
$database->query("INSERT INTO " . $btable . " (active,modified_when,modified_by) VALUES ('1','{$modified_when}','{$modified_by}' )");
// Get the id
$slide_id = $database->get_one("SELECT LAST_INSERT_ID()");
// Say that a new record has been added, then redirect to modify page
if ($database->is_error()) {
$admin->print_error($database->get_error(), $module_edit_link);
} else {
$admin->print_success($TEXT['SUCCESS'], WB_URL . '/modules/capslider/modify_slide.php?slide_id=' . $slide_id);
}
// Print admin footer
$admin->print_footer();
} else {
die(header('Location: ../../index.php'));
}
示例9: trim
$name = trim(media_filename($name), '.');
// Target location
$requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']);
$target = isset(${$requestMethod}['target']) ? ${$requestMethod}['target'] : '';
if (!$admin->checkFTAN()) {
$admin->print_header();
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
}
// After check print the header
$admin->print_header();
if (!check_media_path($target, false)) {
$admin->print_error($MESSAGE['MEDIA_TARGET_DOT_DOT_SLASH']);
}
// Create relative path of the new dir name
$directory = WB_PATH . $target . '/' . $name;
// Check to see if the folder already exists
if (file_exists($directory)) {
$admin->print_error($MESSAGE['MEDIA_DIR_EXISTS']);
}
//if ( sizeof(createFolderProtectFile( $directory )) )
if (!make_dir($directory)) {
$admin->print_error($MESSAGE['MEDIA_DIR_NOT_MADE']);
} else {
createFolderProtectFile($directory);
$usedFiles = array();
// feature freeze
// require_once(ADMIN_PATH.'/media/dse.php');
$admin->print_success($MESSAGE['MEDIA_DIR_MADE']);
}
// Print admin
$admin->print_footer();
示例10: unlink
// Make sure the template dir exists, and chmod if needed
if (!file_exists($template_dir)) {
make_dir($template_dir);
} else {
change_mode($template_dir);
}
if (!function_exists("rename_recursive_dirs")) {
require_once LEPTON_PATH . "/framework/functions/function.rename_recursive_dirs.php";
}
rename_recursive_dirs($temp_unzip, $template_dir);
// Delete the temp zip file
if (file_exists($temp_file)) {
unlink($temp_file);
}
// Chmod all the uploaded files
$dir = dir($template_dir);
while (false !== ($entry = $dir->read())) {
// Skip pointers
if (substr($entry, 0, 1) != '.' and $entry != '.svn' and !is_dir($template_dir . '/' . $entry)) {
// Chmod file
change_mode($template_dir . '/' . $entry);
}
}
// is done by function rename_recursive_dirs
//rm_full_dir(LEPTON_PATH.'/temp/unzip/');
// Load template info into DB
load_template($template_dir);
// Print success message
$admin->print_success($success_message);
// Print admin footer
$admin->print_footer();
示例11:
$group_id = $b[1];
if ($count == 1) {
$new_group = $group_id;
} else {
$new_group = $new_group . ',' . $group_id;
}
}
}
if ($count == 0) {
$err_page_id = $index_page[$p];
//$pagetree_url = ADMIN_URL.'/pages/index.php';
$target_url = ADMIN_URL . '/admintools/tool.php?tool=page_permission';
//$admin->print_error($MESSAGE['PAGES']['SAVED_SETTINGS'], $target_url );
$admin->print_error($MOD_PAGE_PERMISSION['TXT_ERROR'] . $err_page_id . $MOD_PAGE_PERMISSION['TXT_ERROR_HINT'], $target_url);
} else {
//Zurueckschreiben
echo 'UPDATE `' . TABLE_PREFIX . 'pages` SET `admin_groups` = "' . $new_group . '" WHERE `page_id` = ' . $page_id . '<br />';
$sql = 'UPDATE `' . TABLE_PREFIX . 'pages` SET `admin_groups` = "' . $new_group . '" WHERE `page_id` = ' . $page_id;
$database->query($sql);
}
}
$pagetree_url = ADMIN_URL . '/pages/index.php';
$target_url = ADMIN_URL . '/admintools/tool.php?tool=page_permission';
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error(), $target_url);
} else {
$admin->print_success($MESSAGE['PAGES']['SAVED_SETTINGS'], $target_url);
}
// Print admin footer
$admin->print_footer();
示例12: header
break;
default:
$error['no_sort'] = 1;
break;
}
}
if ($error != null) {
header("Location: ../../index.php");
exit;
}
// Create new admin object and print admin header
require_once WB_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages_settings');
$sql = "SELECT file_name, position, id FROM `" . TABLE_PREFIX . "mod_foldergallery_files` WHERE parent_id =" . $cat_id . " ORDER BY file_name " . $sort;
$query = $database->query($sql);
if ($query->numRows()) {
$sql = "UPDATE `" . TABLE_PREFIX . "mod_foldergallery_files` SET position= CASE ";
$position = 1;
while ($result = $query->fetchRow()) {
$sql = $sql . "WHEN id=" . $result['id'] . " THEN '" . $position . "' ";
$position++;
}
$sql = $sql . " ELSE position END;";
}
if ($database->query($sql)) {
$admin->print_success($MESSAGE['PAGES']['REORDERED'], WB_URL . '/modules/foldergallery/admin/modify_cat_sort.php?page_id=' . $page_id . '§ion_id=' . $section_id . '&cat_id=' . $cat_id);
} else {
$admin->print_error($TEXT['ERROR'], WB_URL . '/modules/foldergallery/admin/modify_cat_sort.php?page_id=' . $page_id . '§ion_id=' . $section_id . '&cat_id=' . $cat_id);
}
// Print admin footer
$admin->print_footer();
示例13: array
}
}
}
}
// Update the page visibility to 'deleted'
$sql = 'UPDATE `' . TABLE_PREFIX . 'pages` SET ' . '`visibility` = \'deleted\' ' . 'WHERE `page_id` = ' . $page_id . ' ' . '';
$database->query($sql);
if ($database->is_error()) {
$admin->print_error($database->get_error());
}
//
// Run trash subs for this page
trash_subs($page_id);
} else {
// Really dump the page
// Delete page subs
$sub_pages = get_subs($page_id, array());
foreach ($sub_pages as $sub_page_id) {
delete_page($sub_page_id);
}
// Delete page
delete_page($page_id);
}
// Check if there is a db error, otherwise say successful
if ($database->is_error()) {
$admin->print_error($database->get_error());
} else {
$admin->print_success($MESSAGE['PAGES_DELETED']);
}
// Print admin footer
$admin->print_footer();
示例14: header
$id = $_GET['id'];
$id_field = 'id';
$common_field = 'parent_id';
$table = TABLE_PREFIX . 'mod_foldergallery_categories';
}
} else {
header("Location: index.php");
exit(0);
}
// Create new admin object and print admin header
require_once WB_PATH . '/framework/class.admin.php';
$admin = new admin('Pages', 'pages_settings');
// Include the ordering class
require WB_PATH . '/framework/class.order.php';
// Create new order object an reorder
$order = new order($table, 'position', $id_field, $common_field);
if ($id_field == 'id') {
if ($order->move_up($id)) {
$admin->print_success($MESSAGE['PAGES']['REORDERED'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
} else {
$admin->print_error($MESSAGE['PAGES']['CANNOT_REORDER'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
}
} else {
if ($order->move_up($id)) {
$admin->print_success($TEXT['SUCCESS'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
} else {
$admin->print_error($TEXT['ERROR'], ADMIN_URL . '/pages/modify.php?page_id=' . $page_id);
}
}
// Print admin footer
$admin->print_footer();
示例15: admin
require_once LEPTON_PATH . '/framework/summary.functions.php';
// load WB language file
require_once LEPTON_PATH . '/languages/' . LANGUAGE . '.php';
// create Admin object with admin header
$admin = new admin('Addons', '', true, false);
$js_back = ADMIN_URL . '/modules/index.php?advanced';
/**
* Manually execute the specified module file (install.php, upgrade.php or uninstall.php)
*/
// check if specified module folder exists
$mod_path = LEPTON_PATH . '/modules/' . basename(LEPTON_PATH . '/' . $_POST['file']);
// let the old variablename if module use it
$module_dir = $mod_path;
if (!file_exists($mod_path . '/' . $_POST['action'] . '.php')) {
$admin->print_error($TEXT['NOT_FOUND'] . ': <tt>"' . htmlentities(basename($mod_path)) . '/' . $_POST['action'] . '.php"</tt> ', $js_back);
}
// include modules install.php script
require $mod_path . '/' . $_POST['action'] . '.php';
// load module info into database and output status message
require $mod_path . "/info.php";
load_module($mod_path, false);
$msg = $TEXT['EXECUTE'] . ': <tt>"' . htmlentities(basename($mod_path)) . '/' . $_POST['action'] . '.php"</tt>';
switch ($_POST['action']) {
case 'install':
case 'upgrade':
case 'uninstall':
$admin->print_success($msg, $js_back);
break;
default:
$admin->print_error($TEXT["ACTION_NOT_SUPPORTED"], $js_back);
}