/**
  * @deprecated
  */
 function setNavigation(StudipPluginNavigation $navigation)
 {
     parent::setNavigation($navigation);
     if (Navigation::hasItem('/admin/plugins')) {
         Navigation::addItem('/admin/plugins/' . $this->getPluginclassname(), $navigation);
     }
 }
 public function __construct()
 {
     parent::__construct();
     if ($GLOBALS['perm']->have_perm("autor")) {
         $topicon = new Navigation(_("Lernmaterialien"), PluginEngine::getURL($this, array(), "market/overview"));
         $topicon->setImage(Icon::create('service', 'navigation'));
         Navigation::addItem("/lernmarktplatz", $topicon);
         Navigation::addItem("/lernmarktplatz/overview", new Navigation(_("Lernmarktplatz"), PluginEngine::getURL($this, array(), "market/overview")));
         Navigation::addItem("/lernmarktplatz/mymaterial", new Navigation(_("Meine Materialien"), PluginEngine::getURL($this, array(), "mymaterial/overview")));
     }
     if ($GLOBALS['perm']->have_perm("root")) {
         $tab = new Navigation(_("Lernmarktplatz"), PluginEngine::getURL($this, array(), "admin/hosts"));
         Navigation::addItem("/admin/config/lernmarktplatz", $tab);
     }
     if (UpdateInformation::isCollecting() && stripos(Request::get("page"), "plugins.php/lernmarktplatz/market/discussion/") !== false) {
         $data = Request::getArray("page_info");
         $last_update = Request::get("server_timestamp", time() - 30);
         $review_id = $data['Lernmarktplatz']['review_id'];
         $output = array('comments' => array());
         $comments = LernmarktplatzComment::findBySQL("review_id = :review_id AND mkdate >= :last_update ORDER BY mkdate ASC", array('last_update' => $last_update, 'review_id' => $review_id));
         $tf = new Flexi_TemplateFactory(__DIR__ . "/views");
         foreach ($comments as $comment) {
             $template = $tf->open("market/_comment.php");
             $template->set_attribute('comment', $comment);
             $output['comments'][] = array('comment_id' => $comment->getId(), 'html' => $template->render());
         }
         UpdateInformation::setInformation("Lernmarktplatz.update", $output);
     }
 }
Exemplo n.º 3
0
 function getTabNavigation($course_id)
 {
     if (TRUE) {
         $temp = ScmTabEntry::findByRange_id($course_id, 'ORDER BY position ASC');
         if ($temp) {
             $scms = SimpleORMapCollection::createFromArray($temp);
             $navigation = new Navigation($scms->first()->tab_name ?: _('Informationen'));
             $navigation->setImage('icons/16/white/infopage.png');
             $navigation->setActiveImage('icons/16/black/infopage.png');
             foreach ($scms as $scm) {
                 $scm_link = PluginEngine::getLink($this, array(), 'show/' . $scm->id);
                 $nav = new Navigation($scm['tab_name'], $scm_link);
                 $nav->setImage('icons/16/white/infopage.png');
                 $nav->setActiveImage('icons/16/black/infopage.png');
                 Navigation::addItem('course/scmTabs' . $scm->id, $nav);
             }
             return null;
             //array('scm' => $navigation);
         } else {
             $scm = new ScmTabEntry($id);
             $scm->tab_name = 'Infoseite';
             $scm->user_id = $GLOBALS['user']->id;
             $scm->range_id = $GLOBALS['SessSemName'][1];
             $scm->store();
             $scm_link = PluginEngine::getLink($this, array(), 'show/' . $scm->id);
             $nav = new Navigation($scm->tab_name, $scm_link);
             $nav->setImage('icons/16/white/infopage.png');
             $nav->setActiveImage('icons/16/black/infopage.png');
             Navigation::addItem('course/scmTabs' . $scm->id, $nav);
             return null;
         }
     } else {
         return null;
     }
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     $nav = new Navigation(_("Downloads"), PluginEngine::getURL($this, array(), "downloadarea/overview"));
     $nav->setImage(Icon::create("download", "navigation"));
     Navigation::addItem("/downloader", $nav);
 }
