public static function format($text)
 {
     StudipFormat::addStudipMarkup("blubberhashtag", "(^|\\s)#([\\w\\d_\\.\\-]*[\\w\\d])", "", "ForumPosting::markupHashtags");
     $output = formatReady($text);
     StudipFormat::removeStudipMarkup("blubberhashtag");
     return $output;
 }
Exemplo n.º 2
0
 /**
  * Special format-function that adds hashtags to the common formatReady-markup.
  * @param string $text : original text with studip-markup plus hashtags
  * @return string : formatted text
  */
 public static function format($text)
 {
     StudipFormat::addStudipMarkup("blubberhashtag", BlubberPosting::$hashtags_regexp, null, "BlubberPosting::markupHashtags");
     $output = formatReady($text);
     StudipFormat::removeStudipMarkup("blubberhashtag");
     return $output;
 }
Exemplo n.º 3
0
 /**
  * sends tour object as json data
  *
  * @param  string $tour_id    id of tour object
  * @param  String $step_nr    number of step to start with
  */
 function get_data_action($tour_id, $step_nr = 1)
 {
     $this->route = get_route(Request::get('route'));
     $this->tour = new HelpTour($tour_id);
     if (!$this->tour->isVisible() or !$this->route) {
         return $this->render_nothing();
     }
     $this->user_visit = new HelpTourUser(array($tour_id, $GLOBALS['user']->user_id));
     if ($this->user_visit->step_nr > 1 and !$_SESSION['active_tour']['step_nr'] and $this->tour->type == 'tour') {
         $data['last_run'] = sprintf(_('Wollen Sie die Tour "%s" an der letzten Position fortsetzen?'), $this->tour->name);
         $data['last_run_step'] = $this->user_visit->step_nr;
         $data['last_run_href'] = URLHelper::getURL($this->tour->steps[$this->user_visit->step_nr - 1]->route, NULL, true);
     } else {
         $_SESSION['active_tour'] = array('tour_id' => $tour_id, 'step_nr' => $step_nr, 'last_route' => $this->tour->steps[$step_nr - 1]->route, 'previous_route' => '', 'next_route' => '');
         $this->user_visit->step_nr = $step_nr;
         $this->user_visit->store();
     }
     $first_step = $step_nr;
     while ($first_step > 1 and $this->route == $this->tour->steps[$first_step - 2]->route) {
         $first_step--;
     }
     if ($first_step > 1 and $this->tour->type == 'tour') {
         $data['back_link'] = URLHelper::getURL($this->tour->steps[$first_step - 2]->route, NULL, true);
         $_SESSION['active_tour']['previous_route'] = $this->tour->steps[$first_step - 2]->route;
     }
     $data['route_step_nr'] = $first_step;
     $next_first_step = $first_step;
     while ($this->route == $this->tour->steps[$next_first_step - 1]->route) {
         $data['data'][] = array('step_nr' => $this->tour->steps[$next_first_step - 1]->step, 'element' => $this->tour->steps[$next_first_step - 1]->css_selector, 'title' => htmlReady($this->tour->steps[$next_first_step - 1]->title), 'tip' => formatReady($this->tour->steps[$next_first_step - 1]->tip), 'route' => $this->tour->steps[$next_first_step - 1]->route, 'action_next' => $this->tour->steps[$next_first_step - 1]->action_next, 'action_prev' => $this->tour->steps[$next_first_step - 1]->action_prev, 'interactive' => $this->tour->steps[$next_first_step - 1]->interactive ? '1' : '', 'orientation' => $this->tour->steps[$next_first_step - 1]->orientation);
         $next_first_step++;
     }
     if ($this->tour->steps[$step_nr - 1]->route != $this->route) {
         $data['redirect'] = URLHelper::getURL($this->tour->steps[$step_nr - 1]->route, NULL, true);
     } elseif (!count($data['data'])) {
         return $this->render_nothing();
     }
     if ($next_first_step <= count($this->tour->steps)) {
         if ($this->tour->type == 'tour') {
             $data['proceed_link'] = URLHelper::getURL($this->tour->steps[$next_first_step - 1]->route, NULL, true);
         }
         $_SESSION['active_tour']['next_route'] = $this->tour->steps[$next_first_step - 1]->route;
     }
     $data['edit_mode'] = $this->help_admin;
     $data['step_count'] = count($this->tour->steps);
     $data['controls_position'] = 'BR';
     $data['tour_type'] = $this->tour->type;
     $data['tour_title'] = htmlReady($this->tour->name);
     $template = $GLOBALS['template_factory']->open('tour/tour.php');
     $template->set_layout(null);
     $data['tour_html'] = $template->render();
     $this->set_content_type('application/json; charset=UTF-8');
     return $this->render_text(json_encode(studip_utf8encode($data)));
 }
