/**
  * Constructor
  *
  * @param	object	$a_parent_obj
  * @param	int $table_id 
  * @param	int $a_definition_id 
  */
 public function __construct($table_id, $a_definition_id = 0)
 {
     global $tpl;
     //TODO Permission-Check
     $this->table_id = $table_id;
     if (!$a_definition_id) {
         $a_definition_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($this->table_id);
     }
     // we always need a page object - create on demand
     if (!$a_definition_id) {
         $viewdef = new ilDataCollectionRecordViewViewdefinition(0, $this->table_id);
         $viewdef->create();
         $a_definition_id = $viewdef->getId();
     }
     parent::__construct("dclf", $a_definition_id);
     // content style (using system defaults)
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     // config
     $this->setPreventHTMLUnmasking(true);
     $this->setEnabledPCTabs(true);
     $this->setEnabledMaps(false);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledWikiLinks(false);
     $this->setEnabledActivation(false);
 }
 /**
  * Render COPage
  * 
  * @see ilContainerGUI
  * @return string
  */
 protected function getPageHTML()
 {
     global $tpl, $ilSetting, $ilUser;
     if (!$ilSetting->get("enable_cat_page_edit")) {
         return;
     }
     $page_id = $this->start_object->getObjId();
     // if page does not exist, return nothing
     include_once "./Services/COPage/classes/class.ilPageUtil.php";
     if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) {
         return;
     }
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     include_once "./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php";
     $page_gui = new ilContainerStartObjectsPageGUI($page_id);
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
     $page_gui->setPresentationTitle("");
     $page_gui->setTemplateOutput(false);
     $page_gui->setHeader("");
     return $page_gui->showPage();
 }
 /**
  * Constructor
  */
 function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true)
 {
     global $tpl, $ilSetting;
     $this->portfolio_id = (int) $a_portfolio_id;
     $this->enable_comments = (bool) $a_enable_comments;
     parent::__construct("prtf", $a_id, $a_old_nr);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     // #11190
     $prfa_set = new ilSetting("prfa");
     $this->setPreventHTMLUnmasking((bool) $prfa_set->get("mask", false));
     // $this->setEnabledMaps(true);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledPCTabs(true);
     $this->setEnabledProfile(true);
     if (!$ilSetting->get('disable_wsp_certificates')) {
         $this->setEnabledVerification(true);
     }
     /* embedding blog postings currently disabled 
     		if(!$ilSetting->get('disable_wsp_blogs'))
     		{
     			$this->setEnabledBlog(true);
     		}		
     		*/
     $skmg_set = new ilSetting("skmg");
     if ($skmg_set->get("enable_skmg")) {
         $this->setEnabledSkills(true);
     }
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     global $tpl;
     if (!ilImprint::_exists("impr", 1)) {
         $page = new ilImprint("impr");
         $page->setId(1);
         $page->create();
     }
     // there is only 1 imprint page
     parent::__construct("impr", 1);
     // content style (using system defaults)
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     // config
     $this->setPreventHTMLUnmasking(true);
     $this->setEnabledPCTabs(true);
     $this->setEnabledMaps(false);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledWikiLinks(false);
     $this->setEnabledActivation(true);
 }
 /**
  * @param     $table_id
  * @param int $a_definition_id
  */
 public function __construct($table_id, $a_definition_id = 0)
 {
     global $tpl, $ilCtrl;
     /**
      * @var $ilCtrl ilCtrl
      */
     $this->ctrl = $ilCtrl;
     //TODO Permission-Check
     $this->table_id = $table_id;
     if (!$a_definition_id) {
         $a_definition_id = ilDataCollectionRecordViewViewdefinition::getIdByTableId($this->table_id);
     }
     // we always need a page object - create on demand
     if (!$a_definition_id) {
         $viewdef = new ilDataCollectionRecordViewViewdefinition();
         $viewdef->setTableId($this->table_id);
         $viewdef->setActive(false);
         $viewdef->create();
         $a_definition_id = $viewdef->getId();
     }
     parent::__construct("dclf", $a_definition_id);
     $this->getPageObject()->setTableId($this->table_id);
     // content style (using system defaults)
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
 }
 public function forwardToPageObject()
 {
     global $lng, $ilTabs;
     $ilTabs->clearTargets();
     $ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top');
     // page object
     include_once 'Services/COPage/classes/class.ilPageObject.php';
     include_once 'Services/COPage/classes/class.ilPageObjectGUI.php';
     $lng->loadLanguageModule('content');
     include_once './Services/Style/classes/class.ilObjStyleSheet.php';
     $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
     if (!ilPageObject::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID)) {
         // doesn't exist -> create new one
         $new_page_object = new ilPageObject('shop');
         $new_page_object->setParentId(0);
         $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
         $new_page_object->createFromXML();
     }
     $this->ctrl->setReturnByClass('ilpageobjectgui', 'edit');
     $page_gui = new ilPageObjectGUI('shop', self::SHOP_PAGE_EDITOR_PAGE_ID);
     $page_gui->setIntLinkHelpDefault('StructureObject', self::SHOP_PAGE_EDITOR_PAGE_ID);
     $page_gui->setTemplateTargetVar('ADM_CONTENT');
     $page_gui->setLinkXML('');
     $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'downloadFile'));
     $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'displayMediaFullscreen'));
     $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'download_paragraph'));
     $page_gui->setPresentationTitle('');
     $page_gui->setTemplateOutput(false);
     $page_gui->setHeader('');
     $page_gui->setEnabledRepositoryObjects(false);
     $page_gui->setEnabledFileLists(true);
     $page_gui->setEnabledMaps(true);
     $page_gui->setEnabledPCTabs(true);
     return $this->ctrl->forwardCommand($page_gui);
 }
 public function forwardToPageObject()
 {
     /**
      * @var $ilTabs ilTabsGUI
      */
     global $ilTabs;
     if (!(int) $_GET['pobject_id']) {
         ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
         return $this->showObjects();
     }
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $this->__initPaymentObject((int) $_GET['pobject_id']);
     $this->lng->loadLanguageModule('content');
     $ilTabs->clearTargets();
     $ilTabs->clearSubTabs();
     $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'editDetails'), '_top');
     // page objec
     include_once 'Services/Payment/classes/class.ilShopPage.php';
     include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
     include_once './Services/Style/classes/class.ilObjStyleSheet.php';
     $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
     if (!ilShopPage::_exists('shop', $this->pobject->getPobjectId())) {
         // doesn't exist -> create new one
         $new_page_object = new ilShopPage();
         $new_page_object->setParentId(0);
         $new_page_object->setId($this->pobject->getPobjectId());
         $new_page_object->createFromXML();
     }
     $this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
     $page_gui = new ilShopPageGUI($this->pobject->getPobjectId());
     $this->ctrl->setParameter($page_gui, 'pobject_id', (int) $_GET['pobject_id']);
     return $this->ctrl->forwardCommand($page_gui);
 }
 function __construct($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_slm_id = 0)
 {
     global $tpl, $ilCtrl;
     parent::__construct($a_parent_type, $a_id, $a_old_nr);
     //associated object
     include_once "./Services/Style/classes/class.ilPageLayout.php";
     $this->layout_object = new ilPageLayout($a_id);
     $this->layout_object->readObject();
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->layout_object->getStyleId()));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilObjStyleSheet::getPlaceHolderStylePath());
     $tpl->parseCurrentBlock();
     $this->setEnabledMaps(false);
     $this->setPreventHTMLUnmasking(false);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledSelfAssessment(false);
     $this->setStyleId($this->layout_object->getStyleId());
     //set For GUI and associated object
     $this->setLayoutMode(true);
     $this->obj->setLayoutMode(true);
     $this->slm_id = $a_slm_id;
 }
 /**
  * Constructor
  *
  * @param int $a_node
  * @param object $a_access_handler
  * @param int $a_id
  * @param int $a_old_nr
  * @param bool $a_enable_notes
  * @param bool $a_may_contribute
  * @return ilBlogPostingGUI
  */
 function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true)
 {
     global $tpl, $lng;
     $lng->loadLanguageModule("blog");
     $this->node_id = $a_node_id;
     $this->access_handler = $a_access_handler;
     $this->enable_public_notes = (bool) $a_enable_public_notes;
     parent::__construct("blp", $a_id, $a_old_nr);
     // #11151
     $this->may_contribute = (bool) $a_may_contribute;
     $this->setEnableEditing($a_may_contribute);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     // #11190
     $blga_set = new ilSetting("blga");
     $this->setPreventHTMLUnmasking((bool) $blga_set->get("mask", false));
     $this->setEnabledMaps(true);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledWikiLinks(false);
     $this->setEnabledPCTabs(true);
     $this->setEnabledActivation(true);
 }
 /**
  * Constructor
  */
 function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false, $a_lang = "")
 {
     global $tpl;
     parent::__construct("mep", $a_id, $a_old_nr, $a_prevent_get_id, $a_lang);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
 }
 public function __construct($a_dcl_object)
 {
     global $tpl;
     $this->dcl_gui_object = $a_dcl_object;
     $this->record_id = $_GET['record_id'];
     $this->record_obj = ilDataCollectionCache::getRecordCache($this->record_id);
     // content style (using system defaults)
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
 }
 /**
  * Constructor
  */
 function __construct($a_portfolio_id, $a_id = 0, $a_old_nr = 0, $a_enable_comments = true)
 {
     global $tpl;
     $this->portfolio_id = (int) $a_portfolio_id;
     $this->enable_comments = (bool) $a_enable_comments;
     parent::__construct($this->getParentType(), $a_id, $a_old_nr);
     $this->getPageObject()->setPortfolioId($this->portfolio_id);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
 }
 public function forwardToPageObject()
 {
     /**
      * @var $ilTabs ilTabsGUI
      */
     global $ilTabs;
     if (!(int) $_GET['pobject_id']) {
         ilUtil::sendInfo($this->lng->txt('paya_no_object_selected'));
         return $this->showObjects();
     }
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $this->__initPaymentObject((int) $_GET['pobject_id']);
     $this->lng->loadLanguageModule('content');
     $ilTabs->clearTargets();
     $ilTabs->clearSubTabs();
     $ilTabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'editDetails'), '_top');
     // page objec
     include_once 'Services/COPage/classes/class.ilPageObject.php';
     include_once 'Services/COPage/classes/class.ilPageObjectGUI.php';
     include_once './Services/Style/classes/class.ilObjStyleSheet.php';
     $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
     if (!ilPageObject::_exists('shop', $this->pobject->getPobjectId())) {
         // doesn't exist -> create new one
         $new_page_object = new ilPageObject('shop');
         $new_page_object->setParentId(0);
         $new_page_object->setId($this->pobject->getPobjectId());
         $new_page_object->createFromXML();
     }
     $this->ctrl->setReturnByClass('ilpageobjectgui', 'edit');
     $page_gui = new ilPageObjectGUI('shop', $this->pobject->getPobjectId());
     $this->ctrl->setParameter($page_gui, 'pobject_id', (int) $_GET['pobject_id']);
     $page_gui->setIntLinkHelpDefault('StructureObject', $this->pobject->getPobjectId());
     $page_gui->setTemplateTargetVar('ADM_CONTENT');
     $page_gui->setLinkXML('');
     $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'downloadFile'));
     $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'displayMediaFullscreen'));
     $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array('ilpageobjectgui'), 'download_paragraph'));
     $page_gui->setPresentationTitle('');
     $page_gui->setTemplateOutput(false);
     $page_gui->setHeader('');
     $page_gui->setEnabledRepositoryObjects(false);
     $page_gui->setEnabledFileLists(true);
     $page_gui->setEnabledMaps(true);
     $page_gui->setEnabledPCTabs(true);
     return $this->ctrl->forwardCommand($page_gui);
 }
 /**
  * Constructor
  */
 function __construct($a_id = 0, $a_old_nr = 0, $a_prevent_get_id = false)
 {
     global $tpl;
     parent::__construct("mep", $a_id, $a_old_nr, $a_prevent_get_id);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $this->setEnabledMaps(false);
     $this->setPreventHTMLUnmasking(false);
     $this->setEnabledInternalLinks(false);
     $this->setEnabledWikiLinks(false);
 }
