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);
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (false) {
         //Suche ersetzen
         if (Navigation::hasItem("/search")) {
             $nav = Navigation::getItem("/search");
             $nav->setURL(PluginEngine::getURL($this, array(), "search"));
             foreach ($nav->getSubNavigation() as $name => $nav_object) {
                 $nav->removeSubNavigation($name);
             }
             $tab = new AutoNavigation(_("Suche"), PluginEngine::getURL($this, array(), "search"));
             $nav->addSubNavigation('search', $tab);
         }
     } else {
         //Suche erweitern
         if (Navigation::hasItem("/search")) {
             $nav = Navigation::getItem("/search");
             $nav->setURL(PluginEngine::getURL($this, array(), "search"));
             $tab = new AutoNavigation(_("Suche"), PluginEngine::getURL($this, array(), "search"));
             $nav->addSubNavigation('search', $tab);
         }
     }
     //Observer definieren:
     NotificationCenter::addObserver($this, "show_user_avatar", "WillDisplaySearchResultItem");
     NotificationCenter::addObserver($this, "show_seminar_avatar", "WillDisplaySearchResultItem");
     NotificationCenter::addObserver($this, "show_document_avatar", "WillDisplaySearchResultItem");
     NotificationCenter::addObserver($this, "add_calculator", "LastAlteringOfSearchResults");
     NotificationCenter::addObserver($this, "filter_study_areas", "GlobalSearchFilter");
 }
Пример #3
0
 function perform($unconsumed_path)
 {
     $trails_root = $this->getPluginPath() . "/app";
     $dispatcher = new Trails_Dispatcher($trails_root, rtrim(PluginEngine::getURL($this, null, ''), '/'), self::DEFAULT_CONTROLLER);
     $dispatcher->plugin = $this;
     $dispatcher->dispatch($unconsumed_path);
 }
Пример #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);
 }
Пример #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");
 }
Пример #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);
     }
 }
Пример #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);
 }
Пример #10
0
 /**
  * Set the posting denoted by the passed topic_id as liked for the
  * currently logged in user
  * 
  * @param string $topic_id
  */
 static function like($topic_id)
 {
     $stmt = DBManager::get()->prepare("REPLACE INTO\n            forum_likes (topic_id, user_id)\n            VALUES (?, ?)");
     $stmt->execute(array($topic_id, $GLOBALS['user']->id));
     // get posting owner
     $data = ForumEntry::getConstraints($topic_id);
     // notify owner of posting about the like
     setTempLanguage($data['user_id']);
     $notification = get_fullname($GLOBALS['user']->id) . _(' gefällt einer deiner Forenbeiträge!');
     restoreLanguage();
     PersonalNotifications::add($data['user_id'], PluginEngine::getURL('coreforum/index/index/' . $topic_id . '?highlight_topic=' . $topic_id . '#' . $topic_id), $notification, $topic_id, Icon::create('forum', 'clickable')->asImagePath(40));
 }
Пример #11
0
 function url_for($to)
 {
     $args = func_get_args();
     # find params
     $params = array();
     if (is_array(end($args))) {
         $params = array_pop($args);
     }
     # urlencode all but the first argument
     $args = array_map('urlencode', $args);
     $args[0] = $to;
     return PluginEngine::getURL($this->dispatcher->current_plugin, $params, join('/', $args));
 }
Пример #12
0
 /**
  * @var Container
  */
 public function __construct()
 {
     parent::__construct();
     global $perm;
     $this->course = Course::findCurrent();
     $this->course_id = $this->course->id;
     $this->course = Course::findCurrent();
     if ($this->course) {
         $this->setupStudIPNavigation();
         if (Navigation::hasItem('/course/admin') && $perm->have_studip_perm('dozent', $this->course_id)) {
             $url = PluginEngine::getURL($this);
             $scormItem = new Navigation(_('Inhaltselemente bearbeiten'), $url);
             Navigation::addItem('/course/admin/seminar_tabs', $scormItem);
         } else {
             if (Navigation::hasItem('/admin/course/details')) {
                 $url = PluginEngine::getURL($this);
                 $scormItem = new Navigation(_('Inhaltselemente bearbeiten'), $url);
                 Navigation::addItem('/admin/course/seminar_tabs', $scormItem);
             }
         }
     }
 }
