X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=includes%2Fui%2Fui_controls.inc;h=2fc434be64bc2ab95b2609c2ec58374ee0bf5659;hb=6918bb5a9e5505ebdeb1abd93127a68db5ece8b6;hp=8fd5aba43b5b7bb55cca5455161ebc7b2a5d4ca3;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 8fd5aba4..2fc434be 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,16 +28,17 @@ function end_form($breaks=0) { if ($breaks) br($breaks); + echo "\n"; echo "
\n"; } -function start_table($extra="", $padding='0', $spacing='0') +function start_table($extra="", $padding='2', $spacing='0') { echo "
\n"; -} +} function end_table($breaks=0) { @@ -47,9 +49,11 @@ 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"; + $Ajax->redirect($forward_to.'?'.$params); exit; } @@ -57,14 +61,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 +100,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 +130,86 @@ 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 edit_link_cell($param) +function delete_link_cell($param, $title=false) { - label_cell("" . _("Edit") . "", "nowrap"); + label_cell("" . _("Delete") . "", "nowrap"); } -function delete_link_cell($param) +function edit_button_cell($name, $value, $title=false) { - label_cell("" . _("Delete") . "", "nowrap"); + label_cell("\n"); } //----------------------------------------------------------------------------------- -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) +{ + global $ajax_divs; + + array_push($ajax_divs, array($id, $trigger===null ? $id : $trigger)); + echo "
"; + ob_start(); +} + +function div_end() +{ + global $ajax_divs, $Ajax; + + if (count($ajax_divs)) + { + $div = array_pop($ajax_divs); + $Ajax->addUpdate($div[1], $div[0], ob_get_flush()); + echo "
"; + } +} ?> \ No newline at end of file