Ejemplo n.º 15
0
 /**
  * Constructor
  */
 public function __construct()
 {
     global $tpl;
     if (!ilImprint::_exists("impr", 1)) {
         $page = new ilImprint("impr");
         $page->setId(1);
         $page->create();
     }
     // there is only 1 imprint page
     parent::__construct("impr", 1);
     // content style (using system defaults)
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
 }
Ejemplo n.º 16
0
 /**
  * Export lm content css to a directory
  */
 static function exportContentCSS($a_slm_object, $a_target_dir)
 {
     ilUtil::makeDir($a_target_dir . "/css");
     ilUtil::makeDir($a_target_dir . "/css/images");
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $active_css = ilObjStyleSheet::getContentStylePath($a_slm_object->getStyleSheetId());
     $active_css = split(@'\\?', $active_css, 2);
     $css = fread(fopen($active_css[0], 'r'), filesize($active_css[0]));
     preg_match_all("/url\\(([^\\)]*)\\)/", $css, $files);
     $currdir = getcwd();
     chdir(dirname($active_css[0]));
     foreach (array_unique($files[1]) as $fileref) {
         if (is_file($fileref)) {
             copy($fileref, $a_target_dir . "/css/images/" . basename($fileref));
         }
         $css = str_replace($fileref, "images/" . basename($fileref), $css);
     }
     chdir($currdir);
     fwrite(fopen($a_target_dir . '/css/style.css', 'w'), $css);
 }
Ejemplo n.º 17
0
 function __construct($a_parent_type, $a_id = 0, $a_old_nr = 0, $a_slm_id = 0)
 {
     global $tpl, $ilCtrl;
     parent::__construct($a_parent_type, $a_id, $a_old_nr);
     //associated object
     include_once "./Services/Style/classes/class.ilPageLayout.php";
     $this->layout_object = new ilPageLayout($a_id);
     $this->layout_object->readObject();
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->layout_object->getStyleId()));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->setVariable("LOCATION_ADDITIONAL_STYLESHEET", ilObjStyleSheet::getPlaceHolderStylePath());
     $tpl->parseCurrentBlock();
     $this->setStyleId($this->layout_object->getStyleId());
     $this->slm_id = $a_slm_id;
 }
Ejemplo n.º 18
0
 /**
  * Constructor
  *
  * @param int $a_node
  * @param object $a_access_handler
  * @param int $a_id
  * @param int $a_old_nr
  * @param bool $a_enable_notes
  * @param bool $a_may_contribute
  * @return ilBlogPostingGUI
  */
 function __construct($a_node_id, $a_access_handler = null, $a_id = 0, $a_old_nr = 0, $a_enable_public_notes = true, $a_may_contribute = true)
 {
     global $tpl, $lng;
     $lng->loadLanguageModule("blog");
     $this->node_id = $a_node_id;
     $this->access_handler = $a_access_handler;
     $this->enable_public_notes = (bool) $a_enable_public_notes;
     parent::__construct("blp", $a_id, $a_old_nr);
     // needed for notification
     $this->getBlogPosting()->setBlogNodeId($this->node_id, $this->isInWorkspace());
     // #11151
     $this->may_contribute = (bool) $a_may_contribute;
     $this->setEnableEditing($a_may_contribute);
     // content style
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
 }