Пример #13
0
            <? if ($section == 'index' && $perms['edit']) : ?>
                <?php 
echo Studip\LinkButton::create(_('Beitrag bearbeiten'), PluginEngine::getUrl('coreforum/index/index/' . $post['topic_id'] . '/?edit_posting=' . $post['topic_id']), array('onClick' => "STUDIP.Forum.editEntry('" . $post['topic_id'] . "'); return false;", 'class' => !$perms['edit_closed'] ? 'hideWhenClosed' : '', 'style' => !$can_edit_closed ? 'display: none' : ''));
?>
            <? endif ?>
            
            <? if ($section == 'index') : ?>
            <span <?php 
echo !$perms['edit_close'] && !$perms['remove_entry'] ? 'class="hideWhenClosed"' : '';
?>
                <?php 
echo !$perms['edit'] && !$perms['remove_entry'] ? 'style="display: none"' : '';
?>
>
                <? $confirmLink = PluginEngine::getURL('coreforum/index/delete_entry/' . $post['topic_id'])  ?>
                <? $confirmLinkApproved = PluginEngine::getURL('coreforum/index/delete_entry/' . $post['topic_id'] . '?approve_delete=1')  ?>
                <? if ($constraint['depth'] == $post['depth']) : /* this is not only a posting, but a thread */ ?>
                    <? $confirmText = _('Wenn Sie diesen Beitrag löschen wird ebenfalls das gesamte Thema gelöscht. Sind Sie sicher, dass Sie das tun möchten?')  ?>
                    <?php 
echo Studip\LinkButton::create(_('Thema löschen'), $confirmLink, array('onClick' => "STUDIP.Forum.showDialog('{$confirmText}', '{$confirmLinkApproved}'); return false;"));
?>
                <? else : ?>
                    <? $confirmText = _('Möchten Sie diesen Beitrag wirklich löschen?') ?>
                    <?php 
echo Studip\LinkButton::create(_('Beitrag löschen'), $confirmLink, array('onClick' => "STUDIP.Forum.showDialog('{$confirmText}', '{$confirmLinkApproved}'); return false;"));
?>
                <? endif ?>
            </span>
            <? endif ?>

            <? if (ForumPerm::has('forward_entry', $seminar_id)) : ?>
Пример #14
0
                        <? if ($entry['sticky'] == 0) : ?>
                            <a href="<?php 
echo PluginEngine::getURL('coreforum/index/make_sticky/' . $entry['topic_id'] . '/' . $constraint['topic_id'] . '/0');
?>
" 
                                id="stickyButton-<?php 
echo $entry['topic_id'];
?>
">
                                <?php 
echo Icon::create('staple', 'clickable', ['title' => _('Thema hervorheben')])->asImg(16);
?>
                            </a>
                        <? else : ?>
                            <a href="<?php 
echo PluginEngine::getURL('coreforum/index/make_unsticky/' . $entry['topic_id'] . '/' . $constraint['topic_id'] . '/0');
?>
" 
                                id="stickyButton-<?php 
echo $entry['topic_id'];
?>
">
                                <?php 
echo Icon::create('staple', 'clickable', ['title' => _('Hervorhebung aufheben')])->asImg(16);
?>
                            </a>
                        <? endif ?>
                    <? endif ?>
                </span>

                <?php 
Пример #15
0
 /**
  * Return the current URL associated with this navigation item.
  *
  * @deprecated
  */
 function getURL()
 {
     return PluginEngine::getURL($this->plugin, $this->params, $this->cmd);
 }
