Ejemplo n.º 1
0
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;
    }
}
Ejemplo n.º 2
0
function do_create()
{
    global $create_id;
    do_edit($create_id);
}
Ejemplo n.º 3
0
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'];
Ejemplo n.º 4
0
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'];
Ejemplo n.º 5
0
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">&nbsp;&nbsp;' . _("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">&nbsp;&nbsp;' . _("¿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();
Ejemplo n.º 6
0
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">		
Ejemplo n.º 7
0
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>
Ejemplo n.º 8
0
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">		
Ejemplo n.º 9
0
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">		
Ejemplo n.º 10
0
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">
Ejemplo n.º 11
0
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">
Ejemplo n.º 12
0
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';
Ejemplo n.º 13
0
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">
Ejemplo n.º 14
0
    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;
Ejemplo n.º 15
0
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">		
Ejemplo n.º 16
0

echo '<div id="genericform-contents">'."\n";

if (!empty($_REQUEST['id']) && is_numeric($_REQUEST['id'])) { 
	$linkres=new Link;
	$linkres->id=$link_id = intval($_REQUEST['id']);
	$linkres->read();
	if (!$linkres->is_editable() || intval($_GET['user'] != $current_user->user_id)) {
		echo '<div class="form-error-submit">&nbsp;&nbsp;'._("noticia no modificable").'</div>'."\n";
		return;
	} 
	if ($_POST['phase'] == "1") 
		do_save();
	else 
		do_edit();
} else {
	echo '<div class="form-error-submit">&nbsp;&nbsp;'._("¿duh?").'</div>';
}



echo "</div>";

do_footer();

function do_edit() {
	global $linkres, $dblang, $db, $current_user;

	$link_title = trim($linkres->title);
	$link_content = trim($linkres->content);
    redirect($returnurl);
} else {
    if ($exteditform->no_submit_button_pressed()) {
        die("nosubmitbutton");
        //no_submit_button_actions($exteditform, $sitecontext);
    } else {
        if ($fromform = $exteditform->get_data()) {
            switch ($action) {
                case 'add':
                    do_add($fromform, $exteditform, $returnurl, $courseid, $checked_file);
                    break;
                case 'edit':
                    if (!$existing) {
                        print_error("wrongfileid", "block_exabis_eportfolio");
                    }
                    do_edit($fromform, $exteditform, $returnurl, $courseid);
                    break;
                default:
                    print_error("unknownaction", "block_exabis_eportfolio");
            }
            redirect($returnurl);
        }
    }
}
$strAction = "";
// gui setup
switch ($action) {
    case 'add':
        $post->action = $action;
        $post->courseid = $courseid;
        $post->assignmentid = $assignmentid;