Exemplo n.º 5
0
 public function __construct()
 {
     parent::__construct();
     $top = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array('view' => 'tiles'), "presenting/overview"));
     $top->setImage(Icon::create($this->getPluginURL() . "/assets/topicon.svg"));
     $overview = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
     $top->addSubNavigation("presenting", $overview);
     $overview->addSubNavigation("overview", new AutoNavigation(_('Übersicht'), PluginEngine::getURL($this, array(), "presenting/overview")));
     $overview->addSubNavigation("all", new AutoNavigation(_('Alle Plugins'), PluginEngine::getURL($this, array(), "presenting/all")));
     $overview->addSubNavigation("tools", new AutoNavigation(_('Tools'), PluginEngine::getURL($this, array(), "tools/sidebar_graphics_generator")));
     if ($GLOBALS['perm']->have_perm("autor")) {
         $top->addSubNavigation("myplugins", new Navigation(_("Meine Plugins"), PluginEngine::getURL($this, array(), "myplugins/overview")));
     }
     if ($GLOBALS['perm']->have_perm("user")) {
         $last_visit = UserConfig::get($GLOBALS['user']->id)->getValue("last_pluginmarket_visit");
         if ($last_visit) {
             $badge_number = MarketPlugin::countBySql("publiclyvisible = 1 AND approved = 1 AND published > ?", array($last_visit));
             if ($badge_number > 0) {
                 $top->setBadgeNumber($badge_number);
             }
         }
     }
     if ($GLOBALS['perm']->have_perm("root")) {
         $approving = new Navigation(_("Qualitätssicherung"), PluginEngine::getURL($this, array(), "approving/overview"));
         $top->addSubNavigation("approving", $approving);
     }
     Navigation::addItem("/pluginmarket", $top);
     $loginlink = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "presenting/overview"));
     $loginlink->setDescription(_("Laden Sie hier Plugins für Ihr Stud.IP herunter"));
     Navigation::addItem("/login/pluginmarket", $loginlink);
     NotificationCenter::addObserver($this, "triggerFollowingStudips", "PluginReleaseDidUpdateCode");
 }
Exemplo n.º 6
0
 public function __construct()
 {
     parent::__construct();
     if ($GLOBALS['perm']->have_perm("root")) {
         $processes = FleximportProcess::findBySQL("1=1 ORDER BY name ASC");
         $navigation = new Navigation($this->getDisplayName());
         $navigation->setURL(PluginEngine::getURL($this, array(), 'import/overview' . (count($processes) ? "/" . $processes[0]['process_id'] : "")));
         Navigation::addItem('/start/fleximport', $navigation);
         Navigation::addItem('/fleximport', $navigation);
         if (count($processes)) {
             foreach ($processes as $process) {
                 $navigation = new Navigation($process['name'], PluginEngine::getURL($this, array(), 'import/overview/' . $process->getId()));
                 Navigation::addItem('/fleximport/process_' . $process->getId(), $navigation);
             }
         } else {
             $navigation = new Navigation(_("Import"), PluginEngine::getURL($this, array(), 'import/overview'));
             Navigation::addItem('/fleximport/overview', $navigation);
         }
         $navigation = new Navigation(_("Konfiguration"), PluginEngine::getURL($this, array(), 'config/overview'));
         Navigation::addItem('/fleximport/config', $navigation);
         if (FleximportConfig::get("DISPLAY_AT_HEADER")) {
             if (is_numeric(FleximportConfig::get("DISPLAY_AT_HEADER"))) {
                 Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create("install", "navigation") : Assets::image_path("icons/lightblue/install.svg"));
             } else {
                 Navigation::getItem('/fleximport')->setImage(version_compare($GLOBALS['SOFTWARE_VERSION'], "3.4", ">=") ? Icon::create(FleximportConfig::get("DISPLAY_AT_HEADER"), "navigation") : FleximportConfig::get("DISPLAY_AT_HEADER"));
             }
         }
     }
 }
 public function __construct()
 {
     parent::__construct();
     if ($GLOBALS['perm']->have_perm("root")) {
         $nav = new Navigation(_("Datenbank"), PluginEngine::getURL($this, array(), "database/overview"));
         Navigation::addItem("/admin/adminer", $nav);
     }
 }
