function getContent($args = null, $raw = false)
 {
     global $SEM_TYPE, $SEM_CLASS;
     $this->group_by_fields = array(array('name' => _("Semester"), 'group_field' => 'sem_number'), array('name' => _("Bereich"), 'group_field' => 'bereich'), array('name' => _("Lehrende"), 'group_field' => 'fullname', 'unique_field' => 'username'), array('name' => _("Typ"), 'group_field' => 'status'), array('name' => _("Einrichtung"), 'group_field' => 'Institut', 'unique_field' => 'Institut_id'));
     // initialise data
     $this->sem_browse_data = array('start_item_id' => $this->getRootStartItemId(), 'do_search' => '0', 'type' => 'all', 'sem' => 'all', 'withkids' => '0', 'show_result' => '0');
     // Daten aus config übernehmen
     $this->sem_browse_data['group_by'] = $this->config->getValue('Main', 'grouping');
     $level_change = $args['start_item_id'];
     $this->search_obj = new StudipSemSearchHelper(null, true);
     $semester = new SemesterData();
     $all_semester = $semester->getAllSemesterData();
     array_unshift($all_semester, 0);
     $switch_time = mktime(0, 0, 0, date('m'), date('d') + 7 * $this->config->getValue('Main', 'semswitch'), date('Y'));
     // get current semester
     $current_sem = get_sem_num($switch_time) + 1;
     switch ($this->config->getValue('Main', 'semstart')) {
         case 'previous':
             if (isset($all_semester[$current_sem - 1])) {
                 $current_sem--;
             }
             break;
         case 'next':
             if (isset($all_semester[$current_sem + 1])) {
                 $current_sem++;
             }
             break;
         case 'current':
             break;
         default:
             if (isset($all_semester[$this->config->getValue('Main', 'semstart')])) {
                 $current_sem = $this->config->getValue('Main', 'semstart');
             }
     }
     $this->sem_number = array($current_sem);
     $this->sem_browse_data['sem'] = $current_sem;
     $sem_classes = (array) $this->config->getValue('Main', 'semclasses');
     $sem_types_order = (array) $this->config->getValue('ReplaceTextSemType', 'order');
     $sem_types_visbility = (array) $this->config->getValue('ReplaceTextSemType', 'visibility');
     foreach ($sem_types_order as $type_id) {
         if ($sem_types_visbility[$type_id] && in_array($GLOBALS['SEM_TYPE'][$type_id]['class'], $sem_classes)) {
             $this->sem_browse_data['sem_status'][] = $type_id;
         }
     }
     $this->module_params = $this->getModuleParams($this->approved_params);
     if (!$this->module_params['reset_search']) {
         $this->sem_browse_data = array_merge($this->sem_browse_data, $this->module_params);
     }
     $sem_status = is_array($this->sem_browse_data['sem_status']) ? $this->sem_browse_data['sem_status'] : false;
     $params = $this->sem_browse_data;
     // delete array of semester data from the search object's parameters
     $params['sem_status'] = false;
     if ($this->config->getValue('Main', 'mode') == 'show_sem_range') {
         $params['scope_choose'] = $this->sem_browse_data['start_item_id'];
     } else {
         $params['range_choose'] = $this->sem_browse_data['start_item_id'];
     }
     if ($this->sem_browse_data['sem'] == 'all') {
         $this->sem_number = array_keys($all_semester);
     } else {
         if (isset($this->sem_browse_data['sem'])) {
             $this->sem_number = array((int) $this->sem_browse_data['sem']);
         }
     }
     // set params for search object
     $this->search_obj->setParams($params, true);
     if ($this->sem_browse_data['do_search'] == 1) {
         $this->search_obj->doSearch();
         $search_result = $this->search_obj->getSearchResultAsArray();
         if (count($search_result)) {
             $this->sem_browse_data['search_result'] = array_flip($search_result);
         } else {
             $this->sem_browse_data['search_result'] = array();
         }
         $this->sem_browse_data['show_result'] = '1';
         $this->sem_browse_data['show_entries'] = false;
     } else {
         if ($this->config->getValue('Main', 'mode') == 'show_sem_range') {
             $this->get_sem_range($this->sem_browse_data['start_item_id'], $this->sem_browse_data['withkids'] == 1);
         } else {
             //($this->config->getValue('Main', 'mode') == 'show_sem_range_tree') {
             $this->get_sem_range_tree($this->sem_browse_data['start_item_id'], $this->sem_browse_data['withkids'] == 1);
         }
     }
     $this->sem_dates = $all_semester;
     $this->sem_dates[0] = array('name' => sprintf(_("vor dem %s"), $this->sem_dates[1]['name']));
     // reorganize the $SEM_TYPE-array
     foreach ($GLOBALS['SEM_CLASS'] as $key_class => $class) {
         $i = 0;
         foreach ($GLOBALS['SEM_TYPE'] as $key_type => $type) {
             if ($type['class'] == $key_class) {
                 $i++;
                 $this->sem_types_position[$key_type] = $i;
             }
         }
     }
     if ($this->sem_browse_data['xls_export']) {
         $tmp_file = basename($this->createResultXls());
         if ($tmp_file) {
             ob_end_clean();
             header('Location: ' . getDownloadLink($tmp_file, _("ErgebnisVeranstaltungssuche.xls"), 4));
             page_close();
             die;
         }
     }
     $this->global_markers['URL_SEARCH_PARAMS'] = '';
     $search_params = $this->module_params;
     $param_key = 'ext_' . strtolower($this->name);
     foreach ($search_params as $key => $value) {
         $this->global_markers['URL_SEARCH_PARAMS'] .= "&{$param_key}[{$key}]=" . urlencode($value);
     }
     $this->global_markers['URL_PERSONDETAILS'] = $this->getLinkToModule('LinkInternPersondetails');
     $this->global_markers['URL_LECTUREDETAILS'] = $this->getLinkToModule('LinkInternLecturedetails');
     $this->global_markers['URL_LEVEL_NO_COURSES'] = $this->getLinkToModule('LinkInternTree');
     $this->global_markers['URL_LEVEL_COURSES'] = $this->getLinkToModule('LinkInternShowCourses');
     $this->global_markers['CURRENT_SEMESTER'] = ExternModule::ExtHtmlReady($all_semester[$this->sem_number[0]]['name']);
     if (trim($this->config->getValue('TemplateSimpleSearch', 'template'))) {
         $content['SEM_BROWSER']['SIMPLE_SEARCH'] = $this->elements['TemplateSimpleSearch']->toString(array('content' => $this->getContentSimpleSearch(), 'subpart' => 'SIMPLE_SEARCH'));
     }
     if (trim($this->config->getValue('TemplateExtendedSearch', 'template'))) {
         $content['SEM_BROWSER']['EXTENDED_SEARCH'] = $this->elements['TemplateExtendedSearch']->toString(array('content' => $this->getContentExtendedSearch(), 'subpart' => 'EXTENDED_SEARCH'));
     }
     if (trim($this->config->getValue('TemplateTree', 'template'))) {
         $content['SEM_BROWSER']['TREE'] = $this->elements['TemplateTree']->toString(array('content' => $this->getContentTree(), 'subpart' => 'TREE'));
     }
     if (trim($this->config->getValue('TemplateResult', 'template')) && $this->sem_browse_data['show_result'] == '1') {
         $content['SEM_BROWSER']['RESULT'] = $this->elements['TemplateResult']->toString(array('content' => $this->getContentResult(), 'subpart' => 'RESULT'));
     }
     // set super global markers
     $content['__GLOBAL__'] = $this->global_markers;
     return $content;
 }
    function ExternSemBrowseTemplate (&$module, $start_item_id) {

        global $SEM_TYPE,$SEM_CLASS;
        $semester = new SemesterData();
        $all_semester = $semester->getAllSemesterData();
        array_unshift($all_semester, 0);

        $this->group_by_fields = array( array('name' => _("Semester"), 'group_field' => 'sem_number'),
                                        array('name' => _("Bereich"), 'group_field' => 'bereich'),
                                        array('name' => _("Lehrende"), 'group_field' => 'fullname', 'unique_field' => 'username'),
                                        array('name' => _("Typ"), 'group_field' => 'status'),
                                        array('name' => _("Einrichtung"), 'group_field' => 'Institut', 'unique_field' => 'Institut_id'));

        $this->module = $module;
        $this->sem_browse_data["group_by"] = $this->module->config->getValue("Main", "grouping");
        $this->sem_dates = $all_semester;
        $this->sem_dates[0] = array("name" => sprintf(_("vor dem %s"),$this->sem_dates[1]['name']));

        // reorganize the $SEM_TYPE-array
        foreach ($SEM_CLASS as $key_class => $class) {
            $i = 0;
            foreach ($SEM_TYPE as $key_type => $type) {
                if ($type["class"] == $key_class) {
                    $i++;
                    $this->sem_types_position[$key_type] = $i;
                }
            }
        }

        $switch_time = mktime(0, 0, 0, date("m"),
                date("d") + 7 * $this->module->config->getValue("Main", "semswitch"), date("Y"));
        // get current semester
        $current_sem = get_sem_num($switch_time) + 1;

        switch ($this->module->config->getValue("Main", "semstart")) {
            case "previous" :
                if (isset($all_semester[$current_sem - 1])) {
                    $current_sem--;
                }
                break;
            case "next" :
                if (isset($all_semester[$current_sem + 1])) {
                    $current_sem++;
                }
                break;
            case "current" :
                break;
            default :
                if (isset($all_semester[$this->module->config->getValue('Main', 'semstart')])) {
                    $current_sem = $this->module->config->getValue('Main', 'semstart');
                }
        }

        $last_sem = $current_sem + $this->module->config->getValue('Main', 'semrange');
        if ($last_sem < $current_sem)
            $last_sem = $current_sem;
        if (!isset($all_semester[$last_sem]))
            $last_sem = sizeof($all_semester);

        for (;$last_sem > $current_sem; $last_sem--)
            $this->sem_number[] = $last_sem - 1;

        $semclasses = $this->module->config->getValue('Main', 'semclasses');
        foreach ($SEM_TYPE as $key => $type) {
            if (in_array($type['class'], (array) $semclasses))
                $this->sem_browse_data['sem_status'][] = $key;
        }

        $this->get_sem_range_tree($start_item_id, true);
    }
    private function getContentListInstitutes () {
        $selected_item_ids = $this->config->getValue('SelectInstitutes', 'institutesselected');
        // at least one institute has to be selected in the configuration
        if (!is_array($selected_item_ids)) {
            return array();
        }
        $content = array();
        
        $first_levels = $this->range_tree->getKids('root');
    //  var_dump($first_levels);
        $current_semester = get_sem_num(time());
        
        $db_count = new DB_Seminar();
        $dbv = DbView::getView('sem_tree');
        $mrks = str_repeat('?,', count($selected_item_ids) - 1) . '?';
        $query = "SELECT Institut_id, Name "
            . "FROM Institute "
            . "WHERE Institut_id IN ($mrks) "
            . "AND fakultaets_id != Institut_id "
            . "ORDER BY Name ASC";
        $parameters = $selected_item_ids;

        $statement = DBManager::get()->prepare($query);
        $statement->execute($parameters);

        while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
            if ($this->config->getValue('Main', 'onlylecturers')) {
                // get only users with status dozent in an visible seminar in the current semester
                $query = sprintf("SELECT COUNT(DISTINCT(su.user_id)) AS count_user "
                    . "FROM user_inst ui "
                    . "LEFT JOIN seminar_user su USING(user_id) "
                    . "LEFT JOIN seminare s USING (seminar_id) "
                    . "LEFT JOIN auth_user_md5 aum ON su.user_id = aum.user_id "
                    . "WHERE ui.Institut_id = '%s' "
                    . "AND su.status = 'dozent' "
                    . "AND ui.externdefault = 1 "
                    . "AND " . get_ext_vis_query()
                    . "AND ui.inst_perms = 'dozent' "
                    . "AND ((%s) = %s OR ((%s) <= %s  AND ((%s) >= %s OR (%s) = -1)))",
                    $row['Institut_id'],
                    $dbv->sem_number_sql,
                    $current_semester,
                    $dbv->sem_number_sql,
                    $current_semester,
                    $dbv->sem_number_end_sql,
                    $current_semester,
                    $dbv->sem_number_end_sql);
            } else {
                // get only users with the given status
                $query = sprintf("SELECT COUNT(DISTINCT(ui.user_id)) AS count_user "
                    . "FROM user_inst ui "
                    . "WHERE ui.Institut_id = '%s' "
                    . "AND ui.inst_perms IN('%s') "
                    . "AND ui.externdefault = 1"
                    . "AND " . get_ext_vis_query(),
                    $row['Institut_id'],
                    implode("','", $this->config->getValue('Main', 'instperms')));
            }
            
           
            $state = DBManager::get()->prepare($query);
            $state->execute($parameters);
            while ($row_count = $state->fetch(PDO::FETCH_ASSOC)) {
            
                if ($row_count['count_user'] > 0) {
                    $content['LIST_INSTITUTES']['INSTITUTE'][] = array(
                        'INSTITUTE_NAME' => ExternModule::ExtHtmlReady($row['Name']),
                        'INSTITUTE_COUNT_USER' => $row_count['count_user'],
                        'URL_LIST_PERSONS' => $this->getLinkToModule('LinkInternListInstitutes', array('item_id' => $row['Institut_id'])));
                }
            }
        }
        
        return $content;
    }
    private function getContentLectures () {
        global $attr_text_td, $end, $start;
        $semester = new SemesterData();
        $all_semester = $semester->getAllSemesterData();
        // old hard coded $SEMESTER-array starts with index 1
        array_unshift($all_semester, 0);

        $types = array();
        $semclass = $this->config->getValue('PersondetailsLectures', 'semclass');
        if (is_null($semclass)) {
            $semclass = array(1);
        }
            if (in_array($type["class"], $semclass)) {
            }
        $switch_time = mktime(0, 0, 0, date("m"), date("d") + 7 * $this->config->getValue("PersondetailsLectures", "semswitch"), date("Y"));
        // get current semester
        $current_sem = get_sem_num($switch_time) + 1;

        switch ($this->config->getValue("PersondetailsLectures", "semstart")) {
            case "previous" :
                if (isset($all_semester[$current_sem - 1])) {
                    $current_sem--;
                }
                break;
            case "next" :
                if (isset($all_semester[$current_sem + 1])) {
                    $current_sem++;
                }
                break;
            case "current" :
                break;
            default :
                if (isset($all_semester[$this->config->getValue("PersondetailsLectures", "semstart")])) {
                    $current_sem = $this->config->getValue("PersondetailsLectures", "semstart");
                }
        }

        $last_sem = $current_sem + $this->config->getValue("PersondetailsLectures", "semrange") - 1;
        if ($last_sem < $current_sem) {
            $last_sem = $current_sem;
        }
        if (!isset($all_semester[$last_sem])) {
            $last_sem = sizeof($all_semester) - 1;
        }

        $types = array();
        $semclass = $this->config->getValue('PersondetailsLectures', 'semclass');
        if (is_null($semclass)) {
            $semclass = array(1);
        }
        foreach ($GLOBALS["SEM_TYPE"] as $key => $type) {
            if (in_array($type["class"], $semclass)) {
                $types[] = $key;
            }
        }
        $stm = DBManager::get()->prepare(
            "SELECT s.Name, s.Seminar_id, s.Untertitel, s.VeranstaltungsNummer "
            . "FROM seminar_user su "
            . "LEFT JOIN seminare s USING(seminar_id) "
            . "WHERE user_id = ? AND su.status LIKE 'dozent' "
            . "AND start_time <= ? AND (? <= start_time + duration_time OR duration_time = -1) "
            . "AND s.status IN (?) AND s.visible = 1 "
            . "ORDER BY Name");

        $i = 0;
        for (;$current_sem <= $last_sem; $last_sem--) {
            $stm->execute(array($this->user_id, $all_semester[$last_sem]['beginn'], $all_semester[$last_sem]['beginn'], $types ?: ''));
            $result = $stm->fetchAll();

            if ($result && sizeof($result)) {
                if (!($this->config->getValue('PersondetailsLectures', 'semstart') == 'current' && $this->config->getValue('PersondetailsLectures', 'semrange') == 1)) {
                    $month = date('n', $all_semester[$last_sem]['beginn']);
                    if ($month > 9) {
                        $content['LECTURES']['SEMESTER'][$i]['NAME'] = $this->config->getValue('PersondetailsLectures', 'aliaswise') . date(' Y/', $all_semester[$last_sem]['beginn']) . date('y', $all_semester[$last_sem]['ende']);
                    } else if ($month > 3 && $month < 10) {
                        $content['LECTURES']['SEMESTER'][$i]['NAME'] = $this->config->getValue('PersondetailsLectures', 'aliassose') . date(' Y', $all_semester[$last_sem]['beginn']);
                    }
                }
                $k = 0;
                foreach ($result as $row) {
                    $content['LECTURES']['SEMESTER'][$i]['LECTURE'][$k]['TITLE'] = ExternModule::ExtHtmlReady($row['Name']);
                    $content['LECTURES']['SEMESTER'][$i]['LECTURE'][$k]['LECTUREDETAILS-HREF'] = $this->elements['LinkInternLecturedetails']->createUrl(array('link_args' => 'seminar_id=' . $row['Seminar_id']));
                    if (trim($row['Untertitel']) != '') {
                        $content['LECTURES']['SEMESTER'][$i]['LECTURE'][$k]['SUBTITLE'] = ExternModule::ExtHtmlReady($row['Untertitel']);
                    }
                    if (trim($row['VeranstaltungsNummer']) != '') {
                        $content['LECTURES']['SEMESTER'][$i]['LECTURE'][$k]['NUMBER'] = ExternModule::ExtHtmlReady($row['VeranstaltungsNummer']);
                    }
                    $k++;
                }
            }
            $i++;
        }
        return $content;
    }
