本文整理汇总了PHP中ilCheckboxInputGUI::addSubItem方法的典型用法代码示例。如果您正苦于以下问题:PHP ilCheckboxInputGUI::addSubItem方法的具体用法?PHP ilCheckboxInputGUI::addSubItem怎么用?PHP ilCheckboxInputGUI::addSubItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilCheckboxInputGUI
的用法示例。
在下文中一共展示了ilCheckboxInputGUI::addSubItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToForm
public function addToForm()
{
global $lng;
$adt = $this->getADT();
$default = false;
if ($adt->isNull()) {
// see ilPersonalProfileGUI::addLocationToForm()
// use installation default
include_once "./Services/Maps/classes/class.ilMapUtil.php";
$def = ilMapUtil::getDefaultSettings();
$adt->setLatitude($def["latitude"]);
$adt->setLongitude($def["longitude"]);
$adt->setZoom($def["zoom"]);
$default = true;
}
$optional = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl"));
if (!$default && !$adt->isNull()) {
$optional->setChecked(true);
}
$loc = new ilLocationInputGUI($lng->txt("location"), $this->getElementId());
$loc->setLongitude($adt->getLongitude());
$loc->setLatitude($adt->getLatitude());
$loc->setZoom($adt->getZoom());
$optional->addSubItem($loc);
$rad = new ilNumberInputGUI($lng->txt("form_location_radius"), $this->addToElementId("rad"));
$rad->setSize(4);
$rad->setSuffix($lng->txt("form_location_radius_km"));
$rad->setValue($this->radius);
$rad->setRequired(true);
$optional->addSubItem($rad);
$this->addToParentElement($optional);
}
示例2: addFieldsToEditForm
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());
}
示例3: addToForm
public function addToForm()
{
global $lng;
$adt = $this->getADT();
$default = false;
if ($adt->isNull()) {
// see ilPersonalProfileGUI::addLocationToForm()
// use installation default
include_once "./Services/Maps/classes/class.ilMapUtil.php";
$def = ilMapUtil::getDefaultSettings();
$adt->setLatitude($def["latitude"]);
$adt->setLongitude($def["longitude"]);
$adt->setZoom($def["zoom"]);
$default = true;
}
// :TODO: title?
$title = $this->isRequired() ? $this->getTitle() : $lng->txt("location");
$loc = new ilLocationInputGUI($title, $this->getElementId());
$loc->setLongitude($adt->getLongitude());
$loc->setLatitude($adt->getLatitude());
$loc->setZoom($adt->getZoom());
$this->addBasicFieldProperties($loc, $adt->getCopyOfDefinition());
if (!$this->isRequired()) {
$optional = new ilCheckboxInputGUI($this->getTitle(), $this->getElementId() . "_tgl");
$optional->addSubItem($loc);
$this->addToParentElement($optional);
if (!$default && !$adt->isNull()) {
$optional->setChecked(true);
}
} else {
$this->addToParentElement($loc);
}
}
示例4: 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;
}
示例5: initConfigurationForm
/**
* 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;
}
示例6: editSettings
/**
* Edit news settings.
*/
public function editSettings()
{
global $ilCtrl, $lng, $ilSetting;
$news_set = new ilSetting("news");
$feed_set = new ilSetting("feed");
$enable_internal_news = $ilSetting->get("block_activated_news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$rss_title_format = $news_set->get("rss_title_format");
$enable_private_feed = $news_set->get("enable_private_feed");
$news_default_visibility = $news_set->get("default_visibility") != "" ? $news_set->get("default_visibility") : "users";
$disable_repository_feeds = $feed_set->get("disable_rep_feeds");
$nr_personal_desktop_feeds = $ilSetting->get("block_limit_pdfeed");
$allow_shorter_periods = $news_set->get("allow_shorter_periods");
$allow_longer_periods = $news_set->get("allow_longer_periods");
include_once "./Services/News/classes/class.ilNewsItem.php";
$rss_period = ilNewsItem::_lookupRSSPeriod();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt("news_settings"));
// Enable internal news
$cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_internal_news"), "enable_internal_news");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("news_enable_internal_news_info"));
$cb_prop->setChecked($enable_internal_news);
$form->addItem($cb_prop);
// Default Visibility
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "news_default_visibility");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue($news_default_visibility);
$form->addItem($radio_group);
// Number of news items per object
$nr_opts = array(50 => 50, 100 => 100, 200 => 200);
$nr_sel = new ilSelectInputGUI($lng->txt("news_nr_of_items"), "news_max_items");
$nr_sel->setInfo($lng->txt("news_nr_of_items_info"));
$nr_sel->setOptions($nr_opts);
$nr_sel->setValue($news_set->get("max_items"));
$form->addItem($nr_sel);
// Access Cache
$min_opts = array(0 => 0, 1 => 1, 2 => 2, 5 => 5, 10 => 10, 20 => 20, 30 => 30, 60 => 60);
$min_sel = new ilSelectInputGUI($lng->txt("news_cache"), "news_acc_cache_mins");
$min_sel->setInfo($lng->txt("news_cache_info"));
$min_sel->setOptions($min_opts);
$min_sel->setValue($news_set->get("acc_cache_mins"));
$form->addItem($min_sel);
// PD News Period
$per_opts = array(2 => "2 " . $lng->txt("days"), 3 => "3 " . $lng->txt("days"), 5 => "5 " . $lng->txt("days"), 7 => "1 " . $lng->txt("week"), 14 => "2 " . $lng->txt("weeks"), 30 => "1 " . $lng->txt("month"), 60 => "2 " . $lng->txt("months"), 120 => "4 " . $lng->txt("months"), 180 => "6 " . $lng->txt("months"), 366 => "1 " . $lng->txt("year"));
$per_sel = new ilSelectInputGUI($lng->txt("news_pd_period"), "news_pd_period");
$per_sel->setInfo($lng->txt("news_pd_period_info"));
$per_sel->setOptions($per_opts);
$per_sel->setValue((int) ilNewsItem::_lookupDefaultPDPeriod());
$form->addItem($per_sel);
// Allow user to choose lower values
$sp_prop = new ilCheckboxInputGUI($lng->txt("news_allow_shorter_periods"), "allow_shorter_periods");
$sp_prop->setValue("1");
$sp_prop->setInfo($lng->txt("news_allow_shorter_periods_info"));
$sp_prop->setChecked($allow_shorter_periods);
$form->addItem($sp_prop);
// Allow user to choose higher values
$lp_prop = new ilCheckboxInputGUI($lng->txt("news_allow_longer_periods"), "allow_longer_periods");
$lp_prop->setValue("1");
$lp_prop->setInfo($lng->txt("news_allow_longer_periods_info"));
$lp_prop->setChecked($allow_longer_periods);
$form->addItem($lp_prop);
// Enable rss for internal news
$cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_internal_rss"), "enable_internal_rss");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("news_enable_internal_rss_info"));
$cb_prop->setChecked($enable_internal_rss);
// RSS News Period
$rssp_opts = array(2 => "2 " . $lng->txt("days"), 3 => "3 " . $lng->txt("days"), 5 => "5 " . $lng->txt("days"), 7 => "1 " . $lng->txt("week"), 14 => "2 " . $lng->txt("weeks"), 30 => "1 " . $lng->txt("month"), 60 => "2 " . $lng->txt("months"), 120 => "4 " . $lng->txt("months"), 180 => "6 " . $lng->txt("months"), 365 => "1 " . $lng->txt("year"));
$rssp_sel = new ilSelectInputGUI($lng->txt("news_rss_period"), "news_rss_period");
$rssp_sel->setOptions($rssp_opts);
$rssp_sel->setValue((int) $rss_period);
$cb_prop->addSubItem($rssp_sel);
// Section Header: RSS
$sh = new ilFormSectionHeaderGUI();
$sh->setTitle($lng->txt("news_rss"));
$form->addItem($sh);
// title format for rss entries
$options = array("" => $lng->txt("news_rss_title_format_obj_news"), "news_obj" => $lng->txt("news_rss_title_format_news_obj"));
$si = new ilSelectInputGUI($lng->txt("news_rss_title_format"), "rss_title_format");
$si->setOptions($options);
$si->setValue($rss_title_format);
$cb_prop->addSubItem($si);
$form->addItem($cb_prop);
// Enable private news feed
$cb_prop = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed");
$cb_prop->setValue("1");
$cb_prop->setInfo($lng->txt("news_enable_private_feed_info"));
$cb_prop->setChecked($enable_private_feed);
$form->addItem($cb_prop);
//.........这里部分代码省略.........
示例7: initClientDbForm
/**
* Init client db form.
*/
public function initClientDbForm($a_install = true, $dbupdate = null, $db_status = false, $hotfix_available = false, $custom_updates_available = false)
{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
// type
$ne = new ilNonEditableValueGUI($lng->txt("db_type"), "db_type");
$this->form->addItem($ne);
// version
if ($this->setup->getClient()->getDBType() == "mysql" || $this->setup->getClient()->getDBType() == "innodb") {
$ne = new ilNonEditableValueGUI($lng->txt("version"), "db_version");
$ilDB = $this->setup->getClient()->db;
$ne->setValue($ilDB->getDBVersion());
$this->form->addItem($ne);
}
// host
$ne = new ilNonEditableValueGUI($lng->txt("host"), "db_host");
$this->form->addItem($ne);
// name
$ne = new ilNonEditableValueGUI($lng->txt("name"), "db_name");
$this->form->addItem($ne);
// user
$ne = new ilNonEditableValueGUI($lng->txt("user"), "db_user");
$this->form->addItem($ne);
// port
$ne = new ilNonEditableValueGUI($lng->txt("port"), "db_port");
$this->form->addItem($ne);
// creation / collation for mysql
if (($this->setup->getClient()->getDBType() == "mysql" || $this->setup->getClient()->getDBType() == "innodb") && $a_install) {
// create database
$cb = new ilCheckboxInputGUI($lng->txt("database_create"), "chk_db_create");
// collation
$collations = array("utf8_unicode_ci", "utf8_general_ci", "utf8_czech_ci", "utf8_danish_ci", "utf8_estonian_ci", "utf8_icelandic_ci", "utf8_latvian_ci", "utf8_lithuanian_ci", "utf8_persian_ci", "utf8_polish_ci", "utf8_roman_ci", "utf8_romanian_ci", "utf8_slovak_ci", "utf8_slovenian_ci", "utf8_spanish2_ci", "utf8_spanish_ci", "utf8_swedish_ci", "utf8_turkish_ci");
foreach ($collations as $collation) {
$options[$collation] = $collation;
}
$si = new ilSelectInputGUI($lng->txt("collation"), "collation");
$si->setOptions($options);
$si->setInfo($this->lng->txt("info_text_db_collation2") . " " . "<a target=\"_new\" href=\"http://dev.mysql.com/doc/mysql/en/charset-unicode-sets.html\">" . " MySQL Reference Manual :: 10.11.1 Unicode Character Sets</a>");
$cb->addSubItem($si);
$this->form->addItem($cb);
}
if ($a_install) {
$this->form->addCommandButton("installDatabase", $lng->txt("database_install"));
} else {
$ilDB = $this->setup->getClient()->db;
$this->lng->setDbHandler($ilDB);
$dbupdate = new ilDBUpdate($ilDB);
// database version
$ne = new ilNonEditableValueGUI($lng->txt("database_version"), "curv");
$ne->setValue($dbupdate->currentVersion);
$this->form->addItem($ne);
// file version
$ne = new ilNonEditableValueGUI($lng->txt("file_version"), "filev");
$ne->setValue($dbupdate->fileVersion);
$this->form->addItem($ne);
if (!($db_status = $dbupdate->getDBVersionStatus())) {
// next update step
$options = array();
for ($i = $dbupdate->currentVersion + 1; $i <= $dbupdate->fileVersion; $i++) {
$options[$i] = $i;
}
if (count($options) > 1) {
$si = new ilSelectInputGUI($lng->txt("next_update_break"), "update_break");
$si->setOptions($options);
$si->setInfo($lng->txt("next_update_break_info"));
$this->form->addItem($si);
}
if ($dbupdate->getRunningStatus() > 0) {
ilUtil::sendFailure($this->lng->txt("db_update_interrupted") . "<br /><br />" . $this->lng->txt("db_update_interrupted_avoid"));
} else {
ilUtil::sendInfo($this->lng->txt("database_needs_update"));
}
$this->form->addCommandButton("updateDatabase", $lng->txt("database_update"));
$this->form->addCommandButton("showUpdateSteps", $lng->txt("show_update_steps"));
} else {
if ($hotfix_available) {
// hotfix current version
$ne = new ilNonEditableValueGUI($lng->txt("applied_hotfixes"), "curhf");
$ne->setValue($dbupdate->getHotfixCurrentVersion());
$this->form->addItem($ne);
// hotfix file version
$ne = new ilNonEditableValueGUI($lng->txt("available_hotfixes"), "filehf");
$ne->setValue($dbupdate->getHotfixFileVersion());
$this->form->addItem($ne);
$this->form->addCommandButton("applyHotfix", $lng->txt("apply_hotfixes"));
$this->form->addCommandButton("showHotfixSteps", $lng->txt("show_update_steps"));
ilUtil::sendInfo($this->lng->txt("database_needs_update"));
} elseif ($custom_updates_available) {
// custom updates current version
$ne = new ilNonEditableValueGUI($lng->txt("applied_custom_updates"), "curcu");
$ne->setValue($dbupdate->getCustomUpdatesCurrentVersion());
$this->form->addItem($ne);
// custom updates file version
$ne = new ilNonEditableValueGUI($lng->txt("available_custom_updates"), "filecu");
$ne->setValue($dbupdate->getCustomUpdatesFileVersion());
$this->form->addItem($ne);
//.........这里部分代码省略.........
示例8: initFormSubstitutions
/**
* init form table 'substitutions'
*
* @access protected
*/
protected function initFormSubstitutions()
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
if (!($visible_records = ilAdvancedMDRecord::_getAllRecordsByObjectType())) {
return;
}
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
#$this->form->setTableWidth('100%');
// substitution
foreach ($visible_records as $obj_type => $records) {
$perm = null;
// :TODO: hardwird ?
if (in_array($obj_type, array("crs", "cat"))) {
$perm = $this->getPermissions()->hasPermissions(ilAdvancedMDPermissionHelper::CONTEXT_SUBSTITUTION, $obj_type, array(ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION, ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES, ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS));
}
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDSubstitution.php';
$sub = ilAdvancedMDSubstitution::_getInstanceByObjectType($obj_type);
// Show section
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('objs_' . $obj_type));
$this->form->addItem($section);
$check = new ilCheckboxInputGUI($this->lng->txt('description'), 'enabled_desc_' . $obj_type);
$check->setValue(1);
$check->setOptionTitle($this->lng->txt('md_adv_desc_show'));
$check->setChecked($sub->isDescriptionEnabled() ? true : false);
$this->form->addItem($check);
if ($perm && !$perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_DESCRIPTION]) {
$check->setDisabled(true);
}
$check = new ilCheckboxInputGUI($this->lng->txt('md_adv_field_names'), 'enabled_field_names_' . $obj_type);
$check->setValue(1);
$check->setOptionTitle($this->lng->txt('md_adv_fields_show'));
$check->setChecked($sub->enabledFieldNames() ? true : false);
$this->form->addItem($check);
if ($perm && !$perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_SHOW_FIELDNAMES]) {
$check->setDisabled(true);
}
#$area = new ilTextAreaInputGUI($this->lng->txt('md_adv_substitution'),'substitution_'.$obj_type);
#$area->setUseRte(true);
#$area->setRteTagSet('standard');
#$area->setValue(ilUtil::prepareFormOutput($sub->getSubstitutionString()));
#$area->setRows(5);
#$area->setCols(80);
#$this->form->addItem($area);
if ($perm) {
$perm_pos = $perm[ilAdvancedMDPermissionHelper::ACTION_SUBSTITUTION_FIELD_POSITIONS];
}
$definitions = ilAdvancedMDFieldDefinition::getInstancesByObjType($obj_type);
$definitions = $sub->sortDefinitions($definitions);
$counter = 1;
foreach ($definitions as $def) {
$definition_id = $def->getFieldId();
$perm = $this->getSubstitutionFieldPermissions($obj_type, $definition_id);
$title = ilAdvancedMDRecord::_lookupTitle($def->getRecordId());
$title = $def->getTitle() . ' (' . $title . ')';
$check = new ilCheckboxInputGUI($title, 'show[' . $obj_type . '][' . $definition_id . ']');
$check->setValue(1);
$check->setOptionTitle($this->lng->txt('md_adv_show'));
$check->setChecked($sub->isSubstituted($definition_id));
if ($perm && !$perm["show"]) {
$check->setDisabled(true);
}
$pos = new ilNumberInputGUI($this->lng->txt('position'), 'position[' . $obj_type . '][' . $definition_id . ']');
$pos->setSize(3);
$pos->setMaxLength(4);
$pos->allowDecimals(true);
$pos->setValue(sprintf('%.1f', $counter++));
$check->addSubItem($pos);
if ($perm && !$perm_pos) {
$pos->setDisabled(true);
}
$bold = new ilCheckboxInputGUI($this->lng->txt('bold'), 'bold[' . $obj_type . '][' . $definition_id . ']');
$bold->setValue(1);
$bold->setChecked($sub->isBold($definition_id));
$check->addSubItem($bold);
if ($perm && !$perm["bold"]) {
$bold->setDisabled(true);
}
$bold = new ilCheckboxInputGUI($this->lng->txt('newline'), 'newline[' . $obj_type . '][' . $definition_id . ']');
$bold->setValue(1);
$bold->setChecked($sub->hasNewline($definition_id));
$check->addSubItem($bold);
if ($perm && !$perm["newline"]) {
$bold->setDisabled(true);
}
$this->form->addItem($check);
}
// placeholder
/*
$custom = new ilCustomInputGUI($this->lng->txt('md_adv_placeholders'));
$tpl = new ilTemplate('tpl.placeholder_info.html',true,true,'Services/AdvancedMetaData');
foreach($records as $record)
{
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $definition)
//.........这里部分代码省略.........
示例9: initFormSettings
/**
* Init settings property form
*
* @access protected
*/
protected function initFormSettings()
{
if (is_object($this->form)) {
return true;
}
include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
$this->form->setTitle($this->lng->txt('cal_global_settings'));
$this->form->addCommandButton('save', $this->lng->txt('save'));
#$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
$check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'), 'enable');
$check->setValue(1);
$check->setChecked($this->settings->isEnabled() ? true : false);
$this->form->addItem($check);
$server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
$server_tz->setValue(ilTimeZone::_getDefaultTimeZone());
$this->form->addItem($server_tz);
$select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'), 'default_timezone');
$select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
$select->setInfo($this->lng->txt('cal_def_timezone_info'));
$select->setValue($this->settings->getDefaultTimeZone());
$this->form->addItem($select);
$year = date("Y");
$select = new ilSelectInputGUI($this->lng->txt('cal_def_date_format'), 'default_date_format');
$select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
$select->setInfo($this->lng->txt('cal_def_date_format_info'));
$select->setValue($this->settings->getDefaultDateFormat());
$this->form->addItem($select);
$select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'), 'default_time_format');
$select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
$select->setInfo($this->lng->txt('cal_def_time_format_info'));
$select->setValue($this->settings->getDefaultTimeFormat());
$this->form->addItem($select);
// Weekstart
$radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'), 'default_week_start');
$radio->setValue($this->settings->getDefaultWeekStart());
$option = new ilRadioOption($this->lng->txt('l_su'), 0);
$radio->addOption($option);
$option = new ilRadioOption($this->lng->txt('l_mo'), 1);
$radio->addOption($option);
$this->form->addItem($radio);
// Day start
$day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'), 'dst');
$day_start->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
$day_start->setValue($this->settings->getDefaultDayStart());
$this->form->addItem($day_start);
$day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'), 'den');
$day_end->setOptions(ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat()));
$day_end->setValue($this->settings->getDefaultDayEnd());
$this->form->addItem($day_end);
$sync = new ilCheckboxInputGUI($this->lng->txt('cal_webcal_sync'), 'webcal');
$sync->setValue(1);
$sync->setChecked($this->settings->isWebCalSyncEnabled());
$sync->setInfo($this->lng->txt('cal_webcal_sync_info'));
$sync_min = new ilNumberInputGUI('', 'webcal_hours');
$sync_min->setSize(2);
$sync_min->setMaxLength(3);
$sync_min->setValue($this->settings->getWebCalSyncHours());
$sync_min->setSuffix($this->lng->txt('hours'));
$sync->addSubItem($sync_min);
$this->form->addItem($sync);
// enable milestone planning in groups
$mil = new ilFormSectionHeaderGUI();
$mil->setTitle($this->lng->txt('cal_milestone_settings'));
$this->form->addItem($mil);
$checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'), 'enable_grp_milestones');
$checkm->setValue(1);
$checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
$checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
$this->form->addItem($checkm);
// Consultation hours
$con = new ilFormSectionHeaderGUI();
$con->setTitle($this->lng->txt('cal_ch_form_header'));
$this->form->addItem($con);
$ch = new ilCheckboxInputGUI($this->lng->txt('cal_ch_form'), 'ch');
$ch->setInfo($this->lng->txt('cal_ch_form_info'));
$ch->setValue(1);
$ch->setChecked($this->settings->areConsultationHoursEnabled());
$this->form->addItem($ch);
// repository visibility default
$rep = new ilFormSectionHeaderGUI();
$rep->setTitle($GLOBALS['lng']->txt('cal_setting_global_vis_repos'));
$this->form->addItem($rep);
$crs = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_crs_vis'), 'visible_crs');
$crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
$crs->setValue(1);
$crs->setInfo($GLOBALS['lng']->txt('cal_setting_global_crs_vis_info'));
$crs->setChecked($this->settings->isCourseCalendarEnabled());
$this->form->addItem($crs);
$grp = new ilCheckboxInputGUI($GLOBALS['lng']->txt('cal_setting_global_grp_vis'), 'visible_grp');
$grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
$grp->setValue(1);
$grp->setInfo($GLOBALS['lng']->txt('cal_setting_global_grp_vis_info'));
//.........这里部分代码省略.........
示例10: initForm
/**
* initEditCustomForm
*
* @param string $a_mode
*/
public function initForm($a_mode = "create")
{
global $ilCtrl, $ilErr, $lng;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form = new ilPropertyFormGUI();
$item = new ilTextInputGUI($lng->txt('title'), 'title');
$item->setRequired(true);
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_visible'), 'is_visible');
$this->form->addItem($item);
$item = new ilTextAreaInputGUI($lng->txt('additional_info'), 'description');
$item->setUseRte(true);
// $item->setRTESupport($this->table->getId(), 'dcl', 'table_settings');
$item->setRteTagSet('mini');
$this->form->addItem($item);
$section = new ilFormSectionHeaderGUI();
$section->setTitle($lng->txt('dcl_permissions_form'));
$this->form->addItem($section);
$item = new ilCustomInputGUI();
$item->setHtml($lng->txt('dcl_table_info'));
$item->setTitle($lng->txt('dcl_table_info_title'));
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_add_perm'), 'add_perm');
// $item->setInfo($lng->txt("dcl_add_perm_info"));
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_edit_perm'), 'edit_perm');
// $item->setInfo($lng->txt("dcl_edit_perm_info"));
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_delete_perm'), 'delete_perm');
// $item->setInfo($lng->txt("dcl_delete_perm_info"));
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_edit_by_owner'), 'edit_by_owner');
// $item->setInfo($lng->txt("dcl_edit_by_owner_info"));
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_export_enabled'), 'export_enabled');
$this->form->addItem($item);
$item = new ilCheckboxInputGUI($lng->txt('dcl_limited'), 'limited');
$sitem1 = new ilDateTimeInputGUI($lng->txt('dcl_limit_start'), 'limit_start');
$sitem2 = new ilDateTimeInputGUI($lng->txt('dcl_limit_end'), 'limit_end');
// $item->setInfo($lng->txt("dcl_limited_info"));
$item->addSubItem($sitem1);
$item->addSubItem($sitem2);
$this->form->addItem($item);
if ($a_mode == "edit") {
$this->form->addCommandButton('update', $lng->txt('dcl_table_' . $a_mode));
} else {
$this->form->addCommandButton('save', $lng->txt('dcl_table_' . $a_mode));
}
$this->form->addCommandButton('cancel', $lng->txt('cancel'));
$this->form->setFormAction($ilCtrl->getFormAction($this, $a_mode));
if ($a_mode == "edit") {
$this->form->setTitle($lng->txt('dcl_edit_table'));
} else {
$this->form->setTitle($lng->txt('dcl_new_table'));
}
}
示例11: initEditCustomForm
protected function initEditCustomForm(ilPropertyFormGUI $a_form)
{
global $lng;
// activation
include_once "Services/Object/classes/class.ilObjectActivation.php";
$this->lng->loadLanguageModule('rep');
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('rep_activation_availability'));
$a_form->addItem($section);
// additional info only with multiple references
$act_obj_info = $act_ref_info = "";
if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) {
$act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
$act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
}
$online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
$online->setInfo($this->lng->txt('poll_activation_online_info') . $act_obj_info);
$a_form->addItem($online);
$act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
// $act_type->setInfo($this->lng->txt('poll_availability_until_info'));
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
$dur->setShowTime(true);
$date = $this->object->getAccessBegin();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->object->getAccessEnd();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$act_type->addSubItem($dur);
$a_form->addItem($act_type);
// period/results
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('poll_voting_period_and_results'));
$a_form->addItem($section);
$prd = new ilCheckboxInputGUI($this->lng->txt('poll_voting_period_limited'), 'period');
$vdur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "voting_period");
$vdur->setShowTime(true);
$date = $this->object->getVotingPeriodBegin();
$vdur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$vdur->setStartText($this->lng->txt('poll_voting_period_start'));
$date = $this->object->getVotingPeriodEnd();
$vdur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$vdur->setEndText($this->lng->txt('poll_voting_period_end'));
$prd->addSubItem($vdur);
$a_form->addItem($prd);
$results = new ilRadioGroupInputGUI($lng->txt("poll_view_results"), "results");
$results->setRequired(true);
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_always"), ilObjPoll::VIEW_RESULTS_ALWAYS));
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_never"), ilObjPoll::VIEW_RESULTS_NEVER));
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_vote"), ilObjPoll::VIEW_RESULTS_AFTER_VOTE));
$results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_period"), ilObjPoll::VIEW_RESULTS_AFTER_PERIOD));
$a_form->addItem($results);
$show_result_as = new ilRadioGroupInputGUI($lng->txt("poll_show_results_as"), "show_results_as");
$show_result_as->setRequired(true);
$result_bar = new ilRadioOption($lng->txt("poll_barchart"), ilObjPoll::SHOW_RESULTS_AS_BARCHART);
$show_result_as->addOption($result_bar);
$show_result_as->addOption(new ilRadioOption($lng->txt("poll_piechart"), ilObjPoll::SHOW_RESULTS_AS_PIECHART));
$a_form->addItem($show_result_as);
$sort = new ilRadioGroupInputGUI($lng->txt("poll_result_sorting"), "sort");
$sort->setRequired(true);
$sort->addOption(new ilRadioOption($lng->txt("poll_result_sorting_answers"), 0));
$sort->addOption(new ilRadioOption($lng->txt("poll_result_sorting_votes"), 1));
$a_form->addItem($sort);
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('poll_comments'));
$a_form->addItem($section);
$comment = new ilCheckboxInputGUI($this->lng->txt('poll_comments'), 'comment');
//$comment->setInfo($this->lng->txt('poll_comments_info'));
$a_form->addItem($comment);
}
示例12: initSettingsForm
/**
* Init setting form
*/
function initSettingsForm()
{
global $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs;
$ilTabs->clearTargets();
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
$public = ilBlockSetting::_lookup($this->getBlockType(), "public_notifications", 0, $this->block_id);
$public_feed = ilBlockSetting::_lookup($this->getBlockType(), "public_feed", 0, $this->block_id);
$hide_block = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block", 0, $this->block_id);
$hide_news_per_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_per_date", 0, $this->block_id);
$hide_news_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_date", 0, $this->block_id);
if ($hide_news_date != "") {
$hide_news_date = explode(" ", $hide_news_date);
}
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$this->settings_form = new ilPropertyFormGUI();
$this->settings_form->setTitle($lng->txt("news_settings"));
$this->settings_form->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
// hide news block for learners
if ($this->getProperty("hide_news_block_option")) {
$ch = new ilCheckboxInputGUI($lng->txt("news_hide_news_block"), "hide_news_block");
$ch->setInfo($lng->txt("news_hide_news_block_info"));
$ch->setChecked($hide_block);
$this->settings_form->addItem($ch);
$hnpd = new ilCheckboxInputGUI($lng->txt("news_hide_news_per_date"), "hide_news_per_date");
$hnpd->setInfo($lng->txt("news_hide_news_per_date_info"));
$hnpd->setChecked($hide_news_per_date);
$dt_prop = new ilDateTimeInputGUI($lng->txt("news_hide_news_date"), "hide_news_date");
if ($hide_news_date != "") {
$dt_prop->setDate(new ilDateTime($hide_news_date[0] . ' ' . $hide_news_date[1], IL_CAL_DATETIME));
}
#$dt_prop->setDate($hide_news_date[0]);
#$dt_prop->setTime($hide_news_date[1]);
$dt_prop->setShowTime(true);
//$dt_prop->setInfo($lng->txt("news_hide_news_date_info"));
$hnpd->addSubItem($dt_prop);
$this->settings_form->addItem($hnpd);
}
// default visibility
if ($this->getProperty("default_visibility_option") && $enable_internal_rss) {
$default_visibility = ilBlockSetting::_lookup($this->getBlockType(), "default_visibility", 0, $this->block_id);
if ($default_visibility == "") {
$default_visibility = ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]);
}
// Default Visibility
$radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "default_visibility");
$radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("news_news_item_visibility_info"));
$radio_group->setRequired(false);
$radio_group->setValue($default_visibility);
$this->settings_form->addItem($radio_group);
}
// public notifications
if ($this->getProperty("public_notifications_option") && $enable_internal_rss) {
$ch = new ilCheckboxInputGUI($lng->txt("news_notifications_public"), "notifications_public");
$ch->setInfo($lng->txt("news_notifications_public_info"));
$ch->setChecked($public);
$this->settings_form->addItem($ch);
}
// extra rss feed
if ($enable_internal_rss) {
$ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "notifications_public_feed");
$ch->setInfo($lng->txt("news_public_feed_info"));
$ch->setChecked($public_feed);
$this->settings_form->addItem($ch);
}
//$this->settings_form->addCheckboxProperty($lng->txt("news_public_feed"), "notifications_public_feed",
// "1", $public_feed, $lng->txt("news_public_feed_info"));
//if ($this->getProperty("public_notifications_option"))
//{
// $this->settings_form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public",
// "1", $public, $lng->txt("news_notifications_public_info"));
//}
$this->settings_form->addCommandButton("saveSettings", $lng->txt("save"));
$this->settings_form->addCommandButton("cancelSettings", $lng->txt("cancel"));
$this->settings_form->setFormAction($ilCtrl->getFormaction($this));
}
示例13: showSecurity
/**
* Show Privacy settings
*
* @access public
*/
public function showSecurity()
{
global $ilSetting, $ilUser, $rbacreview;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$security = ilSecuritySettings::_getInstance();
$this->tabs_gui->setTabActive('show_security');
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('ps_security_protection'));
// Form checkbox
$check = new ilCheckboxInputGUI($this->lng->txt('ps_auto_https'), 'auto_https_detect_enabled');
$check->setOptionTitle($this->lng->txt('ps_auto_https_description'));
$check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
$check->setValue(1);
$text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_name'), 'auto_https_detect_header_name');
$text->setValue($security->getAutomaticHTTPSHeaderName());
$text->setSize(24);
$text->setMaxLength(64);
$check->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_value'), 'auto_https_detect_header_value');
$text->setValue($security->getAutomaticHTTPSHeaderValue());
$text->setSize(24);
$text->setMaxLength(64);
$check->addSubItem($text);
$form->addItem($check);
$check2 = new ilCheckboxInputGUI($this->lng->txt('activate_https'), 'https_enabled');
$check2->setChecked($security->isHTTPSEnabled() ? 1 : 0);
$check2->setValue(1);
$form->addItem($check2);
$radio_group = new ilRadioGroupInputGUI($this->lng->txt('ps_account_security_mode'), 'account_security_mode');
$radio_group->setValue($security->getAccountSecurityMode());
$radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_default'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_DEFAULT);
$radio_group->addOption($radio_opt);
$radio_opt = new ilRadioOption($this->lng->txt('ps_account_security_mode_customized'), ilSecuritySettings::ACCOUNT_SECURITY_MODE_CUSTOMIZED);
$check = new ilCheckboxInputGUI($this->lng->txt('ps_password_chars_and_numbers_enabled'), 'password_chars_and_numbers_enabled');
$check->setChecked($security->isPasswordCharsAndNumbersEnabled() ? 1 : 0);
//$check->setOptionTitle($this->lng->txt('ps_password_chars_and_numbers_enabled'));
$check->setInfo($this->lng->txt('ps_password_chars_and_numbers_enabled_info'));
$radio_opt->addSubItem($check);
$check = new ilCheckboxInputGUI($this->lng->txt('ps_password_special_chars_enabled'), 'password_special_chars_enabled');
$check->setChecked($security->isPasswordSpecialCharsEnabled() ? 1 : 0);
//$check->setOptionTitle($this->lng->txt('ps_password_special_chars_enabled'));
$check->setInfo($this->lng->txt('ps_password_special_chars_enabled_info'));
$radio_opt->addSubItem($check);
$text = new ilTextInputGUI($this->lng->txt('ps_password_min_length'), 'password_min_length');
$text->setInfo($this->lng->txt('ps_password_min_length_info'));
$text->setValue($security->getPasswordMinLength());
$text->setSize(1);
$text->setMaxLength(2);
$radio_opt->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_password_max_length'), 'password_max_length');
$text->setInfo($this->lng->txt('ps_password_max_length_info'));
$text->setValue($security->getPasswordMaxLength());
$text->setSize(2);
$text->setMaxLength(3);
$radio_opt->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_password_max_age'), 'password_max_age');
$text->setInfo($this->lng->txt('ps_password_max_age_info'));
$text->setValue($security->getPasswordMaxAge());
$text->setSize(2);
$text->setMaxLength(3);
$radio_opt->addSubItem($text);
$text = new ilTextInputGUI($this->lng->txt('ps_login_max_attempts'), 'login_max_attempts');
$text->setInfo($this->lng->txt('ps_login_max_attempts_info'));
$text->setValue($security->getLoginMaxAttempts());
$text->setSize(1);
$text->setMaxLength(2);
$radio_opt->addSubItem($text);
$radio_group->addOption($radio_opt);
$form->addItem($radio_group);
$check = new ilCheckboxInputGUI($this->lng->txt('ps_password_change_on_first_login_enabled'), 'password_change_on_first_login_enabled');
$check->setInfo($this->lng->txt('ps_password_change_on_first_login_enabled_info'));
$check->setChecked($security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0);
$form->addItem($check);
// file suffix replacement
$ti = new ilTextInputGUI($this->lng->txt("file_suffix_repl"), "suffix_repl_additional");
$ti->setMaxLength(200);
$ti->setSize(40);
$ti->setInfo($this->lng->txt("file_suffix_repl_info") . " " . SUFFIX_REPL_DEFAULT);
$ti->setValue($ilSetting->get("suffix_repl_additional"));
$form->addItem($ti);
// prevent login from multiple pcs at the same time
$objCb = new ilCheckboxInputGUI($this->lng->txt('ps_prevent_simultaneous_logins'), 'ps_prevent_simultaneous_logins');
$objCb->setChecked((int) $security->isPreventionOfSimultaneousLoginsEnabled());
$objCb->setValue(1);
$objCb->setOptionTitle($this->lng->txt('ps_prevent_simultaneous_logins_info'));
$form->addItem($objCb);
// protected admin
$admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'), 'admin_role');
$admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
$admin->setInfo($GLOBALS['lng']->txt('adm_adm_role_protect_info'));
$admin->setChecked((int) $security->isAdminRoleProtected());
$admin->setValue(1);
$form->addItem($admin);
$form->addCommandButton('save_security', $this->lng->txt('save'));
//.........这里部分代码省略.........
示例14: parseSearch
/**
* Parse search
*
* @access private
* @param
*
*/
private function parseSearch()
{
include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
foreach (ilAdvancedMDRecord::_getActiveSearchableRecords() as $record) {
$section = new ilFormSectionHeaderGUI();
$section->setTitle($record->getTitle());
$this->form->addItem($section);
foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $field) {
if (!$field->isSearchable()) {
continue;
}
switch ($field->getFieldType()) {
case ilAdvancedMDFieldDefinition::TYPE_TEXT:
$group = new ilRadioGroupInputGUI('', 'boolean[' . $field->getFieldId() . ']');
$group->setValue(isset($this->search_values['boolean'][$field->getFieldId()]) ? $this->search_values['boolean'][$field->getFieldId()] : 0);
$radio_option = new ilRadioOption($this->lng->txt("search_any_word"), 0);
$radio_option->setValue(0);
$group->addOption($radio_option);
$radio_option = new ilRadioOption($this->lng->txt("search_all_words"), 1);
$radio_option->setValue(1);
$group->addOption($radio_option);
$text = new ilTextInputGUI($field->getTitle(), $field->getFieldId());
$text->setValue(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : '');
$text->setSize(30);
$text->setMaxLength(255);
$text->addSubItem($group);
$this->form->addItem($text);
break;
case ilAdvancedMDFieldDefinition::TYPE_SELECT:
$select = new ilSelectInputGUI($field->getTitle(), $field->getFieldId());
$select->setValue(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : 0);
$options = array(0 => $this->lng->txt('search_any'));
$counter = 1;
foreach ($field->getFieldValues() as $key => $value) {
$options[$counter++] = $value;
}
$select->setOptions($options);
$this->form->addItem($select);
break;
case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
case ilAdvancedMDFieldDefinition::TYPE_DATE:
$check = new ilCheckboxInputGUI($field->getTitle(), $field->getFieldId());
$check->setValue(1);
$check->setChecked(isset($this->search_values[$field->getFieldId()]) ? $this->search_values[$field->getFieldId()] : 0);
$time = new ilDateTimeInputGUI($this->lng->txt('from'), 'date_start[' . $field->getFieldId() . ']');
if ($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE) {
$time->setShowTime(false);
} else {
$time->setShowTime(true);
}
if (isset($this->search_values['date_start'][$field->getFieldId()]) and 0) {
#$time->setUnixTime($this->toUnixTime($this->search_values['date_start'][$field->getFieldId()]['date'],$this->search_values['date_start'][$field->getFieldId()]['time']));
} else {
$time->setDate(new ilDateTime(mktime(8, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
}
$check->addSubItem($time);
$time = new ilDateTimeInputGUI($this->lng->txt('until'), 'date_end[' . $field->getFieldId() . ']');
if ($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE) {
$time->setShowTime(false);
} else {
$time->setShowTime(true);
}
if (isset($this->search_values['date_end'][$field->getFieldId()]) and 0) {
#$time->setUnixTime($this->toUnixTime($this->search_values['date_end'][$field->getFieldId()]['date'],$this->search_values['date_end'][$field->getFieldId()]['time']));
} else {
$time->setDate(new ilDateTime(mktime(16, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
}
$check->addSubItem($time);
$this->form->addItem($check);
break;
}
}
}
}
示例15: initGeneralSettingsForm
//.........这里部分代码省略.........
// Store last visited
$lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
$options = array(0 => $this->lng->txt("user_lv_keep_entries"), 1 => $this->lng->txt("user_lv_keep_only_for_session"), 2 => $this->lng->txt("user_lv_do_not_store"));
$lv->setOptions($options);
$lv->setValue((int) $ilUser->prefs["store_last_visited"]);
$this->form->addItem($lv);
// hide_own_online_status
if ($this->userSettingVisible("hide_own_online_status")) {
$cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status");
$cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
$cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
$this->form->addItem($cb);
}
include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
if (ilSessionReminder::isGloballyActivated()) {
$cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
$cb->setInfo($this->lng->txt('session_reminder_info'));
$cb->setValue(1);
$cb->setChecked((int) $ilUser->getPref('session_reminder_enabled'));
$expires = ilSession::getSessionExpireValue();
$lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
$lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));
$min_value = ilSessionReminder::MIN_LEAD_TIME;
$max_value = max($min_value, (int) $expires / 60 - 1);
$current_user_value = $ilUser->getPref('session_reminder_lead_time');
if ($current_user_value < $min_value || $current_user_value > $max_value) {
$current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;
}
$value = min(max($min_value, $current_user_value), $max_value);
$lead_time_gui->setValue($value);
$lead_time_gui->setSize(3);
$lead_time_gui->setMinValue($min_value);
$lead_time_gui->setMaxValue($max_value);
$cb->addSubItem($lead_time_gui);
$this->form->addItem($cb);
}
// calendar settings (copied here to be reachable when calendar is inactive)
// they cannot be hidden/deactivated
include_once 'Services/Calendar/classes/class.ilCalendarUserSettings.php';
include_once 'Services/Calendar/classes/class.ilCalendarUtil.php';
$lng->loadLanguageModule("dateplaner");
$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$select = new ilSelectInputGUI($lng->txt('cal_user_timezone'), 'timezone');
$select->setOptions(ilCalendarUtil::_getShortTimeZoneList());
$select->setInfo($lng->txt('cal_timezone_info'));
$select->setValue($user_settings->getTimeZone());
$this->form->addItem($select);
$year = date("Y");
$select = new ilSelectInputGUI($lng->txt('cal_user_date_format'), 'date_format');
$select->setOptions(array(ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year, ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31", ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
$select->setInfo($lng->txt('cal_date_format_info'));
$select->setValue($user_settings->getDateFormat());
$this->form->addItem($select);
$select = new ilSelectInputGUI($lng->txt('cal_user_time_format'), 'time_format');
$select->setOptions(array(ilCalendarSettings::TIME_FORMAT_24 => '13:00', ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
$select->setInfo($lng->txt('cal_time_format_info'));
$select->setValue($user_settings->getTimeFormat());
$this->form->addItem($select);
// starting point
include_once "Services/User/classes/class.ilUserUtil.php";
if (ilUserUtil::hasPersonalStartingPoint()) {
$this->lng->loadLanguageModule("administration");
$si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
$si->setRequired(true);
$si->setInfo($this->lng->txt("adm_user_starting_point_info"));
foreach (ilUserUtil::getPossibleStartingPoints() as $value => $caption) {