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


PHP TextareaField::FieldHolder方法代码示例

本文整理汇总了PHP中TextareaField::FieldHolder方法的典型用法代码示例。如果您正苦于以下问题:PHP TextareaField::FieldHolder方法的具体用法?PHP TextareaField::FieldHolder怎么用?PHP TextareaField::FieldHolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TextareaField的用法示例。


在下文中一共展示了TextareaField::FieldHolder方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FieldHolder

 public function FieldHolder()
 {
     Requirements::javascript('dataobject_manager/javascript/jquery.wysiwyg.js');
     Requirements::css('dataobject_manager/css/jquery.wysiwyg.css');
     Requirements::customScript("\n\t\t\t\$(function() {\n\t\t\t\t\$('#{$this->id()}').wysiwyg({\n\t\t\t\t\t{$this->getConfig()}\n\t\t\t\t}).parents('.simplehtmleditor').removeClass('hidden');\n\t\t\t\t\n\t\t\t});\n\t\t");
     return parent::FieldHolder();
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:7,代码来源:SimpleHTMLEditorField.php

示例2: FieldHolder

    public function FieldHolder($attributes = array())
    {
        Requirements::javascript('//tinymce.cachefly.net/4.1/tinymce.min.js');
        $plugins = "'paste'";
        $extra_options = "";
        if ($this->word_count_limit > 0) {
            $plugins .= ", 'wordcount'";
            $extra_options = ",  wordcount_limit : {$this->word_count_limit}";
        }
        $script = <<<SCRIPT
tinymce.init({
    menubar: false,
    content_css: '//www.openstack.org/summit/css/tinymce.css',
    selector: 'textarea.tinymceeditor',
    plugins: [
        {$plugins}
    ],
    paste_auto_cleanup_on_paste : true,
    paste_remove_styles: true,
    paste_remove_styles_if_webkit: true,
    paste_strip_class_attributes: true,
    paste_retain_style_properties: 'font-size, font-style, color',
    toolbar: 'bold italic | alignleft aligncenter | bullist numlist | paste',
    statusbar : false
    {$extra_options}
});
SCRIPT;
        Requirements::customScript($script);
        $this->addExtraClass('tinymceeditor');
        return parent::FieldHolder($attributes);
    }
开发者ID:rbowen,项目名称:openstack-org,代码行数:31,代码来源:TinyMCEEditorField.php

示例3: FieldHolder

 /**
  * Returns the field holder used by templates
  * @return {string} HTML to be used
  */
 public function FieldHolder($properties = array())
 {
     Requirements::css('vendor/etdsolutions/simplemde-markdown-editor/simplemde.min.css');
     Requirements::javascript('vendor/etdsolutions/simplemde-markdown-editor/simplemde.min.js');
     Requirements::css(MARKDOWN_MODULE_BASE . '/css/editor.css');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/javascript/editor.js');
     return parent::FieldHolder($properties);
 }
开发者ID:axllent,项目名称:silverstripe-simplemde-markdown,代码行数:12,代码来源:SimpleMDEEditor.php

示例4: FieldHolder

 /**
  * Returns the field holder used by templates
  *
  * @param  array $properties
  * @return string            HTML to be used
  */
 public function FieldHolder($properties = array())
 {
     $this->extraClasses['stacked'] = 'stacked';
     Requirements::css(MARKDOWN_DIR . '/templates/css/styles.css');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
     Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js');
     Requirements::javascript(MARKDOWN_DIR . '/thirdparty/textinputs_jquery.js');
     Requirements::javascript(MARKDOWN_DIR . '/templates/javascript/script.js');
     return parent::FieldHolder($properties);
 }
开发者ID:robbieaverill,项目名称:silverstripe-markdowntextareafield,代码行数:16,代码来源:MarkdownTextareaField.php

示例5: FieldHolder

 /**
  * Returns the field holder used by templates
  * @return {string} HTML to be used
  */
 public function FieldHolder($properties = array())
 {
     $this->extraClasses['stacked'] = 'stacked';
     Requirements::css(MARKDOWN_MODULE_BASE . '/css/MarkdownEditor.css');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/ace/ace.js');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/ace/mode-markdown.js');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/ace/theme-textmate.js');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/ace/theme-twilight.js');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/javascript/MarkdownEditor.js');
     return parent::FieldHolder($properties);
 }
