Code

Added hook to call helpviewer. The latter is not started yet...
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Jun 2005 06:29:38 +0000 (06:29 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Jun 2005 06:29:38 +0000 (06:29 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@607 594d385d-05f5-0310-b6e9-bd551577e9d8

html/helpviewer.php [new file with mode: 0644]
html/main.php
ihtml/themes/altlinux/framework.tpl
ihtml/themes/default/framework.tpl

diff --git a/html/helpviewer.php b/html/helpviewer.php
new file mode 100644 (file)
index 0000000..d2f1e70
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/*
+   This code is part of GOsa (https://gosa.gonicus.de)
+   Copyright (C) 2003  Cajus Pollmeier
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/* Basic setup, remove eventually registered sessions */
+@require_once ("../include/php_setup.inc");
+@require_once ("functions.inc");
+
+session_start ();
+
+/* Logged in? Simple security check */
+if (!isset($_SESSION['ui'])){
+  gosa_log ("Error: helpviewer.php called without session");
+  echo "<b>"._("Help is not available if you are not logged in.")."</b>";
+  exit;
+}
+
+/* Set template compile directory */
+$config= $_SESSION['config'];
+if (isset ($config->data['MAIN']['COMPILE'])){
+  $smarty->compile_dir= $config->data['MAIN']['COMPILE'];
+} else {
+  $smarty->compile_dir= '/var/spool/gosa/';
+}
+
+/* Language setup */
+if ($config->data['MAIN']['LANG'] == ""){
+  $lang= get_browser_language();
+} else {
+  $lang= $config->data['MAIN']['LANG'];
+}
+$lang.=".UTF-8";
+putenv("LANGUAGE=");
+putenv("LANG=$lang");
+setlocale(LC_ALL, $lang);
+$GLOBALS['t_language']= $lang;
+$GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/';
+
+/* Set the text domain as 'messages' */
+$domain = 'messages';
+bindtextdomain($domain, "$BASE_DIR/locale");
+textdomain($domain);
+@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
+
+/* Get plugin list */
+$plist= $_SESSION['plist'];
+
+echo "Help...";
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
index af4f52d67c42fbc4dc41aa406a0f3046be658fae..99746264a3a9908548202c82d70ad156084d15dc 100644 (file)
@@ -202,10 +202,17 @@ if(isset($_SESSION['POST'])){
 /* show web frontend */
 $smarty->assign ("date", date("l, dS F Y H:i:s O"));
 $smarty->assign ("must", "<font class=\"must\">*</font>");
+if (isset($plug)){
+  $plug= "?plug=$plug";
+} else {
+  $plug= "";
+}
 if ($_SESSION['js']==FALSE){
   $smarty->assign("javascript", "false");
+  $smarty->assign("help_method", "href='helpviewer.php$plug' target='_new'");
 } else {
   $smarty->assign("javascript", "true");
+  $smarty->assign("help_method", "href='' onClick=\"window.open('helpviewer.php$plug','{t}GOsa help{/t}','width=600,height=700')\"");
 }
 $smarty->assign ("username", $ui->username);
 $smarty->assign ("go_logo", get_template_path('images/go_logo.png'));
@@ -218,11 +225,8 @@ $smarty->assign ("go_left", get_template_path('images/go_left.png'));
 $smarty->assign ("go_help", get_template_path('images/help.png'));
 $plist->gen_menu();
 $smarty->assign ("menu", $plist->menu);
-if (isset($plug)){
-  $smarty->assign ("plug", "?plug=$plug");
-} else {
-  $smarty->assign ("plug", "");
-}
+$smarty->assign ("plug", "$plug");
+
 $header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
 
 
index b8ed5da13f605c7786c43484428c7632e522515e..4c1ac5cd2d5863c7f63adc639d89f734af7191b5 100644 (file)
@@ -16,7 +16,7 @@
         </a>
        </td>
         <td>
-        <a class=maintitlebar style="margin-left:35px; vertical-align:middle;">
+        <a class=maintitlebar style="margin-left:35px; vertical-align:middle;" {$help_method}>
           <img src='{$go_help}' align="middle" border="0" alt="GOSA2">&nbsp;{t}Help{/t}
          </a>
        </td>
index 7813effbb9e2b3f507c90bad849edd5357a4c94c..239e725f6a64855b9284b9f956373edb876d9e68 100644 (file)
@@ -16,7 +16,7 @@
         </a>
        </td>
         <td>
-        <a class=maintitlebar style="margin-left:35px; vertical-align:middle;">
+        <a class=maintitlebar style="margin-left:35px; vertical-align:middle;" {$help_method}>
           <img src='{$go_help}' align="middle" border="0" alt="GOSA2">&nbsp;{t}Help{/t}
          </a>
        </td>