当前位置: 首页>>代码示例>>PHP>>正文


PHP FormUI::insert方法代码示例

本文整理汇总了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;
    }
开发者ID:ringmaster,项目名称:heavy,代码行数:31,代码来源:theme.php

示例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');
 }
开发者ID:ringmaster,项目名称:elks853,代码行数:8,代码来源:eventone.plugin.php

示例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';
     }
 }
开发者ID:habari-extras,项目名称:fun-with-photos,代码行数:17,代码来源:fun_with_photos_plugin.plugin.php

示例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';
 }
开发者ID:habari-extras,项目名称:summary,代码行数:16,代码来源:summary.plugin.php


注:本文中的FormUI::insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。