4 * SourceForge Trove Software Map
6 * SourceForge: Breaking Down the Barriers to Open Source Development
7 * Copyright 1999-2001 (c) VA Linux Systems
8 * http://sourceforge.net
12 require_once('../env.inc.php');
13 require_once('pre.php');
14 require_once('trove.php');
16 require_once('common/include/escapingUtils.php');
17 require_once('TroveCategory.class.php');
18 require_once('TroveCategoryFactory.class.php');
19 require_once('include/utils.php');
21 if (!$sys_use_trove) {
25 $categoryId = getIntFromGet('form_cat');
27 // assign default if not defined
29 $categoryId = $default_trove_cat;
32 $category = new TroveCategory($categoryId);
34 $HTML->header(array('title'=>_('Trove Map')));
38 // We check current filtering directives and display them
40 $filter = getStringFromGet('discrim');
44 // check and clean the array
45 $filterArray = explode(',', $filter);
46 $cleanArray = array();
47 $count = max(6, sizeof($filterArray));
48 for ($i = 0; $i < $count; $i++) {
49 if(is_numeric($filterArray[$i]) && $filterArray[$i] != 0) {
50 $cleanArray[] = (int) $filterArray[$i];
53 $filterArray = array_unique($cleanArray);
54 if(!empty($filterArray)) {
55 $filterCategories = TroveCategoryFactory::getCategories($filterArray);
57 echo '<p><span style="color:red;">'._('Limiting View').'</span>';
59 for($i=0, $count = sizeof($filterCategories); $i < $count; $i++) {
60 $filterCategory =& $filterCategories[$i];
61 echo '<br /> '
62 .$filterCategory->getFullPath()
63 .' <a href="?form_cat='.$category->getId()
64 .getFilterUrl($filterArray, $filterCategory->getId()).'">['._('Remove Filter').']'
71 $category->setFilter($filterArray);
74 // We display the trove
77 <table width="100%" border="0" cellspacing="0" cellpadding="0">
81 // here we print list of root level categories, and use open folder for current
82 $rootCategories = TroveCategoryFactory::getRootCategories();
83 echo _('Browse By').':';
84 for($i = 0, $count = sizeof($rootCategories); $i < $count; $i++) {
85 $rootCategory =& $rootCategories[$i];
87 // print open folder if current, otherwise closed
88 // also make anchor if not current
91 if (($rootCategory->getId() == $category->getRootParentId())
92 || ($rootCategory->getId() == $category->getId())) {
94 echo html_image('ic/ofolder15.png','15','13',array());
95 echo ' <strong>'.$rootCategory->getLocalizedLabel().'</strong>';
97 echo '<a href="?form_cat='.$rootCategory->getId().@$discrim_url.'">';
98 echo html_image('ic/cfolder15.png', '15', '13', array());
99 echo ' '.$rootCategory->getLocalizedLabel();
108 $parentCategories =& $category->getParents();
109 for ($i=0, $count = sizeof($parentCategories); $i < $count; $i++) {
110 echo str_repeat(' ', $i * 2);
112 echo html_image('ic/ofolder15.png', '15', '13', array());
114 if($parentCategories[$i]['id'] != $category->getId()) {
115 echo '<a href="?form_cat='.$parentCategories[$i]['id'].$discrim_url.'">';
119 echo $parentCategories[$i]['name'];
120 if($parentCategories[$i]['id'] != $category->getId()) {
128 $childrenCategories =& $category->getChildren();
130 $currentIndent .= str_repeat(' ', sizeof($parentCategories) * 2);
132 for($i = 0, $count = sizeof($childrenCategories); $i < $count; $i++) {
133 $childCategory =& $childrenCategories[$i];
136 echo '<a href="?form_cat='.$childCategory->getId().@$discrim_url.'">';
137 echo html_image('ic/cfolder15.png', '15', '13', array());
138 echo ' '.$childCategory->getLocalizedLabel().'</a>';
140 .sprintf(_('%1$s projects'), $childCategory->getSubProjectsCount())
150 // We display projects
152 $offset = getIntFromGet('offset');
153 $page = getIntFromGet('page');
155 $projectsResult = $category->getProjects($offset);
157 // store this as a var so it can be printed later as well
158 $html_limit = '<span style="text-align:center;font-size:smaller">';
159 $html_limit .= sprintf (ngettext ('<strong>%d</strong> project in result set.',
160 '<strong>%d</strong> projects in result set.',
164 // only display pages stuff if there is more to display
165 if ($querytotalcount > $TROVE_BROWSELIMIT) {
166 $html_limit .= ' ' . sprintf (ngettext ('Displaying %d project per page. Projects sorted by activity ranking.',
167 'Displaying %d projects per page. Projects sorted by activity ranking.',
172 // display all the numbers
173 for ($i=1;$i<=ceil($querytotalcount/$TROVE_BROWSELIMIT);$i++) {
175 $displayed_i = "<$i>" ;
177 $html_limit .= "<strong>$displayed_i</strong>" ;
179 $html_limit .= url_make_link ("/softwaremap/trove_list.php?form_cat=$form_cat&page=$i",
186 $html_limit .= '</span>';
188 print $html_limit."<hr />\n";
190 ?><table border="0" cellpadding="0" width="100%"><?php
191 while($project = db_fetch_array($projectsResult)) {
194 <td colspan="2"><?php
196 echo util_make_link_g ($project['unix_group_name'],
197 $project['group_id'],
198 '<strong>'.htmlspecialchars($project['group_name']).'</strong>');
199 if ($project['short_description']) {
200 echo ' - '.htmlspecialchars($project['short_description']);
208 // list all trove categories
209 //print trove_getcatlisting($row_grp['group_id'],1,0);
212 Activity Percentile: <strong><?php echo number_format($project['percentile'],2) ?></strong>
213 <br />Activity Ranking: <strong><?php echo number_format($project['ranking'],2) ?></strong>
214 <br />Register Date: <strong><?php echo date($sys_datefmt, $project['register_time']) ?></strong>
218 <td colspan="2"><hr /></td>
224 // print bottom navigation if there are more projects to display
225 if ($querytotalcount > $TROVE_BROWSELIMIT) {
229 $HTML->footer(array());