3 * Copyright (C) 2008-2009 Alcatel-Lucent
4 * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
6 * This file is part of FusionForge. FusionForge is free software;
7 * you can redistribute it and/or modify it under the terms of the
8 * GNU General Public License as published by the Free Software
9 * Foundation; either version 2 of the Licence, or (at your option)
12 * FusionForge is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 * Standard Alcatel-Lucent disclaimer for contributing to open source
25 * "The Full List ("Contribution") has not been tested and/or
26 * validated for release as or in products, combinations with products or
27 * other commercial use. Any use of the Contribution is entirely made at
28 * the user's own responsibility and the user can not rely on any features,
29 * functionalities or performances Alcatel-Lucent has attributed to the
32 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
33 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
34 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
35 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
36 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
37 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
38 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
39 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
40 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
45 require_once('../env.inc.php');
46 require_once $gfcommon.'include/pre.php';
47 require_once $gfwww.'include/trove.php';
49 if (!forge_get_config('use_project_full_list')) {
53 $HTML->header(array('title'=>_('Project List'),'pagename'=>'softwaremap'));
54 $HTML->printSoftwareMapLinks();
56 $projects = get_public_active_projects_asc($TROVE_HARDQUERYLIMIT);
58 $querytotalcount = count($projects);
60 // #################################################################
61 // limit/offset display
63 $page = getIntFromRequest('page',1);
65 // store this as a var so it can be printed later as well
66 $html_limit = '<span style="text-align:center;font-size:smaller">';
67 if ($querytotalcount == $TROVE_HARDQUERYLIMIT){
68 $html_limit .= sprintf(_('More than <strong>%1$s</strong> projects in result set.'), $querytotalcount);
70 $html_limit .= sprintf(_('<strong>%1$s</strong> projects in result set.'), $querytotalcount);
72 // only display pages stuff if there is more to display
73 if ($querytotalcount > $TROVE_BROWSELIMIT) {
74 $html_limit .= sprintf(_(' Displaying %1$s per page. Projects sorted by alphabetical order.'), $TROVE_BROWSELIMIT).'<br/>';
76 // display all the numbers
77 for ($i=1;$i<=ceil($querytotalcount/$TROVE_BROWSELIMIT);$i++) {
80 $html_limit .= '<a href="'.$_SERVER['PHP_SELF'];
81 $html_limit .= '?page='.$i;
83 } else $html_limit .= '<strong>';
84 $html_limit .= '<'.$i.'>';
86 $html_limit .= '</a>';
87 } else $html_limit .= '</strong>';
92 $html_limit .= '</span>';
94 print $html_limit."<hr />\n";
96 // #################################################################
97 // print actual project listings
98 for ($i_proj=0;$i_proj<$querytotalcount;$i_proj++) {
99 $row_grp = $projects[$i_proj];
101 // check to see if row is in page range
102 if (($i_proj >= (($page-1)*$TROVE_BROWSELIMIT)) && ($i_proj < ($page*$TROVE_BROWSELIMIT))) {
110 // Embed RDFa description for /projects/PROJ_NAME
111 $proj_uri = util_make_url_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id']);
112 print '<div typeof="doap:Project sioc:Space" about="'.$proj_uri.'">'."\n";
113 print '<span rel="planetforge:hosted_by" resource="'. util_make_url ('/') .'"></span>'."\n";
115 print '<table class="fullwidth">';
116 print '<tr class="top"><td colspan="2">';
117 print util_make_link_g(strtolower($row_grp['unix_group_name']),$row_grp['group_id'],'<strong>'
118 .'<span property="doap:name">'
119 .$row_grp['group_name']
123 if ($row_grp['short_description']) {
125 . '<span property="doap:short_desc">'
126 . $row_grp['short_description']
131 print '</td></tr><tr class="top"><td>';
132 // list all trove categories
133 print trove_getcatlisting($row_grp['group_id'],0,1,1);
135 print '<td class="bottom align-right"><br />'._('Register Date:').' <strong>'.date(_('Y-m-d H:i'),$row_grp['register_time']).'</strong></td>';
138 print '</div>'; // /doap:Project
140 } // end if for row and range chacking
143 // print bottom navigation if there are more projects to display
144 if ($querytotalcount > $TROVE_BROWSELIMIT) {
148 $HTML->footer(array());