[Fusionforge-commits] FusionForge branch master updated. c8bbf61e5c11d9b30d8ad5689f3183daa29a210b

Franck VILLAUME nerville at fusionforge.org
Sun Feb 23 20:53:09 CET 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  c8bbf61e5c11d9b30d8ad5689f3183daa29a210b (commit)
       via  36b072ba77c5b5841973588bd3166324f27387b0 (commit)
       via  7825b478264fbb9e15d47490721621d439466504 (commit)
       via  ee84aa3bb23f471b76c5f73f0050a8c1d1d2b71d (commit)
       via  0aa56f9f5eec312fcae2fef6f610b5827ce6f4cf (commit)
       via  4922ef9126cd21470d2f38de9bef3680c9b6d790 (commit)
      from  948538a906e2c699f12a9f934a5e7aee17d9450e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c8bbf61e5c11d9b30d8ad5689f3183daa29a210b
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 23 20:51:02 2014 +0100

    use html_{e,ao,ac,ap} helpers, more beautifier html output

diff --git a/src/common/include/Navigation.class.php b/src/common/include/Navigation.class.php
index 241cb2d..378a51e 100644
--- a/src/common/include/Navigation.class.php
+++ b/src/common/include/Navigation.class.php
@@ -145,8 +145,8 @@ class Navigation extends Error {
 			$exact = 1;
 		}
 
