protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
 {
     // orientation
     $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
     $orientation->setRequired(false);
     $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
     $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
     $orientation->addOption(new ilRadioOption($this->lng->txt('combobox'), 2));
     $a_form->addItem($orientation);
     // Answers
     include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
     $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
     $answers->setRequired(false);
     $answers->setAllowMove(true);
     $answers->setShowWizard(true);
     $answers->setShowSavePhrase(true);
     $answers->setUseOtherAnswer(true);
     $answers->setShowNeutralCategory(true);
     $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
     $answers->setDisabledScale(false);
     $a_form->addItem($answers);
     // values
     $orientation->setValue($this->object->getOrientation());
     if (!$this->object->getCategories()->getCategoryCount()) {
         $this->object->getCategories()->addCategory("");
     }
     $answers->setValues($this->object->getCategories());
 }
 protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
 {
     // maximum number of characters
     $maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars");
     $maxchars->setRequired(false);
     $maxchars->setSize(5);
     $maxchars->setDecimals(0);
     $a_form->addItem($maxchars);
     // textwidth
     $textwidth = new ilNumberInputGUI($this->lng->txt("width"), "textwidth");
     $textwidth->setRequired(true);
     $textwidth->setSize(3);
     $textwidth->setDecimals(0);
     $textwidth->setMinValue(10);
     $a_form->addItem($textwidth);
     // textheight
     $textheight = new ilNumberInputGUI($this->lng->txt("height"), "textheight");
     $textheight->setRequired(true);
     $textheight->setSize(3);
     $textheight->setDecimals(0);
     $textheight->setMinValue(1);
     $a_form->addItem($textheight);
     // values
     if ($this->object->getMaxChars() > 0) {
         $maxchars->setValue($this->object->getMaxChars());
     }
     $textwidth->setValue($this->object->getTextWidth());
     $textheight->setValue($this->object->getTextHeight());
 }
 /**
  * Init service settings form
  * @param ilPropertyFormGUI $form
  * @param type $services
  */
 public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
 {
     global $ilSetting;
     if (in_array(self::CALENDAR_VISIBILITY, $services)) {
         include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
         if (ilCalendarSettings::_getInstance()->isEnabled()) {
             // Container tools (calendar, news, ... activation)
             $cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY);
             $cal->setValue(1);
             include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
             $cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id));
             $cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar'));
             $form->addItem($cal);
         }
     }
     if (in_array(self::NEWS_VISIBILITY, $services)) {
         if ($ilSetting->get('block_activated_news')) {
             // Container tools (calendar, news, ... activation)
             $news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY);
             $news->setValue(1);
             $news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true)));
             $news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news'));
             $form->addItem($news);
         }
     }
     return $form;
 }
 protected function initPluginSettings()
 {
     $n = new ilNonEditableValueGUI($this->getPluginHookObject()->txt('info_token_expires'));
     $n->setValue(date(DATE_ISO8601, $this->getPluginObject()->getValidThrough()));
     $this->form->addItem($n);
     $this->form->getItemByPostVar('root_folder')->setDisabled(true);
 }
 protected function initEditCustomForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $ilSetting;
     if ($this->id_type == self::REPOSITORY_NODE_ID) {
         $appr = new ilCheckboxInputGUI($lng->txt("blog_enable_approval"), "approval");
         $appr->setInfo($lng->txt("blog_enable_approval_info"));
         $a_form->addItem($appr);
     }
     $notes = new ilCheckboxInputGUI($lng->txt("blog_enable_notes"), "notes");
     $a_form->addItem($notes);
     if ($ilSetting->get('enable_global_profiles')) {
         $rss = new ilCheckboxInputGUI($lng->txt("blog_enable_rss"), "rss");
         $rss->setInfo($lng->txt("blog_enable_rss_info"));
         $a_form->addItem($rss);
     }
     $ppic = new ilCheckboxInputGUI($lng->txt("blog_profile_picture"), "ppic");
     $a_form->addItem($ppic);
     $blga_set = new ilSetting("blga");
     if ($blga_set->get("banner")) {
         $dimensions = " (" . $blga_set->get("banner_width") . "x" . $blga_set->get("banner_height") . ")";
         $img = new ilImageFileInputGUI($lng->txt("blog_banner") . $dimensions, "banner");
         $a_form->addItem($img);
         // show existing file
         $file = $this->object->getImageFullPath(true);
         if ($file) {
             $img->setImage($file);
         }
     }
     $bg_color = new ilColorPickerInputGUI($lng->txt("blog_background_color"), "bg_color");
     $a_form->addItem($bg_color);
     $font_color = new ilColorPickerInputGUI($lng->txt("blog_font_color"), "font_color");
     $a_form->addItem($font_color);
 }