Exemplo n.º 4
0
 /**
  * Returns the Flexi template for entering the necessary values
  * for this step.
  *
  * @param Array $values Pre-set values
  * @param int $stepnumber which number has the current step in the wizard?
  * @param String $temp_id temporary ID for wizard workflow
  * @return String a Flexi template for getting needed data.
  */
 public function getStepTemplate($values, $stepnumber, $temp_id)
 {
     // We only need our own stored values here.
     $values = $values[__CLASS__];
     // Load template from step template directory.
     $factory = new Flexi_TemplateFactory($GLOBALS['STUDIP_BASE_PATH'] . '/app/views/course/wizard/steps');
     $tpl = $factory->open('studyareas/index');
     if ($values['studyareas']) {
         $tree = $this->buildPartialSemTree(StudipStudyArea::backwards(StudipStudyArea::findMany($values['studyareas'])), false);
         $tpl->set_attribute('assigned', $tree);
     } else {
         $tpl->set_attribute('assigned', array());
     }
     $tpl->set_attribute('values', $values);
     // First tree level is always shown.
     $tree = StudipStudyArea::findByParent(StudipStudyArea::ROOT);
     if (count($tree) == 0) {
         PageLayout::postError(formatReady(_('Das Anlegen einer ' . 'Veranstaltung ist nicht möglich, da keine Studienbereiche ' . 'existieren. Bitte wenden Sie sich an [die ' . 'Stud.IP-Administration]' . URLHelper::getLink('dispatch.php/siteinfo/show') . ' .')));
         return false;
     }
     /*
      * Someone works without JS activated, load all ancestors and
      * children of open node.
      */
     if ($values['open_node']) {
         $tpl->set_attribute('open_nodes', $this->buildPartialSemTree(StudipStudyArea::backwards(StudipStudyArea::findByParent($values['open_node'])), false, true));
     }
     /*
      * Someone works without JS and has entered a search term:
      * build the partial tree with search results.
      */
     if ($values['searchterm']) {
         $search = $this->searchSemTree($values['searchterm'], false, true);
         if ($search) {
             $tpl->set_attribute('open_nodes', $search);
             $tpl->set_attribute('search_result', $search);
             unset($values['open_node']);
         } else {
             PageLayout::postMessage(MessageBox::info(_('Es wurde kein Suchergebnis gefunden.')));
             unset($values['searchterm']);
         }
     }
     $tpl->set_attribute('tree', $tree);
     $tpl->set_attribute('ajax_url', $values['ajax_url'] ?: URLHelper::getLink('dispatch.php/course/wizard/ajax'));
     $tpl->set_attribute('no_js_url', $values['no_js_url'] ?: 'dispatch.php/course/wizard/forward/' . $stepnumber . '/' . $temp_id);
     $tpl->set_attribute('stepnumber', $stepnumber);
     $tpl->set_attribute('temp_id', $temp_id);
     return $tpl->render();
 }
Exemplo n.º 5
0
 /**
  * createEvaluationHeader: generate the head of an evaluation (title and base text)
  * @param   the evaluation
  * @returns a table row
  */
 function createEvaluationHeader($eval, $votedNow, $votedEarlier)
 {
     $br = new HTMpty("br");
     $tr = new HTM("tr");
     $td = new HTM("td");
     $td->attr("class", "table_row_even");
     $table2 = new HTM("table");
     $table2->attr("width", "100%");
     $tr2 = new HTM("tr");
     $td2 = new HTM("td");
     $td2->attr("width", "90%");
     $td2->attr("valign", "top");
     if ($eval->isError()) {
         $td2->html(EvalCommon::createErrorReport($eval, _("Fehler")));
         $td2->html($br);
     }
     $span = new HTM("span");
     $span->attr("class", "eval_title");
     $span->html(htmlReady($eval->getTitle()));
     $td2->cont($span);
     $td2->cont($br);
     $td2->cont($br);
     if ($votedNow) {
         $message = new HTML('div');
         $message->_content = array((string) MessageBox::success(_("Vielen Dank für Ihre Teilnahme.")));
         $td2->cont($message);
     } elseif ($votedEarlier) {
         $message = new HTML('div');
         $message->_content = array((string) MessageBox::info(_("Sie haben an dieser Evaluation bereits teilgenommen.")));
         $td2->cont($message);
     } else {
         $td2->html(formatReady($eval->getText()));
         $td2->cont($br);
     }
     $tr2->cont($td2);
     $td2 = new HTM("td");
     $td2->attr("width", "250");
     $td2->attr("valign", "top");
     $td2->html(EvalShow::createInfoBox($eval, $votedNow || $votedEarlier));
     $tr2->cont($td2);
     $table2->cont($tr2);
     $td->cont($table2);
     $tr->cont($td);
     return $tr;
 }
