Ejemplo n.º 1
0
 /**
  * This method is called to show the form to upload a new avatar for a
  * course.
  *
  * @return void
  */
 function index_action()
 {
     // nothing to do
     if ($this->studygroup_mode) {
         $this->avatar = StudygroupAvatar::getAvatar($this->course_id);
     } else {
         $this->avatar = CourseAvatar::getAvatar($this->course_id);
     }
     if (get_config('NEWS_RSS_EXPORT_ENABLE') && $this->course_id) {
         $rss_id = StudipNews::GetRssIdFromRangeId($this->course_id);
         if ($rss_id) {
             PageLayout::addHeadElement('link', array('rel' => 'alternate', 'type' => 'application/rss+xml', 'title' => 'RSS', 'href' => 'rss.php?id=' . $rss_id));
         }
     }
     // Fetch news
     $response = $this->relay('news/display/' . $this->course_id);
     $this->news = $response->body;
     // Fetch  votes
     if (get_config('VOTE_ENABLE')) {
         $response = $this->relay('questionnaire/widget/' . $this->course_id);
         $this->votes = $response->body;
     }
     // Fetch dates
     if (!$this->studygroup_mode) {
         $response = $this->relay("calendar/contentbox/display/{$this->course_id}/1210000");
         $this->dates = $response->body;
     }
 }
Ejemplo n.º 2
0
 /**
  * Mapping function where to find what
  * @param type $object the object
  * @param type $function the called function
  * @return string output
  */
 private static function map($object, $function)
 {
     /**
      * If you want to add an object to the helper simply add to this array
      */
     $mapping = array('User' => array('link' => function ($obj) {
         return URLHelper::getLink('dispatch.php/profile', array('username' => $obj->username));
     }, 'name' => function ($obj) {
         return htmlReady($obj->getFullname());
     }, 'avatar' => function ($obj) {
         return Avatar::getAvatar($obj->id, $obj->username)->getImageTag(Avatar::SMALL, array('title' => htmlReady($obj->getFullname('no_title'))));
     }), 'Course' => array('link' => function ($obj) {
         return URLHelper::getLink('seminar_main.php', array('auswahl' => $obj->id));
     }, 'name' => function ($obj) {
         return htmlReady($obj->name);
     }, 'avatar' => function ($obj) {
         return CourseAvatar::getAvatar($obj->id)->getImageTag($size = CourseAvatar::SMALL, array('title' => htmlReady($obj->name)));
     }));
     /*
      * Some php magic to call the right function if it exists
      */
     if ($object && $mapping[get_class($object)]) {
         return $mapping[get_class($object)][$function]($object);
     }
     return "";
 }
Ejemplo n.º 3
0
 /**
  * This method is called to remove an avatar for a course.
  *
  * @return void
  */
 function delete_action()
 {
     CourseAvatar::getAvatar($this->course_id)->reset();
     PageLayout::postMessage(MessageBox::success(_("Veranstaltungsbild gelöscht.")));
     if ($this->studygroup_mode) {
         $this->redirect(URLHelper::getUrl('dispatch.php/course/studygroup/edit/' . $this->course_id));
     } else {
         $this->redirect(URLHelper::getUrl('dispatch.php/course/avatar/update/' . $this->course_id));
     }
 }
