本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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>";
}
示例9: FieldHolder
function FieldHolder()
{
return FormField::FieldHolder();
}
示例10: FieldHolder
function FieldHolder($properties = array())
{
return FormField::FieldHolder($properties);
}
示例11: FieldHolder
public function FieldHolder($properties = array())
{
Requirements::css(GSC_DIR . "/css/gridselectionfield.css");
return parent::FieldHolder($properties);
}
示例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);
}
示例13: FieldHolder
public function FieldHolder($properties = array())
{
$this->prepareForRender();
$this->addExtraClass($this->Type() . '_holder');
return parent::FieldHolder($properties);
}