/**
  * Display mark schema
  * @param ilPropertyFormGUI $ects_form
  */
 protected function showMarkSchema(ilPropertyFormGUI $ects_form = null)
 {
     if (!$this->object->canEditMarks()) {
         ilUtil::sendInfo($this->lng->txt('cannot_edit_marks'));
     }
     $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'showMarkSchema'));
     if ($this->object->canEditMarks()) {
         require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
         $create_simple_mark_schema_button = ilSubmitButton::getInstance();
         $create_simple_mark_schema_button->setCaption($this->lng->txt('tst_mark_create_simple_mark_schema'), false);
         $create_simple_mark_schema_button->setCommand('addSimpleMarkSchema');
         $this->toolbar->addButtonInstance($create_simple_mark_schema_button);
     }
     require_once 'Modules/Test/classes/tables/class.ilMarkSchemaTableGUI.php';
     $mark_schema_table = new ilMarkSchemaTableGUI($this, 'showMarkSchema', '', $this->object);
     $content_parts = array($mark_schema_table->getHTML());
     if ($this->objectSupportsEctsGrades() && $this->object->canEditEctsGrades()) {
         if (!$ects_form instanceof ilPropertyFormGUI) {
             $ects_form = $this->getEctsForm();
             $this->populateEctsForm($ects_form);
         }
         $content_parts[] = $ects_form->getHTML();
     }
     $this->tpl->setContent(implode('<br />', $content_parts));
 }
 /**
  * Display all types in a table with actions to edit/delete
  */
 protected function listTypes()
 {
     $button = ilLinkButton::getInstance();
     $button->setCaption('orgu_type_add');
     $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
     $this->toolbar->addButtonInstance($button);
     $table = new ilOrgUnitTypeTableGUI($this, 'listTypes');
     $this->tpl->setContent($table->getHTML());
 }
 /**
  * Get confirmation screen HTML.
  *
  * @return	string		HTML code.
  */
 public final function getHTML()
 {
     global $lng;
     ilUtil::sendQuestion($this->getHeaderText());
     include_once "./Services/Utilities/classes/class.ilConfirmationTableGUI.php";
     // delete/handle items
     if (count($this->item) > 0) {
         $ctab = new ilConfirmationTableGUI($this->use_images);
         $ctab->setData($this->item);
         // other buttons
         foreach ($this->buttons as $b) {
             $ctab->addCommandButton($b["cmd"], $b["txt"]);
         }
         $ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt);
         $ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt);
         $ctab->setFormAction($this->getFormAction());
         foreach ($this->hidden_item as $hidden_item) {
             $ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]);
         }
         if ($this->form_name) {
             $ctab->setFormName($this->form_name);
         }
         return $ctab->getHTML();
     } else {
         $tb = new ilToolbarGUI();
         $tb->setPreventDoubleSubmission(true);
         $tb->setFormAction($this->getFormAction());
         if ($this->hidden_item) {
             require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
             foreach ($this->hidden_item as $hidden_item) {
                 $hiddenInput = new ilHiddenInputGUI($hidden_item['var']);
                 $hiddenInput->setValue($hidden_item['value']);
                 $tb->addInputItem($hiddenInput);
             }
         }
         require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
         $confirm = ilSubmitButton::getInstance();
         $confirm->setCommand($this->confirm_cmd);
         $confirm->setCaption($this->confirm_txt, false);
         $cancel = ilSubmitButton::getInstance();
         $cancel->setCommand($this->cancel_cmd);
         $cancel->setCaption($this->cancel_txt, false);
         $tb->addButtonInstance($confirm);
         $tb->addButtonInstance($cancel);
         return $tb->getHTML();
     }
 }
 /**
  * Render item
  */
 function render($a_mode = "property_form")
 {
     global $lng, $ilCtrl, $ilObjDataCache, $tree;
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initPanel();
     $GLOBALS["tpl"]->addJavascript("./Services/UIComponent/Explorer2/js/Explorer2.js");
     $tpl = new ilTemplate("tpl.prop_expl_select.html", true, true, "Services/UIComponent/Explorer2");
     // set values
     $val = $this->getValue();
     if (is_array($val)) {
         $val_txt = $sep = "";
         foreach ($val as $v) {
             $tpl->setCurrentBlock("node_hid");
             $tpl->setVariable("HID_NAME", $this->getPostVar() . "[]");
             $tpl->setVariable("HID_VAL", $v);
             $tpl->parseCurrentBlock();
             $val_txt .= $sep . $this->getTitleForNodeId($v);
             $sep = ", ";
             $this->explorer_gui->setNodeOpen($v);
             $this->explorer_gui->setNodeSelected($v);
         }
         $tpl->setVariable("VAL_TXT", $val_txt);
     } else {
         if ($val != "") {
             $tpl->setCurrentBlock("node_hid");
             $tpl->setVariable("HID_NAME", $this->getPostVar());
             $tpl->setVariable("HID_VAL", $val);
             $tpl->parseCurrentBlock();
             $tpl->setVariable("VAL_TXT", $this->getTitleForNodeId($val));
             $this->explorer_gui->setNodeOpen($val);
             $this->explorer_gui->setNodeSelected($val);
         }
     }
     $tpl->setVariable("POST_VAR", $this->getPostVar());
     $tpl->setVariable("ID", $this->getFieldId());
     //		$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($this->getValue()));
     $tpl->setVariable("TXT_SELECT", $lng->txt("select"));
     $tpl->setVariable("TXT_RESET", $lng->txt("reset"));
     $tpl->setVariable("EXPL", $this->explorer_gui->getHTML());
     $top_tb = new ilToolbarGUI();
     include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
     $button = ilLinkButton::getInstance();
     $button->setCaption("select");
     $button->addCSSClass("ilExplSelectInputButS");
     $button->setOmitPreventDoubleSubmission(true);
     $top_tb->addButtonInstance($button);
     $button = ilLinkButton::getInstance();
     $button->setCaption("cancel");
     $button->addCSSClass("ilExplSelectInputButC");
     $button->setOmitPreventDoubleSubmission(true);
     $top_tb->addButtonInstance($button);
     // :TODO: we should probably clone the buttons properly
     $tpl->setVariable("TOP_TB", $top_tb->getHTML());
     $tpl->setVariable("BOT_TB", $top_tb->getHTML());
     //$tpl->setVariable("HREF_SELECT",
     //	$ilCtrl->getLinkTargetByClass(array($parent_gui, "ilformpropertydispatchgui", "ilrepositoryselectorinputgui"),
     //	"showRepositorySelection"));
     /*if ($this->getValue() > 0 && $this->getValue() != ROOT_FOLDER_ID)
     		{
     			$tpl->setVariable("TXT_ITEM",
     				$ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($this->getValue())));
     		}
     		else
     		{
     			$nd = $tree->getNodeData(ROOT_FOLDER_ID);
     			$title = $nd["title"];
     			if ($title == "ILIAS")
     			{
     				$title = $lng->txt("repository");
     			}
     			if (in_array($nd["type"], $this->getClickableTypes()))
     			{
     				$tpl->setVariable("TXT_ITEM", $title);
     			}
     		}*/
     return $tpl->get();
 }