/**
  * get module link
  *
  * returns link to the specified ilias object. works without initializing module-class.
  * @access public
  * @return string html-code
  */
 function getModuleLink($title, $module_id, $module_type)
 {
     global $connected_cms, $view, $search_key, $cms_select, $current_module;
     if ($connected_cms[$this->cms_type]->isAuthNecessary() and !$connected_cms[$this->cms_type]->user->isConnected()) {
         return false;
     }
     $output = "<a href=\"" . UrlHelper::getLink($this->cms_link . "?" . "client_id=" . $connected_cms[$this->cms_type]->getClientId() . "&cms_select=" . $this->cms_type . "&ref_id=" . $module_id . "&type=" . $module_type . "&target=start") . "\" target=\"_blank\">";
     $output .= $title;
     $output .= "</a>&nbsp;";
     return $output;
 }
function get_highscore_list()
{
    $db = new DB_Seminar("SELECT murmeln_highscore.*,username FROM murmeln_highscore LEFT JOIN auth_user_md5 USING(user_id) ORDER BY score DESC LIMIT 20");
    $ret = '<ol>';
    $maxscore = 0;
    while ($db->next_record()) {
        $ret .= '<li><b>' . $db->f('score') . '</b> - 
				' . ($db->f('username') ? '<a href="' . UrlHelper::getLink('about.php?username='******'username')) . '">' . htmlReady(get_fullname_from_uname($db->f('username'))) . '</a>' : htmlready($db->f('name'))) . '</li>';
        $maxscore = $db->f('score');
    }
    $ret .= '</ol>';
    $db->query("DELETE FROM murmeln_highscore WHERE score < " . $maxscore);
    return $ret;
}
Example #3
0
                    <? $infotext .= _("Um die Studiengruppe sichtbar zu machen, wenden Sie sich an die Admins."); ?>
                <? endif ?>
                <?php 
echo _("[versteckt]");
?>
                <?php 
echo tooltipicon($infotext);
?>
            <? endif ?>
        </td>
        <td style="text-align: left">
            <? if (!empty($group['navigation'])) : ?>
                <? foreach (MyRealmModel::array_rtrim($group['navigation']) as $key => $nav)  : ?>
                    <? if (isset($nav) && $nav->isVisible(true)) : ?>
                        <a href="<?php 
echo UrlHelper::getLink('seminar_main.php', array('auswahl' => $group['seminar_id'], 'redirect_to' => strtr($nav->getURL(), '?', '&')));
?>
" <?php 
echo $nav->hasBadgeNumber() ? 'class="badge" data-badge-number="' . intval($nav->getBadgeNumber()) . '"' : '';
?>
>
                            <?php 
echo $nav->getImage()->asImg(20, $nav->getLinkAttributes());
?>
                        </a>
                    <? elseif (is_string($key)) : ?>
                        <?php 
echo Assets::img('blank.gif', array('width' => 20, 'height' => 20));
?>
                    <? endif ?>
                    <? echo ' ' ?>
Example #4
0
?>
        </td>

        <td class="answer">
            <? if (is_array($entry['last_posting'])) : ?>
            <?php 
echo _("von");
?>
            <? if ($entry['last_posting']['anonymous']): ?>
                <?php 
echo _('Anonym');
?>
            <? endif; ?>
            <? if (!$entry['last_posting']['anonymous'] || $entry['last_posting']['user_id'] == $GLOBALS['user']->id || $GLOBALS['perm']->have_perm('root')): ?>
            <a href="<?php 
echo UrlHelper::getLink('dispatch.php/profile', array('username' => $entry['last_posting']['username']));
?>
">
                <?php 
echo htmlReady(($temp_user = User::find($entry['last_posting']['user_id'])) ? $temp_user->getFullname() : $entry['last_posting']['user_fullname']);
?>
            </a>
            <? endif; ?>
            <br>
            <?php 
echo _("am");
?>
 <?php 
echo strftime($time_format_string_short, (int) $entry['last_posting']['date']);
?>
            <a href="<?php 
