function before_filter(&$action, &$args) { if (Request::option('auswahl')) { Request::set('cid', Request::option('auswahl')); } parent::before_filter($action, $args); checkObject(); $this->institute = Institute::findCurrent(); if (!$this->institute) { throw new CheckObjectException(_('Sie haben kein Objekt gewählt.')); } $this->institute_id = $this->institute->id; //set visitdate for institute, when coming from meine_seminare if (Request::option('auswahl')) { object_set_visit($this->institute_id, "inst"); } //gibt es eine Anweisung zur Umleitung? if (Request::get('redirect_to')) { $query_parts = explode('&', stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to')); list(, $where_to) = explode('=', array_shift($query_parts)); $new_query = $where_to . '?' . join('&', $query_parts); page_close(); $new_query = preg_replace('/[^:0-9a-z+_\\-.#?&=\\/]/i', '', $new_query); header('Location: ' . URLHelper::getURL($new_query, array('cid' => $this->institute_id))); die; } PageLayout::setHelpKeyword("Basis.Einrichtungen"); PageLayout::setTitle($this->institute->getFullName() . " - " . _("Kurzinfo")); Navigation::activateItem('/course/main/info'); }
/** * Displays a blubber-stream for a course. * @throws AccessDeniedException if user has no access to course */ public function forum_action() { object_set_visit($_SESSION['SessionSeminar'], "forum"); if ($GLOBALS['SessSemName']['class'] === "sem") { $seminar = new Seminar($_SESSION['SessionSeminar']); $this->commentable = $seminar->read_level == 0 || $GLOBALS['perm']->have_studip_perm("autor", $_SESSION['SessionSeminar']); } else { $this->commentable = true; } if (!$this->commentable) { throw new AccessDeniedException(); } PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . $this->plugin->getDisplayTitle()); Navigation::getItem("/course/blubberforum")->setImage(Icon::create('blubber', 'info')); Navigation::activateItem("/course/blubberforum"); $coursestream = BlubberStream::getCourseStream($_SESSION['SessionSeminar']); $this->tags = $coursestream->fetchTags(); if (Request::get("hash")) { $this->search = "#" . Request::get("hash"); $coursestream->filter_hashtags = array(Request::get("hash")); } $this->threads = $coursestream->fetchThreads(0, $this->max_threads + 1); $this->more_threads = count($this->threads) > $this->max_threads; $this->course_id = $_SESSION['SessionSeminar']; if ($this->more_threads) { $this->threads = array_slice($this->threads, 0, $this->max_threads); } }
public function forum_action() { object_set_visit($_SESSION['SessionSeminar'], "forum"); $seminar = new Seminar($_SESSION['SessionSeminar']); if ($seminar->read_level > 0 && !$GLOBALS['perm']->have_studip_perm("autor", $_SESSION['SessionSeminar'])) { throw new AccessDeniedException("Kein Zugriff"); } PageLayout::addHeadElement("script", array('src' => $this->assets_url . "/javascripts/autoresize.jquery.min.js"), ""); PageLayout::addHeadElement("script", array('src' => $this->assets_url . "/javascripts/blubberforum.js"), ""); PageLayout::addHeadElement("script", array('src' => $this->assets_url . "/javascripts/formdata.js"), ""); PageLayout::setTitle($GLOBALS['SessSemName']["header_line"] . " - " . $this->plugin->getDisplayTitle()); Navigation::getItem("/course/blubberforum")->setImage($this->plugin->getPluginURL() . "/assets/images/blubber.png"); Navigation::activateItem("/course/blubberforum"); $parameter = array('seminar_id' => $_SESSION['SessionSeminar'], 'limit' => $this->max_threads + 1); if (Request::get("hash")) { $this->search = "#" . Request::get("hash"); } if ($this->search) { $parameter['search'] = $this->search; } $this->threads = ForumPosting::getThreads($parameter); $this->more_threads = count($this->threads) > $this->max_threads; $this->course_id = $_SESSION['SessionSeminar']; if ($this->more_threads) { $this->threads = array_slice($this->threads, 0, $this->max_threads); } }
public function perform($unconsumed) { if ($unconsumed !== 'read_all') { return; } $global_news = StudipNews::GetNewsByRange('studip', true); foreach ($global_news as $news) { object_add_view($news['news_id']); object_set_visit($news['news_id'], 'news'); } if (Request::isXhr()) { echo json_encode(true); } else { PageLayout::postMessage(MessageBox::success(_('Alle Ankündigungen wurden als gelesen markiert.'))); header('Location: ' . URLHelper::getLink('dispatch.php/start')); } }
/** * This function "opens" an institute to work with it. Does the same * as selectInst() but also sets the visit date. * * @param string $inst_id the id of the institute * * @return boolean true if successful */ function openInst($inst_id) { if ($result = selectInst($inst_id)) { object_set_visit($inst_id, "inst"); } return $result; }
function visit() { if ($GLOBALS['user']->id && $GLOBALS['user']->id != 'nobody' && Request::option('contentbox_open') && in_array(Request::option('contentbox_type'), words('vote eval'))) { object_set_visit(Request::option('contentbox_open'), Request::option('contentbox_type')); } }
/** * This function reset all visits on every available modules * @param $object * @param $object_id * @param $user_id * @return bool */ public static function setObjectVisits(&$object, $object_id, $user_id, $timestamp = null) { // load plugins, so they have a chance to register themselves as observers PluginEngine::getPlugins('StandardPlugin'); $query = "INSERT INTO object_user_visits\n (object_id, user_id, type, visitdate, last_visitdate)\n (\n SELECT news_id, :user_id, 'news', :timestamp, 0\n FROM news_range\n WHERE range_id = :id\n ) UNION (\n SELECT vote_id, :user_id, 'vote', :timestamp, 0\n FROM vote\n WHERE range_id = :id\n ) UNION (\n SELECT eval_id, :user_id, 'eval', :timestamp, 0\n FROM eval_range\n WHERE range_id = :id\n )\n ON DUPLICATE KEY UPDATE last_visitdate = IFNULL(visitdate, 0), visitdate = :timestamp"; $statement = DBManager::get()->prepare($query); $statement->bindValue(':user_id', $user_id); $statement->bindValue(':timestamp', $timestamp ?: time()); // Update all activated modules foreach (words('forum documents schedule participants literature wiki scm elearning_interface') as $type) { if ($object['modules'][$type]) { object_set_visit($object_id, $type); } } // Update news, votes and evaluations $statement->bindValue('id', $object_id); $statement->execute(); // Update object itself object_set_visit($object_id, $object['obj_type']); return true; }
function visit() { if ($GLOBALS['user']->id && $GLOBALS['user']->id != 'nobody' && Request::option('contentbox_open') && Request::option('contentbox_type') === 'news') { object_add_view(Request::option('contentbox_open')); object_set_visit(Request::option('contentbox_open'), 'news'); //and, set a visittime } }
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ require '../lib/bootstrap.php'; ob_start(); page_open(array("sess" => "Seminar_Session", "auth" => "Seminar_Default_Auth", "perm" => "Seminar_Perm", "user" => "Seminar_User")); $auth->login_if(Request::get('again') && $auth->auth["uid"] == "nobody"); if (Request::option('auswahl')) { Request::set('cid', Request::option('auswahl')); } include 'lib/seminar_open.php'; // initialise Stud.IP-Session // -- here you have to put initialisations for the current page $course_id = $_SESSION['SessionSeminar']; //set visitdate for course, when coming from my_courses if (Request::get('auswahl')) { object_set_visit($course_id, "sem"); } // gibt es eine Anweisung zur Umleitung? if (Request::get('redirect_to')) { $query_parts = explode('&', stristr(urldecode($_SERVER['QUERY_STRING']), 'redirect_to')); list(, $where_to) = explode('=', array_shift($query_parts)); $new_query = $where_to . '?' . join('&', $query_parts); $new_query = preg_replace('/[^:0-9a-z+_\\-.#?&=\\/]/i', '', $new_query); header('Location: ' . URLHelper::getURL($new_query, array('cid' => $course_id))); die; } $sem_class = Seminar::getInstance($course_id)->getSemClass(); if ($sem_class->getSlotModule("overview")) { foreach ($sem_class->getNavigationForSlot("overview") as $nav) { header('Location: ' . URLHelper::getURL($nav->getURL())); die;
function object_set_visit_module($type){ global $SessSemName; if (object_get_visit($SessSemName[1], $type, false, false) < object_get_visit($SessSemName[1], $SessSemName['class'], false, false)){ object_set_visit($SessSemName[1], $type); } }