Пример #16
0
 /**
  * Needed function to return notification-objects.
  * @param string $course_id
  * @param int $since
  * @param string $user_id
  * @return array of type ContentElement
  */
 public function getNotificationObjects($course_id, $since, $user_id)
 {
     $blubber = BlubberStream::getCourseStream($course_id)->fetchNewPostings($since);
     $contents = array();
     foreach ($blubber as $blubb) {
         $contents[] = new ContentElement($blubb['name'], $blubb['name'], $blubb['description'], $blubb['user_id'], get_fullname($blubb['user_id']), PluginEngine::getURL($this, array(), 'streams/thread/' . $blubb['root_id']), $blubb['mkdate']);
     }
     return $contents;
 }
Пример #17
0
 public function comment_action()
 {
     $context = Request::option("context");
     $thread = new ForumPosting(Request::option("thread"));
     if ($thread['context_type'] === "course") {
         $seminar = new Seminar($context);
         if ($seminar->write_level > 0 && !$GLOBALS['perm']->have_studip_perm("autor", $context)) {
             throw new AccessDeniedException("Kein Zugriff");
         }
     }
     ForumPosting::$course_hashes = $thread['context_type'] === "course" ? $thread['Seminar_id'] : false;
     if (Request::option("thread") && $thread['Seminar_id'] === $context) {
         $output = array();
         $posting = new ForumPosting();
         ForumPosting::$mention_thread_id = $thread->getId();
         StudipTransformFormat::addStudipMarkup("mention1", '@\\"[^\\n\\"]*\\"', "", "ForumPosting::mention");
         StudipTransformFormat::addStudipMarkup("mention2", '@[^\\s]*[\\d\\w_]+', "", "ForumPosting::mention");
         $content = transformBeforeSave(studip_utf8decode(Request::get("content")));
         //mentions einbauen:
         $content = preg_replace("/(@\"[^\n\"]*\")/e", "ForumPosting::mention('\\1', '" . $thread->getId() . "')", $content);
         $content = preg_replace("/(@[^\\s]+)/e", "ForumPosting::mention('\\1', '" . $thread->getId() . "')", $content);
         $posting['description'] = $content;
         $posting['context_type'] = $thread['context_type'];
         $posting['seminar_id'] = $thread['Seminar_id'];
         $posting['root_id'] = $posting['parent_id'] = Request::option("thread");
         $posting['name'] = "Re: " . $thread['name'];
         if ($GLOBALS['user']->id !== "nobody") {
             $posting['user_id'] = $GLOBALS['user']->id;
             $posting['author'] = get_fullname();
         } else {
             if (Request::get("anonymous_security") === $_SESSION['blubber_anonymous_security']) {
                 $contact_user = BlubberExternalContact::findByEmail(Request::get("anonymous_email"));
                 $_SESSION['anonymous_email'] = Request::get("anonymous_email");
                 $_SESSION['anonymous_name'] = $contact_user['name'] = Request::get("anonymous_name");
                 $contact_user->store();
                 $posting['user_id'] = $contact_user->getId();
                 $posting['external_contact'] = 1;
                 $posting['author'] = Request::get("anonymous_name");
             } else {
                 throw new AccessDeniedException("No permission to write posting.");
             }
         }
         $posting['author_host'] = $_SERVER['REMOTE_ADDR'];
         if ($posting->store()) {
             $factory = new Flexi_TemplateFactory($this->plugin->getPluginPath() . "/views/forum");
             $template = $factory->open("comment.php");
             $template->set_attribute('posting', $posting);
             $template->set_attribute('course_id', $thread['Seminar_id']);
             $output['content'] = studip_utf8encode($template->render($template->render()));
             $output['mkdate'] = time();
             $output['posting_id'] = $posting->getId();
             //Notifications:
             if (class_exists("PersonalNotifications")) {
                 $user_ids = array();
                 if ($thread['user_id'] && $thread['user_id'] !== $GLOBALS['user']->id) {
                     $user_ids[] = $thread['user_id'];
                 }
                 foreach ((array) $thread->getChildren() as $comment) {
                     if ($comment['user_id'] && $comment['user_id'] !== $GLOBALS['user']->id && !$comment['external_contact']) {
                         $user_ids[] = $comment['user_id'];
                     }
                 }
                 $user_ids = array_unique($user_ids);
                 PersonalNotifications::add($user_ids, PluginEngine::getURL($this->plugin, array('cid' => $thread['context_type'] === "course" ? $thread['Seminar_id'] : null), "forum/thread/" . $thread->getId()), get_fullname() . " hat einen Kommentar geschrieben", "posting_" . $posting->getId(), Avatar::getAvatar($GLOBALS['user']->id)->getURL(Avatar::MEDIUM));
             }
         }
         $this->render_json($output);
     } else {
         $this->render_json(array('error' => "Konnte thread nicht zuordnen."));
     }
 }
