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


PHP ilRadioGroupInputGUI::getOptions方法代码示例

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


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

示例1: initCreateForm

 /**
  * Init object creation form
  *
  * @param    string $a_new_type
  *
  * @return    ilPropertyFormGUI
  */
 protected function initCreateForm($a_new_type)
 {
     global $lng;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setTarget("_top");
     $form->setFormAction($this->ctrl->getFormAction($this, "save"));
     $form->setTitle($this->lng->txt($a_new_type . "_new"));
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setSize(min(40, ilObject::TITLE_LENGTH));
     $ti->setMaxLength(ilObject::TITLE_LENGTH);
     $ti->setRequired(true);
     $form->addItem($ti);
     // description
     $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
     $ta->setCols(40);
     $ta->setRows(2);
     $form->addItem($ta);
     $services_group = new ilRadioGroupInputGUI($lng->txt("cld_service"), "service");
     $services_group->setRequired(true);
     foreach (ilCloudConnector::getActiveServices() as $service) {
         $option = new ilRadioOption($service, $service);
         $hook_object = ilCloudConnector::getPluginHookClass($option->getValue());
         $option->setTitle($hook_object->txt($service));
         $option->setInfo($hook_object->txt("create_info"));
         $this->plugin_service = ilCloudConnector::getServiceClass($service, 0, false);
         $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service);
         if ($init_gui) {
             $init_gui->initPluginCreationFormSection($option);
         }
         $services_group->addOption($option);
     }
     //Select first radio-button by default
     $services_group->setValue(array_shift($services_group->getOptions())->getValue());
     $form->addItem($services_group);
     $form = $this->initDidacticTemplate($form);
     $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
     $form->addCommandButton("cancel", $this->lng->txt("cancel"));
     return $form;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:48,代码来源:class.ilObjCloudGUI.php


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