本文整理汇总了PHP中ilPropertyFormGUI类的典型用法代码示例。如果您正苦于以下问题:PHP ilPropertyFormGUI类的具体用法?PHP ilPropertyFormGUI怎么用?PHP ilPropertyFormGUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ilPropertyFormGUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initSettingsForm
/**
* 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;
}
示例2: setFormValues
public function setFormValues(ilPropertyFormGUI $form)
{
$form->getItemByPostVar('registration_type')->setValue($this->getCurrentObject()->getRegistrationType());
$form->getItemByPostVar('registration_membership_limited')->setChecked($this->getCurrentObject()->isRegistrationUserLimitEnabled());
$form->getItemByPostVar('registration_max_members')->setValue($this->getCurrentObject()->getRegistrationMaxUsers());
$form->getItemByPostVar('waiting_list')->setChecked($this->getCurrentObject()->isRegistrationWaitingListEnabled());
}
示例3: initLicenseForm
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;
}
示例4: getMultiLangForm
/**
* 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;
}
示例5: getHTML
/**
* @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
}
示例6: initForm
/**
* Init courses form
*
* @param bool $a_insert
* @return ilPropertyFormGUI
*/
protected function initForm($a_insert = false)
{
global $ilCtrl;
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_amd_page_list"));
} else {
$form->setTitle($this->lng->txt("cont_update_amd_page_list"));
}
$form->setDescription($this->lng->txt("wiki_page_list_form_info"));
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
$this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_SEARCH, 'wiki', $this->getPage()->getWikiId(), 'wpg', $this->getPage()->getId());
$this->record_gui->setPropertyForm($form);
$this->record_gui->setSelectedOnly(true);
if (!$a_insert) {
$this->record_gui->setSearchFormValues($this->content_obj->getFieldValues());
}
$this->record_gui->parse();
if ($a_insert) {
$form->addCommandButton("create_amd_page_list", $this->lng->txt("select"));
$form->addCommandButton("cancelCreate", $this->lng->txt("cancel"));
} else {
$form->addCommandButton("update", $this->lng->txt("select"));
$form->addCommandButton("cancelUpdate", $this->lng->txt("cancel"));
}
return $form;
}
示例7: importEditFormValues
protected function importEditFormValues(ilPropertyFormGUI $a_form)
{
$max = $a_form->getInput("maxchars");
$this->object->setMaxChars(strlen($max) ? $max : null);
$this->object->setTextWidth($a_form->getInput("textwidth"));
$this->object->setTextHeight($a_form->getInput("textheight"));
}
示例8: showDetails
/**
* @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']);
}
示例9: initEditForm
function initEditForm($a_job_id)
{
global $ilCtrl, $lng;
$job = ilCronManager::getJobInstanceById($a_job_id);
if (!$job) {
$ilCtrl->redirect($this, "render");
}
$ilCtrl->setParameter($this, "jid", $a_job_id);
$data = array_pop(ilCronManager::getCronJobData($job->getId()));
include_once "Services/Cron/classes/class.ilCronJob.php";
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "update"));
$form->setTitle($lng->txt("cron_action_edit") . ': "' . $job->getTitle() . '"');
if ($job->hasFlexibleSchedule()) {
$type = new ilRadioGroupInputGUI($lng->txt("cron_schedule_type"), "type");
$type->setRequired(true);
$type->setValue($data["schedule_type"]);
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_daily"), ilCronJob::SCHEDULE_TYPE_DAILY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_weekly"), ilCronJob::SCHEDULE_TYPE_WEEKLY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_monthly"), ilCronJob::SCHEDULE_TYPE_MONTHLY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_quarterly"), ilCronJob::SCHEDULE_TYPE_QUARTERLY));
$type->addOption(new ilRadioOption($lng->txt("cron_schedule_yearly"), ilCronJob::SCHEDULE_TYPE_YEARLY));
$min = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_minutes"), "x"), ilCronJob::SCHEDULE_TYPE_IN_MINUTES);
$mini = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "smini");
$mini->setRequired(true);
$mini->setSize(5);
if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_MINUTES) {
$mini->setValue($data["schedule_value"]);
}
$min->addSubItem($mini);
$type->addOption($min);
$hr = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_hours"), "x"), ilCronJob::SCHEDULE_TYPE_IN_HOURS);
$hri = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "shri");
$hri->setRequired(true);
$hri->setSize(5);
if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_HOURS) {
$hri->setValue($data["schedule_value"]);
}
$hr->addSubItem($hri);
$type->addOption($hr);
$dy = new ilRadioOption(sprintf($lng->txt("cron_schedule_in_days"), "x"), ilCronJob::SCHEDULE_TYPE_IN_DAYS);
$dyi = new ilNumberInputGUI($lng->txt("cron_schedule_value"), "sdyi");
$dyi->setRequired(true);
$dyi->setSize(5);
if ($data["schedule_type"] == ilCronJob::SCHEDULE_TYPE_IN_DAYS) {
$dyi->setValue($data["schedule_value"]);
}
$dy->addSubItem($dyi);
$type->addOption($dy);
$form->addItem($type);
}
if ($job->hasCustomSettings()) {
$job->addCustomSettingsToForm($form);
}
$form->addCommandButton("update", $lng->txt("save"));
$form->addCommandButton("render", $lng->txt("cancel"));
return $form;
}
示例10: addCustomSettingsToForm
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);
}
示例11: getSettingsForm
/**
* @return ilPropertyFormGUI
*/
protected function getSettingsForm()
{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('settings'));
require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
ilAdministrationSettingsFormHandler::addFieldsToForm(ilAdministrationSettingsFormHandler::FORM_ACCESSIBILITY, $form, $this);
return $form;
}
示例12: configure
/**
* Configuration gui.
*/
function configure()
{
global $tpl;
$pl = $this->getPluginObject();
$form = new ilPropertyFormGUI();
$form->setTitle($pl->txt('roomsharing_plugin_configuration'));
$form->setDescription($pl->txt('roomsharing_plugin_config_not_required'));
$tpl->setContent($form->getHTML());
}
示例13: saveSpecificFormProperties
/**
* saves a given form object's specific form properties
* relating to this question type
*
* (overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)
*
* @access public
* @param ilPropertyFormGUI $form
*/
public function saveSpecificFormProperties(ilPropertyFormGUI $form)
{
if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
$this->saveSpecificFeedbackSetting($this->questionOBJ->getId(), $form->getInput('feedback_setting'));
foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
$this->saveSpecificAnswerFeedbackContent($this->questionOBJ->getId(), $index, $form->getInput("feedback_answer_{$index}"));
}
}
}
示例14: initForm
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;
}
示例15: removeHiddenItems
protected function removeHiddenItems(ilPropertyFormGUI $form)
{
if ($this->settingsTemplate) {
foreach ($this->settingsTemplate->getSettings() as $id => $item) {
if ($item["hide"]) {
$form->removeItemByPostVar($id);
}
}
}
}