Ejemplo n.º 19
0
 public function forwardToPageObject()
 {
     global $lng, $ilTabs;
     $ilTabs->clearTargets();
     $ilTabs->setBackTarget($lng->txt('back'), $this->ctrl->getLinkTarget($this), '_top');
     // page object
     include_once 'Services/Payment/classes/class.ilShopPage.php';
     include_once 'Services/Payment/classes/class.ilShopPageGUI.php';
     $lng->loadLanguageModule('content');
     include_once './Services/Style/classes/class.ilObjStyleSheet.php';
     $this->tpl->setVariable('LOCATION_CONTENT_STYLESHEET', ilObjStyleSheet::getContentStylePath(0));
     if (!ilShopPage::_exists('shop', self::SHOP_PAGE_EDITOR_PAGE_ID)) {
         // doesn't exist -> create new one
         $new_page_object = new ilShopPage();
         $new_page_object->setParentId(0);
         $new_page_object->setId(self::SHOP_PAGE_EDITOR_PAGE_ID);
         $new_page_object->createFromXML();
     }
     $this->ctrl->setReturnByClass('ilshoppagegui', 'edit');
     $page_gui = new ilShopPageGUI(self::SHOP_PAGE_EDITOR_PAGE_ID);
     return $this->ctrl->forwardCommand($page_gui);
 }
 /**
  * @param ilObjDataCollectionGUI $a_dcl_object
  */
 public function __construct(ilObjDataCollectionGUI $a_dcl_object)
 {
     global $tpl, $ilCtrl;
     $this->dcl_gui_object = $a_dcl_object;
     $this->record_id = (int) $_REQUEST['record_id'];
     $this->record_obj = ilDataCollectionCache::getRecordCache($this->record_id);
     if (!$this->record_obj->hasPermissionToView((int) $_GET['ref_id'])) {
         ilUtil::sendFailure('dcl_msg_no_perm_view', true);
         $ilCtrl->redirectByClass('ildatacollectionrecordlistgui', 'listRecords');
     }
     // content style (using system defaults)
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("ContentStyle");
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->parseCurrentBlock();
     $this->table = $this->record_obj->getTable();
     // Comments
     include_once "./Services/Notes/classes/class.ilNoteGUI.php";
     $repId = $this->dcl_gui_object->getDataCollectionObject()->getId();
     $objId = (int) $this->record_id;
     $this->notesGUI = new ilNoteGUI($repId, $objId);
     $this->notesGUI->enablePublicNotes(true);
     $this->notesGUI->enablePublicNotesDeletion(true);
     $ilCtrl->setParameterByClass("ilnotegui", "record_id", $this->record_id);
     $ilCtrl->setParameterByClass("ilnotegui", "rep_id", $repId);
     if (isset($_GET['disable_paging']) && $_GET['disable_paging']) {
         $this->is_enabled_paging = false;
     }
     // Find current, prev and next records for navigation
     if ($this->is_enabled_paging) {
         $this->determineNextPrevRecords();
     }
 }
Ejemplo n.º 21
0
 /**
  * get the HTML code for showing the card in a training
  */
 function getCardForTrainingHTML()
 {
     require_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0));
     // get the card pages to be displayed
     if ($this->card->getTermId()) {
         $pages = $this->getGlossaryTermPages();
     } else {
         // TODO: corrently only glossary cards are supported
         $pages = array();
     }
     require_once "./Services/Accordion/classes/class.ilAccordionGUI.php";
     $question = new ilAccordionGUI();
     $question->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
     $question->setContentClass("xflcFlashcardPage");
     $question->addItem($pages[0]["title"], $pages[0]["html"]);
     $answers = new ilAccordionGUI();
     //$answers->setBehaviour(ilAccordionGUI::FIRST_OPEN);
     $answers->setContentClass("xflcFlashcardPage");
     for ($i = 1; $i < count($pages); $i++) {
         $answers->addItem($pages[$i]["title"], $pages[$i]["html"]);
     }
     return $question->getHTML() . $answers->getHTML();
 }
 /**
  * Forward to page editor
  */
 protected function forwardToPageObject()
 {
     global $lng, $tpl;
     $key = (int) $_REQUEST['key'];
     $this->ctrl->saveParameter($this, 'key', $key);
     include_once "./Services/Authentication/classes/class.ilLoginPage.php";
     include_once "./Services/Authentication/classes/class.ilLoginPageGUI.php";
     include_once './Services/Style/classes/class.ilObjStyleSheet.php';
     $lng->loadLanguageModule("content");
     if (!ilLoginPage::_exists('auth', $key)) {
         // doesn't exist -> create new one
         $new_page_object = new ilLoginPage();
         $new_page_object->setParentId($key);
         $new_page_object->setId($key);
         $new_page_object->createFromXML();
     }
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     $tpl->setCurrentBlock("SyntaxStyle");
     $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $tpl->parseCurrentBlock();
     $this->ctrl->setReturnByClass('illoginpagegui', "edit");
     $page_gui = new ilLoginPageGUI($key);
     $page_gui->setTemplateTargetVar("ADM_CONTENT");
     $page_gui->setLinkXML($link_xml);
     //$page_gui->enableChangeComments($this->content_object->isActiveHistoryUserComments());
     //$page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
     //$page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "showMediaFullscreen"));
     //$page_gui->setLinkParams($this->ctrl->getUrlParameterString()); // todo
     //		$page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this, ""));
     $page_gui->setPresentationTitle("");
     $page_gui->setTemplateOutput(false);
     //$page_gui->setLocator($contObjLocator);
     $page_gui->setHeader("");
     // style tab
     //$page_gui->setTabHook($this, "addPageTabs");
     if ($this->ctrl->getCmd() == 'editPage') {
         $this->ctrl->setCmd('edit');
     }
     $html = $this->ctrl->forwardCommand($page_gui);
     $tpl->setContent($html);
 }
