• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_object_type函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_object_type函数的典型用法代码示例。如果您正苦于以下问题:PHP get_object_type函数的具体用法?PHP get_object_type怎么用?PHP get_object_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_object_type函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($range_id){
     $this->range_id = $range_id;
     $this->range_type = get_object_type($range_id);
     $object_name = get_object_name($range_id, $this->range_type);
     $this->range_name = $object_name['type'] . ": " . $object_name['name'];
     $this->createGroups();
 }
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:ResourcesOpenObjectGroups.class.php


示例2: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     Navigation::activateItem('/course/admin/admission');
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(403);
     }
     $this->course = Course::find($this->course_id);
     $this->user_id = $GLOBALS['user']->id;
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenZugangsberechtigungen");
     PageLayout::setTitle($this->course->getFullname() . " - " . _("Verwaltung von Zugangsberechtigungen"));
     $lockrules = words('admission_turnout admission_type admission_endtime admission_binding passwort read_level write_level admission_prelim admission_prelim_txt admission_starttime admission_endtime_sem admission_disable_waitlist user_domain admission_binding admission_studiengang');
     foreach ($lockrules as $rule) {
         $this->is_locked[$rule] = LockRules::Check($this->course_id, $rule) ? 'disabled readonly' : '';
     }
     if (!SeminarCategories::GetByTypeId($this->course->status)->write_access_nobody) {
         $this->is_locked['write_level'] = 'disabled readonly';
     }
     update_admission($this->course->id);
     PageLayout::addSqueezePackage('admission');
     URLHelper::addLinkParam('return_to_dialog', Request::get('return_to_dialog'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:28,代码来源:admission.php


示例3: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     global $perm;
     parent::before_filter($action, $args);
     if (Request::get('termin_id')) {
         $this->dates[0] = new SingleDate(Request::option('termin_id'));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (Request::get('issue_id')) {
         $this->issue_id = Request::option('issue_id');
         $this->dates = array_values(array_map(function ($data) {
             $d = new SingleDate();
             $d->fillValuesFromArray($data);
             return $d;
         }, IssueDB::getDatesforIssue(Request::option('issue_id'))));
         $this->course_id = $this->dates[0]->range_id;
     }
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen");
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _("Veranstaltungstermine absagen"));
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:35,代码来源:cancel_dates.php


示例4: getTabNavigation

 function getTabNavigation($course_id)
 {
     $object_type = get_object_type($course_id, array('sem', 'inst'));
     if ($object_type === 'sem') {
         $course = Course::find($course_id);
         $sem_class = $GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$course->status]['class']] ?: SemClass::getDefaultSemClass();
     } else {
         $institute = Institute::find($course_id);
         $sem_class = SemClass::getDefaultInstituteClass($institute->type);
     }
     $navigation = new Navigation(_('Übersicht'));
     $navigation->setImage(Icon::create('seminar', 'info_alt'));
     $navigation->setActiveImage(Icon::create('seminar', 'info'));
     if ($object_type !== 'sem') {
         $navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/institute/overview'));
         $navigation->addSubNavigation('courses', new Navigation(_('Veranstaltungen'), 'show_bereich.php?level=s&id=' . $course_id));
         $navigation->addSubNavigation('schedule', new Navigation(_('Veranstaltungs-Stundenplan'), 'dispatch.php/calendar/instschedule?cid=' . $course_id));
         if ($GLOBALS['perm']->have_studip_perm('admin', $course_id)) {
             $navigation->addSubNavigation('admin', new Navigation(_('Administration der Einrichtung'), 'dispatch.php/institute/basicdata/index?new_inst=TRUE'));
         }
     } else {
         $navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/course/overview'));
         if (!$sem_class['studygroup_mode']) {
             $navigation->addSubNavigation('details', new Navigation(_('Details'), 'dispatch.php/course/details/'));
         }
         if (!$course->admission_binding && in_array($GLOBALS['perm']->get_studip_perm($course_id), array('user', 'autor'))) {
             $navigation->addSubNavigation('leave', new Navigation(_('Austragen aus der Veranstaltung'), 'dispatch.php/my_courses/decline/' . $course_id . '?cmd=suppose_to_kill'));
         }
     }
     return array('main' => $navigation);
 }
