X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fui%2Fui_controls.inc;h=d0231002b1e1581ba79141e4048ef7f52c60f01b;hb=a1a4460e51a0a792f10df5d41eb43abc1f94ff4a;hp=20d191f464a52c018bdb22605d97232fcf5c4241;hpb=72af4496f87c438dc85a0a7573d36b7bd9e49624;p=fa-stable.git diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 20d191f4..d0231002 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ //--------------------------------------------------------------------------------- function start_form($multi=false, $sid=false, $action="", $name="") @@ -28,7 +37,7 @@ function end_form($breaks=0) { if ($breaks) br($breaks); - echo "\n"; + echo "\n"; echo "\n"; } @@ -47,17 +56,69 @@ function end_table($breaks=0) br($breaks); } +function start_outer_table($extra="", $padding='2', $spacing='0') +{ + br(); + start_table($extra, $padding, $spacing); + echo "\n"; // outer table +} + +function table_section($number=1, $width=false) +{ + if ($number > 1) + { + echo "\n"; + $width = ($width ? "width=$width" : ""); + echo "\n"; // outer table + } + echo "\n"; +} + +function end_outer_table($breaks=0, $close_table=true) +{ + if ($close_table) + echo "
\n"; + echo "\n"; + end_table($breaks); +} + +function vertical_space() +{ + echo ""; // outer table +} 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"; - $Ajax->redirect($forward_to.'?'.$params); + echo " " . _("If this does not happen") . " " . "" . _("click here") . " " . _("to continue") . ".

\n"; + if ($params !='') $params = '?'.$params; + $Ajax->redirect($forward_to.$params); exit; } //----------------------------------------------------------------------------------- +// Find and replace hotkey marker. +// if $clean == true marker is removed and clean label is returned +// (for use in wiki help system), otherwise result is array of label +// with underlined hotkey letter and access property string. +// +function access_string($label, $clean=false) +{ + $access = ''; + $slices = array(); + + if (preg_match('/(.*)&([a-zA-Z0-9])(.*)/', $label, $slices)) + { + $label = $clean ? $slices[1].$slices[2].$slices[3] : + $slices[1].''.$slices[2].''.$slices[3]; + $access = " accesskey='".strtoupper($slices[2])."'"; + } + + $label = str_replace( '&&', '&', $label); + + return $clean ? $label : array($label, $access); +} function hyperlink_back($center=true) { @@ -72,9 +133,10 @@ function hyperlink_back($center=true) function hyperlink_no_params($target, $label, $center=true) { + $pars = access_string($label); if ($center) echo "
"; - echo "$label\n"; + echo "$pars[0]\n"; if ($center) echo "
"; } @@ -90,9 +152,10 @@ function hyperlink_no_params_td($target, $label) function hyperlink_params($target, $label, $params, $center=true) { + $pars = access_string($label); if ($center) echo "
"; - echo "$label\n"; + echo "$pars[0]\n"; if ($center) echo "
"; } @@ -100,7 +163,7 @@ 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"; } @@ -108,9 +171,10 @@ function hyperlink_params_td($target, $label, $params) function hyperlink_params_separate($target, $label, $params, $center=false) { + $pars = access_string($label); if ($center) echo "
"; - echo "$label\n"; + echo "$pars[0]\n"; if ($center) echo "
"; } @@ -138,9 +202,9 @@ function alt_table_row_color(&$k) } } -function table_section_title($msg) +function table_section_title($msg, $colspan=2) { - echo "$msg\n"; + echo "$msg\n"; } function table_header($labels) @@ -150,22 +214,6 @@ function table_header($labels) labelheader_cell($label); end_row(); } - -function edit_link_cell($param) -{ - label_cell("" . _("Edit") . "", "nowrap"); -} - -function delete_link_cell($param) -{ - label_cell("" . _("Delete") . "", "nowrap"); -} - -function edit_button_cell($name, $value) -{ - label_cell("\n"); -} - //----------------------------------------------------------------------------------- function start_row($param="") @@ -189,13 +237,18 @@ function br($num=1) $ajax_divs = array(); -function div_start($id='') +function div_start($id='', $trigger=null, $non_ajax=false) { global $ajax_divs; - array_push($ajax_divs, $id); - echo "
"; - ob_start(); + if ($non_ajax) { // div for non-ajax elements + array_push($ajax_divs, array($id, null)); + echo "