Ejemplo n.º 6
0
 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;
 }
 /**
  * completes a given form object with the specific form properties
  * required by this question type
  * 
  * @access public
  * @param ilPropertyFormGUI $form
  */
 public function completeSpecificFormProperties(ilPropertyFormGUI $form)
 {
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('feedback_answers'));
     $form->addItem($header);
     if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
         foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
             $propertyLabel = $this->questionOBJ->prepareTextareaOutput($this->buildAnswerOptionLabel($index, $answer), true);
             $propertyPostVar = "feedback_answer_{$index}";
             $form->addItem($this->buildFeedbackContentFormProperty($propertyLabel, $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()));
         }
     }
 }
 /**
  * Init service settings form
  * @param ilPropertyFormGUI $form
  * @param type $services
  */
 public static function initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
 {
     global $ilSetting;
     // info tab
     if (in_array(self::INFO_TAB_VISIBILITY, $services)) {
         $info = new ilCheckboxInputGUI('', self::INFO_TAB_VISIBILITY);
         $info->setValue(1);
         $info->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::INFO_TAB_VISIBILITY, true));
         $info->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_info_tab'));
         $form->addItem($info);
     }
     // calendar
     if (in_array(self::CALENDAR_VISIBILITY, $services)) {
         include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
         if (ilCalendarSettings::_getInstance()->isEnabled()) {
             // Container tools (calendar, news, ... activation)
             $cal = new ilCheckboxInputGUI('', self::CALENDAR_VISIBILITY);
             $cal->setValue(1);
             include_once './Services/Calendar/classes/class.ilObjCalendarSettings.php';
             $cal->setChecked(ilCalendarSettings::lookupCalendarActivated($a_obj_id));
             $cal->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_calendar'));
             $form->addItem($cal);
         }
     }
     // news
     if (in_array(self::NEWS_VISIBILITY, $services)) {
         if ($ilSetting->get('block_activated_news')) {
             // Container tools (calendar, news, ... activation)
             $news = new ilCheckboxInputGUI('', self::NEWS_VISIBILITY);
             $news->setValue(1);
             $news->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::NEWS_VISIBILITY, $ilSetting->get('block_activated_news', true)));
             $news->setOptionTitle($GLOBALS['lng']->txt('obj_tool_setting_news'));
             $form->addItem($news);
         }
     }
     // auto rating
     if (in_array(self::AUTO_RATING_NEW_OBJECTS, $services)) {
         $GLOBALS['lng']->loadLanguageModule("rating");
         // auto rating for new objects
         $rate = new ilCheckboxInputGUI('', self::AUTO_RATING_NEW_OBJECTS);
         $rate->setValue(1);
         $rate->setOptionTitle($GLOBALS['lng']->txt('rating_new_objects_auto'));
         $rate->setInfo($GLOBALS['lng']->txt('rating_new_objects_auto_info'));
         $rate->setChecked(ilContainer::_lookupContainerSetting($a_obj_id, self::AUTO_RATING_NEW_OBJECTS, false));
         $form->addItem($rate);
     }
     return $form;
 }
 protected function addFieldsToEditForm(ilPropertyFormGUI $a_form)
 {
     // orientation
     $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
     $orientation->setRequired(false);
     $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
     $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
     $a_form->addItem($orientation);
     // minimum answers
     $minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers");
     $minanswers->setValue(1);
     $minanswers->setOptionTitle($this->lng->txt("use_min_answers_option"));
     $minanswers->setRequired(FALSE);
     $nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers");
     $nranswers->setSize(5);
     $nranswers->setDecimals(0);
     $nranswers->setRequired(false);
     $nranswers->setMinValue(1);
     $minanswers->addSubItem($nranswers);
     $nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers");
     $nrmaxanswers->setSize(5);
     $nrmaxanswers->setDecimals(0);
     $nrmaxanswers->setRequired(false);
     $nrmaxanswers->setMinValue(1);
     $minanswers->addSubItem($nrmaxanswers);
     $a_form->addItem($minanswers);
     // Answers
     include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
     $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
     $answers->setRequired(false);
     $answers->setAllowMove(true);
     $answers->setShowWizard(false);
     $answers->setShowSavePhrase(false);
     $answers->setUseOtherAnswer(true);
     $answers->setShowNeutralCategory(true);
     $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
     $answers->setDisabledScale(false);
     $a_form->addItem($answers);
     // values
     $orientation->setValue($this->object->getOrientation());
     $minanswers->setChecked($this->object->use_min_answers);
     $nranswers->setValue($this->object->nr_min_answers);
     $nrmaxanswers->setValue($this->object->nr_max_answers);
     if (!$this->object->getCategories()->getCategoryCount()) {
         $this->object->getCategories()->addCategory("");
     }
     $answers->setValues($this->object->getCategories());
 }
 /**
  * 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;
 }
 /**
  * Get multi language form
  */
 function getMultiLangForm()
 {
     global $tpl, $lng, $ilCtrl, $ilUser;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     // master language
     include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php";
     $options = ilMDLanguageItem::_getLanguages();
     $si = new ilSelectInputGUI($lng->txt("cont_master_lang"), "master_lang");
     $si->setOptions($options);
     $si->setValue($ilUser->getLanguage());
     $form->addItem($si);
     // additional languages
     include_once "./Services/MetaData/classes/class.ilMDLanguageItem.php";
     $options = ilMDLanguageItem::_getLanguages();
     $options = array("" => $lng->txt("please_select")) + $options;
     $si = new ilSelectInputGUI($lng->txt("cont_additional_langs"), "additional_langs");
     $si->setOptions($options);
     $si->setMulti(true);
     $form->addItem($si);
     $form->addCommandButton("saveMultilingualitySettings", $lng->txt("save"));
     $form->addCommandButton("cancel", $lng->txt("cancel"));
     $form->setTitle($lng->txt("cont_activate_multi_lang"));
     $form->setFormAction($ilCtrl->getFormAction($this));
     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
 }
 /**
  * @param ilObjBibliographic $bibl_obj
  * @return void
  *
  */
 public function showDetails(ilObjBibliographic $bibl_obj)
 {
     global $tpl, $ilTabs, $ilCtrl, $lng;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $ilTabs->clearTargets();
     $ilTabs->setBackTarget("back", $ilCtrl->getLinkTarget($this, 'showContent'));
     $form->setTitle($lng->txt('detail_view'));
     $entry = new ilBibliographicEntry($bibl_obj->getFiletype(), $_GET['entryId']);
     $attributes = $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);
             $strDescTranslated = $lng->txt($arrKey[0] . "_default_" . $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);
     }
     // set content and title
     $tpl->setContent($form->getHTML());
     //Permanent Link
     $tpl->setPermanentLink("bibl", $bibl_obj->getRefId(), "_" . $_GET['entryId']);
 }
 /**
  * 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;
 }
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $ilSetting;
     $cb = new ilCheckboxInputGUI($lng->txt("cron_mail_notification_message"), "mail_notification_message");
     $cb->setInfo($lng->txt("cron_mail_notification_message_info"));
     $cb->setChecked($ilSetting->get("mail_notification_message"));
     $a_form->addItem($cb);
 }
Ejemplo n.º 16
0
 /**
  * structure / page object creation form
  */
 function create()
 {
     $new_type = $_REQUEST["new_type"];
     $this->ctrl->setParameter($this, "new_type", $new_type);
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "save"));
     $form->setTitle($this->lng->txt($new_type . "_new"));
     $title = new ilTextInputGUI($this->lng->txt("title"), "Fobject[title]");
     $title->setRequired(true);
     $form->addItem($title);
     $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "Fobject[desc]");
     $form->addItem($desc);
     $form->addCommandButton("save", $this->lng->txt($new_type . "_add"));
     $form->addCommandButton("cancel", $this->lng->txt("cancel"));
     $this->tpl->setContent($form->getHTML());
 }
 protected function initForm($submit_action)
 {
     $form = new ilPropertyFormGUI();
     $input = new ilFileInputGUI($this->lng->txt("import_xml_file"), "import_file");
     $input->setRequired(true);
     $form->addItem($input);
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton($submit_action, $this->lng->txt("import"));
     return $form;
 }
 protected function addCustomEditForm(ilPropertyFormGUI $a_form)
 {
     $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('ecs_availability'), 'activation_type');
     $radio_grp->setValue($this->object->getAvailabilityType());
     $radio_grp->setDisabled(true);
     $radio_opt = new ilRadioOption($this->lng->txt('offline'), ilObjRemoteLearningModule::ACTIVATION_OFFLINE);
     $radio_grp->addOption($radio_opt);
     $radio_opt = new ilRadioOption($this->lng->txt('online'), ilObjRemoteLearningModule::ACTIVATION_ONLINE);
     $radio_grp->addOption($radio_opt);
     $a_form->addItem($radio_grp);
 }
 /**
  * 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;
 }
 /**
  * completes a given form object with the specific form properties
  * required by this question type
  * 
  * (overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)
  * 
  * @access public
  * @param ilPropertyFormGUI $form
  */
 public function completeSpecificFormProperties(ilPropertyFormGUI $form)
 {
     $header = new ilFormSectionHeaderGUI();
     $header->setTitle($this->lng->txt('feedback_answers'));
     $form->addItem($header);
     if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
         require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';
         require_once './Services/Form/classes/class.ilRadioOption.php';
         $feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
         $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_all'), 1), true);
         $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_checked'), 2));
         $feedback->addOption(new ilRadioOption($this->lng->txt('feedback_correct'), 3));
         $form->addItem($feedback);
         foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
             $propertyLabel = $this->questionOBJ->prepareTextareaOutput($this->buildAnswerOptionLabel($index, $answer), true);
             $propertyPostVar = "feedback_answer_{$index}";
             $form->addItem($this->buildFeedbackContentFormProperty($propertyLabel, $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()));
         }
     }
 }
 /**
  * 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;
 }
 /**
  *
  */
 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 addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng, $ilSetting;
     $num_days = new ilNumberInputGUI($lng->txt('payment_notification_days'), 'payment_notification_days');
     $num_days->setSize(3);
     $num_days->setMinValue(0);
     $num_days->setMaxValue(120);
     $num_days->setRequired(true);
     $num_days->setValue($ilSetting->get('payment_notification_days'));
     $num_days->setInfo($lng->txt('payment_notification_days_desc'));
     $a_form->addItem($num_days);
 }
 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");
 }
 /**
  * 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_settings->getMode());
     $form->addItem($mod);
     foreach ($this->obj_settings->getValidModes() as $mode_key => $mode_name) {
         $opt = new ilRadioOption($mode_name, $mode_key, ilLPObjSettings::_mode2InfoText($mode_key));
         $opt->setValue($mode_key);
         $mod->addOption($opt);
         // Subitem for vistits
         if ($mode_key == 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);
         }
     }
     /*
     // Info Active
     $act = new ilCustomInputGUI($this->lng->txt('trac_activated'), '');
     $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
     $img->setVariable("IMG_SRC",
     	$activated = ilObjUserTracking::_enabledLearningProgress()
     		? ilUtil::getImagePath('icon_ok.png')
     		: ilUtil::getImagePath('icon_not_ok.png')
     );
     $act->setHTML($img->get());
     $form->addItem($act);
     
      		// Info Anonymized
      		$ano = new ilCustomInputGUI($this->lng->txt('trac_anonymized'), '');
     $img = new ilTemplate('tpl.obj_settings_img_row.html',true,true,'Services/Tracking');
     $img->setVariable("IMG_SRC",
     	$anonymized = !ilObjUserTracking::_enabledUserRelatedData()
     		? ilUtil::getImagePath('icon_ok.png')
     		: ilUtil::getImagePath('icon_not_ok.png')
     );
     $ano->setHTML($img->get());
     $form->addItem($ano);
     */
     $form->addCommandButton('saveSettings', $this->lng->txt('save'));
     return $form;
 }
