本文整理匯總了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();
}