Exemplo n.º 6
0
 /**
  * Adding Stud.IP formatted code to the current page of the pdf.
  * Remember to call addPage first.
  * @param string $content Stud.IP formatted code
  */
 public function addContent($content)
 {
     preg_match_all("#\\[comment(=.*)?\\](.*)\\[/comment\\]#msU", $content, $matches);
     if (count($matches[0])) {
         $endnote .= "<br><br>" . _("Kommentare") . "<hr>";
         for ($i = 0; $i < count($matches[0]); $i++) {
             $endnote .= $i + 1 . ") " . htmlReady(substr($matches[1][$i], 1)) . ": " . htmlReady($matches[2][$i]) . "<br>";
         }
     }
     $content = preg_replace("#\\[comment(=.*)?\\](.*)\\[/comment\\]#emsU", '$this->addEndnote("//1", "//2")', $content);
     $content = formatReady($content, true, true, true, null);
     $content = str_replace("<table", "<table border=\"1\"", $content);
     // Since TCPDF cannot handle missing images at all, the content needs
     // to be cleaned from those (see tickets #2957, #3329 and #3688)
     $content = preg_replace_callback('/<img[^>]+src="(.*?)"[^>]*>/', function ($match) {
         $url = $match[1];
         // Detect possible html entities in url and remove them
         if (strpos($url, '&amp;') !== false) {
             $url = html_entity_decode($url);
         }
         // Handle optional media proxy
         if (Config::GetInstance()->LOAD_EXTERNAL_MEDIA) {
             $parsed = parse_url($url);
             // Detect media proxy
             if (strpos($parsed['path'], 'media_proxy') !== false && strpos($parsed['query'], 'url=') !== false) {
                 // Remove media proxy
                 parse_str($parsed['query'], $parameters);
                 $url = $parameters['url'];
             }
         }
         // Fetch headers from url, handle possible redirects
         do {
             $headers = get_headers($url, true);
             list(, $status) = explode(' ', $headers[0]);
             $url = $header['Location'] ?: $header['location'] ?: $url;
         } while (in_array($status, array(300, 301, 302, 303, 305, 307)));
         $status = $status ?: 404;
         // Replace image with link on error (and not internal), otherwise return sainitized
         // url
         return (!is_internal_url($url) || $status == 404) && $status >= 400 ? sprintf('[<a href="%s">%s</a>]', $url, basename($url)) : str_replace($match[1], $url, $match[0]);
     }, $content);
     $this->writeHTML($content . $endnote);
 }
Exemplo n.º 7
0
 public function __construct($label, $id, $language = null)
 {
     $language = $language ?: $GLOBALS['user']->preferred_language;
     try {
         $query = "SELECT content\n                      FROM help_content\n                      WHERE content_id = :id AND language = :language\n                      ORDER BY version DESC\n                      LIMIT 1";
         $statement = DBManager::get()->prepare($query);
         $statement->bindValue(':id', $id);
         $statement->bindValue(':language', $language);
         $statement->execute();
         $text = $statement->fetchColumn() ?: sprintf('Unknown help id "%s"', $id);
         $content = sprintf('<strong>%s</strong><p>%s</p>', htmlReady($label), formatReady($text));
     } catch (Exception $e) {
         if ($GLOBALS['user']->perms === 'root') {
             $content = 'DB-Error: please migrate';
         } else {
             $content = '';
         }
     }
     parent::__construct($content);
 }
