* Setup
 */
require_once 'panl.init.php';
$view = new GrlxView();
$modal = new GrlxForm_Modal();
$message = new GrlxAlert();
$link = new GrlxLinkStyle();
$list = new GrlxList();
$var_list = array('marker_type_id', 'new_title');
if ($var_list) {
    foreach ($var_list as $key => $val) {
        ${$val} = register_variable($val);
    }
}
if ($marker_type_id) {
    $marker_type = new GrlxMarkerType($marker_type_id);
} else {
    header('location:marker-type.list.php');
    die;
}
/*****
 * Updates
 */
if ($marker_type_id && $new_title) {
    $success = $marker_type->saveMarkerType($marker_type_id, $new_title);
    $marker_type = new GrlxMarkerType($marker_type_id);
}
if ($success) {
    $link->url('marker-type.list.php');
    $link->tap('Return to the type list');
    $alert_output = $message->success_dialog('Marker type saved. ' . $link->paint() . '.');
<?php

/*****
 * Setup
 */
require_once 'panl.init.php';
$view = new GrlxView();
$modal = new GrlxForm_Modal();
$message = new GrlxAlert();
$link = new GrlxLinkStyle();
$list = new GrlxList();
$marker_type = new GrlxMarkerType();
$var_list = array('next_rank', 'new_title');
if ($var_list) {
    foreach ($var_list as $key => $val) {
        ${$val} = register_variable($val);
    }
}
/*****
 * Updates
 */
if ($_POST && $new_title) {
    $next_rank ? $next_rank : ($next_rank = 1);
    $new_id = $marker_type->createMarkerType($new_title, $next_rank);
    if ($new_id) {
        header('location:marker-type.list.php');
        die;
    } else {
        $alert_output = $message->alert_dialog('I couldn’t create the new marker.');
    }
} elseif ($_POST && !$new_title) {
<?php

/*****
 * Setup
 */
require_once 'panl.init.php';
$view = new GrlxView();
$message = new GrlxAlert();
$link = new GrlxLinkStyle();
$list = new GrlxList();
$form = new GrlxForm();
$marker_type = new GrlxMarkerType();
$var_list = array('marker_type_id', 'new_marker_name', 'delete_id');
if ($var_list) {
    foreach ($var_list as $key => $val) {
        ${$val} = register_variable($val);
    }
}
// Folder in which we keep ad images.
// $image_path = $milieu_list['directory']['value'].'/assets/images';
/*****
 * Updates
 */
if ($_GET && $delete_id) {
    $success = $marker_type->deleteMarkerType($delete_id);
    $marker_type->resetMarkerTypes();
}
if ($success && $delete_id) {
    $alert_output = $message->alert_dialog('Marker type deleted.');
}
/*****