Ejemplo n.º 4
0
 /**
  * Before filter, set up the page by initializing the session and checking
  * all conditions.
  *
  * @param String $action Name of the action to be invoked
  * @param Array  $args   Arguments to be passed to the action method
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     if (!Config::Get()->ELEARNING_INTERFACE_ENABLE) {
         throw new AccessDeniedException(_('Elearning-Interface ist nicht aktiviert.'));
     } else {
         $this->elearning_active = true;
     }
     PageLayout::setHelpKeyword('Basis.Ilias');
     PageLayout::setTitle($_SESSION['SessSemName']["header_line"] . " - " . _("Lernmodule"));
     checkObject();
     // do we have an open object?
     checkObjectModule('elearning_interface');
     object_set_visit_module('elearning_interface');
     $this->search_key = Request::get('search_key');
     $GLOBALS['search_key'] = $this->search_key;
     $this->cms_select = Request::quoted('cms_select');
     $GLOBALS['cms_select'] = $this->cms_select;
     $this->open_all = Request::get('open_all');
     $this->close_all = Request::get('close_all');
     $this->new_account_cms = Request::get('new_account_cms');
     $this->module_system_type = Request::get('module_system_type');
     $this->module_id = Request::get('module_id');
     $this->module_type = Request::get('module_type');
     $this->anker_target = Request::get('anker_target');
     $this->seminar_id = $_SESSION['SessSemName'][1];
     $this->rechte = $GLOBALS['perm']->have_studip_perm('tutor', $this->seminar_id);
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->new_account_cms])) {
         unset($this->new_account_cms);
     }
     if (!isset($GLOBALS['ELEARNING_INTERFACE_MODULES'][$this->cms_select])) {
         unset($this->cms_select);
     }
     if ($this->seminar_id != $_SESSION['elearning_open_close']["id"]) {
         unset($_SESSION['cache_data']);
         unset($_SESSION['elearning_open_close']);
     }
     if ($this->open_all != "") {
         $_SESSION['elearning_open_close']["all open"] = true;
     } elseif ($this->close_all != "") {
         $_SESSION['elearning_open_close']["all open"] = "";
     }
     $_SESSION['elearning_open_close']["type"] = "seminar";
     $_SESSION['elearning_open_close']["id"] = $this->seminar_id;
     if (Request::get('do_open')) {
         $this->anker_target = Request::get('do_open');
         $_SESSION['elearning_open_close'][Request::get('do_open')] = true;
     } elseif (Request::get('do_close')) {
         $this->anker_target = Request::get('do_close');
         $_SESSION['elearning_open_close'][Request::get('do_close')] = false;
     }
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/learnmodule-sidebar.png');
     $this->sidebar->setContextAvatar(CourseAvatar::getAvatar($this->seminar_id));
 }
Ejemplo n.º 5
0
 function test_nobody_path()
 {
     $path = CourseAvatar::getNobody()->getCustomAvatarPath(Avatar::NORMAL);
     $this->assertEquals("/dynamic/course/nobody_normal.png", $path);
 }
Ejemplo n.º 6
0
 public function index_action()
 {
     $this->prelim_discussion = vorbesprechung($this->course->id);
     $this->title = $this->course->getFullname();
     $this->course_domains = UserDomain::getUserDomainsForSeminar($this->course->id);
     $this->sem = new Seminar($this->course);
     if ($studienmodulmanagement = PluginEngine::getPlugin('StudienmodulManagement')) {
         foreach ($this->course->study_areas->filter(function ($m) {
             return $m->isModule();
         }) as $module) {
             $this->studymodules[] = array('nav' => $studienmodulmanagement->getModuleInfoNavigation($module->id, $this->course->start_semester->id), 'title' => $studienmodulmanagement->getModuleTitle($module->id, $this->course->start_semester->id));
         }
     }
     // Retrive display of sem_tree
     if (Config::get()->COURSE_SEM_TREE_DISPLAY) {
         $this->studyAreaTree = StudipStudyArea::backwards($this->course->study_areas);
     } else {
         $this->study_areas = $this->course->study_areas->filter(function ($m) {
             return !$m->isModule();
         });
     }
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('Content-Type', 'text/html;charset=Windows-1252');
         header('X-Title: ' . $this->title);
     } else {
         PageLayout::setHelpKeyword("Basis.InVeranstaltungDetails");
         PageLayout::setTitle($this->title . " - " . _("Details"));
         PageLayout::addSqueezePackage('admission');
         PageLayout::addSqueezePackage('enrolment');
         if ($GLOBALS['SessionSeminar'] == $this->course->id) {
             Navigation::activateItem('/course/main/details');
             SkipLinks::addIndex(Navigation::getItem('/course/main/details')->getTitle(), 'main_content', 100);
         } else {
             $sidebarlink = true;
             $enrolment_info = $this->sem->getEnrolmentInfo($GLOBALS['user']->id);
         }
         $sidebar = Sidebar::Get();
         if ($sidebarlink) {
             $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         }
         $sidebar->setTitle(_('Details'));
         $links = new ActionsWidget();
         $links->addLink(_("Drucken"), URLHelper::getScriptLink("dispatch.php/course/details/index/" . $this->course->id), Icon::create('print', 'clickable'), array('class' => 'print_action', 'target' => '_blank'));
         if ($enrolment_info['enrolment_allowed'] && $sidebarlink) {
             if (in_array($enrolment_info['cause'], words('member root courseadmin'))) {
                 $abo_msg = _("direkt zur Veranstaltung");
             } else {
                 $abo_msg = _("Zugang zur Veranstaltung");
             }
             $links->addLink($abo_msg, URLHelper::getScriptLink("dispatch.php/course/enrolment/apply/" . $this->course->id), Icon::create('door-enter', 'clickable'), array('data-dialog' => ''));
         }
         if (Config::get()->SCHEDULE_ENABLE && !$GLOBALS['perm']->have_studip_perm("user", $this->course->id) && !$GLOBALS['perm']->have_perm('admin') && $this->sem->getMetaDateCount()) {
             $query = "SELECT COUNT(*) FROM schedule_seminare WHERE seminar_id = ? AND user_id = ?";
             if (!DBManager::Get()->fetchColumn($query, array($this->course->id, $GLOBALS['user']->id))) {
                 $links->addLink(_("Nur im Stundenplan vormerken"), URLHelper::getLink("dispatch.php/calendar/schedule/addvirtual/" . $this->course->id), Icon::create('info', 'clickable'));
             }
         }
         if ($this->send_from_search_page) {
             $links->addLink(_("Zurück zur letzten Auswahl"), URLHelper::getLink($this->send_from_search_page), Icon::create('link-intern', 'clickable'));
         }
         if ($links->hasElements()) {
             $sidebar->addWidget($links);
         }
         $sidebar->setImage('sidebar/seminar-sidebar.png');
         $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         $sidebar = Sidebar::Get();
         $sidebar->setImage('sidebar/seminar-sidebar.png');
         $sidebar->setContextAvatar(CourseAvatar::getAvatar($this->course->id));
         if ($enrolment_info['description']) {
             PageLayout::postMessage(MessageBox::info($enrolment_info['description']));
         }
     }
 }
Ejemplo n.º 7
0
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * @author      Thomas Hackl <*****@*****.**>
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
 * @category    Stud.IP
 * @since       2.1
 */