Exemplo n.º 8
0
 public function __construct()
 {
     parent::__construct();
     $this->addStylesheet("assets/defaultform.less");
     $nav = new Navigation(_("DefaultForm"), PluginEngine::getURL($this, array(), "example/index"));
     Navigation::addItem("/start/defaultform", $nav);
     $nav = clone $nav;
     $nav->addSubNavigation("index", clone $nav);
     Navigation::addItem("/defaultform", $nav);
 }
 public function __construct()
 {
     parent::__construct();
     $this->raumbelegung = new raumbelegung();
     //Navigationselement AutoNavigation
     $navigation = new AutoNavigation($this->getDisplayName(), PluginEngine::getURL($this, array(), "show"));
     $tools = new AutoNavigation("Tools", PluginEngine::getURL($this, array(), "start"));
     //Punkt an dem das Elements eingesetzt werden soll
     Navigation::addItem('/start/Raumbelgungen/', clone $navigation);
 }
 /**
  * Sets the navigation of this plugin.
  *
  * @deprecated
  */
 function setNavigation(StudipPluginNavigation $navigation)
 {
     parent::setNavigation($navigation);
     // prepend copy of navigation to its sub navigation
     $item_names = array_keys($navigation->getSubNavigation());
     $navigation_copy = clone $navigation;
     $navigation_copy->clearSubmenu();
     $navigation_copy->freezeActivation();
     $navigation->insertSubNavigation('self', $navigation_copy, $item_names[0]);
     $navigation->setTitle($this->getDisplayTitle());
     // Check activation for user and display if appropriate.
     if (Navigation::hasItem('/profile') && is_object($this->getRequestedUser()) && $GLOBALS['perm']->have_profile_perm('user', $this->getRequestedUser()->getUserid()) && PluginManager::getInstance()->isPluginActivatedForUser($this->getPluginId(), $this->getRequestedUser()->getUserid())) {
         Navigation::addItem('/profile/' . $this->getPluginclassname(), $navigation);
     }
 }
 /**
  *
  **/
 public function __construct()
 {
     parent::__construct();
     $config = Config::getInstance();
     if (!$config['OAUTH_ENABLED']) {
         return;
     }
     if ($GLOBALS['perm']->have_perm('autor')) {
         $navigation = new AutoNavigation(_('Apps'));
         $navigation->setURL(PluginEngine::getLink($this, array(), 'user'));
         Navigation::addItem('/links/settings/oauth', $navigation);
     }
     if ($GLOBALS['perm']->have_perm('root')) {
         $navigation = new AutoNavigation(_('OAuth'));
         $navigation->setURL(PluginEngine::getLink($this, array(), 'admin'));
         Navigation::addItem('/admin/config/oauth', $navigation);
     }
 }
 function __construct()
 {
     parent::__construct();
     require_once 'polyfills/Button.php';
     require_once 'polyfills/LinkButton.php';
     PageLayout::addStylesheet($this->getPluginURL() . '/polyfills/buttons.css');
     $navigation = new AutoNavigation(_('Plugin-Generator'));
     $navigation->setURL(PluginEngine::GetLink($this, array(), ''));
     $navigation->setImage(Assets::image_path('icons/16/black/plugin.png'));
     Navigation::addItem('/tools/plugingenerator', $navigation);
     /*/
             $navigation = new AutoNavigation(_('Plugin-Generator'));
             $navigation->setURL(PluginEngine::GetLink($this, array(), ''));
             Navigation::addItem('/plugingenerator/index', $navigation);
     
             $navigation = new AutoNavigation(_('Tools'));
             $navigation->setURL(PluginEngine::GetLink($this, array(), 'tools'));
             Navigation::addItem('/plugingenerator/tools', $navigation);
     //*/
 }
