X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fhtml%2Fhelpviewer.php;h=4a4f39982a20872ccbd4f2bddd5585388e72939b;hb=160232869ffa4e81290d44a21237724edd95545a;hp=fed1414feb768dcfc50d6b890917a1952173e934;hpb=c83030828a4b33bf18cd2e960b9a657aff0f9b44;p=gosa.git
diff --git a/gosa-core/html/helpviewer.php b/gosa-core/html/helpviewer.php
index fed1414fe..4a4f39982 100644
--- a/gosa-core/html/helpviewer.php
+++ b/gosa-core/html/helpviewer.php
@@ -1,21 +1,23 @@
data['MAIN']['LANG'] == ""){
+$lang= $config->get_cfg_value("language");
+if ($lang == ""){
$lang= get_browser_language();
-} else {
- $lang= $config->data['MAIN']['LANG'];
}
$lang.=".UTF-8";
@@ -55,27 +56,22 @@ $GLOBALS['t_language']= $lang;
$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/';
$domain = 'messages';
-bindtextdomain($domain, "$BASE_DIR/locale");
+bindtextdomain($domain, LOCALE_DIR);
textdomain($domain);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
-$config= session::get('config');
-if (isset ($config->data['MAIN']['COMPILE'])){
- $smarty->compile_dir= $config->data['MAIN']['COMPILE'];
-} else {
- $smarty->compile_dir= '/var/spool/gosa/';
-}
+$smarty->compile_dir= $config->get_cfg_value("compile", "/var/spool/gosa/");
$smarty->assign("title", "GOsa - "._("Help browser"));
/* HELP management starts here ...
*/
/* Generate helpobject */
-if(session::is_set('helpobject')){
- $helpobject = session::get('helpobject');
+if(session::global_is_set('helpobject')){
+ $helpobject = session::global_get('helpobject');
}else{
- $plist = session::get('plist');
+ $plist = session::global_get('plist');
$helpobject['lang'] = $lang;
$helpobject['helpconf'] = array();
@@ -101,11 +97,11 @@ $forward ="node1.html";
$helpdir ="";
/* Every class which is called within a tab, stores its name in the Session.
- * If session::is_set('current_class_for_help') is true,
+ * If session::global_is_set('current_class_for_help') is true,
* get the helpfile specified in the xml file and display it.
* Unset this Session entry, to avoid displaying it again.
*/
-if(session::is_set('current_class_for_help')){
+if(session::global_is_set('current_class_for_help')){
/* Create new XML parser with the path to the Xml file */
$xml = new parseXml("../doc/guide.xml");
@@ -114,37 +110,39 @@ if(session::is_set('current_class_for_help')){
$str = $xml->parse();
/* __LANG__ is used as placeholder for the used language*/
- $helpdir= @preg_replace("/__LANG__/i",$lang,$str[(session::get('current_class_for_help'))]['PATH']);
+ $helpdir= @preg_replace("/__LANG__/i",$lang,$str[(session::global_get('current_class_for_help'))]['PATH']);
/* If there is no entry in the xml file for this class, display an error message */
if($helpdir == ""){
$smarty->assign("help_contents","
"._("There is no helpfile specified for this class"))."
";
+ $smarty->assign("iePngWorkaround", $config->get_cfg_value("iePngWorkaround","false" ) == "true");
$header= "".$smarty->fetch(get_template_path('headers.tpl'));
$display= ( $header.$smarty->fetch(get_template_path('help.tpl')));
echo $display;
- session::un_set('current_class_for_help');
+ session::global_un_set('current_class_for_help');
exit();
}
/* Save filename */
- $helpobject['file']= $str[(session::get('current_class_for_help'))]['FILE'];
+ $helpobject['file']= $str[(session::global_get('current_class_for_help'))]['FILE'];
/* Save path to the file */
$helpobject['currentplug'] = $helpdir;
/* Avoid displaying the same help every time */
if(isset($_GET['pg'])){
- session::un_set('current_class_for_help');
+ session::global_un_set('current_class_for_help');
}
}elseif(isset($_GET['plug'])){
/* This displays helpfiles depending on the current $_GET[plug] */
- $tmp = new pluglist(session::get('config'),get_userinfo());
+ $ui= get_userinfo();
+ $tmp = new pluglist($config, $ui);
$path = $tmp->get_path($_GET['plug']);
$helpobject['currentplug'] = $path;
$helpobject['file'] = "index.html";
- $helpdir = "../doc/guide/user/".$helpobject['lang']."/html/".preg_replace("/^.*\//i","",$helpobject['currentplug']);
+ $helpdir = "../doc/core/".$helpobject['lang']."/html/".preg_replace("/^.*\//i","",$helpobject['currentplug']);
if(empty($helpobject['currentplug'])){
$helpdir= "";
}
@@ -153,8 +151,8 @@ if(session::is_set('current_class_for_help')){
if(isset($_GET['pg'])){
if(preg_match("/\//",$_GET['pg'])){
- $arr = split("\/",$_GET['pg']);
- $helpobject['currentplug'] = "../doc/guide/user/".$helpobject['lang']."/html/".$arr[0];
+ $arr = explode("/", $_GET['pg']);
+ $helpobject['currentplug'] = "../doc/core/".$helpobject['lang']."/html/".$arr[0];
$helpdir = $helpobject['currentplug'];
$helpobject['file']= $arr[1];
}else{
@@ -168,7 +166,7 @@ if(isset($_GET['pg'])){
$helpobject['file'] = "index.html";
}
/* Create new helpdir (The path where the requested page is located)*/
- $helpdir = "../doc/guide/user/".$helpobject['lang']."/html/".preg_replace("/^.*\//i","",$helpobject['currentplug']);
+ $helpdir = "../doc/core/".$helpobject['lang']."/html/".preg_replace("/^.*\//i","",$helpobject['currentplug']);
/* If helpdir is empty, force index */
if(empty($helpobject['currentplug'])){
@@ -179,7 +177,7 @@ if(isset($_GET['pg'])){
$helpdir.="/";
/* Save current settings */
-session::set('helpobject',$helpobject);
+session::global_set('helpobject',$helpobject);
/*
* Display management
@@ -223,7 +221,7 @@ if($helpobject['file'] == "index.html"){
/* If there is no helpdir or file defined, display the index */
if(isset($_POST['search'])){
- $helpdir = "../doc/guide/user/".$helpobject['lang']."/html/";
+ $helpdir = "../doc/core/".$helpobject['lang']."/html/";
/* read all available directories */
$index = readfiles($helpdir,$prefix,$suffix,false,false);
$smarty->assign("help_contents",((searchlist($index,search($index,$_POST['search_string']),10))));
@@ -247,7 +245,7 @@ if(isset($_POST['search'])){
* parse it, rework links images and so on */
$index = readfiles($helpdir,$prefix,$suffix,false,$helpobject['file']);
- $lastresults = session::get('lastresults');
+ $lastresults = session::global_get('lastresults');
/* if this page is result from a search, mark the search strings */
if(isset($_GET['mark'])){