From 0e8a385b6d1d0b386de7b7ba8c2e0654df27aaa2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 11 Jun 2015 06:41:49 +0200 Subject: [PATCH] allow context sensitive help files --- out/out.Help.php | 10 +++++++++- views/bootstrap/class.Bootstrap.php | 3 ++- views/bootstrap/class.Help.php | 9 +++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/out/out.Help.php b/out/out.Help.php index b5204478a..f535764d3 100644 --- a/out/out.Help.php +++ b/out/out.Help.php @@ -25,8 +25,16 @@ include("../inc/inc.ClassUI.php"); include("../inc/inc.Authentication.php"); $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); -$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user)); +$view = UI::factory($theme, $tmp[1]); + +if(isset($_GET['context'])) + $context = $_GET['context']; +else + $context = ''; if($view) { + $view->setParam('dms', $dms); + $view->setParam('user', $user); + $view->setParam('context', $context); $view->show(); exit; } diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 8f9eb9857..e1980e67a 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -314,7 +314,8 @@ $(document).ready(function () { // echo "
  • params['rootfolderid']."\">".getMLText("search")."
  • \n"; if ($this->params['enablecalendar']) echo "
  • params['calendardefaultview']."\">".getMLText("calendar")."
  • \n"; if ($this->params['user']->isAdmin()) echo "
  • ".getMLText("admin_tools")."
  • \n"; - echo "
  • ".getMLText("help")."
  • \n"; + $tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); + echo "
  • ".getMLText("help")."
  • \n"; echo " \n"; echo "
    "; if ($folder!=null && is_object($folder) && !strcasecmp(get_class($folder), $dms->getClassname('folder'))) { diff --git a/views/bootstrap/class.Help.php b/views/bootstrap/class.Help.php index 96864e17b..5a209068e 100644 --- a/views/bootstrap/class.Help.php +++ b/views/bootstrap/class.Help.php @@ -34,15 +34,20 @@ class SeedDMS_View_Help extends SeedDMS_Bootstrap_Style { function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; + $context = $this->params['context']; $this->htmlStartPage(getMLText("help")); $this->globalNavigation(); $this->contentStart(); - $this->pageNavigation(getMLText("help"), ""); + $this->pageNavigation(getMLText("help").": ".getMLText('help_'.strtolower($context), array(), $context), ""); $this->contentContainerStart(); - readfile("../languages/".$this->params['session']->getLanguage()."/help.htm"); + $helpfile = "../languages/".$this->params['session']->getLanguage()."/help/".$context.".html"; + if(file_exists($helpfile)) + readfile($helpfile); + else + readfile("../languages/".$this->params['session']->getLanguage()."/help.htm"); $this->contentContainerEnd(); $this->htmlEndPage();