Exemplo n.º 13
0
 public function before_filter(&$action, &$args)
 {
     parent::before_filter($action, $args);
     global $perm;
     if (Request::isXhr()) {
         $this->dialog = true;
     }
     PageLayout::setTitle(_('Neue Veranstaltung anlegen'));
     $navigation = new Navigation(_('Neue Veranstaltung anlegen'), 'dispatch.php/course/wizard');
     Navigation::addItem('/browse/my_courses/new_course', $navigation);
     Navigation::activateItem('/browse/my_courses/new_course');
     $this->sidebar = Sidebar::get();
     $this->sidebar->setImage('sidebar/seminar-sidebar.png');
     $this->sidebar->setTitle(_('Neue Veranstaltung anlegen'));
     $this->steps = CourseWizardStepRegistry::findBySQL("`enabled`=1 ORDER BY `number`");
     // Special handling for studygroups.
     if (Request::int('studygroup')) {
         $this->flash['studygroup'] = true;
     }
 }
Exemplo n.º 14
0
 private function setupNavigation()
 {
     global $perm;
     $cid = $this->getContext();
     if (Request::isXhr() || Navigation::hasItem('/course/cliqr') || !$this->isActivated($cid) || !$perm->have_studip_perm("tutor", $cid)) {
         return;
     }
     # /course/cliqr -> plugins.php/cliqrplugin/questions
     $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'questions', true);
     $navigation = new Navigation(_('Cliqr'), $url);
     $navigation->setImage(Assets::image_path('icons/16/white/test.png'));
     $navigation->setActiveImage(Assets::image_path('icons/16/black/test.png'));
     # /course/cliqr/index -> plugins.php/cliqrplugin/questions#index
     $navigation->addSubNavigation("index", new Navigation(_("Fragen"), $url . '#index'));
     # /course/cliqr/new -> plugins.php/cliqrplugin/questions#new
     $navigation->addSubNavigation("new", new Navigation(_("Frage erstellen"), $url . '#new'));
     # /course/cliqr/help -> plugins.php/cliqrplugin/help
     $url = PluginEngine::getURL('cliqrplugin', compact('cid'), 'help', true);
     $navigation->addSubNavigation("help", new Navigation(_("Methodische Informationen"), $url));
     Navigation::addItem('/course/cliqr', $navigation);
 }
 /**
  * define where the plugin will be visible (toolbar and/or start page)
  *
  * @deprecated
  */
 function setDisplayType($display_type)
 {
     $changes = $this->display_type ^ $display_type;
     $this->display_type = $display_type;
     if ($this->hasNavigation()) {
         if ($changes & SYSTEM_PLUGIN_TOOLBAR) {
             if ($this->getDisplayType(SYSTEM_PLUGIN_TOOLBAR)) {
                 Navigation::addItem('/' . $this->getPluginclassname(), $this->getNavigation());
             } else {
                 Navigation::removeItem('/' . $this->getPluginclassname());
             }
         }
         if ($changes & SYSTEM_PLUGIN_STARTPAGE) {
             if ($this->getDisplayType(SYSTEM_PLUGIN_STARTPAGE)) {
                 Navigation::insertItem('/start/' . $this->getPluginclassname(), $this->getNavigation(), 'search');
             } else {
                 Navigation::removeItem('/start/' . $this->getPluginclassname());
             }
         }
     }
 }