Пример #18
0
 public function delete_action($stream_id = null)
 {
     $this->stream = new BlubberStream($stream_id);
     if ($GLOBALS['user']->id === "nobody") {
         throw new AccessDeniedException();
     }
     if ($stream_id) {
         Navigation::activateItem("/community/blubber/" . $stream_id);
     }
     if ($this->stream['user_id'] && $this->stream['user_id'] !== $GLOBALS['user']->id) {
         throw new AccessDeniedException("Not allowed to edit stream");
     }
     $this->stream->delete();
     PageLayout::postMessage(MessageBox::success(_("Blubberstream gelöscht.")));
     $path = "streams/global";
     foreach (BlubberStream::findMine() as $stream) {
         if ($stream['defaultstream']) {
             $path = "streams/custom/" . $stream->getId();
         }
     }
     $this->redirect(PluginEngine::getURL($this->plugin, array(), $path));
 }
Пример #19
0
 public function save_review_action($plugin_id)
 {
     if (!Request::isPost()) {
         throw new Exception("Wrong method, use POST.");
     }
     $this->marketplugin = MarketPlugin::find($plugin_id);
     if (!$this->marketplugin) {
         throw new Exception("Unknown plugin.");
     }
     $reviews = MarketReview::findBySQL("plugin_id = ? AND user_id = ?", array($plugin_id, $GLOBALS['user']->id));
     if (count($reviews)) {
         $this->review = $reviews[0];
     } else {
         $this->review = new MarketReview();
         $this->review['plugin_id'] = $plugin_id;
         $this->review['user_id'] = $GLOBALS['user']->id;
     }
     $data = Request::getArray("data");
     $this->review['review'] = trim($data['review']) ?: null;
     if ($data['rating'] <= 5 && $data['rating'] >= 0) {
         $this->review['rating'] = $data['rating'];
     } else {
         throw new Exception("Rating is not in accepted range.");
     }
     $this->review->store();
     PersonalNotifications::add($this->marketplugin['user_id'], PluginEngine::getURL($this->plugin, array(), "presenting/details/" . $plugin_id), sprintf(_("Ihr Plugin %s wurde von %s bewertet."), $this->marketplugin['name'], get_fullname($GLOBALS['user']->id)), null, Assets::image_path("icons/blue/star.svg"));
     PageLayout::postMessage(MessageBox::success(_("Review/Bewertung wurde gespeichert.")));
     $this->redirect('presenting/details/' . $plugin_id);
 }
Пример #20
0
            <?php 
echo _('Neue Beiträge');
?>
        </a>
    <? elseif ($section == 'latest') : ?>
        <a href="<?php 
echo PluginEngine::getURL('coreforum/index/latest');
?>
">
            <?php 
echo _('Letzte Beiträge');
?>
        </a>
    <? elseif ($section == 'favorites') : ?>
        <a href="<?php 
echo PluginEngine::getURL('coreforum/index/favorites');
?>
">
            <?php 