开发者ID:axllent,项目名称:silverstripe-gfmarkdown,代码行数:15,代码来源:MarkdownEditor.php

示例6: FieldHolder

 /**
  * Builds the form field, includes JavaScript, and sets defaults
  *
  * @param array $attributes The attributes to include on the form field
  * @return SimpleHtmlEditorField
  */
 public function FieldHolder($attributes = array())
 {
     Requirements::javascript("bootstrap_forms/javascript/tinymce/jscripts/tiny_mce/jquery.tinymce.js");
     Requirements::javascript("bootstrap_forms/javascript/tinymce/jscripts/tiny_mce/tiny_mce.js");
     if (!$this->getAttribute('data-buttons')) {
         $this->setButtons(self::$default_buttons);
     }
     if (!$this->getAttribute('data-blockformats')) {
         $this->setBlockFormats(self::$default_blockformats);
     }
     $this->addExtraClass('wysiwyg');
     return parent::FieldHolder($attributes);
 }
开发者ID:reflektera,项目名称:silverstripe-bootstrap-forms,代码行数:19,代码来源:SimpleHtmlEditorField.php

示例7: FieldHolder

 public function FieldHolder($properties = array())
 {
     $this->extraClasses['stacked'] = 'stacked';
     $this->include_js();
     Requirements::css(MARKDOWN_MODULE_BASE . '/thirdparty/font-awesome-4.3.0/css/font-awesome.min.css');
     Requirements::css(MARKDOWN_MODULE_BASE . '/css/MarkdownEditor.css');
     Requirements::css(MARKDOWN_MODULE_BASE . '/thirdparty/editor/simplemde.min.css');
     if (0 && Director::isDev()) {
         Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/editor/sourcefiles/codemirror/codemirror.js');
         Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/editor/sourcefiles/simplemde.js');
     } else {
         Requirements::javascript(MARKDOWN_MODULE_BASE . '/thirdparty/editor/simplemde.min.js');
     }
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/javascript/MarkdownEditorField.js');
     Requirements::javascript(MARKDOWN_MODULE_BASE . '/javascript/MarkDownShortCode.js');
     $this->extend("updateFieldHolder");
     return parent::FieldHolder($properties);
 }
开发者ID:helpfulrobot,项目名称:undefinedoffset-silverstripe-markdown,代码行数:18,代码来源:MarkdownEditorField.php

