X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=054af15e98ee463c3587ab87b11e4908de4089f1;hb=0388050f6d4c6c7c9a9db06d2f31aa8879da69a8;hp=9ca13632a5fd7a149e7be85cae1183c981927bba;hpb=3b431d909abc53e4a4d712cbafa39ca556409d0e;p=fa-stable.git
diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc
index 9ca13632..054af15e 100644
--- a/includes/ui/ui_input.inc
+++ b/includes/ui/ui_input.inc
@@ -93,7 +93,12 @@ function input_num($postname=null, $dflt=0)
}
//---------------------------------------------------------------------------------
-$hidden_fields = array(); // store for hiddn fields attached just before form end (for proper html validation)
+//
+// Thanks to hidden fields buffering hidden() helper can be used in arbitrary places and
+// proper html structure is still preserved. Buffered hidden fields are output on the nearest
+// table or form closing tag (see output_hidden()).
+//
+$hidden_fields = array();
function hidden($name, $value=null, $echo=true)
{
@@ -197,6 +202,7 @@ function submit_center_last($name, $value, $title=false, $async=false, $icon=fal
/*
For following controls:
'both' - use both Ctrl-Enter and Escape hotkeys
+ 'upgrade' - use Ctrl-Enter with progress ajax indicator and Escape hotkeys. Nonajax request for OK option is performed.
'cancel' - apply to 'RESET' button
*/
function submit_add_or_update($add=true, $title=false, $async=false, $clone=false)
@@ -205,10 +211,13 @@ function submit_add_or_update($add=true, $title=false, $async=false, $clone=fals
if ($async === 'both') {
$async = 'default'; $cancel = 'cancel';
- }
- else if ($async === 'default')
+ }
+ elseif ($async === 'upgrade') {
+ $async = 'default nonajax process'; $cancel = 'cancel';
+ }
+ elseif ($async === 'default')
$cancel = true;
- else if ($async === 'cancel')
+ elseif ($async === 'cancel')
$async = true;
if ($add)
@@ -278,7 +287,7 @@ function set_icon($icon, $title=false)
global $path_to_root;
if (basename($icon) === $icon) // standard icons does not contain path separator
$icon = "$path_to_root/themes/".user_theme()."/images/$icon";
- return "\n";
+ return "\n";
}
function button($name, $value, $title=false, $icon=false, $aspect='')
@@ -295,7 +304,7 @@ function button($name, $value, $title=false, $icon=false, $aspect='')
if ($value == _("Delete")) // Helper during implementation
$icon = ICON_DELETE;
return "