echo _('Gemerkte Beiträge');
?>
        </a>        
    <? else: ?>

        <? $first = true ?>
        <? foreach (ForumEntry::getPathToPosting($topic_id) as $path_part) : ?>
            <? if (!$first) : ?> &gt;&gt; <? endif ?>
            <a href="<?php 
echo PluginEngine::getLink('coreforum/index/index/' . $path_part['id']);
?>
">
Пример #21
0
    $export = new ExportWidget();
    $export->addLink(_('Beiträge als PDF exportieren'), $controller->url_for('index/pdfexport/' . $constraint['topic_id']), Icon::create('file-pdf', 'clickable'));
    $sidebar->addWidget($export);
}
?>

<!-- Breadcrumb navigation -->
<?php 
echo $this->render_partial('index/_breadcrumb');
?>

<!-- Seitenwähler (bei Bedarf) am oberen Rand anzeigen -->
<div style="float: right; padding-right: 10px;" data-type="page_chooser">
    <? if ($constraint['depth'] > 0 || !isset($constraint)) : ?>
    <?php 
echo $pagechooser = $GLOBALS['template_factory']->render('shared/pagechooser', array('page' => ForumHelpers::getPage(), 'num_postings' => $number_of_entries, 'perPage' => ForumEntry::POSTINGS_PER_PAGE, 'pagelink' => str_replace('%%s', '%s', str_replace('%', '%%', PluginEngine::getURL('coreforum/index/goto_page/' . $topic_id . '/' . $section . '/%s/?searchfor=' . $searchfor . (!empty($options) ? '&' . http_build_query($options) : ''))))));
?>
    <? endif ?>
    <?php 
echo $link;
?>
</div>
<br style="clear: both">

<!-- Message area -->
<div id="message_area">
    <?php 
echo $this->render_partial('messages');
?>
</div>
Пример #22
0
echo \Studip\Button::create(_("Nein, danke!"), 'nothanx', array());
?>
                </li>
            </ul>

        </form>
    </div>
    <script>
        jQuery(function () {
            jQuery('#init_first_hosts_dialog').dialog({
                'modal': true,
                'title': '<?php 
echo _("Index-Server hinzufügen");
?>
',
                'width': "80%"
            });
        });
    </script>
<? endif ?>

<?
$actions = new ActionsWidget();
$actions->addLink(
    _("Server hinzufügen"),
    PluginEngine::getURL($plugin, array(), "admin/add_new_host"),
    Icon::create("add", "clickable"),
    array('data-dialog' => "1")
);

Sidebar::Get()->addWidget($actions);
Пример #23
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);
     }
 }
Пример #24
0
 /**
  * Jump to page in the entries of the submitted parent-entry 
  * denoted by the submitted context (section)
  * 
  * @param string $topic_id  the parent-topic to goto
  * @param string $section   the type of view (one of index/search)
  * @param int $page         the page to jump to
  */
 function goto_page_action($topic_id, $section, $page)
 {
     switch ($section) {
         case 'index':
             $this->redirect(PluginEngine::getLink('coreforum/index/index/' . $topic_id . '/' . (int) $page . '#' . $topic_id));
             break;
         case 'search':
             $optionlist = array();
             foreach (array('search_title', 'search_content', 'search_author') as $option) {
                 if (Request::option($option)) {
                     $optionlist[] = $option . '=' . 1;
                 }
             }
             $this->redirect(PluginEngine::getURL('coreforum/index/' . $section . '/' . (int) $page . '/?searchfor=' . Request::get('searchfor') . '&' . implode('&', $optionlist)));
             break;
         default:
             $this->redirect(PluginEngine::getLink('coreforum/index/' . $section . '/' . (int) $page));
             break;
     }
 }
Пример #25
0
?>
    </ol>

</div>

