* Copyright 1999-2001 (c) VA Linux Systems
* Copyright 2010 - Alain Peyrat
* Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2010-2011, Alain Peyrat - Alcatel-Lucent
+ * Copyright 2010-2012, Alain Peyrat - Alcatel-Lucent
+ * Copyright © 2011 Thorsten Glaser – tarent GmbH
+ * Copyright 2011 - Marc-Etienne Vargenau, Alcatel-Lucent
+ * Copyright 2012 - Franck Villaume - TrivialDev
+ * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
* http://fusionforge.org
*
- * 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 License, or
- * (at your option) any later version.
+ * 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 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.
*/
/**
* Which doctype to use. Can be configured in the
* constructor. If set to 'strict', headerHTMLDeclaration will
* create a doctype definition that uses the strict doctype,
- * otherwise it will use the transitional doctype.
+ * otherwise it will use the transitional doctype.
* @var string $doctype
*/
var $doctype = 'transitional';
/**
- * The default main page content
+ * The default main page content
* @var string $rootindex
*/
var $rootindex = 'index_std.php';
/**
* The base directory of the theme in the servers file system
* @var string $themedir
- */
+ */
var $themedir;
/**
* The base url of the theme
* @var string $themeurl
- */
+ */
var $themeurl;
/**
* The base directory of the image files in the servers file system
* @var string $imgdir
- */
+ */
var $imgdir;
/**
* The base url of the image files
* @var string $imgbaseurl
- */
+ */
var $imgbaseurl;
/**
* The base directory of the js files in the servers file system
* @var string $jsdir
- */
+ */
var $jsdir;
/**
* The base url of the js files
* @var string $jsbaseurl
- */
+ */
var $jsbaseurl;
/**
var $js = array();
var $js_min = array();
var $javascripts = array();
+ var $javascripts_loaded = array();
var $css = array();
var $css_min = array();
var $stylesheets = array();
+ var $stylesheets_loaded = array();
/**
* Layout() - Constructor
}
/**
- * Constructs a list of Javascript files followed by some timestamp
+ * Build the list of required Javascript files.
+ *
+ * If js file is found, then a timestamp is automatically added to ensure
+ * that file is cached only if not changed.
*
- * TODO document the purpose of this : probably to avoid caching versions updated on the server
* @param string $js path to the JS file
*/
function addJavascript($js) {
- // TODO : what's the point of this ? ... unused ?
+ // If a minified version of the javascript is available, then use it.
if (isset($this->js_min[$js])) {
$js = $this->js_min[$js];
}
}
}
+ /**
+ * getJavascripts - include javascript in html page. check to load only once the file
+ */
function getJavascripts() {
$code = '';
foreach ($this->javascripts as $js) {
- $code .= ' <script type="text/javascript" src="'.$js.'"></script>'."\n";
+ if (!in_array($js, $this->javascripts_loaded)) {
+ $code .= "\t\t\t";
+ $code .= '<script type="text/javascript" src="'.$js.'"></script>'."\n";
+ $this->javascripts_loaded[] = $js;
+ }
}
return $code;
}
+ /**
+ * getStylesheets - include stylesheet in html page. check to load only once the file
+ */
function getStylesheets() {
$code = '';
foreach ($this->stylesheets as $c) {
- if ($c['media']) {
- $code .= ' <link rel="stylesheet" type="text/css" href="'.$c['css'].'" media="'.$c['media'].'" />'."\n";
- } else {
- $code .= ' <link rel="stylesheet" type="text/css" href="'.$c['css'].'"/>'."\n";
+ if (!in_array($c, $this->stylesheets_loaded)) {
+ $code .= "\t\t\t";
+ if ($c['media']) {
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$c['css'].'" media="'.$c['media'].'" />'."\n";
+ } else {
+ $code .= '<link rel="stylesheet" type="text/css" href="'.$c['css'].'"/>'."\n";
+ }
+ $this->stylesheets_loaded[] = $c;
}
}
return $code;
}
- /**
- * header() - generates the complete header of page by calling
+ /**
+ * header() - generates the complete header of page by calling
* headerStart() and bodyHeader().
*/
function header($params) {
}
/**
- * headerStart() - generates the header code for all themes up to the
+ * headerStart() - generates the header code for all themes up to the
* closing </head>.
- * Override any of the methods headerHTMLDeclaration(), headerTitle(),
- * headerFavIcon(), headerRSS(), headerSearch(), headerCSS(), or
- * headerJS() to adapt your theme.
+ * Override any of the methods headerHTMLDeclaration(), headerTitle(),
+ * headerFavIcon(), headerRSS(), headerSearch(), headerCSS(), or
+ * headerJS() to adapt your theme.
*
* @param array Header parameters array
*/
function headerStart($params) {
$this->headerHTMLDeclaration();
?>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<?php if (isset($params['meta-description'])) { ?>
+ <meta name="description" content="<?php echo $params['meta-description'] ?>" />
+<?php } ?>
+<?php if (isset($params['meta-keywords'])) { ?>
+ <meta name="keywords" content="<?php echo $params['meta-keywords'] ?>" />
+<?php } ?>
<?php
plugin_hook('htmlhead', array());
$this->headerTitle($params);
$this->headerRSS();
$this->headerSearch();
$this->headerCSS();
- $this->headerJS();
- $this->headerForgepluckerMeta();
+ $this->headerJS();
+ $this->headerForgepluckerMeta();
+ $this->headerLinkedDataAutodiscovery();
?>
- </head>
+ </head>
<?php
- }
+ }
/**
* headerHTMLDeclaration() - generates the HTML declaration, i.e. the
- * XML declaration, the doctype definition, and the opening <html>.
+ * XML declaration, the doctype definition, and the opening <html>.
*
*/
function headerHTMLDeclaration() {
global $sysDTDs, $sysXMLNSs;
- print '<?xml version="1.0" encoding="utf-8"?>'."\n";
+ print '<' . '?xml version="1.0" encoding="utf-8"?>'."\n";
if (!util_ifsetor($this->doctype) || !util_ifsetor($sysDTDs[$this->doctype])) {
$this->doctype = 'transitional';
}
}
/**
- * headerTitle() - creates the <title> header
+ * headerTitle() - creates the <title> header
*
* @param array Header parameters array
*/
*
*/
function headerSearch() {
- echo '<link rel="search" title="'
- . forge_get_config ('forge_name').'" href="'
- . util_make_url ('/export/search_plugin.php')
+ echo '<link rel="search" title="'
+ . forge_get_config ('forge_name').'" href="'
+ . util_make_url ('/export/search_plugin.php')
. '" type="application/opensearchdescription+xml"/>'."\n";
}
- /**
+ /**
* Create the CSS headers for all cssfiles in $cssfiles and
* calls the plugin cssfile hook.
*/
<script type="text/javascript" src="/scripts/codendi/ReorderColumns.js"></script>
<script type="text/javascript" src="/scripts/codendi/codendi-1236793993.js"></script>
<script type="text/javascript" src="/scripts/codendi/validate.js"></script>
- <script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>';
+ <script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>
+ <script language="JavaScript" type="text/javascript">/* <![CDATA[ */';
+ plugin_hook ("javascript",false);
+ echo '
+ /* ]]> */</script>';
plugin_hook ("javascript_file",false);
echo $this->getJavascripts();
-
+
// invoke the 'javascript' hook for custom javascript addition
$params = array('return' => false);
plugin_hook("javascript",$params);
}
}
+ /**
+ * headerLinkedDataAutodiscovery() - creates the link+meta links to alternate
+ * representations for Linked Data autodiscovery
+ */
+ function headerLinkedDataAutodiscovery() {
+ // Only activated for /projects or /users for the moment
+ $script_name = getStringFromServer('SCRIPT_NAME');
+
+ if ($script_name == '/projects' || $script_name == '/users') {
+
+ $php_self = getStringFromServer('PHP_SELF');
+
+ // invoke the 'alt_representations' hook
+ $params = array('script_name' => $script_name,
+ 'php_self' => $php_self,
+ 'return' => array());
+
+ plugin_hook_by_reference('alt_representations', $params);
+
+ foreach($params['return'] as $link) {
+ echo " $link"."\n";
+ }
+ }
+ }
+
function headerForgepluckerMeta() {
/*-
* Forge-Identification Meta Header, Version 1.0
<td class="projecttab" ><img src="<?php echo $this->imgbaseurl; ?>clear.png" width="10" height="1" alt="" /></td>
<td valign="top" width="99%" class="projecttab">
- <?php
+ <?php
}
<?php echo $this->navigation->getPoweredBy(); ?>
</div>
- <?php echo $this->navigation->getShowSource(); ?>
+ <?php echo $this->navigation->getShowSource();
+
+ plugin_hook('webanalytics_url', array());
+
+ ?>
</body>
</html>
return '
<!-- Box Top Start -->
- <table cellspacing="0" cellpadding="0" width="100%" border="0" style="background:url('.$this->imgbaseurl.'vert-grad.png)">
+ <table class="fullwidth" style="background:url('.$this->imgroot.'vert-grad.png)">
<tr class="align-center">
<td valign="top" align="right" width="10" style="background:url('.$this->imgbaseurl.'box-topleft.png)"><img src="'.$this->imgbaseurl.'clear.png" width="10" height="20" alt="" /></td>
<td width="100%" style="background:url('.$this->imgbaseurl.'box-grad.png)"><span class="titlebar">'.$title.'</span></td>
<tr class="align-center">
<td colspan="2" style="background:url('.$this->imgbaseurl.'box-grad.png)"><span class="titlebar">'.$title.'</span></td>
</tr>
- <tr align="left">
+ <tr class="align-left">
<td colspan="2">
<!-- Box Middle End -->';
}
}
$return = "\n".
'<table'.$args.'>';
-
+
if (count($titleArray)) {
$return .= '<thead><tr>';
echo '
<form id="quicknavform" name="quicknavform" action=""><div>
- <select name="quicknav" id="quicknav" onChange="location.href=document.quicknavform.quicknav.value">
+ <select name="quicknav" id="quicknav" onchange="location.href=document.quicknavform.quicknav.value">
<option value="">'._('Quick Jump To...').'</option>';
foreach ($groups as $g) {
$menu = $this->navigation->getProjectMenu($group_id);
echo '
- <option value="' . $menu['starturl'] . '">'
+ <option value="' . $menu['starturl'] . '">'
. $menu['name'] .'</option>';
for ($j = 0; $j < count($menu['urls']); $j++) {
echo '
- <option value="' . $menu['urls'][$j] .'"> '
+ <option value="' . $menu['urls'][$j] .'"> '
. $menu['titles'][$j] . '</option>';
if (@$menu['adminurls'][$j]) {
echo '
- <option value="' . $menu['adminurls'][$j]
- . '"> '
+ <option value="' . $menu['adminurls'][$j]
+ . '"> '
. _('Admin') . '</option>';
}
}
function projectTabs($toptab, $group_id) {
// get group info using the common result set
$menu = $this->navigation->getProjectMenu($group_id, $toptab);
- echo $this->tabGenerator($menu['urls'], $menu['titles'], true, $menu['selected'], 'white');
+ echo $this->tabGenerator($menu['urls'], $menu['titles'], $menu['tooltips'], true, $menu['selected'], 'white');
}
function tabGenerator($TABS_DIRS, $TABS_TITLES, $TABS_TOOLTIPS, $nested=false, $selected=false, $sel_tab_bgcolor='white', $total_width='100%') {
// $rowspan=(($issel)?'rowspan="2" ' : '');
$return .= '
- <td '.$rowspan.'valign="top" width="10" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-end-'.(($issel) ? '' : 'not').'selected.png)">'.
+ <td '.$rowspan.'class="top" width="10" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-end-'.(($issel) ? '' : 'not').'selected.png)">'.
'<img src="'.$this->imgbaseurl . 'clear.png" height="25" width="10" alt="" /></td>'.
'<td '.$rowspan.'style="background:url('.$this->imgbaseurl . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).'</td>';
} elseif ($i==$count-1) {
// Build image between current and prior tab
//
$return .= '
- <td '.$rowspan.'colspan="2" valign="top" width="20" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
+ <td '.$rowspan.'colspan="2" class="top" width="20" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
'<img src="'.$this->imgbaseurl . 'clear.png" height="2" width="20" alt="" /></td>'.
'<td '.$rowspan.'style="background:url('.$this->imgbaseurl . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link($TABS_DIRS[$i], $TABS_TITLES[$i], array('class'=>(($issel)?'tabsellink':'tablink')), true).'</td>';
//
// Last graphic on right-side
//
$return .= '
- <td '.$rowspan.'valign="top" width="10" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($issel) ? '' : 'not').'selected-end.png)">'.
+ <td '.$rowspan.'class="top" width="10" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($issel) ? '' : 'not').'selected-end.png)">'.
'<img src="'.$this->imgbaseurl . 'clear.png" height="2" width="10" alt="" /></td>';
} else {
// Build image between current and prior tab
//
$return .= '
- <td '.$rowspan.'colspan="2" valign="top" width="20" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
+ <td '.$rowspan.'colspan="2" class="top" width="20" style="background:url('.$this->imgbaseurl . 'theme-'.$inner.'-'.(($wassel) ? '' : 'not').'selected-'.(($issel) ? '' : 'not').'selected.png)">'.
'<img src="'.$this->imgbaseurl . 'clear.png" height="2" width="20" alt="" /></td>'.
'<td '.$rowspan.'style="background:url('.$this->imgbaseurl . $bgimg.')" width="'.$width.'%" align="center">'.util_make_link($TABS_DIRS[$i], $TABS_TITLES[$i], array('class'=>(($issel)?'tabsellink':'tablink')), true).'</td>';
return $return.'
- </table>
+ </table>
<!-- end tabs -->
';
$return = '';
for ($i=0; $i<$count; $i++) {
- $return .= util_make_link($links_arr[$i],$title_arr[$i],$attr_arr[$i]).' | ';
+ $return .= util_make_link($links_arr[$i],$title_arr[$i],$attr_arr[$i]). $this->subMenuSeparator();
}
$return .= util_make_link($links_arr[$i],$title_arr[$i],$attr_arr[$i]);
return $return;
}
+ /**
+ * subMenuSeparator() - returns the separator used between submenus
+ *
+ * @return string Html to build a submenu separator.
+ */
+ function subMenuSeparator() {
+ return '';
+ }
+
/**
* subMenu() - Takes two array of titles and links and build a menu.
*
return '';
} else {
return '
- <div class="feedback">'.strip_tags($feedback, '<br>').'</div>';
+ <p class="feedback">'.strip_tags($feedback, '<br>').'</p>';
}
}
/**
return '';
} else {
return '
- <div class="warning_msg">'.strip_tags($msg, '<br>').'</div>';
+ <p class="warning_msg">'.strip_tags($msg, '<br>').'</p>';
}
}
return '';
} else {
return '
- <div class="error">'.strip_tags($msg, '<br>').'</div>';
+ <div class="error">' .
+ util_pwrap(strip_tags($msg, '<br>')) .
+ "</div>\n";
}
}
+ /**
+ * information() - returns the htmlized information string.
+ *
+ * @param string msg string
+ * @return string htmlized information
+ */
+ function information($msg) {
+ if (!$msg) {
+ return '';
+ } else {
+ return '
+ <p class="information">'.strip_tags($msg, '<br>').'</p>';
+ }
+ }
/**
* getThemeIdFromName()
*
* @param string the dirname of the theme
- * @return integer the theme id
+ * @return integer the theme id
*/
function getThemeIdFromName($dirname) {
$res = db_query_params ('SELECT theme_id FROM themes WHERE dirname=$1',
foreach ($params as $b => $v) {
$prms[] = '<input type="hidden" name="'.$b.'" value="'.$v.'" />'."\n";
}
- $prm = join(' ', $prms);
+ $prm = join(' ', $prms);
foreach ($buttons as $b => $v) {
$btns[] = '<input type="submit" name="'.$b.'" value="'.$v.'" />'."\n";
}
}
$return .= '/>
- <input type="image" id="' . $id . '_submit" src="' . $this->imgbaseurl . $img_src . '" alt="' . $img_alt . '" title="' . $img_title . '"';
+ <input type="image" id="' . $id . '_submit" src="' . $this->imgbaseurl . $img_src . '" alt="' . util_html_secure($img_alt) . '" title="' . util_html_secure($img_title) . '"';
if (is_array($img_extra_params)) {
foreach ($img_extra_params as $key => $img_extra_params_value) {
$return .= $key . '="' . $img_extra_params_value . '" ';
}
function getMonitorPic($title = '', $alt = '') {
- return $this->getPicto('ic/mail16w.png', $title, $alt, '15', '15');
+ return $this->getPicto('ic/mail16w.png', $title, $alt);
}
function getReleaseNotesPic($title = '', $alt = '') {
- return $this->getPicto('ic/manual16c.png', $title, $alt, '15', '15');
+ return $this->getPicto('ic/manual16c.png', $title, $alt);
}
/* no picto for download */
function getDownloadPic($title = '', $alt = '') {
- return $this->getPicto('ic/save.png', $title, $alt, '15', '15');
+ return $this->getPicto('ic/save.png', $title, $alt);
}
function getHomePic($title = '', $alt = '') {
function getPicto($url, $title, $alt, $width = '20', $height = '20') {
if (!$alt) {
- $alt = $title;
+ $alt = $title;
}
return html_image($url, $width, $height, array('title'=>$title, 'alt'=>$alt));
}
if (function_exists('iconv')) {
$string = @iconv('UTF-8', 'ASCII//TRANSLIT', $string);
}
- $string = preg_replace("/[^a-zA-Z0-9- ]/", "-", $string);
+ $string = preg_replace("/[^a-zA-Z0-9_:. -]/", "-", $string);
$string = strtolower($string);
$string = str_replace(" ", $space, $string);
+ if (!preg_match("/^[a-zA-Z:_]/", $string)) {
+ /* some chars aren't allowed at the begin */
+ $string = "_" . $string;
+ }
return $string;
}
function widget(&$widget, $layout_id, $readonly, $column_id, $is_minimized, $display_preferences, $owner_id, $owner_type) {
$element_id = 'widget_'. $widget->id .'-'. $widget->getInstanceId();
- echo '<div class="widget" id="'. $element_id .'">';
- echo '<div class="widget_titlebar '. ($readonly?'':'widget_titlebar_handle') .'">';
- echo '<div class="widget_titlebar_title">'. $widget->getTitle() .'</div>';
+ echo '<div class="widget" id="'. $element_id . "\">\n";
+ echo '<div class="widget_titlebar '. ($readonly?'':'widget_titlebar_handle') . "\">\n";
+ echo '<div class="widget_titlebar_title">'. $widget->getTitle() . "</div>\n";
if (!$readonly) {
- echo '<div class="widget_titlebar_close"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=widget&name['. $widget->id .'][remove]='. $widget->getInstanceId() .'&column_id='. $column_id .'&layout_id='. $layout_id .'">'. $this->getPicto('ic/close.png', 'Close','Close') .'</a></div>';
+ echo '<div class="widget_titlebar_close"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=widget&name['. $widget->id .'][remove]='. $widget->getInstanceId() .'&column_id='. $column_id .'&layout_id='. $layout_id .'">'. $this->getPicto('ic/close.png', 'Close','Close') . "</a></div>\n";
if ($is_minimized) {
- echo '<div class="widget_titlebar_maximize"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=maximize&name['. $widget->id .']='. $widget->getInstanceId() .'&column_id='. $column_id .'&layout_id='. $layout_id .'">'. $this->getPicto($this->_getTogglePlusForWidgets(), 'Maximize', 'Maximize') .'</a></div>';
+ echo '<div class="widget_titlebar_maximize"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=maximize&name['. $widget->id .']='. $widget->getInstanceId() .'&column_id='. $column_id .'&layout_id='. $layout_id .'">'. $this->getPicto($this->_getTogglePlusForWidgets(), 'Maximize', 'Maximize') . "</a></div>\n";
} else {
- echo '<div class="widget_titlebar_minimize"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=minimize&name['. $widget->id .']='. $widget->getInstanceId() .'&column_id='. $column_id .'&layout_id='. $layout_id .'">'. $this->getPicto($this->_getToggleMinusForWidgets(), 'Minimize', 'Minimize') .'</a></div>';
+ echo '<div class="widget_titlebar_minimize"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=minimize&name['. $widget->id .']='. $widget->getInstanceId() .'&column_id='. $column_id .'&layout_id='. $layout_id .'">'. $this->getPicto($this->_getToggleMinusForWidgets(), 'Minimize', 'Minimize') . "</a></div>\n";
}
if (strlen($widget->hasPreferences())) {
- echo '<div class="widget_titlebar_prefs"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=preferences&name['. $widget->id .']='. $widget->getInstanceId() .'&layout_id='. $layout_id .'">'. _('Preferences') .'</a></div>';
+ echo '<div class="widget_titlebar_prefs"><a href="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action=preferences&name['. $widget->id .']='. $widget->getInstanceId() .'&layout_id='. $layout_id .'">'. _('Preferences') . "</a></div>\n";
}
}
if ($widget->hasRss()) {
- echo '<div class="widget_titlebar_rss"><a href="'.$widget->getRssUrl($owner_id, $owner_type).'">rss</a></div>';
+ echo '<div class="widget_titlebar_rss"><a href="'.$widget->getRssUrl($owner_id, $owner_type) . "\">rss</a></div>\n";
}
- echo '</div>';
+ echo "</div>\n";
$style = '';
if ($is_minimized) {
$style = 'display:none;';
}
- echo '<div class="widget_content" style="'. $style .'">';
+ echo '<div class="widget_content" style="'. $style . "\">\n";
if (!$readonly && $display_preferences) {
- echo '<div class="widget_preferences">'. $widget->getPreferencesForm($layout_id, $owner_id, $owner_type) .'</div>';
+ echo '<div class="widget_preferences">'. $widget->getPreferencesForm($layout_id, $owner_id, $owner_type) . "</div>\n";
}
if ($widget->isAjax()) {
echo '<div id="'. $element_id .'-ajax">';
echo '<noscript><iframe width="99%" frameborder="0" src="'. $widget->getIframeUrl($owner_id, $owner_type) .'"></iframe></noscript>';
- echo '</div>';
+ echo "</div>\n";
} else {
echo $widget->getContent();
}
- echo '</div>';
+ echo "</div>\n";
if ($widget->isAjax()) {
- echo '<script type="text/javascript">'."
+ echo '<script type="text/javascript">/* <![CDATA[ */'."
document.observe('dom:loaded', function () {
- $('$element_id-ajax').update('<div style=\"text-align:center\">". $this->getPicto('ic/spinner.gif','spinner','spinner') ."</div>');
- new Ajax.Updater('$element_id-ajax',
+ $('$element_id-ajax').update('<div style=\"text-align:center\">". $this->getPicto('ic/spinner.gif','spinner','spinner', 10, 10) ."</div>');
+ new Ajax.Updater('$element_id-ajax',
'". $widget->getAjaxUrl($owner_id, $owner_type) ."'
);
});
- </script>";
+ /* ]]> */</script>";
}
- echo '</div>';
+ echo "</div>\n";
}
function _getTogglePlusForWidgets() {
function printSoftwareMapLinks() {
$subMenuTitle = array();
$subMenuUrl = array();
-
+ $subMenuAttr = array();
+
if (forge_get_config('use_project_tags')) {
$subMenuTitle[] = _('Tag cloud');
$subMenuUrl[] = '/softwaremap/tag_cloud.php';
+ $subMenuAttr[] = array('title' => _('Browse per tags defined by the projects.'), 'class' => 'tabtitle-nw');
}
-
+
if (forge_get_config('use_trove')) {
$subMenuTitle[] = _('Project Tree');
$subMenuUrl[] = '/softwaremap/trove_list.php';
+ $subMenuAttr[] = array('title' => _('Browse per category.'), 'class' => 'tabtitle');
}
-
+
if (forge_get_config('use_project_full_list')) {
$subMenuTitle[] = _('Project List');
$subMenuUrl[] = '/softwaremap/full_list.php';
+ $subMenuAttr[] = array('title' => _('Complete listing of available projects.'), 'class' => 'tabtitle');
}
-
- echo $this->subMenu($subMenuTitle, $subMenuUrl);
+
+ echo $this->subMenu($subMenuTitle, $subMenuUrl, $subMenuAttr);
+ }
+
+ function displayStylesheetElements() {
+ /* Codendi/Tuleap compatibility */
}
}
// mode: php
// c-file-style: "bsd"
// End:
-
-?>