Esempio n. 1
0
 public function execute($dataContainer)
 {
     //No direct access
     defined('_WEXEC') or die("Access denied");
     $smarty = $dataContainer->getSmarty();
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     require_once PATH_ACCESS . '/CardManager.php';
     require_once PATH_ACCESS . '/UserManager.php';
     $cm = new CardManager();
     $um = new UserManager();
     $gsManager = new GlobalSettingsManager();
     try {
         $help_str = $gsManager->getHelpText();
     } catch (Exception $e) {
         die('Ein Fehler ist aufgetreten:' . $e->getMessage());
     }
     if ($dataContainer->getAcl()->moduleGet('root/web/Babesk')) {
         // set {cardid} in helptext administration to replace it with the cardnumber
         $help_str = str_replace("{cardid}", $cm->getCardnumberByUserID($_SESSION['uid']), $help_str);
     }
     //set {login} in helptext administration to replace it with the login name
     $help_str = str_replace("{login}", $um->getUsername($_SESSION['uid']), $help_str);
     $smarty->assign('help_str', $help_str);
     $smarty->display($this->smartyPath . "help.tpl");
 }
Esempio n. 2
0
 public function execute($dataContainer)
 {
     defined('_AEXEC') or die("Access denied");
     require_once 'AdminHelpProcessing.php';
     require_once 'AdminHelpInterface.php';
     require_once PATH_ACCESS . '/GlobalSettingsManager.php';
     $gbManager = new GlobalSettingsManager();
     $helpInterface = new AdminHelpInterface($this->relPath);
     $helpProcessing = new AdminHelpProcessing($helpInterface);
     if ('POST' == $_SERVER['REQUEST_METHOD']) {
         try {
             switch ($_GET['action']) {
                 case 1:
                     //show the Help-Text
                     try {
                         $helptext = $gbManager->getHelpText();
                     } catch (MySQLVoidDataException $e) {
                         $helptext = ' ';
                     }
                     $helpInterface->ShowHelp($helptext);
                     break;
                 case 2:
                     //edit the Help-Text
                     if (isset($_POST['helptext'])) {
                         $helpProcessing->change_help($_POST['helptext']);
                     } else {
                         try {
                             $helptext = $gbManager->getHelpText();
                         } catch (MySQLVoidDataException $e) {
                             $helptext = ' ';
                         }
                         $helpInterface->EditHelp($helptext);
                     }
                     break;
             }
         } catch (Exception $e) {
             die_error($e->getMessage());
         }
     } else {
         $helpInterface->IndexMenu();
     }
 }