/**
  * Init settings form
  */
 protected function initSettingsForm()
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($GLOBALS['lng']->txt('settings'));
     $form->addCommandButton('update', $GLOBALS['lng']->txt('save'));
     $form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel'));
     // activation
     $active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active');
     $active->setInfo($GLOBALS['lng']->txt('fm_settings_active_info'));
     $active->setValue(1);
     $active->setChecked(ilFMSettings::getInstance()->isEnabled());
     $form->addItem($active);
     // one frame
     $local = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_local'), 'local');
     $local->setInfo($GLOBALS['lng']->txt('fm_settings_local_info'));
     $local->setValue(1);
     $local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled());
     $form->addItem($local);
     $fs = new ilNumberInputGUI($GLOBALS['lng']->txt('fm_settings_filesize'), 'filesize');
     $fs->setSuffix('MiB');
     $fs->setSize(3);
     $fs->setMaxLength(3);
     $fs->setMinValue(1);
     $fs->setMaxValue(999);
     $fs->setInfo($GLOBALS['lng']->txt('fm_settings_filesize_info'));
     $fs->setValue(ilFMSettings::getInstance()->getMaxFileSize());
     $form->addItem($fs);
     return $form;
 }
 protected function initLicenseForm()
 {
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "updateLicense"));
     $form->setTitle($this->lng->txt('edit_license'));
     $exist = new ilNumberInputGUI($this->lng->txt("existing_licenses"), "licenses");
     $exist->setInfo($this->lng->txt("zero_licenses_explanation"));
     $exist->setMaxLength(10);
     $exist->setSize(10);
     $exist->setValue($this->license->getLicenses());
     $form->addItem($exist);
     $info_used = new ilNonEditableValueGUI($this->lng->txt("used_licenses"));
     $info_used->setInfo($this->lng->txt("used_licenses_explanation"));
     $info_used->setValue($this->license->getAccesses());
     $form->addItem($info_used);
     $remaining_licenses = $this->license->getLicenses() == "0" ? $this->lng->txt("arbitrary") : $this->license->getRemainingLicenses();
     $info_remain = new ilNonEditableValueGUI($this->lng->txt("remaining_licenses"));
     $info_remain->setInfo($this->lng->txt("remaining_licenses_explanation"));
     $info_remain->setValue($remaining_licenses);
     $form->addItem($info_remain);
     $info_potential = new ilNonEditableValueGUI($this->lng->txt("potential_accesses"));
     $info_potential->setInfo($this->lng->txt("potential_accesses_explanation"));
     $info_potential->setValue($this->license->getPotentialAccesses());
     $form->addItem($info_potential);
     $comm = new ilTextAreaInputGUI($this->lng->txt("comment"), "remarks");
     $comm->setRows(5);
     $comm->setValue($this->license->getRemarks());
     $form->addItem($comm);
     $form->addCommandButton('updateLicense', $this->lng->txt('save'));
     return $form;
 }
 private function showPasswordFormCmd()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     require_once 'Services/Form/classes/class.ilPasswordInputGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt("tst_password_form"));
     $form->setDescription($this->lng->txt("tst_password_introduction"));
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_ENTERED_PASSWORD, $this->lng->txt("submit"));
     $form->addCommandButton(self::CMD_BACK_TO_INFO_SCREEN, $this->lng->txt("cancel"));
     $inp = new ilPasswordInputGUI($this->lng->txt("tst_password"), 'password');
     $inp->setRequired(true);
     $inp->setRetype(false);
     $form->addItem($inp);
     $this->tpl->setVariable($this->parentGUI->getContentBlockName(), $this->ctrl->getHTML($form));
 }
 /**
  * Init property form
  *
  * @return ilPropertyFormGUI $form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('tracking_settings'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     // Mode
     $mod = new ilRadioGroupInputGUI($this->lng->txt('trac_mode'), 'modus');
     $mod->setRequired(true);
     $mod->setValue($this->obj_lp->getCurrentMode());
     $form->addItem($mod);
     foreach ($this->obj_lp->getValidModes() as $mode_key) {
         $opt = new ilRadioOption($this->obj_lp->getModeText($mode_key), $mode_key, $this->obj_lp->getModeInfoText($mode_key));
         $opt->setValue($mode_key);
         $mod->addOption($opt);
         // :TODO: Subitem for visits ?!
         if ($mode_key == ilLPObjSettings::LP_MODE_VISITS) {
             $vis = new ilNumberInputGUI($this->lng->txt('trac_visits'), 'visits');
             $vis->setSize(3);
             $vis->setMaxLength(4);
             $vis->setInfo(sprintf($this->lng->txt('trac_visits_info'), ilObjUserTracking::_getValidTimeSpan()));
             $vis->setRequired(true);
             $vis->setValue($this->obj_settings->getVisits());
             $opt->addSubItem($vis);
         }
     }
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
 /**
  * @return string
  */
 public function getHTML()
 {
     global $tpl, $ilTabs, $ilCtrl, $lng;
     $form = new ilPropertyFormGUI();
     $ilTabs->clearTargets();
     $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, 'showContent'));
     $form->setTitle($lng->txt('detail_view'));
     // add link button if a link is defined in the settings
     $set = new ilSetting("bibl");
     $link = $set->get(strtolower($this->bibl_obj->getFiletype()));
     if (!empty($link)) {
         $form->addCommandButton('autoLink', 'Link');
     }
     $attributes = $this->entry->getAttributes();
     //translate array key in order to sort by those keys
     foreach ($attributes as $key => $attribute) {
         //Check if there is a specific language entry
         if ($lng->exists($key)) {
             $strDescTranslated = $lng->txt($key);
         } else {
             $arrKey = explode("_", $key);
             $is_standard_field = false;
             switch ($arrKey[0]) {
                 case 'bib':
                     $is_standard_field = ilBibTex::isStandardField($arrKey[2]);
                     break;
                 case 'ris':
                     $is_standard_field = ilRis::isStandardField($arrKey[2]);
                     break;
             }
             //				var_dump($is_standard_field); // FSX
             if ($is_standard_field) {
                 $strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $arrKey[2]);
             } else {
                 $strDescTranslated = $arrKey[2];
             }
         }
         unset($attributes[$key]);
         $attributes[$strDescTranslated] = $attribute;
     }
     // sort attributes alphabetically by their array-key
     ksort($attributes, SORT_STRING);
     // render attributes to html
     foreach ($attributes as $key => $attribute) {
         $ci = new ilCustomInputGUI($key);
         $ci->setHtml($attribute);
         $form->addItem($ci);
     }
     // generate/render links to libraries
     $settings = ilBibliographicSetting::getAll();
     foreach ($settings as $set) {
         $ci = new ilCustomInputGUI($set->getName());
         $ci->setHtml($set->getButton($this->bibl_obj, $this->entry));
         $form->addItem($ci);
     }
     $tpl->setPermanentLink("bibl", $this->bibl_obj->getRefId(), "_" . $_GET[ilObjBibliographicGUI::P_ENTRY_ID]);
     // set content and title
     return $form->getHTML();
     //Permanent Link
 }
 /**
  * Init Social Bookmark edit/create Form
  *
  * @param        ilObjectGUI	$formhandlerObject        taken as form target
  * @param        int        	$mode        "create" / "edit"
  */
 public static function _initForm($formhandlerObject, $mode = "create", $id = 0)
 {
     global $lng, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setMultipart(true);
     // File Title
     $in_title = new ilTextInputGUI($lng->txt("title"), "title");
     $in_title->setMaxLength(128);
     $in_title->setSize(40);
     $in_title->setRequired(true);
     $form->addItem($in_title);
     // Link
     $in_link = new ilTextInputGUI($lng->txt("link"), "link");
     $in_link->setMaxLength(300);
     $in_link->setSize(40);
     $in_link->setRequired(true);
     $in_link->setInfo($lng->txt('socialbm_link_description'));
     $form->addItem($in_link);
     // File
     $in_file = new ilFileInputGUI($lng->txt("file"), "image_file");
     $in_file->setSuffixes(array('bmp', 'gif', 'jpg', 'jpeg', 'png'));
     $form->addItem($in_file);
     // Activate on submit
     $in_activate = new ilCheckboxInputGUI($lng->txt("activate"), "activate");
     $in_activate->setValue('1');
     $form->addItem($in_activate);
     // save and cancel commands
     if ($mode == "create") {
         $form->addCommandButton("createSocialBookmark", $lng->txt("create"));
         $form->addCommandButton("editSocialBookmarks", $lng->txt("cancel"));
         $form->setTitle($lng->txt("adm_social_bm_create"));
         $in_file->setRequired(true);
     } else {
         if ($mode == "update") {
             $in_hidden = new ilHiddenInputGUI("sbm_id", $id);
             $form->addItem($in_hidden);
             $form->addCommandButton("updateSocialBookmark", $lng->txt("update"));
             $form->addCommandButton("cancel", $lng->txt("cancel"));
             $form->setTitle($lng->txt("adm_social_bm_edit"));
             $in_file->setRequired(false);
         }
     }
     $form->setTableWidth("60%");
     $form->setFormAction($ilCtrl->getFormAction($formhandlerObject));
     return $form;
 }
 /**
  * Init create form
  * @param bool creation mode
  * @return ilPropertyFormGUI $form
  */
 protected function initFormRoleTemplate($a_mode = self::FORM_MODE_CREATE)
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     if ($this->creation_mode) {
         $this->ctrl->setParameter($this, "new_type", 'rolt');
     }
     $form->setFormAction($this->ctrl->getFormAction($this));
     if ($a_mode == self::FORM_MODE_CREATE) {
         $form->setTitle($this->lng->txt('rolt_new'));
         $form->addCommandButton('save', $this->lng->txt('rolt_new'));
     } else {
         $form->setTitle($this->lng->txt('rolt_edit'));
         $form->addCommandButton('update', $this->lng->txt('save'));
     }
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     if ($a_mode != self::FORM_MODE_CREATE) {
         if ($this->object->isInternalTemplate()) {
             $title->setDisabled(true);
         }
         $title->setValue($this->object->getTitle());
     }
     $title->setSize(40);
     $title->setMaxLength(70);
     $title->setRequired(true);
     $form->addItem($title);
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     if ($a_mode != self::FORM_MODE_CREATE) {
         $desc->setValue($this->object->getDescription());
     }
     $desc->setCols(40);
     $desc->setRows(3);
     $form->addItem($desc);
     if ($a_mode != self::FORM_MODE_CREATE) {
         $ilias_id = new ilNonEditableValueGUI($this->lng->txt("ilias_id"), "ilias_id");
         $ilias_id->setValue('il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->object->getId()) . '_' . $this->object->getId());
         $form->addItem($ilias_id);
     }
     $pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'), 'protected');
     $pro->setChecked($GLOBALS['rbacreview']->isProtected($this->rolf_ref_id, $this->object->getId()));
     $pro->setValue(1);
     $form->addItem($pro);
     return $form;
 }
 /**
  * Init creation from
  */
 function initForm()
 {
     global $ilCtrl, $lng;
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($this->lng->txt("cont_ed_insert_templ"));
     $radg = new ilRadioGroupInputGUI($lng->txt("cont_template"), "page_templ");
     $radg->setRequired(true);
     $ts = $this->getPage()->getContentTemplates();
     foreach ($ts as $t) {
         $op = new ilRadioOption($t["title"], $t["id"] . ":" . $t["parent_type"]);
         $radg->addOption($op);
     }
     $form->addItem($radg);
     $form->addCommandButton("create_templ", $lng->txt("insert"));
     $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     return $form;
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->addCommandButton("save", $lng->txt("save"));
     $form->setTitle($pl->txt("plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * Edit question overview form.
  */
 function edit($a_insert = false)
 {
     global $ilCtrl, $tpl, $lng;
     $this->displayValidationError();
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_insert) {
         $form->setTitle($this->lng->txt("cont_ed_insert_qover"));
     } else {
         $form->setTitle($this->lng->txt("cont_edit_qover"));
     }
     // short message
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_short_message"), "short");
     $cb->setInfo($this->lng->txt("cont_qover_short_message_info"));
     if (!$a_insert) {
         $cb->setChecked($this->content_obj->getShortMessage());
     } else {
         $cb->setChecked(true);
     }
     $form->addItem($cb);
     // list wrong questions
     $cb = new ilCheckboxInputGUI($this->lng->txt("cont_qover_list_wrong_q"), "wrong_questions");
     $cb->setInfo($this->lng->txt("cont_qover_list_wrong_q_info"));
     if (!$a_insert) {
         $cb->setChecked($this->content_obj->getListWrongQuestions());
     }
     $form->addItem($cb);
     // save/cancel buttons
     if ($a_insert) {
         $form->addCommandButton("create_qover", $lng->txt("save"));
         $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $form->addCommandButton("update", $lng->txt("save"));
         $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
     $html = $form->getHTML();
     $tpl->setContent($html);
     return $ret;
 }
 public function initUploadForm()
 {
     global $ilCtrl, $lng;
     include_once "./Services/Form/classes/class.ilDragDropFileInputGUI.php";
     include_once "./Services/jQuery/classes/class.iljQueryUtil.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setId("upload");
     $this->form->setMultipart(true);
     $this->form->setHideLabels();
     $file = new ilDragDropFileInputGUI($lng->txt("cld_upload_flies"), "upload_files");
     $file->setRequired(true);
     $this->form->addItem($file);
     $this->form->addCommandButton("uploadFiles", $lng->txt("upload"));
     $this->form->addCommandButton("cancelAll", $lng->txt("cancel"));
     $this->form->setTableWidth("100%");
     $this->form->setTitle($lng->txt("upload_files_title"));
     $this->form->setTitleIcon(ilUtil::getImagePath('icon_file.gif'), $lng->txt('obj_file'));
     $this->form->setTitle($lng->txt("upload_files"));
     $this->form->setFormAction($ilCtrl->getFormAction($this, "uploadFiles"));
     $this->form->setTarget("cld_blank_target");
 }
 /**
  *
  */
 protected function initSettingsForm()
 {
     if (null == $this->form) {
         $this->form = new ilPropertyFormGUI();
         $this->form->setTitle($this->lng->txt('tos_tos_settings'));
         $this->form->setFormAction($this->ctrl->getFormAction($this, 'saveSettings'));
         $status = new ilCheckboxInputGUI($this->lng->txt('tos_status_enable'), 'tos_status');
         $status->setInfo($this->lng->txt('tos_status_desc'));
         $this->form->addItem($status);
         $this->form->addCommandButton('saveSettings', $this->lng->txt('save'));
     }
 }
 public function initPropertiesForm()
 {
     $this->form = new ilPropertyFormGUI();
     // Title
     $ti = new ilTextInputGUI($this->txt('title'), 'title');
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // Description
     $ta = new ilTextAreaInputGUI($this->txt('description'), 'desc');
     $this->form->addItem($ta);
     $this->form->addCommandButton('updateProperties', $this->txt('save'));
     $this->form->setTitle($this->txt('edit_properties'));
     $this->form->setFormAction($this->ctrl->getFormAction($this));
 }
 public function showTopicForm()
 {
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     if ($this->objCurrentTopic->getId()) {
         $this->ctrl->setParameter($this, 'topic_id', $this->objCurrentTopic->getId());
     }
     $form->setFormAction($this->ctrl->getFormAction($this, 'saveTopic'));
     $form->setTitle($this->lng->txt($this->objCurrentTopic->getId() ? 'edit_topic' : 'new_topic'));
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setValue($this->objCurrentTopic->getTitle());
     $title->setRequired(true);
     $form->addItem($title);
     $sorting = new ilTextInputGUI($this->lng->txt('pay_sorting_value'), 'sorting');
     $sorting->setValue($this->objCurrentTopic->getSorting());
     $sorting->setMaxLength(11);
     $sorting->setSize(11);
     $form->addItem($sorting);
     $form->addCommandButton('saveTopic', $this->lng->txt('save'));
     $form->addCommandButton('showTopicsList', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
     return true;
 }
 function owner()
 {
     $this->__initSubTabs("owner");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
     $form->setTitle($this->lng->txt("info_owner_of_object"));
     $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
     $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
     $login->setRequired(true);
     $login->setSize(50);
     $login->setInfo($this->lng->txt("chown_warning"));
     $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
     $form->addItem($login);
     $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
     $this->tpl->setContent($form->getHTML());
 }
 /**
  *	Configure the displayed form for Settings edition.
  *
  *	This method is called internally by @see
  */
 protected function initSettingsForm()
 {
     /**
      * @var $ilCtrl ilCtrl
      */
     global $ilCtrl;
     /* Configure global form attributes */
     $this->form = new ilPropertyFormGUI();
     $this->form->setTitle($this->txt('edit_properties'));
     $this->form->setFormAction($ilCtrl->getFormAction($this, 'updateSettings'));
     /* Configure form objects */
     $ti = new ilTextInputGUI($this->txt('title'), 'title');
     $ti->setRequired(true);
     $ta = new ilTextAreaInputGUI($this->txt('description'), 'desc');
     $this->form->addItem($ti);
     $this->form->addItem($ta);
     $this->form->addCommandButton('updateSettings', $this->txt('save'));
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // setting 1 (a checkbox)
     $cb = new ilCheckboxInputGUI($pl->txt("setting_1"), "setting_1");
     $form->addItem($cb);
     // setting 2 (text)
     $ti = new ilTextInputGUI($pl->txt("setting_2"), "setting_2");
     $ti->setRequired(true);
     $ti->setMaxLength(10);
     $ti->setSize(10);
     $form->addItem($ti);
     $form->addCommandButton("save", $lng->txt("save"));
     $form->setTitle($pl->txt("example_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     global $lng, $ilCtrl;
     $pl = $this->getPluginObject();
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // Setting for the ephorus logging
     $ephorus_logging = new ilCheckboxInputGUI($pl->txt("ephorus_logging"), "ephorus_logging");
     $ephorus_logging->setValue(1);
     $ephorus_logging->setInfo($pl->txt("ephorus_logging_description"));
     $form->addItem($ephorus_logging);
     // Setting for the hand-in code
     $handin_code = new ilTextInputGUI($pl->txt("handin_code"), "handin_code");
     $handin_code->setRequired(true);
     $form->addItem($handin_code);
     // Setting for the hand-in address
     $handin_address = new ilTextInputGUI($pl->txt("handin_address"), "handin_address");
     $handin_address->setSize(80);
     $handin_address->setRequired(true);
     $form->addItem($handin_address);
     // Setting for the index address
     $index_address = new ilTextInputGUI($pl->txt("index_address"), "index_address");
     $index_address->setSize(80);
     $index_address->setRequired(true);
     $form->addItem($index_address);
     // Setting for the processtype
     $processtype = new ilSelectInputGUI($pl->txt("default_processtype"), "processtype");
     $processtype->setOptions(array(1 => $pl->txt("default"), 3 => $pl->txt("private")));
     $processtype->setInfo($pl->txt("default_processtype_description"));
     $form->addItem($processtype);
     // Setting for the disclosure
     $disclosure = new ilTextAreaInputGUI($pl->txt("disclosure"), "disclosure");
     $disclosure->setCols(79);
     $disclosure->setRows(4);
     $form->addItem($disclosure);
     $form->addCommandButton("save", $lng->txt("save") . " / " . $pl->txt("check_connection"));
     $form->setTitle($pl->txt("ephorus_plugin_configuration"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     return $form;
 }
 /**
  * Init configuration form
  * @global type $ilCtrl 
  */
 protected function initConfigurationForm()
 {
     global $ilCtrl, $lng;
     $settings = ilFhoevEventSettings::getInstance();
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->getPluginObject()->txt('tbl_fhoev_event_settings'));
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->addCommandButton('save', $lng->txt('save'));
     $form->setShowTopButtons(false);
     $lock = new ilCheckboxInputGUI($this->getPluginObject()->txt('tbl_settings_active'), 'active');
     $lock->setValue(1);
     $lock->setChecked($settings->isActive());
     $form->addItem($lock);
     $dtpl = new ilNumberInputGUI($this->getPluginObject()->txt('tbl_settings_dtpl'), 'dtpl');
     $dtpl->setSize(8);
     $dtpl->setValue($settings->getTemplateId());
     $dtpl->setRequired(TRUE);
     $dtpl->setMinValue(1);
     $form->addItem($dtpl);
     return $form;
 }
 /**
  * @param assFormulaQuestionUnitCategory $cat
  * @return ilPropertyFormGUI
  */
 protected function initUnitCategoryForm(assFormulaQuestionUnitCategory $cat = null)
 {
     if ($this->unit_cat_form instanceof ilPropertyFormGUI) {
         return $this->unit_cat_form;
     }
     $this->unit_cat_form = new ilPropertyFormGUI();
     $title = new ilTextInputGUI($this->lng->txt('title'), 'category_name');
     $title->setRequired(true);
     $this->unit_cat_form->addItem($title);
     if (null === $cat) {
         $this->unit_cat_form->setTitle($this->lng->txt('new_category'));
         $this->unit_cat_form->setFormAction($this->ctrl->getFormAction($this, 'addCategory'));
         $this->unit_cat_form->addCommandButton('addCategory', $this->lng->txt('save'));
     } else {
         $this->ctrl->setParameter($this, 'category_id', $cat->getId());
         $this->unit_cat_form->addCommandButton('saveCategory', $this->lng->txt('save'));
         $this->unit_cat_form->setFormAction($this->ctrl->getFormAction($this, 'saveCategory'));
         $this->unit_cat_form->setTitle(sprintf($this->lng->txt('selected_category'), $cat->getDisplayString()));
     }
     $this->unit_cat_form->addCommandButton($this->getUnitCategoryOverviewCommand(), $this->lng->txt('cancel'));
     return $this->unit_cat_form;
 }
 /**
  * Init configuration form.
  *
  * @return object form object
  */
 public function initConfigurationForm()
 {
     /** @var ilCtrl $ilCtrl */
     global $lng, $ilCtrl;
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     foreach ($this->checkboxes as $key => $cb) {
         if (!is_array($cb)) {
             $checkbox = new ilCheckboxInputGUI($this->getPluginObject()->txt($cb), $cb);
             $this->form->addItem($checkbox);
         } else {
             $checkbox = new ilCheckboxInputGUI($this->getPluginObject()->txt($key), $key);
             foreach ($cb as $field => $gui) {
                 $sub = new $gui($this->getPluginObject()->txt($key . '_' . $field), $key . '_' . $field);
                 $checkbox->addSubItem($sub);
             }
             $this->form->addItem($checkbox);
         }
     }
     $this->form->addCommandButton('save', $lng->txt('save'));
     $this->form->setTitle($this->getPluginObject()->txt('configuration'));
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     return $this->form;
 }
 /**
  * build settings form
  * @return object
  */
 protected function initSettingsForm()
 {
     global $ilDB, $ilUser;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $mng = new ilTextInputGUI($this->lng->txt('cal_ch_manager'), 'mng');
     $mng->setInfo($this->lng->txt('cal_ch_manager_info'));
     $form->addItem($mng);
     $mng->setValue(ilConsultationHourAppointments::getManager(true));
     $form->setTitle($this->lng->txt('settings'));
     $form->addCommandButton('updateSettings', $this->lng->txt('save'));
     // $form->addCommandButton('appointmentList', $this->lng->txt('cancel'));
     return $form;
 }
 protected function initPasswordForm()
 {
     global $ilCtrl, $lng, $ilUser, $ilTabs;
     if ($this->node_id) {
         include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
         $object_data = ilWorkspaceAccessHandler::getObjectDataFromNode($this->node_id);
     } else {
         $object_data["title"] = ilObject::_lookupTitle($this->portfolio_id);
     }
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
     $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]);
     $password = new ilPasswordInputGUI($lng->txt("password"), "password");
     $password->setRetype(false);
     $password->setRequired(true);
     $form->addItem($password);
     $form->addCommandButton("checkPassword", $lng->txt("submit"));
     if ($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID) {
         $ilTabs->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "cancelPassword"));
         $form->addCommandButton("cancelPassword", $lng->txt("cancel"));
     }
     return $form;
 }
 public function adoptTeamAssignmentsFormObject()
 {
     global $ilCtrl, $ilTabs, $lng, $tpl;
     $this->checkPermission("write");
     if (!$this->ass) {
         $ilCtrl->redirect($this, "listAssignments");
     }
     $ilTabs->activateTab("content");
     $this->addContentSubTabs("list_assignments");
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setTitle($lng->txt("exc_team_assignment_adopt"));
     $form->setFormAction($ilCtrl->getFormAction($this, "adoptTeamAssignments"));
     $options = ilExAssignment::getAdoptableTeamAssignments($this->ass->getExerciseId());
     // we must not have existing teams in assignment
     if (array_key_exists($this->ass->getId(), $options)) {
         $ilCtrl->redirect($this, "listAssignments");
     }
     $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt");
     $teams->setValue(-1);
     $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none"), -1));
     foreach ($options as $id => $item) {
         $option = new ilRadioOption($item["title"], $id);
         $option->setInfo($lng->txt("exc_team_assignment_adopt_teams") . ": " . $item["teams"]);
         $teams->addOption($option);
     }
     $form->addItem($teams);
     $form->addCommandButton("adoptTeamAssignments", $lng->txt("save"));
     $form->addCommandButton("listAssignments", $lng->txt("cancel"));
     $tpl->setContent($form->getHTML());
 }
 /**
  * Create import form
  */
 protected function initImportForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('cal_import_tbl'));
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton('uploadAppointments', $this->lng->txt('import'));
     $ics = new ilFileInputGUI($this->lng->txt('cal_import_file'), 'file');
     $ics->setALlowDeletion(false);
     $ics->setSuffixes(array('ics'));
     $ics->setInfo($this->lng->txt('cal_import_file_info'));
     $form->addItem($ics);
     return $form;
 }
 /**
  * Move current page
  */
 protected function movePageForm()
 {
     global $lng, $ilCtrl, $tpl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this, "movePage"));
     $form->setTitle($lng->txt("survey_move_page"));
     $old_pos = new ilHiddenInputGUI("old_pos");
     $old_pos->setValue($this->current_page);
     $form->addItem($old_pos);
     $pages = $this->object->getSurveyPages();
     if ($pages) {
         $pages_drop = array();
         if ($this->current_page != 1) {
             $pages_drop["fst"] = $lng->txt("survey_at_beginning");
         }
         foreach ($pages as $idx => $questions) {
             if ($idx + 1 != $this->current_page && $idx + 2 != $this->current_page) {
                 $question = array_shift($questions);
                 if ($question["questionblock_id"]) {
                     $pages_drop[$idx + 1] = $lng->txt("survey_behind_page") . " " . $question["questionblock_title"];
                 } else {
                     $pages_drop[$idx + 1] = $lng->txt("survey_behind_page") . " " . strip_tags($question["title"]);
                 }
             }
         }
         $pos = new ilSelectInputGUI($lng->txt("position"), "pgov");
         $pos->setOptions($pages_drop);
         $form->addItem($pos);
     }
     $form->addCommandButton("movePage", $lng->txt("submit"));
     $form->addCommandButton("renderPage", $lng->txt("cancel"));
     return $tpl->setContent($form->getHTML());
 }
 /**
  * Init form
  *
  * @return ilPropertyFormGUI
  */
 public function initForm()
 {
     global $lng, $ilCtrl;
     /** @var $ilCtrl ilCtrl */
     $ilCtrl = $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $item = new ilCustomInputGUI();
     $item->setHtml($lng->txt('dcl_file_format_description'));
     $item->setTitle("Info");
     $form->addItem($item);
     $file = new ilFileInputGUI($lng->txt("import_file"), "import_file");
     $file->setRequired(true);
     $form->addItem($file);
     $cb = new ilCheckboxInputGUI($lng->txt("dcl_simulate_import"), "simulate");
     $cb->setInfo($lng->txt("dcl_simulate_info"));
     $form->addItem($cb);
     $form->addCommandButton("importExcel", $lng->txt("save"));
     return $form;
 }
 /**
  * Edit resources form.
  */
 function edit($a_insert = false)
 {
     global $ilCtrl, $tpl, $lng, $objDefinition;
     $this->displayValidationError();
     // edit form
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     if ($a_insert) {
         $form->setTitle($this->lng->txt("cont_insert_resources"));
     } else {
         $form->setTitle($this->lng->txt("cont_update_resources"));
     }
     // count number of existing objects per type and collect item groups
     $ref_id = (int) $_GET["ref_id"];
     $childs = $this->rep_tree->getChilds($ref_id);
     $type_counts = array();
     $item_groups = array();
     foreach ($childs as $c) {
         $type_counts[$c["type"]] += 1;
         if ($c["type"] == "itgr") {
             $item_groups[$c["ref_id"]] = $c["title"];
         }
     }
     if (count($item_groups) > 0) {
         // radio group for type selection
         $radg = new ilRadioGroupInputGUI($lng->txt("cont_resources"), "res_type");
         if (!$a_insert && $this->content_obj->getMainType() == "ItemGroup") {
             $radg->setValue("itgr");
         } else {
             $radg->setValue("by_type");
         }
         $op_type = new ilRadioOption($lng->txt("cont_resources_of_type"), "by_type", "");
         $radg->addOption($op_type);
         $op_itemgroup = new ilRadioOption($lng->txt("obj_itgr"), "itgr", "");
         $radg->addOption($op_itemgroup);
         $form->addItem($radg);
     }
     // type selection
     $type_prop = new ilSelectInputGUI($this->lng->txt("cont_type"), "type");
     $obj_id = ilObject::_lookupObjId($_GET["ref_id"]);
     $obj_type = ilObject::_lookupType($obj_id);
     $sub_objs = $objDefinition->getGroupedRepositoryObjectTypes($obj_type);
     $types = array();
     foreach ($sub_objs as $k => $so) {
         if ($k != "itgr") {
             $types[$k] = $this->lng->txt("objs_" . $k) . " (" . (int) $type_counts[$k] . ")";
         }
     }
     $type_prop->setOptions($types);
     $selected = $a_insert ? "" : $this->content_obj->getResourceListType();
     $type_prop->setValue($selected);
     if (count($item_groups) > 0) {
         $op_type->addSubItem($type_prop);
     } else {
         $form->addItem($type_prop);
     }
     if (count($item_groups) > 0) {
         // item groups
         $options = $item_groups;
         $si = new ilSelectInputGUI($this->lng->txt("obj_itgr"), "itgr");
         $si->setOptions($options);
         $selected = $a_insert ? "" : $this->content_obj->getItemGroupRefId();
         $op_itemgroup->addSubItem($si);
     }
     // save/cancel buttons
     if ($a_insert) {
         $form->addCommandButton("create_resources", $lng->txt("save"));
         $form->addCommandButton("cancelCreate", $lng->txt("cancel"));
     } else {
         $form->addCommandButton("update_resources", $lng->txt("save"));
         $form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
     }
     $html = $form->getHTML();
     $tpl->setContent($html);
     return $ret;
 }
 public function editPriceObject()
 {
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id'];
     $price = ilPaymentPrices::_getPrice($price_id);
     $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']);
     $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']);
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false);
     if ($tmp_obj) {
         $form->setTitle($tmp_obj->getTitle());
     } else {
         $form->setTitle($this->lng->txt('object_not_found'));
     }
     //price_type
     $radio_group = new ilRadioGroupInputGUI('', 'price_type');
     $radio_group->setTitle($this->lng->txt('duration'));
     $radio_group->setRequired(true);
     $radio_group->setValue($price['price_type']);
     $radio_group->setPostVar('price_type');
     $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH);
     // duration month
     $oDuration = new ilNumberInputGUI();
     $oDuration->setTitle($this->lng->txt('paya_months'));
     $oDuration->setSize('20%');
     $oDuration->setValue($price['duration']);
     $oDuration->setPostVar('duration_month');
     $radio_option_1->addSubItem($oDuration);
     $radio_group->addOption($radio_option_1);
     $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE);
     // duration_date from
     $o_date_from = new ilDateTimeInputGUI();
     $o_date_from->setTitle($this->lng->txt('cal_from'));
     $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE));
     $o_date_from->setPostVar('duration_date_from');
     $radio_option_3->addSubItem($o_date_from);
     // duration_date until
     $o_date_until = new ilDateTimeInputGUI();
     $o_date_until->setTitle($this->lng->txt('cal_until'));
     $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE));
     $o_date_until->setPostVar('duration_date_until');
     $radio_option_3->addSubItem($o_date_until);
     $radio_group->addOption($radio_option_3);
     $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION);
     $radio_group->addOption($radio_option_2);
     $form->addItem($radio_group);
     // description
     $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $oDescription->setRows(4);
     $oDescription->setCols(35);
     $oDescription->setValue($price['description']);
     $form->addItem($oDescription);
     // price
     $oPrice = new ilNumberInputGUI();
     $oPrice->setTitle($this->lng->txt('price_a'));
     $oPrice->setSize('20%');
     $oPrice->setRequired(true);
     $oPrice->setValue($price['price']);
     include_once './Services/Payment/classes/class.ilPaymentSettings.php';
     $genSet = ilPaymentSettings::_getInstance();
     $oPrice->setInfo($genSet->get('currency_unit'));
     $oPrice->setPostVar('price');
     $oPrice->allowDecimals(true);
     $form->addItem($oPrice);
     //extension
     $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension');
     $oExtension->setChecked($price['extension']);
     $form->addItem($oExtension);
     $o_hidden_1 = new ilHiddenInputGUI('pobject_id');
     $o_hidden_1->setValue((int) $_GET['pobject_id']);
     $o_hidden_1->setPostVar('pobject_id');
     $o_hidden_2 = new ilHiddenInputGUI('price_id');
     $o_hidden_2->setValue((int) $_GET['price_id']);
     $o_hidden_2->setPostVar('price_id');
     $form->addItem($o_hidden_1);
     $form->addItem($o_hidden_2);
     $form->addCommandButton('updatePrice', $this->lng->txt('save'));
     $form->addCommandButton('editPrices', $this->lng->txt('cancel'));
     $this->tpl->setVariable('FORM', $form->getHTML());
 }
Beispiel #30
0
 /**
  * Init object import form
  *
  * @param	string	new type
  * @return	ilPropertyFormGUI
  */
 protected function initImportForm($a_new_type)
 {
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setTarget("_top");
     $form->setFormAction($this->ctrl->getFormAction($this, "importFile"));
     $form->setTitle($this->lng->txt($a_new_type . "_import"));
     include_once "./Services/Form/classes/class.ilFileInputGUI.php";
     $fi = new ilFileInputGUI($this->lng->txt("import_file"), "importfile");
     $fi->setSuffixes(array("zip"));
     $fi->setRequired(true);
     $form->addItem($fi);
     $form->addCommandButton("importFile", $this->lng->txt("import"));
     $form->addCommandButton("cancel", $this->lng->txt("cancel"));
     return $form;
 }