use Studip\Button, Studip\LinkButton;

/* * * * * * * * * * * * *
 * * * I N F O B O X * * *
 * * * * * * * * * * * * */
$infobox['picture'] = CourseAvatar::getAvatar($SessSemName[1]);

$infobox['content'][] = array(
    'kategorie' => _("Information"),
    'eintrag'   => array(
        array(
            'text' => _("Hier können Sie festlegen, dass Sie die ".
                "Veranstaltung aus der Sicht einer Person sehen wollen, ".
                "die nicht Lehrende ist und somit überprüfen, wie ".
                "für Ihre Teilnehmende die Veranstaltung aussieht."),
            "icon" => Icon::create('info', 'clickable')
         )
     )
);
// ende Infobox
Ejemplo n.º 8
0
<? foreach ($studygroups as $group)  : ?>
    <tr>
        <td class="gruppe<?php 
echo $group['gruppe'];
?>
"></td>
        <td>
            <?php 
echo CourseAvatar::getAvatar($group['seminar_id'])->is_customized() ? CourseAvatar::getAvatar($group['seminar_id'])->getImageTag(Avatar::SMALL, tooltip2(htmlReady($group['name']))) : Icon::create('studygroup', 'clickable', ['title' => htmlReady($group['name'])])->asImg(20);
?>
        </td>
        <td style="text-align: left">
            <a href="<?php 
echo URLHelper::getLink('seminar_main.php', array('auswahl' => $group['seminar_id']));
?>
"
                <?php 
echo $group['lastvisitdate'] >= $group['chdate'] ? 'style="color: red;"' : '';
?>
>
                <?php 
