00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: index.php 5187 2005-12-01 16:22:29Z yeupou $
00006 #
00007 # Copyright 1999-2000 (c) The SourceForge Crew
00008 # Copyright 2000-2003 (c) Free Software Foundation
00009 # Mathieu Roy <yeupou--at--gnu.org>
00010 #
00011 # Copyright 2004 (c) Mathieu Roy <yeupou--at--gnu.org>
00012 #
00013 # The Savane project is free software; you can redistribute it and/or
00014 # modify it under the terms of the GNU General Public License
00015 # as published by the Free Software Foundation; either version 2
00016 # of the License, or (at your option) any later version.
00017 #
00018 # The Savane project is distributed in the hope that it will be useful,
00019 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021 # GNU General Public License for more details.
00022 #
00023 # You should have received a copy of the GNU General Public License
00024 # along with the Savane project; if not, write to the Free Software
00025 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00026
00027
00028 require '../include/pre.php';
00029
00030 if ($_POST['group_id'])
00031 {
00032 $group_id = $_POST['group_id'];
00033 }
00034 elseif ($_GET['group_id'])
00035 {
00036 $group_id = $_GET['group_id'];
00037 }
00038
00039 if (!$group_id)
00040 {
00041 $group_id = $GLOBALS['sys_group_id'];
00042 }
00043
00044 # yeupou--gnu.org 2004-09-06: the following simply break the form, see
00045 # bug #703.
00046 #
00047 #if ($_POST['limit'])
00048 # {
00049 # $limit= $_POST['limit'];
00050 # }
00051 #elseif ($_GET['limit'])
00052 # {
00053 # $group_id = $_GET['limit'];
00054 # }
00055
00056 if (!isset($limit))
00057 {
00058 $limit = 10;
00059 }
00060
00061 if ($_POST['feedback'])
00062 {
00063 $feedback = $_POST['feedback'];
00064 }
00065 elseif ($_GET['feedback'])
00066 {
00067 $feedback = $_GET['feedback'];
00068 }
00069
00070 if ($_POST['group'])
00071 {
00072 $group = $_POST['group'];
00073 }
00074 elseif ($_GET['group'])
00075 {
00076 $group = $_GET['group'];
00077 }
00078
00079 $project=project_get_object($group_id);
00080 if (!$project->Uses("news"))
00081 { exit_error(_("This project has turned off the news tool.")); }
00082
00083 site_project_header(array('group'=>$group_id,
00084 'context'=>'news'));
00085
00086
00087
00088
00089 $form_opening = '<form action="'. $PHP_SELF .'#options" method="get">';
00090 $form = sprintf(_("Print summaries for the %s latest news."), '<input type="text" name="limit" size="4" value="'.$limit.'" />');
00091 if ($group_name)
00092 { $form .= '<input type="hidden" name="group" value="'.$group_name.'" />'; }
00093 $form_submit = '<input class="bold" type="submit" value="'._("Apply").'" />';
00094
00095 print html_show_displayoptions($form, $form_opening, $form_submit);
00096
00097 print "<br />\n";
00098
00099 print $HTML->box_top(_("Latest News Approved - With Summaries"));
00100 print news_show_latest($group_id, $limit, "true", $start_from="nolinks");
00101 print $HTML->box_bottom();
00102
00103
00104 if ($limit < news_total_number($group_id))
00105 {
00106 print "<br />\n";
00107 print $HTML->box_top(_("Older News Approved"));
00108 print news_show_latest($group_id, 0, "false", $start_from=$limit);
00109 print $HTML->box_bottom();
00110 }
00111
00112 site_project_footer(array());
00113
00114 ?>