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


PHP ilPropertyFormGUI::getInputItemsRecursive方法代码示例

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


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

示例1: showConfirmation

 private function showConfirmation(ilPropertyFormGUI $form, $oldQuestionSetType, $newQuestionSetType, $hasQuestionsWithoutQuestionpool)
 {
     require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
     $confirmation = new ilConfirmationGUI();
     $headerText = sprintf($this->lng->txt('tst_change_quest_set_type_from_old_to_new_with_conflict'), $this->getQuestionSetTypeTranslation($oldQuestionSetType), $this->getQuestionSetTypeTranslation($newQuestionSetType));
     if ($hasQuestionsWithoutQuestionpool) {
         $headerText .= '<br /><br />' . $this->lng->txt("tst_nonpool_questions_get_lost_warning");
     }
     $confirmation->setHeaderText($headerText);
     $confirmation->setFormAction($this->ctrl->getFormAction($this));
     $confirmation->setCancel($this->lng->txt('cancel'), self::CMD_SHOW_FORM);
     $confirmation->setConfirm($this->lng->txt('confirm'), self::CMD_CONFIRMED_SAVE_FORM);
     foreach ($form->getInputItemsRecursive() as $key => $item) {
         //vd("$key // {$item->getType()} // ".json_encode($_POST[$item->getPostVar()]));
         switch ($item->getType()) {
             case 'section_header':
                 continue;
             case 'datetime':
                 list($date, $time) = explode(' ', $item->getDate()->get(IL_CAL_DATETIME));
                 if ($item->getMode() == ilDateTimeInputGUI::MODE_SELECT) {
                     list($y, $m, $d) = explode('-', $date);
                     $confirmation->addHiddenItem("{$item->getPostVar()}[date][y]", $y);
                     $confirmation->addHiddenItem("{$item->getPostVar()}[date][m]", $m);
                     $confirmation->addHiddenItem("{$item->getPostVar()}[date][d]", $d);
                     if ($item->getShowTime()) {
                         list($h, $m, $s) = explode('-', $time);
                         $confirmation->addHiddenItem("{$item->getPostVar()}[time][h]", $h);
                         $confirmation->addHiddenItem("{$item->getPostVar()}[time][m]", $m);
                         $confirmation->addHiddenItem("{$item->getPostVar()}[time][s]", $s);
                     }
                 } else {
                     $confirmation->addHiddenItem("{$item->getPostVar()}[date]", $date);
                     $confirmation->addHiddenItem("{$item->getPostVar()}[time]", $time);
                 }
                 break;
             case 'duration':
                 $confirmation->addHiddenItem("{$item->getPostVar()}[MM]", (int) $item->getMonths());
                 $confirmation->addHiddenItem("{$item->getPostVar()}[dd]", (int) $item->getDays());
                 $confirmation->addHiddenItem("{$item->getPostVar()}[hh]", (int) $item->getHours());
                 $confirmation->addHiddenItem("{$item->getPostVar()}[mm]", (int) $item->getMinutes());
                 $confirmation->addHiddenItem("{$item->getPostVar()}[ss]", (int) $item->getSeconds());
                 break;
             case 'checkboxgroup':
                 if (is_array($item->getValue())) {
                     foreach ($item->getValue() as $option) {
                         $confirmation->addHiddenItem("{$item->getPostVar()}[]", $option);
                     }
                 }
                 break;
             case 'checkbox':
                 if ($item->getChecked()) {
                     $confirmation->addHiddenItem($item->getPostVar(), 1);
                 }
                 break;
             default:
                 $confirmation->addHiddenItem($item->getPostVar(), $item->getValue());
         }
     }
     $this->tpl->setContent($this->ctrl->getHTML($confirmation));
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:60,代码来源:class.ilObjTestSettingsGeneralGUI.php

示例2: populateParametersFromPropertyForm

 /**
  * @param ilPropertyForm $form
  */
 public function populateParametersFromPropertyForm(ilPropertyFormGUI $form, $timezone)
 {
     foreach ($form->getInputItemsRecursive() as $key => $item) {
         //vd("$key // {$item->getType()} // ".json_encode($_POST[$item->getPostVar()]));
         switch ($item->getType()) {
             case 'section_header':
                 continue;
             case 'datetime':
                 list($date, $time) = explode(' ', $item->getDate()->get(IL_CAL_DATETIME));
                 if ($item->getMode() == ilDateTimeInputGUI::MODE_SELECT) {
                     list($y, $m, $d) = explode('-', $date);
                     $this->addHiddenItem("{$item->getPostVar()}[date][y]", $y);
                     $this->addHiddenItem("{$item->getPostVar()}[date][m]", $m);
                     $this->addHiddenItem("{$item->getPostVar()}[date][d]", $d);
                     if ($item->getShowTime()) {
                         list($h, $m, $s) = explode('-', $time);
                         $this->addHiddenItem("{$item->getPostVar()}[time][h]", $h);
                         $this->addHiddenItem("{$item->getPostVar()}[time][m]", $m);
                         $this->addHiddenItem("{$item->getPostVar()}[time][s]", $s);
                     }
                 } else {
                     $this->addHiddenItem("{$item->getPostVar()}[date]", $date);
                     $this->addHiddenItem("{$item->getPostVar()}[time]", $time);
                 }
                 break;
             case 'duration':
                 $this->addHiddenItem("{$item->getPostVar()}[MM]", (int) $item->getMonths());
                 $this->addHiddenItem("{$item->getPostVar()}[dd]", (int) $item->getDays());
                 $this->addHiddenItem("{$item->getPostVar()}[hh]", (int) $item->getHours());
                 $this->addHiddenItem("{$item->getPostVar()}[mm]", (int) $item->getMinutes());
                 $this->addHiddenItem("{$item->getPostVar()}[ss]", (int) $item->getSeconds());
                 break;
             case 'dateduration':
                 $this->addHiddenItem("{$item->getPostVar()}[start][date][y]", (int) $item->getStart()->get(IL_CAL_FKT_DATE, 'Y', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[start][date][m]", (int) $item->getStart()->get(IL_CAL_FKT_DATE, 'm', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[start][date][d]", (int) $item->getStart()->get(IL_CAL_FKT_DATE, 'd', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[start][time][h]", (int) $item->getStart()->get(IL_CAL_FKT_DATE, 'H', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[start][time][m]", (int) $item->getStart()->get(IL_CAL_FKT_DATE, 'i', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[start][time][s]", (int) $item->getStart()->get(IL_CAL_FKT_DATE, 's', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[end][date][y]", (int) $item->getEnd()->get(IL_CAL_FKT_DATE, 'Y', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[end][date][m]", (int) $item->getEnd()->get(IL_CAL_FKT_DATE, 'm', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[end][date][d]", (int) $item->getEnd()->get(IL_CAL_FKT_DATE, 'd', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[end][time][h]", (int) $item->getEnd()->get(IL_CAL_FKT_DATE, 'H', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[end][time][m]", (int) $item->getEnd()->get(IL_CAL_FKT_DATE, 'i', $timezone));
                 $this->addHiddenItem("{$item->getPostVar()}[end][time][s]", (int) $item->getEnd()->get(IL_CAL_FKT_DATE, 's', $timezone));
                 break;
             case 'checkboxgroup':
                 if (is_array($item->getValue())) {
                     foreach ($item->getValue() as $option) {
                         $this->addHiddenItem("{$item->getPostVar()}[]", $option);
                     }
                 }
                 break;
             case 'checkbox':
                 if ($item->getChecked()) {
                     $this->addHiddenItem($item->getPostVar(), 1);
                 }
                 break;
             default:
                 $this->addHiddenItem($item->getPostVar(), $item->getValue());
         }
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:66,代码来源:class.ilTestSettingsChangeConfirmationGUI.php


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