本文整理汇总了PHP中ilNonEditableValueGUI::setPostVar方法的典型用法代码示例。如果您正苦于以下问题:PHP ilNonEditableValueGUI::setPostVar方法的具体用法?PHP ilNonEditableValueGUI::setPostVar怎么用?PHP ilNonEditableValueGUI::setPostVar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilNonEditableValueGUI
的用法示例。
在下文中一共展示了ilNonEditableValueGUI::setPostVar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initAddCastItemForm
/**
* Init add cast item form.
*/
function initAddCastItemForm($a_mode = "create")
{
global $lng, $ilCtrl, $ilTabs;
$this->checkPermission("write");
$ilTabs->activateTab("edit_content");
$lng->loadLanguageModule("mcst");
$news_set = new ilSetting("news");
$enable_internal_rss = $news_set->get("enable_rss_for_internal");
include "Services/Form/classes/class.ilPropertyFormGUI.php";
$this->form_gui = new ilPropertyFormGUI();
$this->form_gui->setMultipart(true);
// Property Title
$text_input = new ilTextInputGUI($lng->txt("title"), "title");
$text_input->setMaxLength(200);
$this->form_gui->addItem($text_input);
// Property Content
$text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
$text_area->setRequired(false);
$this->form_gui->addItem($text_area);
// Property Visibility
if ($enable_internal_rss) {
$radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
$radio_option = new ilRadioOption($lng->txt("access_users"), "users");
$radio_group->addOption($radio_option);
$radio_option = new ilRadioOption($lng->txt("access_public"), "public");
$radio_group->addOption($radio_option);
$radio_group->setInfo($lng->txt("mcst_visibility_info"));
$radio_group->setRequired(true);
$radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
$this->form_gui->addItem($radio_group);
}
// Duration
$dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
$dur->setInfo($lng->txt("mcst_duration_info"));
$dur->setShowDays(false);
$dur->setShowHours(true);
$dur->setShowSeconds(true);
$this->form_gui->addItem($dur);
foreach (ilObjMediaCast::$purposes as $purpose) {
if ($purpose == "VideoAlternative" && $a_mode == "create") {
continue;
}
$section = new ilFormSectionHeaderGUI();
$section->setTitle($lng->txt("mcst_" . strtolower($purpose) . "_title"));
$this->form_gui->addItem($section);
if ($a_mode != "create") {
$value = new ilHiddenInputGUI("value_" . $purpose);
$label = new ilNonEditableValueGUI($lng->txt("value"));
$label->setPostVar("label_value_" . $purpose);
$label->setInfo($lng->txt("mcst_current_value_info"));
$this->form_gui->addItem($label);
$this->form_gui->addItem($value);
}
$file = new ilFileInputGUI($lng->txt("file"), "file_" . $purpose);
$file->setSuffixes($this->purposeSuffixes[$purpose]);
$this->form_gui->addItem($file);
$text_input = new ilRegExpInputGUI($lng->txt("url"), "url_" . $purpose);
$text_input->setPattern("/https?\\:\\/\\/.+/i");
$text_input->setInfo($lng->txt("mcst_reference_info"));
$this->form_gui->addItem($text_input);
if ($purpose != "Standard") {
$clearCheckBox = new ilCheckboxInputGUI();
$clearCheckBox->setPostVar("delete_" . $purpose);
$clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
$this->form_gui->addItem($clearCheckBox);
} else {
// mime type selection
$mimeTypeSelection = new ilSelectInputGUI();
$mimeTypeSelection->setPostVar("mimetype_" . $purpose);
$mimeTypeSelection->setTitle($lng->txt("mcst_mimetype"));
$mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info"));
$options = array("" => $lng->txt("mcst_automatic_detection"));
$options = array_merge($options, $this->mimeTypes);
$mimeTypeSelection->setOptions($options);
$this->form_gui->addItem($mimeTypeSelection);
// preview picure
$pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic");
$pp->setSuffixes(array("png", "jpeg", "jpg"));
$pp->setInfo($lng->txt("mcst_preview_picture_info") . " mp4, mp3, png, jp(e)g, gif");
$this->form_gui->addItem($pp);
}
}
// save/cancel button
if ($a_mode == "create") {
$this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
$this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
} else {
$this->form_gui->setTitle($lng->txt("mcst_edit_item"));
$this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
}
$this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
$this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
}