Exemplo n.º 16
0
 private function sortCourseNavigation()
 {
     global $perm;
     $restNavigation = array();
     $newNavigation = Navigation::getItem('/course');
     foreach (Navigation::getItem('/course') as $key => $tab) {
         $block = SeminarTab::findOneBySQL('seminar_id = ? AND tab IN (?) ORDER BY position ASC', array($this->getSeminarId(), $key));
         if ($block) {
             $tab->setTitle($block->getValue('title'));
             if ($block->getValue('tn_visible') == true || $perm->have_studip_perm('dozent', Request::get('cid'))) {
                 $subNavigations[$block->getValue('position')][$key] = $tab;
             }
         } else {
             //keine Info bezüglich Reihenfolge also hinten dran
             //greift bei neu aktivierten Navigationselementen
             $restNavigation[$key] = $tab;
         }
         $newNavigation->removeSubNavigation($key);
     }
     ksort($subNavigations);
     foreach ($subNavigations as $subNavs) {
         foreach ($subNavs as $key => $subNav) {
             $newNavigation->addSubNavigation($key, $subNav);
         }
     }
     if (count($restNavigation) > 0) {
         foreach ($restNavigation as $key => $restNav) {
             $newNavigation->addSubNavigation($key, $restNav);
         }
     }
     Navigation::addItem('/course', $newNavigation);
 }
Exemplo n.º 17
0
 public function details_action($plugin_id)
 {
     $this->marketplugin = MarketPlugin::find($plugin_id);
     if (!$this->marketplugin) {
         throw new Trails_Exception(404);
     }
     Navigation::addItem('/pluginmarket/presenting/details', new AutoNavigation(_('Details'), $this->url_for('presenting/details/' . $plugin_id)));
     PageLayout::setTitle($this->marketplugin->name . ' - ' . $this->plugin->getDisplayTitle());
     if (Request::isPost() && Request::submitted("delete_plugin") && $this->marketplugin->isRootable()) {
         $this->marketplugin->delete();
         PageLayout::postMessage(MessageBox::success(_("Plugin wurde gelöscht.")));
         $this->redirect('presenting/overview');
         return;
     }
     $this->marketplugin['rating'] = $this->marketplugin->calculateRating();
     $this->marketplugin->store();
     // Add actions widget
     $sidebar = Sidebar::Get();
     $actions = new ActionsWidget();
     $actions->addLink(_('Nutzung mitteilen'), $this->url_for('presenting/propose_usage/' . $this->marketplugin->id), Icon::create('add', "clickable"))->asDialog('size=auto');
     $sidebar->addWidget($actions);
 }
Exemplo n.º 18
0
 public function new_action($givenrubric = null)
 {
     if ($givenrubric === null) {
         Navigation::addItem('/footer/siteinfo/rubric_new', new AutoNavigation(_('Neue Rubrik'), $this->url_for('siteinfo/new')));
         $this->edit_rubric = true;
     } else {
         Navigation::addItem('/footer/siteinfo/' . $this->currentrubric . '/detail_new', new AutoNavigation(_('Neue Seite'), $this->url_for('siteinfo/new/' . $this->currentrubric)));
         $this->rubrics = $this->si->get_all_rubrics();
     }
 }
Exemplo n.º 19
0
 /**
  * Returns the formatted list of skip links
  *
  * @return string the formatted list of skip links
  */
 public static function getHTML()
 {
     $html = '';
     if (UserConfig::get($GLOBALS['user']->id)->getValue('SKIPLINKS_ENABLE') && $GLOBALS['auth']->is_authenticated() && sizeof(self::$links)) {
         Navigation::addItem('/skiplinks', new Navigation(''));
         uasort(self::$links, create_function('$a, $b', 'return $a["position"] > $b["position"];'));
         $i = 1;
         $position = 0;
         $overwriteable = false;
         foreach (self::$links as $link) {
             $navigation = new Navigation($link['name'], $link['url']);
             $path = '/skiplinks/' . $i++;
             Navigation::addItem($path, $navigation);
             $position = $link['position'];
             $overwriteable = $link['overwriteable'];
         }
         $navigation = Navigation::getItem('/skiplinks');
         $html = $GLOBALS['template_factory']->render('skiplinks', compact('navigation'));
     }
     return $html;
 }
