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


PHP FormField::FieldHolder方法代码示例

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


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

示例1: FieldHolder

    public function FieldHolder($attributes = array())
    {
        Requirements::css(THIRDPARTY_DIR . '/jquery-ui-themes/smoothness/jquery-ui.css');
        Requirements::css("registration/css/affiliations.css");
        Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js");
        Requirements::javascript(Director::protocol() . "ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js");
        Requirements::javascript(THIRDPARTY_DIR . '/jquery-ui/jquery-ui.js');
        $js_scripts = array("themes/openstack/javascript/pure.min.js", "themes/openstack/javascript/jquery.serialize.js", "themes/openstack/javascript/jquery.cleanform.js", "themes/openstack/javascript/jquery.ui.datepicker.validation.package-1.0.1/jquery.ui.datepicker.validation.js", "themes/openstack/javascript/jquery.validate.custom.methods.js", 'registration/javascript/affiliations.js');
        foreach ($js_scripts as $js) {
            Requirements::javascript($js);
        }
        $arrayData = new ArrayData(array('Title' => 'Edit Affiliation'));
        $modal = $arrayData->renderWith('AffiliationModalForm');
        $modal = trim(preg_replace('/\\s\\s+/', ' ', $modal));
        $script = <<<JS

        (function( \$ ){

            \$(document).ready(function() {
                \$('{$modal}').appendTo(\$('body'));
                \$("#edit-affiliation-form").affiliations({
                    storage:'{$this->mode}'
                });
            });


        }( jQuery ));
JS;
        Requirements::customScript($script);
        return parent::FieldHolder($attributes);
    }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:31,代码来源:AffiliationField.php

示例2: FieldHolder

 public function FieldHolder($properties = array())
 {
     Requirements::css(LINKABLE_PATH . '/css/embeddedobjectfield.css');
     Requirements::javascript(LINKABLE_PATH . '/javascript/embeddedobjectfield.js');
     if ($this->object && $this->object->ID) {
         $properties['SourceURL'] = TextField::create($this->getName() . '[sourceurl]', '')->setAttribute('placeholder', _t('Linkable.SOURCEURL', 'Source URL'));
         if (strlen($this->object->SourceURL)) {
             $properties['ObjectTitle'] = TextField::create($this->getName() . '[title]', _t('Linkable.TITLE', 'Title'));
             $properties['Width'] = TextField::create($this->getName() . '[width]', _t('Linkable.WIDTH', 'Width'));
             $properties['Height'] = TextField::create($this->getName() . '[height]', _t('Linkable.HEIGHT', 'Height'));
             $properties['ThumbURL'] = HiddenField::create($this->getName() . '[thumburl]', '');
             $properties['Type'] = HiddenField::create($this->getName() . '[type]', '');
             $properties['EmbedHTML'] = HiddenField::create($this->getName() . '[embedhtml]', '');
             $properties['ObjectDescription'] = TextAreaField::create($this->getName() . '[description]', _t('Linkable.DESCRIPTION', 'Description'));
             $properties['ExtraClass'] = TextField::create($this->getName() . '[extraclass]', _t('Linkable.CSSCLASS', 'CSS class'));
             foreach ($properties as $key => $field) {
                 if ($key == 'ObjectTitle') {
                     $key = 'Title';
                 } elseif ($key == 'ObjectDescription') {
                     $key = 'Description';
                 }
                 $field->setValue($this->object->{$key});
             }
             if ($this->object->ThumbURL) {
                 $properties['ThumbImage'] = LiteralField::create($this->getName(), '<img src="' . $this->object->ThumbURL . '" />');
             }
         }
     } else {
         $properties['SourceURL'] = TextField::create($this->getName() . '[sourceurl]', '')->setAttribute('placeholder', _t('Linkable.SOURCEURL', 'Source URL'));
     }
     $field = parent::FieldHolder($properties);
     return $field;
 }
开发者ID:jason-zz,项目名称:silverstripe-linkable,代码行数:33,代码来源:EmbeddedObjectField.php

示例3: FieldHolder

 public function FieldHolder($properties = array())
 {
     $config = array('datetimeorder' => $this->getConfig('datetimeorder'));
     $config = array_filter($config);
     $this->addExtraClass('fieldgroup');
     $this->addExtraClass(Convert::raw2json($config));
     return parent::FieldHolder($properties);
 }
开发者ID:jakedaleweb,项目名称:AtomCodeChallenge,代码行数:8,代码来源:DatetimeField.php

