本文整理汇总了PHP中ilSelectInputGUI::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP ilSelectInputGUI::setValue方法的具体用法?PHP ilSelectInputGUI::setValue怎么用?PHP ilSelectInputGUI::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilSelectInputGUI
的用法示例。
在下文中一共展示了ilSelectInputGUI::setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: listFields
/**
* list fields
*/
public function listFields()
{
global $tpl, $lng, $ilCtrl, $ilToolbar;
// Show tables
require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
$tables = $this->parent_obj->object->getTables();
foreach ($tables as $table) {
$options[$table->getId()] = $table->getTitle();
}
include_once './Services/Form/classes/class.ilSelectInputGUI.php';
$table_selection = new ilSelectInputGUI('', 'table_id');
$table_selection->setOptions($options);
$table_selection->setValue($this->table_id);
$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionFieldListGUI", "doTableSwitch"));
$ilToolbar->addText($lng->txt("dcl_table"));
$ilToolbar->addInputItem($table_selection);
$ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch');
$ilToolbar->addSeparator();
$ilToolbar->addButton($lng->txt("dcl_add_new_table"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "create"));
$ilToolbar->addSeparator();
$ilCtrl->setParameterByClass("ildatacollectiontableeditgui", "table_id", $this->table_id);
$ilToolbar->addButton($lng->txt("dcl_table_settings"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "edit"));
$ilToolbar->addButton($lng->txt("dcl_delete_table"), $ilCtrl->getLinkTargetByClass("ildatacollectiontableeditgui", "confirmDelete"));
$ilToolbar->addButton($lng->txt("dcl_add_new_field"), $ilCtrl->getLinkTargetByClass("ildatacollectionfieldeditgui", "create"));
// requested not to implement this way...
// $tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js");
require_once './Modules/DataCollection/classes/class.ilDataCollectionFieldListTableGUI.php';
$list = new ilDataCollectionFieldListTableGUI($this, $ilCtrl->getCmd(), $this->table_id);
$tpl->setContent($list->getHTML());
}
示例3: initForm
/**
* Add all fields to the form
*/
protected function initForm()
{
$this->setFormAction($this->ctrl->getFormAction($this->parent_gui));
$this->setTitle($this->lng->txt('orgu_settings'));
$item = new ilTextInputGUI($this->lng->txt('title'), 'title');
$item->setRequired(true);
$item->setValue($this->obj_orgu->getTitle());
$this->addItem($item);
$item = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
$item->setValue($this->obj_orgu->getDescription());
$this->addItem($item);
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->lng->txt('orgu_type'));
$this->addItem($item);
$types = ilOrgUnitType::getAllTypes();
$options = array(0 => '');
/** @var ilOrgUnitType $type */
foreach ($types as $type) {
$options[$type->getId()] = $type->getTitle();
}
asort($options);
$item = new ilSelectInputGUI($this->lng->txt('orgu_type'), 'orgu_type');
$item->setOptions($options);
$item->setValue($this->obj_orgu->getOrgUnitTypeId());
$this->addItem($item);
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->lng->txt('ext_id'));
$this->addItem($item);
$item = new ilTextInputGUI($this->lng->txt('ext_id'), 'ext_id');
$item->setValue($this->obj_orgu->getImportId());
$this->addItem($item);
$this->addCommandButton('updateSettings', $this->lng->txt('save'));
}
示例4: initFilter
/**
* Init Filter
*/
function initFilter()
{
global $lng, $ilUser;
// period
$per = $_SESSION["news_pd_news_per"] != "" ? $_SESSION["news_pd_news_per"] : ilNewsItem::_lookupUserPDPeriod($ilUser->getId());
$news_set = new ilSetting("news");
$allow_shorter_periods = $news_set->get("allow_shorter_periods");
$allow_longer_periods = $news_set->get("allow_longer_periods");
$default_per = ilNewsItem::_lookupDefaultPDPeriod();
$options = array(2 => sprintf($lng->txt("news_period_x_days"), 2), 3 => sprintf($lng->txt("news_period_x_days"), 3), 5 => sprintf($lng->txt("news_period_x_days"), 5), 7 => $lng->txt("news_period_1_week"), 14 => sprintf($lng->txt("news_period_x_weeks"), 2), 30 => $lng->txt("news_period_1_month"), 60 => sprintf($lng->txt("news_period_x_months"), 2), 120 => sprintf($lng->txt("news_period_x_months"), 4), 180 => sprintf($lng->txt("news_period_x_months"), 6), 366 => $lng->txt("news_period_1_year"));
$unset = array();
foreach ($options as $k => $opt) {
if (!$allow_shorter_periods && $k < $default_per) {
$unset[$k] = $k;
}
if (!$allow_longer_periods && $k > $default_per) {
$unset[$k] = $k;
}
}
foreach ($unset as $k) {
unset($options[$k]);
}
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$si = new ilSelectInputGUI($this->lng->txt("news_time_period"), "news_per");
$si->setOptions($options);
$si->setValue($per);
$this->addFilterItem($si);
// related to...
$si = new ilSelectInputGUI($this->lng->txt("context"), "news_ref_id");
$si->setOptions($this->contexts);
$si->setValue($this->selected_context);
$this->addFilterItem($si);
}
示例5: editSettings
/**
* Edit news settings.
*/
public function editSettings()
{
global $ilCtrl, $lng, $ilSetting, $ilTabs, $ilToolbar;
$ilTabs->activateTab("settings");
if (OH_REF_ID > 0) {
ilUtil::sendInfo("This installation is used for online help authoring. Help modules cannot be imported.");
return;
}
if ($this->checkPermissionBool("write")) {
// help file
include_once "./Services/Form/classes/class.ilFileInputGUI.php";
$fi = new ilFileInputGUI($lng->txt("help_help_file"), "help_file");
$fi->setSuffixes(array("zip"));
$ilToolbar->addInputItem($fi, true);
$ilToolbar->addFormButton($lng->txt("upload"), "uploadHelpFile");
$ilToolbar->addSeparator();
// help mode
include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
$options = array("" => $lng->txt("help_tooltips_and_help"), "1" => $lng->txt("help_help_only"), "2" => $lng->txt("help_tooltips_only"));
$si = new ilSelectInputGUI($this->lng->txt("help_mode"), "help_mode");
$si->setOptions($options);
$si->setValue($ilSetting->get("help_mode"));
$ilToolbar->addInputItem($si);
$ilToolbar->addFormButton($lng->txt("help_set_mode"), "setMode");
}
$ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
include_once "./Services/Help/classes/class.ilHelpModuleTableGUI.php";
$tab = new ilHelpModuleTableGUI($this, "editSettings");
$this->tpl->setContent($tab->getHTML());
}
示例6: parse
public function parse($scoSelected, $report, $reports)
{
global $ilCtrl, $lng;
$lng->loadLanguageModule("scormtrac");
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this->parent_obj));
$options = array("all" => $lng->txt("all"));
$scos = $this->parent_obj->object->getTrackedItems();
foreach ($scos as $row) {
$options[$row->getId()] = $row->getTitle();
}
$si = new ilSelectInputGUI($lng->txt("chapter"), "scoSelected");
$si->setOptions($options);
$si->setValue($scoSelected);
$this->form->addItem($si);
$options = array("choose" => $lng->txt("please_choose"));
for ($i = 0; $i < count($reports); $i++) {
$options[$reports[$i]] = $lng->txt(strtolower($reports[$i]));
}
$si = new ilSelectInputGUI($lng->txt("report"), "report");
$si->setOptions($options);
$si->setValue($report);
$this->form->addItem($si);
$this->form->addCommandButton($this->parent_cmd, $lng->txt("apply_filter"));
}
示例7: build
public function build()
{
$this->setFormAction($this->ctrl->getFormAction($this->parentGUI));
$select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM);
$select->setOptions($this->buildEvaluationModeOptionsArray());
$select->setValue($this->getSelectedEvaluationMode());
$this->addInputItem($select, true);
$this->addFormButton($this->lng->txt("select"), $this->parentCMD);
}
示例8: viewToolbar
protected function viewToolbar($a_is_initial = false)
{
global $ilToolbar, $lng, $ilCtrl;
$current_figure = (int) $_POST["fig"];
$current_time_frame = (string) $_POST["tfr"];
$current_scope = (int) $_POST["scp"];
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$view = new ilSelectInputGUI($lng->txt("wiki_stat_figure"), "fig");
$view->setOptions($this->page_id ? ilWikiStat::getFigureOptionsPage() : ilWikiStat::getFigureOptions());
if ($current_figure) {
$view->setValue($current_figure);
} else {
if ($a_is_initial) {
// default
$current_figure = $this->page_id ? ilWikiStat::KEY_FIGURE_WIKI_PAGE_CHANGES : ilWikiStat::KEY_FIGURE_WIKI_NUM_PAGES;
}
}
$ilToolbar->addInputItem($view, true);
$options = array();
include_once "Services/Calendar/classes/class.ilCalendarUtil.php";
$lng->loadLanguageModule("dateplaner");
foreach (ilWikiStat::getAvailableMonths($this->wiki_id) as $month) {
$parts = explode("-", $month);
$options[$month] = ilCalendarUtil::_numericMonthToString((int) $parts[1]) . " " . $parts[0];
}
krsort($options);
$tframe = new ilSelectInputGUI($lng->txt("month"), "tfr");
$tframe->setOptions($options);
if ($current_time_frame) {
$tframe->setValue($current_time_frame);
} else {
if ($a_is_initial) {
$current_time_frame = array_shift(array_keys($options));
// default
}
}
$ilToolbar->addInputItem($tframe, true);
$scope = new ilSelectInputGUI($lng->txt("wiki_stat_scope"), "scp");
$scope->setOptions(array(1 => "1 " . $lng->txt("month"), 2 => "2 " . $lng->txt("months"), 3 => "3 " . $lng->txt("months"), 4 => "4 " . $lng->txt("months"), 5 => "5 " . $lng->txt("months"), 6 => "6 " . $lng->txt("months")));
if ($current_scope) {
$scope->setValue($current_scope);
} else {
if ($a_is_initial) {
$current_scope = 1;
// default
}
}
$ilToolbar->addInputItem($scope, true);
$ilToolbar->setFormAction($ilCtrl->getFormAction($this, "view"));
$ilToolbar->addFormButton($lng->txt("show"), "view");
if ($current_figure && $current_time_frame && $current_scope) {
$ilToolbar->addSeparator();
$ilToolbar->addFormButton($lng->txt("export"), "export");
return array("figure" => $current_figure, "month" => $current_time_frame, "scope" => $current_scope);
}
}
示例9: addToForm
public function addToForm()
{
global $lng;
$def = $this->getADT()->getCopyOfDefinition();
$options = $def->getOptions();
asort($options);
// ?
$lng->loadLanguageModule("search");
$options = array("" => $lng->txt("search_any")) + $options;
$select = new ilSelectInputGUI($this->getTitle(), $this->getElementId());
$select->setOptions($options);
$select->setValue($this->getADT()->getSelection());
$this->addToParentElement($select);
}
示例10: showPersonalData
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());
}
}
示例11: listRecords
/**
* List Records
*
*
*/
public function listRecords()
{
global $ilTabs, $tpl, $lng, $ilCtrl, $ilToolbar;
// Show tables
require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
if (ilObjDataCollection::_hasWriteAccess($this->parent_obj->ref_id)) {
$tables = $this->parent_obj->object->getTables();
} else {
$tables = $this->parent_obj->object->getVisibleTables();
}
foreach ($tables as $table) {
$options[$table->getId()] = $table->getTitle();
}
$tpl->addCss("./Modules/DataCollection/css/dcl_reference_hover.css");
if (count($options) > 0) {
include_once './Services/Form/classes/class.ilSelectInputGUI.php';
$table_selection = new ilSelectInputGUI('', 'table_id');
$table_selection->setOptions($options);
$table_selection->setValue($this->table_id);
$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionRecordListGUI", "doTableSwitch"));
$ilToolbar->addText($lng->txt("dcl_table"));
$ilToolbar->addInputItem($table_selection);
$ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch');
$ilToolbar->addSeparator();
}
if (($this->table_obj->getExportEnabled() || $this->table_obj->hasPermissionToFields($this->parent_obj->ref_id)) && count($this->table_obj->getExportableFields())) {
$ilToolbar->addButton($lng->txt('dcl_export_table_excel'), $ilCtrl->getFormActionByClass("ildatacollectionrecordlistgui", "exportExcel"));
}
if ($this->table_obj->hasPermissionToAddRecord($this->parent_obj->ref_id) && $this->table_obj->hasCustomFields()) {
$ilCtrl->setParameterByClass("ildatacollectionrecordeditgui", "record_id", null);
$ilToolbar->addButton($lng->txt("dcl_import_records .xls"), $ilCtrl->getFormActionByClass("ildatacollectionrecordlistgui", "showImportExcel"));
$ilToolbar->addButton($lng->txt("dcl_add_new_record"), $ilCtrl->getFormActionByClass("ildatacollectionrecordeditgui", "create"), "", "", "", "", "submit emphsubmit");
// #11502
}
// requested not to implement this way...
//$tpl->addJavaScript("Modules/DataCollection/js/fastTableSwitcher.js");
$tpl->addJavaScript("Modules/DataCollection/js/datacollection.js");
if (count($this->table_obj->getRecordFields()) == 0) {
ilUtil::sendInfo($lng->txt("dcl_no_fields_yet") . " " . ($this->table_obj->hasPermissionToFields($this->parent_obj->ref_id) ? $lng->txt("dcl_create_fields") : ""));
}
$list = new ilDataCollectionRecordListTableGUI($this, $ilCtrl->getCmd(), $this->table_obj);
$tpl->getStandardTemplate();
$tpl->setPermanentLink("dcl", $this->parent_obj->ref_id);
if ($desc = $this->table_obj->getDescription()) {
$desc = "<div class='ilDclTableDescription'>{$desc}</div>";
}
$tpl->setContent($desc . $list->getHTML());
}
示例12: build
public function build()
{
if ($this->isTestResultButtonEnabled()) {
$link = ilLinkButton::getInstance();
// always returns a new instance
$link->setUrl($this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'outUserResultsOverview'));
$link->setCaption($this->lng->txt("tst_show_results"), false);
$this->addButtonInstance($link);
$this->addSeparator();
}
$this->setFormAction($this->ctrl->getFormAction($this->parentGUI));
$select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM);
$select->setOptions($this->buildEvaluationModeOptionsArray());
$select->setValue($this->getSelectedEvaluationMode());
$this->addInputItem($select, true);
$this->addFormButton($this->lng->txt("select"), $this->parentCMD);
}
示例13: initForm
/**
* initRecordListViewdefinitionForm
*
*/
public function initForm()
{
global $lng, $ilCtrl, $ilToolbar;
// Show tables
require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php";
$arrTables = ilDataCollectionTable::getAll($this->obj_id);
foreach ($arrTables as $table) {
$options[$table['id']] = $table['title'];
}
include_once './Services/Form/classes/class.ilSelectInputGUI.php';
$table_selection = new ilSelectInputGUI('', 'table_id');
$table_selection->setOptions($options);
$table_selection->setValue($this->table_id);
$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionRecordListViewdefinitionGUI", "doTableSwitch"));
$ilToolbar->addInputItem($table_selection);
$ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch');
// Form
require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this), "save");
$this->form->addCommandButton('save', $lng->txt('dcl_listviewdefinition_update'));
$this->form->addCommandButton('cancel', $lng->txt('cancel'));
//Table-ID
$hidden_prop = new ilHiddenInputGUI("table_id");
$hidden_prop->setValue($this->table_id);
$this->form->addItem($hidden_prop);
//Get fields
require_once "./Modules/DataCollection/classes/class.ilDataCollectionField.php";
$fields = ilDataCollectionField::getAll($this->table_id);
$tabledefinition = array("id" => array("title" => $lng->txt("id")), "table_id" => array("title" => $lng->txt("dcl_table_id")), "create_date" => array("title" => $lng->txt("create_date")), "last_update" => array("title" => $lng->txt("last_update")), "owner" => array("title" => $lng->txt("owner")));
//Array zusammenführen
foreach ($fields as $key => $value) {
$tabledefinition[$key] = $value;
}
foreach ($tabledefinition as $key => $field) {
$chk_prop = new ilCheckboxInputGUI($field['title'], 'visible_' . $key);
$chk_prop->setOptionTitle($lng->txt('visible'));
$text_prop = new ilTextInputGUI($lng->txt('dcl_field_ordering'), 'order_' . $key);
$chk_prop->addSubItem($text_prop);
$this->form->addItem($chk_prop);
}
$this->form->setTitle($lng->txt('dcl_view_viewdefinition'));
}
示例14: showTopicsSettings
public function showTopicsSettings()
{
$this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
$genSet = ilPaymentSettings::_getInstance();
$genSetData = $genSet->getAll();
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'saveTopicsSettings'));
$form->setTitle($this->lng->txt('pays_general_settings'));
$form->addCommandButton('saveTopicsSettings', $this->lng->txt('save'));
// use topics
$formItem = new ilCheckboxInputGUI($this->lng->txt('enable_topics'), 'enable_topics');
$formItem->setChecked((int) $genSetData['enable_topics']);
$formItem->setInfo($this->lng->txt('enable_topics_info'));
$form->addItem($formItem);
// default sorting type
$formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_type'), 'topics_sorting_type');
$formItem->setValue($genSetData['topics_sorting_type']);
$options = array(1 => $this->lng->txt('pay_topics_sort_by_title'), 2 => $this->lng->txt('pay_topics_sort_by_date'), 3 => $this->lng->txt('pay_topics_sort_manually'));
$formItem->setOptions($options);
$form->addItem($formItem);
// default sorting direction
$formItem = new ilSelectInputGUI($this->lng->txt('pay_topics_default_sorting_direction'), 'topics_sorting_direction');
$formItem->setValue($genSetData['topics_sorting_direction']);
$options = array('asc' => $this->lng->txt('sort_asc'), 'desc' => $this->lng->txt('sort_desc'));
$formItem->setOptions($options);
$form->addItem($formItem);
// topics custom sorting
$formItem = new ilCheckboxInputGUI($this->lng->txt('pay_topics_allow_custom_sorting'), 'topics_allow_custom_sorting');
$formItem->setChecked((int) $genSetData['topics_allow_custom_sorting']);
$formItem->setInfo($this->lng->txt('pay_topics_allow_custom_sorting_info'));
$form->addItem($formItem);
// show topics filter
$formItem = new ilCheckboxInputGUI($this->lng->txt('show_topics_filter'), 'show_topics_filter');
$formItem->setChecked((int) $genSetData['show_topics_filter']);
$formItem->setInfo($this->lng->txt('show_topics_filter_info'));
$form->addItem($formItem);
$this->tpl->setVariable('FORM', $form->getHTML());
return true;
}
示例15: getGeneralSettingsForm
public static function getGeneralSettingsForm()
{
global $lng;
$form = new ilPropertyFormGUI();
require_once 'Services/Notifications/classes/class.ilNotificationDatabaseHelper.php';
$channels = ilNotificationDatabaseHandler::getAvailableChannels(array(), true);
$options = array('set_by_user' => $lng->txt('set_by_user'), 'set_by_admin' => $lng->txt('set_by_admin'));
/**
* @todo dirty...
*/
$form->restored_values = array();
$store_values = array();
foreach ($channels as $channel) {
$chb = new ilCheckboxInputGUI($lng->txt('enable_' . $channel['name']), 'enable_' . $channel['name']);
$store_values[] = 'enable_' . $channel['name'];
$select = new ilSelectInputGUI($lng->txt('config_type'), 'notifications[' . $channel['name'] . ']');
$select->setOptions($options);
$select->setValue($channel['config_type']);
$chb->addSubItem($select);
/**
* @todo dirty...
*/
$form->restored_values['notifications[' . $channel['name'] . ']'] = $channel['config_type'];
require_once $channel['include'];
// let the channel display their own settings below the "enable channel"
// checkbox
$result = call_user_func(array($channel['handler'], 'showSettings'), $chb);
if ($result) {
$store_values = array_merge($result, $store_values);
}
$form->addItem($chb);
}
/**
* @todo dirty...
*/
$form->store_values = $store_values;
return $form;
}