/**
  * execute command
  */
 public function executeCommand()
 {
     $cmd = $this->ctrl->getCmd();
     $this->tpl->getStandardTemplate();
     switch ($cmd) {
         case 'update':
             $this->save("update");
             break;
         default:
             $this->{$cmd}();
             break;
     }
     return true;
 }
 public function executeCommand()
 {
     $this->checkPermission();
     $this->initHeader();
     $this->setSubTabs();
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     // needed for ILIAS >= 4.5
     if (ilCertificatePlugin::getBaseClass() != 'ilRouterGUI') {
         $this->tpl->getStandardTemplate();
     }
     switch ($next_class) {
         case '':
             switch ($cmd) {
                 case 'showDefinition':
                 case 'showPlaceholders':
                 case 'showCertificates':
                 case 'downloadCertificate':
                 case 'downloadCertificates':
                 case 'updateDefinition':
                 case 'confirmTypeChange':
                 case 'updateType':
                 case 'createDefinition':
                 case 'updatePlaceholders':
                 case 'previewCertificate':
                 case 'buildActions':
                     $this->{$cmd}();
                     break;
                 case 'updatePlaceholdersPreview':
                     $this->updatePlaceholders('previewCertificate');
                     break;
                 case 'callBack':
                 case 'undoCallBack':
                 case 'retryGeneration':
                     /** @var srCertificate $certificate */
                     $certificate = srCertificate::find((int) $_GET['cert_id']);
                     if ($certificate->getDefinitionId() == $this->definition->getId()) {
                         $this->{$cmd}($certificate);
                     }
                     break;
                 case '':
                     if ($this->definition) {
                         $this->showCertificates();
                     } else {
                         $this->showDefinition();
                     }
             }
             break;
     }
     // needed for ILIAS >= 4.5
     if (ilCertificatePlugin::getBaseClass() != 'ilRouterGUI') {
         $this->tpl->show();
     }
 }
 public function executeCommand()
 {
     if (!$this->checkPermission()) {
         ilUtil::sendFailure($this->pl->txt('msg_no_permission'), true);
         $this->ctrl->redirectByClass('ilpersonaldesktopgui');
     }
     if (iLCertificatePlugin::getBaseClass() == 'ilUIPluginRouterGUI') {
         $this->tpl->getStandardTemplate();
     }
     $cmd = $this->ctrl->getCmd('index');
     switch ($cmd) {
         case 'index':
             $this->index();
             break;
         case 'applyFilter':
             $this->applyFilter();
             break;
         case 'resetFilter':
             $this->resetFilter();
             break;
         case 'downloadCertificate':
             $this->downloadCertificate();
             break;
         case 'downloadCertificates':
             $this->downloadCertificates();
             break;
         case 'buildActions':
             $this->buildActions();
             break;
         default:
             $this->performCommand($cmd);
     }
     if (iLCertificatePlugin::getBaseClass() == 'ilUIPluginRouterGUI') {
         $this->tpl->show();
     }
 }
 public function executeCommand()
 {
     if (!$this->checkPermission()) {
         ilUtil::sendFailure($this->pl->txt('msg_no_permission'), true);
         $this->ctrl->redirectByClass('ilpersonaldesktopgui');
     }
     global $ilMainMenu;
     $ilMainMenu->setActive('none');
     $cmd = $this->ctrl->getCmd();
     $next_class = $this->ctrl->getNextClass($this);
     if (!in_array($cmd, array('addType', ''))) {
         $this->ctrl->saveParameter($this, 'type_id');
         $this->ctrl->saveParameter($this, 'signature_id');
     }
     // needed for ILIAS >= 4.5
     if (ilCertificatePlugin::getBaseClass() != 'ilRouterGUI') {
         $this->tpl->getStandardTemplate();
     }
     switch ($next_class) {
         case '':
             switch ($cmd) {
                 case 'showTypes':
                     $this->showTypes();
                     break;
                 case 'editType':
                     $this->editType();
                     $this->setTabs('general');
                     break;
                 case 'addType':
                     $this->addType();
                     $this->setTabs('general');
                     break;
                 case 'saveType':
                     $this->saveType();
                     $this->setTabs('general');
                     break;
                 case 'editTemplate':
                     $this->editTemplate();
                     $this->setTabs('template');
                     break;
                 case 'updateTemplate':
                     $this->updateTemplate();
                     $this->setTabs('template');
                     break;
                 case 'downloadDefaultTemplate':
                     $this->downloadDefaultTemplate();
                     $this->setTabs('template');
                     break;
                 case 'downloadTemplate':
                     $this->downloadTemplate();
                     $this->setTabs('template');
                     break;
                 case 'showSettings':
                     $this->showSettings();
                     $this->setTabs('settings');
                     break;
                 case 'editSetting':
                     $this->editSetting();
                     $this->setTabs('settings');
                     break;
                 case 'updateSetting':
                     $this->updateSetting();
                     $this->setTabs('settings');
                     break;
                 case 'addCustomSetting':
                     $this->addCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'editCustomSetting':
                     $this->editCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'confirmDeleteCustomSetting':
                     $this->confirmDeleteCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'deleteCustomSetting':
                     $this->deleteCustomSetting();
                     break;
                 case 'saveCustomSetting':
                     $this->saveCustomSetting();
                     $this->setTabs('settings');
                     break;
                 case 'showPlaceholders':
                     $this->showPlaceholders();
                     $this->setTabs('placeholders');
                     break;
                 case 'addPlaceholder':
                     $this->addPlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'editPlaceholder':
                     $this->editPlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'updatePlaceholder':
                     $this->updatePlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'createPlaceholder':
                     $this->createPlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'deletePlaceholder':
                     $this->deletePlaceholder();
                     break;
                 case 'confirmDeletePlaceholder':
                     $this->confirmDeletePlaceholder();
                     $this->setTabs('placeholders');
                     break;
                 case 'showSignatures':
                     $this->showSignatures();
                     $this->setTabs('signatures');
                     break;
                 case 'addSignature':
                     $this->addSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'editSignature':
                     $this->editSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'createSignature':
                     $this->createSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'updateSignature':
                     $this->updateSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'confirmDeleteSignature':
                     $this->confirmDeleteSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'deleteSignature':
                     $this->deleteSignature();
                     $this->setTabs('signatures');
                     break;
                 case 'downloadSignature':
                     $this->downloadSignature();
                     $this->setTabs('signatures');
                     break;
                 case '':
                     $this->showTypes();
                     break;
             }
             break;
     }
     // needed for ILIAS >= 4.5
     if (ilCertificatePlugin::getBaseClass() != 'ilRouterGUI') {
         $this->tpl->show();
     }
 }