Exemplo n.º 8
0
 function getItemContent($item_id)
 {
     $content = "\n<table width=\"90%\" cellpadding=\"2\" cellspacing=\"2\" align=\"center\" style=\"font-size:10pt\">";
     if ($item_id == "root") {
         $content .= "\n<tr><td class=\"table_header_bold\" align=\"left\">" . htmlReady($this->tree->root_name) . " </td></tr>";
         $content .= "\n<tr><td class=\"blank\" align=\"left\">" . htmlReady($this->root_content) . " </td></tr>";
         $content .= "\n</table>";
         return $content;
     }
     $range_object = RangeTreeObject::GetInstance($item_id);
     $name = $range_object->item_data['type'] ? $range_object->item_data['type'] . ": " : "";
     $name .= $range_object->item_data['name'];
     $content .= "\n<tr><td class=\"table_header_bold\" align=\"left\">" . htmlReady($name) . " </td></tr>";
     if (is_array($range_object->item_data_mapping)) {
         $content .= "\n<tr><td class=\"blank\" align=\"left\">";
         foreach ($range_object->item_data_mapping as $key => $value) {
             if ($range_object->item_data[$key]) {
                 $content .= "<b>" . htmlReady($value) . ":</b>&nbsp;";
                 $content .= formatLinks($range_object->item_data[$key]) . "&nbsp; ";
             }
         }
         $content .= "</td></tr><tr><td class=\"blank\" align=\"left\">" . "<a href=\"" . URLHelper::getLink("dispatch.php/institute/overview?auswahl=" . $range_object->item_data['studip_object_id']) . "\"" . tooltip(_("Seite dieser Einrichtung in Stud.IP aufrufen")) . ">" . htmlReady($range_object->item_data['name']) . "</a>&nbsp;" . _("in Stud.IP") . "</td></tr>";
     } elseif (!$range_object->item_data['studip_object']) {
         $content .= "\n<tr><td class=\"blank\" align=\"left\">" . _("Dieses Element ist keine Stud.IP-Einrichtung, es hat daher keine Grunddaten.") . "</td></tr>";
     } else {
         $content .= "\n<tr><td class=\"blank\" align=\"left\">" . _("Keine Grunddaten vorhanden!") . "</td></tr>";
     }
     $content .= "\n<tr><td>&nbsp;</td></tr>";
     $kategorien =& $range_object->getCategories();
     if ($kategorien->numRows) {
         while ($kategorien->nextRow()) {
             $content .= "\n<tr><td class=\"table_header_bold\">" . htmlReady($kategorien->getField("name")) . "</td></tr>";
             $content .= "\n<tr><td class=\"blank\">" . formatReady($kategorien->getField("content")) . "</td></tr>";
         }
     } else {
         $content .= "\n<tr><td class=\"blank\">" . _("Keine weiteren Daten vorhanden!") . "</td></tr>";
     }
     $content .= "</table>";
     return $content;
 }
Exemplo n.º 9
0
 function getNotificationObjects($course_id, $since, $user_id)
 {
     $items = array();
     $type = get_object_type($course_id, array('sem', 'inst', 'fak'));
     if ($type == 'sem') {
         $query = 'SELECT dokumente.*, seminare.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
             FROM dokumente
             JOIN auth_user_md5 USING (user_id)
             JOIN user_info USING (user_id)
             JOIN seminar_user USING (Seminar_id)
             JOIN seminare USING (Seminar_id)
             WHERE seminar_user.user_id = ? AND Seminar_id = ? 
                 AND dokumente.chdate > ?';
     } else {
         $query = 'SELECT dokumente.*, Institute.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
             FROM dokumente
             JOIN auth_user_md5 USING (user_id)
             JOIN user_info USING (user_id)
             JOIN user_inst ON (seminar_id = Institut_id)
             JOIN Institute USING (Institut_id)
             WHERE user_inst.user_id = ? AND Institut_id = ? 
                 AND dokumente.chdate > ?';
     }
     $stmt = DBManager::get()->prepare($query);
     $stmt->execute(array($user_id, $course_id, $since));
     while ($row = $stmt->fetch()) {
         $folder_tree = TreeAbstract::GetInstance('StudipDocumentTree', array('range_id' => $row['seminar_id']));
         if ($folder_tree->isDownloadFolder($row['range_id'], $user_id)) {
             // use correct text depending on type of object
             if ($type == 'sem') {
                 $summary = sprintf('%s hat im Dateibereich der Veranstaltung "%s" die Datei "%s" hochgeladen.', $row['fullname'], $row['Name'], $row['name']);
             } else {
                 $summary = sprintf('%s hat im Dateibereich der Einrichtung "%s" die Datei "%s" hochgeladen.', $row['fullname'], $row['Name'], $row['name']);
             }
             // create ContentElement
             $items[] = new ContentElement(_('Datei') . ': ' . $row['name'], $summary, formatReady(GetDownloadLink($row['dokument_id'], $row['name'])), $row['user_id'], $row['fullname'], URLHelper::getLink('folder.php#anker', array('cid' => $row['seminar_id'], 'cmd' => 'tree', 'open' => $row['dokument_id'])), $row['chdate']);
         }
     }
     return $items;
 }
