Empty password is forbidden when creating new user account.
[fa-stable.git] / includes / ui / ui_controls.inc
index 65e0071cf925dda04087868e2bfeca505aed7cb5..515cf999322cd0adabcdc3169b49e0086c692b87 100644 (file)
@@ -49,6 +49,17 @@ function start_form($multi=false, $dummy=false, $action="", $name="")
 
 }
 
+/*
+       Flush hidden fields buffer.
+*/
+function output_hidden()
+{
+       global $hidden_fields;
+
+       if (is_array($hidden_fields))
+               echo implode('', $hidden_fields);
+       $hidden_fields = array();
+}
 //---------------------------------------------------------------------------------
 
 function end_form($breaks=0)
@@ -62,7 +73,8 @@ function end_form($breaks=0)
        hidden('_modified', get_post('_modified', 0));
        hidden('_token', $_SESSION['csrf_token']);
        
-       echo implode('', $hidden_fields)."</form>\n";
+       output_hidden();
+       echo "</form>\n";
        $Ajax->activate('_token');
 }
 
@@ -94,6 +106,7 @@ function start_table($class=false, $extra="", $padding='2', $spacing='0')
 function end_table($breaks=0)
 {
        echo "</table></center>\n";
+       output_hidden();
        if ($breaks)
                br($breaks);
 }
@@ -111,6 +124,7 @@ function table_section($number=1, $width=false)
        if ($number > 1)
        {
                echo "</table>\n";
+               output_hidden();
                $width = ($width ? "width='$width'" : "");
                //echo "</td><td class='tableseparator' $width>\n"; // outer table
                echo "</td><td style='border-left:1px solid #cccccc;' $width>\n"; // outer table
@@ -121,7 +135,10 @@ function table_section($number=1, $width=false)
 function end_outer_table($breaks=0, $close_table=true)
 {
        if ($close_table)
+       {
                echo "</table>\n";
+               output_hidden();
+       }
        echo "</td></tr>\n";
        end_table($breaks);
 }
@@ -376,13 +393,14 @@ function div_end()
 {
     global $ajax_divs, $Ajax;
 
+       output_hidden();
     if (count($ajax_divs))
     {
                $div = array_pop($ajax_divs);
                if ($div[1] !== null)
                        $Ajax->addUpdate($div[1], $div[0], ob_get_flush());
-               echo "</div>";
     }
+       echo "</div>";
 }
 
 //-----------------------------------------------------------------------------
@@ -430,6 +448,7 @@ function tabbed_content_start($name, $tabs, $dft='') {
 }
 
 function tabbed_content_end() {
+       output_hidden();
        echo "</div>"; // content box (don't change to div_end() unless div_start() is used above)
        div_end(); // tabs widget
 }