X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=c1091b3702c63a76df24ae2e5c621167fd64578a;hb=3b06c6c4718610a408cae2e9b76c3134ca30b84c;hp=1e29770487deff359a401b9349dbb170cbc89398;hpb=4567e45243466f391f152b86cd972a847ec82a86;p=fa-stable.git
diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc
index 1e297704..c1091b37 100644
--- a/includes/ui/ui_input.inc
+++ b/includes/ui/ui_input.inc
@@ -37,6 +37,7 @@ function find_submit($prefix, $numeric=true)
}
return $numeric ? -1 : null;
}
+
//------------------------------------------------------------------------------
//
// Helper function for simple db table editor pages
@@ -112,6 +113,7 @@ function hidden($name, $value=null, $echo=true)
'selector' - ditto with closing current popup editor window
'cancel' - cancel form entry on Escape press; dflt ICON_CANCEL
'process' - displays progress bar during call; optional icon
+ 'nonajax' - ditto, non-ajax submit
$atype can contain also multiply type selectors separated by space,
however make sense only combination of 'process' and one of defualt/selector/cancel
@@ -141,6 +143,9 @@ function submit($name, $value, $echo=true, $title=false, $atype=false, $icon=fal
case 'cancel':
if ($icon===false) $icon=ICON_ESCAPE; break;
+
+ case 'nonajax':
+ $atype = false;
}
}
}
@@ -247,11 +252,16 @@ function submit_return($name, $value, $title=false)
}
}
-function submit_js_confirm($name, $msg) {
- add_js_source(
- "_validate.$name=function(){ return confirm('"
- . strtr($msg, array("\n"=>'\\n')) . "');};");
-};
+function submit_js_confirm($name, $msg, $set = true) {
+ global $Ajax;
+ $js = "_validate.$name=".($set ? "function(){ return confirm('"
+ . strtr($msg, array("\n"=>'\\n')) . "');};"
+ : 'null;');
+ if (in_ajax()) {
+ $Ajax->addScript(true, $js);
+ } else
+ add_js_source($js);
+}
//-----------------------------------------------------------------------------------
function set_icon($icon, $title=false)
@@ -374,7 +384,10 @@ function check_row($label, $name, $value=null, $submit_on_change=false, $title=f
}
//-----------------------------------------------------------------------------------
-function radio($label, $name, $value, $selected, $submit_on_change=false) {
+function radio($label, $name, $value, $selected=null, $submit_on_change=false)
+{
+ if (!isset($selected))
+ $selected = get_post($name) == $value;
if ($submit_on_change === true)
$submit_on_change =
@@ -593,7 +606,7 @@ function link_row_ex($label, $name, $size, $max=null, $title=null, $value=null,
function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
$inc_months=0, $inc_years=0, $params=null, $submit_on_change=false)
{
- global $use_date_picker, $path_to_root, $Ajax;
+ global $path_to_root, $Ajax;
if (!isset($_POST[$name]) || $_POST[$name] == "")
{
@@ -611,9 +624,13 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
$_POST[$name] = $dd;
}
}
- if ($use_date_picker)
+ if (user_use_date_picker())
+ {
+ $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ?
+ "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
$post_label = ""
- . " \n";
+ . "
\n";
+ }
else
$post_label = "";
@@ -622,15 +639,15 @@ function date_cells($label, $name, $title = null, $check=null, $inc_days=0,
echo "