开发者ID:ratbird,项目名称:hope,代码行数:31,代码来源:CoreOverview.class.php


示例5: getRangename

 /**
  * Gets the name of the range. Copied somewhere from Stud.IP...
  * @access  public
  * @param   string   $rangeID         the rangeID
  * @param   boolean  $html_decode     (optional)
  * @return  string                    The name of the range
  */
 function getRangename($rangeID, $html_decode = true)
 {
     global $user;
     if ($rangeID == "studip") {
         return _("Systemweite Evaluationen");
     }
     $o_type = get_object_type($rangeID, array('sem', 'user', 'inst'));
     if (in_array($o_type, array('sem', 'inst', 'fak'))) {
         $name = getHeaderLine($rangeID);
         if ($name != NULL) {
             if ($html_decode) {
                 $rangename = decodeHTML($name);
             } else {
                 $rangename = $name;
             }
         } else {
             $rangename = _("Kein Titel gefunden.");
         }
         return $rangename;
     }
     if ($o_type != 'user') {
         $user_id = get_userid($rangeID);
     } else {
         $user_id = $rangeID;
     }
     if ($user_id != $user->id) {
         $rangename = _("Profil: ") . get_fullname($user_id, 'full', 1) . " (" . get_username($user_id) . ")";
     } else {
         $rangename = _("Profil");
     }
     return $rangename;
 }
开发者ID:ratbird,项目名称:hope,代码行数:39,代码来源:EvaluationObjectDB.class.php