-		$res .= html_eo('form', array('id' => 'searchBox', 'action' => util_make_uri('/search/'), 'method' => 'get'));
-		$res .= html_eo('div', array());
+		$res .= html_ao('form', array('id' => 'searchBox', 'action' => util_make_uri('/search/'), 'method' => 'get'));
+		$res .= html_ao('div', array());
 		$parameters = array(
 			SEARCH__PARAMETER_GROUP_ID => $group_id,
 			SEARCH__PARAMETER_ARTIFACT_ID => $atid,
@@ -158,29 +158,27 @@ class Navigation extends Error {
 		$searchManager->setParametersValues($parameters);
 		$searchEngines =& $searchManager->getAvailableSearchEngines();
 
-		$res .= html_eo('select', array('name' => 'type_of_search'));
+		$res .= html_ao('select', array('name' => 'type_of_search'));
 		for($i = 0, $max = count($searchEngines); $i < $max; $i++) {
 			$searchEngine =& $searchEngines[$i];
-			$res .= '<option value="' . $searchEngine->getType() . '"'
-				. ( $type_of_search == $searchEngine->getType() ? ' selected="selected"' : '' )
-				. '>' . $searchEngine->getLabel($parameters) . '</option>' . "\n";
+			$attrs = array('value' => $searchEngine->getType());
+			if ( $type_of_search == $searchEngine->getType())
+				$attrs['selected'] = 'selected';
+			$res .= html_e('option', $attrs, $searchEngine->getLabel($parameters), false);
 		}
-		$res .= '</select>';
+		$res .= html_ac(html_ap() - 1);
 
 		$parameters = $searchManager->getParameters();
 		foreach($parameters AS $name => $value) {
-			$res .= '<input type="hidden" value="'.$value.'" name="'.$name.'" />' . "\n";
+			$res .= html_e('input', array('type' => 'hidden', 'value' => $value, 'name' => $name));
 		}
-		$res .= '<input type="text" size="12" id="searchBox-words" name="words" value="'
-			. $defaultWords . '" required="required" />' . "\n";
-		$res .= '<input type="submit" name="Search" value="'._('Search').'" />' . "\n";
+		$res .= html_e('input', array('type' => 'text', 'size' => 12, 'id' => 'searchBox-words', 'name' => 'words', 'value' => $defaultWords, 'required' => 'required'));
+		$res .= html_e('input', array('type' => 'submit', 'name' => 'Search', 'value' => _('Search')));
 
 		if (isset($group_id) && $group_id) {
-			$res .= util_make_link('/search/advanced_search.php?group_id=' .
-					       $group_id, _('Advanced search'));
+			$res .= util_make_link('/search/advanced_search.php?group_id='.$group_id, _('Advanced search'));
 		}
-		$res .= '</div>';
-		$res .= '</form>';
+		$res .= html_ac(html_ap() - 2);
 
 		return $res;
 	}
diff --git a/src/common/widget/WidgetLayoutManager.class.php b/src/common/widget/WidgetLayoutManager.class.php
index 5287151..cfd5530 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -2,7 +2,7 @@
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013-2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -249,23 +249,31 @@ class WidgetLayoutManager {
 			$used_widgets[] = $data['name'];
 		}
 		// display contextual toolbar
-		echo '<ul class="widget_toolbar">';
-		$url = "/widgets/widgets.php?owner=".HTTPRequest::instance()->get('owner').
-			"&layout_id=".HTTPRequest::instance()->get('layout_id');
+		echo html_ao('ul', array('class' => 'widget_toolbar'));
+		$url = '/widgets/widgets.php?owner='.HTTPRequest::instance()->get('owner').
+			'&layout_id='.HTTPRequest::instance()->get('layout_id');
 
 		$update_layout = (HTTPRequest::instance()->get('update') == 'layout');
 		if ($update_layout) {
 			// customized selected
-			echo '<li><a href="'. $url .'">'. _("Add widgets") .'</a></li>';
-			echo '<li class="current"><a href="'. $url.'&update=layout' .'">'. _("Customize Layout") .'</a></li>';
+			echo html_ao('li');
+			echo util_make_link($url, _('Add widgets'));
+			echo html_ac(html_ap() - 1);
+			echo html_ao('li', array('class' => 'current'));
+			echo util_make_link($url.'&update=layout', _('Customize Layout'));
+			echo html_ac(html_ap() -1);
 			$action = 'layout';
 		} else {
 			// add selected, or default when first displayed
-			echo '<li class="current"><a href="'. $url .'">'. _("Add widgets") .'</a></li>';
-			echo '<li><a href="'. $url.'&update=layout' .'">'. _("Customize Layout") .'</a></li>';
+			echo html_ao('li', array('class' => 'current'));
+			echo util_make_link($url, _('Add widgets'));
+			echo html_ac(html_ap() -1);
+			echo html_ao('li');
+			echo util_make_link($url.'&update=layout', _('Customize Layout'));
+			echo html_ac(html_ap() -1);
 			$action = 'widget';
 		}
-		echo '</ul>';
+		echo html_ac(html_ap() -1 );
 		echo '<form action="/widgets/updatelayout.php?owner='. $owner_type.$owner_id .'&action='. $action .'&layout_id='. $layout_id .'" method="post">';
 		if ($update_layout) {
 			?>
@@ -519,14 +527,14 @@ class WidgetLayoutManager {
 			if (count($categs)) {
 				// display the categories selector in left panel
 				foreach($categs as $c => $ws) {
-					$widget_rows[$c] = '<a class="widget-categ-switcher" id="widget-categ-switcher-'. $c .'" href="#widget-categ-'. $c .'" onClick="jQuery(\'.widget-categ-class-void\').hide();jQuery(\'.widget-categ-switcher\').removeClass(\'selected\');jQuery(\'#widget-categ-'. $c .'\').show();jQuery(\'#widget-categ-switcher-'. $c .'\').addClass(\'selected\');" ><span>'.  str_replace('_',' ', $hp->purify($c, CODENDI_PURIFIER_CONVERT_HTML))  .'</span></a>';
+					$widget_rows[$c] = html_e('a', array('class' => 'widget-categ-switcher', 'id' => 'widget-categ-switcher-'.$c, 'href' => '#widget-categ-'.$c, 'onClick' => 'jQuery(\'.widget-categ-class-void\').hide();jQuery(\'.widget-categ-switcher\').removeClass(\'selected\');jQuery(\'#widget-categ-'. $c .'\').show();jQuery(\'#widget-categ-switcher-'. $c .'\').addClass(\'selected\')'), html_e('span', array(), str_replace('_',' ', $hp->purify($c, CODENDI_PURIFIER_CONVERT_HTML))), false);
 				}
 				uksort($widget_rows, 'strnatcasecmp');
-				echo '<ul id="widget-categories">';
+				echo html_ao('ul', array('id' => 'widget-categories'));
 				foreach($widget_rows as $row) {
-					echo '<li>'. $row .'</li>';
+					echo html_e('li', array(), $row, false);
 				}
-				echo '</ul>';
+				echo html_ac(html_ap() - 1);
 			} else {
 				foreach($widgets as $widget_name) {
 					if ($widget = Widget::getInstance($widget_name)) {
diff --git a/src/common/widget/WidgetLayout_Row.class.php b/src/common/widget/WidgetLayout_Row.class.php
index 68da175..39ad9db 100644
--- a/src/common/widget/WidgetLayout_Row.class.php
+++ b/src/common/widget/WidgetLayout_Row.class.php
@@ -1,7 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013-2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -41,15 +41,15 @@ class WidgetLayout_Row {
 	}
 
 	function display($readonly, $owner_id, $owner_type) {
-		echo '<table id="mainwidget_table'.$this->id.'" class="fullwidth "><tbody>' . "\n";
-		echo '<tr style="vertical-align:top;">' . "\n";
+		echo html_ao('table', array('id' => 'mainwidget_table'.$this->id, 'class' => 'fullwidth'));
+		echo html_ao('tbody');
+		echo html_ao('tr', array('style' => 'vertical-align:top;'));
 		$last = count($this->columns) - 1;
 		$i = 0;
 		foreach($this->columns as $key => $nop) {
 			$this->columns[$key]->display($readonly, $owner_id, $owner_type, $is_last = ($i++ == $last));
 		}
-		echo '</tr>' . "\n";
-		echo '</tbody></table>' . "\n";
+		echo html_ac(html_ap() -3);
 	}
 
 	function getColumnIds() {
diff --git a/src/common/widget/WidgetLayout_Row_Column.class.php b/src/common/widget/WidgetLayout_Row_Column.class.php
index 5fc6af3..ab487e8 100644
--- a/src/common/widget/WidgetLayout_Row_Column.class.php
+++ b/src/common/widget/WidgetLayout_Row_Column.class.php
@@ -1,6 +1,7 @@
 <?php
 /**
  * Copyright (c) Xerox Corporation, Codendi Team, 2001-2009. All rights reserved
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is a part of Fusionforge.
  *
@@ -35,11 +36,11 @@ class WidgetLayout_Row_Column {
         $this->contents[] = array('content' => &$c, 'is_minimized' => $is_minimized, 'display_preferences' => $display_preferences);
     }
     function display($readonly, $owner_id, $owner_type, $is_last) {
-        echo '<td style="height:10px; width:'. $this->width .'%; '. (!$is_last ? 'padding-right:20px;' : '') .'" id="'. $this->getColumnId() .'">';
+        echo html_ao('td', array('style' => 'height:10px; width:'. $this->width .'%; '. (!$is_last ? 'padding-right:20px;' : ''), 'id' => $this->getColumnId()));
         foreach ($this->contents as $key => $nop) {
             $this->contents[$key]['content']->display($this->row->layout->id, $this->id, $readonly, $this->contents[$key]['is_minimized'], $this->contents[$key]['display_preferences'], $owner_id, $owner_type);
         }
-        echo '</td>';
+        echo html_ac(html_ap() -1);
     }
     function getColumnId() {
         return 'widgetlayout_col_'. $this->id;
diff --git a/src/common/widget/Widget_ProjectInfo.class.php b/src/common/widget/Widget_ProjectInfo.class.php
index d12652e..95ebcf3 100644
--- a/src/common/widget/Widget_ProjectInfo.class.php
+++ b/src/common/widget/Widget_ProjectInfo.class.php
@@ -40,23 +40,23 @@ class Widget_ProjectInfo extends Widget {
 		// Tag list
 		if (forge_get_config('use_project_tags')) {
 			$list_tag = list_project_tag($group_id);
-			echo '<p>'.html_image('ic/tag.png'). ' ';
+			echo html_ao('p').html_image('ic/tag.png'). ' ';
 			if ($list_tag) {
 				echo _('Tags')._(': '). $list_tag;
 			} else {
 				$project = group_get_object($group_id);
 				if (forge_check_perm ('project_admin', $project->getID())) {
-					print '<a href="/project/admin/?group_id=' . $group_id . '" >' . _('No tag defined for this project') . '</a>.';
+					echo util_make_link('/project/admin/?group_id='.$group_id, _('No tag defined for this project'));
 				}
 				else {
-					print _('No tag defined for this project');
+					echo html_e('span', array(), _('No tag defined for this project'), false);
 				}
 			}
-			echo "</p>\n";
+			echo html_ac(html_ap() - 1);
 		}
 
 		if(forge_get_config('use_trove')) {
-			print "<br />\n";
+			echo html_e('br');
 			print stripslashes(trove_getcatlisting($group_id,0,1,1))."\n";
 		}
 
diff --git a/src/plugins/online_help/common/online_helpPlugin.class.php b/src/plugins/online_help/common/online_helpPlugin.class.php
index 2b4bb74..30048b6 100644
--- a/src/plugins/online_help/common/online_helpPlugin.class.php
+++ b/src/plugins/online_help/common/online_helpPlugin.class.php
@@ -5,6 +5,7 @@
  *
  * Copyright 2008 Alain Peyrat <aljeux at free.fr>
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2014, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge.
  *
@@ -82,7 +83,7 @@ class online_helpPlugin extends Plugin {
 			$guide .= 'index.html';
 		}
 
-		$guide = '<a href="javascript:help_window(\''.$guide.'\')">'._('Get Help').'</a>';
+		$guide = util_make_link('javascript:help_window(\''.$guide.'\')', _('Get Help'), array(), true);
 
 		$template = isset($params['template']) ?  $params['template'] : ' | {menu}';
 		echo str_replace('{menu}', $guide, $template);
diff --git a/src/plugins/projects-hierarchy/view/home_project_link.php b/src/plugins/projects-hierarchy/view/home_project_link.php
index 2e067a7..f0afad4 100644
--- a/src/plugins/projects-hierarchy/view/home_project_link.php
+++ b/src/plugins/projects-hierarchy/view/home_project_link.php
@@ -49,21 +49,21 @@ if (sizeof($childs)) {
 if (sizeof($parent) || sizeof($childs)) {
 	echo $HTML->boxTop(_('Linked projects'));
 	if (sizeof($parent)) {
-		echo '<ul>';
+		echo html_ao('ul');
 		$parentGroup = group_get_object($parent[0]);
-		echo '<li>'._('Parent Project')._(': ').util_make_link('/projects/'.$parentGroup->getUnixName(), $parentGroup->getPublicName(), array('class' => 'tabtitle', 'title' => _('Direct link to project'))).'</li>';
-		echo '</ul>';
+		echo html_e('li', array(), _('Parent Project')._(': ').util_make_link('/projects/'.$parentGroup->getUnixName(), $parentGroup->getPublicName(), array('class' => 'tabtitle', 'title' => _('Direct link to project'))));
+		echo html_ac(html_ap() -1);
 	}
 	if (sizeof($childs)) {
 		if (sizeof($parent))
-			echo '<hr>';
+			echo html_e('hr');
 
-		echo '<ul>';
+		echo html_ao('ul');
 		foreach ($childs as $child) {
 			$childGroup = group_get_object($child);
-			echo '<li>'._('Child project')._(': ').util_make_link('/projects/'.$childGroup->getUnixName(), $childGroup->getPublicName(), array('class' => 'tabtitle', 'title' => _('Direct link to project'))).'</li>';
+			echo html_e('li', array(), _('Child project')._(': ').util_make_link('/projects/'.$childGroup->getUnixName(), $childGroup->getPublicName(), array('class' => 'tabtitle', 'title' => _('Direct link to project'))));
 		}
-		echo '</ul>';
+		echo html_ac(html_ap() -1);
 	}
 	echo $HTML->boxBottom();
 }
diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 2ac720b..b2501b4 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -211,8 +211,7 @@ class Layout extends Error {
 	function getJavascripts() {
 		$code = '';
 		foreach ($this->javascripts as $js) {
-			$code .= "\t\t\t";
-			$code .= '<script type="text/javascript" src="'.$js.'"></script>'."\n";
+			$code .= html_e('script', array('type' => 'text/javascript', 'src' => $js), '', false);
 		}
 		$this->javascripts = array();
 		return $code;
@@ -224,11 +223,10 @@ class Layout extends Error {
 	function getStylesheets() {
 		$code = '';
 		foreach ($this->stylesheets as $c) {
-			$code .= "\t\t\t";
 			if ($c['media']) {
-				$code .= '<link rel="stylesheet" type="text/css" href="'.$c['css'].'" media="'.$c['media'].'" />'."\n";
+				$code .= html_e('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $c['css'], 'media' => $c['media']));
 			} else {
-				$code .= '<link rel="stylesheet" type="text/css" href="'.$c['css'].'"/>'."\n";
+				$code .= html_e('link', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => $c['css']));
 			}
 		}
 		$this->stylesheets = array();
@@ -256,16 +254,14 @@ class Layout extends Error {
 	 */
 	function headerStart($params) {
 		$this->headerHTMLDeclaration();
-		?>
-	<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
+		echo html_ao('head');
+		echo html_e('meta', array('http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'));
+		if (isset($params['meta-description'])) {
+			echo html_e('meta', array('name' => 'description', 'content' => $params['meta-description']));
+		}
+		if (isset($params['meta-keywords'])) {
+			echo html_e('meta', array('name' => 'keywords', 'content' => $params['meta-keywords']));
+		}
 		plugin_hook('htmlhead');
 		$this->headerTitle($params);
 		$this->headerFavIcon();
@@ -275,9 +271,7 @@ class Layout extends Error {
 		$this->headerJS();
 		$this->headerForgepluckerMeta();
 		$this->headerLinkedDataAutodiscovery();
-		?>
-	</head>
-		<?php
+		echo html_ac(html_ap() -1);
 	}
 
 	/**
@@ -346,9 +340,8 @@ class Layout extends Error {
 	 * @todo generalize this
 	 */
 	function headerJS() {
-		echo '
-			<script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>
-			<script type="text/javascript">/* <![CDATA[ */';
+		echo html_e('script', array('type' => 'text/javascript', 'src' => util_make_uri('/js/common.js')), '', false);
+		echo '	<script type="text/javascript">/* <![CDATA[ */';
 		plugin_hook ("javascript");
 		echo '
 			/* ]]> */</script>';
@@ -404,11 +397,8 @@ class Layout extends Error {
 		 * Forge-Identification Meta Header, Version 1.0
 		 * cf. http://home.gna.org/forgeplucker/forge-identification.html
 		 */
-		echo "\t\t\t";
 		$ff = new FusionForge();
-		printf('<meta name="Forge-Identification" content="%s:%s" />',
-		    $ff->software_type, $ff->software_version);
-		echo "\n";
+		echo html_e('meta', array('name' => 'Forge-Identification', 'content' => $ff->software_type.':'.$ff->software_version));
 	}
 
 	function bodyHeader($params){
@@ -695,10 +685,10 @@ if (isset($params['group']) && $params['group']) {
 			} else {
 				sortProjectList($groups);
 
-				echo '
-					<form id="quicknavform" name="quicknavform" action=""><div>
-					<select name="quicknav" id="quicknav" onchange="location.href=document.quicknavform.quicknav.value">
-					<option value="">'._('Quick Jump To...').'</option>';
+				echo html_ao('form', array('id' => 'quicknavform', 'name' => 'quicknavform', 'action' => ''));
+				echo html_ao('div');
+				echo html_ao('select', array('name' => 'quicknav', 'id' => 'quicknav', 'onchange' => 'location.href=document.quicknavform.quicknav.value'));
+				echo html_e('option', array('value' => ''), _('Quick Jump To...'), false);
 
 				foreach ($groups as $g) {
 					$group_id = $g->getID();
@@ -711,9 +701,7 @@ if (isset($params['group']) && $params['group']) {
 						}
 					}
 				}
-				echo '
-					</select>
-					</div></form>';
+				echo html_ac(html_ap() - 3);
 			}
 		}
 	}
@@ -1307,20 +1295,30 @@ if (isset($params['group']) && $params['group']) {
 		$element_id = 'widget_'. $widget->id .'-'. $widget->getInstanceId();
 		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";
+		echo html_e('div', array('class' => 'widget_titlebar_title'), $widget->getTitle(), false);
 		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>\n";
+			echo html_ao('div', array('class' => 'widget_titlebar_close'));
+			echo util_make_link('/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')));
+			echo html_ac(html_ap() -1);
 			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>\n";
+				echo html_ao('div', array('class' => 'widget_titlebar_maximize'));
+				echo util_make_link('/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')));
+				echo html_ac(html_ap() -1);
 			} 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>\n";
+				echo html_ao('div', array('class' => 'widget_titlebar_minimize'));
+				echo util_make_link('/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')));
+				echo html_ac(html_ap() -1);
 			}
 			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>\n";
