本文整理汇总了PHP中do_edit函数的典型用法代码示例。如果您正苦于以下问题:PHP do_edit函数的具体用法?PHP do_edit怎么用?PHP do_edit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_edit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_new
function do_new($formatter, $options)
{
global $DBInfo;
if (!$options['value']) {
$title = _("Create a new page");
$formatter->send_header("", $options);
$formatter->send_title($title, "", $options);
$url = $formatter->link_url($formatter->page->urlname);
if ($DBInfo->hasPage('MyNewPage')) {
$p = $DBInfo->getPage('MyNewPage');
$f = new Formatter($p, $options);
$f->use_rating = 0;
$f->send_page('', $options);
}
$msg = _("Page Name");
$fixname = _("Normalize this page name");
$btn = _("Create a new page");
print <<<FORM
<div class='addPage'>
<form method='get' action='{$url}'>
<table style='border:0'><tr><th class='addLabel'><labe>{$msg}: </label></th><td><input type='hidden' name='action' value='new' />
<input name='value' size='30' /></td></tr>
<tr><th class='addLabel'><input type='checkbox' name='fixname' checked='checked' /></th><td>{$fixname}</td></tr>
<td></td><td><input type='submit' value='{$btn}' /></td>
</tr></table>
</form>
</div>
FORM;
$formatter->send_footer();
} else {
$pgname = $options['value'];
if ($options['fixname']) {
$pgname = normalize($pgname);
}
$options['page'] = $pgname;
$page = new WikiPage($pgname);
$f = new Formatter($page, $options);
do_edit($f, $options);
return true;
}
}
示例2: do_create
function do_create()
{
global $create_id;
do_edit($create_id);
}
示例3:
global $current_section;
$current_section = 'campaigns';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('campaigns', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
$_GET['id'] = (int) $_GET['id'];
if (isset($_POST['update'])) {
if (do_edit('adunit', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('edit_ad_unit.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_adunit_detail($_GET['id']);
$editdata['creative_type'] = $editdata['adv_type'];
$editdata['custom_creative_width'] = $editdata['adv_width'];
$editdata['custom_creative_height'] = $editdata['adv_height'];
$editdata['click_url'] = $editdata['adv_click_url'];
$editdata['tracking_pixel'] = $editdata['adv_impression_tracking_url'];
示例4:
global $edited;
$current_section = 'campaigns';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('inventory', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
$_GET['id'] = (int) $_GET['id'];
if (isset($_POST['update'])) {
if (do_edit('campaign', $_POST, $_GET['id'])) {
$edited = 1;
MAD_Admin_Redirect::redirect('edit_campaign.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_campaign_detail($_GET['id']);
$editdata['geo_targeting'] = $editdata['country_target'];
$editdata['device_targeting'] = $editdata['device_target'];
$editdata['channel_targeting'] = $editdata['channel_target'];
$editdata['publication_targeting'] = $editdata['publication_target'];
$main_cap = get_campaign_cap_detail($_GET['id']);
$editdata['total_amount'] = $main_cap['total_amount'];
示例5: array_push
array_push($globals['cache-control'], 'no-cache');
do_header(_("editar noticia"), "post");
echo '<div id="singlewrap">' . "\n";
if (!empty($_REQUEST['id']) && is_numeric($_REQUEST['id'])) {
$link = new Link();
$link->id = $link_id = intval($_REQUEST['id']);
$link->read();
if (!$link->is_editable() || intval($_GET['user'] != $current_user->user_id)) {
echo '<div class="form-error-submit"> ' . _("noticia no modificable") . '</div>' . "\n";
return;
}
if ($_POST['phase'] == "1") {
do_save($link);
fork("backend/send_pingbacks.php?id={$link->id}");
} else {
do_edit($link);
}
} else {
echo '<div class="form-error-submit"> ' . _("¿duh?") . '</div>';
}
echo "</div>" . "\n";
do_footer();
function do_edit($link)
{
global $dblang, $db, $current_user, $globals;
$link->status = $link->sub_status;
$link->discarded = $link->is_discarded();
$link->status_text = $link->get_status_text();
$link->key = md5($globals['now'] . $link->randkey);
$link->chars_left = 550 - mb_strlen(html_entity_decode($link->content, ENT_COMPAT, 'UTF-8'), 'UTF-8');
$link->thumb_url = $link->has_thumb();
示例6:
global $current_section;
$current_section = 'configuration';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('configuration', $user_detail['user_id']) && !check_permission_simple('modify_advertisers', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('user', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('edit_user.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_user_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
示例7:
global $current_section;
global $edited;
$current_section = 'campaigns';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('inventory', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('runninglimit', $_POST, $_GET['id'])) {
$edited = 1;
MAD_Admin_Redirect::redirect('edit_running_limit.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
<div id="contentHeader">
<h1>Edit Running Campaign Limit</h1>
示例8:
global $current_section;
$current_section = 'configuration';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('configuration', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('channel', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('edit_channel.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_channel_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
示例9:
global $current_section;
$current_section = 'configuration';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('configuration', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('group', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('edit_group.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_group_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
示例10:
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('inventory', $user_detail['user_id'])) {
exit;
}
if (!check_permission_simple('modify_publications', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('placement', $_POST, $_GET['id'])) {
$edited = 1;
MAD_Admin_Redirect::redirect('edit_zone.php?edited=1&id=' . $_GET['id'] . '');
} else {
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_zone_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
<div id="contentHeader">
示例11:
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('inventory', $user_detail['user_id'])) {
exit;
}
if (!check_permission_simple('modify_publications', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('publication', $_POST, $_GET['id'])) {
$edited = 1;
MAD_Admin_Redirect::redirect('edit_publication.php?edited=1&id=' . $_GET['id'] . '');
} else {
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_publication_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
<div id="contentHeader">
示例12:
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('inventory', $user_detail['user_id'])) {
exit;
}
if (!check_permission_simple('modify_publications', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('location', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('edit_location.php?edited=1&id=' . $_GET['id']);
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_location_details($_GET['id']);
$editdata['location_name'] = $editdata['adv_location_name'];
$editdata['location_lat'] = $editdata['adv_location_lat'];
$editdata['location_lon'] = $editdata['adv_location_lon'];
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
示例13:
global $current_section;
$current_section = 'configuration';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('configuration', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('creative_server', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('edit_creative_server.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_creativeserver_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">
示例14: redirect
redirect($returnurl);
} else {
if ($blogeditform->no_submit_button_pressed()) {
no_submit_button_actions($blogeditform, $sitecontext);
} else {
if ($fromform = $blogeditform->get_data()) {
//save stuff in db
switch ($action) {
case 'add':
do_add($fromform, $blogeditform);
break;
case 'edit':
if (!$existing) {
error('Incorrect blog post id');
}
do_edit($fromform, $blogeditform);
break;
default:
error('Unknown action!');
}
redirect($returnurl);
}
}
}
// gui setup
switch ($action) {
case 'add':
// prepare new empty form
$post->publishstate = 'site';
$strformheading = get_string('addnewentry', 'blog');
$post->action = $action;
示例15:
global $current_section;
$current_section = 'adnetworks';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
if (!check_permission('adnetworks', $user_detail['user_id'])) {
exit;
}
global $current_action;
$current_action = 'edit';
if (isset($_POST['update'])) {
if (do_edit('network', $_POST, $_GET['id'])) {
global $edited;
$edited = 1;
MAD_Admin_Redirect::redirect('network_settings.php?edited=1&id=' . $_GET['id'] . '');
} else {
global $edited;
$edited = 2;
}
}
if ($edited != 2) {
$editdata = get_network_detail($_GET['id']);
}
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
?>
<div id="content">