Example #5
0
 /**
  * get ilias courses
  *
  * creates output of ilias courses linked to the chosen seminar. also updates object-connections.
  * @access public
  * @return boolean successful
  */
 function getIliasCourses($sem_id)
 {
     global $connected_cms, $messages, $view, $cms_select;
     $db = DBManager::get();
     $rs = $db->query("SELECT DISTINCT system_type, module_id\n                          FROM object_contentmodules\n                          WHERE module_type = 'crs' AND object_id = " . $db->quote($sem_id))->fetchAll(PDO::FETCH_ASSOC);
     foreach ($rs as $row) {
         $courses[$row['system_type']] = $row['module_id'];
     }
     if (is_array($courses)) {
         foreach ($courses as $system_type => $crs_id) {
             if (ELearningUtils::isCMSActive($system_type)) {
                 ELearningUtils::loadClass($system_type);
                 $connected_courses['courses'][$system_type] = array('url' => UrlHelper::getLink($connected_cms[$system_type]->link->cms_link . '?client_id=' . $connected_cms[$system_type]->getClientId() . '&cms_select=' . $system_type . '&ref_id=' . $crs_id . '&type=crs&target=start'), 'cms_name' => $connected_cms[$system_type]->getName());
                 $course_output[] = "<a href=\"" . UrlHelper::getLink($connected_cms[$system_type]->link->cms_link . "?" . "client_id=" . $connected_cms[$system_type]->getClientId() . "&cms_select=" . $system_type . "&ref_id=" . $crs_id . "&type=crs&target=start") . "\" target=\"_blank\">" . sprintf(_("Kurs in %s"), htmlReady($connected_cms[$system_type]->getName())) . "</a>";
                 // gegebenenfalls zugeordnete Module aktualisieren
                 if (Request::option('update')) {
                     if (method_exists($connected_cms[$system_type], "updateConnections")) {
                         $connected_cms[$system_type]->updateConnections($crs_id);
                     }
                 }
                 if (method_exists($connected_cms[$system_type]->permissions, 'CheckUserPermissions')) {
                     $connected_cms[$system_type]->permissions->CheckUserPermissions($crs_id);
                 }
             }
         }
     }
     if ($connected_courses['courses']) {
         if (count($connected_courses['courses']) > 1) {
             $connected_courses['text'] = _("Diese Veranstaltung ist mit folgenden Ilias-Kursen verknüpft. Hier gelangen Sie direkt in den jeweiligen Kurs: ");
         } else {
             $connected_courses['text'] = _("Diese Veranstaltung ist mit einem Ilias-Kurs verknüpft. Hier gelangen Sie direkt in den Kurs: ");
         }
         $output["update"] .= "<font style=\"font-size: -1\">" . _("Hier können Sie die Zuordnungen zu den verknüpften Kursen aktualisieren.") . "<br></font>";
         $output["update"] .= "<form method=\"POST\" action=\"" . URLHelper::getLink() . "#anker\">\n";
         $output["update"] .= CSRFProtection::tokenTag();
         $output["update"] .= "<input type=\"HIDDEN\" name=\"view\" value=\"" . htmlReady($view) . "\">\n";
         $output["update"] .= "<input type=\"HIDDEN\" name=\"cms_select\" value=\"" . htmlReady($cms_select) . "\">\n";
         $output["update"] .= Button::create(_('Aktualisieren'), 'update');
         $output["update"] .= "</form>";
     }
     return $connected_courses;
 }
Example #6
0
                    <a href="<?php 
echo URLHelper::getLink('dispatch.php/institute/overview', array('auswahl' => $instid));
?>
">
                        <?php 
echo htmlReady($GLOBALS['INST_TYPE'][$values["type"]]["name"] . ": " . $values["name"]);
?>
                    </a>
                </td>

                <td style="text-align: left; white-space: nowrap">
                    <? if (!empty($values['navigation'])) : ?>
                        <? foreach (MyRealmModel::array_rtrim($values['navigation']) as $key => $nav)  : ?>
                            <? if (isset($nav) && $nav->isVisible(true)) : ?>
                                <a href="<?php 
echo UrlHelper::getLink('dispatch.php/institute/overview', array('auswahl' => $instid, 'redirect_to' => strtr($nav->getURL(), '?', '&')));
?>
" <?php 
echo $nav->hasBadgeNumber() ? 'class="badge" data-badge-number="' . intval($nav->getBadgeNumber()) . '"' : '';
?>
>
                                    <?php 
echo $nav->getImage()->asImg(20, $nav->getLinkAttributes());
?>
                                </a>
                            <? elseif (is_string($key)) : ?>
                                <?php 
echo Assets::img('blank.gif', array('widtd' => 20, 'height' => 20));
?>
                            <? endif ?>
                        <? endforeach ?>
Example #7
0
    echo Studip\Button::createAccept(_('Kopieren'), 'do_copy');
    ?>
    <?php 
    echo Studip\LinkButton::createCancel(_('Abbrechen'), '?');
    ?>
    </div>