Ejemplo n.º 23
0
 function setContentStyleSheet($a_tpl = null)
 {
     global $tpl;
     if ($a_tpl != null) {
         $ctpl = $a_tpl;
     } else {
         $ctpl = $tpl;
     }
     $ctpl->setCurrentBlock("ContentStyle");
     $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
     $ctpl->parseCurrentBlock();
 }
 /**
  * show abstract of digilib book
  */
 function showAbstract($a_target_id)
 {
     if (count($_POST["tr_id"]) > 1) {
         $message = true;
         $message_text = $this->lng->txt("cont_select_one_translation_warning");
         $show_full = false;
     } else {
         if (!$a_target_id and ($_POST["action"] == "show" or $_POST["action"] == "details")) {
             $message = true;
             $message_text = $this->lng->txt("cont_select_one_edition");
             $show_full = false;
         } else {
             if (is_array($a_target_id) and count($a_target_id) > 1) {
                 $message = true;
                 $message_text = $this->lng->txt("cont_msg_multiple_editions");
                 $show_full = false;
             } else {
                 if (is_array($a_target_id)) {
                     $a_target_id = $a_target_id[0];
                     $show_full = true;
                 } else {
                     $a_target_id = 0;
                     $show_full = false;
                 }
             }
         }
     }
     $this->object->initBibItemObject();
     // content style
     $this->tpl->setCurrentBlock("ContentStyle");
     $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
     $this->tpl->parseCurrentBlock();
     // syntax style
     $this->tpl->setCurrentBlock("SyntaxStyle");
     $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $this->tpl->parseCurrentBlock();
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $this->tpl->setCurrentBlock("ilPage");
     $tmp_tpl = new ilTemplate("tpl.bibliography.xsl", true, true, "Modules/LearningModule");
     $tmp_tpl->setVariable("TITLE", $this->lng->txt("title"));
     $tmp_tpl->setVariable("EDITION", $this->lng->txt("cont_edition"));
     $tmp_tpl->setVariable("AUTHORS", $this->lng->txt("authors"));
     if ($show_full) {
         $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent");
         $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout");
         $params = array('mode' => "view_full", 'action' => $action, 'target_id' => "{$a_target_id}");
         $tmp_tpl->setVariable("BOOKTITLE", $this->lng->txt("cont_booktitle"));
         $tmp_tpl->setVariable("CROSS_REFERENCE", $this->lng->txt("cont_cross_reference"));
         $tmp_tpl->setVariable("DETAILS", $this->lng->txt("cont_details"));
         $tmp_tpl->setVariable("EDITOR", $this->lng->txt("editor"));
         $tmp_tpl->setVariable("HOW_PUBLISHED", $this->lng->txt("cont_how_published"));
         $tmp_tpl->setVariable("WHERE_PUBLISHED", $this->lng->txt("cont_where_published"));
         $tmp_tpl->setVariable("INSTITUTION", $this->lng->txt("institution"));
         $tmp_tpl->setVariable("JOURNAL", $this->lng->txt("cont_journal"));
         $tmp_tpl->setVariable("KEYWORD", $this->lng->txt("cont_keyword"));
         $tmp_tpl->setVariable("PAGES", $this->lng->txt("cont_pages"));
         $tmp_tpl->setVariable("SCHOOL", $this->lng->txt("cont_school"));
         $tmp_tpl->setVariable("MONTH", $this->lng->txt("cont_month"));
         $tmp_tpl->setVariable("PUBLISHER", $this->lng->txt("cont_publisher"));
         $tmp_tpl->setVariable("SERIES", $this->lng->txt("cont_series"));
         $tmp_tpl->setVariable("SERIES_TITLE", $this->lng->txt("cont_series_title"));
         $tmp_tpl->setVariable("SERIES_EDITOR", $this->lng->txt("cont_series_editor"));
         $tmp_tpl->setVariable("SERIES_VOLUME", $this->lng->txt("cont_series_volume"));
         $tmp_tpl->setVariable("YEAR", $this->lng->txt("cont_year"));
         $tmp_tpl->setVariable("ISBN", $this->lng->txt("cont_isbn"));
         $tmp_tpl->setVariable("URL", $this->lng->txt("cont_url"));
     } else {
         $this->ctrl->setParameterByClass("illmpresentationgui", "frame", "maincontent");
         $action = $this->ctrl->getLinkTargetByClass("illmpresentationgui", "layout");
         $params = array('mode' => "view_simple", 'action' => $action);
         $this->ctrl->clearParametersByClass("illmpresentationgui");
         if ($translations = $this->object->getTranslations()) {
             foreach ($translations as $tr_id) {
                 $tmp_obj = ilObjectFactory::getInstanceByRefId($tr_id);
                 $tmp_tpl->setCurrentBlock("TRANSLATION_ROW");
                 $tmp_tpl->setVariable("ROW_TITLE", $tmp_obj->getTitle());
                 $tmp_tpl->setVariable("ROW_ID", $tr_id);
                 $tmp_tpl->parseCurrentBlock();
                 unset($tmp_obj);
             }
             $tmp_tpl->setCurrentBlock("TRANSLATION");
             $tmp_tpl->setVariable("TRANSLATION_HEADER", $this->lng->txt("cont_translations"));
             $tmp_tpl->parseCurrentBlock();
         }
         $tmp_tpl->setVariable("DETAILS", $this->lng->txt("cont_details"));
         $tmp_tpl->setVariable("SHOW", $this->lng->txt("cont_show"));
         $tmp_tpl->setVariable("SHOW_CITATION", $this->lng->txt("cont_show_citation"));
         $tmp_tpl->setVariable("GO", $this->lng->txt("go"));
     }
     // SHOW MESSAGE
     if ($message) {
         ilUtil::sendInfo($message_text);
     }
     $xsl = $tmp_tpl->get();
     $xml = $this->object->bib_obj->getXML();
     if (empty($xml)) {
         return true;
     }
     $args = array('/_xml' => $xml, '/_xsl' => $xsl);
     $xh = xslt_create();
     $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
     $this->tpl->setVariable("PAGE_CONTENT", $output);
     return $output;
 }
 /**
  * Create resource entries for the learning module "PKG" and all SCOS and Assets
  */
 function writeResources()
 {
     include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php";
     $tree = new ilSCORM2004Tree($this->cont_obj->getId());
     //$tree = new ilTree($this->cont_obj->getId());
     //$tree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
     //$tree->setTreeTablePK("slm_id");
     foreach ($tree->getSubTree($tree->getNodeData($tree->root_id), true, array('sco', 'ass')) as $obj) {
         $attrs = array();
         $attrs["identifier"] = "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . "_ref";
         $attrs["type"] = "webcontent";
         if ($obj['type'] == "sco") {
             $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "sco";
         } else {
             $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "asset";
         }
         $attrs["href"] = "./" . $obj['obj_id'] . "/index.html";
         $this->writer->xmlStartTag("resource", $attrs, "");
         $this->writer->xmlElement("dependency", array("identifierref" => "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'ITSELF'), "");
         $this->writer->xmlElement("dependency", array("identifierref" => "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'OBJECTS'), "");
         $this->writer->xmlElement("dependency", array("identifierref" => "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'RESOURCES'), "");
         $this->writer->xmlElement("dependency", array("identifierref" => "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'FLAVOUR'), "");
         $this->writer->xmlEndTag("resource");
         $attrs = array();
         $attrs["identifier"] = "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'ITSELF';
         $attrs["type"] = "webcontent";
         $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "asset";
         $this->writer->xmlStartTag("resource", $attrs, "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/index.xml"), "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/ilias_co_3_7.dtd"), "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/index.html"), "");
         $this->writer->xmlEndTag("resource");
         $attrs = array();
         $attrs["identifier"] = "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'RESOURCES';
         $attrs["type"] = "webcontent";
         $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "asset";
         $this->writer->xmlStartTag("resource", $attrs, "");
         $this->writer->xmlEndTag("resource");
         $attrs = array();
         $attrs["identifier"] = "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'FLAVOUR';
         $attrs["type"] = "webcontent";
         $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "asset";
         $this->writer->xmlStartTag("resource", $attrs, "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/index.xml"), "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/sco.xsl"), "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/css/system.css"), "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/css/style.css"), "");
         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/js/scorm.js"), "");
         $this->writer->xmlEndTag("resource");
         $attrs = array();
         $attrs["identifier"] = "il_" . IL_INST_ID . "_" . $obj['type'] . "_" . $obj['obj_id'] . 'OBJECTS';
         $attrs["type"] = "webcontent";
         $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "asset";
         $this->writer->xmlStartTag("resource", $attrs, "");
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $active_css = ilObjStyleSheet::getContentStylePath($this->cont_obj->getStyleSheetId());
         $active_css = split(@'\\?', $active_css, 2);
         $css = fread(fopen($active_css[0], 'r'), filesize($active_css[0]));
         preg_match_all("/url\\(([^\\)]*)\\)/", $css, $css_files);
         $css_files = array_unique($css_files[1]);
         $currdir = getcwd();
         chdir(dirname($active_css[0]));
         foreach ($css_files as $fileref) {
             if (file_exists($fileref)) {
                 $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/images/" . basename($fileref)), "");
             }
         }
         chdir($currdir);
         include_once "./Modules/Scorm2004/classes/class.ilSCORM2004Tree.php";
         $pagetree = new ilSCORM2004Tree($this->cont_obj->getId());
         //$pagetree = new ilTree($this->cont_obj->getId());
         //$pagetree->setTableNames('sahs_sc13_tree', 'sahs_sc13_tree_node');
         //$pagetree->setTreeTablePK("slm_id");
         foreach ($pagetree->getSubTree($pagetree->getNodeData($obj['obj_id']), false, 'page') as $page) {
             $page_obj = new ilSCORM2004Page($page);
             $page_obj->buildDom();
             $mob_ids = $page_obj->collectMediaObjects(false);
             foreach ($mob_ids as $mob_id) {
                 if ($mob_id > 0 && ilObject::_exists($mob_id)) {
                     $media_obj = new ilObjMediaObject($mob_id);
                     $media_obj = $media_obj->getMediaItem("Standard");
                     if ($media_obj != null && $media_obj->getLocationType() == "LocalFile") {
                         $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/objects/il_" . IL_INST_ID . "_mob_" . $mob_id . "/" . rawurlencode($media_obj->getLocation())), "");
                     }
                 }
             }
             $file_ids = $page_obj->collectFileItems();
             foreach ($file_ids as $file_id) {
                 if (ilObject::_lookupType($file_id) == "file") {
                     $file_obj = new ilObjFile($file_id, false);
                     $this->writer->xmlElement("file", array("href" => "./" . $obj['obj_id'] . "/objects/il_" . IL_INST_ID . "_file_" . $file_id . "/" . rawurlencode($file_obj->filename)), "");
                 }
             }
             unset($page_obj);
         }
         $this->writer->xmlEndTag("resource");
     }
     if ($this->version == "2004") {
         $attrs = array();
         $attrs["identifier"] = "PKG";
         $attrs["type"] = "webcontent";
         $attrs[$this->version == "2004" ? "adlcp:scormType" : "adlcp:scormtype"] = "asset";
         $this->writer->xmlStartTag("resource", $attrs, "");
         $xsd_files = array('adlcp_v1p3.xsd', 'adlseq_v1p3.xsd', 'imsss_v1p0.xsd', 'adlnav_v1p3.xsd', 'adlnav_v1p3.xsd', 'imscp_v1p1.xsd', 'imsmanifest.xml', 'imsss_v1p0auxresource.xsd', 'imsss_v1p0control.xsd', 'imsss_v1p0delivery.xsd', 'imsss_v1p0limit.xsd', 'imsss_v1p0objective.xsd', 'imsss_v1p0random.xsd', 'imsss_v1p0rollup.xsd', 'imsss_v1p0seqrule.xsd', 'imsss_v1p0util.xsd', 'xml.xsd', 'index.html');
         foreach ($xsd_files as $xsd_file) {
             $attrs = array();
             $attrs["href"] = $xsd_file;
             $this->writer->xmlElement("file", $attrs, "");
         }
         $this->writer->xmlEndTag("resource");
     }
 }
Ejemplo n.º 26
0
 /**
  * execute command
  *
  * @global ilLocatorGUI $ilLocator
  * @global ilAccessHandler $ilAccess
  * @global ilNavigationHistory $ilNavigationHistory
  * @global ilTemplate $tpl
  * @global ilCtrl $ilCtrl
  * @global ilTabsGUI $ilTabs
  * @global ilLanguage $lng
  * @global ILIAS $ilias 
  */
 function executeCommand()
 {
     global $ilUser, $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr, $ilTabs, $lng, $ilDB, $ilPluginAdmin;
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"]) && !$ilAccess->checkAccess("visible", "", $_GET["ref_id"])) {
         global $ilias;
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         if ('qpl' == $this->object->getType()) {
             $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl");
         }
     }
     $cmd = $this->ctrl->getCmd("questions");
     $next_class = $this->ctrl->getNextClass($this);
     if (in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions') {
         $_GET['q_id'] = '';
     }
     $this->prepareOutput();
     $this->ctrl->setReturn($this, "questions");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
     $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
     if ($_GET["q_id"] < 1) {
         $q_type = $_POST["sel_question_types"] != "" ? $_POST["sel_question_types"] : $_GET["sel_question_types"];
     }
     if ($cmd != "createQuestion" && $cmd != "createQuestionForTest" && $next_class != "ilassquestionpagegui") {
         if ($_GET["test_ref_id"] != "" or $_GET["calling_test"]) {
             $ref_id = $_GET["test_ref_id"];
             if (!$ref_id) {
                 $ref_id = $_GET["calling_test"];
             }
         }
     }
     switch ($next_class) {
         case "ilcommonactiondispatchergui":
             include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case 'ilassquestionpreviewgui':
             $this->ctrl->saveParameter($this, "q_id");
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
             $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB);
             $gui->initQuestion((int) $_GET['q_id'], $this->object->getId());
             $gui->initPreviewSettings($this->object->getRefId());
             $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']);
             $gui->initHintTracking();
             $gui->initStyleSheets();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilassquestionpagegui":
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
             $q_gui->setQuestionTabs();
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $q_gui->setTargetGuiClass(null);
             $q_gui->setQuestionActionCmd(null);
             $question = $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
             $this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode("edit");
             $page_gui->setHeader($question->getTitle());
             $page_gui->setPresentationTitle($question->getTitle());
             $ret = $this->ctrl->forwardCommand($page_gui);
             $tpl->setContent($ret);
             break;
         case 'ilpermissiongui':
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui = new ilPermissionGUI($this);
             $ret = $this->ctrl->forwardCommand($perm_gui);
             break;
         case 'ilobjectcopygui':
             include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('qpl');
             $this->ctrl->forwardCommand($cp);
             break;
         case "ilquestionpoolexportgui":
             require_once 'Modules/TestQuestionPool/classes/class.ilQuestionPoolExportGUI.php';
             $exp_gui = new ilQuestionPoolExportGUI($this);
             $exp_gui->addFormat('zip', $this->lng->txt('qpl_export_xml'), $this, 'createExportQTI');
             $exp_gui->addFormat('xls', $this->lng->txt('qpl_export_excel'), $this, 'createExportExcel');
             $ret = $this->ctrl->forwardCommand($exp_gui);
             break;
         case "ilinfoscreengui":
             $this->infoScreenForward();
             break;
         case 'ilassquestionhintsgui':
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'illocalunitconfigurationgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             $this->ctrl->setReturn($this, 'questions');
             require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
             $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id']));
             $ilCtrl->forwardCommand($gui);
             break;
         case 'ilassquestionfeedbackeditinggui':
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             // forward to ilAssQuestionFeedbackGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'ilobjquestionpoolsettingsgeneralgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolSettingsGeneralGUI.php';
             $gui = new ilObjQuestionPoolSettingsGeneralGUI($ilCtrl, $ilAccess, $lng, $tpl, $ilTabs, $this);
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilobjtaxonomygui":
             require_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPoolTaxonomyEditingCommandForwarder.php';
             $forwarder = new ilObjQuestionPoolTaxonomyEditingCommandForwarder($this->object, $ilDB, $ilPluginAdmin, $ilCtrl, $ilTabs, $lng);
             $forwarder->forward();
             break;
         case 'ilquestionbrowsertablegui':
             $this->ctrl->forwardCommand($this->buildQuestionBrowserTableGUI($taxIds = array()));
             // no tax ids required
             break;
         case "ilobjquestionpoolgui":
         case "":
             if ($cmd == 'questions') {
                 $this->ctrl->setParameter($this, 'q_id', '');
             }
             $cmd .= "Object";
             $ret = $this->{$cmd}();
             break;
         default:
             $this->ctrl->setReturn($this, "questions");
             include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             if ($this->object->getType() == 'qpl') {
                 $q_gui->setTaxonomyIds($this->object->getTaxonomyIds());
                 $this->object->addQuestionChangeListeners($q_gui->object);
             }
             $q_gui->setQuestionTabs();
             global $ilHelp;
             $ilHelp->setScreenIdComponent("qpl");
             $ret = $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (!(strtolower($_GET["baseClass"]) == "iladministrationgui" || strtolower($_GET['baseClass']) == 'ilrepositorygui') && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
 /**
  * show media object
  */
 function media($a_mode = "media")
 {
     $this->tpl =& new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
     include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
     //$int_links = $page_object->getInternalLinks();
     $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
     // later
     //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
     $link_xlm = "";
     require_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
     $xml = "<dummy>";
     // todo: we get always the first alias now (problem if mob is used multiple
     // times in page)
     $xml .= $media_obj->getXML(IL_MODE_ALIAS);
     $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
     $xml .= $link_xml;
     $xml .= "</dummy>";
     $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
     $args = array('/_xml' => $xml, '/_xsl' => $xsl);
     $xh = xslt_create();
     if (!$this->offlineMode()) {
         $enlarge_path = ilUtil::getImagePath("enlarge.png", false, "output");
         $wb_path = ilUtil::getWebspaceDir("output") . "/";
     } else {
         $enlarge_path = "images/enlarge.png";
         $wb_path = "";
     }
     $mode = $a_mode;
     $this->ctrl->setParameter($this, "obj_type", "MediaObject");
     $fullscreen_link = $this->getLink($_GET["ref_id"], "fullscreen");
     $this->ctrl->clearParameters($this);
     $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path, 'link_params' => "ref_id=" . $_GET["ref_id"], 'fullscreen_link' => $fullscreen_link, 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
     $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
     echo xslt_error($xh);
     xslt_free($xh);
     // unmask user html
     $this->tpl->setVariable("MEDIA_CONTENT", $output);
     $this->tpl->parseCurrentBlock();
     if ($this->offlineMode()) {
         $html = $this->tpl->get();
         return $html;
     }
 }
 /**
  * show objectives
  *
  * @access public
  * @param object $tpl template object
  * @return
  */
 public function showObjectives($a_tpl, $a_is_order = false)
 {
     global $lng, $ilSetting;
     $this->clearAdminCommandsDetermination();
     // get embedded blocks
     $has_container_page = false;
     if (!$a_is_order) {
         $output_html = $this->getContainerGUI()->getContainerPageHTML();
         if ($output_html != "") {
             $has_container_page = true;
             $this->output_html .= $this->insertPageEmbeddedBlocks($output_html);
         }
         unset($output_html);
     }
     // All objectives
     include_once './Modules/Course/classes/class.ilCourseObjective.php';
     if (!count($objective_ids = ilCourseObjective::_getObjectiveIds($this->getContainerObject()->getId(), true))) {
         return false;
     }
     include_once './Modules/Course/classes/class.ilCourseObjectiveListGUI.php';
     $this->objective_list_gui = new ilCourseObjectiveListGUI();
     $this->objective_list_gui->setContainerObject($this->getContainerGUI());
     if ($ilSetting->get("icon_position_in_lists") == "item_rows") {
         $this->objective_list_gui->enableIcon(true);
     }
     $acc = null;
     if (!$a_is_order) {
         include_once "Services/Accordion/classes/class.ilAccordionGUI.php";
         $acc = new ilAccordionGUI();
         $acc->setUseSessionStorage(true);
         $acc->setAllowMultiOpened(true);
         $acc->setBehaviour(ilAccordionGUI::FIRST_OPEN);
         $acc->setId("crsobjtv_" . $this->container_obj->getId());
     } else {
         $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives'));
     }
     $lur_data = $this->parseLOUserResults();
     $has_initial = ilLOSettings::getInstanceByObjId($this->container_obj->getId())->worksWithInitialTest();
     $has_lo_page = false;
     $obj_cnt = 0;
     foreach ($objective_ids as $objective_id) {
         include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
         if ($has_initial && (!isset($lur_data[$objective_id]) or ilLOUtils::hasActiveRun($this->container_obj->getId(), ilLOSettings::getInstanceByObjId($this->container_obj->getId())->getInitialTest(), $objective_id))) {
             $lur_data[$objective_id] = array("type" => ilLOSettings::TYPE_TEST_INITIAL);
         }
         if ($html = $this->renderObjective($objective_id, $has_lo_page, $acc, $lur_data[$objective_id])) {
             $this->renderer->addItemToBlock('lobj', 'lobj', $objective_id, $html);
         }
         $obj_cnt++;
     }
     // buttons for showing/hiding all objectives
     if (!$a_is_order && $obj_cnt > 1) {
         $this->showButton("", $lng->txt("crs_show_all_obj"), "", "crs_show_all_obj_btn");
         $this->showButton("", $lng->txt("crs_hide_all_obj"), "", "crs_hide_all_obj_btn");
         $acc->setShowAllElement("crs_show_all_obj_btn");
         $acc->setHideAllElement("crs_hide_all_obj_btn");
     }
     if (!$has_container_page && $has_lo_page) {
         // add core co page css
         include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
         $GLOBALS["tpl"]->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
         $GLOBALS["tpl"]->setCurrentBlock("SyntaxStyle");
         $GLOBALS["tpl"]->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
         $GLOBALS["tpl"]->parseCurrentBlock();
     }
     // order/block
     if ($a_is_order) {
         $this->addFooterRow();
         $this->output_html .= $output_html . $this->renderer->getHTML();
         $this->renderer->resetDetails();
     } else {
         $this->output_html .= "<div class='ilCrsObjAcc'>" . $acc->getHTML() . "</div>";
     }
 }
Ejemplo n.º 29
0
 /**
  * execute command
  */
 function executeCommand()
 {
     global $ilAccess, $ilNavigationHistory, $ilCtrl, $ilErr, $tpl, $lng, $ilTabs, $ilPluginAdmin, $ilDB, $tree, $ilias, $ilUser;
     if (!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
     }
     $cmd = $this->ctrl->getCmd("infoScreen");
     $cmdsDisabledDueToOfflineStatus = array('resumePlayer', 'resumePlayer', 'outUserResultsOverview', 'outUserListOfAnswerPasses');
     if (!$this->getCreationMode() && !$this->object->isOnline() && in_array($cmd, $cmdsDisabledDueToOfflineStatus)) {
         $cmd = 'infoScreen';
     }
     $next_class = $this->ctrl->getNextClass($this);
     $this->ctrl->setReturn($this, "infoScreen");
     if (method_exists($this->object, "getTestStyleLocation")) {
         $this->tpl->addCss($this->object->getTestStyleLocation("output"), "screen");
     }
     // add entry to navigation history
     if (!$this->getCreationMode() && $ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $ilNavigationHistory->addItem($_GET["ref_id"], "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . $_GET["ref_id"], "tst");
     }
     if (!$this->getCreationMode()) {
         if (IS_PAYMENT_ENABLED) {
             require_once 'Services/Payment/classes/class.ilPaymentObject.php';
             if (ilPaymentObject::_requiresPurchaseToAccess($this->object->getRefId(), $type = isset($_GET['purchasetype']) ? $_GET['purchasetype'] : NULL)) {
                 $this->setLocator();
                 $this->tpl->getStandardTemplate();
                 include_once 'Services/Payment/classes/class.ilShopPurchaseGUI.php';
                 $pp = new ilShopPurchaseGUI((int) $_GET['ref_id']);
                 $ret = $this->ctrl->forwardCommand($pp);
                 $this->tpl->show();
                 exit;
             }
         }
     }
     // elba hack for storing question id for inserting new question after
     if ($_REQUEST['prev_qid']) {
         global $___prev_question_id;
         $___prev_question_id = $_REQUEST['prev_qid'];
         $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
     }
     if (!$this->getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken()) {
         if (!$this->isValidRequestOnBrokenQuestionSetDepencies($next_class, $cmd)) {
             $this->ctrl->redirectByClass('ilObjTestGUI', 'infoScreen');
         }
     }
     $this->determineObjectiveOrientedContainer();
     switch ($next_class) {
         case 'iltestexportgui':
             if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilTestExportGUI.php';
             $ilCtrl->forwardCommand(new ilTestExportGUI($this));
             break;
         case "ilinfoscreengui":
             $this->prepareOutput();
             $this->addHeaderAction();
             $this->infoScreen();
             // forwards command
             break;
         case 'ilmdeditorgui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
             $md_gui =& new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
             $md_gui->addObserver($this->object, 'MDUpdateListener', 'General');
             $this->ctrl->forwardCommand($md_gui);
             break;
         case "iltestplayerfixedquestionsetgui":
             require_once "./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $gui = new ilTestPlayerFixedQuestionSetGUI($this->object);
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $this->ctrl->forwardCommand($gui);
             break;
         case "iltestplayerrandomquestionsetgui":
             require_once "./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $gui = new ilTestPlayerRandomQuestionSetGUI($this->object);
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $this->ctrl->forwardCommand($gui);
             break;
         case "iltestplayerdynamicquestionsetgui":
             require_once "./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
             if (!$this->object->getKioskMode()) {
                 $this->prepareOutput();
             }
             $gui = new ilTestPlayerDynamicQuestionSetGUI($this->object);
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $this->ctrl->forwardCommand($gui);
             break;
         case "iltestevaluationgui":
             $this->forwardToEvaluationGUI();
             break;
         case "iltestevalobjectiveorientedgui":
             $this->forwardToEvalObjectiveOrientedGUI();
             break;
         case "iltestservicegui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once "./Modules/Test/classes/class.ilTestServiceGUI.php";
             $serviceGUI =& new ilTestServiceGUI($this->object);
             $this->ctrl->forwardCommand($serviceGUI);
             break;
         case 'ilpermissiongui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once "Services/AccessControl/classes/class.ilPermissionGUI.php";
             $perm_gui =& new ilPermissionGUI($this);
             $ret =& $this->ctrl->forwardCommand($perm_gui);
             break;
         case "illearningprogressgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
             $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId());
             $this->ctrl->forwardCommand($new_gui);
             break;
         case "ilcertificategui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once "./Services/Certificate/classes/class.ilCertificateGUI.php";
             require_once "./Modules/Test/classes/class.ilTestCertificateAdapter.php";
             $output_gui = new ilCertificateGUI(new ilTestCertificateAdapter($this->object));
             $this->ctrl->forwardCommand($output_gui);
             break;
         case "iltestscoringgui":
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once "./Modules/Test/classes/class.ilTestScoringGUI.php";
             $output_gui = new ilTestScoringGUI($this->object);
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilmarkschemagui':
             if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
                 ilUtil::sendInfo($this->lng->txt('cannot_edit_test'), true);
                 $this->ctrl->redirect($this, 'infoScreen');
             }
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilMarkSchemaGUI.php';
             $mark_schema_gui = new ilMarkSchemaGUI($this->object);
             $this->ctrl->forwardCommand($mark_schema_gui);
             break;
         case 'iltestscoringbyquestionsgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             include_once 'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
             $output_gui = new ilTestScoringByQuestionsGUI($this->object);
             $this->ctrl->forwardCommand($output_gui);
             break;
         case 'ilobjtestsettingsgeneralgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
             $gui = new ilObjTestSettingsGeneralGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjtestsettingsscoringresultsgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
             $gui = new ilObjTestSettingsScoringResultsGUI($this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjtestdynamicquestionsetconfiggui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
             $gui = new ilObjTestDynamicQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestrandomquestionsetconfiggui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
             $gui = new ilTestRandomQuestionSetConfigGUI($this->ctrl, $ilAccess, $ilTabs, $this->lng, $this->tpl, $ilDB, $tree, $ilPluginAdmin, $this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestquestionbrowsertablegui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php';
             $gui = new ilTestQuestionBrowserTableGUI($this->ctrl, $this->tpl, $ilTabs, $this->lng, $tree, $ilDB, $ilPluginAdmin, $this->object);
             $gui->setWriteAccess($ilAccess->checkAccess("write", "", $this->ref_id));
             $gui->init();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestskilladministrationgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php';
             $gui = new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng, $ilDB, $tree, $ilPluginAdmin, $this->object, $this->ref_id);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'iltestskillevaluationgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
             if ($this->object->isDynamicTest()) {
                 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
                 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
                 $dynamicQuestionSetConfig->loadFromDb();
                 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
                 $questionList->setParentObjId($dynamicQuestionSetConfig->getSourceQuestionPoolId());
                 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
             } else {
                 $questionList = new ilAssQuestionList($ilDB, $this->lng, $ilPluginAdmin);
                 $questionList->setParentObjId($this->object->getId());
                 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES);
             }
             $questionList->load();
             require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
             $testSessionFactory = new ilTestSessionFactory($this->object);
             $testSession = $testSessionFactory->getSession();
             $testResults = $this->object->getTestResult($testSession->getActiveId(), $testSession->getPass(), true);
             require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
             $gui = new ilTestSkillEvaluationGUI($this->ctrl, $ilTabs, $this->tpl, $this->lng, $ilDB, $this->object->getTestId(), $this->object->getRefId(), $this->object->getId());
             $gui->setObjectiveOrientedContainer($this->getObjectiveOrientedContainer());
             $gui->setQuestionList($questionList);
             $gui->setTestSession($testSession);
             $gui->setTestResults($testResults);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilobjectcopygui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once './Services/Object/classes/class.ilObjectCopyGUI.php';
             $cp = new ilObjectCopyGUI($this);
             $cp->setType('tst');
             $this->ctrl->forwardCommand($cp);
             break;
         case 'ilrepositorysearchgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             require_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
             $rep_search =& new ilRepositorySearchGUI();
             $rep_search->setCallback($this, 'addParticipantsObject', array());
             // Set tabs
             $this->ctrl->setReturn($this, 'participants');
             $ret =& $this->ctrl->forwardCommand($rep_search);
             $this->tabs_gui->setTabActive('participants');
             break;
         case 'ilpageeditorgui':
         case 'iltestexpresspageobjectgui':
             require_once 'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
             $incompleteQuestionPurger = new ilAssIncompleteQuestionPurger($ilDB);
             $incompleteQuestionPurger->setOwnerId($ilUser->getId());
             $incompleteQuestionPurger->purge();
             $qid = $_REQUEST['q_id'];
             // :FIXME: does not work
             // $this->ctrl->saveParameterByClass(array('iltestexpresspageobjectgui', 'assorderingquestiongui', 'ilpageeditorgui', 'ilpcquestion', 'ilpcquestiongui'), 'test_express_mode');
             if (!$qid || $qid == 'Array') {
                 $questions = $this->object->getQuestionTitlesAndIndexes();
                 if (!is_array($questions)) {
                     $questions = array();
                 }
                 $keys = array_keys($questions);
                 $qid = $keys[0];
                 $_REQUEST['q_id'] = $qid;
                 $_GET['q_id'] = $qid;
                 $_POST['q_id'] = $qid;
             }
             $this->prepareOutput();
             if (!in_array($cmd, array('addQuestion', 'browseForQuestions'))) {
                 $this->buildPageViewToolbar($qid);
             }
             if (!$qid || in_array($cmd, array('insertQuestions', 'browseForQuestions'))) {
                 require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
                 $pageObject = new ilTestExpressPageObjectGUI(0);
                 $pageObject->test_object = $this->object;
                 $ret =& $this->ctrl->forwardCommand($pageObject);
                 break;
             }
             require_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $qid);
             if (!$q_gui instanceof assQuestionGUI) {
                 $this->ctrl->setParameterByClass('iltestexpresspageobjectgui', 'q_id', '');
                 $this->ctrl->redirectByClass('iltestexpresspageobjectgui', $this->ctrl->getCmd());
             }
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question = $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             #$this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilTestExpressPageObjectGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
             require_once "./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
             $page_gui = new ilTestExpressPageObjectGUI($qid);
             $page_gui->test_object = $this->object;
             $page_gui->setEditPreview(true);
             $page_gui->setEnabledTabs(false);
             if (strlen($this->ctrl->getCmd()) == 0) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
             $page_gui->setHeader($question->getTitle());
             $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
             $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
             $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
             $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
             $ret =& $this->ctrl->forwardCommand($page_gui);
             global $ilTabs;
             $ilTabs->activateTab('assQuestions');
             $this->tpl->setContent($ret);
             break;
         case 'ilassquestionpreviewgui':
             $this->prepareOutput();
             $this->ctrl->saveParameter($this, "q_id");
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
             $gui = new ilAssQuestionPreviewGUI($this->ctrl, $this->tabs_gui, $this->tpl, $this->lng, $ilDB);
             $gui->initQuestion((int) $_GET['q_id'], $this->object->getId());
             $gui->initPreviewSettings($this->object->getRefId());
             $gui->initPreviewSession($ilUser->getId(), (int) $_GET['q_id']);
             $gui->initHintTracking();
             $gui->initStyleSheets();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionpagegui':
             require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
             //echo $_REQUEST['prev_qid'];
             if ($_REQUEST['prev_qid']) {
                 $this->ctrl->setParameter($this, 'prev_qid', $_REQUEST['prev_qid']);
             }
             $this->prepareOutput();
             //global $___test_express_mode;
             //$___test_express_mode = true;
             $_GET['calling_test'] = $this->object->getRefId();
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $this->tpl->setCurrentBlock("ContentStyle");
             $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
             $this->tpl->parseCurrentBlock();
             // syntax style
             $this->tpl->setCurrentBlock("SyntaxStyle");
             $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
             $this->tpl->parseCurrentBlock();
             require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
             $q_gui->setQuestionTabs();
             $q_gui->outAdditionalOutput();
             $q_gui->object->setObjId($this->object->getId());
             $question =& $q_gui->object;
             $this->ctrl->saveParameter($this, "q_id");
             $this->lng->loadLanguageModule("content");
             $this->ctrl->setReturnByClass("ilAssQuestionPageGUI", "view");
             $this->ctrl->setReturn($this, "questions");
             $page_gui = new ilAssQuestionPageGUI($_GET["q_id"]);
             $page_gui->setEditPreview(true);
             if (strlen($this->ctrl->getCmd()) == 0) {
                 $this->ctrl->setCmdClass(get_class($page_gui));
                 $this->ctrl->setCmd("preview");
             }
             $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
             $page_gui->setTemplateTargetVar("ADM_CONTENT");
             $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? "edit" : 'preview');
             $page_gui->setHeader($question->getTitle());
             $page_gui->setPresentationTitle($question->getTitle() . ' [' . $this->lng->txt('question_id_short') . ': ' . $question->getId() . ']');
             $ret =& $this->ctrl->forwardCommand($page_gui);
             $this->tpl->setContent($ret);
             break;
         case 'ilassspecfeedbackpagegui':
             require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
             $pg_gui = new ilAssSpecFeedbackPageGUI((int) $_GET["feedback_id"]);
             $this->ctrl->forwardCommand($pg_gui);
             break;
         case 'ilassgenfeedbackpagegui':
             require_once "./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
             $pg_gui = new ilAssGenFeedbackPageGUI((int) $_GET["feedback_id"]);
             $this->ctrl->forwardCommand($pg_gui);
             break;
         case 'illocalunitconfigurationgui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             require_once 'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
             require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
             $gui = new ilLocalUnitConfigurationGUI(new ilUnitConfigurationRepository((int) $_GET['q_id']));
             $this->ctrl->forwardCommand($gui);
             break;
         case "ilcommonactiondispatchergui":
             require_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
             $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilassquestionhintsgui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI =& assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionHintsGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
             $gui = new ilAssQuestionHintsGUI($questionGUI);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'ilassquestionfeedbackeditinggui':
             $this->prepareSubGuiOutput();
             // set return target
             $this->ctrl->setReturn($this, "questions");
             // set context tabs
             require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
             $questionGUI = assQuestionGUI::_getQuestionGUI('', $_GET['q_id']);
             $questionGUI->object->setObjId($this->object->getId());
             $questionGUI->setQuestionTabs();
             // forward to ilAssQuestionFeedbackGUI
             require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
             $gui = new ilAssQuestionFeedbackEditingGUI($questionGUI, $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng);
             $ilCtrl->forwardCommand($gui);
             break;
         case 'iltesttoplistgui':
             $this->prepareOutput();
             require_once './Modules/Test/classes/class.ilTestToplistGUI.php';
             $gui = new ilTestToplistGUI($this);
             $this->ctrl->forwardCommand($gui);
             break;
         case 'ilscoringadjustmentgui':
             $this->prepareOutput();
             require_once './Modules/Test/classes/class.ilScoringAdjustmentGUI.php';
             $gui = new ilScoringAdjustmentGUI($this->object);
             $this->ctrl->forwardCommand($gui);
             break;
         case '':
         case 'ilobjtestgui':
             $this->prepareOutput();
             $this->addHeaderAction();
             if (strcmp($cmd, "properties") == 0 && $_GET["browse"]) {
                 $this->questionBrowser();
                 return;
             }
             if (strcmp($cmd, "properties") == 0 && ($_GET["up"] || $_GET["down"])) {
                 $this->questionsObject();
                 return;
             }
             $cmd .= "Object";
             $ret =& $this->{$cmd}();
             break;
         default:
             // elba hack for storing question id for inserting new question after
             if ($_REQUEST['prev_qid']) {
                 global $___prev_question_id;
                 $___prev_question_id = $_REQUEST['prev_qid'];
                 $this->ctrl->setParameterByClass('ilassquestionpagegui', 'prev_qid', $_REQUEST['prev_qid']);
                 $this->ctrl->setParameterByClass($_GET['sel_question_types'] . 'gui', 'prev_qid', $_REQUEST['prev_qid']);
             }
             $this->create_question_mode = true;
             $this->prepareOutput();
             $this->ctrl->setReturn($this, "questions");
             require_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
             $q_gui =& assQuestionGUI::_getQuestionGUI($_GET['sel_question_types'], $_GET["q_id"]);
             $q_gui->object->setObjId($this->object->getId());
             if (!$_GET['sel_question_types']) {
                 $qType = assQuestion::getQuestionTypeFromDb($_GET['q_id']);
             } else {
                 $qType = $_GET['sel_question_types'];
             }
             $this->ctrl->setParameterByClass($qType . "GUI", 'prev_qid', $_REQUEST['prev_qid']);
             $this->ctrl->setParameterByClass($qType . "GUI", 'test_ref_id', $_REQUEST['ref_id']);
             $this->ctrl->setParameterByClass($qType . "GUI", 'q_id', $_REQUEST['q_id']);
             if ($_REQUEST['test_express_mode']) {
                 $this->ctrl->setParameterByClass($qType . "GUI", 'test_express_mode', 1);
             }
             #global $___test_express_mode;
             #$___test_express_mode = true;
             if (!$q_gui->isSaveCommand()) {
                 $_GET['calling_test'] = $this->object->getRefId();
             }
             $q_gui->setQuestionTabs();
             #unset($___test_express_mode);
             $ret =& $this->ctrl->forwardCommand($q_gui);
             break;
     }
     if (!in_array(strtolower($_GET["baseClass"]), array('iladministrationgui', 'ilrepositorygui')) && $this->getCreationMode() != true) {
         $this->tpl->show();
     }
 }
 /**
  * deletion confirmation screen
  */
 function confirmDefinitionDeletion()
 {
     global $ilTabs;
     $this->getTemplate();
     $this->displayLocator();
     $this->setTabs();
     $ilTabs->activateTab("definitions");
     // content style
     $this->tpl->setCurrentBlock("ContentStyle");
     $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId()));
     $this->tpl->parseCurrentBlock();
     // syntax style
     $this->tpl->setCurrentBlock("SyntaxStyle");
     $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath());
     $this->tpl->parseCurrentBlock();
     $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm());
     $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png"));
     $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true);
     ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
     $this->tpl->setVariable("TXT_TERM", $this->term->getTerm());
     $definition =& new ilGlossaryDefinition($_GET["def"]);
     //$page =& new ilPageObject("gdf", $definition->getId());
     $page_gui =& new ilPageObjectGUI("gdf", $definition->getId());
     $page_gui->setTemplateOutput(false);
     $page_gui->setStyleId($this->glossary->getStyleSheetId());
     $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
     $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
     $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&amp;ref_id=" . $_GET["ref_id"]);
     $output = $page_gui->preview();
     $this->tpl->setCurrentBlock("definition");
     $this->tpl->setVariable("PAGE_CONTENT", $output);
     $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
     $this->tpl->setVariable("LINK_CANCEL", $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion"));
     $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm"));
     $this->ctrl->setParameter($this, "def", $definition->getId());
     $this->tpl->setVariable("LINK_CONFIRM", $this->ctrl->getLinkTarget($this, "deleteDefinition"));
     $this->tpl->parseCurrentBlock();
 }