示例6: setVisit

 /**
  * Set the seminar denoted by the passed id as visited by the currently 
  * logged in user
  * 
  * @param string $seminar_id
  */
 static function setVisit($seminar_id)
 {
     $type = get_object_type($seminar_id, words('fak inst sem'));
     if ($type === 'fak') {
         $type = 'inst';
     }
     if (self::getVisit($seminar_id) < object_get_visit($seminar_id, $type, false, false)) {
         self::setVisitdates($seminar_id);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:16,代码来源:ForumVisit.php


示例7: index_action

 /**
  * this action is the main action of the schedule-controller, setting the environment for the timetable,
  * accepting a comma-separated list of days.
  *
  * @param  string  a list of an arbitrary mix of the numbers 0-6, separated with a comma (e.g. 1,2,3,4,5 (for Monday to Friday, the default))
  */
 function index_action($days = false)
 {
     if ($GLOBALS['perm']->have_perm('admin')) {
         $inst_mode = true;
     }
     $my_schedule_settings = $GLOBALS['user']->cfg->SCHEDULE_SETTINGS;
     // set the days to be displayed
     if ($days === false) {
         if (Request::getArray('days')) {
             $this->days = array_keys(Request::getArray('days'));
         } else {
             $this->days = array(0, 1, 2, 3, 4, 5, 6);
         }
     } else {
         $this->days = explode(',', $days);
     }
     // try to find the correct institute-id
     $institute_id = Request::option('institute_id', $SessSemName[1] ? $SessSemName[1] : Request::option('cid', false));
     if (!$institute_id) {
         $institute_id = $GLOBALS['user']->cfg->MY_INSTITUTES_DEFAULT;
     }
     if (!$institute_id || in_array(get_object_type($institute_id), words('inst fak')) === false) {
         throw new Exception(sprintf(_('Kann Einrichtungskalendar nicht anzeigen!' . 'Es wurde eine ungültige Instituts-Id übergeben (%s)!', $institute_id)));
     }
     // load semester-data and current semester
     $semdata = new SemesterData();
     $this->semesters = $semdata->getAllSemesterData();
     if (Request::option('semester_id')) {
         $this->current_semester = $semdata->getSemesterData(Request::option('semester_id'));
     } else {
         $this->current_semester = $semdata->getCurrentSemesterData();
     }
     $this->entries = (array) CalendarInstscheduleModel::getInstituteEntries($GLOBALS['user']->id, $this->current_semester, 8, 20, $institute_id, $this->days);
     Navigation::activateItem('/course/main/schedule');
     PageLayout::setHelpKeyword('Basis.TerminkalenderStundenplan');
     PageLayout::setTitle($GLOBALS['SessSemName']['header_line'] . ' - ' . _('Veranstaltungs-Stundenplan'));
     $zoom = Request::int('zoom', 0);
     $this->controller = $this;
     $this->calendar_view = new CalendarWeekView($this->entries, 'instschedule');
     $this->calendar_view->setHeight(40 + 20 * $zoom);
     $this->calendar_view->setRange($my_schedule_settings['glb_start_time'], $my_schedule_settings['glb_end_time']);
     $this->calendar_view->groupEntries();
     // if enabled, group entries with same start- and end-date
     URLHelper::addLinkParam('zoom', $zoom);
     URLHelper::addLinkParam('semester_id', $this->current_semester['semester_id']);
     $style_parameters = array('whole_height' => $this->calendar_view->getOverallHeight(), 'entry_height' => $this->calendar_view->getHeight());
     $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root . '/views');
     PageLayout::addStyle($factory->render('calendar/stylesheet', $style_parameters));
     if (Request::option('printview')) {
         PageLayout::addStylesheet('print.css');
     } else {
         PageLayout::addStylesheet('print.css', array('media' => 'print'));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:60,代码来源:instschedule.php


示例8: before_filter

 /**
  * Common tasks for all actions
  *
  * @param String $action Called action
  * @param Array  $args   Possible arguments
  */
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$GLOBALS['perm']->have_studip_perm("tutor", $this->course_id)) {
         throw new Trails_Exception(400);
     }
     PageLayout::addSqueezePackage('raumzeit');
     PageLayout::setHelpKeyword('Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen');
     PageLayout::setTitle(Course::findCurrent()->getFullname() . " - " . _('Blockveranstaltungstermine anlegen'));
 }
开发者ID:ratbird,项目名称:hope,代码行数:18,代码来源:block_appointments.php


示例9: getNotificationObjects

 function getNotificationObjects($course_id, $since, $user_id)
 {
     $items = array();
     $type = get_object_type($course_id, array('sem', 'inst', 'fak'));
     if ($type == 'sem') {
         $query = 'SELECT wiki.*, seminare.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
             FROM wiki
             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 wiki.chdate > ?';
     } else {
         $query = 'SELECT wiki.*, Institute.Name, ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
             FROM wiki
             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 wiki.chdate > ?';
     }
     $wikipage_stmt = DBManager::get()->prepare("SELECT * FROM wiki\n            WHERE keyword = ? AND range_id = ?\n                AND version = ?");
     $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') {
             if ($row['version'] > 1) {
                 $summary = sprintf('%s hat im Wiki der Veranstaltung "%s" die Seite "%s" geändert.', $row['fullname'], $row['Name'], $row['keyword']);
             } else {
                 $summary = sprintf('%s hat im Wiki der Veranstaltung "%s" die Seite "%s" erstellt.', $row['fullname'], $row['Name'], $row['keyword']);
             }
         } else {
             if ($row['version'] > 1) {
                 $summary = sprintf('%s hat im Wiki der Einreichtung "%s" die Seite "%s" geändert.', $row['fullname'], $row['Name'], $row['keyword']);
             } else {
                 $summary = sprintf('%s hat im Wiki der Einreichtung "%s" die Seite "%s" erstellt.', $row['fullname'], $row['Name'], $row['keyword']);
             }
         }
         $content = '';
         if ($row['version'] > 1) {
             $wikipage_stmt->execute(array($row['keyword'], $row['range_id'], $row['version'] - 1));
             $old_page = $wikipage_stmt->fetch(PDO::FETCH_ASSOC);
             $content = '<table>' . do_diff($old_page['body'], $row['body']) . '</table>';
         } else {
             $content = wikiReady($row['body']);
         }
         $items[] = new ContentElement('Wiki: ' . $row['keyword'], $summary, $content, $row['user_id'], $row['fullname'], URLHelper::getLink('wiki.php', array('cid' => $row['range_id'], 'keyword' => $row['keyword'])), $row['chdate']);
     }
     return $items;
 }
开发者ID:ratbird,项目名称:hope,代码行数:53,代码来源:CoreWiki.class.php


