* FusionForge navigation
*
* Copyright 2009 - 2010, Olaf Lenz
+ * Copyright 2011, Franck Villaume - TrivialDev
*
- * This file is part of FusionForge.
+ * This file is part of FusionForge. FusionForge is free software;
+ * you can redistribute it and/or modify it under the terms of the
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
*
- * FusionForge is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * FusionForge is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once $gfwww.'search/include/SearchManager.class.php';
-
+
/**
* This class provides all the navigational elements to be used by the themes,
* like the site menu, the project menus, and the user links.
* $params contains a value for the key 'title', this title
* is appended to the title generated here. If $asHTML is
* set to false, it will return only the title in plain
- * text. */
+ * text.
+ */
function getTitle($params, $asHTML = true) {
if (!$asHTML) {
// get the title
- if (!$params['title']) {
+ if (!isset($params['title'])) {
return forge_get_config('forge_name');
} else {
return forge_get_config('forge_name') . ': ' . $params['title'];
/** Get the HTML code for the favicon links of the site (to be
* put into the <head>. If $asHTML is false, it will return
* the URL of the favicon.
- *
+ *
* @todo: Make favicon configurable
*/
function getFavIcon($asHTML = true) {
if (!$asHTML) {
return util_make_url('/images/icon.png');
} else {
- return '<link rel="icon" type="image/png" href="'
- . $this->getFavIcon(false) .'" />'
+ return '<link rel="icon" type="image/png" href="'
+ . $this->getFavIcon(false) .'" />'
. '<link rel="shortcut icon" type="image/png" href="'
. $this->getFavIcon(false) .'" />';
}
* into the <head>. If $asHTML is false, it will return an
* array with the following structure: $result['titles']:
* list of titles of the feeds; $result['urls'] list of urls
- * of the feeds. */
+ * of the feeds.
+ */
function getRSS($asHTML = true) {
if (!$asHTML) {
$res = array();
$feeds = $this->getRSS(false);
for ($j = 0; $j < count($feeds['urls']); $j++) {
echo '
- <link rel="alternate" title="' . $feeds['titles'][$j]
- . '" href="' . $feeds['urls'][$j]
- . '" type="application/rss+xml"/>';
+ <link rel="alternate" title="' .
+ util_html_secure($feeds['titles'][$j]) .
+ '" href="' . $feeds['urls'][$j] .
+ '" type="application/rss+xml"/>';
}
}
}
- /** Get the searchBox HTML code. */
+ /**
+ * Get the searchBox HTML code.
+ */
function getSearchBox() {
- global $words,$forum_id,$group_id,$group_project_id,$atid,$exact,$type_of_search;
+ global $words, $forum_id, $group_id, $group_project_id, $atid, $exact, $type_of_search;
$res = "";
if (get_magic_quotes_gpc()) {
}
$defaultWords = htmlspecialchars($defaultWords);
-
+
// if there is no search currently, set the default
if (!isset($type_of_search) ) {
$exact = 1;
$searchManager->setParametersValues($parameters);
$searchEngines =& $searchManager->getAvailableSearchEngines();
- $res .= '<label for="searchBox-words">
- <select name="type_of_search">';
+ $res .= '<select name="type_of_search">';
for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
$searchEngine =& $searchEngines[$i];
- $res .= '<option value="' . $searchEngine->getType() . '"'
+ $res .= '<option value="' . $searchEngine->getType() . '"'
. ( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' )
. '>' . $searchEngine->getLabel($parameters) . '</option>' . "\n";
}
- $res .= '</select></label>';
+ $res .= '</select>';
$parameters = $searchManager->getParameters();
foreach($parameters AS $name => $value) {
$res .= '<input type="hidden" value="'.$value.'" name="'.$name.'" />' . "\n";
}
- $res .= '<input type="text" size="12" id="searchBox-words" name="words" value="'
+ $res .= '<input type="text" size="12" id="searchBox-words" name="words" value="'
. $defaultWords . '" />' . "\n";
$res .= '<input type="submit" name="Search" value="'._('Search').'" />' . "\n";
if (isset($group_id) && $group_id) {
- $res .= util_make_link('/search/advanced_search.php?group_id=' .
+ $res .= util_make_link('/search/advanced_search.php?group_id=' .
$group_id, _('Advanced search'));
}
$res .= '</div>';
return $res;
}
- /** Get an array of the user links (Login/Logout/My
- Account/Register) with the following structure:
- $result['titles']: list of the titles. $result['urls']: list
- of the urls.
+ /**
+ * Get an array of the user links (Login/Logout/My Account/Register) with the following structure:
+ * $result['titles']: list of the titles. $result['urls']: list of the urls.
*/
function getUserLinks() {
$res = array();
$url .= urlencode(getStringFromServer('REQUEST_URI'));
}
$res['titles'][] = _('Log In');
- $res['urls'][] = util_make_url($url);
+ $res['urls'][] = util_make_uri($url);
if (!forge_get_config ('user_registration_restricted')) {
$res['titles'][] = _('New Account');
- $res['urls'][] = util_make_url('/account/register.php');
+ $res['urls'][] = util_make_uri('/account/register.php');
}
}
return $res;
}
- /** Get an array of the menu of the site with the following
- * structure: $result['titles']: list of titles of the
- * links. $result['urls']: list of urls. $result['selected']:
- * number of the selected menu entry.
+ /**
+ * Get an array of the menu of the site with the following structure:
+ * $result['titles']: list of titles of the links.
+ * $result['urls']: list of urls.
+ * $result['tooltips']: list of tooltips (html title).
+ * $result['selected']: number of the selected menu entry.
*/
function getSiteMenu() {
$request_uri = getStringFromServer('REQUEST_URI');
$menu = array();
$menu['titles'] = array();
$menu['urls'] = array();
+ $menu['tooltips'] = array();
$selected = 0;
// Home
$menu['titles'][] = _('Home');
$menu['urls'][] = util_make_uri('/');
+ $menu['tooltips'][] = _('Main Page');
// My Page
- $menu['titles'][] = _('My Page');
+ $menu['titles'][] = _('My Page');
$menu['urls'][] = util_make_uri('/my/');
+ $menu['tooltips'][] = _('Your Page, widgets selected by you to follow your items.');
if (strstr($request_uri, util_make_uri('/my/'))
|| strstr($request_uri, util_make_uri('/account/'))
|| strstr($request_uri, util_make_uri('/register/'))
|| strstr($request_uri, util_make_uri('/themes/'))
)
{
- $selected=count($menu['urls'])-1;
+ $selected = count($menu['urls'])-1;
}
if (forge_get_config('use_trove') || forge_get_config('use_project_tags') || forge_get_config('use_project_full_list')) {
$menu['titles'][] = _('Projects');
- $menu['urls'][] = util_make_uri('/softwaremap/') ;
+ $menu['urls'][] = util_make_uri('/softwaremap/');
+ $menu['tooltips'][] = _('Map of projects, by categories or types.');
if (strstr($request_uri, util_make_uri('/softwaremap/'))) {
- $selected=count($menu['urls'])-1;
+ $selected = count($menu['urls'])-1;
}
}
if (forge_get_config('use_snippet')) {
- $menu['titles'][] = _('Code Snippets');
- $menu['urls'][] = util_make_uri('/snippet/') ;
+ $menu['titles'][] = _('Code Snippets');
+ $menu['urls'][] = util_make_uri('/snippet/');
+ $menu['tooltips'][] = _('Tooling library. Small coding tips.');
if (strstr($request_uri, util_make_uri('/snippet/'))) {
- $selected=count($menu['urls'])-1;
+ $selected = count($menu['urls'])-1;
}
}
if (forge_get_config('use_people')) {
- $menu['titles'][] = _('Project Openings');
- $menu['urls'][] = util_make_uri('/people/') ;
+ $menu['titles'][] = _('Project Openings');
+ $menu['urls'][] = util_make_uri('/people/');
+ $menu['tooltips'][] = _('Hiring Market Place.');
if (strstr($request_uri, util_make_uri('/people/'))) {
$selected=count($menu['urls'])-1;
}
$before = count($menu['urls']);
$plugin_urls = array();
$hookParams['DIRS'] = &$menu['urls'];
+ $hookParams['ADMIN'] =& $menu['adminurls'];
$hookParams['TITLES'] = &$menu['titles'];
+ $hookParams['TOOLTIPS'] = &$menu['tooltips'];
plugin_hook("outermenu", $hookParams);
// try to find selected entry
}
}
- // Admin and Reporting
+ // Admin and Reporting
if (forge_check_global_perm('forge_admin')) {
$user_is_super = true;
$menu['titles'][] = _('Site Admin');
- $menu['urls'][] = util_make_url('/admin/') ;
+ $menu['urls'][] = util_make_uri('/admin/');
+ $menu['tooltips'][] = _('Administration Submenu to handle global configuration, users & projects.');
if (strstr($request_uri, util_make_uri('/admin/'))) {
- $selected=count($menu['urls'])-1;
+ $selected = count($menu['urls'])-1;
}
}
if (forge_check_global_perm ('forge_stats', 'read')) {
$menu['titles'][] = _('Reporting');
- $menu['urls'][] = util_make_uri('/reporting/') ;
+ $menu['urls'][] = util_make_uri('/reporting/');
+ $menu['tooltips'][] = _('Statistics about visits, users & projects in time frame.');
if (strstr($request_uri, util_make_uri('/reporting/'))) {
- $selected=count($menu['urls'])-1;
+ $selected = count($menu['urls'])-1;
}
}
// Project
- if (isset($GLOBALS['group_id'])) {
+ if (isset($GLOBALS['group_id'])) {
// get group info using the common result set
$project =& group_get_object($GLOBALS['group_id']);
+ if (is_int($project) && $project == 0) {
+ if (preg_match('/root=/',$request_uri)) {
+ $project_name = preg_replace('/.*?root=/', '', $request_uri);
+ $project =& group_get_object_by_name($project_name);
+ }
+ }
if ($project && is_object($project)) {
if ($project->isError()) {
} elseif (!$project->isProject()) {
} else {
$menu['titles'][] = $project->getPublicName();
+ $menu['tooltips'][] = _('Project home page, widgets selected to follow specific items.');
if (isset ($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
$menu['urls'][]=util_make_uri('/project/?group_id') .$project->getId();
} else {
return $menu;
}
- /** Get a reference to an array of the projects menu for the
- * project with the id $group_id with the following
- * structure: $result['starturl']: URL of the
- * projects starting page; $result['name']: public name of
- * the project; $result['titles']: list of titles of the menu
- * entries; $result['urls']: list of urls of the menu
- * entries; $result['adminurls']: list of urls to the admin
- * pages of the menu entries. If the user has no admin
- * permissions, the correpsonding adminurl is
- * false. $result['selected']: number of the menu entry that
- * is currently selected.
+ /**
+ * Get a reference to an array of the projects menu for the project with the id $group_id with the following structure:
+ * $result['starturl']: URL of the projects starting page;
+ * $result['name']: public name of the project;
+ * $result['titles']: list of titles of the menu entries;
+ * $result['tooltips']: list of tooltips (html title) of the menu entries;
+ * $result['urls']: list of urls of the menu entries;
+ * $result['adminurls']: list of urls to the admin pages of the menu entries.
+ * If the user has no admin permissions, the correpsonding adminurl is false.
+ * $result['selected']: number of the menu entry that is currently selected.
*/
function getProjectMenu($group_id, $toptab = "") {
// rebuild menu if it has never been built before, or
// if the toptab was set differently
if (!isset($this->project_menu_data[$group_id])
- || ($toptab != "")
+ || ($toptab != "")
|| ($toptab != $this->project_menu_data[$group_id]['last_toptab'])) {
// get the group and permission objects
$group = group_get_object($group_id);
$menu =& $this->project_menu_data[$group_id];
$menu['titles'] = array();
- $menu['urls'] = array();
- $menu['adminurls'] = array();
+ $menu['tooltips'] = array();
+ $menu['urls'] = array();
+ $menu['adminurls'] = array();
$menu['name'] = $group->getPublicName();
- // Summary
- $menu['titles'][] = _('Summary');
- if (isset($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
- $url = util_make_uri('/project/?group_id=' . $group_id);
- } else {
- $url = util_make_uri('/projects/' . $group->getUnixName() .'/');
- }
- $menu['urls'][] = $url;
- $menu['adminurls'][] = false;
- if ($toptab == "home") {
- $selected = (count($menu['urls'])-1);
- }
-
- // setting these allows to change the initial project page
- $menu['starturl'] = $url;
-
- // Project Admin
- if (forge_check_perm ('project_admin', $group_id)) {
- $menu['titles'][] = _('Admin');
- $menu['urls'][] = util_make_uri('/project/admin/?group_id=' . $group_id);
- $menu['adminurls'][] = false;
- if ($toptab == "admin") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- /* Homepage
- // check for use_home_tab?
- $TABS_DIRS[]='http://'. $this->getHomePage();
- $TABS_TITLES[]=_('Home Page');
- */
-
- // Project Activity tab
- $menu['titles'][] = _('Activity');
- $menu['urls'][] = util_make_uri('/activity/?group_id=' . $group_id);
- $menu['adminurls'][] = false;
- if ($toptab == "activity") {
- $selected = (count($menu['urls'])-1);
- }
-
- // Forums
- if ($group->usesForum()) {
- $menu['titles'][] = _('Forums');
- $menu['urls'][] = util_make_uri('/forum/?group_id=' . $group_id);
- if (forge_check_perm ('forum_admin', $group_id)) {
- $menu['adminurls'][] = util_make_url('/forum/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "forums") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // Artifact Tracking
- if ($group->usesTracker()) {
- $menu['titles'][] = _('Tracker');
- $menu['urls'][] = util_make_uri('/tracker/?group_id=' . $group_id);
- if (forge_check_perm ('tracker_admin', $group_id)) {
- $menu['adminurls'][] = util_make_url('/tracker/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "tracker" ||
- $toptab == "bugs" ||
- $toptab == "support" ||
- $toptab == "patch") {
+ // Summary
+ $menu['titles'][] = _('Summary');
+ $menu['tooltips'][] = _('Project Homepage. Widgets oriented');
+ if (isset($GLOBALS['sys_noforcetype']) && $GLOBALS['sys_noforcetype']) {
+ $url = util_make_uri('/project/?group_id=' . $group_id);
+ } else {
+ $url = util_make_uri('/projects/' . $group->getUnixName() .'/');
+ }
+ $menu['urls'][] = $url;
+ $menu['adminurls'][] = false;
+ if ($toptab == "home") {
+ $selected = (count($menu['urls'])-1);
+ }
+
+ // setting these allows to change the initial project page
+ $menu['starturl'] = $url;
+
+ // Project Admin
+ if (forge_check_perm ('project_admin', $group_id)) {
+ $menu['titles'][] = _('Admin');
+ $menu['tooltips'][] = _('Project Administration.');
+ $menu['urls'][] = util_make_uri('/project/admin/?group_id=' . $group_id);
+ $menu['adminurls'][] = false;
+ if ($toptab == "admin") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ /* Homepage
+ // check for use_home_tab?
+ $TABS_DIRS[]='http://'. $this->getHomePage();
+ $TABS_TITLES[]=_('Home Page');
+ */
+
+ // Project Activity tab
+ $menu['titles'][] = _('Activity');
+ $menu['tooltips'][] = _('Last activities per category.');
+ $menu['urls'][] = util_make_uri('/activity/?group_id=' . $group_id);
+ $menu['adminurls'][] = false;
+ if ($toptab == "activity") {
+ $selected = (count($menu['urls'])-1);
+ }
+
+ // Forums
+ if ($group->usesForum()) {
+ $menu['titles'][] = _('Forums');
+ $menu['tooltips'][] = _('Tech & help forums.');
+ $menu['urls'][] = util_make_uri('/forum/?group_id=' . $group_id);
+ if (forge_check_perm ('forum_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/forum/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "forums") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // Artifact Tracking
+ if ($group->usesTracker()) {
+ $menu['titles'][] = _('Tracker');
+ $menu['tooltips'][] = _('Issues, tickets, bugs.');
+ $menu['urls'][] = util_make_uri('/tracker/?group_id=' . $group_id);
+ if (forge_check_perm ('tracker_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/tracker/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "tracker" ||
+ $toptab == "bugs" ||
+ $toptab == "support" ||
+ $toptab == "patch") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // Mailing Lists
+ if ($group->usesMail()) {
+ $menu['titles'][] = _('Lists');
+ $menu['tooltips'][] = _('Mailing Lists.');
+ $menu['urls'][] = util_make_uri('/mail/?group_id=' . $group_id);
+ if (forge_check_perm ('project_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/mail/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "mail") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // Project/Task Manager
+ if ($group->usesPm()) {
+ $menu['titles'][] = _('Tasks');
+ $menu['tooltips'][] = _('Project Management.');
+ $menu['urls'][] = util_make_uri('/pm/?group_id=' . $group_id);
+ if (forge_check_perm ('pm_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/pm/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "pm") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // Doc Manager
+ if ($group->usesDocman()) {
+ $menu['titles'][] = _('Docs');
+ $menu['tooltips'][] = _('Document Management.');
+ $menu['urls'][] = util_make_uri('/docman/?group_id=' . $group_id);
+ if (forge_check_perm ('docman', $group_id, 'approve')) {
+ $menu['adminurls'][] = util_make_uri('/docman/?group_id='.$group_id.'&view=admin');
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "docman") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // Surveys
+ if ($group->usesSurvey()) {
+ $menu['titles'][] = _('Surveys');
+ $menu['tooltips'][] = _('Online surveys, project needs your point of view.');
+ $menu['urls'][] = util_make_uri('/survey/?group_id=' . $group_id);
+ if (forge_check_perm ('project_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/survey/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "surveys") {
$selected = (count($menu['urls'])-1);
}
- }
-
- // Mailing Lists
- if ($group->usesMail()) {
- $menu['titles'][] = _('Lists');
- $menu['urls'][] = util_make_uri('/mail/?group_id=' . $group_id);
- if (forge_check_perm ('project_admin', $group_id)) {
- $menu['adminurls'][] = util_make_url('/mail/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "mail") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // Project/Task Manager
- if ($group->usesPm()) {
- $menu['titles'][] = _('Tasks');
- $menu['urls'][] = util_make_uri('/pm/?group_id=' . $group_id);
- if (forge_check_perm ('pm_admin', $group_id)) {
- $menu['adminurls'][] = util_make_uri('/pm/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "pm") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // Doc Manager
- if ($group->usesDocman()) {
- $menu['titles'][] = _('Docs');
- $menu['urls'][] = util_make_uri('/docman/?group_id=' . $group_id);
- if (forge_check_perm ('docman', $group_id, 'approve')) {
- $menu['adminurls'][] = util_make_uri('/docman/?group_id='.$group_id.'&view=admin');
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "docman") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // Surveys
- if ($group->usesSurvey()) {
- $menu['titles'][] = _('Surveys');
- $menu['urls'][] = util_make_uri('/survey/?group_id=' . $group_id);
- if (forge_check_perm ('project_admin', $group_id)) {
- $menu['adminurls'][] = util_make_uri('/survey/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "surveys") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // News
- if ($group->usesNews()) {
- $menu['titles'][] = _('News');
- $menu['urls'][] = util_make_uri('/news/?group_id=' . $group_id);
- if (forge_check_perm ('project_admin', $group_id)) {
- $menu['adminurls'][] = util_make_uri('/news/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "news") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // SCM systems
- if ($group->usesSCM()) {
- $menu['titles'][] = _('SCM');
- $menu['urls'][] = util_make_uri('/scm/?group_id=' . $group_id);
- // eval cvs_flags?
- if (forge_check_perm ('project_admin', $group_id)) {
- $menu['adminurls'][] = util_make_uri('/scm/admin/?group_id='.$group_id);
- } else {
- $menu['adminurls'][] = false;
- }
- if ($toptab == "scm") {
- $selected = (count($menu['urls'])-1);
- }
- }
-
- // groupmenu_after_scm hook
- $hookParams = array();
- $hookParams['group_id'] = $group_id ;
- $hookParams['DIRS'] =& $menu['urls'];
- $hookParams['TITLES'] =& $menu['titles'];
- $hookParams['toptab'] =& $toptab;
- $hookParams['selected'] =& $selected;
- plugin_hook ("groupmenu_scm", $hookParams) ;
-
- // fill up adminurls
- for ($i = 0; $i < count($menu['urls']) - count($menu['adminurls']); $i++) {
- $menu['adminurls'][] = false;
- }
+ }
+
+ // News
+ if ($group->usesNews()) {
+ $menu['titles'][] = _('News');
+ $menu['tooltips'][] = _('Flash head line from the project.');
+ $menu['urls'][] = util_make_uri('/news/?group_id=' . $group_id);
+ if (forge_check_perm ('project_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/news/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "news") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // SCM systems
+ if ($group->usesSCM()) {
+ $menu['titles'][] = _('SCM');
+ $menu['tooltips'][] = _('Source Content Management, peer-review and source discovery.');
+ $menu['urls'][] = util_make_uri('/scm/?group_id=' . $group_id);
+ // eval cvs_flags?
+ if (forge_check_perm ('project_admin', $group_id)) {
+ $menu['adminurls'][] = util_make_uri('/scm/admin/?group_id='.$group_id);
+ } else {
+ $menu['adminurls'][] = false;
+ }
+ if ($toptab == "scm") {
+ $selected = (count($menu['urls'])-1);
+ }
+ }
+
+ // groupmenu_after_scm hook
+ $hookParams = array();
+ $hookParams['group_id'] = $group_id ;
+ $hookParams['DIRS'] =& $menu['urls'];
+ $hookParams['ADMIN'] =& $menu['adminurls'];
+ $hookParams['TITLES'] =& $menu['titles'];
+ $hookParams['TOOLTIPS'] =& $menu['tooltips'];
+ $hookParams['toptab'] =& $toptab;
+ $hookParams['selected'] =& $selected;
+ plugin_hook ("groupmenu_scm", $hookParams);
+
+ // fill up adminurls
+ for ($i = 0; $i < count($menu['urls']) - count($menu['adminurls']); $i++) {
+ $menu['adminurls'][] = false;
+ }
// Downloads
if ($group->usesFRS()) {
$menu['titles'][] = _('Files');
+ $menu['tooltips'][] = _('All published files organized per version.');
$menu['urls'][] = util_make_uri('/frs/?group_id=' . $group_id);
if (forge_check_perm ('frs', $group_id, 'write')) {
$menu['adminurls'][] = util_make_uri('/frs/admin/?group_id='.$group_id);
// groupmenu hook
$hookParams = array();
- $hookParams['group'] = $group_id ;
+ $hookParams['group'] = $group_id;
$hookParams['DIRS'] =& $menu['urls'];
+ $hookParams['ADMIN'] =& $menu['adminurls'];
$hookParams['TITLES'] =& $menu['titles'];
+ $hookParams['TOOLTIPS'] =& $menu['tooltips'];
$hookParams['toptab'] =& $toptab;
$hookParams['selected'] =& $selected;
- plugin_hook ("groupmenu", $hookParams) ;
+ plugin_hook("groupmenu", $hookParams);
// fill up adminurls
for ($i = 0; $i < count($menu['urls']) - count($menu['adminurls']); $i++) {
$menu['last_toptab'] = $toptab;
}
}
- return $this->project_menu_data[$group_id] ;
+ return $this->project_menu_data[$group_id];
}
/**
function getPoweredBy($asHTML=true) {
$res['url'] = 'http://fusionforge.org/';
$res['image'] = util_make_uri('/images/pow-fusionforge.png');
- $res['title'] = '<img src="'
- . $res['image']
- . '" alt="Powered By FusionForge" border="0" />';
+ $res['title'] = '<img src="'
+ . $res['image']
+ . '" alt="Powered By FusionForge" />';
$res['html'] = util_make_link($res['url'], $res['title'], array(), true);
if ($asHTML) {
return $res['html'];
*/
function getShowSource($asHTML=true) {
if (forge_get_config('show_source')) {
- $res['url'] = util_make_url('/source.php?file='.getStringFromServer('SCRIPT_NAME'));
- $res['title'] = _('Show source');
+ $res['url'] = util_make_uri('/source.php?file='.getStringFromServer('SCRIPT_NAME'));
+ $res['title'] = _('Show source');
} else {
- return ($asHTML ? "" : NULL);
+ return ($asHTML ? "" : NULL);
}
- if (!$asHTML) {
- return $res;
+ if (!$asHTML) {
+ return $res;
} else {
- return util_make_link($res['url'], $res['title'],
- array('class' => 'showsource'),
- true);
+ return util_make_link($res['url'], $res['title'],
+ array('class' => 'showsource'),
+ true);
}
}
}