本文整理汇总了PHP中HTML_QuickForm_input::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm_input::setName方法的具体用法?PHP HTML_QuickForm_input::setName怎么用?PHP HTML_QuickForm_input::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_QuickForm_input
的用法示例。
在下文中一共展示了HTML_QuickForm_input::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
function setup_elements(&$mform)
{
global $CFG, $RESOURCE_WINDOW_OPTIONS;
if (KalturaHelpers::getPlatformKey("partner_id", "none") == "none") {
// $basic = get_string('needreg', 'kaltura');
// $str = str_replace("##SERVER##", $CFG->wwwroot . "/admin/settings.php?section=modsettingkaltura", $basic);
// $mform->addElement('static', 'pleasereg',$str, '');
redirect($CFG->wwwroot . "/admin/module.php?module=kaltura");
die;
// return;
}
if (isset($_GET['update'])) {
$item_id = $_GET['update'];
$result = get_record('course_modules', 'id', $item_id);
$result = get_record('resource', 'id', $result->instance);
$entry = get_record('kaltura_entries', 'context', "R_" . "{$result->id}");
$default_entry = $entry;
} else {
$last_entry_id = get_field('kaltura_entries', 'max(id)', 'id', 'id');
if (!empty($last_entry_id)) {
$default_entry = get_record('kaltura_entries', 'id', "{$last_entry_id}");
$default_entry->title = "";
} else {
$default_entry = new kaltura_entry();
}
}
$hidden_alltext = new HTML_QuickForm_hidden('alltext', $default_entry->dimensions, array('id' => 'id_alltext'));
$mform->addElement($hidden_alltext);
$hidden_popup = new HTML_QuickForm_hidden('popup', '', array('id' => 'id_popup'));
$mform->addElement($hidden_popup);
$hidden_dimensions = new HTML_QuickForm_hidden('dimensions', $default_entry->dimensions, array('id' => 'id_dimensions'));
$mform->addElement($hidden_dimensions);
$hidden_size = new HTML_QuickForm_hidden('size', $default_entry->size, array('id' => 'id_size'));
$mform->addElement($hidden_size);
$hidden_custom_width = new HTML_QuickForm_hidden('custom_width', $default_entry->custom_width, array('id' => 'id_custom_width'));
$mform->addElement($hidden_custom_width);
$hidden_design = new HTML_QuickForm_hidden('design', $default_entry->design, array('id' => 'id_design'));
$mform->addElement($hidden_design);
$hidden_title = new HTML_QuickForm_hidden('title', $default_entry->title, array('id' => 'id_title'));
$mform->addElement($hidden_title);
$hidden_entry_type = new HTML_QuickForm_hidden('entry_type', $default_entry->entry_type, array('id' => 'id_entry_type'));
$mform->addElement($hidden_entry_type);
$text_video = new HTML_QuickForm_static('video_text', null, '<span id="spanExplain"><table style="width:100%;font-size:9px;"><tr><td width="25%">' . get_string('videotext', 'resource_kalturavideo') . '</td><td style="width:40%;padding-left:25px;">' . get_string('videoremixtext', 'resource_kalturavideo') . '</td><td width="35%"> </td></tr></table></span>');
// $text_video_remix = new HTML_QuickForm_static('video_text_remix',null, 'bbb');
$button = new HTML_QuickForm_input();
$button->setName('addvid');
$button->setType('button');
$button->setValue('Add Video');
$button_editable = new HTML_QuickForm_input();
$button_editable->setName('addeditvid');
$button_editable->setType('button');
$button_editable->setValue('Add Editable Video');
$button_replace = new HTML_QuickForm_input();
$button_replace->setName('replacevid');
$button_replace->setType('button');
$button_replace->setValue('Replace Video');
$button_preview = new HTML_QuickForm_input();
$button_preview->setName('previewvid');
$button_preview->setType('button');
$button_preview->setValue('Preview Video');
$button_preview_edit = new HTML_QuickForm_input();
$button_preview_edit->setName('previeweditvid');
$button_preview_edit->setType('button');
$button_preview_edit->setValue('Preview & Edit Video');
$videolabel = get_string('addvideo', 'resource_kalturavideo');
$videoeditablelabel = get_string('editablevideo', 'resource_kalturavideo');
$replacelabel = get_string('replacevideo', 'resource_kalturavideo');
$previewlabel = get_string('previewvideo', 'resource_kalturavideo');
$previeweditlabel = get_string('previeweditvideo', 'resource_kalturavideo');
$cw_url = $CFG->wwwroot . '/mod/kaltura/kcw.php?';
$cw_url_init = $cw_url;
$edit_url = $CFG->wwwroot . '/mod/kaltura/keditor.php?';
$edit_url_init = $edit_url;
$preview_url = $CFG->wwwroot . '/mod/kaltura/kpreview.php?';
$preview_url_init = $preview_url;
if (!empty($entry)) {
$cw_url_init .= 'id=' . $entry->id;
$preview_url_init .= 'entry_id=' . $entry->entry_id . '&design=' . $entry->design . '&width=' . get_width($entry) . '&dimensions=' . $entry->dimensions;
$edit_url_init .= 'entry_id=' . $entry->entry_id;
}
$button_attributes = array('type' => 'button', 'onclick' => 'set_entry_type(' . KalturaEntryType::MEDIA_CLIP . ');kalturaInitModalBox(\'' . $cw_url_init . '&upload_type=video' . '\', {width:760, height:422});', 'id' => 'id_addvideo', 'value' => $videolabel, 'style' => empty($entry) ? 'display:inline' : 'display:none');
$button_attributes_editable = array('type' => 'button', 'onclick' => 'set_entry_type(' . KalturaEntryType::MIX . ');kalturaInitModalBox(\'' . $cw_url_init . '&upload_type=mix' . '\', {width:760, height:422});', 'id' => 'id_addeditablevideo', 'value' => $videoeditablelabel, 'style' => empty($entry) ? 'display:inline;margin-left:90px;' : 'display:none');
$button_attributes_replace = array('type' => 'button', 'onclick' => 'kalturaInitModalBox(\'' . $cw_url_init . (empty($entry) ? '' : ($entry->entry_type == KalturaEntryType::MEDIA_CLIP ? '&upload_type=video' : '&upload_type=mix')) . '\', {width:760, height:422});', 'id' => 'id_replace', 'value' => $replacelabel, 'style' => empty($entry) ? 'display:none' : 'display:inline');
$button_attributes_preview = array('type' => 'button', 'onclick' => 'kalturaInitModalBox(\'' . $preview_url_init . '\', ' . (empty($entry) ? '{width:400, height:382}' : '{width:' . get_width($entry) . ', height:' . (get_height($entry) + 50) . '}') . ');', 'id' => 'id_preview', 'value' => $previewlabel, 'style' => empty($entry) || $entry->entry_type != KalturaEntryType::MEDIA_CLIP ? 'display:none' : 'display:inline');
$button_attributes_preview_edit = array('type' => 'button', 'onclick' => 'kalturaInitModalBox(\'' . $edit_url_init . '\', {width:890, height:546});', 'id' => 'id_preview_edit', 'value' => $previeweditlabel, 'style' => empty($entry) || $entry->entry_type != KalturaEntryType::MIX ? 'display:none' : 'display:inline');
$resource = $this->resource;
$thumbnail = "";
if (isset($_GET['update'])) {
if (!empty($entry)) {
$thumbnail = '<img id="id_thumb" src="' . KalturaHelpers::getThumbnailUrl(null, $entry->entry_id, 140, 105) . '" />';
// $mform->addElement('static', 'video_thumb', get_string('video', 'resource_kalturavideo'), $thumbnail);
}
}
$button->setAttributes($button_attributes);
$button_editable->setAttributes($button_attributes_editable);
$button_replace->setAttributes($button_attributes_replace);
$button_preview->setAttributes($button_attributes_preview);
$button_preview_edit->setAttributes($button_attributes_preview_edit);
$objs = array();
$objs[] =& $button;
//.........这里部分代码省略.........