[Fusionforge-commits] FusionForge branch master updated. a12f3431568ae160d295ece8aca51ec82822a548

Franck Villaume nerville at fusionforge.org
Fri Oct 24 10:37:40 CEST 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  a12f3431568ae160d295ece8aca51ec82822a548 (commit)
      from  7ab00ed9e691bbf0c89fe47b3de93a01d65c8c55 (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 a12f3431568ae160d295ece8aca51ec82822a548
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Oct 24 10:30:58 2014 +0200

    use HTML helpers

diff --git a/src/www/scm/admin/index.php b/src/www/scm/admin/index.php
index 8af9b2a..bb05d9a 100644
--- a/src/www/scm/admin/index.php
+++ b/src/www/scm/admin/index.php
@@ -137,8 +137,9 @@ $hook_params['group_id'] = $group_id;
 plugin_hook('scm_admin_buttons', $hook_params);
 
 scm_header(array('title'=>_('SCM Repository'),'group'=>$group_id));
+echo html_ao('script', array('type' => 'text/javascript'));
 ?>
-<script type="text/javascript">
+//<![CDATA[
 	$(document).ready(function() {
 		$("input[type=radio][name=scmradio]").change(function() {
 			$("input[type=radio][name=scmradio]").each(function () {
@@ -147,8 +148,9 @@ scm_header(array('title'=>_('SCM Repository'),'group'=>$group_id));
 			$('#div_'+$("input[type=radio][name=scmradio]:checked").val()).show();
 		});
 	});
-</script>
+//]]>
 <?php
+echo html_ac(html_ap() - 1);
 echo $HTML->openForm(array('method' => 'post', 'action' => util_make_uri('/scm/admin/?group_id='.$group_id)));
 $hook_params = array () ;
 $hook_params['group_id'] = $group_id ;
@@ -156,37 +158,32 @@ $hook_params['group_id'] = $group_id ;
 $SCMFactory = new SCMFactory();
 $scm_plugins = $SCMFactory->getSCMs();
 if (count($scm_plugins) != 0) {
-	echo '<p>'._('Note: Changing the repository does not delete the previous repository.  It only affects the information displayed under the SCM tab.').'</p>';
+	echo $HTML->information(_('Note: Changing the repository does not delete the previous repository.  It only affects the information displayed under the SCM tab.'));
 	if (count($scm_plugins) == 1) {
 		$myPlugin = plugin_get_object($scm_plugins[0]);
-		echo '<input type="hidden" name="scmradio" value="'.$myPlugin->name.'" />' ;
-		echo '<p><input type="radio" name="fake" disabled="disabled" checked="checked" />'.$myPlugin->text.'</p>';
+		echo html_e('input', array('type' => 'hidden', 'name' => 'scmradio', 'value' => $myPlugin->name));
+		echo html_e('p', array(), html_e('input', array('type' => 'radio', 'name' => 'fake', 'disabled' => 'disabled', 'checked' => 'checked')).$myPlugin->text);
 		$scm = $myPlugin->name;
 	} else {
-		echo '<table><tbody><tr><td><strong>'._('SCM Repository').'</strong></td>';
-		$checked=true;
+		echo html_e('h2', array(), _('SCM Repository'));
 		foreach ($scm_plugins as $plugin) {
 			$myPlugin = plugin_get_object($plugin);
-			echo '<td><input type="radio" name="scmradio" ';
-			echo 'value="'.$myPlugin->name.'"';
+			$inputAttr = array('type' => 'radio', 'name' => 'scmradio', 'value' => $myPlugin->name);
 			if ($group->usesPlugin($myPlugin->name)) {
 				$scm = $myPlugin->name;
-				echo ' checked="checked"';
+				$inputAttr['checked'] = 'checked';
 			}
-			echo ' />'.$myPlugin->text.'</td>';
+			echo html_e('input', $inputAttr).$myPlugin->text;
 		}
-		echo '</tr></tbody></table>'."\n";
 	}
 } else {
-	echo $HTML->error_msg(_('Error: Site has SCM but no plugins registered'));
+	echo $HTML->error_msg(_('Error')._(': ')._('Site has SCM but no plugins registered'));
 }
 
 (isset($scm)) ? $hook_params['scm_plugin'] = $scm : $hook_params['scm_plugin'] = 0;
 plugin_hook("scm_admin_page", $hook_params);
-?>
-<input type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
-<input type="submit" name="submit" value="<?php echo _('Update'); ?>" />
-<?php
+echo html_e('input', array('type' => 'hidden', 'name' => 'group_id', 'value' => $group_id));
+echo html_e('p', array(), html_e('input', array('type' => 'submit', 'name' => 'submit', 'value' => _('Update'))));
 echo $HTML->closeForm();
 
 plugin_hook('scm_admin_form', $hook_params);
diff --git a/src/www/scm/include/scm_utils.php b/src/www/scm/include/scm_utils.php
index 4f437fd..736953a 100644
--- a/src/www/scm/include/scm_utils.php
+++ b/src/www/scm/include/scm_utils.php
@@ -65,11 +65,11 @@ function scm_header($params) {
 
 	$params['toptab'] = 'scm';
 	site_project_header($params);
-	echo '<div id="scm" class="scm">';
+	echo html_ao('div', array('id' => 'scm', 'class' => 'scm'));
 }
 
 function scm_footer() {
-	echo '</div>';
+	echo html_ac(html_ap() -1);
 	site_project_footer();
 }
 
@@ -186,7 +186,7 @@ function commitstime_graph($group_id, $chartid) {
 			plot'.$chartid.'.replot();
 		});'."\n";
 	echo '//]]></script>';
-	echo '<div id="chart'.$chartid.'"></div>';
+	echo html_e('div', array('id' => 'chart'.$chartid), '', false);
 }
 
 function commits_graph($group_id, $days, $chartid) {
@@ -250,7 +250,7 @@ function commits_graph($group_id, $days, $chartid) {
 				plot'.$chartid.'.replot( { resetAxes: true } );
 			});'."\n";
 		echo '//]]></script>';
-		echo '<div id="chart'.$chartid.'"></div>';
+		echo html_e('div', array('id' => 'chart'.$chartid), '', false);
 	} else {
 		echo $HTML->information(_('No commits during this period.'));
 	}