示例4: FieldHolder

 public function FieldHolder($attributes = array())
 {
     //$tags_json = json_encode($this->Category->AllowedTags()->column('Tag'));
     $tag_array = array();
     foreach ($this->Category->AllowedTags() as $tag) {
         if (!isset($tag_array[$tag->Group])) {
             $tag_array[$tag->Group] = array();
         }
         $tag_array[$tag->Group][] = $tag->Tag;
     }
     $tags_json = json_encode($tag_array);
     Requirements::customScript("var category_tags = {$tags_json};");
     Requirements::javascript('themes/openstack/bower_assets/jquery-validate/dist/jquery.validate.min.js');
     Requirements::set_write_js_to_body(false);
     return parent::FieldHolder($attributes);
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:16,代码来源:TagManagerField.php

示例5: FieldHolder

	/**
	 * Checkboxes use the RightLabelledFieldHolder template, to put the field on the left
	 * and the label on the right.  See {@link FormField::FieldHolder} for more information about
	 * how FieldHolder works. 
	 */
	function FieldHolder() {
		if($this->labelLeft) {
			return parent::FieldHolder();
		} else {
			extract($this->getXMLValues(array( 'Name', 'Field', 'Title', 'Message', 'MessageType' )));
			$messageBlock = isset($Message) ? "<span class=\"message $MessageType\">$Message</span>" : '';
			$Type = $this->XML_val('Type');
			return <<<HTML
<p id="$Name" class="field $Type">
	$Field
	<label class="right" for="{$this->id()}">$Title</label>
	$messageBlock
</p>
HTML;
			
		}
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:22,代码来源:CheckboxField.php

示例6: FieldHolder

    /**
     * Checkboxes use the RightLabelledFieldHolder template, to put the field on the left
     * and the label on the right.  See {@link FormField::FieldHolder} for more information about
     * how FieldHolder works. 
     */
    function FieldHolder()
    {
        if ($this->labelLeft) {
            return parent::FieldHolder();
        } else {
            extract($this->getXMLValues(array('Name', 'Field', 'Title', 'Message', 'MessageType')), EXTR_SKIP);
            $messageBlock = isset($Message) ? "<span class=\"message {$MessageType}\">{$Message}</span>" : '';
            $Type = $this->XML_val('Type');
            return <<<HTML
<p id="{$Name}" class="field {$Type}">
\t{$Field}
\t<label class="right" for="{$this->id()}">{$Title}</label>
\t{$messageBlock}
</p>
HTML;
        }
    }
开发者ID:Raiser,项目名称:Praktikum,代码行数:22,代码来源:CheckboxField.php

示例7: FieldHolder

 /**
  * Generates the normal field holder for the field
  * @param {array} $properties Properties to add to the field holder
  * @return {string}
  */
 public function FieldHolder($properties = null)
 {
     if (!empty($this->_link) && !empty($this->_label)) {
         return parent::FieldHolder($properties);
     }
 }
开发者ID:helpfulrobot,项目名称:webbuilders-group-silverstripe-kapost-bridge-logger,代码行数:11,代码来源:KapostLogLinkField.php

示例8: Field

 /**
  * @return string
  */
 public function Field($properties = array())
 {
     Requirements::javascript(project() . '/javascript/WTLinkField.js');
     return "<div class=\"fieldgroup\">" . "<div class=\"fieldgroupField\">" . $this->fieldType->FieldHolder() . "</div>" . "<div class=\"fieldgroupField\">" . $this->fieldLink->FieldHolder() . "</div>" . "</div>";
 }
开发者ID:jakedaleweb,项目名称:link-field,代码行数:8,代码来源:WTLinkField.php

示例9: FieldHolder

 function FieldHolder()
 {
     return FormField::FieldHolder();
 }
开发者ID:ramziammar,项目名称:websites,代码行数:4,代码来源:FieldGroup.php

示例10: FieldHolder

 function FieldHolder($properties = array())
 {
     return FormField::FieldHolder($properties);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-forum,代码行数:4,代码来源:CheckableOption.php

示例11: FieldHolder

 public function FieldHolder($properties = array())
 {
     Requirements::css(GSC_DIR . "/css/gridselectionfield.css");
     return parent::FieldHolder($properties);
 }
开发者ID:burnbright,项目名称:silverstripe-gridstructuredcontent,代码行数:5,代码来源:GridSelectionField.php

示例12: FieldHolder

 public function FieldHolder($attributes = array())
 {
     Requirements::javascript('themes/openstack/bower_assets/jquery-validate/dist/jquery.validate.min.js');
     Requirements::javascript("summit/javascript/forms/tagmanagerfield/tagmanagerfield.bundle.js");
     return parent::FieldHolder($attributes);
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:6,代码来源:TagManagerField.php

示例13: FieldHolder

 public function FieldHolder($properties = array())
 {
     $this->prepareForRender();
     $this->addExtraClass($this->Type() . '_holder');
     return parent::FieldHolder($properties);
 }
开发者ID:silbinarywolf,项目名称:multirecordfield,代码行数:6,代码来源:MultiRecordField.php


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