当前位置: 首页>>代码示例>>PHP>>正文


PHP ilTextInputGUI::setInputType方法代码示例

本文整理汇总了PHP中ilTextInputGUI::setInputType方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextInputGUI::setInputType方法的具体用法?PHP ilTextInputGUI::setInputType怎么用?PHP ilTextInputGUI::setInputType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilTextInputGUI的用法示例。


在下文中一共展示了ilTextInputGUI::setInputType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initSettingsForm

 /**
  * init settings form
  *
  * @access protected
  */
 protected function initSettingsForm($a_mode = 'update')
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'settings'));
     $this->form->setTitle($this->lng->txt('ecs_connection_settings'));
     $ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'), 'active');
     $ena->setChecked($this->settings->isEnabled());
     $ena->setValue(1);
     $this->form->addItem($ena);
     $ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'), 'server');
     $ser->setValue((string) $this->settings->getServer());
     $ser->setRequired(true);
     $this->form->addItem($ser);
     $pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'), 'protocol');
     // fixed to https
     #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
     #		ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
     $pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS'));
     $pro->setValue($this->settings->getProtocol());
     $pro->setRequired(true);
     $this->form->addItem($pro);
     $por = new ilTextInputGUI($this->lng->txt('ecs_port'), 'port');
     $por->setSize(5);
     $por->setMaxLength(5);
     $por->setValue((string) $this->settings->getPort());
     $por->setRequired(true);
     $this->form->addItem($por);
     $tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'), 'auth_type');
     $tcer->setValue($this->settings->getAuthType());
     $this->form->addItem($tcer);
     // Certificate based authentication
     $cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE);
     $tcer->addOption($cert_based);
     $cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'), 'client_cert');
     $cli->setSize(60);
     $cli->setValue((string) $this->settings->getClientCertPath());
     $cli->setRequired(true);
     $cert_based->addSubItem($cli);
     $key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'), 'key_path');
     $key->setSize(60);
     $key->setValue((string) $this->settings->getKeyPath());
     $key->setRequired(true);
     $cert_based->addSubItem($key);
     $cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'), 'key_password');
     $cerp->setSize(12);
     $cerp->setValue((string) $this->settings->getKeyPassword());
     $cerp->setInputType('password');
     $cerp->setRequired(true);
     $cert_based->addSubItem($cerp);
     $cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'), 'ca_cert');
     $cer->setSize(60);
     $cer->setValue((string) $this->settings->getCACertPath());
     $cer->setRequired(true);
     $cert_based->addSubItem($cer);
     // Apache auth
     $apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE);
     $tcer->addOption($apa_based);
     $user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'), 'auth_user');
     $user->setSize(32);
     $user->setValue((string) $this->settings->getAuthUser());
     $user->setRequired(true);
     $apa_based->addSubItem($user);
     $pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass');
     $pass->setRetype(false);
     $pass->setSize(16);
     $pass->setMaxLength(32);
     $pass->setValue((string) $this->settings->getAuthPass());
     $pass->setRequired(true);
     $apa_based->addSubItem($pass);
     $ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial'));
     $ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value'));
     $cert_based->addSubItem($ser);
     $loc = new ilFormSectionHeaderGUI();
     $loc->setTitle($this->lng->txt('ecs_local_settings'));
     $this->form->addItem($loc);
     $pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'), 'polling');
     $pol->setShowDays(false);
     $pol->setShowHours(false);
     $pol->setShowMinutes(true);
     $pol->setShowSeconds(true);
     $pol->setSeconds($this->settings->getPollingTimeSeconds());
     $pol->setMinutes($this->settings->getPollingTimeMinutes());
     $pol->setRequired(true);
     $pol->setInfo($this->lng->txt('ecs_polling_info'));
     $this->form->addItem($pol);
     $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'));
     $imp->setRequired(true);
     $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS');
     $tpl->setVariable('SIZE', 5);
     $tpl->setVariable('MAXLENGTH', 11);
     $tpl->setVariable('POST_VAR', 'import_id');
//.........这里部分代码省略.........
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:101,代码来源:class.ilECSSettingsGUI.php

