當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。