Exemplo n.º 10
0
 function getNotificationObjects($course_id, $since, $user_id)
 {
     $items = array();
     $type = get_object_type($course_id, array('sem', 'inst', 'fak'));
     if ($type == 'sem') {
         $query = 'SELECT scm.*, seminare.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
             FROM scm
             JOIN auth_user_md5 USING (user_id)
             JOIN user_info USING (user_id)
             JOIN seminar_user ON (range_id = Seminar_id)
             JOIN seminare USING (Seminar_id)
             WHERE seminar_user.user_id = ? AND Seminar_id = ? 
                 AND scm.chdate > ?';
     } else {
         $query = 'SELECT scm.*, Institute.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
             FROM scm
             JOIN auth_user_md5 USING (user_id)
             JOIN user_info USING (user_id)
             JOIN user_inst ON (range_id = Institut_id)
             JOIN Institute USING (Institut_id)
             WHERE user_inst.user_id = ? AND Institut_id = ? 
                 AND scm.chdate > ?';
     }
     $stmt = DBManager::get()->prepare($query);
     $stmt->execute(array($user_id, $course_id, $since));
     while ($row = $stmt->fetch()) {
         // use correct text depending on type of object
         if ($type == 'sem') {
             $summary = sprintf('%s hat in der Veranstaltung "%s" die Informationsseite "%s" geändert.', $row['fullname'], $row['Name'], $row['tab_name']);
         } else {
             $summary = sprintf('%s hat in der Einreichtung "%s" die Informationsseite "%s" geändert.', $row['fullname'], $row['Name'], $row['tab_name']);
         }
         $link = URLHelper::getLink('dispatch.php/course/scm/' . $row['scm_id'], array('cid' => $row['range_id']));
         $items[] = new ContentElement('Freie Informationsseite: ' . $row['tab_name'], $summary, formatReady($row['content']), $row['user_id'], $row['fullname'], $link, $row['chdate']);
     }
     return $items;
 }
Exemplo n.º 11
0
echo $p["name"] == $plugin_name ? "selected" : "";
?>
>
                    <?php 
echo $p["visual_name"];
?>
                </option>
                    <? endforeach; ?>
            </select>
            <? if ($plugin_name) : ?>
                <br>
                <?php 
echo strlen($plugin["description"]) > 0 ? Icon::create('info-circle', 'inactive')->asImg() : '';
?>
                <?php 
echo formatReady($plugin["description"]);
?>
<br>
                <br>
                <?php 
echo _("1. Wählen Sie mit <b>Durchsuchen</b> eine Datei von Ihrer Festplatte aus.");
?>
<br>
                <input name="xmlfile" type="file" style="width:250px" accept="text/xml" maxlength="8000000"><br>
                <br>
                <?php 
echo _("2. Klicken Sie auf <b>Absenden</b>, um die Datei hochzuladen.");
?>
<br>
                <br>
                <?php 
Exemplo n.º 12
0
<br>

<? if (trim($constraint['content'])) : ?>
<div class="posting">
    <div class="postbody">
        <div class="content"><?php 
echo formatReady(ForumEntry::killEdit($constraint['content']));
?>
</div>
    </div>
</div>
<? endif ?>

<? if (!empty($list)) foreach ($list as $category_id => $entries) : ?>
<table class="default forum" data-category-id="<?php 
echo $category_id;
?>
">

    <colgroup>
        <col>
        <col>
        <col>
        <col>
    </colgroup>

    <thead>
        <tr>
            <th colspan="2"><?php 
echo _('Thema');
?>
Exemplo n.º 13
0
<div style="display: flex; width: 100%; margin-bottom: 20px;">
    <div>
        <img class="avatar-normal" src="<?php 
echo htmlReady($user['avatar']);
?>
">
    </div>
    <div style="width: 100%; padding-left: 10px;">
        <h1><?php 
echo htmlReady($user['name']);
?>
</h1>
        <div>
            <?php 
echo formatReady($user['description']);
?>
        </div>
    </div>
</div>

<? if (count($materials)) : ?>
    <section class="contentbox">
        <header>
            <h1>
                <?php 
echo Icon::create("service", "clickable")->asImg("16px");
?>
                <?php 
echo _("Lernmaterialien");
?>
            </h1>
Exemplo n.º 14
0
<?
# Lifter010: TODO
?>
<div class="modaloverlay">
    <div class="messagebox">
        <div class="content">
            <?php 
echo formatReady($question);
?>
        </div>
        <div class="content">
            <form action="<?php 
echo $action;
?>
" method="post">
                <?php 
echo CSRFProtection::tokenTag();
?>
                <?foreach($elements as $e) :?>
                    <div style="margin-top: 0.5em; text-align: left;">
                        <?php 
echo $e;
?>
                    </div>
                <?endforeach?>
                <div class="buttons">
                    <?php 
echo $approvalbutton;
?>
                    <span style="margin-left: 1em;">
                        <?php 
Exemplo n.º 15
0
 function extFormatReady ($text) {
     if ($this->is_raw_output) {
         return $text;
     }
     return formatReady($text, TRUE, TRUE, FALSE);
 }
Exemplo n.º 16
0
 function getLiteratureEntryRowForTableBox($item_id)
 {
     $content .= "\n<tr><td class=\"table_row_even\" align=\"left\" style=\"border-left: 1px solid black;border-right: 1px solid black;\">";
     $content .= formatReady($this->tree->getFormattedEntry($item_id), false, true);
     $content .= " </td></tr>";
     return $content;
 }
Exemplo n.º 17
0
<article class="comment open">
    <time><?php 
echo reltime($comment[3]);
?>
</time>
    <h1>#<?php 
