X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_controls.inc;h=2693b07943db5c0caa04a5479ee328f995800f8d;hb=361aac31df66f513fc014aee6adc9f1e30dd18a7;hp=1883ba2aeafc12ebdff7334f7161f8ddb0aa1ac8;hpb=f12dbe7523bb1abc6cd69b009ef8f0be838f5348;p=fa-stable.git
diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc
index 1883ba2a..2693b079 100644
--- a/includes/ui/ui_controls.inc
+++ b/includes/ui/ui_controls.inc
@@ -59,6 +59,27 @@ function meta_forward($forward_to, $params="")
}
//-----------------------------------------------------------------------------------
+// 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)
{
@@ -73,9 +94,10 @@ function hyperlink_back($center=true)
function hyperlink_no_params($target, $label, $center=true)
{
+ $pars = access_string($label);
if ($center)
echo "