echo htmlReady($group['name']);
?>
            </a>
            <? if ($group['visible'] == 0) : ?>
                <? $infotext = _("Versteckte Studiengruppen können über die Suchfunktionen nicht gefunden werden."); ?>
                <? $infotext .= " "; ?>
                <? if (Config::get()->ALLOW_DOZENT_VISIBILITY) : ?>
                    <? $infotext .= _("Um die Studiengruppe sichtbar zu machen, wählen Sie den Punkt \"Sichtbarkeit\" im Administrationsbereich der Veranstaltung."); ?>
                <? else : ?>
                    <? $infotext .= _("Um die Studiengruppe sichtbar zu machen, wenden Sie sich an die Admins."); ?>
 public function indexing_action()
 {
     if (!$GLOBALS['perm']->have_perm("root")) {
         throw new AccessDeniedException("Kein Zugriff");
     }
     //indexiert Veranstaltungen:
     $db = DBManager::get();
     $count = 0;
     $seminare = $db->query("SELECT * FROM seminare " . "");
     $index = Globalsearch::get();
     while ($seminar = $seminare->fetch(PDO::FETCH_ASSOC)) {
         $searchtext = $seminar['VeranstaltungsNummer'] . " " . $seminar['Name'] . " " . $seminar['Untertitel'] . " " . $seminar['Beschreibung'] . " " . $seminar['Sonstiges'] . " " . $seminar['Ort'];
         $sem_tree_ids = $db->query("SELECT sem_tree_id FROM seminar_sem_tree WHERE seminar_id = " . $db->quote($seminar['Seminar_id']))->fetchAll(PDO::FETCH_COLUMN, 0);
         $searchtext .= GlobalSearchPlugin::getStudyareaSearchstring($sem_tree_ids);
         $index->setEntry($seminar['Name'], "seminar", "details.php?cid=" . $seminar['Seminar_id'], $seminar['visible'] ? null : $seminar['Seminar_id'], $searchtext, CourseAvatar::getAvatar($seminar['Seminar_id'])->getImageTag(Avatar::SMALL) . " " . htmlReady($seminar['Name']), $seminar['Seminar_id']);
         $count++;
     }
     $users = $db->query("SELECT * FROM auth_user_md5 " . "");
     while ($user = $users->fetch(PDO::FETCH_ASSOC)) {
         $searchtext = $user['Vorname'] . " " . $user['Nachname'];
         $index->setEntry($user['Vorname'] . " " . $user['Nachname'], "user", "about.php?username="******"never" ? null : $user['user_id'], $searchtext, Avatar::getAvatar($user['user_id'])->getImageTag(Avatar::SMALL) . " " . htmlReady($user['Vorname']) . " " . htmlReady($user['Nachname']), $user['user_id']);
         $count++;
     }
     $documents = $db->query("SELECT * FROM dokumente " . "");
     while ($document = $documents->fetch(PDO::FETCH_ASSOC)) {
         $seminar_name = $db->query("SELECT Name FROM seminare WHERE Seminar_id = " . $db->quote($document['seminar_id']) . " ")->fetch(PDO::FETCH_COLUMN, 0);
         $searchtext = $document['name'] . " " . $document['description'] . " " . $document['filename'];
         $sem_tree_ids = $db->query("SELECT sem_tree_id FROM seminar_sem_tree WHERE seminar_id = " . $db->quote($document['seminar_id']))->fetchAll(PDO::FETCH_COLUMN, 0);
         $searchtext .= GlobalSearchPlugin::getStudyareaSearchstring($sem_tree_ids);
         $index->setEntry($document['name'] . ($seminar_name ? " in " . $seminar_name : ""), "document", "folder.php?cid=" . $document['seminar_id'] . "&cmd=all&open=" . $document['dokument_id'] . "#anker", $document['seminar_id'], $searchtext, "<strong>" . htmlReady($document['filename']) . "</strong>: " . htmlReady($document['description']), $document['dokument_id']);
         $count++;
     }
     $resources = $db->query("SELECT * FROM resources_objects WHERE category_id != '' " . "");
     while ($object = $resources->fetch(PDO::FETCH_ASSOC)) {
         $index->setEntry($object['name'], "resource", "resources.php?show_object=" . $object['resource_id'] . "&view=view_schedule", null, $object['name'] . " " . $object['description'], htmlReady($object['description']), $object['resource_id']);
         $count++;
     }
     $postings = $db->query("SELECT * FROM px_topics ");
     while ($posting = $postings->fetchAll(PDO::FETCH_ASSOC)) {
         $posting_content = preg_replace("/\\[quote([=\\d\\w\\s]*)\\]([\\d\\w\\s]*)\\[\\/quote\\]/", "", $posting['description']);
         $posting_content = strip_tags(formatReady(str_replace("\n", " ", $posting_content)));
         $searchtext = get_fullname($posting['user_id']) . " " . $posting_content;
         $sem_tree_ids = $db->query("SELECT sem_tree_id FROM seminar_sem_tree WHERE seminar_id = " . $db->quote($posting['Seminar_id']))->fetchAll(PDO::FETCH_COLUMN, 0);
         $searchtext .= GlobalSearchPlugin::getStudyareaSearchstring($sem_tree_ids);
         $index->setEntry($posting['name'], "posting", "forum.php?cid=" . $posting['Seminar_id'] . "&view=tree&open=" . $posting['topic_id'] . "#anker", $posting['Seminar_id'], $searchtext, $posting_content, $posting['topic_id']);
         $count++;
     }
     $result_object = new stdClass();
     $result_object->count = 0;
     NotificationCenter::postNotification("indexing_plugin_items", $result_object);
     $count += $result_object->count;
     if ($GLOBALS['IS_CLI']) {
         echo "Index ersellt mit " . $count . " Einträgen.";
     } else {
         $template = $this->getTemplate("indexing.php");
         $template->set_attribute("count", $count);
         $template->set_attribute("plugin", $this);
         echo $template->render();
     }
 }