Exemplo n.º 20
0
 /**
  * Constructor of Plugin : adds Navigation and collects information for javascript-update.
  */
 public function __construct()
 {
     parent::__construct();
     if (UpdateInformation::isCollecting()) {
         $data = Request::getArray("page_info");
         if (stripos(Request::get("page"), "plugins.php/blubber") !== false && isset($data['Blubber'])) {
             $output = array();
             switch ($data['Blubber']['stream']) {
                 case "global":
                     $stream = BlubberStream::getGlobalStream();
                     break;
                 case "course":
                     $stream = BlubberStream::getCourseStream($data['Blubber']['context_id']);
                     break;
                 case "profile":
                     $stream = BlubberStream::getProfileStream($data['Blubber']['context_id']);
                     break;
                 case "thread":
                     $stream = BlubberStream::getThreadStream($data['Blubber']['context_id']);
                     break;
                 case "custom":
                     $stream = new BlubberStream($data['Blubber']['context_id']);
                     break;
             }
             $last_check = $data['Blubber']['last_check'] ? $data['Blubber']['last_check'] : time() - 5 * 60;
             $new_postings = $stream->fetchNewPostings($last_check);
             $factory = new Flexi_TemplateFactory($this->getPluginPath() . "/views");
             foreach ($new_postings as $new_posting) {
                 if ($new_posting['root_id'] === $new_posting['topic_id']) {
                     $thread = $new_posting;
                     $template = $factory->open("streams/thread.php");
                     $template->set_attribute('thread', $new_posting);
                 } else {
                     $thread = new BlubberPosting($new_posting['root_id']);
                     $template = $factory->open("streams/comment.php");
                     $template->set_attribute('posting', $new_posting);
                 }
                 BlubberPosting::$course_hashes = $thread['user_id'] !== $thread['Seminar_id'] ? $thread['Seminar_id'] : false;
                 $template->set_attribute("course_id", $data['Blubber']['seminar_id']);
                 $output['postings'][] = array('posting_id' => $new_posting['topic_id'], 'discussion_time' => $new_posting['discussion_time'], 'mkdate' => $new_posting['mkdate'], 'root_id' => $new_posting['root_id'], 'content' => $template->render());
             }
             UpdateInformation::setInformation("Blubber.getNewPosts", $output);
             //Events-Queue:
             $db = DBManager::get();
             $events = $db->query("SELECT event_type, item_id " . "FROM blubber_events_queue " . "WHERE mkdate >= " . $db->quote($last_check) . " " . "ORDER BY mkdate ASC " . "")->fetchAll(PDO::FETCH_ASSOC);
             UpdateInformation::setInformation("Blubber.blubberEvents", $events);
             $db->exec("DELETE FROM blubber_events_queue " . "WHERE mkdate < UNIX_TIMESTAMP() - 60 * 60 * 6 " . "");
         }
     }
     if (Navigation::hasItem("/community")) {
         $nav = new Navigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "streams/global"));
         $nav->addSubNavigation("global", new AutoNavigation(_("Globaler Stream"), PluginEngine::getURL($this, array(), "streams/global")));
         foreach (BlubberStream::findMine() as $stream) {
             $url = PluginEngine::getURL($this, array(), "streams/custom/" . $stream->getId());
             $nav->addSubNavigation($stream->getId(), new AutoNavigation($stream['name'], $url));
             if ($stream['defaultstream']) {
                 $nav->setURL($url);
             }
         }
         $nav->addSubNavigation("add", new AutoNavigation(_("Neuen Stream erstellen"), PluginEngine::getURL($this, array(), "streams/edit")));
         Navigation::insertItem("/community/blubber", $nav, "online");
         Navigation::getItem("/community")->setURL($nav->getURL());
     }
     if (Navigation::hasItem("/profile") && $this->isActivated(get_userid(Request::username('username', $GLOBALS['auth']->auth['uname'])), 'user')) {
         $nav = new AutoNavigation(_("Blubber"), PluginEngine::getURL($this, array('user_id' => get_userid(Request::get("username"))), "streams/profile"));
         Navigation::addItem("/profile/blubber", $nav);
     }
 }