Ejemplo n.º 26
0
 function showPersonalData()
 {
     // user_id $this->user_obj->getId()
     // all
     $this->psc_obj = new ilPaymentShoppingCart($this->user_obj);
     if (!count($items = $this->psc_obj->getEntries($this->pm_id))) {
         $this->tpl->setVariable("HEADER", $this->lng->txt('pay_bmf_your_order'));
         $this->tpl->touchBlock("stop_floating");
         ilUtil::sendInfo($this->lng->txt('pay_shopping_cart_empty'));
     } else {
         $this->tpl->setVariable("HEADER", $this->lng->txt('pay_step1'));
         $this->tpl->setVariable("TITLE", $this->lng->txt('pay_bmf_personal_data'));
         $this->tpl->setVariable("DESCRIPTION", $this->lng->txt('pay_bmf_description_personal_data'));
         $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
         $oForm = new ilPropertyFormGUI();
         $oForm->setFormAction($this->ctrl->getFormAction($this, 'getPersonalData'));
         $oForm->setTitle($this->lng->txt('pay_bmf_personal_data'));
         $oFirstname = new ilNonEditableValueGUI($this->lng->txt('firstname'));
         $oFirstname->setValue($this->user_obj->getFirstname());
         $oForm->addItem($oFirstname);
         $oLastname = new ilNonEditableValueGUI($this->lng->txt('lastname'));
         $oLastname->setValue($this->user_obj->getLastname());
         $oForm->addItem($oLastname);
         $oStreet = new ilTextInputGUI($this->lng->txt('street'), 'street');
         $oStreet->setValue($this->error != '' && isset($_POST['street']) ? ilUtil::prepareFormOutput($_POST['street'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['street'], true));
         $oForm->addItem($oStreet);
         $oHouseNumber = new ilTextInputGUI($this->lng->txt('pay_bmf_house_number'), 'house_number');
         $oHouseNumber->setValue($this->error != '' && isset($_POST['house_number']) ? ilUtil::prepareFormOutput($_POST['house_number'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['house_number'], true));
         $oForm->addItem($oHouseNumber);
         $oPoBox = new ilTextInputGUI($this->lng->txt('pay_bmf_or') . '  ' . $this->lng->txt('pay_bmf_po_box'), 'po_box');
         $oPoBox->setValue($this->error != '' && isset($_POST['po_box']) ? ilUtil::prepareFormOutput($_POST['po_box'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['po_box'], true));
         $oForm->addItem($oPoBox);
         $oZipCode = new ilTextInputGUI($this->lng->txt('zipcode'), 'zipcode');
         $oZipCode->setValue($this->error != '' && isset($_POST['zipcode']) ? ilUtil::prepareFormOutput($_POST['zipcode'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['zipcode'], true));
         $oForm->addItem($oZipCode);
         $oCity = new ilTextInputGUI($this->lng->txt('city'), 'city');
         $oCity->setValue($this->error != '' && isset($_POST['city']) ? ilUtil::prepareFormOutput($_POST['city'], true) : ilUtil::prepareFormOutput($_SESSION['bmf']['personal_data']['city'], true));
         $oForm->addItem($oCity);
         $oCountry = new ilSelectInputGUI($this->lng->txt('country'), 'country');
         $oCountry->setOptions($this->__getCountries());
         $oCountry->setValue($this->error != '' && isset($_POST['country']) ? $_POST['country'] : $_SESSION['bmf']['personal_data']['country']);
         $oForm->addItem($oCountry);
         $oEmail = new ilNonEditableValueGUI($this->lng->txt('email'));
         $oEmail->setValue($this->user_obj->getEmail());
         $oForm->addItem($oEmail);
         $oForm->addcommandButton('getPersonalData', ucfirst($this->lng->txt('next')));
         $this->tpl->setVariable('FORM', $oForm->getHTML());
     }
 }
 /**
  * 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;
 }
Ejemplo n.º 28
0
 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));
 }
Ejemplo n.º 29
0
 public function addCustomSettingsToForm(ilPropertyFormGUI $a_form)
 {
     global $lng;
     $lng->loadLanguageModule("file");
     require_once 'Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php';
     $disk_quota_obj = ilObjDiskQuotaSettings::getInstance();
     // Enable disk quota reminder mail
     $cb_prop_reminder = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail");
     $cb_prop_reminder->setValue('1');
     $cb_prop_reminder->setChecked($disk_quota_obj->isDiskQuotaReminderMailEnabled());
     $cb_prop_reminder->setInfo($lng->txt('disk_quota_reminder_mail_desc'));
     $a_form->addItem($cb_prop_reminder);
     // Enable summary mail for certain users
     $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail");
     $cb_prop_summary->setValue(1);
     $cb_prop_summary->setChecked($disk_quota_obj->isDiskQuotaSummaryMailEnabled());
     $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc'));
     $a_form->addItem($cb_prop_summary);
     // Edit disk quota recipients
     $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp");
     $summary_rcpt->setValue($disk_quota_obj->getSummaryRecipients());
     $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc'));
     $cb_prop_summary->addSubItem($summary_rcpt);
 }
 /**
  * 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;
 }