com.lokorin.lokorin.modules
[ class tree: com.lokorin.lokorin.modules ] [ index: com.lokorin.lokorin.modules ] [ all elements ]

Source for file module_progress.php

Documentation is available at module_progress.php

  1. <?php
  2. /*
  3. * Lokorin.com
  4. * Copyright 2004-2006
  5. * Licensed under the GNU LGPL. See COPYING for full terms.
  6. */
  7. /**
  8. * A project module that displays all news entries that are connected to the
  9. * project.
  10. * @author Andreas Launila
  11. * @version $Revision: 1.9 $
  12. * @package com.lokorin.lokorin.modules
  13. * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  14. */
  15.  
  16. /**
  17. * For access to common constants and functions.
  18. */
  19. require_once('common.php');
  20. doInclude('lib_projects');
  21. doInclude('lib_displayer');
  22. doInclude('lib_news');
  23.  
  24. try {
  25. $project = getProjectBasedOnDir();
  26. Page::getInstance()->setProject($project);
  27. } catch(Exception $e) {
  28. logFatalException($e);
  29. }
  30.  
  31. Page::getInstance()->setTitle('Progress');
  32.  
  33. //Appent the rss feed link.
  34. Page::getInstance()->addToHead(new HeadData($project->getRssHeaderLink()));
  35.  
  36. $tableDisplayer = new TableDisplayer(TABLE_NEWS, 5,
  37. $project->getNewsSqlSelector()." ORDER by timestamp DESC");
  38. $news = getNews($tableDisplayer->getSqlSelector());
  39. $menuBar = $tableDisplayer->getPageMenuBar();
  40. //Construct and display the output.
  41. $output = '<p><a href="'.$project->getRssPath().'">RSS feed</a></p>';
  42. if(count($news) > 0) {
  43. echo $menuBar;
  44. /*$navList = '<ul>';
  45. foreach($news as $key => $newsItem) {
  46. $navList .= '<li><a href="#'.$key.'">'.$newsItem->getCaption().
  47. ' ('.date(DATE_LONG, $newsItem->getTimeAdded()).')</a></li>';
  48. $output .= '<a name="'.$key.'"></a>'.$newsItem->getAsHTMLProject();
  49. }
  50. $navList .= '</ul>';
  51. echo $navList . $output;*/
  52. foreach($news as $entry) {
  53. echo $entry->getAsHTMLProject();
  54. }
  55. echo $menuBar;
  56. } else {
  57. echo 'No news entries were found.';
  58. }
  59.  
  60. Page::getInstance()->display();
  61. ?>

Documentation generated on Sun, 16 Apr 2006 21:04:02 +0200 by phpDocumentor 1.3.0RC4