echo $index + 1;
?>
        <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile?username=' . $comment[2]);
?>
">
             <?php 
echo htmlReady($comment[1]);
?>
        </a>
    </h1>
    <?php 
echo formatReady($comment[0]);
?>
</article>
Exemplo n.º 18
0
 public function testMail()
 {
     $input = '[Mail]some.user+tag@example.com';
     $expected = '<a class="link-extern" href="mailto:some.user+tag@example.com">Mail</a>';
     $expected = $this->wrap($expected);
     $this->assertEquals($expected, formatReady($input));
 }
Exemplo n.º 19
0
 static function loadByNewsId($news_id)
 {
     $query = "SELECT comment_id, content AS comment, mkdate, chdate, user_id\n                  FROM comments\n                  WHERE object_id = ?\n                  ORDER BY mkdate";
     $statement = \DBManager::get()->prepare($query);
     $statement->execute(array($news_id));
     $comments = $statement->fetchAll(\PDO::FETCH_ASSOC);
     foreach ($comments as &$comment) {
         $comment['comment_original'] = $comment['comment'];
         $comment['comment'] = formatReady($comment['comment']);
     }
     return $comments;
 }
Exemplo n.º 20
0
?>
>
            <?php 
echo _("Auf der persönlichen Profilseite");
?>
        </label>
        <label>
            <input type="checkbox" name="public" value="1"<?php 
echo $public ? " checked" : "";
?>
>
            <?php 
echo _("Als öffentlicher Link für unangemeldete Nutzer");
?>
            <?php 
echo formatReady($GLOBALS['ABSOLUTE_URI_STUDIP'] . "dispatch.php/questionnaire/answer/" . $questionnaire->getId());
?>
        </label>
        <? if ($GLOBALS['perm']->have_perm("root")) : ?>
            <label>
                <input type="checkbox" name="start" value="1"<?php 
echo $start ? " checked" : "";
?>
>
                <?php 
echo _("Auf der Systemstartseite");
?>
            </label>
        <? endif ?>

        <h3><?php 
Exemplo n.º 21
0
/**
 * Returns the HTML table rows for the date entries in $data.
 * The query has to start like this:
 * SELECT termine.*, themen.title as th_title, themen.description as th_desc FROM termine LEFT JOIN themen_termine USING (termin_id) LEFT JOIN themen USING (issue_id)
 * @param  $data the result of an query for date entries
 * @return the HTML for the table rows
 */
function dumpDateTableRows($data)
{
    global $TERMIN_TYP;

    $dump = '';
    $lastTerminId = NULL;

    foreach ($data as $row) {
        $currentTerminId = $row['termin_id'];
        if ($lastTerminId != $currentTerminId) {
            $dump .= '<tr align="center"> ';
            $dump .= '<td width="25%" align="left" valign="top">';
            $dump .= strftime('%d. %b. %Y, %H:%M', $row['date']);
            $dump .= ' - ' . strftime('%H:%M', $row['end_time']);
            $dump .= '&nbsp;(' . $TERMIN_TYP[$row['date_typ']]['name'] . ')';
            $dump .= '</td>';
        } else {
            $dump .= '<tr><td width="25%"></td>';
        }

        $dump .= '<td width="75%" align="left"> ';
        $dump .= htmlReady($row['th_title'], 1, 1);
        if ($row['th_desc']) {
            $dump .= '<br/>';
            $dump .= formatReady($row['th_desc'], 1, 1);
        }
        $dump .= '&nbsp;</td></tr>' . "\n";

        $lastTerminId = $currentTerminId;
    }

    return $dump;
}
Exemplo n.º 22
0
<table class="default nohover">
    <tbody>
    <? $countAnswers = $vote->questionnaire->countAnswers() ?>
    <? foreach ($vote['questiondata']['options'] as $key => $option) : ?>
        <tr>
            <? $percentage = $countAnswers ? round((int) $results[$key] / $countAnswers * 100) : 0 ?>
            <td style="text-align: right; background-size: <?php 
