本文整理汇总了PHP中FormUI::insert方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUI::insert方法的具体用法?PHP FormUI::insert怎么用?PHP FormUI::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormUI
的用法示例。
在下文中一共展示了FormUI::insert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_form_publish_entry
/**
* Add the Key Image field to the post publication form, and allow it to be set from silos
* @param FormUI $form
* @param Post $post
*/
public function action_form_publish_entry($form, $post)
{
$form->insert('publish_controls', new FormControlText('keyimage', $post, 'Key Image', 'admincontrol_text'));
$imageinsert = $form->insert('content', 'static', 'imageinsert', '');
$imageinsert->caption = <<<CAPTION_SCRIPT
<script type="text/javascript">
function add_photo_to_set(fileindex, fileobj) {
\t\$('#keyimage').val(fileobj.url);
}
\$(function(){
\t\$.extend(habari.media.output.image_jpeg, {
\t\tset_key_image: add_photo_to_set
\t});
\t\$.extend(habari.media.output.image_png, {
\t\tset_key_image: add_photo_to_set
\t});
\t\$.extend(habari.media.output.image_gif, {
\t\tset_key_image: add_photo_to_set
\t});
\t\$.extend(habari.media.output.flickr, {
\t\tset_key_image: add_photo_to_set
\t});
});
</script>
CAPTION_SCRIPT;
}
示例2: action_form_publish_event
public function action_form_publish_event(FormUI $form, $post, $context)
{
$event_data = $form->insert('publish_controls', new FormControlFieldset('event_data', _t('Event Data'), 'admincontrol_fieldset'));
$start = $event_data->append(new FormControlTags('event_start', $post, 'Event Start', 'optionscontrol_text'));
$start->add_validator('validate_datetime')->add_validator('validate_required');
$end = $event_data->append(new FormControlTags('event_end', $post, 'Event End', 'optionscontrol_text'));
$end->add_validator('validate_datetime')->add_validator('validate_required');
}
示例3: action_form_publish
/**
* Add fields to the publish page for photos
*
* @param FormUI $form The publish form
* @param Post $post
* @return array
*/
public function action_form_publish($form, $post)
{
if ($form->content_type->value == Post::type('entry')) {
$form->insert('content', 'text', 'photo', 'null:null', _t('Photo URL'));
if (isset($post->info->photo)) {
$form->photo->value = $post->info->photo;
}
$form->photo->template = 'admincontrol_text';
}
}
示例4: action_form_publish
/**
* Add fields to the publish page for all content types
*
* @param FormUI $form The publish form
* @param Post $post The post being published
*/
public function action_form_publish($form, $post)
{
$form->insert('tags', 'text', 'summary', 'null:null', _t('Summary'));
$form->summary->raw = true;
$form->summary->value = $post->info->summary;
$form->summary->tabindex = 3;
$form->tags->tabindex = 4;
$form->buttons->save->tabindex = 5;
$form->summary->template = 'admincontrol_text';
}