示例10: before_filter

 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->institute_id = current($args);
     if ($this->institute_id === '' || !in_array(get_object_type($this->institute_id), words('inst fak')) || !$GLOBALS['perm']->have_studip_perm("admin", $this->institute_id)) {
         $this->set_status(403);
         return FALSE;
     }
     $this->body_id = 'custom_avatar';
     PageLayout::setTitle(getHeaderLine($this->institute_id) . ' - ' . _('Bild ändern'));
     Navigation::activateItem('/admin/institute/details');
     # choose base layout w/o infobox and set tabs
     $layout = $GLOBALS['template_factory']->open('layouts/base_without_infobox');
     $this->set_layout($layout);
 }
开发者ID:ratbird,项目名称:hope,代码行数:15,代码来源:avatar.php


示例11: StudipDocumentTree

    /**
    * constructor
    *
    * do not use directly, call TreeAbstract::GetInstance("StudipDocumentTree")
    * @access private
    */ 
    function StudipDocumentTree($args)
    {
        DbView::addView('core');

        $this->range_id = $args['range_id'];
        $this->entity_type = $args['entity_type'] ?: get_object_type($this->range_id);
        if ($args['get_root_name']) {
            list($name,) = array_values(get_object_name($this->range_id, $this->entity_type));
        }
        $this->root_name = $name;
        $this->must_have_perm = $this->entity_type == 'sem' ? 'tutor' : 'autor';
        $modules = new Modules();
        $this->permissions_activated = $modules->getStatus('documents_folder_permissions', $this->range_id, $this->entity_type);
        parent::TreeAbstract(); //calling the baseclass constructor 
        $this->tree_data['root']['permission'] = $this->default_perm;
    }
开发者ID:ratbird,项目名称:hope,代码行数:22,代码来源:StudipDocumentTree.class.php