示例2: editSettings

 /**
  * Show settings screen.
  */
 function editSettings()
 {
     global $ilUser, $lng, $ilCtrl, $ilSetting;
     $news_set = new ilSetting("news");
     $enable_internal_rss = $news_set->get("enable_rss_for_internal");
     $allow_shorter_periods = $news_set->get("allow_shorter_periods");
     $allow_longer_periods = $news_set->get("allow_longer_periods");
     $enable_private_feed = $news_set->get("enable_private_feed");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     if ($allow_shorter_periods || $allow_longer_periods) {
         $form = new ilPropertyFormGUI();
         include_once "./Services/News/classes/class.ilNewsItem.php";
         $default_per = ilNewsItem::_lookupDefaultPDPeriod();
         $per = ilNewsItem::_lookupUserPDPeriod($ilUser->getId());
         $form->setTitle($lng->txt("news_settings"));
         $form->setTitleIcon(ilUtil::getImagePath("icon_news.png"));
         $form->setTableWidth("100%");
         $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"));
         $unset = array();
         foreach ($per_opts 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($per_opts[$k]);
         }
         $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) $per);
         $form->addItem($per_sel);
         //$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"))
         //{
         //	$form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public",
         //		"1", $public, $lng->txt("news_notifications_public_info"));
         //}
         $form->addCommandButton("saveSettings", $lng->txt("save"));
         $form->addCommandButton("cancelSettings", $lng->txt("cancel"));
         $form->setFormAction($ilCtrl->getFormaction($this));
         $returnForm = $form->getHTML();
     }
     if ($enable_private_feed) {
         $feed_form = new ilPropertyFormGUI();
         $feed_form->setTitle($lng->txt("priv_feed_settings"));
         $feed_form->setTitleIcon(ilUtil::getImagePath("privrss.png"));
         $feed_form->setTableWidth("100%");
         $enable_private_feed = new ilCheckboxInputGUI($lng->txt("news_enable_private_feed"), "enable_private_feed");
         $retype_pass = new ilTextInputGUI($lng->txt("retype_password"), "retype_password");
         $desired_pass = new ilTextInputGUI($lng->txt("desired_password"), "desired_password");
         // user has already valid password
         if (ilObjUser::_getFeedPass($_SESSION[AccountId]) != false) {
             $enable_private_feed->setChecked(true);
             $desired_pass->setValue("******");
         }
         $desired_pass->setInputType("password");
         $retype_pass->setInputType("password");
         $feed_form->addItem($enable_private_feed);
         $feed_form->addItem($desired_pass);
         $feed_form->addItem($retype_pass);
         $feed_form->addCommandButton("changeFeedSettings", $lng->txt("save"));
         $feed_form->addCommandButton("cancelSettings", $lng->txt("cancel"));
         $feed_form->setFormAction($ilCtrl->getFormaction($this));
         $returnForm .= $returnForm == "" ? $feed_form->getHTML() : "<br>" . $feed_form->getHTML();
     }
     return $returnForm;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:75,代码来源:class.ilPDNewsBlockGUI.php

