X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpage%2Fheader.inc;h=8db8fe9ba5ae8f3b42cbea08022b42b6e48bd558;hb=807baf36cadbb2452b15c2321bbcacdbc09a8951;hp=65003be49eb533b62f2a61c7a44ecf83a3624f7c;hpb=7b143b29078445dd2bcd7a5a2006eb2472d1c23e;p=fa-stable.git diff --git a/includes/page/header.inc b/includes/page/header.inc index 65003be4..8db8fe9b 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -9,44 +9,70 @@ 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)) + elseif (isset($help_context)) + { + $help_page_url = $help_context; + } else // main menu { - $help_page_url = $help_page_title; + $app = $_SESSION['sel_app']; + $help_page_url = $_SESSION['App']->applications[$app]->help_context; + $clean = 1; } - elseif ($title==_("Main Menu")) + + if (@$SysPrefs->old_style_help) + $help_page_url = _($help_page_url); + + if ($clean) + $help_page_url = access_string($help_page_url, true); + + return html_specials_encode( + $SysPrefs->help_base_url + .urlencode(strtr(ucwords($help_page_url), array(' '=>'', '/'=>'', '&'=>'And'))) + .'&ctxhelp=1&lang='.$country); +} + +function send_css($css = '') +{ + global $css_files; + + css_files_ensure_init(); + + foreach ($css_files as $css_file) { - $help_page_url = access_string($_SESSION['App']->applications[$app]->name, true); + echo " \n"; } - else + if ($css) { - $help_page_url = $title; + echo " \n"; } - - return $help_base_url.urlencode(str_replace(' ', '', ucwords($help_page_url))); } 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 .= '