/** * Constructor * @access public */ public function __construct(ilObjForumGUI $gui, ilForumTopic $topic, ilForumProperties $properties) { global $tpl, $ilCtrl; $this->gui = $gui; $this->topic = $topic; $this->properties = $properties; $this->tpl = new ilTemplate('tpl.frm_tree.html', true, true, 'Modules/Forum'); ilYuiUtil::initConnection(); $tpl->addJavaScript(ilYuiUtil::getLocalPath() . '/yahoo/yahoo-min.js'); $tpl->addJavaScript(ilYuiUtil::getLocalPath() . '/event/event-min.js'); $tpl->addJavaScript('./Modules/Forum/js/treeview.js'); $tpl->addJavaScript('./Modules/Forum/js/treeview_extensions.js'); $tpl->addCss('./Modules/Forum/css/forum_tree.css'); // Set ref_id for urls $ilCtrl->setParameter($this->gui, 'thr_pk', $this->topic->getId()); $ilCtrl->setParameter($this->gui, 'backurl', null); // Set urls for async commands $this->tpl->setVariable('THR_TREE_STATE_URL', $ilCtrl->getLinkTarget($this->gui, 'setTreeStateAsynch', '', true, false)); $this->tpl->setVariable('THR_TREE_FETCH_CHILDREN_URL', $ilCtrl->getLinkTarget($this->gui, 'fetchTreeChildrenAsync', '', true, false)); // Fetch root id of the thread node $this->root_id = $this->topic->getFirstPostNode()->getId(); if (!is_array($_SESSION['frm'][$this->topic->getId()]['openTreeNodes'])) { $_SESSION['frm'][(int) $this->topic->getId()]['openTreeNodes'] = array(0); } // Prevent key gaps shuffle($_SESSION['frm'][(int) $this->topic->getId()]['openTreeNodes']); }
/** * @param ilObjectGUI $a_parent_obj * @param string $a_parent_cmd */ public function __construct(ilObjectGUI $a_parent_obj, $a_parent_cmd) { /** * @var $ilCtrl ilCtrl */ global $ilCtrl; $this->ctrl = $ilCtrl; // Call this immediately in constructor $this->setId('tos_agreement_by_lng'); $this->setDefaultOrderDirection('ASC'); $this->setDefaultOrderField('language'); $this->setExternalSorting(false); $this->setExternalSegmentation(false); parent::__construct($a_parent_obj, $a_parent_cmd); $this->setTitle($this->lng->txt('tos_agreement_by_lng')); $this->addColumn($this->lng->txt('language'), 'language'); $this->addColumn($this->lng->txt('tos_agreement'), 'agreement'); $this->addColumn($this->lng->txt('tos_agreement_document'), 'agreement_document'); $this->optionalColumns = (array) $this->getSelectableColumns(); $this->visibleOptionalColumns = (array) $this->getSelectedColumns(); foreach ($this->visibleOptionalColumns as $column) { $this->addColumn($this->optionalColumns[$column]['txt'], $column); } $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'applyAgreementByLanguageFilter')); $this->setRowTemplate('tpl.tos_agreement_by_lng_table_row.html', 'Services/TermsOfService'); $this->setShowRowsSelector(true); require_once 'Services/jQuery/classes/class.iljQueryUtil.php'; require_once 'Services/YUI/classes/class.ilYuiUtil.php'; iljQueryUtil::initjQuery(); ilYuiUtil::initPanel(); ilYuiUtil::initOverlay(); $this->initFilter(); $this->setFilterCommand('applyAgreementByLanguageFilter'); $this->setResetCommand('resetAgreementByLanguageFilter'); }
public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0) { global $lng, $ilCtrl, $tpl; parent::__construct($a_id, $a_id_type, $a_parent_node_id); $lng->loadLanguageModule("dcl"); if (isset($_REQUEST['table_id'])) { $this->table_id = $_REQUEST['table_id']; } elseif ($a_id > 0) { $this->table_id = $this->object->getMainTableId(); } /** * @var ilCtrl $ilCtrl */ if (!$ilCtrl->isAsynch()) { ilYuiUtil::initConnection(); ilOverlayGUI::initJavascript(); $tpl->addJavaScript('Modules/DataCollection/js/ilDataCollection.js'); $tpl->addJavaScript("Modules/DataCollection/js/datacollection.js"); $this->tpl->addOnLoadCode("ilDataCollection.setEditUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'edit', '', true) . "');"); $this->tpl->addOnLoadCode("ilDataCollection.setCreateUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'create', '', true) . "');"); $this->tpl->addOnLoadCode("ilDataCollection.setSaveUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'save', '', true) . "');"); $this->tpl->addOnLoadCode("ilDataCollection.setDataUrl('" . $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjdatacollectiongui', 'ildatacollectionrecordeditgui'), 'getRecordData', '', true) . "');"); } $ilCtrl->saveParameter($this, "table_id"); }
/** * Constructor * * @param */ function ilBlockGUI() { global $ilUser, $tpl, $ilCtrl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnection(); $tpl->addJavaScript("./Services/Block/js/ilblockcallback.js"); $this->setLimit($ilUser->getPref("hits_per_page")); }
/** * execute command */ function executeCommand() { global $ilDB, $lng, $ilPluginAdmin, $ilTabs, $tree; $ilTabs->clearTargets(); $this->ctrl->saveParameter($this, "sequence"); $this->ctrl->saveParameter($this, "active_id"); $this->initAssessmentSettings(); require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php'; $this->dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object); $this->dynamicQuestionSetConfig->loadFromDb(); $testSessionFactory = new ilTestSessionFactory($this->object); $this->testSession = $testSessionFactory->getSession($_GET['active_id']); $this->ensureExistingTestSession($this->testSession); $this->initProcessLocker($this->testSession->getActiveId()); $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object); $this->testSequence = $testSequenceFactory->getSequenceByTestSession($this->testSession); $this->testSequence->loadFromDb(); include_once 'Services/jQuery/classes/class.iljQueryUtil.php'; iljQueryUtil::initjQuery(); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnectionWithAnimation(); if ($this->object->getKioskMode()) { include_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php'; ilOverlayGUI::initJavascript(); } $this->handlePasswordProtectionRedirect(); $cmd = $this->ctrl->getCmd(); $nextClass = $this->ctrl->getNextClass($this); switch ($nextClass) { case 'ilassquestionpagegui': $questionId = $this->testSequence->getQuestionForSequence($this->calculateSequence()); require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php"; $page_gui = new ilAssQuestionPageGUI($questionId); $ret = $this->ctrl->forwardCommand($page_gui); break; case 'ilassquestionhintrequestgui': $questionGUI = $this->object->createQuestionGUI("", $this->testSequenceFactory->getSequenceByTestSession()->getQuestionForSequence($this->calculateSequence())); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php'; $gui = new ilAssQuestionHintRequestGUI($this, self::CMD_SHOW_QUESTION, $this->testSession, $questionGUI); $this->ctrl->forwardCommand($gui); break; case 'ildynamicquestionsetstatistictablegui': $this->ctrl->forwardCommand($this->buildQuestionSetFilteredStatisticTableGUI()); break; case 'iltestpasswordprotectiongui': require_once 'Modules/Test/classes/class.ilTestPasswordProtectionGUI.php'; $gui = new ilTestPasswordProtectionGUI($this->ctrl, $this->tpl, $this->lng, $this, $this->passwordChecker); $ret = $this->ctrl->forwardCommand($gui); break; default: $cmd .= 'Cmd'; $ret =& $this->{$cmd}(); break; } return $ret; }
/** * @return string */ public function getHTML() { ilYuiUtil::initJson(); $chatSetting = new ilSetting('chatroom'); if ($this->getCurrentDetailLevel() == 0 || !$chatSetting->get('chat_enabled', 0) || !(bool) @ilChatroomServerConnector::checkServerConnection()) { return ''; } else { return parent::getHTML(); } }
protected function initOverlay() { include_once 'Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initOverlay(); $this->tpl->addCss('Modules/TestQuestionPool/templates/default/lac_legend.css'); //$this->setAnchor('fixed_content', 'tr', 'tr'); // we use css instead, does not hoppel over screen for initially visible overlays //$this->setTrigger('lac_legend_toggle_btn', 'click'); // is done by own listener that also changes the toggle label $this->setVisible($this->isInitialVisibilityEnabled()); $this->setAutoHide(false); $this->add(); }
/** * Constructor * * @param */ function __construct() { global $lng, $tpl; $this->maxdepth = -1; $this->multi_commands = array(); $this->commands = array(); $this->drag_target[] = array(); $this->drag_content[] = array(); $lng->loadLanguageModule("form"); $this->setCheckboxName("cbox"); parent::ilFormGUI(); $this->help_items = array(); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDragDrop(); $tpl->addJavascript("./Services/Form/js/ServiceFormHierarchyForm.js"); }
/** * execute command */ function executeCommand() { global $ilDB, $lng, $ilPluginAdmin, $ilTabs, $tree; $ilTabs->clearTargets(); $this->ctrl->saveParameter($this, "sequence"); $this->ctrl->saveParameter($this, "active_id"); require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php'; $this->dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object); $this->dynamicQuestionSetConfig->loadFromDb(); $testSessionFactory = new ilTestSessionFactory($this->object); $this->testSession = $testSessionFactory->getSession($_GET['active_id']); $testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object); $this->testSequence = $testSequenceFactory->getSequence($this->testSession); $this->testSequence->loadFromDb(); include_once 'Services/jQuery/classes/class.iljQueryUtil.php'; iljQueryUtil::initjQuery(); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnectionWithAnimation(); if ($this->object->getKioskMode()) { include_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php'; ilOverlayGUI::initJavascript(); } $cmd = $this->ctrl->getCmd(); $nextClass = $this->ctrl->getNextClass($this); switch ($nextClass) { case 'ilassquestionhintrequestgui': $questionGUI = $this->object->createQuestionGUI("", $this->testSequenceFactory->getSequence()->getQuestionForSequence($this->calculateSequence())); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php'; $gui = new ilAssQuestionHintRequestGUI($this, $this->testSession, $questionGUI); $this->ctrl->forwardCommand($gui); break; case 'ilfilteredquestionstablegui': $this->ctrl->forwardCommand($this->buildFilteredQuestionsTableGUI()); break; default: $cmd .= 'Cmd'; $ret =& $this->{$cmd}(); break; } return $ret; }
/** * execute command */ function executeCommand() { global $ilUser; $cmd = $this->ctrl->getCmd(); $next_class = $this->ctrl->getNextClass($this); $this->ctrl->saveParameter($this, "sequence"); $this->ctrl->saveParameter($this, "active_id"); if (preg_match("/^gotoquestion_(\\d+)\$/", $cmd, $matches)) { $cmd = "gotoquestion"; if (strlen($matches[1])) { $this->ctrl->setParameter($this, 'gotosequence', $matches[1]); } } if ($_GET["active_id"]) { $this->object->setTestSession($_GET["active_id"]); } else { $this->object->setTestSession(); } include_once 'Services/jQuery/classes/class.iljQueryUtil.php'; iljQueryUtil::initjQuery(); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnectionWithAnimation(); $cmd = $this->getCommand($cmd); switch ($next_class) { case 'ilassquestionhintrequestgui': $questionGUI = $this->object->createQuestionGUI("", $this->object->getTestSequence()->getQuestionForSequence($this->calculateSequence())); require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php'; $gui = new ilAssQuestionHintRequestGUI($this, $this->object->getTestSession(), $questionGUI); $ret = $this->ctrl->forwardCommand($gui); break; default: $ret =& $this->{$cmd}(); break; } return $ret; }
/** * @return string */ public function getHtml() { /** * @var $lng ilLanguage * @var $tpl ilTemplate */ global $lng, $tpl; if ($this->getSessionReminder()->isActive()) { require_once 'Services/jQuery/classes/class.iljQueryUtil.php'; iljQueryUtil::initjQuery(); require_once 'Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initCookie(); $tpl->addJavaScript('./Services/Authentication/js/session_reminder.js'); $reminder_tpl = new ilTemplate('tpl.session_reminder.html', true, true, 'Services/Authentication'); $reminder_tpl->setVariable('DEBUG', defined('DEVMODE') && DEVMODE ? 1 : 0); $reminder_tpl->setVariable('CLIENT_ID', CLIENT_ID); $reminder_tpl->setVariable('SESSION_NAME', session_name()); $reminder_tpl->setVariable('FREQUENCY', 60); $reminder_tpl->setVariable('SESSION_ID', session_id()); $reminder_tpl->setVariable('URL', './sessioncheck.php?client_id=' . CLIENT_ID . '&lang=' . $lng->getLangKey()); return $reminder_tpl->get(); } return ''; }
/** * Insert property html */ function insert(&$a_tpl) { global $lng; $template = new ilTemplate("tpl.prop_flashfile.html", true, true, "Services/Form"); if ($this->getApplet() != "") { $this->outputSuffixes($template); if (count($this->getParameters())) { $index = 0; $params = array(); foreach ($this->getParameters() as $name => $value) { array_push($params, urlencode($name) . "=" . urlencode($value)); $template->setCurrentBlock("applet_param_input"); $template->setVariable("TEXT_NAME", $lng->txt("name")); $template->setVariable("TEXT_VALUE", $lng->txt("value")); $template->setVariable("PARAM_INDEX", $index); $template->setVariable("POST_VAR_P", $this->getPostVar()); $template->setVariable("VALUE_NAME", "value=\"" . ilUtil::prepareFormOutput($name) . "\""); $template->setVariable("VALUE_VALUE", "value=\"" . ilUtil::prepareFormOutput($value) . "\""); $template->setVariable("TEXT_DELETE_PARAM", $lng->txt("delete_parameter")); $template->parseCurrentBlock(); $index++; } $template->setCurrentBlock("applet_parameter"); $template->setVariable("PARAM_VALUE", join($params, "&")); $template->parseCurrentBlock(); $template->setCurrentBlock("flash_vars"); $template->setVariable("PARAM_VALUE", join($params, "&")); $template->parseCurrentBlock(); } $template->setCurrentBlock("applet"); $template->setVariable("TEXT_ADD_PARAM", $lng->txt("add_parameter")); $template->setVariable("APPLET_WIDTH", $this->getWidth()); $template->setVariable("APPLET_HEIGHT", $this->getHeight()); $template->setVariable("POST_VAR_D", $this->getPostVar()); $template->setVariable("FILENAME", $this->getApplet()); $template->setVariable("TEXT_WIDTH", $lng->txt("width")); $template->setVariable("TEXT_HEIGHT", $lng->txt("height")); $template->setVariable("APPLET_FILE", $this->getApplet()); $template->setVariable("APPLET_PATH", $this->getAppletPathWeb() . $this->getApplet()); if ($this->getWidth()) { $template->setVariable("VALUE_WIDTH", "value=\"" . $this->getWidth() . "\""); } if ($this->getHeight()) { $template->setVariable("VALUE_HEIGHT", "value=\"" . $this->getHeight() . "\""); } $template->setVariable("ID", $this->getFieldId()); $template->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file")); $template->parseCurrentBlock(); } $js_tpl = new ilTemplate('tpl.flashAddParam.js', true, true, 'Services/Form'); $js_tpl->setVariable("TEXT_NAME", $lng->txt("name")); $js_tpl->setVariable("TEXT_VALUE", $lng->txt("value")); $js_tpl->setVariable("POST_VAR", $this->getPostVar()); $js_tpl->setVariable("TEXT_DELETE_PARAM", $lng->txt("delete_parameter")); $js_tpl->setVariable("TEXT_CONFIRM_DELETE_PARAMETER", $lng->txt("confirm_delete_parameter")); $template->setVariable("POST_VAR", $this->getPostVar()); $template->setVariable("ID", $this->getFieldId()); $template->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString()); $template->setVariable("JAVASCRIPT_FLASH", $js_tpl->get()); $a_tpl->setCurrentBlock("prop_generic"); $a_tpl->setVariable("PROP_GENERIC", $template->get()); $a_tpl->parseCurrentBlock(); global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnectionWithAnimation(); }
/** * Get initialisation HTML to use interna link editing */ function getInitHTML($a_url) { global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initPanel(false); ilYuiUtil::initConnection(); ilYuiUtil::initDragDrop(); $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js"); $tpl->addJavascript("./Services/Link/js/ilIntLink.js"); $ltpl = new ilTemplate("tpl.int_link_panel.html", true, true, "Services/Link"); $ltpl->setVariable("IL_INT_LINK_URL", $a_url); return $ltpl->get(); }
function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE, $show_feedback = FALSE) { // generate the question output $template = new ilTemplate("tpl.il_as_qpl_orderinghorizontal_output.html", TRUE, TRUE, "Modules/TestQuestionPool"); $elements = $this->object->getRandomOrderingElements(); if ($active_id) { $solutions = NULL; include_once "./Modules/Test/classes/class.ilObjTest.php"; if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) { if (is_null($pass)) { $pass = ilObjTest::_getPass($active_id); } } $solutions =& $this->object->getSolutionValues($active_id, $pass); if (count($solutions) == 1) { $elements = split("{::}", $solutions[0]["value1"]); } } if (strlen($_SESSION['qst_selection'])) { $this->object->moveRight($_SESSION['qst_selection'], $active_id, $pass); unset($_SESSION['qst_selection']); $solutions =& $this->object->getSolutionValues($active_id, $pass); if (count($solutions) == 1) { $elements = split("{::}", $solutions[0]["value1"]); } } if (count($solutions) == 0) { $_SESSION['qst_ordering_horizontal_elements'] = $elements; } else { unset($_SESSION['qst_ordering_horizontal_elements']); } $idx = 0; foreach ($elements as $id => $element) { $template->setCurrentBlock("element"); $template->setVariable("ELEMENT_ID", "e_" . $this->object->getId() . "_{$id}"); $template->setVariable("ELEMENT_VALUE", ilUtil::prepareFormOutput($element)); $this->ctrl->setParameterByClass('iltestoutputgui', 'qst_selection', $idx); $idx++; $url = $this->ctrl->getLinkTargetByClass('iltestoutputgui', 'gotoQuestion'); $template->setVariable("MOVE_RIGHT", $url); $template->setVariable("TEXT_MOVE_RIGHT", $this->lng->txt('move_right')); $template->setVariable("RIGHT_IMAGE", ilUtil::getImagePath('nav_arr_R.png')); $template->parseCurrentBlock(); } if ($this->object->textsize >= 10) { echo $template->setVariable("STYLE", " style=\"font-size: " . $this->object->textsize . "%;\""); } $template->setVariable("VALUE_ORDERRESULT", ' value="' . join($elements, '{::}') . '"'); $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE)); $questionoutput = $template->get(); if (!$show_question_only) { // get page object output $questionoutput = $this->getILIASPage($questionoutput); } include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDragDropAnimation(); $this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/orderinghorizontal.js"); $questionoutput = $template->get(); $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput); return $pageoutput; }
/** * Add javascript files that are necessary to run accordion */ static function addJavaScript() { global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initEvent(); ilYuiUtil::initDom(); ilYuiUtil::initAnimation(); ilYuiUtil::initConnection(); $tpl->addJavaScript("./Services/Accordion/js/accordion.js", true, 3); }
/** * Export support scripts * * @param * @return */ function exportSupportScripts() { // export flv/mp3 player //copy(ilPlayerUtil::getFlashVideoPlayerFilename(true), // $this->js_dir."/".ilPlayerUtil::getFlashVideoPlayerFilename()); //copy("./Services/MediaObjects/flash_mp3_player/mp3player.swf", // $this->mp3_dir."/mp3player.swf"); // basic js copy('./Services/JavaScript/js/Basic.js', $this->js_dir . '/Basic.js'); copy('./Services/UIComponent/Overlay/js/ilOverlay.js', $this->js_dir . '/ilOverlay.js'); // jquery include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; copy(iljQueryUtil::getLocaljQueryPath(), $this->js_dir . '/jquery.js'); copy(iljQueryUtil::getLocaljQueryUIPath(), $this->js_dir . '/jquery-ui-min.js'); copy(iljQueryUtil::getLocalMaphilightPath(), $this->js_dir . '/maphilight.js'); // yui stuff we use include_once "./Services/YUI/classes/class.ilYuiUtil.php"; copy(ilYuiUtil::getLocalPath('yahoo/yahoo-min.js'), $this->js_yahoo_dir . '/yahoo-min.js'); copy(ilYuiUtil::getLocalPath('yahoo-dom-event/yahoo-dom-event.js'), $this->js_yahoo_dir . '/yahoo-dom-event.js'); copy(ilYuiUtil::getLocalPath('animation/animation-min.js'), $this->js_yahoo_dir . '/animation-min.js'); copy(ilYuiUtil::getLocalPath('container/container-min.js'), $this->js_yahoo_dir . '/container-min.js'); copy(ilYuiUtil::getLocalPath('container/assets/skins/sam/container.css'), $this->css_dir . '/container.css'); // accordion copy('./Services/Accordion/js/accordion.js', $this->js_dir . '/accordion.js'); copy('./Services/Accordion/css/accordion.css', $this->css_dir . '/accordion.css'); // page presentation js copy('./Services/COPage/js/ilCOPagePres.js', $this->js_dir . '/ilCOPagePres.js'); // tooltip copy('./Services/UIComponent/Tooltip/js/ilTooltip.js', $this->js_dir . '/ilTooltip.js'); // mediaelement.js include_once "./Services/MediaObjects/classes/class.ilPlayerUtil.php"; ilPlayerUtil::copyPlayerFilesToTargetDirectory($this->flv_dir); // copy(ilPlayerUtil::getLocalMediaElementCssPath(), // $this->css_dir.'/mediaelementplayer.css'); // copy(ilPlayerUtil::getLocalMediaElementJsPath(), // $this->js_dir.'/mediaelement-and-player.js'); }
/** * Insert property html * * @return int Size */ public function insert($a_tpl) { $tpl = new ilTemplate("tpl.prop_selectbuilder.html", true, true, "Services/Form"); $i = 0; foreach ($this->values as $value) { if (!is_string($value)) { continue; } if (strlen((string) $value)) { $tpl->setCurrentBlock("prop_text_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput((string) $value)); $tpl->parseCurrentBlock(); } if ($this->getAllowMove()) { $tpl->setCurrentBlock("move"); $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ID", $this->getFieldId() . "[{$i}]"); $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png')); $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png')); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock("row"); $class = $i % 2 == 0 ? "even" : "odd"; if ($i == 0) { $class .= " first"; } if ($i == count($this->values) - 1) { $class .= " last"; } $tpl->setVariable("ROW_CLASS", $class); $tpl->setVariable("POST_VAR", $this->getPostVar() . "[{$i}]"); $tpl->setVariable('POST_VAR_OPEN', $this->getPostVar() . '[open]' . '[' . $i . ']'); if ($this->isOpenAnswerIndex($i)) { $tpl->setVariable('PROP_OPEN_CHECKED', 'checked="checked"'); } if ($this->getDisabled()) { $tpl->setVariable('PROP_OPEN_DISABLED', 'disabled="disabled"'); } $tpl->setVariable("ID", $this->getFieldId() . "[{$i}]"); $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("SIZE", $this->getSize()); $tpl->setVariable("MAXLENGTH", $this->getMaxLength()); if ($this->getDisabled()) { $tpl->setVariable("DISABLED", " disabled=\"disabled\""); } $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->parseCurrentBlock(); $i++; } $tpl->setVariable("ELEMENT_ID", $this->getFieldId()); $a_tpl->setCurrentBlock("prop_generic"); $a_tpl->setVariable("PROP_GENERIC", $tpl->get()); $a_tpl->parseCurrentBlock(); global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); $tpl->addJavascript("./Services/Form/templates/default/textwizard.js"); }
public function debugGUI() { global $lng; $lng->loadLanguageModule("scormdebug"); /* if ($_POST['password'] == $this->slm->getDebugPw()) { $_SESSION["debug_pw"] = $this->slm->getDebugPw(); } if ($_SESSION["debug_pw"]!=$this->slm->getDebugPw()) { $this->tpl = new ilTemplate("tpl.scorm2004.debug_pw.html", false, false, "./Modules/Scorm2004"); $this->tpl->setVariable('SUBMIT', $lng->txt("debugwindow_submit")); $this->tpl->setVariable('CANCEL', $lng->txt("debugwindow_cancel")); $this->tpl->setVariable('PASSWORD_ENTER', $lng->txt("debugwindow_password_enter")); $this->tpl->setVariable('DEBUG_URL','ilias.php?baseClass=ilSAHSPresentationGUI' .'&cmd=debugGUI&ref_id='.$_GET["ref_id"]); } else {*/ $this->tpl = new ilTemplate("tpl.scorm2004.debug.html", false, false, "./Modules/Scorm2004"); $this->tpl->setVariable('CONSOLE', $lng->txt("debugwindow_console")); $this->tpl->setVariable('LOGS', $lng->txt("debugwindow_logs")); $this->tpl->setVariable('COMMENT', $lng->txt("debugwindow_comment")); $this->tpl->setVariable('COMMENT_ENTER', $lng->txt("debugwindow_comment_enter")); $this->tpl->setVariable('START_RECORDING', $lng->txt("debugwindow_start_recording")); $this->tpl->setVariable('STOP_RECORDING', $lng->txt("debugwindow_stop_recording")); $this->tpl->setVariable('DELETE_LOGFILE', $lng->txt("debugwindow_delete_logfile")); $this->tpl->setVariable('SUBMISSION_FAILED', $lng->txt("debugwindow_submission_failed")); $this->tpl->setVariable('SUBMIT', $lng->txt("debugwindow_submit")); $this->tpl->setVariable('CANCEL', $lng->txt("debugwindow_cancel")); $this->tpl->setVariable('FILENAME', $lng->txt("debugwindow_filename")); $this->tpl->setVariable('DATE', $lng->txt("debugwindow_date")); $this->tpl->setVariable('ACTION', $lng->txt("debugwindow_action")); $this->tpl->setVariable('RECORD_IMG', ilUtil::getImagePath("record.png", "./Modules/Scorm2004")); $this->tpl->setVariable('STOP_IMG', ilUtil::getImagePath("stop.png", "./Modules/Scorm2004")); $this->tpl->setVariable('COMMENT_IMG', ilUtil::getImagePath("comment.png", "./Modules/Scorm2004")); $logfile = $this->logFileName() . ".html"; $this->tpl->setVariable('LOGFILE', $this->logFileName() . ".html"); $this->tpl->setVariable('FILES_DATA', json_encode($this->getLogFileList($lng->txt("debugwindow_delete"), $lng->txt("debugwindow_download"), $lng->txt("debugwindow_open")))); // path to latest yui distribution include_once "Services/YUI/classes/class.ilYuiUtil.php"; $this->tpl->setVariable('PATH_YUI', ilYuiUtil::getLocalPath()); //} echo $this->tpl->get("DEFAULT", true); }
/** * fill data section * * @access protected * */ protected function show() { global $lng, $ilUser; // config $raster = 15; if ($this->user_settings->getDayStart()) { // push starting point to last "slot" of hour BEFORE morning aggregation $morning_aggr = ($this->user_settings->getDayStart() - 1) * 60 + (60 - $raster); } else { $morning_aggr = 0; } $evening_aggr = $this->user_settings->getDayEnd() * 60; $this->tpl = new ilTemplate('tpl.day_view.html', true, true, 'Services/Calendar'); include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDragDrop(); ilYuiUtil::initPanel(); if (isset($_GET["bkid"])) { $user_id = $_GET["bkid"]; $no_add = true; } elseif ($ilUser->getId() == ANONYMOUS_USER_ID) { $user_id = $ilUser->getId(); $no_add = true; } else { $user_id = $ilUser->getId(); $no_add = false; } include_once 'Services/Calendar/classes/class.ilCalendarSchedule.php'; $this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_DAY, $user_id); $this->scheduler->addSubitemCalendars(true); $this->scheduler->calculate(); $daily_apps = $this->scheduler->getByDay($this->seed, $this->timezone); $hours = $this->parseInfoIntoRaster($daily_apps, $morning_aggr, $evening_aggr, $raster); $colspan = $this->calculateColspan($hours); $navigation = new ilCalendarHeaderNavigationGUI($this, $this->seed, ilDateTime::DAY); $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE)); // add milestone link include_once 'Services/Calendar/classes/class.ilCalendarSettings.php'; $settings = ilCalendarSettings::_getInstance(); include_once "Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php"; if (!$no_add) { $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE)); $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $this->seed->get(IL_CAL_DATE)); $new_app_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'add'); if ($settings->getEnableGroupMilestones()) { $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE)); $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $this->seed->get(IL_CAL_DATE)); $new_ms_url = $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'addMilestone'); $this->tpl->setCurrentBlock("new_ms"); $this->tpl->setVariable('DD_ID', $this->seed->get(IL_CAL_UNIX)); $this->tpl->setVariable('DD_TRIGGER', ilGlyphGUI::get(ilGlyphGUI::ADD)); $this->tpl->setVariable('URL_DD_NEW_APP', $new_app_url); $this->tpl->setVariable('TXT_DD_NEW_APP', $this->lng->txt('cal_new_app')); $this->tpl->setVariable('URL_DD_NEW_MS', $new_ms_url); $this->tpl->setVariable('TXT_DD_NEW_MS', $this->lng->txt('cal_new_ms')); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock("new_app1"); $this->tpl->setVariable('H_NEW_APP_SRC', ilGlyphGUI::get(ilGlyphGUI::ADD, $this->lng->txt('cal_new_app'))); $this->tpl->setVariable('NEW_APP_LINK', $new_app_url); $this->tpl->parseCurrentBlock(); } $this->ctrl->clearParametersByClass('ilcalendarappointmentgui'); } $this->tpl->setVariable('NAVIGATION', $navigation->getHTML()); $this->tpl->setVariable('HEADER_DATE', $this->seed_info['mday'] . ' ' . ilCalendarUtil::_numericMonthToString($this->seed_info['mon'], false)); $this->tpl->setVariable('HEADER_DAY', ilCalendarUtil::_numericDayToString($this->seed_info['wday'], true)); $this->tpl->setVariable('HCOLSPAN', $colspan - 1); $this->tpl->setVariable('TXT_TIME', $lng->txt("time")); // show fullday events foreach ($daily_apps as $event) { if ($event['fullday']) { $this->showFulldayAppointment($event); } } $this->tpl->setCurrentBlock('fullday_apps'); $this->tpl->setVariable('TXT_F_DAY', $lng->txt("cal_all_day")); $this->tpl->setVariable('COLSPAN', $colspan - 1); $this->tpl->parseCurrentBlock(); // parse the hour rows foreach ($hours as $numeric => $hour) { if (!($numeric % 60) || $numeric == $morning_aggr && $morning_aggr || $numeric == $evening_aggr && $evening_aggr) { if (!$no_add) { $this->tpl->setCurrentBlock("new_app2"); $this->ctrl->clearParametersByClass('ilcalendarappointmentgui'); $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'seed', $this->seed->get(IL_CAL_DATE)); $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'idate', $this->seed->get(IL_CAL_DATE)); $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'hour', floor($numeric / 60)); $this->tpl->setVariable('NEW_APP_HOUR_LINK', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'add')); $this->tpl->setVariable('NEW_APP_SRC', ilGlyphGUI::get(ilGlyphGUI::ADD, $this->lng->txt('cal_new_app'))); $this->tpl->parseCurrentBlock(); } // aggregation rows if ($numeric == $morning_aggr && $morning_aggr || $numeric == $evening_aggr && $evening_aggr) { $this->tpl->setVariable('TIME_ROWSPAN', 1); } else { $this->tpl->setVariable('TIME_ROWSPAN', 60 / $raster); } $this->tpl->setCurrentBlock('time_txt'); $this->tpl->setVariable('TIME', $hour['txt']); $this->tpl->parseCurrentBlock(); } foreach ($hour['apps_start'] as $app) { $this->showAppointment($app); } if ($ilUser->prefs["screen_reader_optimization"]) { $this->tpl->touchBlock('scrd_app_cell'); } for ($i = $colspan - 1; $i > $hour['apps_num']; $i--) { $this->tpl->setCurrentBlock('empty_cell'); $this->tpl->setVariable('EMPTY_WIDTH', 100 / (int) ($colspan - 1) . '%'); // last "slot" of hour needs border if ($numeric % 60 == 60 - $raster || $numeric == $morning_aggr && $morning_aggr || $numeric == $evening_aggr && $evening_aggr) { $this->tpl->setVariable('EMPTY_STYLE', ' calempty_border'); } $this->tpl->parseCurrentBlock(); } $this->tpl->touchBlock('time_row'); } }
/** * @param $question_id * @param $question_pool_id * * @return ilPropertyFormGUI */ protected function buildAdjustQuestionForm($question_id, $question_pool_id) { require_once './Services/Form/classes/class.ilPropertyFormGUI.php'; require_once './Modules/TestQuestionPool/classes/class.assQuestion.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setMultipart(FALSE); $form->setTableWidth("100%"); $form->setId("adjustment"); /** @var $question assQuestionGUI|ilGuiQuestionScoringAdjustable|ilGuiAnswerScoringAdjustable */ $question = assQuestion::instantiateQuestionGUI($question_id); $form->setTitle($question->object->getTitle() . '<br /><small>(' . $question->outQuestionType() . ')</small>'); $hidden_question_id = new ilHiddenInputGUI('q_id'); $hidden_question_id->setValue($question_id); $form->addItem($hidden_question_id); $hidden_qpl_id = new ilHiddenInputGUI('qpl_id'); $hidden_qpl_id->setValue($question_pool_id); $form->addItem($hidden_qpl_id); $this->populateScoringAdjustments($question, $form); $manscoring_section = new ilFormSectionHeaderGUI(); $manscoring_section->setTitle($this->lng->txt('manscoring')); $form->addItem($manscoring_section); $manscoring_preservation = new ilCheckboxInputGUI($this->lng->txt('preserve_manscoring'), 'preserve_manscoring'); $manscoring_preservation->setChecked(true); $manscoring_preservation->setInfo($this->lng->txt('preserve_manscoring_info')); $form->addItem($manscoring_preservation); $form->addCommandButton("savescoringfortest", $this->lng->txt("save")); $participants = $this->object->getParticipants(); $active_ids = array_keys($participants); $results = array(); foreach ($active_ids as $active_id) { $passes[] = $this->object->_getPass($active_id); foreach ($passes as $key => $pass) { for ($i = 0; $i <= $pass; $i++) { $results[] = $question->object->getSolutionValues($active_id, $i); } } } $relevant_answers = array(); foreach ($results as $result) { foreach ($result as $answer) { if ($answer['question_fi'] == $question->object->getId()) { $relevant_answers[] = $answer; } } } $answers_view = $question->getAggregatedAnswersView($relevant_answers); include_once 'Services/jQuery/classes/class.iljQueryUtil.php'; iljQueryUtil::initjQuery(); include_once 'Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initPanel(); ilYuiUtil::initOverlay(); $this->tpl->addJavascript('./Services/UIComponent/Overlay/js/ilOverlay.js'); $this->tpl->addJavaScript("./Services/JavaScript/js/Basic.js"); $container = new ilTemplate('tpl.il_as_tst_adjust_answer_aggregation_container.html', true, true, 'Modules/Test'); $container->setVariable('FORM_ELEMENT_NAME', 'aggr_usr_answ'); $container->setVariable('CLOSE_HTML', json_encode(ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt('close')))); $container->setVariable('TXT_SHOW_ANSWER_OVERVIEW', $this->lng->txt('show_answer_overview')); $container->setVariable('TXT_CLOSE', $this->lng->txt('close')); $container->setVariable('ANSWER_OVERVIEW', $answers_view); $custom_input = new ilCustomInputGUI('', 'aggr_usr_answ'); $custom_input->setHtml($container->get()); $form->addItem($custom_input); return $form; }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_multiplechoicewizardinput.html", true, true, "Modules/TestQuestionPool"); $i = 0; foreach ($this->values as $value) { if ($this->getSingleline()) { if (!$this->hideImages) { if (strlen($value->getImage())) { $imagename = $this->qstObject->getImagePathWeb() . $value->getImage(); if ($this->getSingleline() && $this->qstObject->getThumbSize()) { if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) { $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage(); } } $tpl->setCurrentBlock('image'); $tpl->setVariable('SRC_IMAGE', $imagename); $tpl->setVariable('IMAGE_NAME', $value->getImage()); $tpl->setVariable('ALT_IMAGE', ilUtil::prepareFormOutput($value->getAnswertext())); $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file")); $tpl->setVariable("IMAGE_ROW_NUMBER", $i); $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar()); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('addimage'); $tpl->setVariable("IMAGE_ID", $this->getPostVar() . "[image][{$i}]"); $tpl->setVariable("IMAGE_SUBMIT", $lng->txt("upload")); $tpl->setVariable("IMAGE_ROW_NUMBER", $i); $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar()); $tpl->parseCurrentBlock(); } if (is_object($value)) { $tpl->setCurrentBlock("prop_text_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext())); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("prop_points_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPointsChecked())); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("prop_points_unchecked_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPointsUnchecked())); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('singleline'); $tpl->setVariable("SIZE", $this->getSize()); $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][{$i}]"); $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i); $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar()); $tpl->setVariable("MAXLENGTH", $this->getMaxLength()); if ($this->getDisabled()) { $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\""); } $tpl->parseCurrentBlock(); } else { if (!$this->getSingleline()) { if (is_object($value)) { $tpl->setCurrentBlock("prop_points_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints())); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("prop_points_unchecked_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPointsUnchecked())); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('multiline'); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext())); $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][{$i}]"); $tpl->setVariable("MULTILINE_ROW_NUMBER", $i); $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar()); if ($this->getDisabled()) { $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\""); } $tpl->parseCurrentBlock(); } } if ($this->getAllowMove()) { $tpl->setCurrentBlock("move"); $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ID", $this->getPostVar() . "[{$i}]"); $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png')); $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png')); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock("row"); $class = $i % 2 == 0 ? "even" : "odd"; if ($i == 0) { $class .= " first"; } if ($i == count($this->values) - 1) { $class .= " last"; } $tpl->setVariable("ROW_CLASS", $class); $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->setVariable("ROW_NUMBER", $i); $tpl->setVariable("ID", $this->getPostVar() . "[answer][{$i}]"); $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][{$i}]"); $tpl->setVariable("POINTS_UNCHECKED_ID", $this->getPostVar() . "[points_unchecked][{$i}]"); $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); if ($this->getDisabled()) { $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\""); } $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->parseCurrentBlock(); $i++; } if ($this->getSingleline()) { if (!$this->hideImages) { if (is_array($this->getSuffixes())) { $suff_str = $delim = ""; foreach ($this->getSuffixes() as $suffix) { $suff_str .= $delim . "." . $suffix; $delim = ", "; } $tpl->setCurrentBlock('allowed_image_suffixes'); $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes") . " " . $suff_str); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock("image_heading"); $tpl->setVariable("ANSWER_IMAGE", $lng->txt('answer_image')); $tpl->setVariable("TXT_MAX_SIZE", ilUtil::getFileSizeInfo()); $tpl->parseCurrentBlock(); } } $tpl->setVariable("ELEMENT_ID", $this->getPostVar()); $tpl->setVariable("TEXT_YES", $lng->txt('yes')); $tpl->setVariable("TEXT_NO", $lng->txt('no')); $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header')); $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question')); $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text')); $tpl->setVariable("POINTS_TEXT", $lng->txt('points')); $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions')); $tpl->setVariable("POINTS_CHECKED_TEXT", $lng->txt('checkbox_checked')); $tpl->setVariable("POINTS_UNCHECKED_TEXT", $lng->txt('checkbox_unchecked')); $a_tpl->setCurrentBlock("prop_generic"); $a_tpl->setVariable("PROP_GENERIC", $tpl->get()); $a_tpl->parseCurrentBlock(); global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/multiplechoicewizard.js"); }
/** * Init form * @param int $a_mode * @return */ protected function initFormSequence($a_mode) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case self::MODE_CREATE: $this->form->setTitle($this->lng->txt('cal_ch_add_sequence')); $this->form->addCommandButton('saveSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ case self::MODE_MULTI: $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence')); $this->form->addCommandButton('updateMulti', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; } // in case of existing groups show a selection include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php'; if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) { $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp'); $group->setOptions($options); $group->setRequired(false); $this->form->addItem($group); } // Title $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti'); $ti->setSize(32); $ti->setMaxLength(128); $ti->setRequired(true); $this->form->addItem($ti); if ($a_mode != self::MODE_MULTI) { // Start include_once './Services/Form/classes/class.ilDateTimeInputGUI.php'; $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st'); $dur->setShowTime(true); $dur->setMinuteStepSize(5); $this->form->addItem($dur); // Duration $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du'); $du->setShowMinutes(true); $du->setShowHours(true); $this->form->addItem($du); // Number of appointments $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap'); $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info')); $nu->setSize(2); $nu->setMaxLength(2); $nu->setRequired(true); $nu->setMinValue(1); $this->form->addItem($nu); // Recurrence include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY)); $this->form->addItem($rec); } // Number of bookings $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo'); $nu->setSize(2); $nu->setMaxLength(2); $nu->setMinValue(1); $nu->setRequired(true); $this->form->addItem($nu); // Deadline $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead'); $dead->setInfo($this->lng->txt('cal_ch_deadline_info')); $dead->setShowMinutes(false); $dead->setShowHours(true); $dead->setShowDays(true); $this->form->addItem($dead); // Location $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo'); $lo->setSize(32); $lo->setMaxLength(128); $this->form->addItem($lo); // Description $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de'); $de->setRows(10); $de->setCols(60); $this->form->addItem($de); // Target Object $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt'); $tgt->setInfo($this->lng->txt('cal_ch_target_object_info')); $tgt->setSize(16); $tgt->setMaxLength(128); $this->form->addItem($tgt); }
/** * Insert property html * * @return int Size */ function insert($a_tpl) { global $tpl; include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initColorPicker(); $a_tpl->setCurrentBlock("prop_color"); $js_tpl = new ilTemplate('tpl.color_picker.js', true, true, 'Services/Form'); $js_tpl->setVariable('THUMB_PATH', ilUtil::getImagePath('color_picker_thumb.png', 'Services/Form')); $js_tpl->setVariable('HUE_THUMB_PATH', ilUtil::getImagePath('color_picker_hue_thumb.png', 'Services/Form')); $js_tpl->setVariable('COLOR_ID', $this->getFieldId()); $ic = ilColorPickerInputGUI::determineHexcode($this->getHexcode()); if ($ic == "") { $ic = "FFFFFF"; } $js_tpl->setVariable('INIT_COLOR_SHORT', $ic); $js_tpl->setVariable('INIT_COLOR', '#' . $this->getHexcode()); $js_tpl->setVariable('POST_VAR', $this->getPostVar()); if ($this->getDisabled()) { $a_tpl->setVariable('COLOR_DISABLED', 'disabled="disabled"'); } else { $a_tpl->setVariable('PROP_COLOR_JS', $js_tpl->get()); } $a_tpl->setVariable("POST_VAR", $this->getPostVar()); $a_tpl->setVariable("PROP_COLOR_ID", $this->getFieldId()); if (substr(trim($this->getValue()), 0, 1) == "!" && $this->getAcceptNamedColors()) { $a_tpl->setVariable("PROPERTY_VALUE_COLOR", ilUtil::prepareFormOutput(trim($this->getValue()))); } else { $a_tpl->setVariable("PROPERTY_VALUE_COLOR", ilUtil::prepareFormOutput($this->getHexcode())); } $a_tpl->parseCurrentBlock(); }
function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE, $show_feedback = FALSE) { // generate the question output $template = new ilTemplate("tpl.il_as_qpl_errortext_output.html", TRUE, TRUE, "Modules/TestQuestionPool"); if ($active_id) { $solutions = NULL; include_once "./Modules/Test/classes/class.ilObjTest.php"; if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) { if (is_null($pass)) { $pass = ilObjTest::_getPass($active_id); } } $solutions =& $this->object->getSolutionValues($active_id, $pass); } $errortext_value = ""; if (strlen($_SESSION['qst_selection'])) { $this->object->toggleSelection($_SESSION['qst_selection'], $active_id, $pass); unset($_SESSION['qst_selection']); $solutions =& $this->object->getSolutionValues($active_id, $pass); } $selections = array(); if (is_array($solutions)) { foreach ($solutions as $solution) { array_push($selections, $solution['value1']); } $errortext_value = join(",", $selections); } if ($this->object->getTextSize() >= 10) { echo $template->setVariable("STYLE", " style=\"font-size: " . $this->object->getTextSize() . "%;\""); } $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE)); $errortext = $this->object->createErrorTextOutput($selections); $errortext = preg_replace_callback("/#HREF(\\d+)/is", array(&$this, 'exchangeURL'), $errortext); $this->ctrl->setParameterByClass('iltestoutputgui', 'errorvalue', ''); $template->setVariable("ERRORTEXT", $errortext); $template->setVariable("ERRORTEXT_ID", "qst_" . $this->object->getId()); $template->setVariable("ERRORTEXT_VALUE", $errortext_value); $questionoutput = $template->get(); if (!$show_question_only) { // get page object output $questionoutput = $this->getILIASPage($questionoutput); } include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initElementSelection(); $this->tpl->addJavascript("./Modules/TestQuestionPool/templates/default/errortext.js"); $questionoutput = $template->get(); $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput); return $pageoutput; }
/** * render questions per page */ protected function renderPage() { global $ilCtrl, $lng, $tpl, $rbacsystem; $pages = $this->object->getSurveyPages(); $this->has_next_page = $this->current_page < sizeof($pages); $this->has_previous_page = $this->current_page > 1; $this->has_datasets = $this->object->_hasDatasets($this->object->getSurveyId()); if ($this->has_datasets) { $link = $ilCtrl->getLinkTargetByClass(array("ilobjsurveygui", "ilsurveyparticipantsgui"), "maintenance"); $link = "<a href=\"" . $link . "\">" . $lng->txt("survey_has_datasets_warning_page_view_link") . "</a>"; ilUtil::sendInfo($lng->txt("survey_has_datasets_warning_page_view") . " " . $link); } $ilCtrl->setParameter($this, "pg", $this->current_page); $ilCtrl->setParameter($this, "pgov", ""); $this->renderToolbar($pages); if ($pages) { $ttpl = new ilTemplate("tpl.il_svy_svy_page_view.html", true, true, "Modules/Survey"); $ttpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this)); $ttpl->setVariable("WYSIWYG_ACTION", $ilCtrl->getFormAction($this)); $lng->loadLanguageModule("form"); $read_only = $this->has_datasets || !$rbacsystem->checkAccess("write", $this->ref_id); $commands = $multi_commands = array(); if (!$read_only) { // clipboard is empty if (!$_SESSION["survey_page_view"][$this->ref_id]["clipboard"]) { $multi_commands[] = array("cmd" => "multiDelete", "text" => $lng->txt("delete")); $multi_commands[] = array("cmd" => "multiCut", "text" => $lng->txt("cut")); $multi_commands[] = array("cmd" => "multiCopy", "text" => $lng->txt("copy")); } else { if (!$this->suppress_clipboard_msg) { ilUtil::sendInfo($lng->txt("survey_clipboard_notice")); } $multi_commands[] = array("cmd" => "clearClipboard", "text" => $lng->txt("survey_dnd_clear_clipboard")); } // help $ttpl->setCurrentBlock("help_img"); $ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("streaked_area.png")); $ttpl->parseCurrentBlock(); $ttpl->setCurrentBlock("help_section"); $ttpl->setVariable("TXT_HELP", $lng->txt("form_hierarchy_add_elements")); $ttpl->parseCurrentBlock(); $ttpl->setCurrentBlock("help_img"); $ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("icon_cont_el_s.png")); $ttpl->parseCurrentBlock(); $ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("drop_streaked_area.png")); $ttpl->parseCurrentBlock(); $ttpl->setCurrentBlock("help_section"); $ttpl->setVariable("TXT_HELP", $lng->txt("form_hierarchy_drag_drop_help")); $ttpl->parseCurrentBlock(); $ttpl->setCurrentBlock("help_img"); $ttpl->setVariable("IMG_HELP", ilUtil::getImagePath("icon_cont_el_s.png")); $ttpl->parseCurrentBlock(); $ttpl->setCurrentBlock("help_section"); $ttpl->setVariable("TXT_HELP", $lng->txt("survey_dnd_double_click_to_delete")); $ttpl->parseCurrentBlock(); $ttpl->setVariable("DND_INIT_JS", "initDragElements();"); // tiny mce include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $tags = ilObjAdvancedEditing::_getUsedHTMLTags("survey"); include_once "./Services/RTE/classes/class.ilTinyMCE.php"; $tiny = new ilTinyMCE("3.3.9.2"); $ttpl->setVariable("WYSIWYG_BLOCKFORMATS", $tiny->_buildAdvancedBlockformatsFromHTMLTags($tags)); $ttpl->setVariable("WYSIWYG_VALID_ELEMENTS", $tiny->_getValidElementsFromHTMLTags($tags)); $buttons_1 = $tiny->_buildAdvancedButtonsFromHTMLTags(1, $tags); $buttons_2 = $tiny->_buildAdvancedButtonsFromHTMLTags(2, $tags) . ',' . $tiny->_buildAdvancedTableButtonsFromHTMLTags($tags) . ($tiny->getStyleSelect() ? ',styleselect' : ''); $buttons_3 = $tiny->_buildAdvancedButtonsFromHTMLTags(3, $tags); $ttpl->setVariable('WYSIWYG_BUTTONS_1', $tiny->_removeRedundantSeparators($buttons_1)); $ttpl->setVariable('WYSIWYG_BUTTONS_2', $tiny->_removeRedundantSeparators($buttons_2)); $ttpl->setVariable('WYSIWYG_BUTTONS_3', $tiny->_removeRedundantSeparators($buttons_3)); } // commands if (count($multi_commands) > 0 || count($commands) > 0) { $single = false; foreach ($commands as $cmd) { $ttpl->setCurrentBlock("cmd"); $ttpl->setVariable("ORG_CMD", "renderPage"); $ttpl->setVariable("CMD", $cmd["cmd"]); $ttpl->setVariable("CMD_TXT", $cmd["text"]); $ttpl->parseCurrentBlock(); $single = true; } $multi = false; foreach ($multi_commands as $cmd) { $ttpl->setCurrentBlock("multi_cmd"); $ttpl->setVariable("ORG_CMD_MULTI", "renderPage"); $ttpl->setVariable("MULTI_CMD", $cmd["cmd"]); $ttpl->setVariable("MULTI_CMD_TXT", $cmd["text"]); $ttpl->parseCurrentBlock(); $multi = true; } if ($multi) { $ttpl->setCurrentBlock("multi_cmds"); $ttpl->setVariable("MCMD_ALT", $lng->txt("commands")); $ttpl->setVariable("MCMD_IMG", ilUtil::getImagePath("arrow_downright.png")); $ttpl->parseCurrentBlock(); } if ($single || $multi) { $ttpl->setCurrentBlock("commands"); $ttpl->parseCurrentBlock(); } } // nodes $ttpl->setVariable("NODES", $this->getPageNodes($pages[$this->current_page - 1], $this->has_previous_page, $this->has_next_page, $read_only)); $tpl->setContent($ttpl->get()); // add js to template include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDragDrop(); $tpl->addJavascript("./Modules/Survey/js/SurveyPageView.js"); $tpl->addJavascript("./Services/RTE/tiny_mce_3_3_9_2/tiny_mce_src.js"); } }
protected function initLearningProgressDetailsLayer() { global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initPanel(); include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery(); $tpl->addJavascript("./Services/Tracking/js/ilObjStat.js"); }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_filewizardinput.html", true, true, "Services/Form"); $i = 0; foreach ($this->filenames as $value) { if (strlen($value)) { $tpl->setCurrentBlock("image"); $tpl->setVariable("SRC_IMAGE", $this->getImagePathWeb() . ilUtil::prepareFormOutput($value)); $tpl->setVariable("PICTURE_FILE", ilUtil::prepareFormOutput($value)); $tpl->setVariable("ID", $this->getFieldId() . "[{$i}]"); $tpl->setVariable("ALT_IMAGE", ilUtil::prepareFormOutput($value)); $tpl->parseCurrentBlock(); } if ($this->getAllowMove()) { $tpl->setCurrentBlock("move"); $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ID", $this->getFieldId() . "[{$i}]"); $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png')); $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png')); $tpl->parseCurrentBlock(); } $this->outputSuffixes($tpl, "allowed_image_suffixes"); $tpl->setCurrentBlock("row"); $class = $i % 2 == 0 ? "even" : "odd"; if ($i == 0) { $class .= " first"; } if ($i == count($this->filenames) - 1) { $class .= " last"; } $tpl->setVariable("ROW_CLASS", $class); $tpl->setVariable("POST_VAR", $this->getPostVar() . "[{$i}]"); $tpl->setVariable("ID", $this->getFieldId() . "[{$i}]"); $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ALT_ADD", $lng->txt("add")); $tpl->setVariable("ALT_REMOVE", $lng->txt("remove")); if ($this->getDisabled()) { $tpl->setVariable("DISABLED", " disabled=\"disabled\""); } $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString()); $tpl->parseCurrentBlock(); $i++; } $tpl->setVariable("ELEMENT_ID", $this->getFieldId()); $a_tpl->setCurrentBlock("prop_generic"); $a_tpl->setVariable("PROP_GENERIC", $tpl->get()); $a_tpl->parseCurrentBlock(); global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); $tpl->addJavascript("./Services/Form/templates/default/filewizard.js"); }
public function initGUI(ilObjCloudGUI $gui_class, $perm_create_folder, $perm_upload_items, $perm_delete_files, $perm_delete_folders, $perm_download, $perm_files_visible, $perm_folders_visible) { global $ilTabs, $lng, $tpl; $ilTabs->activateTab("content"); $this->setGuiClass($gui_class); $this->setPermUploadItems($perm_upload_items); $this->setPermCreateFolders($perm_create_folder); $this->setPermDeleteFiles($perm_delete_files); $this->setPermDeleteFolders($perm_delete_folders); $this->setPermDownload($perm_download); $this->setPermFilesVisible($perm_files_visible); $this->setPermFoldersVisible($perm_folders_visible); try { ilCloudConnector::checkServiceActive($this->getGUIClass()->object->getServiceName()); $this->beforeInitGUI(); $tpl->addJavaScript("./Modules/Cloud/js/ilCloudFileList.js"); $tpl->addJavaScript("./Modules/Cloud/js/jquery.address.js"); $tpl->addJavascript("./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js"); $tpl->addCss("./Modules/Cloud/templates/css/cloud.css"); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnection(); $this->tpl_file_tree = new ilTemplate("tpl.cloud_file_tree.html", true, true, "Modules/Cloud"); $file_tree = new ilCloudFileTree($this->getGUIClass()->object->getRootFolder(), $this->getGUIClass()->object->getRootId(), $this->getGUIClass()->object->getId(), $this->getGUIClass()->object->getServiceName()); $file_tree->storeFileTreeToSession(); $this->addToolbar($file_tree->getRootNode()); $this->tpl_file_tree->setVariable("ASYNC_GET_BLOCK", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilobjcloudgui", "asyncGetBlock", true))); $this->tpl_file_tree->setVariable("ASYNC_CREATE_FOLDER", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilcloudplugincreatefoldergui", "asyncCreateFolder", true))); $this->tpl_file_tree->setVariable("ASYNC_UPLOAD_FILE", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilcloudpluginuploadgui", "asyncUploadFile", true))); $this->tpl_file_tree->setVariable("ASYNC_DELETE_ITEM", json_encode($this->getGUIClass()->ctrl->getLinkTargetByClass("ilcloudplugindeletegui", "asyncDeleteItem", true))); $this->tpl_file_tree->setVariable("ROOT_ID", json_encode($file_tree->getRootNode()->getId())); $this->tpl_file_tree->setVariable("ROOT_PATH", json_encode($file_tree->getRootNode()->getPath())); if (isset($_POST["path"])) { $this->tpl_file_tree->setVariable("CURRENT_PATH", json_encode($_POST["path"])); $file_tree->updateFileTree($_POST["path"]); $node = $file_tree->getNodeFromPath($_POST["path"]); $this->tpl_file_tree->setVariable("CURRENT_ID", json_encode($node->getId())); } else { $this->tpl_file_tree->setVariable("CURRENT_PATH", json_encode($file_tree->getRootNode()->getPath())); $this->tpl_file_tree->setVariable("CURRENT_ID", json_encode($file_tree->getRootNode()->getID())); } $txt_max_file_size = $lng->txt("file_notice") . " " . ilCloudConnector::getPluginClass($this->getGUIClass()->object->getServiceName(), $this->getGUIClass()->object->getId())->getMaxFileSize() . " MB"; $this->tpl_file_tree->setVariable("MAX_FILE_SIZE", json_encode($txt_max_file_size)); $this->beforeSetContent(); $tpl->setContent($this->tpl_file_tree->get()); $tpl->setPermanentLink("cld", $this->getGuiClass()->object->getRefId(), "_path__endPath"); /** else { $file_tree = ilCloudFileTree::getFileTreeFromSession(); if($_GET["current_path"] && $_GET["current_id"] && $file_tree && $file_tree->getId() == $this->getGUIClass()->object->getId()) { $path = $_GET["current_path"]; $id = $_GET["current_id"]; } else { $path = $gui_class->object->getRootFolder(); $id = $gui_class->object->getRootId(); ilCloudFileTree::clearFileTreeSession(); $file_tree = new ilCloudFileTree($this->getGUIClass()->object->getRootFolder(), $this->getGUIClass()->object->getRootId(), $this->getGUIClass()->object->getId(), $this->getGUIClass()->object->getServiceName()); } $file_tree->updateFileTree($path); $file_tree_gui = ilCloudConnector::getFileTreeGUIClass($this->getService(), $file_tree); $this->content = $file_tree_gui->getFolderHtml($this->getGuiClass(), $id, $this->getPermDeleteFiles(), $this->getPermDeleteFolders(), $this->getPermDownload(), $this->getPermFilesVisible(), $this->getPermCreateFolders()); $tpl->setContent($this->content); }**/ $this->afterInitGUI(); } catch (Exception $e) { if ($e->getCode() == ilCloudException::AUTHENTIFICATION_FAILED) { $this->getGUIClass()->object->setAuthComplete(false); $this->getGUIClass()->object->doUpdate(); } ilUtil::sendFailure($e->getMessage()); } }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_answerwizardinput.html", true, true, "Modules/TestQuestionPool"); $i = 0; foreach ($this->values as $value) { if ($this->getSingleline()) { if (is_object($value)) { $tpl->setCurrentBlock("prop_text_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext())); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("prop_points_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints())); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('singleline'); $tpl->setVariable("SIZE", $this->getSize()); $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][{$i}]"); $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i); $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar()); $tpl->setVariable("MAXLENGTH", $this->getMaxLength()); if ($this->getDisabled()) { $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\""); } $tpl->parseCurrentBlock(); } else { if (!$this->getSingleline()) { if (is_object($value)) { $tpl->setCurrentBlock("prop_points_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints())); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock('multiline'); $tpl->setVariable("PROPERTY_VALUE", $this->qstObject->prepareTextareaOutput($value->getAnswertext())); $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][{$i}]"); $tpl->setVariable("MULTILINE_ROW_NUMBER", $i); $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar()); if ($this->getDisabled()) { $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\""); } $tpl->parseCurrentBlock(); } } if ($this->getAllowMove()) { $tpl->setCurrentBlock("move"); $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ID", $this->getPostVar() . "[{$i}]"); $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png')); $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png')); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock("row"); $class = $i % 2 == 0 ? "even" : "odd"; if ($i == 0) { $class .= " first"; } if ($i == count($this->values) - 1) { $class .= " last"; } $tpl->setVariable("ROW_CLASS", $class); $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->setVariable("ROW_NUMBER", $i); $tpl->setVariable("ID", $this->getPostVar() . "[answer][{$i}]"); $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][{$i}]"); $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); if ($this->getDisabled()) { $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\""); } $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->parseCurrentBlock(); $i++; } $tpl->setVariable("ELEMENT_ID", $this->getPostVar()); $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text')); $tpl->setVariable("POINTS_TEXT", $lng->txt('points')); $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions')); $a_tpl->setCurrentBlock("prop_generic"); $a_tpl->setVariable("PROP_GENERIC", $tpl->get()); $a_tpl->parseCurrentBlock(); global $tpl; include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/answerwizard.js"); }
/** * Creates output * recursive method * @access public * @return string */ function getOutput() { global $ilBench, $tpl, $lng; $ilBench->start("Explorer", "getOutput"); $this->format_options[0]["tab"] = array(); $depth = $this->getMaximumTreeDepth(); for ($i = 0; $i < $depth; ++$i) { $this->createLines($i); } include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initConnection(); $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js"); $tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html"); //echo "hh"; // set global body class // $tpl->setBodyClass("il_Explorer"); $tpl_tree = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer"); // updater if (($_GET["ict"] || $_POST["collapseAll"] != "" || $_POST["expandAll"] != "") && $this->up_frame != "") { $tpl_tree->setCurrentBlock("updater"); $tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame); $tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script); if (is_array($this->up_params)) { $up_str = $lim = ""; foreach ($this->up_params as $p) { $up_str .= $lim . "'" . $p . "'"; $lim = ","; } $tpl_tree->setVariable("UPDATE_PARAMS", $up_str); } $tpl_tree->parseCurrentBlock(); } $cur_depth = -1; foreach ($this->format_options as $key => $options) { //echo "-".$options["depth"]."-"; if (!$options["visible"]) { continue; } // end tags $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]); // start tags $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]); $cur_depth = $options["depth"]; if ($options["visible"] and $key != 0) { $this->formatObject($tpl_tree, $options["child"], $options, $options['obj_id']); } if ($key == 0) { $this->formatHeader($tpl_tree, $options["child"], $options); } } //if ($GLOBALS["ilUser"]->getLogin() == "alex") var_dump($this->format_options); $this->handleListEndTags($tpl_tree, $cur_depth, -1); $ilBench->stop("Explorer", "getOutput"); $tpl_tree->setVariable("TREE_LEAD", ""); if ($this->tree_lead != "") { $tpl_tree->setCurrentBlock("tree_lead"); $tpl_tree->setVariable("TREE_LEAD", $this->tree_lead); $tpl_tree->parseCurrentBlock(); } if ($this->getId() != "") { $tpl_tree->setVariable("TREE_ID", 'id="' . $this->getId() . '_tree"'); } $html = $tpl_tree->get(); if ($this->getUseStandardFrame()) { $mtpl = new ilTemplate("tpl.main.html", true, true); $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation()); $mtpl->setVariable("BODY_CLASS", "il_Explorer"); $mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html"); if ($this->getTitle() != "") { $mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle()); } if ($this->getId() != "") { $mtpl->setVariable("ID", 'id="' . $this->getId() . '"'); } $mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false)); $mtpl->setCurrentBlock("content"); $mtpl->setVariable("EXPLORER", $html); $mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh")); $mtpl->parseCurrentBlock(); $html = $mtpl->get(); } return $html; }