/** * 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"); }
/** * 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"); }
/** * Constructor * */ function ilSetupGUI() { global $tpl, $lng; $this->tpl = $tpl; $this->lng = $lng; // note: this is currently only used for subtabs, alex 8.1.2012 include_once "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"; $this->tabs = new ilTabsGUI(); $this->tabs->setSetupMode(true); include_once "./Services/jQuery/classes/class.iljQueryUtil.php"; iljQueryUtil::initjQuery($this->tpl); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); // CVS - REVISION - DO NOT MODIFY $this->revision = '$Revision$'; $this->version = "2 " . substr(substr($this->revision, 1), 0, -2); $this->lang = $this->lng->lang_key; // init setup $this->setup = new ilSetup($_SESSION["auth"], $_SESSION["access_mode"]); // init client object if exists $client_id = $_GET["client_id"] ? $_GET["client_id"] : $_SESSION["ClientId"]; if ($_POST["client_id"] != "") { $client_id = $_POST["client_id"]; } /*if ($_POST["client_id"] == "") { echo "<br>+".$_GET["client_id"]; echo "<br>+".$_POST["client_id"]; echo "<br>+".$_SESSION["ClientId"]; echo "<br>+".$client_id; }*/ // for security if (!$this->setup->isAdmin() and $client_id != $_SESSION["ClientId"]) { $client_id = $_SESSION["ClientId"]; } $this->client_id = $client_id; $this->setup->ini_client_exists = $this->setup->newClient($client_id); if (is_object($this->setup->getClient())) { $this->setup->getClient()->status = $this->setup->getStatus($client_id); } // determine command if (($this->cmd = $_GET["cmd"]) == "gateway") { // surpress warning if POST is not set @($this->cmd = key($_POST["cmd"])); } // determine display mode here // TODO: depending on previous setting (session) // OR switch to 'setup'-mode if someone logs in as client and client's setup wasn't finished (-> entry in settings table does not exist) if ($this->setup->isAuthenticated() and !$this->setup->getClient()->status["finish"]["status"] and $this->cmd != "clientlist" and $this->cmd != "") { $this->setDisplayMode("setup"); } else { $this->setDisplayMode($_SESSION["display_mode"]); } // output starts here // main cmd handling if (!$this->setup->isAuthenticated() or !$this->setup->isInstalled()) { // check for first time installation or migrate an old one first if (!$this->setup->isInstalled() or !$this->setup->ini->readVariable("clients", "path")) { $this->cmdInstall(); } else { if ($this->cmd == "performLogin" || $this->cmd == "performMLogin") { $cmd = $this->cmd; $this->{$cmd}(); } else { $this->displayLogin(); } } } else { if ($this->setup->isAdmin()) { $this->cmdAdmin(); } else { $this->cmdClient(); } } // display header $this->displayHeader(); if (DEBUG) { echo "cmd: " . $this->cmd . " | access: " . $this->setup->access_mode . " | display: " . $this->display_mode; var_dump($this->setup->getClient()->status); } // display footer $this->displayFooter(); // end output }
/** * 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"); }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_kvpwizardinput.html", true, true, "Modules/TestQuestionPool"); $i = 0; foreach ($this->values as $value) { if (is_array($value)) { $tpl->setCurrentBlock("prop_key_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value[0])); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("prop_value_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value[1])); $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("ROW_NUMBER", $i); $tpl->setVariable("KEY_SIZE", $this->getKeySize()); $tpl->setVariable("KEY_ID", $this->getPostVar() . "[key][{$i}]"); $tpl->setVariable("KEY_MAXLENGTH", $this->getKeyMaxlength()); $tpl->setVariable("VALUE_SIZE", $this->getValueSize()); $tpl->setVariable("VALUE_ID", $this->getPostVar() . "[value][{$i}]"); $tpl->setVariable("VALUE_MAXLENGTH", $this->getValueMaxlength()); $tpl->setVariable("ID", $this->getPostVar() . "[{$i}]"); $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->parseCurrentBlock(); $i++; } $tpl->setVariable("ELEMENT_ID", $this->getPostVar()); $tpl->setVariable("KEY_TEXT", $this->getKeyName()); $tpl->setVariable("VALUE_TEXT", $this->getValueName()); $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/kvpwizard.js"); }
/** * init form * * @access protected * @param string mode ('edit' | 'create') * @return */ protected function initForm($a_mode, $a_as_milestone = false, $a_edit_single_app = false) { global $ilUser, $tpl; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarRecurrenceGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php'; include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; $this->form = new ilPropertyFormGUI(); include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $resp_info = false; switch ($a_mode) { case 'create': $this->ctrl->saveParameter($this, array('seed', 'idate')); $this->form->setFormAction($this->ctrl->getFormAction($this)); if ($a_as_milestone) { $this->form->setTitle($this->lng->txt('cal_new_ms')); $this->form->addCommandButton('saveMilestone', $this->lng->txt('cal_add_milestone')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } else { $this->form->setTitle($this->lng->txt('cal_new_app')); $this->form->addCommandButton('save', $this->lng->txt('cal_add_appointment')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } break; case 'edit': if ($a_as_milestone) { $this->form->setTitle($this->lng->txt('cal_edit_milestone')); } else { $this->form->setTitle($this->lng->txt('cal_edit_appointment')); } $this->ctrl->saveParameter($this, array('seed', 'app_id', 'idate')); $this->form->setFormAction($this->ctrl->getFormAction($this)); $ass = new ilCalendarCategoryAssignments($this->app->getEntryId()); $cat = $ass->getFirstAssignment(); include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat); $type = ilObject::_lookupType($cat_info['obj_id']); if ($a_as_milestone && $cat_info['type'] == ilCalendarCategory::TYPE_OBJ && ($type == "grp" || $type == "crs")) { $resp_info = true; $this->form->addCommandButton('editResponsibleUsers', $this->lng->txt('cal_change_responsible_users')); } $this->form->addCommandButton('update', $this->lng->txt('save')); // $this->form->addCommandButton('askDelete',$this->lng->txt('delete')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); break; } // title $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValue($this->app->getTitle()); $title->setRequired(true); $title->setMaxLength(128); $title->setSize(32); $this->form->addItem($title); // calendar selection $calendar = new ilSelectInputGUI($this->lng->txt('cal_category_selection'), 'calendar'); if ($_POST['category']) { $calendar->setValue((int) $_POST['calendar']); $selected_calendar = (int) $_POST['calendar']; } else { if ($_GET['category_id']) { $calendar->setValue((int) $_GET['category_id']); $selected_calendar = (int) $_GET['category_id']; } elseif ($a_mode == 'edit') { $ass = new ilCalendarCategoryAssignments($this->app->getEntryId()); $cat = $ass->getFirstAssignment(); $calendar->setValue($cat); $selected_calendar = $cat; } elseif (isset($_GET['ref_id'])) { include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $obj_cal = ilObject::_lookupObjId($_GET['ref_id']); $calendar->setValue(ilCalendarCategories::_lookupCategoryIdByObjId($obj_cal)); $selected_calendar = ilCalendarCategories::_lookupCategoryIdByObjId($obj_cal); } } $calendar->setRequired(true); $cats = ilCalendarCategories::_getInstance($ilUser->getId()); $calendar->setOptions($cats->prepareCategoriesOfUserForSelection()); include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if (ilCalendarSettings::_getInstance()->isNotificationEnabled()) { $notification_cals = $cats->getNotificationCalendars(); $notification_cals = count($notification_cals) ? implode(',', $notification_cals) : ''; $calendar->addCustomAttribute("onchange=\"ilToggleNotification(new Array(" . $notification_cals . "));\""); } $this->form->addItem($calendar); if (!$a_as_milestone) { include_once './Services/Form/classes/class.ilDateDurationInputGUI.php'; $tpl->addJavaScript('./Services/Form/js/date_duration.js'); $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event'); $dur->setStartText($this->lng->txt('cal_start')); $dur->setEndText($this->lng->txt('cal_end')); $dur->enableToggleFullTime($this->lng->txt('cal_fullday_title'), $this->app->isFullday() ? true : false); $dur->setShowTime(true); $dur->setStart($this->app->getStart()); $dur->setEnd($this->app->getEnd()); $this->form->addItem($dur); // recurrence include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setRecurrence($this->rec); $this->form->addItem($rec); // location $where = new ilTextInputGUI($this->lng->txt('cal_where'), 'location'); $where->setValue($this->app->getLocation()); $where->setMaxLength(128); $where->setSize(32); $this->form->addItem($where); } else { $deadline = new ilDateTimeInputGUI($this->lng->txt('cal_deadline'), 'event[start]'); $deadline->setDate($this->app->getStart()); $deadline->setShowTime(false); $deadline->setMinuteStepSize(5); $this->form->addItem($deadline); // completion $completion_vals = array(); for ($i = 0; $i <= 100; $i += 5) { $completion_vals[$i] = $i . " %"; } $compl = new ilSelectInputGUI($this->lng->txt('cal_task_completion'), 'completion'); $compl->setOptions($completion_vals); $compl->setValue($this->app->getCompletion()); $this->form->addItem($compl); } $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $desc->setValue($this->app->getDescription()); $desc->setRows(5); $this->form->addItem($desc); if ($a_as_milestone && $a_mode == "edit" && $resp_info) { // users responsible $users = $this->app->readResponsibleUsers(); $resp = new ilNonEditableValueGUI($this->lng->txt('cal_responsible'), $users); $delim = ""; foreach ($users as $r) { $value .= $delim . $r["lastname"] . ", " . $r["firstname"] . " [" . $r["login"] . "]"; $delim = "<br />"; } if (count($users) > 0) { $resp->setValue($value); } else { $resp->setValue("-"); } $this->form->addItem($resp); } if (ilCalendarSettings::_getInstance()->isUserNotificationEnabled()) { $notu = new ilTextWizardInputGUI($this->lng->txt('cal_user_notification'), 'notu'); $notu->setInfo($this->lng->txt('cal_user_notification_info')); $notu->setSize(20); $notu->setMaxLength(64); $values = array(); foreach ($this->notification->getRecipients() as $rcp) { switch ($rcp['type']) { case ilCalendarUserNotification::TYPE_USER: $values[] = ilObjUser::_lookupLogin($rcp['usr_id']); break; case ilCalendarUserNotification::TYPE_EMAIL: $values[] = $rcp['email']; break; } } if (count($values)) { $notu->setValues($values); } else { $notu->setValues(array('')); } $this->form->addItem($notu); } // Notifications include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if (ilCalendarSettings::_getInstance()->isNotificationEnabled() and count($cats->getNotificationCalendars())) { $selected_cal = new ilCalendarCategory($selected_calendar); $disabled = true; if ($selected_cal->getType() == ilCalendarCategory::TYPE_OBJ) { if (ilObject::_lookupType($selected_cal->getObjId()) == 'crs' or ilObject::_lookupType($selected_cal->getObjId()) == 'grp') { $disabled = false; } } $tpl->addJavaScript('./Services/Calendar/js/toggle_notification.js'); $not = new ilCheckboxInputGUI($this->lng->txt('cal_cg_notification'), 'not'); $not->setInfo($this->lng->txt('cal_notification_info')); $not->setValue(1); $not->setChecked($this->app->isNotificationEnabled()); $not->setDisabled($disabled); $this->form->addItem($not); } }
function getTestOutput($active_id, $pass = NULL, $is_postponed = FALSE, $use_post_solutions = FALSE) { // get the solution of the user for the active pass or from the last pass if allowed $user_solution = ""; 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); foreach ($solutions as $idx => $solution_value) { $user_solution = $solution_value["value1"]; } } // generate the question output include_once "./Services/UICore/classes/class.ilTemplate.php"; $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", TRUE, TRUE, "Modules/TestQuestionPool"); if ($this->object->getMaxNumOfChars()) { $template->setCurrentBlock("maximum_char_hint"); $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars())); $template->parseCurrentBlock(); #mbecker: No such block. $template->setCurrentBlock("has_maxchars"); $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars()); $template->parseCurrentBlock(); $template->setCurrentBlock("maxchars_counter"); $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars()); $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars())); $template->setVariable("CHARACTERS", $this->lng->txt("characters")); $template->parseCurrentBlock(); } $template->setVariable("ESSAY", ilUtil::prepareFormOutput($user_solution)); $questiontext = $this->object->getQuestion(); $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE)); $questionoutput = $template->get(); $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); return $pageoutput; }
/** * Creates a booking form. * * @return ilform */ private function createForm() { $form = new ilPropertyFormGUI(); include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTitle($this->getFormTitle()); $form->addCommandButton(self::BOOK_CMD, $this->lng->txt("rep_robj_xrs_room_book")); $form_items = $this->createFormItems(); foreach ($form_items as $item) { $form->addItem($item); } return $form; }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_matrixrowwizardinput.html", true, true, "Modules/SurveyQuestionPool"); $i = 0; if (is_object($this->values)) { for ($i = 0; $i < $this->values->getCategoryCount(); $i++) { $cat = $this->values->getCategory($i); $tpl->setCurrentBlock("prop_text_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->title)); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("prop_label_propval"); $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($cat->label)); $tpl->parseCurrentBlock(); if ($this->getUseOtherAnswer()) { $tpl->setCurrentBlock("other_answer_checkbox"); $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->setVariable("OTHER_ID", $this->getPostVar() . "[other][{$i}]"); $tpl->setVariable("ROW_NUMBER", $i); if ($cat->other) { $tpl->setVariable("CHECKED_OTHER", ' checked="checked"'); } $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 == $this->values->getCategoryCount() - 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("ID_LABEL", $this->getPostVar() . "[label][{$i}]"); $tpl->setVariable("SIZE", $this->getSize()); $tpl->setVariable("SIZE_LABEL", 15); $tpl->setVariable("MAXLENGTH", $this->getMaxLength()); if ($this->getDisabled()) { $tpl->setVariable("DISABLED", " disabled=\"disabled\""); $tpl->setVariable("DISABLED_LABEL", " disabled=\"disabled\""); } $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->parseCurrentBlock(); } } if ($this->getShowWizard()) { $tpl->setCurrentBlock("wizard"); $tpl->setVariable("CMD_WIZARD", 'cmd[wizard' . $this->getFieldId() . ']'); $tpl->setVariable("WIZARD_BUTTON", ilUtil::getImagePath('wizard.png')); $tpl->setVariable("WIZARD_TEXT", $lng->txt('add_phrase')); $tpl->parseCurrentBlock(); } if ($this->getShowSavePhrase()) { $tpl->setCurrentBlock('savephrase'); $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->setVariable("VALUE_SAVE_PHRASE", $lng->txt('save_phrase')); $tpl->parseCurrentBlock(); } if ($this->getUseOtherAnswer()) { $tpl->setCurrentBlock('other_answer_title'); $tpl->setVariable("OTHER_TEXT", $lng->txt('use_other_answer')); $tpl->parseCurrentBlock(); } $tpl->setVariable("ELEMENT_ID", $this->getPostVar()); $tpl->setVariable("ANSWER_TEXT", $this->getCategoryText()); $tpl->setVariable("LABEL_TEXT", $this->getLabelText()); $tpl->setVariable("ACTIONS_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/SurveyQuestionPool/templates/default/matrixrowwizard.js"); }
/** * Returns the list of answers of a users test pass and offers a scoring option * * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult) * @param integer $active_id Active ID of the active user * @param integer $pass Test pass * @param boolean $show_solutions TRUE, if the solution output should be shown in the answers, FALSE otherwise * @return string HTML code of the list of answers * @access public * * @deprecated */ function getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions = FALSE) { include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", TRUE, TRUE, "Modules/Test"); include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php"; $scoring = ilObjAssessmentFolder::_getManualScoring(); $counter = 1; // output of questions with solutions foreach ($result_array as $question_data) { $question = $question_data["qid"]; if (is_numeric($question)) { $question_gui = $this->object->createQuestionGUI("", $question); if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) { $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool"); $scoretemplate = new ilTemplate("tpl.il_as_tst_manual_scoring_points.html", TRUE, TRUE, "Modules/Test"); #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question"); $template->setVariable("COUNTER_QUESTION", $counter . ". "); $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle())); $points = $question_gui->object->getMaximumPoints(); if ($points == 1) { $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("point")); } else { $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("points")); } $show_question_only = $this->object->getShowSolutionAnswersOnly() ? TRUE : FALSE; $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions, FALSE, $show_question_only, $this->object->getShowSolutionFeedback(), FALSE, TRUE); $solout = $question_gui->object->getSuggestedSolutionOutput(); if (strlen($solout)) { $scoretemplate->setCurrentBlock("suggested_solution"); $scoretemplate->setVariable("TEXT_SUGGESTED_SOLUTION", $this->lng->txt("solution_hint")); $scoretemplate->setVariable("VALUE_SUGGESTED_SOLUTION", $solout); $scoretemplate->parseCurrentBlock(); } $scoretemplate->setCurrentBlock("feedback"); $scoretemplate->setVariable("FEEDBACK_NAME_INPUT", $question); $feedback = $this->object->getManualFeedback($active_id, $question, $pass); $scoretemplate->setVariable("VALUE_FEEDBACK", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, TRUE))); $scoretemplate->setVariable("TEXT_MANUAL_FEEDBACK", $this->lng->txt("set_manual_feedback")); $scoretemplate->parseCurrentBlock(); $scoretemplate->setVariable("NAME_INPUT", $question); $this->ctrl->setParameter($this, "active_id", $active_id); $this->ctrl->setParameter($this, "pass", $pass); $scoretemplate->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "manscoring")); $scoretemplate->setVariable("LABEL_INPUT", $this->lng->txt("tst_change_points_for_question")); $scoretemplate->setVariable("VALUE_INPUT", " value=\"" . assQuestion::_getReachedPoints($active_id, $question_data["qid"], $pass) . "\""); $scoretemplate->setVariable("VALUE_SAVE", $this->lng->txt("save")); $template->setVariable("SOLUTION_OUTPUT", $result_output); $maintemplate->setCurrentBlock("printview_question"); $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get()); $maintemplate->setVariable("QUESTION_SCORING", $scoretemplate->get()); $maintemplate->parseCurrentBlock(); } $counter++; } } if ($counter == 1) { // no scorable questions found $maintemplate->setVariable("NO_QUESTIONS_FOUND", $this->lng->txt("manscoring_questions_not_found")); } $maintemplate->setVariable("RESULTS_OVERVIEW", sprintf($this->lng->txt("manscoring_results_pass"), $pass + 1)); include_once "./Services/YUI/classes/class.ilYuiUtil.php"; ilYuiUtil::initDomEvent(); return $maintemplate->get(); }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_essaykeywordswizardinput.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->getPointsChecked())); $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("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("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')); $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"); }
/** * Insert property html * * @return int Size */ function insert(&$a_tpl) { global $lng; $tpl = new ilTemplate("tpl.prop_matchingpairinput.html", true, true, "Modules/TestQuestionPool"); $i = 0; foreach ($this->pairs as $pair) { $counter = 1; $tpl->setCurrentBlock("option_term"); $tpl->setVariable("TEXT_OPTION", ilUtil::prepareFormOutput($lng->txt('please_select'))); $tpl->setVariable("VALUE_OPTION", 0); $tpl->parseCurrentBlock(); foreach ($this->terms as $term) { $tpl->setCurrentBlock("option_term"); $tpl->setVariable("VALUE_OPTION", ilUtil::prepareFormOutput($term->identifier)); $tpl->setVariable("TEXT_OPTION", $lng->txt('term') . " " . $counter); if ($pair->term->identifier == $term->identifier) { $tpl->setVariable('SELECTED_OPTION', ' selected="selected"'); } $tpl->parseCurrentBlock(); $counter++; } $counter = 1; $tpl->setCurrentBlock("option_definition"); $tpl->setVariable("TEXT_OPTION", ilUtil::prepareFormOutput($lng->txt('please_select'))); $tpl->setVariable("VALUE_OPTION", 0); $tpl->parseCurrentBlock(); foreach ($this->definitions as $definition) { $tpl->setCurrentBlock("option_definition"); $tpl->setVariable("VALUE_OPTION", ilUtil::prepareFormOutput($definition->identifier)); $tpl->setVariable("TEXT_OPTION", $lng->txt('definition') . " " . $counter); if ($pair->definition->identifier == $definition->identifier) { $tpl->setVariable('SELECTED_OPTION', ' selected="selected"'); } $tpl->parseCurrentBlock(); $counter++; } if (strlen($pair->points)) { $tpl->setCurrentBlock('points_value'); $tpl->setVariable('POINTS_VALUE', $pair->points); $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("ROW_NUMBER", $i); $tpl->setVariable("ID", $this->getPostVar() . "[{$i}]"); $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][{$i}]"); $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png')); $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->parseCurrentBlock(); $i++; } $tpl->setCurrentBlock('term_ids'); $ids = array(); foreach ($this->terms as $term) { array_push($ids, $term->identifier); } $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->setVariable("TERM_IDS", join($ids, ",")); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock('definition_ids'); $ids = array(); foreach ($this->definitions as $definition) { array_push($ids, $definition->identifier); } $tpl->setVariable("POST_VAR", $this->getPostVar()); $tpl->setVariable("DEFINITION_IDS", join($ids, ",")); $tpl->parseCurrentBlock(); $tpl->setVariable("ELEMENT_ID", $this->getPostVar()); $tpl->setVariable("TEXT_POINTS", $lng->txt('points')); $tpl->setVariable("TEXT_DEFINITION", $lng->txt('definition')); $tpl->setVariable("TEXT_TERM", $lng->txt('term')); $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/matchingpairwizard.js"); }
/** * Insert property html */ function insert(&$a_tpl) { global $lng; $template = new ilTemplate("tpl.prop_imagemap_file.html", true, true, "Modules/TestQuestionPool"); $this->outputSuffixes($template, "allowed_image_suffixes"); if ($this->getImage() != "") { if (strlen($this->getValue())) { $template->setCurrentBlock("has_value"); $template->setVariable("TEXT_IMAGE_NAME", $this->getValue()); $template->setVariable("POST_VAR_D", $this->getPostVar()); $template->parseCurrentBlock(); } $template->setCurrentBlock("image"); if (count($this->getAreas())) { include_once "./Modules/TestQuestionPool/classes/class.ilImagemapPreview.php"; $preview = new ilImagemapPreview($this->getImagePath() . $this->getValue()); foreach ($this->getAreas() as $index => $area) { $preview->addArea($index, $area->getArea(), $area->getCoords(), $area->getAnswertext(), "", "", true, $this->getLineColor()); } $preview->createPreview(); $imagepath = $this->getImagePathWeb() . $preview->getPreviewFilename($this->getImagePath(), $this->getValue()) . "?img=" . time(); $template->setVariable("SRC_IMAGE", $imagepath); } else { $template->setVariable("SRC_IMAGE", $this->getImage()); } $template->setVariable("ALT_IMAGE", $this->getAlt()); $template->setVariable("POST_VAR_D", $this->getPostVar()); $template->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file")); $template->setVariable("TEXT_ADD_RECT", $lng->txt('add_rect')); $template->setVariable("TEXT_ADD_CIRCLE", $lng->txt('add_circle')); $template->setVariable("TEXT_ADD_POLY", $lng->txt('add_poly')); $template->parseCurrentBlock(); } if (is_array($this->getAreas())) { $counter = 0; foreach ($this->getAreas() as $area) { if (strlen($area->getPoints())) { $template->setCurrentBlock('area_points_value'); $template->setVariable('VALUE_POINTS', $area->getPoints()); $template->parseCurrentBlock(); } if (strlen($area->getAnswertext())) { $template->setCurrentBlock('area_name_value'); $template->setVariable('VALUE_NAME', $area->getAnswertext()); $template->parseCurrentBlock(); } $template->setCurrentBlock('row'); $class = $counter % 2 == 0 ? "even" : "odd"; if ($counter == 0) { $class .= " first"; } if ($counter == count($this->getAreas()) - 1) { $class .= " last"; } $template->setVariable("ROW_CLASS", $class); $template->setVariable('POST_VAR_R', $this->getPostVar()); $template->setVariable('TEXT_SHAPE', strtoupper($area->getArea())); $template->setVariable('VALUE_SHAPE', $area->getArea()); $coords = preg_replace("/(\\d+,\\d+,)/", "\$1 ", $area->getCoords()); $template->setVariable('VALUE_COORDINATES', $area->getCoords()); $template->setVariable('TEXT_COORDINATES', $coords); $template->setVariable('COUNTER', $counter); $template->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png')); $template->parseCurrentBlock(); $counter++; } $template->setCurrentBlock("areas"); $template->setVariable("TEXT_NAME", $lng->txt("hint")); $template->setVariable("TEXT_POINTS", $lng->txt("points")); $template->setVariable("TEXT_SHAPE", $lng->txt("shape")); $template->setVariable("TEXT_COORDINATES", $lng->txt("coordinates")); $template->setVariable("TEXT_COMMANDS", $lng->txt("actions")); $template->parseCurrentBlock(); } $template->setVariable("POST_VAR", $this->getPostVar()); $template->setVariable("ID", $this->getFieldId()); $template->setVariable("TXT_MAX_SIZE", $lng->txt("file_notice") . " " . $this->getMaxFileSizeString()); $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::initDomEvent(); $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/imagemap.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); }
/** * Init Form * * @access protected */ protected function initForm($a_mode) { global $ilUser; if (is_object($this->form)) { return true; } $this->lng->loadLanguageModule('dateplaner'); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $this->form = new ilPropertyFormGUI(); $this->form->setMultipart(true); $this->form->setTableWidth('600px'); $this->form->setFormAction($this->ctrl->getFormAction($this)); $this->form->setMultipart(true); /* $full = new ilCheckboxInputGUI('','fulltime'); $full->setChecked($this->object->getFirstAppointment()->enabledFulltime() ? true : false); $full->setOptionTitle($this->lng->txt('event_fulltime_info')); $full->setAdditionalAttributes('onchange="ilToggleSessionTime(this);"'); #$this->form->addItem($full); */ $this->lng->loadLanguageModule('dateplaner'); include_once './Services/Form/classes/class.ilDateDurationInputGUI.php'; #$this->tpl->addJavaScript('./Modules/Session/js/toggle_session_time.js'); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event'); $dur->setStartText($this->lng->txt('event_start_date')); $dur->setEndText($this->lng->txt('event_end_date')); $dur->enableToggleFullTime($this->lng->txt('event_fulltime_info'), $this->object->getFirstAppointment()->enabledFulltime() ? true : false); $dur->setMinuteStepSize(5); $dur->setShowTime(true); $dur->setShowDate(true); $dur->setStart($this->object->getFirstAppointment()->getStart()); $dur->setEnd($this->object->getFirstAppointment()->getEnd()); $this->form->addItem($dur); /* // start $start = new ilDateTimeInputGUI($this->lng->txt('event_start_date'),'start'); $start->setMinuteStepSize(5); $start->setDate($this->object->getFirstAppointment()->getStart()); $start->setShowTime(true); #$this->form->addItem($start); // end $end = new ilDateTimeInputGUI($this->lng->txt('event_end_date'),'end'); $end->setMinuteStepSize(5); $end->setDate($this->object->getFirstAppointment()->getEnd()); $end->setShowTime(true); #$this->form->addItem($end); */ // Recurrence if ($a_mode == 'create') { if (!is_object($this->rec)) { include_once './Modules/Session/classes/class.ilEventRecurrence.php'; $this->rec = new ilEventRecurrence(); } include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->allowUnlimitedRecurrences(false); $rec->setRecurrence($this->rec); $this->form->addItem($rec); } $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('event_section_information')); $this->form->addItem($section); // title $title = new ilTextInputGUI($this->lng->txt('event_title'), 'title'); $title->setValue($this->object->getTitle()); $title->setSize(50); $title->setMaxLength(70); $this->form->addItem($title); // desc $desc = new ilTextAreaInputGUI($this->lng->txt('event_desc'), 'desc'); $desc->setValue($this->object->getLongDescription()); $desc->setRows(4); $desc->setCols(50); $this->form->addItem($desc); // location $desc = new ilTextAreaInputGUI($this->lng->txt('event_location'), 'location'); $desc->setValue($this->object->getLocation()); $desc->setRows(4); $desc->setCols(50); $this->form->addItem($desc); // workflow $details = new ilTextAreaInputGUI($this->lng->txt('event_details_workflow'), 'details'); $details->setValue($this->object->getDetails()); $details->setCols(50); $details->setRows(4); $this->form->addItem($details); // section $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('event_tutor_data')); $this->form->addItem($section); // name $tutor_name = new ilTextInputGUI($this->lng->txt('tutor_name'), 'tutor_name'); $tutor_name->setValue($this->object->getName()); $tutor_name->setSize(20); $tutor_name->setMaxLength(70); $this->form->addItem($tutor_name); // email $tutor_email = new ilTextInputGUI($this->lng->txt('tutor_email'), 'tutor_email'); $tutor_email->setValue($this->object->getEmail()); $tutor_email->setSize(20); $tutor_email->setMaxLength(70); $this->form->addItem($tutor_email); // phone $tutor_phone = new ilTextInputGUI($this->lng->txt('tutor_phone'), 'tutor_phone'); $tutor_phone->setValue($this->object->getPhone()); $tutor_phone->setSize(20); $tutor_phone->setMaxLength(70); $this->form->addItem($tutor_phone); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('crs_further_settings')); $this->form->addItem($section); // registration $reg = new ilCheckboxInputGUI($this->lng->txt('event_registration'), 'registration'); $reg->setChecked($this->object->enabledRegistration() ? true : false); $reg->setOptionTitle($this->lng->txt('event_registration_info')); $this->form->addItem($reg); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('event_assign_files')); $this->form->addItem($section); $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files'); $files->setFilenames(array(0 => '')); $this->form->addItem($files); switch ($a_mode) { case 'create': $this->form->setTitle($this->lng->txt('event_table_create')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png')); $this->form->addCommandButton('save', $this->lng->txt('event_btn_add')); $this->form->addCommandButton('saveAndAssignMaterials', $this->lng->txt('event_btn_add_edit')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); return true; case 'edit': $this->form->setTitle($this->lng->txt('event_table_update')); $this->form->setTitleIcon(ilUtil::getImagePath('icon_event.png')); $this->form->addCommandButton('update', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); return true; } return true; }
/** * 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 and returns the search form. * * @return \ilRoomSharingSearchFormGUI the customized search form */ private function createForm() { $search_form = new ilRoomSharingSearchFormGUI(); ilYuiUtil::initDomEvent(); $search_form->setId("searchform"); $search_form->setTitle($this->lng->txt("search")); $search_form->addCommandButton("applySearch", $this->lng->txt("rep_robj_xrs_search")); $search_form->addCommandButton("resetSearch", $this->lng->txt("reset")); $search_form->setFormAction($this->ctrl->getFormAction($this)); $this->search_form = $search_form; $form_items = $this->createFormItems(); foreach ($form_items as $item) { $search_form->addItem($item); } return $search_form; }