Пример #5
0
function lehre (&$module, $row, $alias_content, $text_div, $text_div_end)
{
    global $attr_text_td, $end, $start;

    $semester = new SemesterData();
    $all_semester = $semester->getAllSemesterData();
    // old hard coded $SEMESTER-array starts with index 1
    array_unshift($all_semester, 0);

    if ($margin = $module->config->getValue('TableParagraphSubHeadline', 'margin')) {
        $subheadline_div     = '<div style="margin-left:' . $margin . ';">';
        $subheadline_div_end = '</div>';
    } else {
        $subheadline_div     = '';
        $subheadline_div_end = '';
    }
    if ($margin = $module->config->getValue('List', 'margin')) {
        $list_div     = '<div style="margin-left:' . $margin . ';">';
        $list_div_end = '</div>';
    } else {
        $list_div     = '';
        $list_div_end = '';
    }

    $types = array();
    $semclass = $module->config->getValue('PersondetailsLectures', 'semclass');
    if (is_null($semclass)) {
        $semclass = array(1);
    }
    foreach ($GLOBALS['SEM_TYPE'] as $key => $type) {
        if (in_array($type['class'], $semclass)) {
            $types[] = $key;
        }
    }

    $switch_time = mktime(0, 0, 0, date('m'),
            date('d') + 7 * $module->config->getValue('PersondetailsLectures', 'semswitch'), date('Y'));
    // get current semester
    $current_sem = get_sem_num($switch_time) + 1;

    switch ($module->config->getValue('PersondetailsLectures', 'semstart')) {
        case 'previous':
            if (isset($all_semester[$current_sem - 1])) {
                $current_sem -= 1;
            }
            break;
        case 'next':
            if (isset($all_semester[$current_sem + 1])) {
                $current_sem += 1;
            }
            break;
        case 'current':
            break;
        default:
            if (isset($all_semester[$module->config->getValue('PersondetailsLectures', 'semstart')])) {
                $current_sem = $module->config->getValue('PersondetailsLectures', 'semstart');
            }
    }

    $last_sem = $current_sem + $module->config->getValue('PersondetailsLectures', 'semrange') - 1;
    if ($last_sem < $current_sem) {
        $last_sem = $current_sem;
    }
    if (!isset($all_semester[$last_sem])) {
        $last_sem = count($all_semester) - 1;
    }

    $query = "SELECT *
              FROM seminar_user AS su
              LEFT JOIN seminare AS s USING (seminar_id)
              WHERE user_id = :user_id AND su.status = 'dozent'
                AND start_time <= :beginn AND (:beginn <= start_time + duration_time OR duration_time = -1)
                AND s.status IN (:types) AND s.visible = 1";
    if (Config::get()->IMPORTANT_SEMNUMBER) {
        $query .= " ORDER BY s.`VeranstaltungsNummer`, s.`Name`";
    } else {
        $query .= " ORDER BY s.`Name`";
    }
    $statement = DBManager::get()->prepare($query);
    $statement->bindValue(':user_id', $row['user_id']);
    $statement->bindValue(':types', $types ?: '');

    $out = '';
    for (;$current_sem <= $last_sem; $last_sem--) {
        $statement->bindValue(':beginn', $all_semester[$last_sem]['beginn']);
        $statement->execute();
        $data = $statement->fetchAll(PDO::FETCH_ASSOC);

        if (count($data) > 0) {
            if (!($module->config->getValue("PersondetailsLectures", "semstart") == "current"
                    && $module->config->getValue("PersondetailsLectures", "semrange") == 1)) {
                $out .= "<tr" . $module->config->getAttributes("TableParagraphSubHeadline", "tr") . ">";
                $out .= "<td" . $module->config->getAttributes("TableParagraphSubHeadline", "td") . ">";
                $out .= $subheadline_div;
                $out .= "<font" . $module->config->getAttributes("TableParagraphSubHeadline", "font") . ">";
                $month = date("n", $all_semester[$last_sem]['beginn']);
                if($month > 9) {
                    $out .= $module->config->getValue("PersondetailsLectures", "aliaswise");
                    $out .= date(" Y/", $all_semester[$last_sem]['beginn']) . date("y", $all_semester[$last_sem]['ende']);
                }
                else if($month > 3 && $month < 10) {
                    $out .= $module->config->getValue("PersondetailsLectures", "aliassose");
                    $out .= date(" Y", $all_semester[$last_sem]['beginn']);
                }
                $out .= "</font>$subheadline_div_end</td></tr>\n";
            }

            $out .= "<tr" . $module->config->getAttributes("TableParagraphText", "tr") . ">";
            $out .= "<td" . $module->config->getAttributes("TableParagraphText", "td") . ">";

            if ($module->config->getValue("PersondetailsLectures", "aslist")) {
                $out .= "$list_div<ul" . $module->config->getAttributes("List", "ul") . ">\n";
                foreach ($data as $item) {
                    $out .= "<li" . $module->config->getAttributes("List", "li") . ">";
                    $name = $item['Name'];
                    if (Config::get()->IMPORTANT_SEMNUMBER && $item['VeranstaltungsNummer']) {
                        $name = $item['VeranstaltungsNummer'].' '.$name;
                    }
                    $out .= $module->elements["LinkIntern"]->toString(array("module" => "Lecturedetails",
                            "link_args" => "seminar_id=" . $item['Seminar_id'],
                            "content" => htmlReady($name, TRUE)));
                    if ($item['Untertitel'] != '') {
                        $out .= "<font" . $module->config->getAttributes("TableParagraphText", "font") . "><br>";
                        $out .= htmlReady($item['Untertitel'], TRUE) . "</font>\n";
                    }
                }
                $out .= "</ul>$list_div_end";
            }
            else {
                $out .= $text_div;
                $j = 0;
                foreach ($data as $item) {
                    if ($j) {
                        $out .= '<br>';
                    }
                    $out .= $module->elements['LinkIntern']->toString(array('module' => 'Lecturedetails',
                            'link_args' => 'seminar_id=' . $item['Seminar_id'],
                            'content' => htmlReady($item['Name'], TRUE)));
                    if ($item['Untertitel'] != '') {
                        $out .= "<font" . $module->config->getAttributes("TableParagraphText", "font") . ">";
                        $out .= "<br>" . htmlReady($item['Untertitel'], TRUE) . "</font>\n";
                    }
                    $j = 1;
                }
                $out .= $text_div_end;
            }
            $out .= "</td></tr>\n";
        }
    }

    if ($out) {
        $out_title = '<tr><td width="100%">' . "\n";
        $out_title .= '<table' . $module->config->getAttributes('TableParagraph', 'table') . '>' . "\n";
        $out_title .= '<tr' . $module->config->getAttributes('TableParagraphHeadline', 'tr') . '>';
        $out_title .= '<td' . $module->config->getAttributes('TableParagraphHeadline', 'td') . '>';
        $out_title .= '<font' . $module->config->getAttributes('TableParagraphHeadline', 'font') . '>';
        $out_title .= $alias_content . '</font></td></tr>' . "\n";
        echo $out_title . $out;
        echo '</table>' . "\n";
        echo '</td></tr>' . "\n";
    }
}
Пример #6
0
function lehre (&$module, $data, $alias_content, $text_div, $text_div_end) {
    global $attr_text_td;
    $semester = new SemesterData;
    $all_semester = $semester->getAllSemesterData();
    // old hard coded $SEMESTER-array starts with index 1
    array_unshift($all_semester, 0);

    if ($margin = $module->config->getValue("TableParagraphSubHeadline", "margin")) {
        $subheadline_div = "<div style=\"margin-left:$margin;\">";
        $subheadline_div_end = "</div>";
    }
    else {
        $subheadline_div = "";
        $subheadline_div_end = "";
    }
    if ($margin = $module->config->getValue("List", "margin")) {
        $list_div = "<div style=\"margin-left:$margin;\">";
        $list_div_end = "</div>";
    }
    else {
        $list_div = "";
        $list_div_end = "";
    }
    // sem-types in class 1 (Lehre)
    foreach ($GLOBALS["SEM_TYPE"] as $key => $type) {
        if ($type["class"] == 1)
            $types[] = $key;
    }
    $types = implode("','", $types);


    $switch_time = mktime(0, 0, 0, date("m"),
            date("d") + 7 * $module->config->getValue("PersondetailsLectures", "semswitch"), date("Y"));
    // get current semester
    $current_sem = get_sem_num($switch_time) + 1;

    switch ($module->config->getValue("PersondetailsLectures", "semstart")) {
        case "previous" :
            if (isset($all_semester[$current_sem - 1]))
                $current_sem--;
            break;
        case "next" :
            if (isset($all_semester[$current_sem + 1]))
                $current_sem++;
            break;
        case "current" :
            break;
        default :
            if (isset($all_semester[$module->config->getValue("PersondetailsLectures", "semstart")]))
                $current_sem = $module->config->getValue("PersondetailsLectures", "semstart");
    }

    $last_sem = $current_sem + $module->config->getValue("PersondetailsLectures", "semrange") - 1;
    if ($last_sem < $current_sem)
        $last_sem = $current_sem;
    if (!isset($all_semester[$last_sem]))
        $last_sem = sizeof($all_semester) - 1;

    $out = "";
    for (;$current_sem <= $last_sem; $last_sem--) {
        if (!($module->config->getValue("PersondetailsLectures", "semstart") == "current"
                && $module->config->getValue("PersondetailsLectures", "semrange") == 1)) {
            $out .= "<tr" . $module->config->getAttributes("TableParagraphSubHeadline", "tr") . ">";
            $out .= "<td" . $module->config->getAttributes("TableParagraphSubHeadline", "td") . ">";
            $out .= $subheadline_div;
            $out .= "<font" . $module->config->getAttributes("TableParagraphSubHeadline", "font") . ">";
            $month = date("n", $all_semester[$last_sem]["beginn"]);
            if($month > 9) {
                $out .= $module->config->getValue("PersondetailsLectures", "aliaswise");
                $out .= date(" Y/", $all_semester[$last_sem]["beginn"]) . date("y", $all_semester[$last_sem]["ende"]);
            }
            else if($month > 3 && $month < 10) {
                $out .= $module->config->getValue("PersondetailsLectures", "aliassose");
                $out .= date(" Y", $all_semester[$last_sem]["beginn"]);
            }
            $out .= "</font>$subheadline_div_end</td></tr>\n";
        }

        $out .= "<tr" . $module->config->getAttributes("TableParagraphText", "tr") . ">";
        $out .= "<td" . $module->config->getAttributes("TableParagraphText", "td") . ">";

        if ($module->config->getValue("PersondetailsLectures", "aslist")) {
            $out .= "$list_div<ul" . $module->config->getAttributes("List", "ul") . ">\n";
            foreach ($data as $dat) {
                $out .= "<li" . $module->config->getAttributes("List", "li") . ">";
                $out .= "<font" . $module->config->getAttributes("LinkIntern", "font") . ">";
                $out .= "<a href=\"\"" . $module->config->getAttributes("LinkIntern", "a") . ">";
                $out .= $dat["name"] . "</a></font>\n";
                $out .= "<font" . $module->config->getAttributes("TableParagraphText", "font") . "><br>";
                $out .= $dat["untertitel"] . "</font>\n";
            }
            $out .= "</ul>$list_div_end";
        }
        else {
            $out .= $text_div;
            $j = 0;
            foreach ($data as $dat) {
                if ($j) $out .= "<br><br>";
                $out .= "<font" . $module->config->getAttributes("LinkIntern", "font") . ">";
                $out .= "<a href=\"$lnk\"" . $module->config->getAttributes("LinkIntern", "a") . ">";
                $out .= $dat["name"] . "</a></font>\n";
                $out .= "<font" . $module->config->getAttributes("TableParagraphText", "font") . ">";
                $out .= "<br>" . $dat["untertitel"] . "</font>\n";
                $j = 1;
            }
            $out .= $text_div_end;
        }
        $out .= "</td></tr>\n";
    }

    if ($out) {
        $out_title = "<tr><td width=\"100%\">\n";
        $out_title .= "<table" . $module->config->getAttributes("TableParagraph", "table") . ">\n";
        $out_title .= "<tr" . $module->config->getAttributes("TableParagraphHeadline", "tr") . ">";
        $out_title .= "<td" . $module->config->getAttributes("TableParagraphHeadline", "td") . ">";
        $out_title .= "<font" . $module->config->getAttributes("TableParagraphHeadline", "font") . ">";
        $out_title .= $alias_content . "</font></td></tr>\n";
        echo $out_title . $out . "</table>\n</td></tr>\n";
    }
}