示例12: before_filter

 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $course_id = Request::option('cid');
     if (isset($_SESSION['seminar_change_view_' . $course_id])) {
         unset($_SESSION['seminar_change_view_' . $course_id]);
         // Reset simulated view, redirect to administration page.
         $this->redirect(URLHelper::getURL('dispatch.php/course/management'));
     } elseif (get_object_type($course_id, array('sem')) && !SeminarCategories::GetBySeminarId($course_id)->studygroup_mode && in_array($GLOBALS['perm']->get_studip_perm($course_id), words('tutor dozent'))) {
         // Set simulated view, redirect to overview page.
         $_SESSION['seminar_change_view_' . $course_id] = 'autor';
         $this->redirect(URLHelper::getURL('seminar_main.php'));
     } else {
         throw new Trails_Exception(400);
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:16,代码来源:change_view.php


示例13: before_filter

 /**
  * common tasks for all actions
  */
 function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     $this->course_id = $args[0];
     if (!in_array($action, words('apply claim delete order_down order_up'))) {
         $this->redirect($this->url_for('/apply/' . $action));
         return false;
     }
     if (!get_object_type($this->course_id, array('sem'))) {
         throw new Trails_Exception(400);
     }
     $course = Seminar::GetInstance($this->course_id);
     $enrolment_info = $course->getEnrolmentInfo($GLOBALS['user']->id);
     //Ist bereits Teilnehmer/Admin/freier Zugriff -> gleich weiter
     if ($enrolment_info['enrolment_allowed'] && (in_array($enrolment_info['cause'], words('root courseadmin member')) || $enrolment_info['cause'] == 'free_access' && $GLOBALS['user']->id == 'nobody')) {
         $redirect_url = UrlHelper::getUrl('seminar_main.php', array('auswahl' => $this->course_id));
         if (Request::isXhr()) {
             $this->response->add_header('X-Location', $redirect_url);
             $this->render_nothing();
         } else {
             $this->redirect($redirect_url);
         }
         return false;
     }
     //Grundsätzlich verboten
     if (!$enrolment_info['enrolment_allowed']) {
         throw new AccessDeniedException($enrolment_info['description']);
     }
     PageLayout::setTitle($course->getFullname() . " - " . _("Veranstaltungsanmeldung"));
     PageLayout::addSqueezePackage('enrolment');
     if (Request::isXhr()) {
         $this->set_layout(null);
         $this->response->add_header('X-No-Buttons', 1);
         $this->response->add_header('X-Title', PageLayout::getTitle());
         $request = Request::getInstance();
         foreach ($request as $key => $value) {
             $request[$key] = studip_utf8decode($value);
         }
     } else {
         $this->set_layout($GLOBALS['template_factory']->open('layouts/base'));
     }
     $this->set_content_type('text/html;charset=windows-1252');
     if (Request::submitted('cancel')) {
         $this->redirect(URLHelper::getURL('dispatch.php/course/details/', array('sem_id' => $this->course_id)));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:49,代码来源:enrolment.php


示例14: StudipLitList

    /**
    * constructor
    *
    * do not use directly, call TreeAbstract::GetInstance("StudipLitList", $range_id)
    * @access private
    */
    function StudipLitList($range_id) {
        DbView::addView('literatur');

        if ($GLOBALS['LIT_LIST_FORMAT_TEMPLATE']){
            $this->format_default = $GLOBALS['LIT_LIST_FORMAT_TEMPLATE'];
        }
        $this->range_id = $range_id;
        $this->range_type = get_object_type($range_id);
        if ($this->range_type == "user"){
            $this->root_name = get_fullname($range_id);
        } else {
            $object_name = get_object_name($range_id, $this->range_type);
            $this->root_name = $object_name['type'] . ": " . $object_name['name'];
        }
        $this->cat_element = new StudipLitCatElement();
        parent::TreeAbstract(); //calling the baseclass constructor
    }
开发者ID:ratbird,项目名称:hope,代码行数:23,代码来源:StudipLitList.class.php


示例15: getObjectRule

 /**
  * returns the lock rule object for the given id, else null
  * 
  * @param string $object_id id of course, institute or user
  * @param bool $renew if true, reloads the rule from database
  * @return LockRule 
  */
 public static function getObjectRule($object_id, $renew = false)
 {
     if (!array_key_exists($object_id, self::$lockmap) || $renew) {
         $object_type = get_object_type($object_id, words('sem inst user'));
         if ($object_type) {
             $methodmap = array('sem' => 'Seminar', 'inst' => 'Institute', 'fak' => 'Institute', 'user' => 'User');
             $lr = call_user_func(array('LockRule', 'FindBy' . $methodmap[$object_type]), $object_id);
             if ($lr) {
                 self::$lockmap[$object_id] = $lr->getId();
                 self::$lockrules[$lr->getId()] = $lr;
             } else {
                 self::$lockmap[$object_id] = null;
             }
         }
     }
     return self::$lockmap[$object_id] ? self::$lockrules[self::$lockmap[$object_id]] : null;
 }
开发者ID:ratbird,项目名称:hope,代码行数:24,代码来源:LockRules.class.php


示例16: before_filter

 /**
  * Common tasks for all actions
  *
  * @param String $action Called action
  * @param Array  $args   Possible arguments
  */
 public function before_filter(&$action, &$args)
 {
     global $perm;
     $this->current_action = $action;
     parent::before_filter($action, $args);
     $course_id = $args[0];
     $this->course_id = Request::option('cid', $course_id);
     if ($course_id != '-') {
         //Navigation in der Veranstaltung:
         Navigation::activateItem('/course/admin/room_requests');
         if (!get_object_type($this->course_id, array('sem')) || SeminarCategories::GetBySeminarId($this->course_id)->studygroup_mode || !$perm->have_studip_perm("tutor", $this->course_id)) {
             throw new Trails_Exception(400);
         }
         PageLayout::setHelpKeyword("Basis.VeranstaltungenVerwaltenAendernVonZeitenUndTerminen");
         PageLayout::setTitle(Course::find($this->course_id)->getFullname() . " - " . _("Verwaltung von Raumanfragen"));
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:23,代码来源:room_requests.php


示例17: getTabNavigation

 function getTabNavigation($course_id)
 {
     if (get_config('LITERATURE_ENABLE')) {
         $object_type = get_object_type($course_id);
         $navigation = new Navigation(_('Literatur'));
         $navigation->setImage(Icon::create('literature', 'info_alt'));
         $navigation->setActiveImage(Icon::create('literature', 'info'));
         $navigation->addSubNavigation('view', new Navigation(_('Literatur'), "dispatch.php/course/literature?view=literatur_" . $object_type));
         if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) {
             $navigation->addSubNavigation('edit', new Navigation(_('Literatur bearbeiten'), 'dispatch.php/literature/edit_list?view=literatur_' . $object_type . '&new_' . $object_type . '=TRUE&_range_id=' . $course_id));
             $navigation->addSubNavigation('search', new Navigation(_('Literatur suchen'), 'dispatch.php/literature/search?return_range=' . $course_id));
         }
         return array('literature' => $navigation);
     } else {
         return null;
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:17,代码来源:CoreLiterature.class.php


示例18: getNotificationObjects

 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;
 }
开发者ID:ratbird,项目名称:hope,代码行数:40,代码来源:CoreDocuments.class.php


示例19: display_action

 /**
  * Widget controller to produce the formally known show_votes()
  *
  * @param String $range_id range id (or array of range ids) of the news to get displayed
  * @return array() Array of votes
  */
 function display_action($range_id, $timespan = 604800, $start = null)
 {
     // Fetch time if needed
     $this->start = $start ?: strtotime('today');
     $this->timespan = $timespan;
     // To array fallback of $range_id
     if (!is_array($range_id)) {
         $this->single = true;
         $range_id = array($range_id);
     }
     foreach ($range_id as $id) {
         switch (get_object_type($id, array('user', 'sem'))) {
             case 'user':
                 $this->parseUser($id);
                 $this->userRange = true;
                 break;
             case 'sem':
                 $this->parseSeminar($id);
                 break;
         }
     }
     // Check permission to edit
     if ($this->single) {
         $this->admin = $range_id[0] == $GLOBALS['user']->id || get_object_type($range_id[0], array('sem')) === 'sem' && $GLOBALS['perm']->have_studip_perm('tutor', $range_id[0]);
         // Set range_id
         $this->range_id = $range_id[0];
     }
     // Forge title
     if ($this->termine) {
         $this->title = sprintf(_("Termine für die Zeit vom %s bis zum %s"), strftime("%d. %B %Y", $this->start), strftime("%d. %B %Y", $this->start + $this->timespan));
     } else {
         $this->title = _('Termine');
     }
     // Check out if we are on a profile
     if ($this->admin) {
         $this->isProfile = $this->single && $this->userRange;
     }
 }
开发者ID:ratbird,项目名称:hope,代码行数:44,代码来源:contentbox.php


示例20: getNotificationObjects

 function getNotificationObjects($course_id, $since, $user_id)
 {
     $items = array();
     $type = get_object_type($course_id, array('sem', 'inst', 'fak'));
     // only show new participants for seminars, not for institutes
     if ($type != 'sem') {
         return $items;
     }
     $stmt = DBManager::get()->prepare('SELECT seminar_user.*, seminare.Name, seminare.status,
         ' . $GLOBALS['_fullname_sql']['full'] . ' as fullname
         FROM seminar_user
         JOIN auth_user_md5 USING (user_id)
         JOIN user_info USING (user_id)
         JOIN seminare USING (Seminar_id)
         WHERE Seminar_id = ? 
             AND seminar_user.mkdate > ?');
     $stmt->execute(array($course_id, $since));
     while ($row = $stmt->fetch()) {
         $summary = sprintf('%s ist der Veranstaltung "%s" beigetreten.', $row['fullname'], $row['Name']);
         $items[] = new ContentElement('Studiengruppe: Neue/r Teilnehmer/in', $summary, '', $row['user_id'], $row['fullname'], URLHelper::getLink('seminar_main.php?auswahl=' . $row['Seminar_id'] . '&redirect_to=dispatch.php/course/member'), $row['mkdate']);
     }
     return $items;
 }
开发者ID:ratbird,项目名称:hope,代码行数:23,代码来源:CoreParticipants.class.php



注:本文中的get_object_type函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_object_vars函数代码示例发布时间:2022-05-15
下一篇:
PHP get_object_term_cache函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap