function outQuestionForTest($formaction, $active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE)
 {
     $test_output = $this->getTestOutput($active_id, $pass, $is_postponed, $use_post_solutions);
     $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
     $this->tpl->setVariable("FORMACTION", $formaction);
     include_once "./Services/RTE/classes/class.ilRTE.php";
     $rtestring = ilRTE::_getRTEClassname();
     include_once "./Services/RTE/classes/class.{$rtestring}.php";
     $rte = new $rtestring();
     include_once "./Services/Object/classes/class.ilObject.php";
     $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
     $obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
     $rte->addUserTextEditor("textinput");
     $this->outAdditionalOutput();
 }
示例#2
0
 /**
  * edit page content (for repository root node and categories)
  *
  * @access	public
  */
 function editPageContentObject()
 {
     global $rbacsystem, $tpl, $lng, $ilCtrl;
     if (!$rbacsystem->checkAccess("write", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
     }
     $xpage_id = ilContainer::_lookupContainerSetting($this->object->getId(), "xhtml_page");
     if ($xpage_id > 0) {
         include_once "Services/XHTMLPage/classes/class.ilXHTMLPage.php";
         $xpage = new ilXHTMLPage($xpage_id);
         $content = $xpage->getContent();
     }
     // get template
     $tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.container_edit_page_content.html", "Services/Container");
     $tpl->setVariable("VAL_CONTENT", ilUtil::prepareFormOutput($content));
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tpl->setVariable("TXT_EDIT_PAGE_CONTENT", $this->lng->txt("edit_page_content"));
     $tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
     $tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
     $tpl->setVariable("TXT_MIGRATION_INFO", $lng->txt("cntr_old_editor_warning"));
     $tpl->setVariable("TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt("cntr_old_editor_open_standard_editor"));
     $tpl->setVariable("IMG_WARNING", ilUtil::getImagePath("icon_alert.svg"));
     $tpl->setVariable("HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this, "switchToStdEditor"));
     $tpl->setVariable("ALT_WARNING", $lng->txt("warning"));
     include_once "./Services/Form/classes/class.ilFormPropertyGUI.php";
     include_once "./Services/Form/classes/class.ilTextAreaInputGUI.php";
     //$ta = new ilTextAreaInputGUI();
     //$tags = $ta->getRteTagSet("extended_table_img");
     // add rte support
     include_once "./Services/RTE/classes/class.ilRTE.php";
     $rtestring = ilRTE::_getRTEClassname();
     include_once "./Services/RTE/classes/class.{$rtestring}.php";
     $rte = new $rtestring();
     //$rte->addPlugin("latex");
     include_once "./Services/Object/classes/class.ilObject.php";
     $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
     $obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
     $rte->addRTESupport($obj_id, $obj_type);
     //$rte->setStyleSelect(true);
     //$rte->addCustomRTESupport($obj_id, $obj_type, $tags);
 }
示例#3
0
 private function initReplyEditForm()
 {
     /**
      * @var $ilUser ilObjUser
      * @var $rbacsystem ilRbacSystem
      * @var $ilSetting ilSetting
      */
     global $ilUser, $rbacsystem, $ilSetting;
     // init objects
     $oForumObjects = $this->getForumObjects();
     /**
      * @var $frm ilForum
      */
     $frm = $oForumObjects['frm'];
     /**
      * @var $oFDForum ilFileDataForum
      */
     $oFDForum = $oForumObjects['file_obj'];
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->replyEditForm = new ilPropertyFormGUI();
     $this->replyEditForm->setTableWidth('100%');
     // titel
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $this->ctrl->setParameter($this, 'action', 'ready_showreply');
     } else {
         $this->ctrl->setParameter($this, 'action', 'ready_showedit');
     }
     // form action
     $this->ctrl->setParameter($this, 'pos_pk', $this->objCurrentPost->getId());
     $this->ctrl->setParameter($this, 'thr_pk', $this->objCurrentPost->getThreadId());
     $this->ctrl->setParameter($this, 'offset', (int) $_GET['offset']);
     $this->ctrl->setParameter($this, 'orderby', $_GET['orderby']);
     $this->replyEditForm->setFormAction($this->ctrl->getFormAction($this, 'savePost', $this->objCurrentPost->getId()));
     $this->ctrl->clearParameters($this);
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $this->replyEditForm->setTitle($this->lng->txt('forums_your_reply'));
     } else {
         $this->replyEditForm->setTitle($this->lng->txt('forums_edit_post'));
     }
     // alias
     if ($this->objProperties->isAnonymized() && in_array($_GET['action'], array('showreply', 'ready_showreply'))) {
         $oAnonymousNameGUI = new ilTextInputGUI($this->lng->txt('forums_your_name'), 'alias');
         $oAnonymousNameGUI->setMaxLength(64);
         $oAnonymousNameGUI->setInfo($this->lng->txt('forums_use_alias'));
         $this->replyEditForm->addItem($oAnonymousNameGUI);
     }
     // subject
     $oSubjectGUI = new ilTextInputGUI($this->lng->txt('forums_subject'), 'subject');
     $oSubjectGUI->setMaxLength(64);
     $oSubjectGUI->setRequired(true);
     if ($this->objProperties->getSubjectSetting() == 'empty_subject') {
         $oSubjectGUI->setInfo($this->lng->txt('enter_new_subject'));
     }
     $this->replyEditForm->addItem($oSubjectGUI);
     // post
     $oPostGUI = new ilTextAreaInputGUI($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply' ? $this->lng->txt('forums_your_reply') : $this->lng->txt('forums_edit_post'), 'message');
     $oPostGUI->setRequired(true);
     $oPostGUI->setCols(50);
     $oPostGUI->setRows(15);
     $oPostGUI->setUseRte(true);
     $oPostGUI->addPlugin('latex');
     $oPostGUI->addButton('latex');
     $oPostGUI->addButton('pastelatex');
     $oPostGUI->addPlugin('ilfrmquote');
     //$oPostGUI->addPlugin('code');
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $oPostGUI->addButton('ilFrmQuoteAjaxCall');
     }
     $oPostGUI->removePlugin('advlink');
     $oPostGUI->setRTERootBlockElement('');
     $oPostGUI->usePurifier(true);
     $oPostGUI->disableButtons(array('charmap', 'undo', 'redo', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'anchor', 'fullscreen', 'cut', 'copy', 'paste', 'pastetext', 'formatselect'));
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         $oPostGUI->setRTESupport($ilUser->getId(), 'frm~', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
     } else {
         $oPostGUI->setRTESupport($this->objCurrentPost->getId(), 'frm', 'frm_post', 'tpl.tinymce_frm_post.html', false, '3.4.7');
     }
     // purifier
     require_once 'Services/Html/classes/class.ilHtmlPurifierFactory.php';
     $oPostGUI->setPurifier(ilHtmlPurifierFactory::_getInstanceByType('frm_post'));
     $this->replyEditForm->addItem($oPostGUI);
     // notification only if gen. notification is disabled and forum isn't anonymous
     include_once 'Services/Mail/classes/class.ilMail.php';
     $umail = new ilMail($ilUser->getId());
     if ($rbacsystem->checkAccess('internal_mail', $umail->getMailObjectReferenceId()) && !$frm->isThreadNotificationEnabled($ilUser->getId(), $this->objCurrentPost->getThreadId()) && !$this->objProperties->isAnonymized()) {
         $oNotificationGUI = new ilCheckboxInputGUI('', 'notify');
         $oNotificationGUI->setInfo($this->lng->txt('forum_notify_me'));
         $this->replyEditForm->addItem($oNotificationGUI);
     }
     // attachments
     $oFileUploadGUI = new ilFileWizardInputGUI($this->lng->txt('forums_attachments_add'), 'userfile');
     $oFileUploadGUI->setFilenames(array(0 => ''));
     $this->replyEditForm->addItem($oFileUploadGUI);
     require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
     if ($ilUser->isAnonymous() && !$ilUser->isCaptchaVerified() && ilCaptchaUtil::isActiveForForum()) {
         require_once 'Services/Captcha/classes/class.ilCaptchaInputGUI.php';
         $captcha = new ilCaptchaInputGUI($this->lng->txt('cont_captcha_code'), 'captcha_code');
         $captcha->setRequired(true);
         $this->replyEditForm->addItem($captcha);
     }
     // edit attachments
     if (count($oFDForum->getFilesOfPost()) && ($_GET['action'] == 'showedit' || $_GET['action'] == 'ready_showedit')) {
         $oExistingAttachmentsGUI = new ilCheckboxGroupInputGUI($this->lng->txt('forums_delete_file'), 'del_file');
         foreach ($oFDForum->getFilesOfPost() as $file) {
             $oAttachmentGUI = new ilCheckboxInputGUI($file['name'], 'del_file');
             $oAttachmentGUI->setValue($file['md5']);
             $oExistingAttachmentsGUI->addOption($oAttachmentGUI);
         }
         $this->replyEditForm->addItem($oExistingAttachmentsGUI);
     }
     // buttons
     $this->replyEditForm->addCommandButton('savePost', $this->lng->txt('create'));
     if ($_GET['action'] == 'showreply' || $_GET['action'] == 'ready_showreply') {
         include_once 'Services/RTE/classes/class.ilRTE.php';
         $rtestring = ilRTE::_getRTEClassname();
         if (array_key_exists('show_rte', $_POST)) {
             ilObjAdvancedEditing::_setRichTextEditorUserState($_POST['show_rte']);
         }
         if (strtolower($rtestring) != 'iltinymce' || !ilObjAdvancedEditing::_getRichTextEditorUserState()) {
             $this->replyEditForm->addCommandButton('quotePost', $this->lng->txt('forum_add_quote'));
         }
     }
     $this->replyEditForm->addCommandButton('cancelPost', $this->lng->txt('cancel'));
 }
 /**
  * Insert property html
  *
  * @return	int	Size
  */
 function insert(&$a_tpl)
 {
     $ttpl = new ilTemplate("tpl.prop_textarea.html", true, true, "Services/Form");
     // disabled rte
     if ($this->getUseRte() && $this->getDisabled()) {
         $ttpl->setCurrentBlock("disabled_rte");
         $ttpl->setVariable("DR_VAL", $this->getValue());
         $ttpl->parseCurrentBlock();
     } else {
         if ($this->getUseRte()) {
             $rtestring = ilRTE::_getRTEClassname();
             include_once "./Services/RTE/classes/class.{$rtestring}.php";
             $rte = new $rtestring($this->rteSupport['version']);
             // @todo: Check this.
             $rte->addPlugin("emotions");
             foreach ($this->plugins as $plugin) {
                 if (strlen($plugin)) {
                     $rte->addPlugin($plugin);
                 }
             }
             foreach ($this->removeplugins as $plugin) {
                 if (strlen($plugin)) {
                     $rte->removePlugin($plugin);
                 }
             }
             foreach ($this->buttons as $button) {
                 if (strlen($button)) {
                     $rte->addButton($button);
                 }
             }
             $rte->disableButtons($this->getDisabledButtons());
             if ($this->getRTERootBlockElement() !== null) {
                 $rte->setRTERootBlockElement($this->getRTERootBlockElement());
             }
             if (count($this->rteSupport) >= 3) {
                 $rte->addRTESupport($this->rteSupport["obj_id"], $this->rteSupport["obj_type"], $this->rteSupport["module"], false, $this->rteSupport['cfg_template'], $this->rteSupport['hide_switch']);
             } else {
                 $rte->addCustomRTESupport(0, "", $this->getRteTags());
             }
             $ttpl->touchBlock("prop_ta_w");
             $ttpl->setCurrentBlock("prop_textarea");
             $ttpl->setVariable("ROWS", $this->getRows());
         } else {
             $ttpl->touchBlock("no_rteditor");
             if ($this->getCols() > 5) {
                 $ttpl->setCurrentBlock("prop_ta_c");
                 $ttpl->setVariable("COLS", $this->getCols());
                 $ttpl->parseCurrentBlock();
             } else {
                 $ttpl->touchBlock("prop_ta_w");
             }
             $ttpl->setCurrentBlock("prop_textarea");
             $ttpl->setVariable("ROWS", $this->getRows());
         }
         if (!$this->getDisabled()) {
             $ttpl->setVariable("POST_VAR", $this->getPostVar());
         }
         $ttpl->setVariable("ID", $this->getFieldId());
         if ($this->getDisabled()) {
             $ttpl->setVariable('DISABLED', 'disabled="disabled" ');
         }
         $ttpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $ttpl->parseCurrentBlock();
     }
     if ($this->getDisabled()) {
         $ttpl->setVariable("HIDDEN_INPUT", $this->getHiddenTag($this->getPostVar(), $this->getValue()));
     }
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $ttpl->get());
     $a_tpl->parseCurrentBlock();
 }
 /**
  * Creates an output of the edit form for the question
  *
  * Creates an output of the edit form for the question
  *
  * @access public
  */
 function editQuestion()
 {
     $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js");
     $this->tpl->addCss($this->cssDir . "/default.css");
     $this->tpl->addJavascript($this->ownDir . "/js/bracketCount.js");
     $this->tpl->addJavascript($this->ownDir . "/js/url_encode.js");
     $javascript = "<script type=\"text/javascript\">ilAddOnLoad(initialSelect);\n" . "function initialSelect() {\n%s\n}</script>";
     // single response
     $this->getQuestionTemplate();
     $this->tpl->addBlockFile("QUESTION_DATA", "question_data", "tpl.il_as_qpl_syntaxtree.html", $this->ownDir);
     // output of existing single response answers
     for ($i = 0; $i < $this->object->getAnswerCount(); $i++) {
         $this->tpl->setCurrentBlock("answers");
         $answer = $this->object->getAnswer($i);
         $this->tpl->setVariable("VALUE_ANSWER_COUNTER", $answer->getOrder() + 1);
         $this->tpl->setVariable("ANSWER_ORDER", $answer->getOrder());
         $this->tpl->setVariable("VALUE_ANSWER", ilUtil::prepareFormOutput($answer->getAnswertext()));
         $this->tpl->setVariable("VALUE_POINTS", ilUtil::prepareFormOutput($answer->getPoints()));
         $this->tpl->setVariable("TEXT_PHRASE_HEADER", $this->lng->txt("qpl_qst_syntaxtree_phrase_header"));
         $this->tpl->setVariable("TEXT_OPEN_BRACKETS", $this->lng->txt("qpl_qst_syntaxtree_open_brackets"));
         $this->tpl->setVariable("TEXT_CLOSED_BRACKETS", $this->lng->txt("qpl_qst_syntaxtree_closed_brackets"));
         /* SyntaxTreeAddon */
         $img = "<img src=\"" . sprintf($this->ownDir . "/phpsyntaxtree_obj/stgraph.png?syntaxTreeData=%s\" id=\"syntaxTreeGraph\" alt=\"\">", urlencode($answer->getAnswertext()));
         $this->tpl->setVariable("GRAPH", sprintf("%s", $img));
         $this->tpl->parseCurrentBlock();
     }
     if ($this->object->getAnswerCount() > 0) {
         $this->tpl->setCurrentBlock("answersheading");
         $this->tpl->setVariable("TEXT_ANSWER_TEXT", $this->lng->txt("answer_text"));
         $this->tpl->setVariable("TEXT_POINTS", $this->lng->txt("points"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("HeadContent");
     if ($this->object->getAnswerCount() == 0) {
         $this->tpl->setVariable("CONTENT_BLOCK", sprintf($javascript, "document.frm_syntaxtree.title.focus();"));
     } else {
         switch ($this->ctrl->getCmd()) {
             case "add":
                 $this->tpl->setVariable("CONTENT_BLOCK", sprintf($javascript, "document.frm_syntaxtree.answer_" . ($this->object->getAnswerCount() - $_POST["nrOfAnswers"]) . ".focus(); document.getElementById('answer_" . ($this->object->getAnswerCount() - $_POST["nrOfAnswers"]) . "').scrollIntoView(\"true\");"));
                 break;
             case "":
                 if ($this->object->getAnswerCount() == 0) {
                     $this->tpl->setVariable("CONTENT_BLOCK", sprintf($javascript, "document.frm_syntaxtree.title.focus();"));
                 } else {
                     $this->tpl->setVariable("CONTENT_BLOCK", sprintf($javascript, "document.frm_syntaxtree.answer_" . ($this->object->getAnswerCount() - 1) . ".focus(); document.getElementById('answer_" . ($this->object->getAnswerCount() - 1) . "').scrollIntoView(\"true\");"));
                 }
                 break;
             default:
                 $this->tpl->setVariable("CONTENT_BLOCK", sprintf($javascript, "document.frm_syntaxtree.title.focus();"));
                 break;
         }
     }
     $this->tpl->parseCurrentBlock();
     // Add text rating options
     $text_options = array(array("ci", $this->lng->txt("cloze_textgap_case_insensitive")), array("cs", $this->lng->txt("cloze_textgap_case_sensitive")), array("l1", sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1")), array("l2", sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2")), array("l3", sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3")), array("l4", sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4")), array("l5", sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5")));
     $text_rating = $this->object->getTextRating();
     foreach ($text_options as $text_option) {
         $this->tpl->setCurrentBlock("text_rating");
         $this->tpl->setVariable("RATING_VALUE", $text_option[0]);
         $this->tpl->setVariable("RATING_TEXT", $text_option[1]);
         if (strcmp($text_rating, $text_option[0]) == 0) {
             $this->tpl->setVariable("SELECTED_RATING_VALUE", " selected=\"selected\"");
         }
         $this->tpl->parseCurrentBlock();
     }
     if ($this->object->getAnswerCount() > 0) {
         $this->tpl->setCurrentBlock("selectall");
         $this->tpl->setVariable("SELECT_ALL", $this->lng->txt("select_all"));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock("existinganswers");
         $this->tpl->setVariable("DELETE", $this->lng->txt("delete"));
         $this->tpl->setVariable("MOVE", $this->lng->txt("move"));
         $this->tpl->setVariable("ARROW", "<img src=\"" . ilUtil::getImagePath("arrow_downright.gif") . "\" alt=\"" . $this->lng->txt("arrow_downright") . "\">");
         $this->tpl->parseCurrentBlock();
     }
     for ($i = 1; $i < 10; $i++) {
         $this->tpl->setCurrentBlock("numbers");
         $this->tpl->setVariable("VALUE_NUMBER", $i);
         if ($i == 1) {
             $this->tpl->setVariable("TEXT_NUMBER", $i . " " . $this->lng->txt("answer"));
         } else {
             $this->tpl->setVariable("TEXT_NUMBER", $i . " " . $this->lng->txt("answers"));
         }
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setCurrentBlock("question_data");
     $this->tpl->setVariable("SYNTAXTREE_ID", $this->object->getId());
     $this->tpl->setVariable("VALUE_SYNTAXTREE_TITLE", ilUtil::prepareFormOutput($this->object->getTitle()));
     $this->tpl->setVariable("VALUE_SYNTAXTREE_COMMENT", ilUtil::prepareFormOutput($this->object->getComment()));
     $this->tpl->setVariable("VALUE_SYNTAXTREE_AUTHOR", ilUtil::prepareFormOutput($this->object->getAuthor()));
     $this->tpl->setVariable("VALUE_CORRECTANSWERS", $this->object->getCorrectAnswers());
     $this->tpl->setVariable("VALUE_POINTS", $this->object->getMaximumPoints());
     $questiontext = $this->object->getQuestion();
     $this->tpl->setVariable("VALUE_QUESTION", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($questiontext)));
     $this->tpl->setVariable("VALUE_ADD_ANSWER", $this->lng->txt("add"));
     $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("title"));
     $this->tpl->setVariable("TEXT_AUTHOR", $this->lng->txt("author"));
     $this->tpl->setVariable("TEXT_COMMENT", $this->lng->txt("description"));
     $this->tpl->setVariable("TEXT_QUESTION", $this->lng->txt("question"));
     $this->tpl->setVariable("TEXT_RATING", $this->lng->txt("text_rating"));
     $this->tpl->setVariable("TEXT_POINTS", $this->lng->txt("maximum_points"));
     $this->tpl->setVariable("TEXT_CORRECTANSWERS", $this->lng->txt("nr_of_correct_answers"));
     // estimated working time
     $est_working_time = $this->object->getEstimatedWorkingTime();
     $this->tpl->setVariable("TEXT_WORKING_TIME", $this->lng->txt("working_time"));
     $this->tpl->setVariable("TIME_FORMAT", $this->lng->txt("time_format"));
     $this->tpl->setVariable("VALUE_WORKING_TIME", ilUtil::makeTimeSelect("Estimated", false, $est_working_time[h], $est_working_time[m], $est_working_time[s]));
     $this->tpl->setVariable("SAVE", $this->lng->txt("save"));
     $this->tpl->setVariable("SAVE_EDIT", $this->lng->txt("save_edit"));
     $this->tpl->setVariable("CANCEL", $this->lng->txt("cancel"));
     $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
     $this->ctrl->setParameter($this, "sel_question_types", "SyntaxTree");
     $this->tpl->setVariable("ACTION_SYNTAXTREE_TEST", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("TEXT_QUESTION_TYPE", $this->lng->txt("qpl_qst_syntaxtree_syntaxtree_question"));
     //$this->outOtherQuestionData();
     $this->tpl->parseCurrentBlock();
     include_once "./Services/RTE/classes/class.ilRTE.php";
     $rtestring = ilRTE::_getRTEClassname();
     include_once "./Services/RTE/classes/class.{$rtestring}.php";
     $rte = new $rtestring();
     $rte->addPlugin("latex");
     $rte->addButton("latex");
     $rte->addButton("pastelatex");
     include_once "./classes/class.ilObject.php";
     $obj_id = $_GET["q_id"];
     $obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
     $rte->addRTESupport($obj_id, $obj_type, "assessment");
     $this->tpl->setCurrentBlock("adm_content");
     //$this->tpl->setVariable("BODY_ATTRIBUTES", " onload=\"initialSelect();\"");
     $this->tpl->parseCurrentBlock();
 }
 /**
  * Insert property html
  *
  * @return	int	Size
  */
 function insert(&$a_tpl)
 {
     $ttpl = new ilTemplate("tpl.prop_textarea.html", true, true, "Services/Form");
     // disabled rte
     if ($this->getUseRte() && $this->getDisabled()) {
         $ttpl->setCurrentBlock("disabled_rte");
         $ttpl->setVariable("DR_VAL", $this->getValue());
         $ttpl->parseCurrentBlock();
     } else {
         if ($this->getUseRte()) {
             $rtestring = ilRTE::_getRTEClassname();
             include_once "./Services/RTE/classes/class.{$rtestring}.php";
             $rte = new $rtestring($this->rteSupport['version']);
             $rte->setInitialWidth($this->getInitialRteWidth());
             // @todo: Check this.
             $rte->addPlugin("emotions");
             foreach ($this->plugins as $plugin) {
                 if (strlen($plugin)) {
                     $rte->addPlugin($plugin);
                 }
             }
             foreach ($this->removeplugins as $plugin) {
                 if (strlen($plugin)) {
                     $rte->removePlugin($plugin);
                 }
             }
             foreach ($this->buttons as $button) {
                 if (strlen($button)) {
                     $rte->addButton($button);
                 }
             }
             $rte->disableButtons($this->getDisabledButtons());
             if ($this->getRTERootBlockElement() !== null) {
                 $rte->setRTERootBlockElement($this->getRTERootBlockElement());
             }
             if (count($this->rteSupport) >= 3) {
                 $rte->addRTESupport($this->rteSupport["obj_id"], $this->rteSupport["obj_type"], $this->rteSupport["module"], false, $this->rteSupport['cfg_template'], $this->rteSupport['hide_switch']);
             } else {
                 // disable all plugins for mini-tagset
                 if (!array_diff($this->getRteTags(), $this->getRteTagSet("mini"))) {
                     $rte->removeAllPlugins();
                     // #13603 - "paste from word" is essential
                     $rte->addPlugin("paste");
                     // #11980 - p-tag is mandatory but we do not want the icons it comes with
                     $rte->disableButtons(array("anchor", "justifyleft", "justifycenter", "justifyright", "justifyfull", "formatselect", "removeformat", "cut", "copy", "paste", "pastetext"));
                     // JF, 2013-12-09
                 }
                 $rte->addCustomRTESupport(0, "", $this->getRteTags());
             }
             $ttpl->touchBlock("prop_ta_w");
             $ttpl->setCurrentBlock("prop_textarea");
             $ttpl->setVariable("ROWS", $this->getRows());
         } else {
             $ttpl->touchBlock("no_rteditor");
             if ($this->getCols() > 5) {
                 $ttpl->setCurrentBlock("prop_ta_c");
                 $ttpl->setVariable("COLS", $this->getCols());
                 $ttpl->parseCurrentBlock();
             } else {
                 $ttpl->touchBlock("prop_ta_w");
             }
             $ttpl->setCurrentBlock("prop_textarea");
             $ttpl->setVariable("ROWS", $this->getRows());
         }
         if (!$this->getDisabled()) {
             $ttpl->setVariable("POST_VAR", $this->getPostVar());
         }
         $ttpl->setVariable("ID", $this->getFieldId());
         if ($this->getDisabled()) {
             $ttpl->setVariable('DISABLED', 'disabled="disabled" ');
         }
         $ttpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
         $ttpl->parseCurrentBlock();
     }
     if ($this->getDisabled()) {
         $ttpl->setVariable("HIDDEN_INPUT", $this->getHiddenTag($this->getPostVar(), $this->getValue()));
     }
     $a_tpl->setCurrentBlock("prop_generic");
     $a_tpl->setVariable("PROP_GENERIC", $ttpl->get());
     $a_tpl->parseCurrentBlock();
 }