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  5c285a2622faae471eaf60b001a39106ad994e79 (commit)
      from  11700e37bca501c9df787eec2dad9de6a6cfddd8 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=5c285a2622faae471eaf60b001a39106ad994e79

commit 5c285a2622faae471eaf60b001a39106ad994e79
Author: Franck Villaume <[email protected]>
Date:   Wed Sep 6 15:00:48 2017 +0000

    less code

diff --git a/src/www/include/Layout.class.php b/src/www/include/Layout.class.php
index 69dbab6..55dbb48 100644
--- a/src/www/include/Layout.class.php
+++ b/src/www/include/Layout.class.php
@@ -39,6 +39,7 @@
 require_once $gfcommon.'include/constants.php';
 require_once $gfcommon.'include/FusionForge.class.php';
 require_once $gfcommon.'include/Navigation.class.php';
+require_once $gfwww.'include/html.php';
 
 abstract class Layout extends FFError {
 
@@ -771,19 +772,17 @@ abstract class Layout extends FFError {
        }
 
        function jQueryUIconfirmBox($id = 'dialog-confirm', $title = 'Confirm 
your action', $message = 'Do you confirm your action?') {
-               $htmlcode = html_ao('div', array('id' => $id, 'title' => 
$title, 'class' => 'hide'));
-               $htmlcode .= html_e('p', array(), html_e('span', array('class' 
=> 'ui-icon ui-icon-alert', 'style' => 'float:left; margin:0 7px 20px 0;'), '', 
false).$message);
-               $htmlcode .= html_ac(html_ap() -1);
-               return $htmlcode;
+               return html_e('div', array('id' => $id, 'title' => $title, 
'class' => 'hide'), 
+                               html_e('p', array(), html_e('span', 
array('class' => 'ui-icon ui-icon-alert', 'style' => 'float:left; margin:0 7px 
20px 0;'), '', false).$message));
        }
 
        function html_input($name, $id = '', $label = '', $type = 'text', 
$value = '', $extra_params = '') {
                if (!$id) {
                        $id = $name;
                }
-               $return = html_ao('div', array('class' => 'field-holder'));
+               $htmllabel = '';
                if ($label) {
-                       $return .= html_e('label', array('for' => $id), $label);
+                       $htmllabel .= html_e('label', array('for' => $id), 
$label, true);
                }
                $attrs = array('id' => $id, 'type' => $type);
                //if input is a submit then name is not present
@@ -798,16 +797,13 @@ abstract class Layout extends FFError {
                                $attrs[$key] = $extra_params_value;
                        }
                }
-               $return .= html_e('input', $attrs);
-               $return .= html_ac(html_ap() -1);
-               return $return;
+               return html_e('div', array('class' => 'field-holder'), 
$htmllabel.html_e('input', $attrs));
        }
 
        function html_checkbox($name, $value, $id = '', $label = '', $checked = 
'', $extra_params = array()) {
                if (!$id) {
                        $id = $name;
                }
-               $return = html_ao('div', array('class' => 'field-holder'));
                $attrs = array('name' => $name, 'id' => $id, 'type' => 
'checkbox', 'value' => $value);
                if ($checked) {
                        $attrs['checked'] = 'checked';
@@ -817,12 +813,11 @@ abstract class Layout extends FFError {
                                $attrs[$key] = $extra_params_value;
                        }
                }
-               $return .= html_e('input', $attrs);
+               $htmllabel = '';
                if ($label) {
-                       $return .= html_e('label', array('for' => $id), $label, 
true);
+                       $htmllabel .= html_e('label', array('for' => $id), 
$label, true);
                }
-               $return .= html_ac(html_ap() -1);
-               return $return;
+               return html_e('div', array('class' => 'field-holder'), 
$htmllabel.html_e('input', $attrs));
        }
 
        function html_text_input_img_submit($name, $img_src, $id = '', $label = 
'', $value = '', $img_title = '', $img_alt = '', $extra_params = array(), 
$img_extra_params = '') {
@@ -865,39 +860,17 @@ abstract class Layout extends FFError {
                if (!$id) {
                        $id = $name;
                }
-               $return = '<div class="field-holder">
-                       ';
+               $htmllabel = '';
                if ($label) {
-                       $return .= html_e('label', array('for' => $id), $label);
+                       $htmllabel .= html_e('label', array('for' => $id), 
$label);
                }
-               $return .= '<select name="' . $name . '" id="' . $id . '" ';
+               $attrs = array();
                if (is_array($extra_params)) {
                        foreach ($extra_params as $key => $extra_params_value) {
-                               $return .= $key . '="' . $extra_params_value . 
'" ';
-                       }
-               }
-               $return .= '>';
-               $rows = count($vals);
-               for ($i = 0; $i < $rows; $i++) {
-                       if ( $text_is_value ) {
-                               $return .= '
-                                       <option value="' . $vals[$i] . '"';
-                               if ($vals[$i] == $checked_val) {
-                                       $return .= ' selected="selected"';
-                               }
-                       } else {
-                               $return .= '
-                                       <option value="' . $i . '"';
-                               if ($i == $checked_val) {
-                                       $return .= ' selected="selected"';
-                               }
+                               $attrs[$key] = $extra_params_value;
                        }
-                       $return .= '>' . htmlspecialchars($vals[$i]) . 
'</option>';
                }
-               $return .= '
-                       </select>
-                       </div>';
-               return $return;
+               return html_e('div', array('class' => 'field-holder'), 
$htmllabel.html_build_select_box_from_array($vals, $name, $checked_val, 
$text_is_value, $attrs)); 
        }
 
        function html_textarea($name, $id = '', $label = '', $value = '',  
$extra_params = '') {

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

Summary of changes:
 src/www/include/Layout.class.php | 55 ++++++++++------------------------------
 1 file changed, 14 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to