/**
 * creates an td with an image
 *
 * @access  private
 * @param   string  $pic  the image
 * @return  string        the image
 */
 function createLevelOutputTD($pic = "forumleer.gif")
 {
     $td = new HTML("td");
     $td->addAttr("class", "blank");
     $td->addAttr("background", Assets::image_path($pic));
     $img = new HTMLempty("img");
     $img->addAttr("width", "10");
     $img->addAttr("height", "20");
     $img->addAttr("src", Assets::image_path($pic));
     $td->addContent($img);
     return $td->createContent();
 }
Example #2
0
 function stri($string)
 {
     parent::addString($string);
 }
 /**
  *  the current eval-ranges and the options to copy and link ranges
  *
  * @access  private
  * @param   $eval    the eval object
  * @param   $state   the eval's state (EVAL_STATE_NEW, EVAL_STATE_ACTIVE, ...)
  * @param   $style   the background style
  * @return  string   the domain settings (html)
  */
 function createDomainSettings($eval, $state, $style)
 {
     global $user;
     $db = new EvaluationObjectDB();
     $evalDB = new EvaluationDB();
     $evalID = $eval->getObjectID();
     $globalperm = $db->getGlobalPerm();
     // linked ranges
     $rangeIDs = $eval->getRangeIDs();
     // search results
     if (Request::get("search")) {
         $results = $evalDB->search_range(Request::get("search"));
     } else {
         $results = $evalDB->search_range("");
     }
     if ($globalperm == "root") {
         $results["studip"] = array("type" => "system", "name" => _("Systemweite Evaluationen"));
     } elseif ($globalperm == "dozent" || $globalperm == "autor" || $globalperm == "admin") {
         $results[$user->id] = array("type" => "user", "name" => _("Profil"));
     }
     if ($globalperm == "dozent" || $globalperm == "autor" || Request::get("search")) {
         $showsearchresults = 1;
     }
     if ($globalperm == "autor") {
         $range_types = array("user" => _("Benutzer"), "sem" => _("Veranstaltung"));
     } elseif ($globalperm == "dozent") {
         $range_types = array("user" => _("Benutzer"), "sem" => _("Veranstaltung"), "inst" => _("Einrichtung"));
     } elseif ($globalperm == "admin") {
         $range_types = array("user" => _("Benutzer"), "sem" => _("Veranstaltung"), "inst" => _("Einrichtung"), "fak" => _("Fakultät"));
     } elseif ($globalperm == "root") {
         $range_types = array("user" => _("Benutzer"), "sem" => _("Veranstaltung"), "inst" => _("Einrichtung"), "fak" => _("Fakultät"), "system" => _("System"));
     }
     // zugewiesene Bereiche
     $table_r = new HTML("table");
     #   $table_r->addAttr ("class","white");
     $table_r->addAttr("border", "0");
     $table_r->addAttr("align", "center");
     $table_r->addAttr("cellspacing", "0");
     $table_r->addAttr("cellpadding", "0");
     $table_r->addAttr("width", "100%");
     $table_r->addAttr('class', 'default');
     // Überschriften
     $tr_r = new HTML("tr");
     $td_r = new HTML("td");
     $td_r->addAttr("class", "{$style}");
     $td_r->addAttr("style", "vertical-align:bottom;");
     $td_r->addAttr("height", "22");
     $b_r = new HTML("b");
     $b_r->addHTMLContent(" ");
     $b_r->addContent(_("Bereich"));
     $td_r->addContent($b_r);
     $tr_r->addContent($td_r);
     $td_r = new HTML("td");
     $td_r->addAttr("class", "{$style}");
     $td_r->addAttr("height", "22");
     $td_r->addAttr("align", "center");
     $td_r->addAttr("style", "vertical-align:bottom;");
     $b_r = new HTML("b");
     $b_r->addContent(_("aushängen"));
     $td_r->addContent($b_r);
     $tr_r->addContent($td_r);
     $table_r->addContent($tr_r);
     if ($rangeIDs) {
         // die verknüpften bereiche
         foreach ($rangeIDs as $k => $assigned_rangeID) {
             $tr_r = new HTML("tr");
             // title
             $td_r = new HTML("td");
             $td_r->addHTMLContent(" ");
             $td_r->addHTMLContent($db->getRangename($assigned_rangeID, NO));
             #         $td_r->addContent ($db->getRangename($assigned_rangeID));
             $tr_r->addContent($td_r);
             if ($this->perm->have_studip_perm("tutor", $assigned_rangeID) || $assigned_rangeID == $user->id) {
                 // link
                 $td_r = new HTML("td");
                 $td_r->addAttr("align", "center");
                 $input = new HTMLempty("input");
                 $input->addAttr("type", "checkbox");
                 $input->addAttr("name", "remove_range[{$assigned_rangeID}]");
                 $input->addAttr("value", "1");
                 $td_r->addContent($input);
             } else {
                 // no permission
                 $td_r = new HTML("td");
                 $td_r->addAttr("align", "center");
                 $td_r->addContent(_("Sie haben keine Berechtigung die Evaluation aus diesem Bereich auszuhängen."));
             }
             $tr_r->addContent($td_r);
             $table_r->addContent($tr_r);
         }
     } else {
         $td_r = new HTML("td");
         $td_r->addAttr("class", "content_body");
         $td_r->addAttr("width", "40");
         $td_r->addAttr("align", "center");
         $td_r->addAttr("style", "vertical-align:bottom;");
         $td_r->addAttr("colspan", "2");
         $b_r = new HTML("b");
         $b_r->addHTMLContent(" ");
         $b_r->addContent(_("Diese Evaluation wurde keinem Bereich zugeordnet."));
         $td_r->addContent($b_r);
         $tr_r->addContent($td_r);
         $table_r->addContent($tr_r);
     }
     $table = new HTML("table");
     $table->addAttr("border", "0");
     $table->addAttr("align", "center");
     $table->addAttr("cellspacing", "0");
     $table->addAttr("cellpadding", "4");
     $table->addAttr("width", "100%");
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addAttr("colspan", "2");
     $td->addAttr("style", "padding-bottom:0; border-top:1px solid black;");
     $b = new HTML("b");
     $b->addContent(_("Diese Evaluation ist folgenden Bereichen zugeordnet:"));
     $td->addContent($b);
     $td->addContent(EvalCommon::createImage(EVAL_PIC_HELP, "", tooltip(_(" können Sie Ihre Evaluation aus den verknüpften Bereichen entfernen."), TRUE, TRUE)));
     $tr->addContent($td);
     if (!$eval->isTemplate()) {
         $table->addContent($tr);
     }
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addAttr("colspan", "2");
     $td->addContent($table_r);
     $tr->addContent($td);
     if (!$eval->isTemplate()) {
         $table->addContent($tr);
     }
     // display search_results
     if ($results) {
         foreach ($results as $k => $v) {
             while (list($type_key, $type_value) = each($range_types)) {
                 if ($v["type"] == $type_key) {
                     $ranges["{$type_key}"][] = array("id" => $k, "name" => $v["name"]);
                 }
             }
             reset($range_types);
         }
         $table_s = new HTML("table");
         $table_s->addAttr("border", "0");
         $table_s->addAttr("align", "center");
         $table_s->addAttr("cellspacing", "0");
         $table_s->addAttr("cellpadding", "0");
         $table_s->addAttr("width", "100%");
         while (list($type_key, $type_value) = each($range_types)) {
             // Überschriften
             $tr_s = new HTML("tr");
             // Typ
             $td_s = new HTML("td");
             $td_s->addAttr("colspan", "1");
             $td_s->addAttr("class", "{$style}");
             $td_s->addAttr("height", "22");
             $td_s->addAttr("style", "vertical-align:bottom;");
             $b_s = new HTML("b");
             $b_s->addHTMLContent(" ");
             $b_s->addContent($type_value . ":");
             $td_s->addContent($b_s);
             $tr_s->addContent($td_s);
             // link
             $td_s = new HTML("td");
             $td_s->addAttr("class", "{$style}");
             $td_s->addAttr("height", "22");
             $td_s->addAttr("align", "center");
             $td_s->addAttr("style", "vertical-align:bottom;");
             $b_s = new HTML("b");
             $b_s->addContent(_("einhängen"));
             $td_s->addContent($b_s);
             $tr_s->addContent($td_s);
             // kopie
             $td_s = new HTML("td");
             $td_s->addAttr("class", "{$style}");
             $td_s->addAttr("height", "22");
             $td_s->addAttr("align", "center");
             $td_s->addAttr("style", "vertical-align:bottom;");
             $b_s = new HTML("b");
             $b_s->addContent(_("kopieren"));
             $td_s->addContent($b_s);
             $tr_s->addContent($td_s);
             $table_s->addContent($tr_s);
             $counter = 0;
             if ($ranges["{$type_key}"]) {
                 foreach ($ranges["{$type_key}"] as $range) {
                     if ($counter == 0) {
                         $displayclass = "content_body";
                     } elseif ($counter % 2 == 0) {
                         $displayclass = "table_row_even";
                     } else {
                         $displayclass = "table_row_odd";
                     }
                     $tr_s = new HTML("tr");
                     // name
                     $td_s = new HTML("td");
                     $td_s->addHTMLContent(" ");
                     $td_s->addHTMLContent(htmlready($range["name"]));
                     $tr_s->addContent($td_s);
                     // if the rangeID is a username, convert it to the userID
                     $new_rangeID = get_userid($range['id']) ? get_userid($range['id']) : $range['id'];
                     if (!in_array($new_rangeID, $rangeIDs)) {
                         // link
                         $td_s = new HTML("td");
                         $td_s->addAttr("align", "center");
                         $input = new HTMLempty("input");
                         $input->addAttr("type", "checkbox");
                         $input->addAttr("name", "link_range[{$range['id']}]");
                         $input->addAttr("value", "1");
                         $td_s->addContent($input);
                         $tr_s->addContent($td_s);
                     } else {
                         // no link
                         $td_s = new HTML("td");
                         $td_s->addAttr("align", "center");
                         $td_s->addAttr("colspan", "1");
                         $input = new HTMLempty("input");
                         $td_s->addContent(_("Die Evaluation ist bereits diesem Bereich zugeordnet."));
                         $tr_s->addContent($td_s);
                     }
                     // copy
                     $td_s = new HTML("td");
                     $td_s->addAttr("align", "center");
                     $input = new HTMLempty("input");
                     $input->addAttr("type", "checkbox");
                     $input->addAttr("name", "copy_range[{$range['id']}]");
                     $input->addAttr("value", "1");
                     $td_s->addContent($input);
                     $tr_s->addContent($td_s);
                     $table_s->addContent($tr_s);
                     $counter++;
                 }
             } elseif ($globalperm == "root" || $globalperm == "admin") {
                 $tr_s = new HTML("tr");
                 $td_s = new HTML("td");
                 $td_s->addAttr("class", "content_body");
                 $td_s->addAttr("colspan", "4");
                 $td_s->addHTMLContent(" ");
                 $td_s->addContent(_("Es wurden keine Ergebnisse aus diesem Bereich gefunden."));
                 $tr_s->addContent($td_s);
                 $table_s->addContent($tr_s);
             }
             reset($ranges);
         }
     }
     if ($showsearchresults) {
         $tr = new HTML("tr");
         $td = new HTML("td");
         $td->addAttr("colspan", "2");
         //       $td->addContent(new HTMLempty("hr"));
         $b = new HTML("b");
         #       $b->addContent (_("Suchergebnisse:"));
         if (Request::get("search")) {
             $b->addContent(_("Sie können die Evaluation folgenden Bereichen zuordnen (Suchergebnisse):"));
         } else {
             $b->addContent(_("Sie können die Evaluation folgenden Bereichen zuordnen:"));
         }
         $td->addContent($b);
         $td->addContent(EvalCommon::createImage(EVAL_PIC_HELP, "", tooltip(_("Hängen Sie die Evaluation in die gewünschten Bereiche ein (abhängige Kopie mit gemeinsamer Auswertung) oder kopieren Sie sie in Bereiche (unabhängige Kopie mit getrennter Auswertung)."), TRUE, TRUE)));
         $td->addContent($results ? $table_s : _("Die Suche ergab keine Treffer."));
         $tr->addContent($td);
         $table->addContent($tr);
     }
     // the seach-button
     if ($globalperm == "root" || $globalperm == "admin") {
         $tr = new HTML("tr");
         $td = new HTML("td");
         $td->addAttr("colspan", "2");
         $td->addAttr("style", "padding-bottom:0; border-top:1px solid black;");
         $td->addContent(_("Nach Bereichen suchen:"));
         $td->addContent(" ");
         $input = new HTMLempty("input");
         $input->addAttr("type", "text");
         $input->addAttr("name", "search");
         $input->addAttr("style", "vertical-align:middle;");
         $input->addAttr("value", "" . Request::get("search") . "");
         $td->addContent($input);
         $td->addContent(Button::create(_('Suchen'), 'search_range_button', array('title' => _('Bereiche suchen'))));
         $tr->addContent($td);
         $table->addContent($tr);
     }
     return $table->createContent();
 }
