本文整理汇总了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();
}
示例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();
}