本文整理汇总了PHP中FormField::Field方法的典型用法代码示例。如果您正苦于以下问题:PHP FormField::Field方法的具体用法?PHP FormField::Field怎么用?PHP FormField::Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormField
的用法示例。
在下文中一共展示了FormField::Field方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Field
/**
* (non-PHPdoc)
* @see sapphire/forms/FormField#Field()
*/
function Field()
{
if ($this->isReadonly()) {
$nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
} else {
$nullableCheckbox = new CheckboxField($this->getIsNullId());
}
$nullableCheckbox->setValue(is_null($this->dataValue()));
return $this->valueField->Field() . ' ' . $nullableCheckbox->Field() . ' <span>' . $this->getIsNullLabel() . '</span>';
}
示例2: Field
public function Field($properties = array())
{
$name = $this->getName();
if ($this->wrapFieldgroup) {
$field = "<div class=\"fieldgroup\">" . "<div class=\"fieldgroup-field\">" . $this->fieldLatitude->Field() . $this->fieldLongditude->Field() . "</div>" . "</div>";
} else {
$field = $this->fieldLatitude->Field() . $this->fieldLongditude->Field();
//SmallFieldHolder()
}
return $field;
}
示例3: Field
/**
* @return string
*/
function Field($properties = array())
{
if (GoogleMaps::getApiKey()) {
Requirements::javascript('//maps.googleapis.com/maps/api/js?js?v=3.exp&callback=initializeGoogleMaps&signed_in=true&sensor=false&libraries=places&language=' . i18n::get_tinymce_lang() . '&key=' . GoogleMaps::getApiKey());
} else {
Requirements::javascript('//maps.googleapis.com/maps/api/js?v=3.exp&callback=initializeGoogleMaps&signed_in=true&sensor=false&libraries=places&language=' . i18n::get_tinymce_lang());
}
Requirements::javascript('geoform/javascript/backendgeolocationfield.js');
Requirements::css('geoform/css/backendgeolocationfield.css');
return "<div class=\"fieldgroup\">" . "<div class=\"backend-geo-location-field\">" . $this->fieldLatitude->Field() . $this->fieldLongditude->Field() . "<div class=\"fieldgroupField\">" . $this->fieldAddress->Field() . "</div>" . "</div>" . "</div>";
}
示例4: Field
/**
* @return string
*/
function Field($properties = array())
{
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.min.js');
Requirements::javascript('geoform/javascript/jquery.geocomplete.js');
if (GoogleMaps::getApiKey()) {
Requirements::javascript('//maps.googleapis.com/maps/api/js?sensor=false&libraries=places&language=' . i18n::get_tinymce_lang() . '&key=' . GoogleMaps::getApiKey());
} else {
Requirements::javascript('//maps.googleapis.com/maps/api/js?sensor=false&libraries=places&language=' . i18n::get_tinymce_lang());
}
$name = $this->name;
$js = <<<JS
(function(\$){
\$(function(){
\t\t\$("#{$name}_Address").change(function(){
\t\t\t\$("#{$name}_Latitude").val('');
\$("#{$name}_Longditude").val('');
\t\t});
\$("#{$name}_Address").geocomplete().bind("geocode:result", function(event, result){
\$("#{$name}_Latitude").val(result.geometry.location.lat());
\$("#{$name}_Longditude").val(result.geometry.location.lng());
});
});
})(jQuery);
JS;
Requirements::customScript($js, 'GeoLocationField_Js_' . $this->ID());
$css = <<<CSS
/* make the location suggest dropdown appear above dialog */
.pac-container {
z-index: 2000 !important;
}
CSS;
Requirements::customCSS($css, 'GeoLocationField_Css_' . $this->ID());
return "<div class=\"fieldgroup\">" . $this->fieldLatitude->Field() . $this->fieldLongditude->Field() . "<div class=\"fieldgroupField\">" . $this->fieldAddress->Field() . "</div>" . "</div>";
}
示例5: Field
public function Field($properties = array())
{
$source = $this->getSource();
$options = array();
if ($source) {
// SQLMap needs this to add an empty value to the options
if (is_object($source) && $this->emptyString) {
$options[] = new ArrayData(array('Value' => '', 'Title' => $this->emptyString));
}
foreach ($source as $value => $params) {
$selected = false;
if ($value === '' && ($this->value === '' || $this->value === null)) {
$selected = true;
} else {
// check against value, fallback to a type check comparison when !value
if ($value) {
$selected = $value == $this->value;
} else {
$selected = $value === $this->value || (string) $value === (string) $this->value;
}
$this->isSelected = $selected;
}
$disabled = false;
if (in_array($value, $this->disabledItems) && $params['Title'] != $this->emptyString) {
$disabled = 'disabled';
}
$options[] = new ArrayData(array('Title' => $params['Title'], 'Value' => $value, 'Selected' => $selected, 'Disabled' => $disabled, 'Attributes' => $this->createOptionAttributes($params)));
}
}
$properties = array_merge($properties, array('Options' => new ArrayList($options)));
return FormField::Field($properties);
}
开发者ID:helpfulrobot,项目名称:dnadesign-silverstripe-advanceddropdowns,代码行数:32,代码来源:AdvancedDropdownField.php
示例6: Field
/**
* @param array $properties
* @return string
*/
public function Field($properties = array())
{
Requirements::css(CLOUDINARY_RELATIVE . "/css/CloudinaryColorSelectField.css");
Requirements::javascript(CLOUDINARY_RELATIVE . "/javascript/thirdparty/color-thief.js");
Requirements::javascript(CLOUDINARY_RELATIVE . "/javascript/CloudinaryColorSelectField.js");
return parent::Field($properties);
}
开发者ID:helpfulrobot,项目名称:mademedia-silverstripe-cloudinary,代码行数:11,代码来源:CloudinaryColorSelectField.php
示例7: Field
public function Field($properties = array())
{
// set the html js attributes
$this->setAttribute('data-map-options', $this->getMapOptionsJS());
$this->setAttribute('data-draw-options', $this->getDrawOptionsJS());
// set the dependencies
$this->requireDependencies();
return parent::Field($properties);
}
示例8: Field
/**
* @param array $properties
*
* @return string
*/
public function Field($properties = array())
{
if ($this->isReadonly()) {
$nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
} else {
$nullableCheckbox = new CheckboxField($this->getIsNullId());
}
$nullableCheckbox->setValue(is_null($this->dataValue()));
return sprintf('%s %s <span>%s</span>', $this->valueField->Field(), $nullableCheckbox->Field(), $this->getIsNullLabel());
}
示例9: Field
public function Field($properties = array())
{
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.js');
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
Requirements::javascript(SS_FOCUS_AREA_DIR . '/thirdparty/jcrop/js/jquery.Jcrop.js');
Requirements::css(SS_FOCUS_AREA_DIR . '/thirdparty/jcrop/css/jquery.Jcrop.min.css');
Requirements::javascript(SS_FOCUS_AREA_DIR . '/javascript/mwm.focus-area.js');
Requirements::css(SS_FOCUS_AREA_DIR . '/css/mwm.focus-area.css');
return parent::Field($properties);
}
示例10: Field
/**
* @param array $properties
* @return HTMLText
*/
public function Field($properties = array())
{
// Include a hidden field in the HTML
if ($this->includeHiddenField && $this->readonly) {
$hidden = clone $this;
$hidden->setReadonly(false);
return parent::Field($properties) . $hidden->Field($properties);
} else {
return parent::Field($properties);
}
}
示例11: Field
public function Field($properties = array())
{
$dir = basename(dirname(dirname(__DIR__)));
Requirements::javascript($dir . '/javascript/MapField.js');
Requirements::css($dir . '/css/MapField.css');
$url = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=mapFieldInit';
if (Config::inst()->get('GoogleMap', 'api_key')) {
$url .= '&key=' . Config::inst()->get('GoogleMap', 'api_key');
}
Requirements::javascript($url, 'GoogleMaps');
return parent::Field($properties);
}
示例12: Field
/**
* Adds in the requirements for the field
* @param {array} $properties Array of properties for the form element (not used)
* @return {string} Rendered field template
*/
public function Field($properties = array())
{
$siteKey = self::config()->site_key;
$secretKey = self::config()->secret_key;
if (empty($siteKey) || empty($secretKey)) {
user_error('You must configure Nocaptcha.site_key and Nocaptcha.secret_key, you can retrieve these at https://google.com/recaptcha', E_USER_ERROR);
}
Requirements::javascript(NOCAPTCHA_BASE . '/javascript/NocaptchaField.js');
Requirements::customScript("var _noCaptchaFields=_noCaptchaFields || [];_noCaptchaFields.push('" . $this->ID() . "');");
Requirements::customScript("(function() {\n" . " var gr = document.createElement('script'); gr.type = 'text/javascript'; gr.async = true;\n" . " gr.src = ('https:' == document.location.protocol ? 'https://www' : 'http://www') + " . "'.google.com/recaptcha/api.js?render=explicit&hl=" . i18n::get_lang_from_locale(i18n::get_locale()) . "&onload=noCaptchaFieldRender';\n" . " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gr, s);\n" . "})();\n", 'NocaptchaField-lib');
return parent::Field($properties);
}
示例13: Field
function Field($properties = array()) {
$properties = array_merge(
$properties,
array(
'Name' => $this->action,
'Title' => ($this->description && !$this->useButtonTag) ? $this->description : $this->Title(),
'UseButtonTag' => $this->useButtonTag
)
);
return parent::Field($properties);
}
示例14: Field
public function Field($properties = array())
{
$config = SiteConfig::current_site_config();
$this->setAttribute('data-cloudname', $config->CloudName);
$this->setAttribute('data-api', $config->APIKey);
$this->setAttribute('data-preset', $config->UploadPreset);
$this->setAttribute('data-url', $this->Link());
Requirements::javascript('cloudinary/javascript/thirdparty/jQuery-File-Upload-master/js/jquery.ui.widget.js');
Requirements::javascript('cloudinary/javascript/thirdparty/jQuery-File-Upload-master/js/jquery.iframe-transport.js');
Requirements::javascript('cloudinary/javascript/thirdparty/jQuery-File-Upload-master/js/jquery.fileupload.js');
Requirements::javascript('cloudinary/javascript/CloudinaryUpload.js');
Requirements::css('cloudinary/css/CloudinaryUpload.css');
return parent::Field($properties);
}
示例15: Field
public function Field($properties = array())
{
Requirements::javascript(FRAMEWORK_DIR . '/thirdparty/jquery/jquery.min.js');
$name = $this->getName();
// set caption if required
$js = <<<JS
!function(\$){
\$(function(){
// Try HTML5 geolocation
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position){
jQuery('#{$name}_Latitude').val(position.coords.latitude);
jQuery('#{$name}_Longditude').val(position.coords.longitude);
\t\t\t\t\tjQuery('#{$name}_PositionSet').val(1);
});
}
});
}(window.jQuery);
JS;
Requirements::customScript($js, 'HiddenLocationField_Js_' . $this->ID());
$field = $this->fieldLatitude->Field() . $this->fieldLongditude->Field() . $this->fieldPositionSet->Field();
//SmallFieldHolder()
return $field;
}