Example #4
0
 /**
  * Creates a reportmessage
  * @param  string  $text     The text to show
  * @param  string  $imgURL   The image to show
  * @param  string  $cssClass The css class for the text
  */
 static function createReportMessage($text, $imgURL, $cssClass)
 {
     $table = new HTML("table");
     $table->addAttr("border", "0");
     $table->addAttr("cellpadding", "2");
     $table->addAttr("cellspacing", "0");
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addAttr("align", "center");
     $td->addAttr("width", "50");
     $img = new HTMLempty("img");
     $img->addAttr("src", $imgURL);
     $td->addContent($img);
     $tr->addContent($td);
     $td = new HTML("td");
     $td->addAttr("align", "left");
     $td->addAttr("class", $cssClass);
     $td->addHTMLContent($text);
     $tr->addContent($td);
     $table->addContent($tr);
     return $table;
 }
    $td->addHTMLContent("Evaluationen aus dem Bereich \"" . htmlReady($db->getRangename($rangeID)) . "\":");
    $td->addContent(new HTMLempty("br"));
}
$td->addContent(new HTMLempty("br"));
$tr->addContent($td);
$table->addContent($tr);
/* ----------------------------------------------------------- end: infoline */
/* Show showrange search results ------------------------------------------- */
if ($evalAction == "search_showrange" && Request::get("search")) {
    $tr = new HTML("tr");
    $td = new HTML("td");
    $td->addAttr("class", "blank");
    $td->addAttr("align", "left");
    $td->addContent(new HTMLempty("br"));
    $b = new HTML("b");
    $line = new HTMLempty("hr");
    $line->addAttr("size", "1");
    $line->addAttr("noshade", "noshade");
    #$td->addContent ($line);
    $b->addContent(_("Suchergebnisse:"));
    $td->addContent($b);
    $td->addHTMLContent($lib->createDomainLinks(Request::get("search")));
    $tr->addContent($td);
    $table->addContent($tr);
    $table->addContent($lib->createClosingRow());
    echo $table->createContent();
    return;
}
/* -------------------------------------- end: Show showrange search results */
/* Show not started evaluations -------------------------------------------- */
$evalIDArray = $db->getEvaluationIDs($rangeID, EVAL_STATE_NEW);