X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_controls.inc;h=ff969639222dbe150d00f7718df703ce6cddaca4;hb=f4737ea725de62440c8bf58a7b4d7b187268fe93;hp=6e2c664a7a8f9cc01a59ca65fa49fbed8fb4efa1;hpb=5e65108fed968201c56db4db3d28cf416916d01d;p=fa-stable.git diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 6e2c664a..ff969639 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -1,29 +1,29 @@ . + See the License here . ***********************************************************************/ +function get_post($name, $dflt='') +{ + return ((!isset($_POST[$name]) || $_POST[$name] === '') ? $dflt : $_POST[$name]); +} //--------------------------------------------------------------------------------- -function start_form($multi=false, $sid=false, $action="", $name="") +function start_form($multi=false, $dummy=false, $action="", $name="") { + // $dummy - leaved for compatibility with 2.0 API + if ($name != "") $name = "name='$name'"; if ($action == "") $action = $_SERVER['PHP_SELF']; - if ($sid) - { - if (strpos($action, "?")) - $action .= "&" . SID; - else - $action .= "?" . SID; - } + if ($multi) echo "
\n"; else @@ -82,11 +82,14 @@ function end_outer_table($breaks=0, $close_table=true) echo "\n"; end_table($breaks); } - -function vertical_space() +// +// outer table spacer +// +function vertical_space($params='') { - echo ""; // outer table + echo ""; } + function meta_forward($forward_to, $params="") { global $Ajax; @@ -125,7 +128,6 @@ function hyperlink_back($center=true) { if ($center) echo "
"; - //echo ""._("Back")."\n"; echo "

"._("Back")."

\n"; if ($center) echo "
"; @@ -134,10 +136,11 @@ function hyperlink_back($center=true) function hyperlink_no_params($target, $label, $center=true) { + $id = default_focus(); $pars = access_string($label); if ($center) echo "
"; - echo "$pars[0]\n"; + echo "$pars[0]\n"; if ($center) echo "
"; } @@ -149,14 +152,65 @@ function hyperlink_no_params_td($target, $label) echo "\n"; } +function viewer_link($label, $url='', $class='', $id='', $icon=null) +{ + global $path_to_root; + + if ($class != '') + $class = " class='$class'"; + + if ($id != '') + $class = " id='$id'"; + + if ($url != "") + { + $pars = access_string($label); + if (user_graphic_links() && $icon) + $pars[0] = set_icon($icon, $pars[0]); + $preview_str = "$pars[0]"; + } + else + $preview_str = $label; + + return $preview_str; +} + +function menu_link($url, $label, $id=null) +{ + + $id = default_focus($id); + $pars = access_string($label); + return "$pars[0]"; +} + +function submenu_option($title, $url, $id=null) +{ + global $path_to_root; + display_note(menu_link($path_to_root . $url, $title, $id)); + echo '
'; +} + +function submenu_view($title, $type, $number, $id=null) +{ + display_note(get_trans_view_str($type, $number, $title, false, 'menu_option', $id)); + echo '
'; +} + +function submenu_print($title, $type, $number, $id=null) +{ + display_note(print_document_link($number, $title, true, $type, false, 'menu_option', $id)); + echo '
'; +} //----------------------------------------------------------------------------------- function hyperlink_params($target, $label, $params, $center=true) { + $id = default_focus(); + $pars = access_string($label); if ($center) echo "
"; - echo "$pars[0]\n"; + echo "$pars[0]\n"; if ($center) echo "
"; } @@ -172,10 +226,12 @@ function hyperlink_params_td($target, $label, $params) function hyperlink_params_separate($target, $label, $params, $center=false) { + $id = default_focus(); + $pars = access_string($label); if ($center) echo "
"; - echo "$pars[0]\n"; + echo "$pars[0]\n"; if ($center) echo "
"; }