Exemplo n.º 21
0
 public function testNotificationOnActivation()
 {
     $navigation = new Navigation('test');
     Navigation::addItem('/test', $navigation);
     $observer = $this->getMock("NotificationObserver");
     $observer->expects($this->once())->method('update')->with($this->equalTo('NavigationDidActivateItem'), $this->equalTo('/test'));
     NotificationCenter::addObserver($observer, 'update', 'NavigationDidActivateItem', '/test');
     Navigation::activateItem('/test');
 }
Exemplo n.º 22
0
 public function __construct()
 {
     global $perm;
     parent::__construct();
     if (UpdateInformation::isCollecting()) {
         $data = Request::getArray("page_info");
         if (stripos(Request::get("page"), "plugins.php/blubber") !== false) {
             $output = array();
             $context_id = $data['Blubber']['context_id'];
             $stream = $data['Blubber']['stream'];
             $last_check = $data['Blubber']['last_check'] ? $data['Blubber']['last_check'] : time() - 5 * 60;
             $parameter = array('since' => $last_check);
             if ($stream === "thread") {
                 $parameter['thread'] = $context_id;
             }
             if ($stream === "course") {
                 $parameter['seminar_id'] = $context_id;
             }
             if ($stream === "profile") {
                 $parameter['user_id'] = $context_id;
             }
             if ($data['Blubber']['search']) {
                 $parameter['search'] = $data['Blubber']['search'];
             }
             $new_postings = ForumPosting::getPostings($parameter);
             $factory = new Flexi_TemplateFactory($this->getPluginPath() . "/views");
             foreach ($new_postings as $new_posting) {
                 if ($new_posting['root_id'] === $new_posting['topic_id']) {
                     $thread = $new_posting;
                     $template = $factory->open("forum/thread.php");
                     $template->set_attribute('thread', $new_posting);
                 } else {
                     $thread = new ForumPosting($new_posting['root_id']);
                     $template = $factory->open("forum/comment.php");
                     $template->set_attribute('posting', $new_posting);
                 }
                 ForumPosting::$course_hashes = $thread['user_id'] !== $thread['Seminar_id'] ? $thread['Seminar_id'] : false;
                 $template->set_attribute("course_id", $data['Blubber']['seminar_id']);
                 $output['postings'][] = array('posting_id' => $new_posting['topic_id'], 'mkdate' => $new_posting['mkdate'], 'root_id' => $new_posting['root_id'], 'content' => $template->render());
             }
             UpdateInformation::setInformation("Blubber.getNewPosts", $output);
             //Events-Queue:
             $db = DBManager::get();
             $events = $db->query("SELECT event_type, item_id " . "FROM blubber_events_queue " . "WHERE mkdate >= " . $db->quote($last_check) . " " . "ORDER BY mkdate ASC " . "")->fetchAll(PDO::FETCH_ASSOC);
             UpdateInformation::setInformation("Blubber.blubberEvents", $events);
             $db->exec("DELETE FROM blubber_events_queue " . "WHERE mkdate < UNIX_TIMESTAMP() - 60 * 60 * 6 " . "");
         }
     }
     if (Navigation::hasItem("/course") && $this->isActivated() && version_compare($GLOBALS['SOFTWARE_VERSION'], "2.4") <= 0) {
         $tab = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getLink($this, array(), "forum/forum"));
         $tab->setImage($this->getPluginURL() . "/assets/images/blubber_white.png");
         Navigation::addItem("/course/blubberforum", $tab);
     }
     if (Navigation::hasItem("/community")) {
         $nav = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "forum/globalstream"));
         Navigation::insertItem("/community/blubber", $nav, "online");
         Navigation::getItem("/community")->setURL(PluginEngine::getURL($this, array(), "forum/globalstream"));
     }
     if (Navigation::hasItem("/profile")) {
         $nav = new AutoNavigation(_("Blubber"), PluginEngine::getURL($this, array('user_id' => get_userid(Request::get("username"))), "forum/profile"));
         Navigation::addItem("/profile/blubber", $nav);
     }
 }
