X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_controls.inc;h=1883ba2aeafc12ebdff7334f7161f8ddb0aa1ac8;hb=654b2cb832f5ad2313cfbbd98832681fae05943a;hp=8e815e73473415518e422cf686fca027e91a47f5;hpb=e3c8e72bcdeff74e38c9be4c3d95293bb4cb5604;p=fa-stable.git diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 8e815e73..1883ba2a 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -12,13 +12,14 @@ function start_form($multi=false, $sid=false, $action="", $name="") { if (strpos($action, "?")) $action .= "&" . SID; - else + else $action .= "?" . SID; - } + } if ($multi) - echo "
\n"; + echo "\n"; else - echo "\n"; + echo "\n"; + } //--------------------------------------------------------------------------------- @@ -27,6 +28,7 @@ function end_form($breaks=0) { if ($breaks) br($breaks); + echo "\n"; echo "
\n"; } @@ -36,7 +38,7 @@ function start_table($extra="", $padding='2', $spacing='0') if ($extra != "") echo " $extra"; echo " cellpadding=$padding cellspacing=$spacing>\n"; -} +} function end_table($breaks=0) { @@ -47,9 +49,12 @@ function end_table($breaks=0) function meta_forward($forward_to, $params="") { + global $Ajax; echo "\n"; echo "

" . _("You should automatically be forwarded."); - echo " " . _("If this does not happen") . " " . "" . _("click here") . " " . _("to continue") . ".

\n"; + echo " " . _("If this does not happen") . " " . "" . _("click here") . " " . _("to continue") . ".

\n"; + if ($params !='') $params = '?'.$params; + $Ajax->redirect($forward_to.$params); exit; } @@ -57,14 +62,13 @@ function meta_forward($forward_to, $params="") function hyperlink_back($center=true) { - echo get_js_go_back(); - if ($center) echo "
"; - echo ""._("Back")."\n"; + //echo ""._("Back")."\n"; + echo "

"._("Back")."

\n"; if ($center) echo "
"; - echo "
"; + echo "
"; } function hyperlink_no_params($target, $label, $center=true) @@ -97,15 +101,19 @@ function hyperlink_params($target, $label, $params, $center=true) function hyperlink_params_td($target, $label, $params) { echo ""; - hyperlink_params($target, $label, $params); + hyperlink_params($target, $label, $params, false); echo "\n"; } //----------------------------------------------------------------------------------- -function hyperlink_params_separate($target, $label, $params) +function hyperlink_params_separate($target, $label, $params, $center=false) { + if ($center) + echo "
"; echo "$label\n"; + if ($center) + echo "
"; } function hyperlink_params_separate_td($target, $label, $params) @@ -123,55 +131,178 @@ function alt_table_row_color(&$k) { echo "\n"; $k = 0; - } - else + } + else { echo "\n"; $k++; } } -function table_section_title($msg) +function table_section_title($msg) { echo "$msg\n"; } -function table_header($labels) +function table_header($labels) { start_row(); foreach ($labels as $label) labelheader_cell($label); - end_row(); + end_row(); +} + +function edit_link_cell($param, $title=false) +{ + label_cell("" . _("Edit") . "", "nowrap"); +} + +function delete_link_cell($param, $title=false) +{ + label_cell("" . _("Delete") . "", "nowrap"); } -function edit_link_cell($param) +function edit_button($name, $value, $title=false) { - label_cell("" . _("Edit") . "", "nowrap"); +// php silently changes dots,spaces,'[' and characters 128-159 +// to underscore in POST names, to maintain compatibility with register_globals + echo "'=2E',' '=>'=20','='=>'=3D','['=>'=5B'))) + ."\" value=\"$value\"" + .($title ? " title='$title'":'')." />\n"; } -function delete_link_cell($param) +function edit_button_cell($name, $value, $title=false) { - label_cell("" . _("Delete") . "", "nowrap"); + echo ""; + edit_button($name, $value, $title); + echo ""; } //----------------------------------------------------------------------------------- -function start_row($param="") +function start_row($param="") { if ($param != "") echo "\n"; - else + else echo "\n"; } -function end_row() +function end_row() { echo "\n"; -} +} function br($num=1) { for ($i = 0; $i < $num; $i++) echo "
"; -} +} + +$ajax_divs = array(); + +function div_start($id='', $trigger=null, $non_ajax=false) +{ + global $ajax_divs; + + if ($non_ajax) { // div for non-ajax elements + array_push($ajax_divs, array($id, null)); + echo "