X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpage%2Fheader.inc;h=721ba242d258ad3a6cc495054b40a2b170ef3f41;hb=17b390efcf904072b02ec866b2a427490471a260;hp=197f27fb3c3955b3a738c62387daf31bea6f0273;hpb=10dced7e75209f8158e4e1fa250bfbf91cfaa182;p=fa-stable.git diff --git a/includes/page/header.inc b/includes/page/header.inc index 197f27fb..721ba242 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -9,44 +9,53 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -function help_url($title, $app) +/* + If no context is set current page/menu screen is selected. +*/ +function help_url($context=null) { - global $help_page_url, $help_base_url, $applications, $help_page_title; + global $SysPrefs, $help_context; - if (isset($help_page_url)) + $country = $_SESSION['language']->code; + $clean = 0; + + if ($context!=null) { - return $help_base_url.$help_page_url; + $help_page_url = $context; } - - $help_page_url = ''; - if (isset($help_page_title)) - { - $help_page_url = $help_page_title; - } - elseif ($title==_("Main Menu")) + elseif (isset($help_context)) { - $help_page_url = access_string($applications[$app], true); - } - else + $help_page_url = $help_context; + } else // main menu { - $help_page_url = $title; + $app = $_SESSION['sel_app']; + $help_page_url = $_SESSION['App']->applications[$app]->help_context; + $clean = 1; } - return $help_base_url.urlencode(str_replace(' ', '', ucwords($help_page_url))); + if (@$SysPrefs->old_style_help) + $help_page_url = _($help_page_url); + + if ($clean) + $help_page_url = access_string($help_page_url, true); + + return htmlspecialchars($SysPrefs->help_base_url + .urlencode(strtr(ucwords($help_page_url), array(' '=>'', '/'=>'', '&'=>'And'))) + .'&ctxhelp=1&lang='.$country, ENT_QUOTES); } function send_scripts() { - global $js_lib, $js_static, $js_path, $js_userlib, $comp_path, - $path_to_root, $go_debug; + global $SysPrefs, $path_to_root, $js_static, $js_path, $js_userlib; $js =''; foreach($js_static as $jsfile) { - $fpath = $comp_path.'/'.user_company().'/js_cache/'.$jsfile; + $cached_name = basename($jsfile); + $fpath = user_js_cache().'/'.$cached_name; // compress also static files - if (!file_exists($fpath) || $go_debug) + if (!file_exists($fpath) || $SysPrefs->go_debug) cache_js_file($fpath, file_get_contents($js_path.$jsfile)); $js .= '