- <?php
- /*
- * Lokorin.com
- * Copyright 2004-2006
- * Licensed under the GNU LGPL. See COPYING for full terms.
- */
- /**
- * A project module that displays all news entries that are connected to the
- * project.
- * @author Andreas Launila
- * @version $Revision: 1.9 $
- * @package com.lokorin.lokorin.modules
- * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
- */
-
- /**
- * For access to common constants and functions.
- */
- require_once('common.php');
- doInclude('lib_projects');
- doInclude('lib_displayer');
- doInclude('lib_news');
-
- try {
- $project = getProjectBasedOnDir();
- Page::getInstance()->setProject($project);
- } catch(Exception $e) {
- logFatalException($e);
- }
-
- Page::getInstance()->setTitle('Progress');
-
- //Appent the rss feed link.
- Page::getInstance()->addToHead(new HeadData($project->getRssHeaderLink()));
-
- $tableDisplayer = new TableDisplayer(TABLE_NEWS, 5,
- $project->getNewsSqlSelector()." ORDER by timestamp DESC");
- $news = getNews($tableDisplayer->getSqlSelector());
- $menuBar = $tableDisplayer->getPageMenuBar();
-
- //Construct and display the output.
- $output = '<p><a href="'.$project->getRssPath().'">RSS feed</a></p>';
- if(count($news) > 0) {
- echo $menuBar;
-
- /*$navList = '<ul>';
- foreach($news as $key => $newsItem) {
- $navList .= '<li><a href="#'.$key.'">'.$newsItem->getCaption().
- ' ('.date(DATE_LONG, $newsItem->getTimeAdded()).')</a></li>';
- $output .= '<a name="'.$key.'"></a>'.$newsItem->getAsHTMLProject();
- }
- $navList .= '</ul>';
- echo $navList . $output;*/
- foreach($news as $entry) {
- echo $entry->getAsHTMLProject();
- }
-
- echo $menuBar;
- } else {
- echo 'No news entries were found.';
- }
-
- Page::getInstance()->display();
- ?>