include_once($path_to_root."/themes/".user_theme()."/renderer.php");
$rend = new renderer();
$rend->menu_footer($no_menu, $is_index);
+ echo "<script>_focus = '".get_post('_focus')."';</script>";
echo "</body></html>\n";
}
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
+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 "<form enctype='multipart/form-data' method='post' action='$action' $name>\n";
else
{
if ($center)
echo "<center>";
- //echo "<a href='javascript:goBack();'>"._("Back")."</a>\n";
echo "<p><a href='javascript:goBack();'>"._("Back")."</a></p>\n";
if ($center)
echo "</center>";
function hyperlink_no_params($target, $label, $center=true)
{
+ $id = default_focus();
$pars = access_string($label);
if ($center)
echo "<br><center>";
- echo "<a href='$target?=" . SID . "'$pars[1]>$pars[0]</a>\n";
+ echo "<a href='$target' $id='$id' $pars[1]>$pars[0]</a>\n";
if ($center)
echo "</center>";
}
echo "</td>\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 = "<a target='_blank' $class $id href='$path_to_root/$url' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
+ }
+ else
+ $preview_str = $label;
+
+ return $preview_str;
+}
+
+function menu_link($url, $label, $id=null)
+{
+
+ $id = default_focus($id);
+ $pars = access_string($label);
+ return "<a href='$url' class='menu_option' id='$id' $pars[1]>$pars[0]</a>";
+}
+
+function submenu_option($title, $url, $id=null)
+{
+ global $path_to_root;
+ display_note(menu_link($path_to_root . $url, $title, $id));
+ echo '<br>';
+}
+
+function submenu_view($title, $type, $number, $id=null)
+{
+ display_note(get_trans_view_str($type, $number, $title, false, 'menu_option', $id));
+ echo '<br>';
+}
+
+function submenu_print($title, $type, $number, $id=null)
+{
+ display_note(print_document_link($number, $title, true, $type, false, 'menu_option', $id));
+ echo '<br>';
+}
//-----------------------------------------------------------------------------------
function hyperlink_params($target, $label, $params, $center=true)
{
+ $id = default_focus();
+
$pars = access_string($label);
if ($center)
echo "<br><center>";
- echo "<a href='$target?$params'$pars[1]>$pars[0]</a>\n";
+ echo "<a id='$id' href='$target?$params'$pars[1]>$pars[0]</a>\n";
if ($center)
echo "</center>";
}
function hyperlink_params_separate($target, $label, $params, $center=false)
{
+ $id = default_focus();
+
$pars = access_string($label);
if ($center)
echo "<br><center>";
- echo "<a target='_blank' href='$target?$params" . SID . "'$pars[1]>$pars[0]</a>\n";
+ echo "<a target='_blank' $id='$id' href='$target?$params' $pars[1]>$pars[0]</a>\n";
if ($center)
echo "</center>";
}
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-
-function get_post($name, $dflt='')
-{
- return ((!isset($_POST[$name]) || $_POST[$name] === '') ? $dflt : $_POST[$name]);
-}
//
// Sets local POST value and adds Value to ajax posting if needed
//
else
return $ret;
}
-
-function submit($name, $value, $echo=true, $title=false, $async=false, $icon=false)
+/*
+ Universal submit form button.
+ $atype - type of submit:
+ Normal submit:
+ false - normal button; optional icon
+ null - button visible only in fallback mode; optional icon
+ Ajax submit:
+ true - standard button; optional icon
+ 'process' - displays progress bar during call; optional icon
+ 'default' - default form submit on Ctrl-Enter press; dflt ICON_OK icon
+ 'cancel' - cancel form entry on Escape press; dflt ICON_CANCEL
+*/
+function submit($name, $value, $echo=true, $title=false, $atype=false, $icon=false)
{
global $path_to_root;
-
+
+ $aspect='';
+ if (!is_bool($atype)) // necessary: switch uses '=='
+ switch($atype) {
+ case 'process':
+ $aspect = " aspect='process'"; break;
+ case 'default':
+ $aspect = " aspect='default'";
+ if ($icon===false) $icon=ICON_SUBMIT; break;
+ case 'cancel':
+ $aspect = " aspect='cancel'";
+ if ($icon===false) $icon=ICON_ESCAPE; break;
+ case null:
+ $aspect = fallback_mode() ?
+ " aspect='fallback'" : " style='display:none;'"; break;
+ }
+
default_focus($name);
$submit_str = "<button class=\""
- .($async ? 'ajaxsubmit' : 'inputsubmit')
+ .($atype ? 'ajaxsubmit' : 'inputsubmit')
."\" type=\"submit\""
- .($async === null ? (fallback_mode() ? ' aspect="fallback"' : " style='display:none;'" ):
- ($async === 'process' ? 'aspect="process"' : '') )
+ .$aspect
." name=\"$name\" id=\"$name\" value=\"$value\""
.($title ? " title='$title'" : '')
- ."><span>$value</span>"
+ .">"
.($icon ? "<img src='$path_to_root/themes/".user_theme()."/images/$icon'>" : '')
+ ."<span>$value</span>"
."</button>\n";
if ($echo)
echo $submit_str;
//--------------------------------------------------------------------------------------
-function get_supplier_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_supplier_trans_view_str($type, $trans_no, $label="", $icon=false,
+ $class='', $id='')
{
- global $path_to_root;
-
- $viewer = "";
+ $viewer = "purchasing/view/";
if ($type == systypes::po())
- $viewer = "view_po.php";
+ $viewer .= "view_po.php";
elseif ($type == 20)
- $viewer = "view_supp_invoice.php";
+ $viewer .= "view_supp_invoice.php";
elseif ($type == 21)
- $viewer = "view_supp_credit.php";
+ $viewer .= "view_supp_credit.php";
elseif ($type == 22)
$viewer = "view_supp_payment.php";
elseif ($type == 25)
- $viewer = "view_grn.php";
+ $viewer .= "view_grn.php";
else
return null;
+ $viewer .= "?trans_no=$trans_no";
if ($label == "")
$label = $trans_no;
- if ($viewer != "")
- {
- $pars = access_string($label);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $preview_str = "<a target='_blank' href='$path_to_root/purchasing/view/$viewer?trans_no=$trans_no' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
- }
- else
- $preview_str = $label;
-
- return $preview_str;
+ return viewer_link($label, $viewer, $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
-function get_gl_view_str($type, $trans_no, $label="", $force=false)
+function get_gl_view_str($type, $trans_no, $label="", $force=false, $class='', $id='')
{
- global $path_to_root;
-
if (!$force && !user_show_gl_info())
return "";
$label = _("GL");
$icon = ICON_GL;
}
- $pars = access_string($label);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $gl_view = "<a target='_blank' href='$path_to_root/gl/view/gl_trans_view.php?type_id=$type&trans_no=$trans_no' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
- return $gl_view;
+ return viewer_link($label,
+ "gl/view/gl_trans_view.php?type_id=$type&trans_no=$trans_no",
+ $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
-function get_customer_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_customer_trans_view_str($type, $trans_no, $label="", $icon=false,
+ $class='', $id='')
{
- global $path_to_root;
+ $viewer = "sales/view/";
- $viewer = "";
if ($type == 10)
- $viewer = "view_invoice.php";
+ $viewer .= "view_invoice.php";
elseif ($type == 11)
- $viewer = "view_credit.php";
+ $viewer .= "view_credit.php";
elseif ($type == 12)
- $viewer = "view_receipt.php";
+ $viewer .= "view_receipt.php";
elseif ($type == 13)
- $viewer = "view_dispatch.php";
+ $viewer .= "view_dispatch.php";
elseif ($type == 30)
- $viewer = "view_sales_order.php";
+ $viewer .= "view_sales_order.php";
else
return null;
$lbl = $trans;
if($preview_str!='') $preview_str .= ',';
- if ($viewer != "")
- {
- $pars = access_string($lbl);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $preview_str .= "<a target='_blank' href='$path_to_root/sales/view/$viewer?trans_no=$trans' onclick=\"javascript:openWindow(this.href,this.target); return false;\" $pars[1]>$pars[0]</a>";
- }
- else
- $preview_str .= $lbl;
- }
+ $preview_str .= viewer_link($lbl, $viewer."?trans_no=$trans",
+ $class, $id, $icon);
- return $preview_str;
+ }
+ return $preview_str;
}
//--------------------------------------------------------------------------------------
-function get_banking_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_banking_trans_view_str($type, $trans_no, $label="",
+ $icon=false, $class='', $id='')
{
- global $path_to_root;
-
- $viewer = "";
+ if ($label == "")
+ $label = $trans_no;
if ($type == 4)
$viewer = "bank_transfer_view.php";
elseif ($type == 2)
$viewer = "gl_deposit_view.php";
elseif ($type == 0)
- $viewer = "";
+ return $label;
else
return null;
- if ($label == "")
- $label = $trans_no;
-
- if ($viewer != "")
- {
- $pars = access_string($label);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $preview_str = "<a target='_blank' href='$path_to_root/gl/view/$viewer?trans_no=$trans_no' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
- }
- else
- $preview_str = $label;
-
- return $preview_str;
+ return viewer_link($label, "gl/view/$viewer?trans_no=$trans_no",
+ $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
-function get_inventory_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_inventory_trans_view_str($type, $trans_no, $label="",
+ $icon=false, $class='', $id='')
{
- global $path_to_root;
-
- $viewer = "";
+ $viewer = "inventory/view/";
if ($type == systypes::inventory_adjustment())
- $viewer = "view_adjustment.php";
+ $viewer .= "view_adjustment.php";
elseif ($type == systypes::location_transfer())
- $viewer = "view_transfer.php";
+ $viewer .= "view_transfer.php";
else
return null;
+ $viewer .= "?trans_no=$trans_no";
if ($label == "")
$label = $trans_no;
- if ($viewer != "")
- {
- $pars = access_string($label);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $preview_str = "<a target='_blank' href='$path_to_root/inventory/view/$viewer?trans_no=$trans_no' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
- }
- else
- $preview_str = $label;
-
- return $preview_str;
+ return viewer_link($label, $viewer, $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
-function get_manufacturing_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_manufacturing_trans_view_str($type, $trans_no, $label="",
+ $icon=false, $class='', $id='')
{
- global $path_to_root;
-
- $viewer = "";
+ $viewer = "manufacturing/view/";
if ($type == 28)
- $viewer = "wo_issue_view.php";
+ $viewer .= "wo_issue_view.php";
elseif ($type == 29)
- $viewer = "wo_production_view.php";
+ $viewer .= "wo_production_view.php";
elseif ($type == systypes::work_order())
- $viewer = "work_order_view.php";
+ $viewer .= "work_order_view.php";
else
return null;
+ $viewer .= "?trans_no=$trans_no";
+
if ($label == "")
$label = $trans_no;
- if ($viewer != "")
- {
- $pars = access_string($label);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $preview_str = "<a target='_blank' href='$path_to_root/manufacturing/view/$viewer?trans_no=$trans_no' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
- }
- else
- $preview_str = $label;
-
- return $preview_str;
+ return viewer_link($label, $viewer, $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
-function get_dimensions_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_dimensions_trans_view_str($type, $trans_no, $label="", $icon=false,
+ $class='', $id='')
{
- global $path_to_root;
-
- $viewer = "";
-
if ($type == 40)
- $viewer = "view_dimension.php";
+ $viewer = "dimensions/view_dimension.php?trans_no=$trans_no";
else
return null;
if ($label == "")
$label = $trans_no;
- if ($viewer != "")
- {
- $pars = access_string($label);
- if (user_graphic_links() && $icon)
- $pars[0] = set_icon($icon, $pars[0]);
- $preview_str = "<a target='_blank' href='$path_to_root/dimensions/view/$viewer?trans_no=$trans_no' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
- }
- else
- $preview_str = $label;
-
- return $preview_str;
+ return viewer_link($label, $viewer, $class, $id, $icon);
}
//--------------------------------------------------------------------------------------
-function get_trans_view_str($type, $trans_no, $label="", $icon=false)
+function get_trans_view_str($type, $trans_no, $label="", $icon=false,
+ $class='', $id='')
{
- $view_str = get_customer_trans_view_str($type, $trans_no, $label, $icon);
+ $view_str = get_customer_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
if ($view_str != null)
return $view_str;
- $view_str = get_supplier_trans_view_str($type, $trans_no, $label, $icon);
+ $view_str = get_supplier_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
if ($view_str != null)
return $view_str;
- $view_str = get_banking_trans_view_str($type, $trans_no, $label, $icon);
+ $view_str = get_banking_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
if ($view_str != null)
return $view_str;
- $view_str = get_inventory_trans_view_str($type, $trans_no, $label, $icon);
+ $view_str = get_inventory_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
if ($view_str != null)
return $view_str;
- $view_str = get_manufacturing_trans_view_str($type, $trans_no, $label, $icon);
+ $view_str = get_manufacturing_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
if ($view_str != null)
return $view_str;
- $view_str = get_dimensions_trans_view_str($type, $trans_no, $label, $icon);
+ $view_str = get_dimensions_trans_view_str($type, $trans_no, $label, $icon, $class, $id);
if ($view_str != null)
return $view_str;
}
//
// Set default focus on first field $name if not set yet
-//
-function default_focus($name, $form_no=0) {
+// Returns unique name if $name=null
+//
+function default_focus($name=null, $form_no=0) {
+ if ($name==null)
+ $name = uniqid('_el');
if (!isset($_POST['_focus'])) {
set_focus($name);
}
+ return $name;
}
function get_js_png_fix()
var _focus;
var _hotkeys = {
'alt': false, // whether is the Alt key pressed
- 'focus': -1 // currently selected indeks of document.links
+ 'focus': -1, // currently selected indeks of document.links
};
function debug(msg) {
if((ev.ctrlKey && key == 13) || key == 27) {
ev.cancelBubble = true;
if(ev.stopPropagation) ev.stopPropagation();
-// here ctrl-enter/escape support
+ // activate submit/escape form
+ for (var i=0; i<this.elements.length; i++){
+ var asp = this.elements[i].getAttribute('aspect');
+ if ((asp=='default' && key==13)||(asp=='cancel' && key==27))
+ JsHttpRequest.request(this.elements[i]);
+ }
+
ev.returnValue = false;
return false;
}
e.onfocus = function() {
save_focus(this);
};
+ e.onmouseover = function(e) {
+ setFocus(this.id, 1);
+ return false;
+ }
}
},
'a.printlink': function(l) {
return false;
}
},
+ 'a': function(e) { // traverse menu
+ e.onkeydown = function(ev) {
+ ev = ev||window.event;
+ key = ev.keyCode||ev.which;
+ if(key==37 || key==38 || key==39 || key==40) {
+ move_focus(key, e, document.links);
+ return false;
+ }
+ }
+ },
'ul.ajaxtabs': function(ul) {
var ulist=ul.getElementsByTagName("li");
for (var x=0; x<ulist.length; x++){ //loop through each LI e
}
}
},
- '#msgbox': function(e) {
+/* 'tr.editrow': function(e) {
+ e.onkeydown = function(ev) {
+ ev = ev||window.event;
+ key = ev.keyCode||ev.which;
+ if(key == 13) {
+ // Find & click additem/update button
+
+ } else if(key == 27) {
+ return false;
+ }
+ }
+
+ },
+*/ '#msgbox': function(e) {
// this is to avoid changing div height after ajax update in IE7
e.style.display = e.innerHTML.length ? 'block' : 'none';
}
return true;
}
}
-
+
Behaviour.register(inserts);
Behaviour.addLoadEvent(setFocus);
}
function setFocus(name, byId) {
- if(document.location.pathname.indexOf('index.php') != -1) {
- // this is application menu page - set focus on first link
- // var el = document.getElementById('msgbox');
- // TODO find first link after msgbox and set focus
- }
- if(!name) {
+
+ if(!name) { // page load/ajax update
if (_focus)
name = _focus; // last focus set in onfocus handlers
else
if(cur) name = cur.value;
}
}
- if(byId)
+ if(byId || !(el = document.getElementsByName(name)[0]))
el = document.getElementById(name);
- else
- el = document.getElementsByName(name)[0];
if(el && el.focus) {
// The timeout is needed to prevent unpredictable behaviour on IE & Gecko.
setTimeout(tmp, 0);
}
}
+/*
+ Find closest element in neighbourhood and set focus.
+ dir is direction as arrow code.
+*/
+function move_focus(dir, e, neighbours)
+{
+ var p0 = element_pos(e);
+ var t;
+ var l=0;
+ for(var i=0; i<neighbours.length; i++) {
+ var p = element_pos(neighbours[i]);
+ if (neighbours[i].className!='menu_option') continue;
+ if (((dir==40) && (p.y>p0.y)) || (dir==38 && (p.y<p0.y))
+ || ((dir==37) && (p.x<p0.x)) || ((dir==39 && (p.x>p0.x)))) {
+ var l1 = (p.y-p0.y)*(p.y-p0.y)+(p.x-p0.x)*(p.x-p0.x);
+ if ((l1<l) || (l==0)) {
+ l = l1; t = neighbours[i];
+ }
+ }
+ }
+ if (t) {
+ var tmp = function() {t.focus(); if (t.select) t.select();};
+ setTimeout(tmp, 0);
+ }
+ return t;
+}
+
+var __isFireFox = navigator.userAgent.match(/gecko/i);
+//returns the absolute position of some element within document
+function element_pos(e) {
+ var res = new Object();
+ res.x = 0; res.y = 0;
+ if (element !== null) {
+ res.x = e.offsetLeft;
+ res.y = e.offsetTop;
+ var offsetParent = e.offsetParent;
+ var parentNode = e.parentNode;
+
+ while (offsetParent !== null) {
+ res.x += offsetParent.offsetLeft;
+ res.y += offsetParent.offsetTop;
+
+ if (offsetParent != document.body && offsetParent != document.documentElement) {
+ res.x -= offsetParent.scrollLeft;
+ res.y -= offsetParent.scrollTop;
+ }
+ //next lines are necessary to support FireFox problem with offsetParent
+ if (__isFireFox) {
+ while (offsetParent != parentNode && parentNode !== null) {
+ res.x -= parentNode.scrollLeft;
+ res.y -= parentNode.scrollTop;
+
+ parentNode = parentNode.parentNode;
+ }
+ }
+ parentNode = offsetParent.parentNode;
+ offsetParent = offsetParent.offsetParent;
+ }
+ }
+ return res;
+}
\ No newline at end of file
// or display_note(print_document_link($order_no, _("Print this order")));
// You only need full parameter list for invoices/credit notes
-function print_document_link($doc_no, $link_text, $link=true, $type_no, $icon=false)
+function print_document_link($doc_no, $link_text, $link=true, $type_no,
+ $icon=false, $class='', $id='')
{
global $path_to_root;
include_once($path_to_root . "/includes/types.inc");
// default: $ar = array();
}
- return print_link($link_text, $rep, $ar, "", $icon);
+ return print_link($link_text, $rep, $ar, "", $icon, $class, $id);
}
//
// Universal link to any kind of report.
//
-function print_link($link_text, $rep, $pars = array(), $dir = '', $icon=false)
+function print_link($link_text, $rep, $pars = array(), $dir = '',
+ $icon=false, $class='', $id='')
{
global $path_to_root, $pdf_debug;
$url = $dir == '' ? $path_to_root.'/reporting/prn_redirect.php?' : $dir;
+ $id = default_focus($id);
foreach($pars as $par => $val) {
$pars[$par] = "$par=".urlencode($val);
}
$pars[] = 'REP_ID='.urlencode($rep);
$url .= implode ('&', $pars);
- $class = $pdf_debug ? '' : "class='printlink'";
+
+ if ($class != '')
+ $class = $pdf_debug ? '' : " class='$class'";
+ if ($id != '')
+ $id = " id='$id'";
$pars = access_string($link_text);
if (user_graphic_links() && $icon)
$pars[0] = set_icon($icon, $pars[0]);
- return "<a $class target='_blank' href='$url'$pars[1]>$pars[0]</a>";
+ return "<a target='_blank' href='$url'$id$class $pars[1]>$pars[0]</a>";
}
function get_first_bank_account()
text-decoration: none;
}
-a:hover {
+a:hover, a:focus {
color: #2d8628;
text-decoration: underline;
}
{
$acc = access_string($app->name);
echo "<a ".($sel_app == $app->id ? "class='selected' " : "").
- "href='$local_path_to_root/index.php?application=".$app->id.
- SID ."'$acc[1]>" .$acc[0] . "</a>";
+ "href='$local_path_to_root/index.php?application=".$app->id
+ ."'$acc[1]>" .$acc[0] . "</a>";
}
echo "</div>";
if ($appfunction->label == "")
echo " <br>";
else
- {
- $lnk = access_string($appfunction->label);
- echo "$img<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
- }
+ echo $img.menu_link($appfunction->link, $appfunction->label)."<br>\n";
}
}
echo "</td>";
if ($appfunction->label == "")
echo " <br>";
else
- {
- $lnk = access_string($appfunction->label);
- echo "$img<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
- }
+ echo $img.menu_link($appfunction->link, $appfunction->label)."<br>\n";
}
}
echo "</td>";
text-decoration: none;
}
-a:hover {
+a:hover, a:focus {
color: #2d8628;
text-decoration: underline;
}
{
$acc = access_string($app->name);
echo "<a ".($sel_app == $app->id ? "class='selected' " : "").
- "href='$local_path_to_root/index.php?application=".$app->id.
- SID ."'$acc[1]>" .$acc[0] . "</a>";
+ "href='$local_path_to_root/index.php?application=".$app->id
+ ."'$acc[1]>" .$acc[0] . "</a>";
}
echo "</div>";
if ($appfunction->label == "")
echo " <br>";
else
- {
- $lnk = access_string($appfunction->label);
- echo "$img<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
- }
+ echo $img.menu_link($appfunction->link, $appfunction->label)."<br>\n";
}
}
echo "</td>";
if ($appfunction->label == "")
echo " <br>";
else
- {
- $lnk = access_string($appfunction->label);
- echo "$img<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
- }
+ echo $img.menu_link($appfunction->link, $appfunction->label)."<br>\n";
}
}
echo "</td>";
text-decoration: none;
}
-a:hover {
+a:hover, a:focus {
color: #2d8628;
text-decoration: underline;
}
{
function wa_header()
{
+// add_js_ufile("themes/default/renderer.js");
page(_("Main Menu"), false, true);
}
function menu_header($title, $no_menu, $is_index)
{
global $path_to_root, $help_base_url, $db_connections;
-
// you can owerride the table styles from config.php here, if you want.
//global $table_style, $table_style2;
//$table_style = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
foreach($applications as $app)
{
$acc = access_string($app->name);
- echo "<a ".($sel_app == $app->id ? "class='selected' " : "").
- "href='$local_path_to_root/index.php?application=".$app->id.
- SID ."'$acc[1]>" .$acc[0] . "</a>";
+ echo "<a ".($sel_app == $app->id ?
+ ("class='selected'") : "")
+ ." href='$local_path_to_root/index.php?application=".$app->id
+ ."'$acc[1]>" .$acc[0] . "</a>";
}
echo "</div>";
echo "</td></tr></table>";
if ($appfunction->label == "")
echo " <br>";
else
- {
- $lnk = access_string($appfunction->label);
- echo "$img<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
- }
+ echo $img.menu_link($appfunction->link, $appfunction->label)."<br>\n";
}
}
echo "</td>";
if ($appfunction->label == "")
echo " <br>";
else
- {
- $lnk = access_string($appfunction->label);
- echo "$img<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
- }
+ echo $img.menu_link($appfunction->link, $appfunction->label)."<br>\n";
}
}
echo "</td>";