From: Alain Peyrat Date: Wed, 9 Nov 2011 20:34:31 +0000 (+0000) Subject: Document addJavascript() and some HTML cleanup. X-Git-Tag: v5_2_rc1~492 X-Git-Url: https://scm.fusionforge.org/anonscm/gitweb?p=fusionforge%2Ffusionforge.git;a=commitdiff_plain;h=ed8cf5280bbbb23caf0264ed29ea99388b861ee6 Document addJavascript() and some HTML cleanup. --- diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php index cdac7137a1..352589bba9 100644 --- a/src/www/include/Layout.class.php +++ b/src/www/include/Layout.class.php @@ -158,13 +158,15 @@ class Layout extends Error { } /** - * 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]; } @@ -548,7 +550,7 @@ class Layout extends Error { '.$title.' - + '; } @@ -730,7 +732,7 @@ class Layout extends Error { // $rowspan=(($issel)?'rowspan="2" ' : ''); $return .= ' - '. + '. ''. ''.util_make_link ($TABS_DIRS[$i],$TABS_TITLES[$i],array('class'=>(($issel)?'tabsellink':'tablink')),true).''; } elseif ($i==$count-1) { @@ -745,14 +747,14 @@ class Layout extends Error { // Build image between current and prior tab // $return .= ' - '. + '. ''. ''.util_make_link($TABS_DIRS[$i], $TABS_TITLES[$i], array('class'=>(($issel)?'tabsellink':'tablink')), true).''; // // Last graphic on right-side // $return .= ' - '. + '. ''; } else { @@ -767,7 +769,7 @@ class Layout extends Error { // Build image between current and prior tab // $return .= ' - '. + '. ''. ''.util_make_link($TABS_DIRS[$i], $TABS_TITLES[$i], array('class'=>(($issel)?'tabsellink':'tablink')), true).''; @@ -927,7 +929,7 @@ class Layout extends Error { return ''; } else { return ' -
'.strip_tags($feedback, '
').'
'; +

'.strip_tags($feedback, '
').'

'; } } /** @@ -941,7 +943,7 @@ class Layout extends Error { return ''; } else { return ' -
'.strip_tags($msg, '
').'
'; +

'.strip_tags($msg, '
').'

'; } } @@ -962,6 +964,20 @@ class Layout extends Error { } } + /** + * information() - returns the htmlized information string. + * + * @param string msg string + * @return string htmlized information + */ + function information($msg) { + if (!$msg) { + return ''; + } else { + return ' +

'.strip_tags($msg, '
').'

'; + } + } /** * getThemeIdFromName()