<div style="text-align: center">
<?php 
if ($marketplugin->isWritable()) {
    ?>
    <?php 
    echo \Studip\LinkButton::create(_("Plugin löschen"), PluginEngine::getURL($plugin, array(), 'myplugins/delete/' . $marketplugin->getId()), array('data-dialog' => 1));
    ?>
    <?php 
    echo \Studip\LinkButton::create(_("Bearbeiten"), PluginEngine::getURL($plugin, array(), "myplugins/edit/" . $marketplugin->getId()), array('data-dialog' => 1));
    ?>
    <?php 
    echo \Studip\LinkButton::create(_("Release hinzufügen"), PluginEngine::getURL($plugin, array(), "myplugins/add_release/" . $marketplugin->getId()), array('data-dialog' => 1));
}
if (!$marketplugin->isWritable()) {
    ?>
    <?php 
    echo \Studip\LinkButton::create(_("Bewertung schreiben"), $controller->url_for('presenting/review/' . $marketplugin->getId()), array('data-dialog' => 1));
}
if ($marketplugin['user_id'] !== $GLOBALS['user']->id) {
    ?>
    <?php 
    echo \Studip\LinkButton::create(_("Plugin abonnieren"), PluginEngine::getURL($plugin, array(), "presenting/register_for_pluginnews/" . $marketplugin->getId()), array('title' => _("Neuigkeiten des Plugins per Nachricht bekommen."), 'data-dialog' => "1"));
}
?>
</div>
Пример #26
0
                    <?php 
echo Icon::create('checkbox-checked', 'info')->asImg(['class' => "check text-bottom"]);
?>
                </div>
                <input type="checkbox" name="filter_nohashtags_check" id="filter_nohashtags_check" onChange="jQuery(this).closest('td').toggleClass('selected');" value="1"<?php 
echo $stream['filter_nohashtags'] ? " checked" : "";
?>
>
            </td>
        </tr>
    </tbody>
</table>
    
<?php 
echo \Studip\Button::createAccept(_("Speichern"), array());
?>

</form>

<?php 
$sidebar = Sidebar::get();
$sidebar->setImage("sidebar/blubber-sidebar.png");
$streamAvatar = StreamAvatar::getAvatar($stream->getId());
if ($streamAvatar->is_customized()) {
    $sidebar->setContextAvatar($streamAvatar);
}
$actions = new ActionsWidget();
if (!$stream->isNew()) {
    $actions->addLink(_("Diesen Stream löschen"), PluginEngine::getURL($plugin, array(), 'streams/delete/' . $stream->getId()), Icon::create("trash", "clickable"), array('onclick' => "return window.confirm('" . _("Wirklich löschen?") . "');"));
}
$sidebar->addWidget($actions);
Пример #27
0
                        <? endif ?>
                    </div>
                </div>
            </li>
        <? endforeach ?>
    </ul>

    <div style="text-align: center;">
        <? if ($material['host_id'] || $material['user_id'] !== $GLOBALS['user']->id) : ?>
            <?php 
echo \Studip\LinkButton::create(_("Review schreiben"), PluginEngine::getLink($plugin, array(), 'market/review/' . $material->getId()), array('data-dialog' => 1));
?>
        <? endif ?>
    </div>

</div>


