Ejemplo n.º 1
0
$toolName = $langNotes;

ModalBoxHelper::loadModalBox();
load_js('tools.js');
load_js('references.js');
$head_content .= '<script type="text/javascript">var langEmptyGroupName = "' .
        $langEmptyNoteTitle . '";</script>';

$noteNumber = Notes::count_user_notes();

$displayForm = true;
/* up and down commands */
if (isset($_GET['down'])) {
    $thisNoteId = intval(getDirectReference($_GET['down']));
    Notes::movedown_note($thisNoteId);
    redirect_to_home_page('main/notes/index.php');  
}
if (isset($_GET['up'])) {
    $thisNoteId = intval(getDirectReference($_GET['up']));
    Notes::moveup_note($thisNoteId);
    redirect_to_home_page('main/notes/index.php');  
}

/* submit form: new or updated note */
if (isset($_POST['submitNote'])) {
    $v = new Valitron\Validator($_POST);
    $v->rule('required', array('newTitle'));
    $v->labels(array(
        'newTitle' => "$langTheField $langTitle"
    ));