Ejemplo n.º 1
0
<?php

require_once 'JavaScript.class.php';
require_once 'HTM.class.php';
// ------
$attributes = array('href' => 'http://localhost', 'onclick' => "window.open(this.href,'_blank'); return false");
$link1 = HTM::a('Localhost New Tab', $attributes);
echo $link1;
echo HTM::br(2);
$array = array('href' => '#', 'onclick' => JavaScript::alert('test'));
$alert_link = HTM::a('Alert Link Text', $array);
/* div HTML */
$attr['id'] = 'div1';
$attr['class'] = 'recaptcha_only_if_incorrect_sol';
$attr['style'] = 'color:red;';
echo "\r\n";
echo HTM::div(HTM::span('Link: ', array('style' => 'font-weight:bold;')) . $alert_link, $attr);
// TODO: input
Ejemplo n.º 2
0
 /**
  * createEvaluationFooter: generate the foot of an evaluation (buttons etc.)
  * @param   the evaluation
  * @returns a table row
  */
 function createEvaluationFooter($eval, $voted, $isPreview)
 {
     global $auth;
     if ($isPreview) {
         $voted = YES;
     }
     $br = new HTMpty("br");
     $tr = new HTM("tr");
     $td = new HTM("td");
     $td->attr("class", "content_body");
     $td->attr("align", "center");
     $td->attr("data-dialog-button", "");
     $td->cont($br);
     /* vote button */
     if (!$voted) {
         $button = Button::createAccept(_('Abschicken'), 'voteButton', array('title' => _('Senden Sie Ihre Antworten hiermit ab.'), 'data-dialog' => ''));
         $td->cont($button);
     }
     /* close button */
     if (!Request::isXHR()) {
         $button = new HTM("p");
         $button->cont(_("Sie können dieses Fenster jetzt schließen."));
         $td->cont($button);
     }
     /* reload button */
     if ($isPreview) {
         $button = LinkButton::create(_('Aktualisieren'), URLHelper::getURL('show_evaluation.php?evalID=' . $eval->getObjectID() . '&isPreview=1'), array('title' => _('Vorschau aktualisieren.')));
         $td->cont($button);
     }
     $td->cont($br);
     $td->cont($br);
     $tr->cont($td);
     return $tr;
 }
Ejemplo n.º 3
0
 /**
  * create a fat-printed sub headline with some space
  */
 function createSubHeadline($text)
 {
     $div = new HTM("div");
     $div->attr("style", "margin-bottom:4px; margin-top:4px;");
     $b = new HTM("b");
     $b->cont($text);
     $div->cont($b);
     return $div;
 }
Ejemplo n.º 4
0
        /* --------------------------------------------------- end: save template */
        $command = "";
        $template_answers = "";
        break;
    case "save2":
        $question->save();
        if ($question->isError()) {
            $report = EvalCommon::createReportMessage(_("Fehler beim Speichern."), EVAL_PIC_ERROR, EVAL_CSS_ERROR);
        }
        $command = "";
        $template_answers = "";
        break;
}
/* Surrounding Table ------------------------------------------------------- */
$br = new HTMpty("br");
$tableA = new HTM("table");
$tableA->attr("border", "0");
$tableA->attr("align", "center");
$tableA->attr("cellspacing", "0");
$tableA->attr("cellpadding", "2");
$tableA->attr("width", "250");
$trA = new HTM("tr");
$tdA = new HTM("td");
$tdA->attr("class", "blank");
$tdA->html($lib->createInfoBox($command));
$trA->cont($tdA);
$tableA->cont($trA);
$trA = new HTM("tr");
$tdA = new HTM("td");
$tdA->cont(EvalCommon::createTitle(_("Antwortenvorlagen"), NULL, 2));
$trA->cont($tdA);
Ejemplo n.º 5
0
$evalID = Request::option('evalID');
$tree = new EvaluationTreeShowUser($evalID);
$eval = $tree->tree->eval;
$evalDB = new EvaluationDB();
$isPreview = Request::option('isPreview') ? YES : NO;
$votedEarlier = $eval->hasVoted($auth->auth["uid"]) && $isPreview == NO;
$votedNow = Request::submitted('voteButton') && $votedEarlier == NO;
if ($eval->isAnonymous()) {
    $userID = StudipObject::createNewID();
} else {
    $userID = $auth->auth["uid"];
}
/* ---------------------------------------------------------- end: variables */
$br = new HTMpty("br");
/* Surrounding Form -------------------------------------------------------- */
$form = new HTM("form");
$form->attr("action", URLHelper::getLink(Request::url()));
$form->attr("method", "post");
$form->html(CSRFProtection::tokenTag());
if (Request::isXHR()) {
    header('X-Title:' . _("Stud.IP Online-Evaluation"));
} else {
    // TODO: This should use Assets::img() but on the other hand it should also use templates
    $titlebar = EvalCommon::createTitle(_("Stud.IP Online-Evaluation"), Icon::create('test', 'info_alt')->asImagePath());
    $form->cont($titlebar);
}
/* Surrounding Table ------------------------------------------------------- */
$table = new HTM("table");
$table->attr("border", "0");
$table->attr("align", "center");
$table->attr("cellspacing", "0");