示例3: fillRegistrationType

 /**
  * fill registration type
  *
  * @access protected
  * @return
  */
 protected function fillRegistrationType()
 {
     global $ilUser;
     if ($this->container->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_DEACTIVATED) {
         $reg = new ilCustomInputGUI($this->lng->txt('mem_reg_type'));
         #$reg->setHtml($this->lng->txt('crs_info_reg_deactivated'));
         $reg->setAlert($this->lng->txt('crs_info_reg_deactivated'));
         #ilUtil::sendFailure($this->lng->txt('crs_info_reg_deactivated'));
         #$reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
         #$reg->setValue($this->lng->txt('crs_info_reg_deactivated'));
         #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
         $this->form->addItem($reg);
         // Disable registration
         $this->enableRegistration(false);
         return true;
     }
     switch ($this->container->getSubscriptionType()) {
         case IL_CRS_SUBSCRIPTION_DIRECT:
             // no "request" info if waiting list is active
             if ($this->isWaitingListActive()) {
                 return true;
             }
             $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $txt->setValue($this->lng->txt('crs_info_reg_direct'));
             $this->form->addItem($txt);
             break;
         case IL_CRS_SUBSCRIPTION_PASSWORD:
             $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $txt->setValue($this->lng->txt('crs_subscription_options_password'));
             $pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
             $pass->setInputType('password');
             $pass->setSize(12);
             $pass->setMaxLength(32);
             #$pass->setRequired(true);
             $pass->setInfo($this->lng->txt('crs_info_reg_password'));
             $txt->addSubItem($pass);
             $this->form->addItem($txt);
             break;
         case IL_CRS_SUBSCRIPTION_CONFIRMATION:
             // no "request" info if waiting list is active
             if ($this->isWaitingListActive()) {
                 return true;
             }
             $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $txt->setValue($this->lng->txt('crs_subscription_options_confirmation'));
             $sub = new ilTextAreaInputGUI($this->lng->txt('crs_reg_subject'), 'subject');
             $sub->setValue($_POST['subject']);
             $sub->setInfo($this->lng->txt('crs_info_reg_confirmation'));
             $sub->setCols(40);
             $sub->setRows(5);
             if ($this->participants->isSubscriber($ilUser->getId())) {
                 $sub_data = $this->participants->getSubscriberData($ilUser->getId());
                 $sub->setValue($sub_data['subject']);
                 $sub->setInfo('');
                 ilUtil::sendFailure($this->lng->txt('crs_reg_user_already_subscribed'));
                 $this->enableRegistration(false);
             }
             $txt->addSubItem($sub);
             $this->form->addItem($txt);
             break;
         default:
             return true;
     }
     return true;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:71,代码来源:class.ilCourseRegistrationGUI.php

示例4: fillRegistrationType

 /**
  * fill registration procedure
  *
  * @access protected
  * @param
  * @return
  */
 protected function fillRegistrationType()
 {
     global $ilUser;
     if ($this->getWaitingList()->isOnList($ilUser->getId())) {
         return true;
     }
     switch ($this->container->getRegistrationType()) {
         case GRP_REGISTRATION_DEACTIVATED:
             $reg = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $reg->setValue($this->lng->txt('grp_reg_disabled'));
             #$reg->setAlert($this->lng->txt('grp_reg_deactivated_alert'));
             $this->form->addItem($reg);
             // Disable registration
             $this->enableRegistration(false);
             break;
         case GRP_REGISTRATION_PASSWORD:
             $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $txt->setValue($this->lng->txt('grp_pass_request'));
             $pass = new ilTextInputGUI($this->lng->txt('passwd'), 'grp_passw');
             $pass->setInputType('password');
             $pass->setSize(12);
             $pass->setMaxLength(32);
             #$pass->setRequired(true);
             $pass->setInfo($this->lng->txt('group_password_registration_msg'));
             $txt->addSubItem($pass);
             $this->form->addItem($txt);
             break;
         case GRP_REGISTRATION_REQUEST:
             // no "request" info if waiting list is active
             if ($this->isWaitingListActive()) {
                 return true;
             }
             $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $txt->setValue($this->lng->txt('grp_reg_request'));
             $sub = new ilTextAreaInputGUI($this->lng->txt('grp_reg_subject'), 'subject');
             $sub->setValue($_POST['subject']);
             $sub->setInfo($this->lng->txt('group_req_registration_msg'));
             $sub->setCols(40);
             $sub->setRows(5);
             if ($this->participants->isSubscriber($ilUser->getId())) {
                 $sub_data = $this->participants->getSubscriberData($ilUser->getId());
                 $sub->setValue($sub_data['subject']);
                 $sub->setInfo('');
                 ilUtil::sendFailure($this->lng->txt('grp_already_assigned'));
                 $this->enableRegistration(false);
             }
             $txt->addSubItem($sub);
             $this->form->addItem($txt);
             break;
         case GRP_REGISTRATION_DIRECT:
             // no "direct registration" info if waiting list is active
             if ($this->isWaitingListActive()) {
                 return true;
             }
             $txt = new ilNonEditableValueGUI($this->lng->txt('mem_reg_type'));
             $txt->setValue($this->lng->txt('group_req_direct'));
             $this->form->addItem($txt);
             break;
         default:
             return true;
     }
     return true;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:70,代码来源:class.ilGroupRegistrationGUI.php


注:本文中的ilTextInputGUI::setInputType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。