<?php echo $this->render_partial('index/_abo_link', compact('constraint')); ?> </span> <? endif ?> <? if (ForumPerm::has('pdfexport', $seminar_id)) : ?> <?php echo Studip\LinkButton::create(_('Beiträge als PDF exportieren'), PluginEngine::getLink('coreforum/index/pdfexport/' . $topic_id), array('target' => '_blank')); ?> <? endif ?> </div> </div> </div> <? endif ?> <? endif ?> <? if (ForumPerm::has('add_entry', $seminar_id)): ?> <?php echo $this->render_partial('index/_new_entry'); ?> <? endif ?> </div> <!-- Mail-Notifikationen verschicken (soweit am Ende der Seite wie möglich!) --> <? if ($flash['notify']) : ForumAbo::notify($flash['notify']); endif ?>
<? $js = "STUDIP.Forum.loadAction('#abolink', '" . (ForumAbo::has($constraint['topic_id']) ? 'remove_' : '') . 'abo/'. $constraint['topic_id'] ."'); return false;"; $url = PluginEngine::getUrl('coreforum/index/' . (ForumAbo::has($constraint['topic_id']) ? 'remove_' : '') . 'abo/'. $constraint['topic_id']); ?> <? $text = $constraint['area'] ? _('Diesen Bereich abonnieren') : _('Dieses Thema abonnieren') ?> <? if ($constraint['depth'] == 0) : $text = _('Komplettes Forum abonnieren'); endif ?> <? if (!ForumAbo::has($constraint['topic_id'])) : ?> <?php echo Studip\LinkButton::create($text, $url, array('title' => _('Wenn sie diesen Bereich abonnieren, erhalten Sie eine ' . 'Stud.IP-interne Nachricht sobald in diesem Bereich ' . 'ein neuer Beitrag erstellt wurde.'), 'onClick' => $js)); ?> <? else : ?> <?php echo Studip\LinkButton::create(_('Nicht mehr abonnieren'), $url, array('onClick' => $js)); ?> <? endif; ?>
/** * Unsubscribe from the passed topic * * @param string $topic_id */ function remove_abo_action($topic_id) { ForumPerm::check('abo', $this->getId(), $topic_id); ForumAbo::delete($topic_id); if (Request::isXhr()) { $this->constraint = ForumEntry::getConstraints($topic_id); $this->render_template('index/_abo_link'); } else { $this->flash['messages'] = array('success' => _('Abonnement aufgehoben.')); $this->redirect(PluginEngine::getLink('coreforum/index/index/' . $topic_id)); } }