Exemplo n.º 1
0
require_once '../../classes/helputils.class.php';
require_once '../../classes/userutils.class.php';
$pageid = check_var('id', 'REQUEST', true, false, true);
$help_system = new OnlineHelp($userObject, $configObject, $string, $notice, 'staff', $language, $mysqli);
header('Content-Type: text/html; charset=utf8');
$page_details = $help_system->get_page_details($pageid);
if ($page_details === false) {
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '/artwork/page_not_found.png', '#C00000', true, true);
}
if (isset($_POST['save_changes'])) {
    // Update help file record
    $tmp_body = $_POST['edit1'];
    $tmp_title = $_POST['page_title'];
    $tmp_roles = $_POST['page_roles'];
    $help_system->save_page($tmp_title, $tmp_body, $tmp_roles, $pageid, $_POST['edit_id']);
    $mysqli->close();
    header("location: index.php?id={$pageid}");
    exit;
} elseif (isset($_POST['cancel'])) {
    // Release authoring lock.
    if ($_POST['checkout_authorID'] == $userObject->get_user_ID()) {
        $help_system->release_edit_lock($_POST['edit_id']);
    }
    $mysqli->close();
    header("location: index.php?id={$pageid}");
    exit;
} else {
    ?>
<!DOCTYPE html>
<html>