+				echo html_ao('div', array('class' => 'widget_titlebar_prefs'));
+				echo util_make_link('/widgets/updatelayout.php?owner='.$owner_type.$owner_id.'&action=preferences&name['.$widget->id.']='.$widget->getInstanceId().'&layout_id='.$layout_id, _('Preferences'));
+				echo html_ac(html_ap() -1);
 			}
 		}
 		if ($widget->hasRss()) {
-			echo '<div class="widget_titlebar_rss"><a href="'.$widget->getRssUrl($owner_id, $owner_type) . "\">rss</a></div>\n";
+			echo html_ao('div', array('class' => 'widget_titlebar_rss'));
+			echo util_make_link($widget->getRssUrl($owner_id, $owner_type), 'rss');
+			echo html_ac(html_ap() -1);
 		}
 		echo "</div>\n";
 		$style = '';
diff --git a/src/www/include/html.php b/src/www/include/html.php
index 3afb610..d73527a 100644
--- a/src/www/include/html.php
+++ b/src/www/include/html.php
@@ -1144,10 +1144,7 @@ function html_e($name, $attrs = array(), $content = "", $shortform = true) {
 		$attrs['title'] = '';
 	}
 	$rv = '';
-	for ($i = 0; $i < $html_autoclose_pos; $i++) {
-		$rv .= "\t";
-	}
-	if (!$shortform) {
+	for ($i = 0; $i < $html_autoclose_pos +1; $i++) {
 		$rv .= "\t";
 	}
 	$rv .= '<'.$name;
@@ -1250,7 +1247,7 @@ function html_ac($spos) {
 		throw new Exception($e);
 	}
 
-	$rv = "";
+	$rv = '';
 	while ($html_autoclose_pos > $spos) {
 		for ($i = 0; $i < $html_autoclose_pos; $i++) {
 			$rv .= "\t";
diff --git a/src/www/themes/funky-wOw/Theme.class.php b/src/www/themes/funky-wOw/Theme.class.php
index 641ccdc..c7cc77d 100644
--- a/src/www/themes/funky-wOw/Theme.class.php
+++ b/src/www/themes/funky-wOw/Theme.class.php
@@ -37,7 +37,6 @@ class Theme extends Layout {
 		$this->themeurl = util_make_url('themes/funky-wOw/');
 		$this->imgbaseurl = $this->themeurl . 'images/';
 		$this->imgroot = $this->imgbaseurl;
-
 		$this->addStylesheet('/themes/funky-wOw/css/theme.css');
 		$this->addStylesheet('/themes/funky-wOw/css/theme-pages.css');
 	}
@@ -54,42 +53,35 @@ class Theme extends Layout {
 			$params['title'] = $params['title'] . " - ".forge_get_config('forge_name');
 		}
 
-		echo '<table id="header" class="fullwidth">' . "\n";
-		echo '<tr>' . "\n";
-		echo '<td id="header-col1">' . "\n";
-		echo util_make_link('/', html_image('/header/top-logo.png', null, null, array('alt'=>'FusionForge Home'))) . "\n";
-
-		echo '</td>' . "\n";
-		echo '<td id="header-col2">' . "\n";
+		echo html_ao('table', array('id' => 'header', 'class' => 'fullwidth'));
+		echo html_ao('tr');
+		echo html_ao('td', array('id' => 'header-col1'));
+		echo util_make_link('/', html_image('/header/top-logo.png', null, null, array('alt'=>'FusionForge Home')));
+		echo html_ac(html_ap() -1);
+		echo html_ao('td', array('id' => 'header-col2'));
 
 		$items = $this->navigation->getUserLinks();
 		for ($j = 0; $j < count($items['titles']); $j++) {
-			$links[] = util_make_link($items['urls'][$j], $items['titles'][$j], array('class'=>'userlink'), true);
+			$links[] = util_make_link($items['urls'][$j], $items['titles'][$j], array('class' => 'userlink'), true);
 		}
 		echo implode(' | ', $links);
 		plugin_hook('headermenu', $params);
 
-		echo '</td>' . "\n";
-		echo '</tr>' . "\n";
-		echo '<tr>' . "\n";
-		echo '<td colspan="2" id="header-line2">' . "\n";
-		// echo $this->quicknewsbutton();
+		echo html_ac(html_ap() -2);
+		echo html_ao('tr');
+		echo html_ao('td', array('id' => 'header-line2', 'colspan' => 2));
 		$this->quickNav();
 		$this->searchBox();
-
-		echo '</td></tr>' . "\n";
-		echo '<tr><td colspan="2" id="header-news">' . "\n";
-		//echo $this->quicknews();
-		echo'</td></tr></table><!-- outer tabs -->' . "\n";
+		echo html_ac(html_ap() -3);
 		$this->outerTabs($params);
 		echo '<!-- inner tabs -->' . "\n";
-		echo '<div class="innertabs">' . "\n";
+		echo html_ao('div', array('class' => 'innertabs'));
 		if (isset($params['group']) && $params['group']) {
 			$this->projectTabs($params['toptab'], $params['group']);
 		}
 
-		echo '</div>' . "\n";
-		echo '<div id="maindiv">' . "\n";
+		echo html_ac(html_ap() -1);
+		echo html_ao('div', array('id' => 'maindiv'));
 
 		plugin_hook('message');
 
@@ -104,24 +96,25 @@ class Theme extends Layout {
 		}
 
 		if (isset($params['h1'])) {
-			echo '<h1>'.$params['h1'].'</h1>';
+			echo html_e('h1', array(), $params['h1'], false);
 		} elseif (isset($params['title'])) {
-			echo '<h1 class="hide">'.$params['title'].'</h1>';
+			echo html_e('h1', array('class' => 'hide'), $params['title'], false);
 		}
 		if (isset($params['submenu']))
 			echo $params['submenu'];
 	}
 
 	function bodyFooter($params) {
-		echo '</div><!-- id="maindiv" -->' . "\n";
+		echo html_ac(html_ap() -1).'<!-- id="maindiv" -->' . "\n";
 	}
 
 	function footer($params = array()) {
 		$this->bodyFooter($params);
-		echo '<div class="footer">' . "\n";
+		echo html_ao('div', array('class' => 'footer'));
 		echo $this->navigation->getPoweredBy();
 		echo $this->navigation->getShowSource();
-		echo '<div style="clear:both"></div></div>';
+		echo '<div style="clear:both"></div>'."\n";
+		echo html_ac(html_ap() -1);
 		plugin_hook('webanalytics_url');
 		echo '</body></html>' . "\n";
 	}
@@ -146,11 +139,10 @@ class Theme extends Layout {
 		}
 
 		$t_result = '';
-		$t_result .= html_e('div', array('id' => $idid, 'class' => 'box-surround'));
-		$t_result .= html_e('div', array('id' => $idtitle, 'class' => 'box-title'));
+		$t_result .= html_ao('div', array('id' => $idid, 'class' => 'box-surround'));
+		$t_result .= html_ao('div', array('id' => $idtitle, 'class' => 'box-title'));
 		$t_result .= html_e('div', array('id' => $idtcont, 'class' => 'box-title-content'), $title, false);
-		$t_result .= '</div> <!-- class="box-title" -->';
-
+		$t_result .= html_ac(html_ap() -1);
 		return $t_result;
 	}
 
@@ -196,9 +188,7 @@ class Theme extends Layout {
 	 * @return	string
 	 */
 	function boxBottom() {
-		$t_result='</div><!-- class="box-surround" -->';
-
-		return $t_result;
+		return html_ac(html_ap() -1).'<!-- class="box-surround" -->'."\n";
 	}
 
 	/**
@@ -228,69 +218,68 @@ class Theme extends Layout {
 		global $use_tooltips;
 
 		if ($use_tooltips) {
-			?>
-			<script type="text/javascript">//<![CDATA[
-				if (typeof(jQuery(window).tipsy) == 'function') {
+			echo html_ao('script', array('type' => 'text/javascript'));
+			echo '	//<![CDATA[
+				if (typeof(jQuery(window).tipsy) == \'function\') {
 					jQuery(document).ready(
 						function() {
-							jQuery('.tabtitle').tipsy({delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-nw').tipsy({gravity: 'nw', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-ne').tipsy({gravity: 'ne', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-w').tipsy({gravity: 'w', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-e').tipsy({gravity: 'e', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-sw').tipsy({gravity: 'sw', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-se').tipsy({gravity: 'se', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle\').tipsy({delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-nw\').tipsy({gravity: \'nw\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-ne\').tipsy({gravity: \'ne\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-w\').tipsy({gravity: \'w\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-e\').tipsy({gravity: \'e\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-sw\').tipsy({gravity: \'sw\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-se\').tipsy({gravity: \'se\', delayIn: 500, delayOut: 0, fade: true});
 						}
 					);
 				}
-			//]]></script>
-			<?php
+			//]]>'."\n";
+			echo html_ac(html_ap() -1);
 		}
 
-		$return = '<!-- start tabs -->';
-		$return .= '<table class="tabGenerator fullwidth" ';
+		$return = '<!-- start tabs -->'."\n";
+		$attrs = array('class' => 'tabGenerator fullwidth');
 
 		if ($total_width != '100%')
-			$return .= 'style="width:' . $total_width . ';"';
+			$attrs['style'] = 'width:' . $total_width;
 
-		$return .= ">\n";
-		$return .= '<tr>';
+		$return .= html_ao('table', $attrs);
+		$return .= html_ao('tr');
 
 		$accumulated_width = 0;
 
-		for ($i=0; $i<$count; $i++) {
-			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width ;
-			$accumulated_width += $tabwidth ;
-
-			$return .= "\n";
+		for ($i = 0; $i < $count; $i++) {
+			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width;
+			$accumulated_width += $tabwidth;
 
 			// middle part
-			$return .= '<td class="tg-middle" style="width:'.$tabwidth.'%;"><a ';
-			$return .= 'id="'.md5($TABS_DIRS[$i]).'" ';
-			if ($use_tooltips && isset($TABS_TOOLTIPS[$i]))
-				$return .= 'class="tabtitle" title="'.$TABS_TOOLTIPS[$i].'" ';
-			$return .= 'href="'.$TABS_DIRS[$i].'">' . "\n";
-			$return .= '<span';
-
+			$attrs = array();
+			$attrs['class'] = 'tg-middle';
+			$attrs['style'] = 'width:'.$tabwidth.'%';
+			$return .= html_ao('td', $attrs);
+			if ($i == 0) {
+				$class_a = 'tabtitle-nw';
+			} else if ( $i == ($count - 1)) {
+				$class_a = 'tabtitle-ne';
+			} else {
+				$class_a = 'tabtitle';
+			}
+			$return .= html_ao('a', array('href' => $TABS_DIRS[$i], 'id' => md5($TABS_DIRS[$i]), 'class' => $class_a, 'title' => $TABS_TOOLTIPS[$i]));
+			$attrs = array();
 			if ($selected == $i)
-				$return .= ' class="selected"';
-
-			$return .= '>';
-			$return .= '<span';
+				$attrs['class'] = 'selected';
 
+			$return .= html_ao('span', $attrs);
+			$attrs = array();
 			if ($nested)
-				$return .= ' class="nested"';
+				$attrs['class'] = 'nested';
 
-			$return .= '>' . "\n";
-			$return .= ''.$TABS_TITLES[$i].'' . "\n";
-			$return .= '</span>';
-			$return .= '</span>' . "\n";
-			$return .= '</a></td>' . "\n";
+			$return .= html_e('span', $attrs, $TABS_TITLES[$i], false);
+			$return .= html_ac(html_ap() - 3);
 
 		}
 
-		$return .= '</tr></table><!-- end tabs -->';
-
+		$return .= html_ac(html_ap() -2).'<!-- end tabs -->'."\n";
 		return $return;
 	}
 
@@ -371,8 +360,7 @@ class Theme extends Layout {
 	 *
 	 * @return string
 	 */
-	function multiTableRow($row_attr, $cell_data, $istitle)
-	{
+	function multiTableRow($row_attr, $cell_data, $istitle) {
 		$return= '<tr class="ff" '.$row_attr;
 		if ( $istitle )
 			$return .=' align="center"';
@@ -403,8 +391,7 @@ class Theme extends Layout {
 	 * @param	string	$dirname	the dirname of the theme
 	 * @return	int		the theme id
 	 */
-	function getThemeIdFromName($dirname)
-	{
+	function getThemeIdFromName($dirname) {
 		$res = db_query_params ('SELECT theme_id FROM themes WHERE dirname=$1', array($dirname));
 		return db_result($res, 0, 'theme_id');
 	}
@@ -413,9 +400,8 @@ class Theme extends Layout {
 	 * headerJS() - creates the JS headers and calls the plugin javascript hook
 	 * @todo generalize this
 	 */
-	function headerJS()
-	{
-		echo '<script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>';
+	function headerJS() {
+		echo html_e('script', array('type' => 'text/javascript', 'src' => util_make_uri('/js/common.js')), '', false);
 
 		plugin_hook("javascript_file");
 
@@ -424,9 +410,10 @@ class Theme extends Layout {
 		plugin_hook("javascript", $params);
 		$javascript = $params['return'];
 		if($javascript) {
-			echo '<script type="text/javascript">//<![CDATA['."\n";
+			echo html_ao('script', array('type' => 'text/javascript')).'//<![CDATA['."\n";
 			echo $javascript;
-			echo "\n//]]></script>\n";
+			echo "\n".'//]]'."\n";
+			echo html_ac(html_ap() -1);
 		}
 		html_use_tooltips();
 		html_use_storage();
@@ -435,16 +422,16 @@ class Theme extends Layout {
 		html_use_jqueryui();
 		echo $this->getJavascripts();
 		echo $this->getStylesheets();
-		?>
-		<script type="text/javascript">//<![CDATA[
-		jQuery(window).load(function(){
-			setTimeout("jQuery('.feedback').hide('slow')", 5000);
-			setInterval(function() {
-					setTimeout("jQuery('.feedback').hide('slow')", 5000);
-				}, 5000);
-		});
-		//]]></script>
-		<?php
+		echo html_ao('script', array('type' => 'text/javascript'));
+		echo '	//<![CDATA[
+			jQuery(window).load(function(){
+				setTimeout("jQuery(\'.feedback\').hide(\'slow\')", 5000);
+				setInterval(function() {
+						setTimeout("jQuery(\'.feedback\').hide(\'slow\')", 5000);
+					}, 5000);
+			});
+			//]]>'."\n";
+		echo html_ac(html_ap() -1);
 	}
 }
 
diff --git a/src/www/themes/funky/Theme.class.php b/src/www/themes/funky/Theme.class.php
index 7b9d1ec..246430f 100644
--- a/src/www/themes/funky/Theme.class.php
+++ b/src/www/themes/funky/Theme.class.php
@@ -37,7 +37,6 @@ class Theme extends Layout {
 		$this->themeurl = util_make_url('themes/funky/');
 		$this->imgbaseurl = $this->themeurl . 'images/';
 		$this->imgroot = $this->imgbaseurl;
-
 		$this->addStylesheet('/themes/funky/css/theme.css');
 		$this->addStylesheet('/themes/funky/css/theme-pages.css');
 	}
@@ -54,41 +53,35 @@ class Theme extends Layout {
 			$params['title'] = $params['title'] . " - ".forge_get_config('forge_name');
 		}
 
-		echo '<table id="header" class="fullwidth">' . "\n";
-		echo '<tr>' . "\n";
-		echo '<td id="header-col1">' . "\n";
+		echo html_ao('table', array('id' => 'header', 'class' => 'fullwidth'));
+		echo html_ao('tr');
+		echo html_ao('td', array('id' => 'header-col1'));
 		echo util_make_link('/', html_image('/header/top-logo.png', null, null, array('alt'=>'FusionForge Home')));
-		echo '</td>' . "\n";
-		echo '<td id="header-col2">' . "\n";
+		echo html_ac(html_ap() -1);
+		echo html_ao('td', array('id' => 'header-col2'));
 
 		$items = $this->navigation->getUserLinks();
 		for ($j = 0; $j < count($items['titles']); $j++) {
-			$links[] = util_make_link($items['urls'][$j], $items['titles'][$j], array('class'=>'userlink'), true);
+			$links[] = util_make_link($items['urls'][$j], $items['titles'][$j], array('class' => 'userlink'), true);
 		}
 		echo implode(' | ', $links);
 		plugin_hook('headermenu', $params);
 
-		echo '</td>' . "\n";
-		echo '</tr>' . "\n";
-		echo '<tr>' . "\n";
-		echo '<td colspan="2" id="header-line2">' . "\n";
-		// echo $this->quicknewsbutton();
+		echo html_ac(html_ap() -2);
+		echo html_ao('tr');
+		echo html_ao('td', array('id' => 'header-line2', 'colspan' => 2));
 		$this->quickNav();
 		$this->searchBox();
-
-		echo '</td></tr>' . "\n";
-		echo '<tr><td colspan="2" id="header-news">' . "\n";
-		//echo $this->quicknews();
-		echo'</td></tr></table><!-- outer tabs -->' . "\n";
+		echo html_ac(html_ap() -3);
 		$this->outerTabs($params);
 		echo '<!-- inner tabs -->' . "\n";
-		echo '<div class="innertabs">' . "\n";
+		echo html_ao('div', array('class' => 'innertabs'));
 		if (isset($params['group']) && $params['group']) {
 			$this->projectTabs($params['toptab'], $params['group']);
 		}
 
-		echo '</div>' . "\n";
-		echo '<div id="maindiv">' . "\n";
+		echo html_ac(html_ap() -1);
+		echo html_ao('div', array('id' => 'maindiv'));
 
 		plugin_hook('message');
 
@@ -103,24 +96,25 @@ class Theme extends Layout {
 		}
 
 		if (isset($params['h1'])) {
-			echo '<h1>'.$params['h1'].'</h1>';
+			echo html_e('h1', array(), $params['h1'], false);
 		} elseif (isset($params['title'])) {
-			echo '<h1 class="hide">'.$params['title'].'</h1>';
+			echo html_e('h1', array('class' => 'hide'), $params['title'], false);
 		}
 		if (isset($params['submenu']))
 			echo $params['submenu'];
 	}
 
 	function bodyFooter($params) {
-		echo '</div><!-- id="maindiv" -->' . "\n";
+		echo html_ac(html_ap() -1).'<!-- id="maindiv" -->' . "\n";
 	}
 
 	function footer($params = array()) {
 		$this->bodyFooter($params);
-		echo html_e('div', array('class' => 'footer'));
+		echo html_ao('div', array('class' => 'footer'));
 		echo $this->navigation->getPoweredBy();
 		echo $this->navigation->getShowSource();
-		echo '<div style="clear:both"></div></div>';
+		echo '<div style="clear:both"></div>'."\n";
+		echo html_ac(html_ap() -1);
 		plugin_hook('webanalytics_url');
 		echo '</body></html>' . "\n";
 	}
@@ -145,11 +139,10 @@ class Theme extends Layout {
 		}
 
 		$t_result = '';
-		$t_result .= html_e('div', array('id' => $idid, 'class' => 'box-surround'));
-		$t_result .= html_e('div', array('id' => $idtitle, 'class' => 'box-title'));
+		$t_result .= html_ao('div', array('id' => $idid, 'class' => 'box-surround'));
+		$t_result .= html_ao('div', array('id' => $idtitle, 'class' => 'box-title'));
 		$t_result .= html_e('div', array('id' => $idtcont, 'class' => 'box-title-content'), $title, false);
-		$t_result .= '</div> <!-- class="box-title" -->';
-
+		$t_result .= html_ac(html_ap() -1);
 		return $t_result;
 	}
 
@@ -195,9 +188,7 @@ class Theme extends Layout {
 	 * @return	string
 	 */
 	function boxBottom() {
-		$t_result='</div><!-- class="box-surround" -->';
-
-		return $t_result;
+		return html_ac(html_ap() -1).'<!-- class="box-surround" -->'."\n";
 	}
 
 	/**
@@ -227,69 +218,68 @@ class Theme extends Layout {
 		global $use_tooltips;
 
 		if ($use_tooltips) {
-			?>
-			<script type="text/javascript">//<![CDATA[
-				if (typeof(jQuery(window).tipsy) == 'function') {
+			echo html_ao('script', array('type' => 'text/javascript'));
+			echo '	//<![CDATA[
+				if (typeof(jQuery(window).tipsy) == \'function\') {
 					jQuery(document).ready(
 						function() {
-							jQuery('.tabtitle').tipsy({delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-nw').tipsy({gravity: 'nw', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-ne').tipsy({gravity: 'ne', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-w').tipsy({gravity: 'w', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-e').tipsy({gravity: 'e', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-sw').tipsy({gravity: 'sw', delayIn: 500, delayOut: 0, fade: true});
-							jQuery('.tabtitle-se').tipsy({gravity: 'se', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle\').tipsy({delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-nw\').tipsy({gravity: \'nw\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-ne\').tipsy({gravity: \'ne\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-w\').tipsy({gravity: \'w\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-e\').tipsy({gravity: \'e\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-sw\').tipsy({gravity: \'sw\', delayIn: 500, delayOut: 0, fade: true});
+							jQuery(\'.tabtitle-se\').tipsy({gravity: \'se\', delayIn: 500, delayOut: 0, fade: true});
 						}
 					);
 				}
-			//]]></script>
-			<?php
+			//]]>'."\n";
+			echo html_ac(html_ap() -1);
 		}
 
-		$return = '<!-- start tabs -->';
-		$return .= '<table class="tabGenerator fullwidth" ';
+		$return = '<!-- start tabs -->'."\n";
+		$attrs = array('class' => 'tabGenerator fullwidth');
 
 		if ($total_width != '100%')
-			$return .= 'style="width:' . $total_width . ';"';
+			$attrs['style'] = 'width:' . $total_width;
 
-		$return .= ">\n";
-		$return .= '<tr>';
+		$return .= html_ao('table', $attrs);
+		$return .= html_ao('tr');
 
 		$accumulated_width = 0;
 
-		for ($i=0; $i<$count; $i++) {
-			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width ;
-			$accumulated_width += $tabwidth ;
-
-			$return .= "\n";
+		for ($i = 0; $i < $count; $i++) {
+			$tabwidth = intval(ceil(($i+1)*100/$count)) - $accumulated_width;
+			$accumulated_width += $tabwidth;
 
 			// middle part
-			$return .= '<td class="tg-middle" style="width:'.$tabwidth.'%;"><a ';
-			$return .= 'id="'.md5($TABS_DIRS[$i]).'" ';
-			if ($use_tooltips && isset($TABS_TOOLTIPS[$i]))
-				$return .= 'class="tabtitle" title="'.$TABS_TOOLTIPS[$i].'" ';
-			$return .= 'href="'.$TABS_DIRS[$i].'">' . "\n";
-			$return .= '<span';
-
+			$attrs = array();
+			$attrs['class'] = 'tg-middle';
+			$attrs['style'] = 'width:'.$tabwidth.'%';
+			$return .= html_ao('td', $attrs);
+			if ($i == 0) {
+				$class_a = 'tabtitle-nw';
+			} else if ( $i == ($count - 1)) {
+				$class_a = 'tabtitle-ne';
+			} else {
+				$class_a = 'tabtitle';
+			}
+			$return .= html_ao('a', array('href' => $TABS_DIRS[$i], 'id' => md5($TABS_DIRS[$i]), 'class' => $class_a, 'title' => $TABS_TOOLTIPS[$i]));
+			$attrs = array();
 			if ($selected == $i)
-				$return .= ' class="selected"';
-
-			$return .= '>';
-			$return .= '<span';
+				$attrs['class'] = 'selected';
 
+			$return .= html_ao('span', $attrs);
+			$attrs = array();
 			if ($nested)
-				$return .= ' class="nested"';
+				$attrs['class'] = 'nested';
 
-			$return .= '>' . "\n";
-			$return .= ''.$TABS_TITLES[$i].'' . "\n";
-			$return .= '</span>';
-			$return .= '</span>' . "\n";
-			$return .= '</a></td>' . "\n";
+			$return .= html_e('span', $attrs, $TABS_TITLES[$i], false);
+			$return .= html_ac(html_ap() - 3);
 
 		}
 
-		$return .= '</tr></table><!-- end tabs -->';
-
+		$return .= html_ac(html_ap() -2).'<!-- end tabs -->'."\n";
 		return $return;
 	}
 
@@ -370,8 +360,7 @@ class Theme extends Layout {
 	 *
 	 * @return string
 	 */
-	function multiTableRow($row_attr, $cell_data, $istitle)
-	{
+	function multiTableRow($row_attr, $cell_data, $istitle) {
 		$return= '<tr class="ff" '.$row_attr;
 		if ( $istitle )
 			$return .=' align="center"';
@@ -402,8 +391,7 @@ class Theme extends Layout {
 	 * @param	string	$dirname	the dirname of the theme
 	 * @return	int		the theme id
 	 */
-	function getThemeIdFromName($dirname)
-	{
+	function getThemeIdFromName($dirname) {
 		$res = db_query_params ('SELECT theme_id FROM themes WHERE dirname=$1', array($dirname));
 		return db_result($res, 0, 'theme_id');
 	}
@@ -412,9 +400,8 @@ class Theme extends Layout {
 	 * headerJS() - creates the JS headers and calls the plugin javascript hook
 	 * @todo generalize this
 	 */
-	function headerJS()
-	{
-		echo '<script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>';
+	function headerJS() {
+		echo html_e('script', array('type' => 'text/javascript', 'src' => util_make_uri('/js/common.js')), '', false);
 
 		plugin_hook("javascript_file");
 
@@ -423,9 +410,10 @@ class Theme extends Layout {
 		plugin_hook("javascript", $params);
 		$javascript = $params['return'];
 		if($javascript) {
-			echo '<script type="text/javascript">//<![CDATA['."\n";
+			echo html_ao('script', array('type' => 'text/javascript')).'//<![CDATA['."\n";
 			echo $javascript;
-			echo "\n//]]></script>\n";
+			echo "\n".'//]]'."\n";
+			echo html_ac(html_ap() -1);
 		}
 		html_use_tooltips();
 		html_use_storage();
@@ -434,17 +422,16 @@ class Theme extends Layout {
 		html_use_jqueryui();
 		echo $this->getJavascripts();
 		echo $this->getStylesheets();
-		?>
-		<script type="text/javascript">//<![CDATA[
-		jQuery(window).load(function(){
-			jQuery(".quicknews").hide();
-			setTimeout("jQuery('.feedback').hide('slow')", 5000);
-			setInterval(function() {
-					setTimeout("jQuery('.feedback').hide('slow')", 5000);
-				}, 5000);
-		});
-		//]]></script>
-		<?php
+		echo html_ao('script', array('type' => 'text/javascript'));
+		echo '	//<![CDATA[
+			jQuery(window).load(function(){
+				setTimeout("jQuery(\'.feedback\').hide(\'slow\')", 5000);
+				setInterval(function() {
+						setTimeout("jQuery(\'.feedback\').hide(\'slow\')", 5000);
+					}, 5000);
+			});
+			//]]>'."\n";
+		echo html_ac(html_ap() -1);
 	}
 }
 

commit 36b072ba77c5b5841973588bd3166324f27387b0
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 23 15:50:21 2014 +0100

    use html_{e,ao,ac,ap} helpers

diff --git a/src/common/docman/views/addsubdocgroup.php b/src/common/docman/views/addsubdocgroup.php
index 6f03de83..235f53f 100644
--- a/src/common/docman/views/addsubdocgroup.php
+++ b/src/common/docman/views/addsubdocgroup.php
@@ -6,7 +6,7 @@
  * Copyright 2002-2003, Tim Perdue/GForge, LLC
  * Copyright 2010-2011, Franck Villaume - Capgemini
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2013, Franck Villaume - TrivialDev
+ * Copyright 2013-2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -36,10 +36,10 @@ if (!forge_check_perm('docman', $group_id, 'approve')) {
 }
 
 // plugin projects-hierarchy
-$actionurl = '?group_id='.$group_id.'&action=addsubdocgroup&dirid='.$dirid;
+$actionurl = '?group_id='.$group_id.'&action=addsubdocgroup&dirid='.$dirid;
 if (isset($childgroup_id) && $childgroup_id) {
 	$g = group_get_object($childgroup_id);
-	$actionurl .= '&childgroup_id='.$childgroup_id;
+	$actionurl .= '&childgroup_id='.$childgroup_id;
 }
 
 ?>
@@ -50,16 +50,14 @@ function doItAddSubGroup() {
 }
 //]]></script>
 <?php
-echo '<div class="docmanDivIncluded">';
-echo '<form id="addsubgroup" name="addsubgroup" method="post" action="'.$actionurl.'">';
+echo html_ao('div', array('class' => 'docmanDivIncluded'));
+echo html_ao('form', array('id' => 'addsubgroup', 'name' => 'addsubgroup', 'method' => 'post', 'action' => $actionurl));
 if ($dirid) {
 	$folderMessage = _('Name of the document subfolder to create');
-	echo $folderMessage._(': ');
 } else {
 	$folderMessage = _('Name of the document folder to create');
-	echo $folderMessage._(': ');
 }
-echo '<input required="required" type="text" name="groupname" size="40" maxlength="255" placeholder="'.$folderMessage.'" />';
-echo '<input id="submitaddsubgroup" type="button" value="'. _('Create') .'" onclick="javascript:doItAddSubGroup()" />';
-echo '</form>';
-echo '</div>';
+echo html_e('span', array(), $folderMessage._(': '), false);
+echo html_e('input', array('required' => 'required', 'type' => 'text',  'name' => 'groupname', 'size' => 40, 'maxlength' => 255, 'placeholder' => $folderMessage));
+echo html_e('input', array('id' => 'submitaddsubgroup', 'type' => 'button', 'value' => _('Create'), 'onclick' => 'javascript:doItAddSubGroup()'));
+echo html_ac(html_ap() -2);
diff --git a/src/common/docman/views/admin.php b/src/common/docman/views/admin.php
index 649941d..4ad38f7 100644
--- a/src/common/docman/views/admin.php
+++ b/src/common/docman/views/admin.php
@@ -33,9 +33,9 @@ if ( !forge_check_perm('docman', $group_id, 'admin')) {
 	$return_msg= _('Document Manager Access Denied');
 	session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
 }
-?>
 
-<div id="principalAdminDiv" class="docmanDivIncluded">
+echo html_ao('div', array('id' => 'principalAdminDiv', 'class' => 'docmanDivIncluded'));
+?>
 <script type="text/javascript">//<![CDATA[
 function doIt(formid) {
 	document.getElementById(formid).submit();
@@ -44,15 +44,14 @@ function doIt(formid) {
 //]]></script>
 <?php
 if (extension_loaded('zip')) {
-	echo '<form id="backup" name="backup" method="post" action="'. util_make_uri('/docman/view.php/'.$group_id.'/backup') .'" >';
-	echo '<ul>';
-	echo '<li><input id="submitbackup" type="button" value="'. _('Extract documents and directories as an archive') .'" onclick="javascript:doIt(\'backup\')"></li>';
-	echo '</ul>';
-	echo '</form>';
+	echo html_ao('form', array('id' => 'backup', 'name' => 'backup', 'method' => 'post', 'action' => util_make_uri('/docman/view.php/'.$group_id.'/backup')));
+	echo html_ao('ul');
+	echo html_e('li', array(), '<input id="submitbackup" type="button" value="'. _('Extract documents and directories as an archive') .'" onclick="javascript:doIt(\'backup\')" />', false);
+	echo html_ac(html_ap() -2);
 }
 
-echo '<form id="createonline" name="createonline" method="post" action="?group_id='.$group_id.'&action=updatecreateonline" >';
-echo '<ul>';
+echo html_ao('form', array('id' => 'createonline', 'name' => 'createonline', 'method' => 'post', 'action' => '?group_id='.$group_id.'&action=updatecreateonline'));
+echo html_ao('ul');
 $createOnlineStatus = '1';
 $labelCreateOnline = _('Enable Create Online Documents');
 if ($g->useCreateOnline()) {
@@ -60,11 +59,10 @@ if ($g->useCreateOnline()) {
 	$labelCreateOnline = _('Disable Create Online Documents');
 }
 echo '<li><input name="status" type="hidden" value="'.$createOnlineStatus.'"><input id="submitcreateonline" type="button" value="'.$labelCreateOnline.'" onclick="javascript:doIt(\'createonline\')"></li>';
-echo '</ul>';
-echo '</form>';
+echo html_ac(html_ap() -2);
 
-echo '<form id="searchengine" name="searchengine" method="post" action="?group_id='.$group_id.'&action=updateenginesearch" >';
-echo '<ul>';
+echo html_ao('form', array('id' => 'searchengine', 'name' => 'searchengine', 'method' => 'post', 'action' => '?group_id='.$group_id.'&action=updateenginesearch'));
+echo html_ao('ul');
 $searchEngineStatus = '1';
 $labelSearchEngine = _('Enable Search Engine');
 if ($g->useDocmanSearch()) {
@@ -72,20 +70,18 @@ if ($g->useDocmanSearch()) {
 	$labelSearchEngine = _('Disable Search Engine');
 }
 echo '<li><input name="status" type="hidden" value="'.$searchEngineStatus.'"><input id="submitsearchengine" type="button" value="'.$labelSearchEngine.'" onclick="javascript:doIt(\'searchengine\')"></li>';
-echo '</ul>';
-echo '</form>';
+echo html_ac(html_ap() -2);
 
 if ($g->useDocmanSearch()) {
-	echo '<form id="reindexword" name="reindexword" method="post" action="?group_id='.$group_id.'&action=forcereindexenginesearch">';
-	echo '<ul>';
+	echo html_ao('form', array('id' => 'reindexword', 'name' => 'reindexword', 'method' => 'post', 'action' => '?group_id='.$group_id.'&action=forcereindexenginesearch'));
+	echo html_ao('ul');
 	echo '<li><input name="status" type="hidden" value="1"><input id="submitreindexword" type="button" value="'. _('Force reindexation search engine') .'" onclick="javascript:doIt(\'reindexword\')"></li>';
-	echo '</ul>';
-	echo '</form>';
+	echo html_ac(html_ap() -2);
 }
 
 if (forge_get_config('use_webdav')) {
-	echo '<form id="webdavinterface" name="webdavinterface" method="post" action="?group_id='.$group_id.'&action=updatewebdavinterface" >';
-	echo '<ul>';
+	echo html_ao('form', array('id' => 'webdavinterface', 'name' => 'webdavinterface', 'method' => 'post', 'action' => '?group_id='.$group_id.'&action=updatewebdavinterface'));
+	echo html_ao('ul');
 	$webdavStatus = '1';
 	$labelWebdavInterface = _('Enable Webdav Interface');
 	if ($g->useWebDav()) {
@@ -93,9 +89,8 @@ if (forge_get_config('use_webdav')) {
 		$labelWebdavInterface = _('Disable Webdav Interface');
 	}
 	echo '<li><input name="status" type="hidden" value="'.$webdavStatus.'"><input id="submitweddavinterface" type="button" value="'.$labelWebdavInterface.'" onclick="javascript:doIt(\'webdavinterface\')"></li>';
-	echo '</ul>';
-	echo '</form>';
+	echo html_ac(html_ap() -2);
 }
 
 plugin_hook('hierarchy_views', array($group_id, 'docman'));
-echo '</div>';
+echo html_ac(html_ap() -1);
diff --git a/src/common/docman/views/tree.php b/src/common/docman/views/tree.php
index cfe125c..dbf6c5e 100644
--- a/src/common/docman/views/tree.php
+++ b/src/common/docman/views/tree.php
@@ -37,11 +37,11 @@ if (!forge_check_perm('docman', $group_id, 'read')) {
 	session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg));
 }
 
-echo '<div id="documenttree">';
+echo html_ao('div', array('id' => 'documenttree'));
 $dm = new DocumentManager($g);
-echo '<ul id="'.$g->getUnixname().'-tree">';
+echo html_ao('ul', array('id' => $g->getUnixname().'-tree'));
 $dm->getTree($dirid, $linkmenu);
-echo '</ul>';
+echo html_ac(html_ap() - 1);
 echo '
 <script type="text/javascript">//<![CDATA[
 	jQuery(document).ready(function() {
@@ -60,12 +60,12 @@ if (isset($projectIDsArray) && is_array($projectIDsArray)) {
 		$groupObject = group_get_object($projectID);
 		if ($groupObject->usesDocman() && $projectsHierarchy->getDocmanStatus($groupObject->getID())
 			&& forge_check_perm('docman', $groupObject->getID(), 'read')) {
-			echo '<hr>';
-			echo '<h5>'._('Child project')._(': ').util_make_link('/docman/?group_id='.$groupObject->getID(),$groupObject->getPublicName(), array('class'=>'tabtitle', 'title'=>_('Browse document manager for this project.'))).'</h5>';
+			echo html_e('hr');
+			echo html_e('h5', array(), _('Child project')._(': ').util_make_link('/docman/?group_id='.$groupObject->getID(),$groupObject->getPublicName(), array('class'=>'tabtitle', 'title'=>_('Browse document manager for this project.'))), false);
 			$dmc = new DocumentManager($groupObject);
-			echo '<ul id="'.$groupObject->getUnixname().'-tree">';
+			echo html_ao('ul', array('id' => $groupObject->getUnixname().'-tree'));
 			$dmc->getTree($dirid, $linkmenu);
-			echo '</ul>';
+			echo html_ac(html_ap() - 1);
 			echo '
 			<script type="text/javascript">//<![CDATA[
 				jQuery(document).ready(function() {
@@ -100,4 +100,4 @@ if (isset($childgroup_id) && $childgroup_id) {
 		//]]></script>
 	';
 }
-echo '</div>';
+echo html_ac(html_ap() - 1);
diff --git a/src/plugins/projects-hierarchy/view/admin_project_link.php b/src/plugins/projects-hierarchy/view/admin_project_link.php
index 67619d3..24eed6e 100644
--- a/src/plugins/projects-hierarchy/view/admin_project_link.php
+++ b/src/plugins/projects-hierarchy/view/admin_project_link.php
@@ -26,7 +26,7 @@
 global $group_id;
 $projectsHierarchy = plugin_get_object('projects-hierarchy');
 
-echo '<h3>'._('Modify the hierarchy').'</h3>';
+echo html_e('h3', array(), _('Modify the hierarchy'), false);
 
 $childs = $projectsHierarchy->getFamily($group_id, 'child', false, 'validated');
 if (sizeof($childs)) {
diff --git a/src/plugins/projects-hierarchy/view/docman_project_link.php b/src/plugins/projects-hierarchy/view/docman_project_link.php
index b6146de..0418523 100644
--- a/src/plugins/projects-hierarchy/view/docman_project_link.php
+++ b/src/plugins/projects-hierarchy/view/docman_project_link.php
@@ -3,7 +3,7 @@
  * docman hierarchy view
  *
  * Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -28,16 +28,16 @@ $projectsHierarchy = plugin_get_object('projects-hierarchy');
 $globalConfArray = $projectsHierarchy->getGlobalConf();
 
 if ($globalConfArray['docman']) {
-	echo '<form id="projectsHierarchyDocman" name="projectsHierarchyDocman" method="post" action="/plugins/'.$projectsHierarchy->name.'/?action=projectsHierarchyDocman&id='.$group_id.'&type=group" >';
-	echo '<ul>';
+	echo html_ao('form', array('id' => 'projectsHierarchyDocman', 'name' => 'projectsHierarchyDocman', 'method' => 'post', 'action' => util_make_uri('/plugins/'.$projectsHierarchy->name.'/?action=projectsHierarchyDocman&id='.$group_id.'&type=group')));
+	echo html_ao('ul');
 	$label = _('Enable hierarchical browsing');
 	$status = 1;
 	if ($projectsHierarchy->getDocmanStatus($group_id)) {
 		$label = _('Disable hierarchical browsing');
 		$status = 0;
 	}
-	echo '<input name="status" type="hidden" value="'.$status.'" />';
-	echo '<li><input id="projectsHierarchyDocmanSubmit" type="submit" value="'.$label.'" /></li>';
-	echo '</ul>';
-	echo '</form>';
+	echo html_e('input', array('name' => 'status', 'type' => 'hidden', 'value' => $status));
+	echo html_ao('li');
+	echo html_e('input', array('id' => 'projectsHierarchyDocmanSubmit', 'type' => 'submit', 'value' => $label));
+	echo html_ac(html_ap() - 3);
 }

commit 7825b478264fbb9e15d47490721621d439466504
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 23 14:58:14 2014 +0100

    funky & wOw : use html_{e,ao,ac,ap} helpers

diff --git a/src/www/themes/funky-wOw/Theme.class.php b/src/www/themes/funky-wOw/Theme.class.php
index 880e3b5..641ccdc 100644
--- a/src/www/themes/funky-wOw/Theme.class.php
+++ b/src/www/themes/funky-wOw/Theme.class.php
@@ -136,9 +136,9 @@ class Theme extends Layout {
 	function boxTop($title, $id = '') {
 		if ($id) {
 			$id = $this->toSlug($id);
-			$idid = ' id="' . $id . '"';
-			$idtitle = ' id="' . $id . '-title"';
-			$idtcont = ' id="' . $id . '-title-content"';
+			$idid = $id;
+			$idtitle = $id.'-title"';
+			$idtcont = $id.'-title-content"';
 		} else {
 			$idid = "";
 			$idtitle = "";
@@ -146,9 +146,9 @@ class Theme extends Layout {
 		}
 
 		$t_result = '';
-		$t_result .= '<div' . $idid . ' class="box-surround">';
-		$t_result .= '<div' . $idtitle . ' class="box-title">';
-		$t_result .= '<div' . $idtcont . ' class="box-title-content">'. $title .'</div>';
+		$t_result .= html_e('div', array('id' => $idid, 'class' => 'box-surround'));
+		$t_result .= html_e('div', array('id' => $idtitle, 'class' => 'box-title'));
+		$t_result .= html_e('div', array('id' => $idtcont, 'class' => 'box-title-content'), $title, false);
 		$t_result .= '</div> <!-- class="box-title" -->';
 
 		return $t_result;
@@ -164,14 +164,12 @@ class Theme extends Layout {
 	function boxMiddle($title, $id = '') {
 		if ($id) {
 			$id = $this->toSlug($id);
-			$idtitle = ' id="' . $id . '-title"';
+			$idtitle = $id.'-title"';
 		} else {
 			$idtitle = "";
 		}
 
-		$t_result ='<div' . $idtitle . ' class="box-middle">'.$title.'</div>';
-
-		return $t_result;
+		return html_e('div', array('id' => $idtitle, 'class' => 'box-middle'), $title, false);
 	}
 
 	/**
@@ -184,13 +182,12 @@ class Theme extends Layout {
 	function boxContent($content, $id = '') {
 		if ($id) {
 			$id = $this->toSlug($id);
-			$idcont = ' id="' . $id . '-content"';
+			$idcont = $id.'-content"';
 		} else {
 			$idcont = "";
 		}
 
-		$t_result ='<div' . $idcont . ' class="box-content">'.$content.'</div>';
-		return $t_result;
+		return html_e('div', array('id' => $idcont, 'class' => 'box-content'), $content, false);
 	}
 
 	/**
@@ -303,7 +300,7 @@ class Theme extends Layout {
 	 * @return	string	Html to start a submenu.
 	 */
 	function beginSubMenu() {
-		$return = '<ul class="submenu">';
+		$return = html_eo('ul', array('class' => 'submenu'));
 		return $return;
 	}
 
@@ -313,7 +310,7 @@ class Theme extends Layout {
 	 * @return	string	Html to end a submenu.
 	 */
 	function endSubMenu() {
-		$return = '</ul>';
+		$return = '</ul>'."\n";
 		return $return;
 	}
 
@@ -334,10 +331,15 @@ class Theme extends Layout {
 				$attr_arr[] = NULL;
 			}
 		}
-		for ($i=0; $i<$count; $i++)
-			$return .= "<li><span>" . util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]) . "</span></li>";
+		for ($i = 0; $i < $count; $i++) {
+			$return .= html_ao('li');
+			$return .= html_e('span', array(), util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]), false);
+			$return .= html_ac(html_ap() -1);
+		}
 
-		$return .= "<li><span>" . util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]) . "</span></li>";
+		$return .= html_ao('li');
+		$return .= html_e('span', array(), util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]), false);
+		$return .= html_ac(html_ap() -1);
 		return $return;
 	}
 
@@ -436,7 +438,6 @@ class Theme extends Layout {
 		?>
 		<script type="text/javascript">//<![CDATA[
 		jQuery(window).load(function(){
-			jQuery(".quicknews").hide();
 			setTimeout("jQuery('.feedback').hide('slow')", 5000);
 			setInterval(function() {
 					setTimeout("jQuery('.feedback').hide('slow')", 5000);
diff --git a/src/www/themes/funky/Theme.class.php b/src/www/themes/funky/Theme.class.php
index 3bf27aa..7b9d1ec 100644
--- a/src/www/themes/funky/Theme.class.php
+++ b/src/www/themes/funky/Theme.class.php
@@ -42,22 +42,6 @@ class Theme extends Layout {
 		$this->addStylesheet('/themes/funky/css/theme-pages.css');
 	}
 
-	function quicknewsbutton() {
-		return "<div class='quicknews-toggle'><a href=# onclick='jQuery(\".quicknews\").slideToggle()'>news</a></div>";
-	}
-
-	function quicknews() {
-		$ret = "<div class='quicknews'>";
-		$ret .= "<ul>";
-		$ret .= "<li><h1>news de ouf</h1>hello world</li>";
-		$ret .= "<li><h1>news de ouf</h1>hello world</li>";
-		$ret .= "<li><h1>news de ouf</h1>hello world</li>";
-		$ret .= "<li><h1>news de ouf</h1>hello world</li>";
-		$ret .= "</ul>";
-		$ret .= "</div>";
-		return $ret;
-	}
-
 	function bodyHeader($params) {
 
 		if (!isset($params['h1']) && isset($params['title'])) {
@@ -315,7 +299,7 @@ class Theme extends Layout {
 	 * @return	string	Html to start a submenu.
 	 */
 	function beginSubMenu() {
-		$return = '<ul class="submenu">';
+		$return = html_eo('ul', array('class' => 'submenu'));
 		return $return;
 	}
 
@@ -325,7 +309,7 @@ class Theme extends Layout {
 	 * @return	string	Html to end a submenu.
 	 */
 	function endSubMenu() {
-		$return = '</ul>';
+		$return = '</ul>'."\n";
 		return $return;
 	}
 
@@ -346,10 +330,15 @@ class Theme extends Layout {
 				$attr_arr[] = NULL;
 			}
 		}
-		for ($i=0; $i<$count; $i++)
-			$return .= "<li><span>" . util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]) . "</span></li>";
+		for ($i = 0; $i < $count; $i++) {
+			$return .= html_ao('li');
+			$return .= html_e('span', array(), util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]), false);
+			$return .= html_ac(html_ap() -1);
+		}
 
-		$return .= "<li><span>" . util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]) . "</span></li>";
+		$return .= html_ao('li');
+		$return .= html_e('span', array(), util_make_link($links_arr[$i], $title_arr[$i], $attr_arr[$i]), false);
+		$return .= html_ac(html_ap() -1);
 		return $return;
 	}
 

commit ee84aa3bb23f471b76c5f73f0050a8c1d1d2b71d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 23 13:28:33 2014 +0100

    docman: fix tree display

diff --git a/src/common/docman/DocumentManager.class.php b/src/common/docman/DocumentManager.class.php
index 93148a1..dd41f0a 100644
--- a/src/common/docman/DocumentManager.class.php
+++ b/src/common/docman/DocumentManager.class.php
@@ -213,7 +213,9 @@ class DocumentManager extends Error {
 					echo html_ao('li', array('id' => 'leaf-'.$subGroupIdValue, 'class' => $liclass)).util_make_link($link, $localDg->getName()).$nbDocsLabel;
 				}
 				if ($dg->getSubgroup($subGroupIdValue, $stateId)) {
-					echo html_e('ul', array('class' => 'simpleTreeMenu'), $this->getTree($selecteddir, $linkmenu, $subGroupIdValue), false);
+					echo html_ao('ul', array('class' => 'simpleTreeMenu'));
+					$this->getTree($selecteddir, $linkmenu, $subGroupIdValue);
+					echo html_ac(html_ap() - 1);
 				}
 				echo html_ac(html_ap() -1);
 			}

commit 0aa56f9f5eec312fcae2fef6f610b5827ce6f4cf
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 23 12:06:18 2014 +0100

    docman: use html_{ao,ac,ap,e} helpers in additem.php

diff --git a/src/common/docman/views/additem.php b/src/common/docman/views/additem.php
index b91ddcb..a66b3ff 100644
--- a/src/common/docman/views/additem.php
+++ b/src/common/docman/views/additem.php
@@ -48,41 +48,36 @@ jQuery(document).ready(function() {
 });
 //]]></script>
 
-<div id="tabs">
-<ul>
-<li><a id="tab-new-document" href="#tabs-new-document" class="tabtitle" title="<?php echo _('Submit a new document in this folder.') ?>">
-    <?php echo _('New Document') ?></a></li>
-<?php if (forge_check_perm('docman', $group_id, 'approve')) { ?>
-<li><a id="tab-new-folder" href="#tabs-new-folder" class="tabtitle" title="<?php echo _('Create a folder based on this name.') ?>">
-    <?php echo _('New Folder') ?></a></li>
-<li><a id="tab-inject-tree" href="#tabs-inject-tree" class="tabtitle" title="<?php echo _('Create a full folders tree using an compressed archive. Only ZIP format support.') ?>">
-    <?php echo _('Inject Tree') ?></a></li>
-<?php } ?>
-</ul>
-
 <?php
-echo '<div id="tabs-new-document">';
-echo '<div class="docman_div_include" id="addfile">';
+echo html_ao('div', array('id' => 'tabs'));
+echo html_ao('ul');
+echo html_e('li', array(), util_make_link('#tabs-new-document', _('New Document'), array('id' => 'tab-new-document', 'class' => 'tabtitle', 'title' => _('Submit a new document in this folder.')), true), false);
+
+if (forge_check_perm('docman', $group_id, 'approve')) {
+	echo html_e('li', array(), util_make_link('#tabs-new-folder', _('New Folder'), array('id' => 'tab-new-folder', 'class' => 'tabtitle', 'title' => _('Create a folder based on this name.')), true), false);
+	echo html_e('li', array(), util_make_link('#tabs-inject-tree', _('Inject Tree'), array('id' => 'tab-inject-tree', 'class' => 'tabtitle', 'title' => _('Create a full folders tree using an compressed archive. Only ZIP format support.')), true), false);
+}
+
+echo html_ac(html_ap() -1);
+echo html_ao('div', array('id' => 'tabs-new-document'));
+echo html_ao('div', array('class' => 'docman_div_include', 'id' => 'addfile'));
 include ($gfcommon.'docman/views/addfile.php');
-echo '</div>';
-echo '</div>';
+echo html_ac(html_ap() -2);
 
 if (forge_check_perm('docman', $group_id, 'approve')) {
-	echo '<div id="tabs-new-folder">';
-	echo '<div class="docman_div_include" id="addsubdocgroup">';
+	echo html_ao('div', array('id' => 'tabs-new-folder'));
+	echo html_ao('div', array('class' => 'docman_div_include', 'id' => 'addsubdocgroup'));
 	include ($gfcommon.'docman/views/addsubdocgroup.php');
-	echo '</div>';
-	echo '</div>';
-	echo '<div id="tabs-inject-tree">';
-	echo '<div class="docman_div_include" id="zipinject">';
-	echo '<form id="injectzip" name="injectzip" method="post" action="?group_id='.$group_id.'&action=injectzip&dirid='.$dirid.'" enctype="multipart/form-data">';
-	echo '<p>';
-	echo '<label>' . _('Upload archive:') . ' </label><input type="file" name="uploaded_zip" required="required" />'.sprintf(_('(max upload size: %s)'),human_readable_bytes(util_get_maxuploadfilesize()));
-	echo '<input id="submitinjectzip" type="button" value="'. _('Inject Tree') .'" />';
-	echo '</p>';
-	echo '</form>';
-	echo '</div>';
-	echo '</div>';
+	echo html_ac(html_ap() -2);
+	echo html_ao('div', array('id' => 'tabs-inject-tree'));
+	echo html_ao('div', array('class' => 'docman_div_include', 'id' => 'zipinject'));
+	echo html_ao('form', array('id' => 'injectzip', 'name' => 'injectzip', 'method' => 'post', 'action' => '?group_id='.$group_id.'&action=injectzip&dirid='.$dirid, 'enctype' => 'multipart/form-data'));
+	echo html_ao('p');
+	echo html_e('label', array(), _('Upload archive:'), false);
+	echo html_e('input', array('type' => 'file', 'name' => 'uploaded_zip', 'required' => 'required'));
+	echo html_e('span', array(), sprintf(_('(max upload size: %s)'),human_readable_bytes(util_get_maxuploadfilesize())), false);
+	echo html_e('input', array('id' => 'submitinjectzip', 'type' => 'button', 'value' => _('Inject Tree')));
+	echo html_ac(html_ap() -4);
 }
 
-echo '</div>';
+echo html_ac(html_ap() -1);

commit 4922ef9126cd21470d2f38de9bef3680c9b6d790
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 23 11:53:09 2014 +0100

    docman: fix missing dm object

diff --git a/src/common/docman/views/addfile.php b/src/common/docman/views/addfile.php
index 4d9097b..d4e1ff4 100644
--- a/src/common/docman/views/addfile.php
+++ b/src/common/docman/views/addfile.php
@@ -42,6 +42,9 @@ if (isset($childgroup_id) && $childgroup_id) {
 	$redirecturl .= '&childgroup_id='.$childgroup_id;
 }
 
+if (!$dm)
+	$dm = new DocumentManager($g);
+
 $dgf = new DocumentGroupFactory($g);
 if ($dgf->isError())
 	exit_error($dgf->getErrorMessage(), 'docman');

-----------------------------------------------------------------------

Summary of changes:
 src/common/docman/DocumentManager.class.php        |    4 +-
 src/common/docman/views/addfile.php                |    3 +
 src/common/docman/views/additem.php                |   57 +++---
 src/common/docman/views/addsubdocgroup.php         |   20 +-
 src/common/docman/views/admin.php                  |   43 ++--
 src/common/docman/views/tree.php                   |   16 +-
 src/common/include/Navigation.class.php            |   28 ++-
 src/common/widget/WidgetLayoutManager.class.php    |   34 ++--
 src/common/widget/WidgetLayout_Row.class.php       |   10 +-
 .../widget/WidgetLayout_Row_Column.class.php       |    5 +-
 src/common/widget/Widget_ProjectInfo.class.php     |   10 +-
 .../online_help/common/online_helpPlugin.class.php |    3 +-
 .../projects-hierarchy/view/admin_project_link.php |    2 +-
 .../view/docman_project_link.php                   |   14 +-
 .../projects-hierarchy/view/home_project_link.php  |   14 +-
 src/www/include/Layout.class.php                   |   74 ++++---
 src/www/include/html.php                           |    7 +-
 src/www/themes/funky-wOw/Theme.class.php           |  210 +++++++++-----------
 src/www/themes/funky/Theme.class.php               |  204 +++++++++----------
 19 files changed, 359 insertions(+), 399 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list