Ejemplo n.º 10
0
 /**
  * Renders the sidebar.
  * The sidebar will only be rendered if it actually contains any widgets.
  * It will use the template "sidebar.php" located at "templates/sidebar".
  * A notification is dispatched before and after the actual rendering
  * process.
  *
  * @return String The HTML code of the rendered sidebar.
  */
 public function render()
 {
     $content = '';
     if ($this->context_avatar === null) {
         $breadcrumbs = $this->getBreadCrumbs();
         $keys = array_keys($breadcrumbs);
         if (reset($keys) === 'course') {
             $course = Course::findCurrent();
             if ($course) {
                 if ($course->getSemClass()->offsetGet('studygroup_mode')) {
                     $avatar = StudygroupAvatar::getAvatar($course->id);
                 } else {
                     $avatar = CourseAvatar::getAvatar($course->id);
                 }
             } else {
                 $institute = Institute::findCurrent();
                 $avatar = InstituteAvatar::getAvatar($institute->id);
             }
             $this->setContextAvatar($avatar);
         }
     }
     NotificationCenter::postNotification('SidebarWillRender', $this);
     if ($this->hasWidgets()) {
         $template = $GLOBALS['template_factory']->open('sidebar/sidebar');
         $template->widgets = $this->widgets;
         $template->image = $this->getImage();
         $template->title = $this->getTitle();
         $template->avatar = $this->context_avatar;
         $content = $template->render();
     }
     NotificationCenter::postNotification('SidebarDidRender', $this);
     return $content;
 }
Ejemplo n.º 11
0
                <a href="<?php 
echo $controller->url_for('admin/courses/toggle_complete/' . $semid);
?>
"
                   class="course-completion <? if ($values['is_complete']) echo 'course-complete'; ?>"
                   title="<?php 
echo _('Bearbeitungsstatus ändern');
?>
">
                       <?php 
echo _('Bearbeitungsstatus ändern');
?>
                </a>
            <? else: ?>
                <?php 
echo CourseAvatar::getAvatar($semid)->is_customized() ? CourseAvatar::getAvatar($semid)->getImageTag(Avatar::SMALL, array('title' => tooltip2(trim($values["Name"])))) : Icon::create('seminar', 'clickable', ['title' => trim($values["Name"])])->asImg(20);
?>
            <? endif; ?>
            </td>
            <? if (in_array('number', $view_filter)) : ?>
                <td>
                    <a href="<?php 
echo URLHelper::getLink('seminar_main.php', array('auswahl' => $semid));
?>
">
                        <?php 
echo htmlReady($values["VeranstaltungsNummer"]);
?>
                    </a>
                </td>
            <? endif ?>