<?php 
}
if (count($copied)) {
    ?>
<h3>Erstellte Kopien</h3>
<ol>
    <?foreach ($copied as $copy) : ?>
        <li>
        <a href="<?php 
    echo UrlHelper::getLink('seminar_main.php?auswahl=' . $copy->getId());
    ?>
"><?php 
    echo htmlReady(trim($copy->veranstaltungsnummer . ' ' . $copy->name));
    ?>
</a>
        <br>
        <?
        echo join('; ', $copy->members->findBy('status', 'dozent')->pluck('nachname'));
        ?>
        <br>
        </li>
    <?endforeach;?>
</ol>
<?php 
}
Example #8
0
 function print_result()
 {
     ob_start();
     global $_fullname_sql, $SEM_TYPE, $SEM_CLASS;
     if (is_array($this->sem_browse_data['search_result']) && count($this->sem_browse_data['search_result'])) {
         if (!is_object($this->sem_tree)) {
             $this->sem_tree = new StudipSemTreeViewSimple($this->sem_browse_data["start_item_id"], $this->sem_number, is_array($this->sem_browse_data['sem_status']) ? $this->sem_browse_data['sem_status'] : false, !(is_object($GLOBALS['perm']) && $GLOBALS['perm']->have_perm(get_config('SEM_VISIBILITY_PERM'))));
         }
         $the_tree = $this->sem_tree->tree;
         SkipLinks::addIndex(_("Suchergebnis"), 'sem_search_result', 90);
         list($group_by_data, $sem_data) = $this->get_result();
         echo "\n<table class='default' id=\"sem_search_result\" border=\"0\" align=\"center\" cellspacing=0 cellpadding=2 width = \"99%\">\n";
         echo "<caption>" . sprintf(_(" %s Veranstaltungen gefunden %s, Gruppierung: %s"), count($sem_data), $this->sem_browse_data['sset'] ? _("(Suchergebnis)") : "", $this->group_by_fields[$this->sem_browse_data['group_by']]['name']) . "</caption>";
         foreach ($group_by_data as $group_field => $sem_ids) {
             echo "\n<tr><th colspan='5'>";
             switch ($this->sem_browse_data["group_by"]) {
                 case 0:
                     echo htmlReady($this->search_obj->sem_dates[$group_field]['name']);
                     break;
                 case 1:
                     if ($the_tree->tree_data[$group_field]) {
                         echo htmlReady($the_tree->getShortPath($group_field));
                         if (is_object($this->sem_tree)) {
                             echo $this->sem_tree->getInfoIcon($group_field);
                         }
                     } else {
                         echo _("keine Studienbereiche eingetragen");
                     }
                     break;
                 case 3:
                     echo htmlReady($SEM_TYPE[$group_field]["name"] . " (" . $SEM_CLASS[$SEM_TYPE[$group_field]["class"]]["name"] . ")");
                     break;
                 default:
                     echo htmlReady($group_field);
                     break;
             }
             echo "</th></tr><tr>";
             ob_end_flush();
             ob_start();
             if (is_array($sem_ids['Seminar_id'])) {
                 if ($this->sem_browse_data["default_sem"] != 'all') {
                     $current_semester_id = SemesterData::GetSemesterIdByIndex($this->sem_browse_data["default_sem"]);
                 }
                 while (list($seminar_id, ) = each($sem_ids['Seminar_id'])) {
                     // create instance of seminar-object
                     $seminar_obj = new Seminar($seminar_id);
                     // is this sem a studygroup?
                     $studygroup_mode = SeminarCategories::GetByTypeId($seminar_obj->getStatus())->studygroup_mode;
                     $sem_name = $SEM_TYPE[key($sem_data[$seminar_id]["status"])]["name"] . ": " . key($sem_data[$seminar_id]["Name"]);
                     $seminar_number = key($sem_data[$seminar_id]['VeranstaltungsNummer']);
                     if ($studygroup_mode) {
                         $sem_name .= ' (' . _("Studiengruppe");
                         if ($seminar_obj->admission_prelim) {
                             $sem_name .= ', ' . _("Zutritt auf Anfrage");
                         }
                         $sem_name .= ')';
                         echo '<td width="1%">';
                         echo StudygroupAvatar::getAvatar($seminar_id)->getImageTag(Avatar::SMALL, array('title' => htmlReady($seminar_obj->getName())));
                         echo '</td>';
                     } else {
                         $sem_number_start = key($sem_data[$seminar_id]["sem_number"]);
                         $sem_number_end = key($sem_data[$seminar_id]["sem_number_end"]);
                         if ($sem_number_start != $sem_number_end) {
                             $sem_name .= " (" . $this->search_obj->sem_dates[$sem_number_start]['name'] . " - ";
                             $sem_name .= ($sem_number_end == -1 ? _("unbegrenzt") : $this->search_obj->sem_dates[$sem_number_end]['name']) . ")";
                         } elseif ($this->sem_browse_data["group_by"]) {
                             $sem_name .= " (" . $this->search_obj->sem_dates[$sem_number_start]['name'] . ")";
                         }
                         echo '<td width="1%">';
                         echo CourseAvatar::getAvatar($seminar_id)->getImageTag(Avatar::SMALL, array('title' => htmlReady($seminar_obj->getName())));
                         echo '</td>';
                     }
                     $send_from_search = URLHelper::getUrl(basename($_SERVER['PHP_SELF']), array('keep_result_set' => 1, 'cid' => null));
                     $send_from_search_link = UrlHelper::getLink($this->target_url, array($this->target_id => $seminar_id, 'cid' => null, 'send_from_search' => 1, 'send_from_search_page' => $send_from_search));
                     echo '<td width="66%" colspan="2">';
                     echo '<a href="' . $send_from_search_link . '">';
                     if (Config::get()->IMPORTANT_SEMNUMBER && $seminar_number) {
                         echo htmlReady($seminar_number) . " ";
                     }
                     echo htmlReady($sem_name) . '</a><br>';
                     //create Turnus field
                     if ($studygroup_mode) {
                         echo "<div style=\"font-size:smaller\">" . htmlReady(substr($seminar_obj->description, 0, 100)) . "</div>";
                     } else {
                         $temp_turnus_string = $seminar_obj->getDatesExport(array('short' => true, 'shrink' => true, 'semester_id' => $current_semester_id));
                         //Shorten, if string too long (add link for details.php)
                         if (strlen($temp_turnus_string) > 70) {
                             $temp_turnus_string = htmlReady(substr($temp_turnus_string, 0, strpos(substr($temp_turnus_string, 70, strlen($temp_turnus_string)), ",") + 71));
                             $temp_turnus_string .= " ... <a href=\"{$send_from_search_link}\">(" . _("mehr") . ")</a>";
                         } else {
                             $temp_turnus_string = htmlReady($temp_turnus_string);
                         }
                         if (!Config::get()->IMPORTANT_SEMNUMBER) {
                             echo "<div style=\"margin-left:5px;font-size:smaller\">" . htmlReady($seminar_number) . "</div>";
                         }
                         echo "<div style=\"margin-left:5px;font-size:smaller\">" . $temp_turnus_string . "</div>";
                     }
                     echo '</td>';
                     echo "<td align=\"right\">(";
                     $doz_name = array();
                     $c = 0;
                     reset($sem_data[$seminar_id]['fullname']);
                     foreach ($sem_data[$seminar_id]['username'] as $anzahl1) {
                         if ($c == 0) {
                             list($d_name, $anzahl2) = each($sem_data[$seminar_id]['fullname']);
                             $c = $anzahl2 / $anzahl1;
                             $doz_name = array_merge($doz_name, array_fill(0, $c, $d_name));
                         }
                         --$c;
                     }
                     $doz_uname = array_keys($sem_data[$seminar_id]['username']);
                     $doz_position = array_keys($sem_data[$seminar_id]['position']);
                     if (count($doz_name)) {
                         if (count($doz_position) != count($doz_uname)) {
                             $doz_position = range(1, count($doz_uname));
                         }
                         array_multisort($doz_position, $doz_name, $doz_uname);
                         $i = 0;
                         foreach ($doz_name as $index => $value) {
                             if ($value) {
                                 // hide dozenten with empty username
                                 if ($i == 4) {
                                     echo "... <a href=\"{$send_from_search_link}\">(" . _("mehr") . ")</a>";
                                     break;
                                 }
                                 echo "<a href=\"" . UrlHelper::getLink('dispatch.php/profile', array('username' => $doz_uname[$index])) . "\">" . htmlReady($value) . "</a>";
                                 if ($i != count($doz_name) - 1) {
                                     echo ", ";
                                 }
                             }
                             ++$i;
                         }
                         echo ")</td></tr>";
                     }
                 }
             }
         }
         echo "</table>";
     } elseif ($this->search_obj->search_button_clicked && !$this->search_obj->new_search_button_clicked) {
         if ($this->search_obj->found_rows === false) {
             $details = array(_("Der Suchbegriff fehlt oder ist zu kurz"));
         }
         if (!isset($details)) {
             echo MessageBox::info(_("Ihre Suche ergab keine Treffer"), $details);
         } else {
             echo MessageBox::error(_("Ihre Suche ergab keine Treffer"), $details);
         }
         $this->sem_browse_data["sset"] = 0;
     }
     ob_end_flush();
 }