echo $percentage;
?>
% 100%; background-position: right center; background-image: url('<?php 
echo Assets::image_path("vote_lightgrey.png");
?>
'); background-repeat: no-repeat;" width="50%">
                <strong><?php 
echo formatReady($option);
?>
</strong>
            </td>
            <td style="white-space: nowrap;">
                (<?php 
echo $percentage;
?>
%
                | <?php 
echo (int) $results[$key];
?>
/<?php 
echo $countAnswers;
?>
)
Exemplo n.º 23
0
 /**
 * creates the html for the title and text input
 *
 * @access   private
 * @param    string  $mode
 * @return   string the html
 */
 function createTitleInput($mode = ROOT_BLOCK)
 {
     switch ($mode) {
         case ROOT_BLOCK:
             $title_label = _("Titel der Evaluation");
             $title = htmlReady($this->tree->eval->getTitle());
             $text_label = _("Zusätzlicher Text");
             $text = formatReady($this->tree->eval->getText());
             break;
         case ARRANGMENT_BLOCK:
             $title_label = _("Titel des Gruppierungsblocks");
             $group =& $this->tree->getGroupObject($this->itemID);
             $title = htmlReady($group->getTitle());
             $text_label = _("Zusätzlicher Text");
             $text = formatReady($group->getText());
             break;
         case QUESTION_BLOCK:
             $title_label = _("Titel des Fragenblocks");
             $title_info = _("Die Angabe des Titels ist bei einem Fragenblock optional.");
             $group =& $this->tree->getGroupObject($this->itemID);
             $title = htmlReady($group->getTitle());
             $text_label = _("Zusätzlicher Text");
             $text = formatReady($group->getText());
             break;
     }
     $text_info = _("Die Angabe des zusätzlichen Textes ist optional.");
     $table = new HTML("table");
     $table->addAttr("width", "98%");
     $table->addAttr("border", "0");
     $table->addAttr("cellpadding", "2");
     $table->addAttr("cellpadding", "0");
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addContent($title_label . ":");
     if ($mode == QUESTION_BLOCK) {
         $td->addHTMLContent($this->createImage(EVAL_PIC_HELP, $title_info));
     }
     $tr->addContent($td);
     $td = new HTML("td");
     $input = new HTMLempty("input");
     $input->addAttr("type", "text");
     $input->addAttr("name", "title");
     $input->addString("value=\"" . $title . "\"");
     $input->addAttr("size", "60");
     $input->addAttr("style", "vertical-align:middle; width: 100%;");
     $td->addContent($input);
     $tr->addContent($td);
     $table->addContent($tr);
     $tr = new HTML("tr");
     $td = new HTML("td");
     $td->addContent($text_label . ":");
     $td->addHTMLContent($this->createImage(EVAL_PIC_HELP, $text_info));
     $tr->addContent($td);
     $td = new HTML("td");
     $textarea = "<br><textarea class=\"add_toolbar wysiwyg\" name=\"text\" rows=\"4\" " . "style=\"vertical-align:top; width: 100%;\">";
     $textarea .= $text ? $text : "";
     $textarea .= "</textarea>";
     $td->addHTMLContent($textarea);
     $td->setTextareaCheck();
     $tr->addContent($td);
     $table->addContent($tr);
     return $table->createContent();
 }
Exemplo n.º 24
0
        <section>
            <?php 
echo formatReady($entry['content']);
?>
        </section>
    </section>
    <? endforeach ?>
<?endif?>

<?php 
echo $hompage_plugin;
?>

<?if(!empty($categories)) :?>
    <? foreach($categories as $cat) : ?>
    <section class="contentbox">
        <header>
            <h1><?php 
echo htmlReady($cat['head'] . $cat['zusatz']);
?>
</h1>
        </header>
        <section>
            <?php 
echo formatReady($cat['content']);
?>
        </section>
    </section>
    <?endforeach?>
<? endif; ?>
Exemplo n.º 25
0
echo URLHelper::getLink("dispatch.php/profile", array('username' => $user['username']));
?>
">
                                <?php 
echo htmlReady($user->getFullName());
?>
                            </a>
                        <? endif ?>
                    </strong>
                    <span class="origin">(<?php 
echo htmlReady($review['host_id'] ? $review->host['name'] : $GLOBALS['UNI_NAME_CLEAN']);
?>
)</span>
                    <div class="review_text">
                        <?php 
echo formatReady($review['review']);
?>
                    </div>
                    <div class="stars">
                        <? $rating = round($review['rating'], 1) ?>
                        <? $v = $rating >= 0.75 ? 3 : ($rating >= 0.25 ? 2 : "") ?>
                        <?php 
echo Icon::create($plugin->getPluginURL() . "/assets/star{$v}.svg")->asImg(16);
?>
                        <? $v = $rating >= 1.75 ? 3 : ($rating >= 1.25 ? 2 : "") ?>
                        <?php 
echo Icon::create($plugin->getPluginURL() . "/assets/star{$v}.svg")->asImg(16);
?>
                        <? $v = $rating >= 2.75 ? 3 : ($rating >= 2.25 ? 2 : "") ?>
                        <?php 
echo Icon::create($plugin->getPluginURL() . "/assets/star{$v}.svg")->asImg(16);
Exemplo n.º 26
0
echo _("Evaluation auswerten");
?>
" href="<?php 
echo URLHelper::getLink('eval_summary.php', array('eval_id' => $evaluation->id));
?>
">
                    <?php 
echo Icon::create('vote', 'clickable')->asImg();
?>
                </a>
            <? endif; ?>
        </nav>
    </header>
    <section>
        <?php 
echo formatReady($evaluation->text);
?>
    </section>
    <section>
        <?php 
echo \Studip\LinkButton::create(_('Anzeigen'), URLHelper::getURL('show_evaluation.php', array('evalID' => $evaluation->id)), array('data-dialog' => '', 'target' => '_blank'));
?>
    </section>
    <footer>
        <p>
            <?php 
echo _('Teilnehmer');
?>
: <?php 
echo $evaluation->getNumberOfVotes();
?>
Exemplo n.º 27
0
            ?>
            <tr>
                <td width="33%"><?php 
echo htmlReady($date['date']);
?>
</td>
                <td width="33%"><?php 
echo htmlReady($date['title']);
?>
</td>
                <td width="33%">
                    <? foreach ($date['related_persons'] as $key => $user_id) {
                        echo ($key > 0 ? ", " : "").htmlReady(get_fullname($user_id));
                    } ?>
                </td>
            </tr>
            <? if ($date['description']) : ?>
            <tr>
                <td>&nbsp;</td>
                <td colspan="2"><?php 
echo formatReady($date['description']);
?>
</td>
            </tr>
        <? endif ?>
        <? endforeach ?>

    </table>
<? endif ?>
</body>
</html>
Exemplo n.º 28
0
 static function load($ids, $additional_fields = array())
 {
     if (empty($ids)) {
         return array();
     }
     $additional_fields = empty($additional_fields) ? '' : ',' . implode(',', $additional_fields);
     $query = "SELECT DISTINCT m.message_id, autor_id AS sender_id, mu2.user_id AS receiver_id, subject,\n                         message, m.mkdate, priority, 1 - mu.readed AS unread\n                        {$additional_fields}\n                  FROM message AS m\n                  INNER JOIN message_user AS mu ON (m.message_id = mu.message_id AND mu.user_id = ?)\n                  INNER JOIN message_user AS mu2 ON (mu.message_id = mu2.message_id AND mu.snd_rec != mu2.snd_rec)\n                  WHERE m.message_id IN (?)";
     if (is_array($ids) and count($ids) > 1) {
         $query .= " ORDER BY m.mkdate DESC";
     }
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($GLOBALS['user']->id, $ids));
     $messages = $statement->fetchAll(PDO::FETCH_ASSOC);
     array_walk($messages, function (&$message) {
         $message['message_original'] = $message['message'];
         $message['message'] = formatReady($message['message']);
     });
     return is_array($ids) ? $messages : reset($messages);
 }