Ejemplo n.º 12
0
            )
        )
    ),
    array("kategorie" => _("Profifunktionen"),
          "eintrag"   =>
        array(
            array(
                "icon" => "icons/16/black/forum",
                "text" => _("Drücke Shift-Enter, um einen Absatz einzufügen.")
            ),
            array(
                "icon" => "icons/16/black/smiley",
                "text" => sprintf(_("Verwende beim Tippen %sTextformatierungen%s und %sSmileys.%s"),
                        '<a href="http://docs.studip.de/help/2.2/de/Basis/VerschiedenesFormat" target="_blank">', '</a>',
                        '<a href="'.URLHelper::getLink("dispatch.php/smileys").'" target="_blank">', '</a>')
            ),
            array(
                "icon" => "icons/16/black/upload",
                "text" => _("Ziehe Dateien per Drag & Drop in ein Textfeld, um sie hochzuladen und zugleich zu verlinken.")
            ),
            array(
                "icon" => "icons/16/black/person",
                "text" => _("Erwähne jemanden mit @username oder @\"Vorname Nachname\". Diese Person wird dann speziell auf Deinen Blubber hingewiesen.")
            )
        )
    )
);
$infobox = array(
    'picture' => CourseAvatar::getAvatar($course_id)->getURL(Avatar::NORMAL),
    'content' => $infobox
);
Ejemplo n.º 13
0
 /**
  * returns an html tag of the image of the searched item (if avatar enabled)
  *
  * @param string $id id of the item which can be username, user_id, Seminar_id or Institut_id
  * @param constant $size enum(NORMAL, SMALL, MEDIUM): size of the avatar
  *
  * @return string like "<img src="...avatar.jpg" ... >"
  */
 public function getAvatarImageTag($id, $size = Avatar::SMALL, $options = array())
 {
     switch ($this->avatarLike) {
         case "username":
             return Avatar::getAvatar(get_userid($id), $id)->getImageTag($size, $options);
         case "user_id":
             return Avatar::getAvatar($id)->getImageTag($size, $options);
         case "Seminar_id":
         case "Arbeitsgruppe_id":
             return CourseAvatar::getAvatar($id)->getImageTag($size, $options);
         case "Institut_id":
             return InstituteAvatar::getAvatar($id)->getImageTag($size, $options);
     }
 }
Ejemplo n.º 14
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();
 }
Ejemplo n.º 15
0
<? foreach ($course_collection as $course)  : ?>
    <? $sem_class = $course['sem_class']; ?>
    <tr>
        <td class="gruppe<?php 
echo $course['gruppe'];
?>
"></td>
        <td>
            <? if ($sem_class['studygroup_mode']) : ?>
                <?php 
echo StudygroupAvatar::getAvatar($course['seminar_id'])->is_customized() ? StudygroupAvatar::getAvatar($course['seminar_id'])->getImageTag(Avatar::SMALL, tooltip2($course['name'])) : Icon::create('studygroup', 'clickable', ['title' => $course['name']])->asImg(20);
?>
            <? else : ?>
                <?php 
echo CourseAvatar::getAvatar($course['seminar_id'])->is_customized() ? CourseAvatar::getAvatar($course['seminar_id'])->getImageTag(Avatar::SMALL, tooltip2($course['name'])) : Icon::create('seminar', 'clickable', ['title' => $course['name']])->asImg(20);
?>
            <? endif ?>
        </td>
        <? if($config_sem_number) :?>
            <td><?php 
echo $course['veranstaltungsnummer'];
?>
</td>
        <? endif?>
        <td style="text-align: left">
            <a href="<?php 
echo URLHelper::getLink('seminar_main.php', array('auswahl' => $course['seminar_id']));
?>
"
                <?php 
echo $course['visitdate'] <= $course['chdate'] ? 'style="color: red;"' : '';
Ejemplo n.º 16
0
?>
">
    </div>
    <? if ($thread['context_type'] === "course") : ?>
    <a href="<?php 
echo URLHelper::getLink("plugins.php/blubber/forum/forum", array('cid' => $thread['Seminar_id']));
?>
"
       <? $title = get_object_name($thread['Seminar_id'], "sem") ?>
       title="<?php 
echo _("Veranstaltung") . " " . htmlReady($title['name']);
?>
"
       class="contextinfo"
       style="background-image: url('<?php 
echo CourseAvatar::getAvatar($thread['Seminar_id'])->getURL(Avatar::NORMAL);
?>
');">
    </a>
    <? elseif($thread['context_type'] === "private") : ?>
    <? 
        if (count($related_users) > 20) {
            $title = _("Privat: ").sprintf(_("%s Personen"), count($related_users));
        } else {
            $title = _("Privat: ");
            foreach ($related_users as $key => $user_id) {
                if ($key > 0) {
                    $title .= ", ";
                }
                $title .= get_fullname($user_id);
            }