[Fusionforge-commits] r14781 - trunk/src/www/include

Alain Peyrat aljeux at fusionforge.org
Wed Nov 9 21:34:32 CET 2011


Author: aljeux
Date: 2011-11-09 21:34:31 +0100 (Wed, 09 Nov 2011)
New Revision: 14781

Modified:
   trunk/src/www/include/Layout.class.php
Log:
Document addJavascript() and some HTML cleanup.

Modified: trunk/src/www/include/Layout.class.php
===================================================================
--- trunk/src/www/include/Layout.class.php	2011-11-09 20:02:32 UTC (rev 14780)
+++ trunk/src/www/include/Layout.class.php	2011-11-09 20:34:31 UTC (rev 14781)
@@ -158,13 +158,15 @@
 	}
 
 	/**
-	 * Constructs a list of Javascript files followed by some timestamp
+	 * Build the list of required Javascript files.
 	 *
-	 * TODO document the purpose of this : probably to avoid caching versions updated on the server
+	 * If js file is found, then a timestamp is automatically added to ensure
+	 * that file is cached only if not changed.
+	 *
 	 * @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 @@
 			<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 -->';
 	}
@@ -730,7 +732,7 @@
 				//		$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) {
@@ -745,14 +747,14 @@
 				//	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 {
@@ -767,7 +769,7 @@
 				//	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>';
 
@@ -927,7 +929,7 @@
 			return '';
 		} else {
 			return '
-				<div class="feedback">'.strip_tags($feedback, '<br>').'</div>';
+			<p class="feedback">'.strip_tags($feedback, '<br>').'</p>';
 		}
 	}
 	/**
@@ -941,7 +943,7 @@
 			return '';
 		} else {
 			return '
-				<div class="warning_msg">'.strip_tags($msg, '<br>').'</div>';
+			<p class="warning_msg">'.strip_tags($msg, '<br>').'</p>';
 		}
 	}
 
@@ -962,6 +964,20 @@
 		}
 	}
 
+	/**
+	 * 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()




More information about the Fusionforge-commits mailing list