Exemplo n.º 29
0
$perm->check('dozent');

require_once 'lib/msg.inc.php';    //Ausgaben

$checks=new StartupChecks;
$list = $checks->getCheckList();

$problems_found = 0;

foreach ($list as $key=>$val) {
    if ($val){
        if ($checks->registered_checks[$key]['msg_fak_admin'] && $perm->is_fak_admin()) {
            $msgText = $checks->registered_checks[$key]["msg_fak_admin"]; 
        } else {
            $msgText = $checks->registered_checks[$key]["msg"];
            $msgText .= ' <br><i> Aktion: '.formatReady("=)");
            $msgText .= '&nbsp;<a href="'.($checks->registered_checks[$key]["link_fak_admin"] && $perm->is_fak_admin() ? 
            $checks->registered_checks[$key]["link_fak_admin"] : $checks->registered_checks[$key]["link"]).'" > '.
            ($checks->registered_checks[$key]["link_name_fak_admin"] && $perm->is_fak_admin() ? 
            $checks->registered_checks[$key]["link_name_fak_admin"] : $checks->registered_checks[$key]["link_name"]).' </a></i>';
        }
        $problems[$problems_found] = $msgText;
        $problems_found++;
    }
}

if ($problems_found > 1) {
    $moreProbs = " (Beachten Sie bitte die angegebene Reihenfolge!)";
}

if ($problems_found) {
Exemplo n.º 30
0
" title="<?php 
echo _('Diese Seite an die erste Position setzen');
?>
">
                            <?php 
echo Icon::create('arr_2up', 'clickable')->asImg();
?>
                        </a>
                    <? endif; ?>
                    <a href="<?php 
echo $controller->url_for('course/scm/' . $scm->id . '?verify=delete');
?>
" title="<?php 
echo _('Diese Seite löschen');
?>
">
                        <?php 
echo Icon::create('trash', 'clickable')->asImg();
?>
                    </a>
                <? endif; ?>
            <? endif; ?>
        </nav>
    </header>
    <section>
        <?php 
echo $scm->content ? formatReady($scm->content) : MessageBox::info(_('In diesem Bereich wurden noch keine Inhalte erstellt.'));
?>
    </section>
</section>