Example #5
0
 /**
  * Generates an index.html file including links to all xml files included
  * (for container exports)
  */
 function _generateIndexFile($a_filename, $a_obj_id, $a_files, $a_type = "")
 {
     global $lng;
     $lng->loadLanguageModule("export");
     if ($a_type == "") {
         $a_type = ilObject::_lookupType($a_obj_id);
     }
     $a_tpl = new ilTemplate("tpl.main.html", true, true);
     $location_stylesheet = ilUtil::getStyleSheetLocation();
     $a_tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
     $a_tpl->getStandardTemplate();
     $a_tpl->setTitle(ilObject::_lookupTitle($a_obj_id));
     $a_tpl->setDescription($lng->txt("export_export_date") . ": " . date('Y-m-d H:i:s', time()) . " (" . date_default_timezone_get() . ")");
     $f_tpl = new ilTemplate("tpl.export_list.html", true, true, "Services/Export");
     foreach ($a_files as $file) {
         $f_tpl->setCurrentBlock("file_row");
         $f_tpl->setVariable("TITLE", $file["title"]);
         $f_tpl->setVariable("TYPE", $lng->txt("obj_" . $file["type"]));
         $f_tpl->setVariable("FILE", $file["file"]);
         $f_tpl->parseCurrentBlock();
     }
     $a_tpl->setContent($f_tpl->get());
     $index_content = $a_tpl->get("DEFAULT", false, false, false, true, false, false);
     $f = fopen($a_filename, "w");
     fwrite($f, $index_content);
     fclose($f);
 }