當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilPropertyFormGUI::getMultipart方法代碼示例

本文整理匯總了PHP中ilPropertyFormGUI::getMultipart方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilPropertyFormGUI::getMultipart方法的具體用法?PHP ilPropertyFormGUI::getMultipart怎麽用?PHP ilPropertyFormGUI::getMultipart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilPropertyFormGUI的用法示例。


在下文中一共展示了ilPropertyFormGUI::getMultipart方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 protected function render($a_mode = '')
 {
     $tpl = new ilTemplate("tpl.prop_checkbox_group.html", true, true, "Services/Form");
     foreach ($this->getOptions() as $option) {
         // information text for option
         if ($option->getInfo() != "") {
             $tpl->setCurrentBlock("checkbox_option_desc");
             $tpl->setVariable("CHECKBOX_OPTION_DESC", $option->getInfo());
             $tpl->parseCurrentBlock();
         }
         if (count($option->getSubItems()) > 0) {
             $tpl->setCurrentBlock("checkbox_option_subform");
             $pf = new ilPropertyFormGUI();
             $pf->setMode("subform");
             $pf->setItems($option->getSubItems());
             $tpl->setVariable("SUB_FORM", $pf->getContent());
             $tpl->setVariable("SOP_ID", $this->getFieldId() . "_" . $option->getValue());
             if ($pf->getMultipart()) {
                 $this->getParentForm()->setMultipart(true);
             }
             $tpl->parseCurrentBlock();
             if ($pf->getMultipart()) {
                 $this->getParentForm()->setMultipart(true);
             }
         }
         $tpl->setCurrentBlock("prop_checkbox_option");
         if (!$this->getUseValuesAsKeys()) {
             $tpl->setVariable("POST_VAR", $this->getPostVar() . '[]');
             $tpl->setVariable("VAL_CHECKBOX_OPTION", $option->getValue());
         } else {
             $tpl->setVariable("POST_VAR", $this->getPostVar() . '[' . $option->getValue() . ']');
             $tpl->setVariable("VAL_CHECKBOX_OPTION", "1");
         }
         $tpl->setVariable("OP_ID", $this->getFieldId() . "_" . $option->getValue());
         $tpl->setVariable("FID", $this->getFieldId());
         if ($this->getDisabled() or $option->getDisabled()) {
             $tpl->setVariable('DISABLED', 'disabled="disabled" ');
         }
         if (is_array($this->getValue())) {
             if (!$this->getUseValuesAsKeys()) {
                 if (in_array($option->getValue(), $this->getValue())) {
                     $tpl->setVariable("CHK_CHECKBOX_OPTION", 'checked="checked"');
                 }
             } else {
                 $cval = $this->getValue();
                 if ($cval[$option->getValue()] == 1) {
                     $tpl->setVariable("CHK_CHECKBOX_OPTION", 'checked="checked"');
                 }
             }
         }
         $tpl->setVariable("TXT_CHECKBOX_OPTION", $option->getTitle());
         $tpl->parseCurrentBlock();
     }
     $tpl->setVariable("ID", $this->getFieldId());
     return $tpl->get();
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:56,代碼來源:class.ilCheckboxGroupInputGUI.php

示例2: render

 /**
  * Insert property html
  */
 function render()
 {
     $tpl = new ilTemplate("tpl.prop_radio.html", true, true, "Services/Form");
     foreach ($this->getOptions() as $option) {
         // information text for option
         if ($option->getInfo() != "") {
             $tpl->setCurrentBlock("radio_option_desc");
             $tpl->setVariable("RADIO_OPTION_DESC", $option->getInfo());
             $tpl->parseCurrentBlock();
         }
         if (count($option->getSubItems()) > 0) {
             if ($option->getValue() != $this->getValue()) {
                 // #10930
                 $tpl->setCurrentBlock("prop_radio_opt_hide");
                 $tpl->setVariable("HOP_ID", $this->getFieldId() . "_" . $option->getValue());
                 $tpl->parseCurrentBlock();
             }
             $tpl->setCurrentBlock("radio_option_subform");
             $pf = new ilPropertyFormGUI();
             $pf->setMode("subform");
             $pf->setItems($option->getSubItems());
             $tpl->setVariable("SUB_FORM", $pf->getContent());
             $tpl->setVariable("SOP_ID", $this->getFieldId() . "_" . $option->getValue());
             if ($pf->getMultipart()) {
                 $this->getParentForm()->setMultipart(true);
             }
             $tpl->parseCurrentBlock();
             if ($pf->getMultipart()) {
                 $this->getParentForm()->setMultipart(true);
             }
         }
         $tpl->setCurrentBlock("prop_radio_option");
         if (!$this->getDisabled()) {
             $tpl->setVariable("POST_VAR", $this->getPostVar());
         }
         $tpl->setVariable("VAL_RADIO_OPTION", $option->getValue());
         $tpl->setVariable("OP_ID", $this->getFieldId() . "_" . $option->getValue());
         $tpl->setVariable("FID", $this->getFieldId());
         if ($this->getDisabled() or $option->getDisabled()) {
             $tpl->setVariable('DISABLED', 'disabled="disabled" ');
         }
         if ($option->getValue() == $this->getValue()) {
             $tpl->setVariable("CHK_RADIO_OPTION", 'checked="checked"');
         }
         $tpl->setVariable("TXT_RADIO_OPTION", $option->getTitle());
         $tpl->parseCurrentBlock();
     }
     $tpl->setVariable("ID", $this->getFieldId());
     if ($this->getDisabled()) {
         $tpl->setVariable("HIDDEN_INPUT", $this->getHiddenTag($this->getPostVar(), $this->getValue()));
     }
     return $tpl->get();
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:56,代碼來源:class.ilRadioGroupInputGUI.php


注:本文中的ilPropertyFormGUI::getMultipart方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。