diff --git a/src/www/scm/reporting/index.php b/src/www/scm/reporting/index.php
index 0eade2e..49c9ef8 100644
--- a/src/www/scm/reporting/index.php
+++ b/src/www/scm/reporting/index.php
@@ -34,17 +34,17 @@ html_use_jqueryjqplotplugindateAxisRenderer();
 $group_id = getIntFromRequest("group_id");
 scm_header(array('title'=>_('SCM Repository Reporting'), 'group'=>$group_id));
 
-echo '<h2>'._('Commits Over Time')."</h2>\n";
+echo html_e('h2', array(), _('Commits Over Time'));
 commitstime_graph($group_id, 1);
 
 
-echo '<h2>'._('Commits Last 30 Days')."</h2>\n";
+echo html_e('h2', array(), _('Commits Last 30 Days'));
 commits_graph($group_id, 30, 2);
 
-echo '<h2>'._('Commits Last 90 Days')."</h2>\n";
+echo html_e('h2', array(), _('Commits Last 90 Days'));
 commits_graph($group_id, 90, 3);
 
-echo '<h2>'._('Commits Last 365 Days')."</h2>\n";
+echo html_e('h2', array(), _('Commits Last 365 Days'));
 commits_graph($group_id, 365, 4);
 
 scm_footer();

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

Summary of changes:
 src/www/scm/admin/index.php       |   31 ++++++++++++++-----------------
 src/www/scm/include/scm_utils.php |    8 ++++----
 src/www/scm/reporting/index.php   |    8 ++++----
 3 files changed, 22 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list