function edit_action($area_id) { ForumPerm::check('edit_area', $this->getId(), $area_id); if (Request::isAjax()) { ForumEntry::update($area_id, studip_utf8decode(Request::get('name')), studip_utf8decode(Request::get('content'))); $this->render_json(array('content' => ForumEntry::killFormat(ForumEntry::killEdit(studip_utf8decode(Request::get('content')))))); } else { ForumEntry::update($area_id, Request::get('name'), Request::get('content')); $this->flash['messages'] = array('success' => _('Die Änderungen am Bereich wurden gespeichert.')); $this->redirect(PluginEngine::getLink('coreforum/index/index')); } }
?> > <a href="<?php echo PluginEngine::getLink('coreforum/index/index/' . $jump_to_topic_id . '#' . $jump_to_topic_id); ?> "> <span class="areaname"><?php echo htmlReady($entry['name_raw']); ?> </span> </a> <div class="areacontent" data-content="<?php echo htmlReady($entry['content_raw']); ?> "> <? $description = ForumEntry::killFormat(ForumEntry::killEdit($entry['content_raw'])) ?> <?php echo htmlReady(substr($description, 0, 150)); echo strlen($description) > 150 ? '…' : ''; ?> </div> </span> <? if (ForumPerm::has('edit_area', $seminar_id) && Request::get('edit_area') == $entry['topic_id']) : ?> <span style="text-align: center;"> <div style="width: 90%"> <?php echo $this->render_partial('area/_edit_area_form', compact('entry')); ?> </div>
/** * Takes a posting-array like the one generated by ForumEntry::getList() * and adds the child-posting with the freshest creation-date to it. * * @param array $postings * @return array */ function getLastPostings($postings) { foreach ($postings as $key => $posting) { if ($data = ForumEntry::getLatestPosting($posting['topic_id'])) { $last_posting['topic_id'] = $data['topic_id']; $last_posting['date'] = $data['mkdate']; $last_posting['user_id'] = $data['user_id']; $last_posting['user_fullname'] = $data['author']; $last_posting['username'] = get_username($data['user_id']); $last_posting['anonymous'] = $data['anonymous']; // we throw away all formatting stuff, tags, etc, so we have just the important bit of information $text = strip_tags($data['name']); $text = ForumEntry::br2space($text); $text = ForumEntry::killFormat(ForumEntry::killQuotes($text)); if (strlen($text) > 42) { $text = substr($text, 0, 40) . '...'; } $last_posting['text'] = $text; } $postings[$key]['last_posting'] = $last_posting; if (!($postings[$key]['last_unread'] = ForumEntry::getLastUnread($posting['topic_id']))) { $postings[$key]['last_unread'] = $last_posting['topic_id']; } $postings[$key]['num_postings'] = ForumEntry::countEntries($posting['topic_id']); unset($last_posting); } return $postings; }
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) : ?> >> <? endif ?> <a href="<?php echo PluginEngine::getLink('coreforum/index/index/' . $path_part['id']); ?> "> <?php echo htmlReady(ForumEntry::killFormat($path_part['name'])); ?> </a> <? $first = false ?> <? endforeach ?> <? endif ?> </span> </div>