Exemplo n.º 23
0
include 'src/Page.php';
include 'src/PageContent.php';
// classes
include 'src/Asset.php';
include 'src/Documentation.php';
include 'src/ExternalPage.php';
include 'src/Header.php';
include 'src/InternalPage.php';
include 'src/Link.php';
include 'src/Links.php';
include 'src/Navigation.php';
include 'src/OronjoBuy.php';
include 'src/PageFactory.php';
include 'src/SimpleContent.php';
include 'src/Site.php';
include 'src/SoftwareContent.php';
$useLocalAssets = true;
if (count($argv) > 1 && $argv[1] === 'absolute-links') {
    $useLocalAssets = false;
}
if ($useLocalAssets) {
    Asset::useRelative();
    Link::useRelative();
}
$pages = new PageFactory();
$navigation = new Navigation($pages->home());
$navigation->addItem($pages->music())->addDropdown('Software', array_merge(array($pages->software()), $pages->linkedSoftwarePages()))->addItem($pages->contact());
$site = new Site(array($pages->home(), $pages->music(), $pages->contact(), $pages->software(), $pages->error(), $pages->m4lWAI(), $pages->m4lDSM(), $pages->m4lMCM(), $pages->wacNetworkMidi(), $pages->miniakPatchEditor(), $pages->metronome(), $pages->pushWrapper()), $navigation);
$site->clearLastBuild();
$site->render();
echo sprintf("Site built in %fms\n", microtime(true) - $start);
Exemplo n.º 24
0
// This also binds the global $_SESSION['SessionSeminar']
// variable to the URL parameter 'cid' for all generated links.
if (isset($course_id)) {
    selectSem($course_id) || selectInst($course_id);
    unset($course_id);
}
if (Request::get("sober") && ($GLOBALS['user']->id === "nobody" || $GLOBALS['perm']->have_perm("root"))) {
    //deactivate non-core-plugins:
    URLHelper::bindLinkParam("sober", $sober);
    PluginManager::$sober = true;
}
// load the default set of plugins
PluginEngine::loadPlugins();
// add navigation item: add modules
if ((Navigation::hasItem('/course/admin') || $GLOBALS['perm']->have_perm('admin')) && ($perm->have_studip_perm('tutor', $SessSemName[1]) && $SessSemName['class'] == 'sem') && ($SessSemName['class'] != 'sem' || !$GLOBALS['SEM_CLASS'][$GLOBALS['SEM_TYPE'][$SessSemName['art_num']]['class']]['studygroup_mode'])) {
    $plus_nav = new Navigation(_('Mehr …'), 'dispatch.php/course/plus/index');
    $plus_nav->setDescription(_("Mehr Stud.IP-Funktionen für Ihre Veranstaltung"));
    Navigation::addItem('/course/modules', $plus_nav);
}
// add navigation item for profile: add modules
if (Navigation::hasItem('/profile/edit')) {
    $plus_nav = new Navigation(_('Mehr …'), 'dispatch.php/profilemodules/index');
    $plus_nav->setDescription(_("Mehr Stud.IP-Funktionen für Ihr Profil"));
    Navigation::addItem('/profile/modules', $plus_nav);
}
if ($user_did_login) {
    NotificationCenter::postNotification('UserDidLogin', $user->id);
}
if ($seminar_open_redirected) {
    startpage_redirect(UserConfig::get($user->id)->PERSONAL_STARTPAGE);
}