示例8: FieldHolder

    public function FieldHolder($attributes = array())
    {
        Requirements::javascript('//tinymce.cachefly.net/4.3/tinymce.min.js');
        $script = '';
        $plugins = "'paste'";
        $extra_options = ",setup : function(ed) {";
        if ($this->word_count_limit > 0) {
            $plugins .= ", 'wordcount'";
            $extra_options = ",  wordcount_limit : {$this->word_count_limit}";
        } else {
            if ($this->max_char_limit > 0) {
                $script .= <<<JS

      var max_chars   = {$this->max_char_limit}; //max characters
      var allowed_keys = [8, 13, 16, 17, 18, 20, 33, 34, 35,36, 37, 38, 39, 40, 46];

      function alarmChars(chars_without_html, container_id){
        if(chars_without_html > (max_chars - 10))
        {
            \$('#chars_left_'+container_id).css('color','red');
        }
        else
        {
            \$('#chars_left_'+container_id).css('color','gray');

        }
      }
JS;
                $extra_options .= <<<JS
    ed.on("KeyDown", function(ed, evt) {
        var chars_without_html = \$.trim(tinyMCE.activeEditor.getBody().textContent).length;
        var container_id       = tinyMCE.activeEditor.id;
        var key = ed.keyCode;

        \$('#chars_left_'+container_id).html(max_chars - chars_without_html);

        if(allowed_keys.indexOf(key) != -1){
            alarmChars(chars_without_html, container_id);
            return;
        }

        if (chars_without_html > ( max_chars - 1 )){
            ed.stopPropagation();
            ed.preventDefault();
            return false;
        }
         alarmChars(chars_without_html, container_id);
    });

    ed.on("Paste", function(ed, evt, o) {
          setTimeout(function(){
               var txt = tinyMCE.activeEditor.getBody().textContent;
               var chars_without_html = \$.trim(txt).length;
               var container_id       = tinyMCE.activeEditor.id;
               if(txt.length > max_chars)
               {
                    txt = txt.substr(0, max_chars);
                    chars_without_html  = max_chars;
               }
               \$('#chars_left_'+container_id).html(max_chars - chars_without_html);
               alarmChars(chars_without_html, container_id);
               tinyMCE.activeEditor.setContent(txt.trim());
           },200);
    });



JS;
            }
        }
        if ($this->required) {
            $extra_options .= <<<JS

                ed.on("Change", function(ed){
                    tinyMCE.triggerSave();
                    console.log('change');
                });
JS;
        }
        $extra_options .= ' }';
        $script .= <<<SCRIPT
tinymce.init({
    menubar: false,
    content_css: '//www.openstack.org/summit/css/tinymce.css',
    selector: 'textarea.tinymceeditor',
    plugins: [
        {$plugins}
    ],
    paste_auto_cleanup_on_paste : true,
    paste_remove_styles: true,
    paste_remove_styles_if_webkit: true,
    paste_strip_class_attributes: true,
    paste_retain_style_properties: 'font-size, font-style, color',
    toolbar: 'bold italic | alignleft aligncenter | bullist numlist | paste',
    statusbar : false,
    valid_elements : "@[id|class|style|title"
        + "a[name|href|target|title|class],strong/b,em/i,strike,u,"
        + "#p,-ol[type|compact],-ul[type|compact],-li,br,"
        + "img[src|border|alt=|title|width|height|align],"
        + "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
//.........这里部分代码省略.........
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:101,代码来源:TinyMCEEditorField.php

示例9: FieldHolder

 public function FieldHolder()
 {
     $html = "<div class=\"display_anything_field upload_anything_field\">";
     $id = $this->controller->{$this->name}()->getField('ID');
     $migrated_value = $this->controller->{$this->name}()->getField('Migrated');
     $migrator = FALSE;
     if ($this->detect_image_gallery_module && $migrated_value == 0) {
         //display only if we want to detect imagegallery albums and it's not already migrated
         $list = $this->ImageGalleryAlbums();
         if (!empty($list)) {
             $migrator = TRUE;
             $html .= "<div class=\"field_content migrate\">";
             $html .= "<fieldset><h5>Display Anything has detected an ImageGallery album associated with this page</h5>";
             $html .= "<p>Do you wish to migrate it to your new gallery?<p>";
             $html .= "<p>Migration notes:</p><ul>";
             $html .= "<li>The original ImageGallery album will remain untouched.</li>";
             $html .= "<li>Files will be copied alongside current files, this will allow you to remove the old gallery as and when required.</li>";
             $html .= "</ul>";
             $migrate = new DropDownField("{$this->name}[{$id}][MigrateImageGalleryAlbumID]", "Choose an album to migrate images from", $list, '', NULL, '[Do not migrate]');
             $html .= $migrate->FieldHolder();
             $html .= "</fieldset>";
             $html .= "</div>";
         }
     } else {
         if ($migrated_value == 1) {
             $migrator = TRUE;
         }
     }
     $html .= "<div class=\"field_content\">";
     $html .= "<fieldset><h5>Gallery settings and options</h5>";
     $title = new TextField("{$this->name}[{$id}][Title]", "Title", $this->controller->{$this->name}()->getField('Title'));
     $html .= $title->FieldHolder();
     $description = new TextareaField("{$this->name}[{$id}][Description]", "Description", 3, NULL, $this->controller->{$this->name}()->getField('Description'));
     $html .= $description->FieldHolder();
     $visible = new CheckboxField("{$this->name}[{$id}][Visible]", "Publicly Visible", $this->controller->{$this->name}()->getField('Visible') == 1 ? TRUE : FALSE);
     $html .= $visible->FieldHolder();
     if ($migrator && $migrated_value == 1) {
         //only need to show this post migration
         $migrated = new CheckboxField("{$this->name}[{$id}][Migrated]", "Image Gallery migration complete (uncheck and save to display migration options)", TRUE);
         $html .= $migrated->FieldHolder();
     }
     $html .= "</fieldset></div>";
     $html .= "<div class=\"field_content\">";
     $html .= "<fieldset><h5>Gallery Items</h5>";
     if (!empty($id)) {
         $html .= parent::FieldHolder();
     } else {
         $html .= "<div class=\"message\"><p>Gallery items can be uploaded after the gallery is saved for the first time</p></div>";
     }
     $html .= "</fieldset></div>";
     $html .= "</div>";
     return $html;
 }
开发者ID:nyeholt,项目名称:DisplayAnything,代码行数:53,代码来源:DisplayAnythingGalleryField.php

示例10: FieldHolder

 public function FieldHolder($properties = array())
 {
     $this->addExtraClass('stacked');
     return parent::FieldHolder($properties);
 }
开发者ID:wehe,项目名称:silverstripe-sirtrevor,代码行数:5,代码来源:SirTrevorEditor.php

示例11: FieldHolder

    public function FieldHolder($attributes = array())
    {
        Requirements::javascript('//tinymce.cachefly.net/4.3/tinymce.min.js');
        $script = '';
        $plugins = "'paste'";
        $extra_options = ",setup : function(ed) {";
        if ($this->word_count_limit > 0) {
            $plugins .= ", 'wordcount'";
            $extra_options = ",  wordcount_limit : {$this->word_count_limit}";
        } else {
            if ($this->max_char_limit > 0) {
                $script .= <<<JS

      var max_chars   = {$this->max_char_limit}; //max characters
      var allowed_keys = [8, 13, 16, 17, 18, 20, 33, 34, 35,36, 37, 38, 39, 40, 46];

      function alarmChars(chars_without_html, container_id){
        if(chars_without_html > (max_chars - 10))
        {
            \$('#chars_left_'+container_id).css('color','red');
        }
        else
        {
            \$('#chars_left_'+container_id).css('color','gray');

        }
      }
JS;
                $extra_options .= <<<JS
    ed.on("KeyDown", function(ed, evt) {
        var chars_without_html = \$.trim(tinyMCE.activeEditor.getBody().textContent).length;
        var container_id       = tinyMCE.activeEditor.id;
        var key = ed.keyCode;

        \$('#chars_left_'+container_id).html(max_chars - chars_without_html);

        if(allowed_keys.indexOf(key) != -1){
            alarmChars(chars_without_html, container_id);
            return;
        }

        if (chars_without_html > ( max_chars - 1 )){
            ed.stopPropagation();
            ed.preventDefault();
            return false;
        }
         alarmChars(chars_without_html, container_id);
    });

    ed.on("Paste", function(ed, evt, o) {
          setTimeout(function(){
               var txt = tinyMCE.activeEditor.getBody().textContent;
               var chars_without_html = \$.trim(txt).length;
               var container_id       = tinyMCE.activeEditor.id;
               if(txt.length > max_chars)
               {
                    txt = txt.substr(0, max_chars);
                    chars_without_html  = max_chars;
               }
               \$('#chars_left_'+container_id).html(max_chars - chars_without_html);
               alarmChars(chars_without_html, container_id);
               tinyMCE.activeEditor.setContent(txt.trim());
           },200);
    });



JS;
            }
        }
        if ($this->required) {
            $extra_options .= <<<JS

                ed.on("Change", function(ed){
                    tinyMCE.triggerSave();
                    console.log('change');
                });
JS;
        }
        $extra_options .= ' }';
        $script .= <<<SCRIPT
tinymce.init({
    menubar: false,
    content_css: '//www.openstack.org/summit/css/tinymce.css',
    selector: 'textarea.tinymceeditor',
    plugins: [
        {$plugins}
    ],
    paste_auto_cleanup_on_paste : true,
    paste_remove_styles: true,
    paste_remove_styles_if_webkit: true,
    paste_strip_class_attributes: true,
    paste_retain_style_properties: 'font-size, font-style, color',
    toolbar: 'bold italic | alignleft aligncenter | bullist numlist | paste',
    statusbar : false
    {$extra_options}
});
SCRIPT;
        if ($this->max_char_limit > 0) {
            $script .= <<<JS
//.........这里部分代码省略.........
开发者ID:Thingee,项目名称:openstack-org,代码行数:101,代码来源:TinyMCEEditorField.php


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