<?
Sidebar::Get()->setImage($plugin->getPluginURL()."/assets/sidebar-service.png");
if ($GLOBALS['perm']->have_perm("autor")) {
    $actions = new ActionsWidget();
    $actions->addLink(
        _("Eigenes Lernmaterial hochladen"),
        PluginEngine::getURL($plugin, array(), "mymaterial/edit"),
        Icon::create("add", "clickable"),
        array('data-dialog' => "1")
    );
    Sidebar::Get()->addWidget($actions);
}
Пример #28
0
        if (!jQuery(event.target).is("a *, a")) {
            //Wenn nicht auf ein Link geklickt wurde
            jQuery(this).toggleClass('selected');
            event.stopImmediatePropagation();
        }
    });
});
var offset = 0;
jQuery(window.document).bind('scroll', function (event) {
    if ((jQuery(window).scrollTop() + jQuery(window).height() > jQuery(window.document).height() - 500)
            && (jQuery("#searchresults > li.more").length > 0)) {
        //nachladen
        jQuery("#searchresults > li.more").removeClass("more").addClass("loading");
        jQuery.ajax({
            url: "<?php 
echo PluginEngine::getURL($plugin, array(), "load");
?>
",
            data: {
                'offset': offset + 1
            },
            dataType: "json",
            success: function (response) {
                jQuery("#searchresults > li.loading").remove();
                offset++;
                jQuery.each(response.results, function (index, element) {
                    jQuery("#searchresults").append(jQuery(element));
                });
                if (response.more) {
                    jQuery("#searchresults").append(jQuery('<li class="more">...</li>'));
                }
Пример #29
0
 function getNotificationObjects($course_id, $since, $user_id)
 {
     $this->setupAutoload();
     if (ForumPerm::has('view', $course_id, $user_id)) {
         $postings = ForumEntry::getLatestSince($course_id, $since);
         $contents = array();
         foreach ($postings as $post) {
             $obj = get_object_name($course_id, 'sem');
             $summary = sprintf(_('%s hat im Forum der Veranstaltung "%s" einen Forenbeitrag verfasst.'), get_fullname($post['user_id']), $obj['name']);
             $contents[] = new ContentElement(_('Forum: ') . $obj['name'], $summary, formatReady($post['content']), $post['user_id'], $post['author'], PluginEngine::getURL($this, array(), 'index/index/' . $post['topic_id'] . '?cid=' . $course_id . '#' . $post['topic_id']), $post['mkdate']);
         }
     }
     return $contents;
 }
Пример #30
0
 public function add_to_course_action($material_id)
 {
     $this->material = new LernmarktplatzMaterial($material_id);
     if (Request::isPost() && Request::option("seminar_id") && $GLOBALS['perm']->have_studip_perm("autor", Request::option("seminar_id"))) {
         //$course = new Course(Request::option("seminar_id"));
         $query = "SELECT folder_id FROM folder WHERE range_id = ? ORDER BY name";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array(Request::option("seminar_id")));
         $folder_id = $statement->fetch(PDO::FETCH_COLUMN, 0);
         if ($folder_id && ($GLOBALS['perm']->have_studip_perm("tutor", Request::option("seminar_id")) || in_array("writable", DocumentFolder::find($folder_id)->getPermissions()))) {
             if ($this->material['host_id']) {
                 $path = $GLOBALS['TMP_PATH'] . "/tmp_download_" . md5(uniqid());
                 file_put_contents($path, file_get_contents($this->material->host->url . "download/" . $this->material['foreign_material_id']));
             } else {
                 $path = $this->material->getFilePath();
             }
             $document = StudipDocument::createWithFile($path, array('name' => $this->material['name'], 'range_id' => $folder_id, 'user_id' => $GLOBALS['user']->id, 'seminar_id' => Request::option("seminar_id"), 'description' => $this->material['description'] ?: $this->material['short_description'], 'filename' => $this->material['filename'], 'filesize' => filesize($path), 'author_name' => get_fullname()));
             PageLayout::postMessage(MessageBox::success(_("Datei wurde erfolgreich kopiert.")));
             $this->redirect(URLHelper::getURL("folder.php#anker", array('cid' => Request::option("seminar_id"), 'data' => array('cmd' => "tree", 'open' => array($folder_id => 1, $document->getId() => 1)), 'open' => $document->getId())));
             if ($this->material['host_id']) {
                 //cleanup
                 @unlink($path);
             }
         } else {
             PageLayout::postMessage(MessageBox::error(_("Veranstaltung hat keinen allgemeinen Dateiordner.")));
             $this->redirect(PluginEngine::getURL($this->plugin, array(), "market/details/" . $material_id));
         }
     }
     $this->courses = Course::findBySQL("INNER JOIN seminar_user USING (Seminar_id) WHERE seminar_user.user_id = ? ORDER BY seminare.mkdate DESC", array($GLOBALS['user']->id));
 }