1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-23 05:16:03 +02:00

feat(core): add tags and date fields #186

This commit is contained in:
Awilum
2019-09-01 16:43:13 +03:00
parent c85f668879
commit 3e9679a57a
3 changed files with 47 additions and 0 deletions

View File

@@ -155,6 +155,12 @@ class Forms
case 'visibility_select':
$form_element = $this->visibilitySelectField($element_name, ['draft' => __('admin_entries_draft'), 'visible' => __('admin_entries_visible'), 'hidden' => __('admin_entries_hidden')], (! empty($form_value) ? $form_value : 'visible'), $property);
break;
case 'tags':
$form_element = $this->tagsField($element_name, $form_value, $property);
break;
case 'date':
$form_element = $this->dateField($element_name, $form_value, $property);
break;
// Simple text-input, for single-line fields.
default:
$form_element = $this->textField($element_name, $form_value, $property);
@@ -342,6 +348,38 @@ class Forms
return Form::input($name, $value, $property['attributes']);
}
/**
* Tags field
*
* @param string $name Field name
* @param string $value Field value
* @param array $property Field property
*
* @return string Returns field
*
* @access protected
*/
protected function tagsField($name, $value, $property)
{
return Form::input($name, $value, $property['attributes']);
}
/**
* Date field
*
* @param string $name Field name
* @param string $value Field value
* @param array $property Field property
*
* @return string Returns field
*
* @access protected
*/
protected function dateField($name, $value, $property)
{
return Form::input($name, $value, $property['attributes']);
}
/**
* _csrfHiddenField
*

View File

@@ -16,6 +16,14 @@ sections:
title: admin_content
type: html
size: 12
tag:
title: admin_tags
type: tags
size: 8/12
date:
title: admin_date
type: date
size: 4/12
seo:
title: Seo
fields:

View File

@@ -244,3 +244,4 @@ admin_slugify_strip_tags: "Strip tags"
admin_slugify_lowercase_after_regexp: "Lowercase after regexp"
admin_slugify_regexp: "Regexp"
admin_gallery_img: "Gallery Image"
admin_tags: "Tags"