Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
color_field
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
color_field
Commits
9a2b78b1
Commit
9a2b78b1
authored
Nov 07, 2013
by
targoo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a number of issue with annotation
parent
21ba2a4b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
17 deletions
+5
-17
color_field.module
color_field.module
+0
-3
lib/Drupal/color_field/Plugin/Field/FieldType/ColorFieldItem.php
...pal/color_field/Plugin/Field/FieldType/ColorFieldItem.php
+1
-1
lib/Drupal/color_field/Plugin/Field/FieldWidget/ColorFieldDefaultWidget.php
...ield/Plugin/Field/FieldWidget/ColorFieldDefaultWidget.php
+4
-13
No files found.
color_field.module
View file @
9a2b78b1
...
...
@@ -4,8 +4,6 @@
* An color field with a custom color picker using the Field Types API.
*/
use
Drupal\Core\Entity\EntityInterface
;
/**
* Implements hook_help().
*/
...
...
@@ -24,7 +22,6 @@ function color_field_help($path, $arg) {
*/
function
color_field_field_instance_settings_form
(
$field
,
$instance
)
{
$settings
=
$instance
[
'settings'
];
$form
[
'alfa'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Alfa'
),
...
...
lib/Drupal/color_field/Plugin/Field/FieldType/ColorField
Type
.php
→
lib/Drupal/color_field/Plugin/Field/FieldType/ColorField
Item
.php
View file @
9a2b78b1
...
...
@@ -2,7 +2,7 @@
/**
* @file
* Contains \Drupal\color_field\Plugin\Field\FieldType\ColorField
Type
.
* Contains \Drupal\color_field\Plugin\Field\FieldType\ColorField
Item
.
*/
namespace
Drupal\color_field\Plugin\Field\FieldType
;
...
...
lib/Drupal/color_field/Plugin/Field/FieldWidget/ColorFieldDefaultWidget.php
View file @
9a2b78b1
...
...
@@ -13,7 +13,7 @@ use Drupal\Core\Field\WidgetBase;
/**
* Plugin implementation of the 'color_field_default' widget.
*
* @
Plugin
(
* @
FieldWidget
(
* id = "color_field_default",
* module = "color_field",
* label = @Translation("Color field default"),
...
...
@@ -31,22 +31,13 @@ class ColorFieldDefaultWidget extends WidgetBase {
* Implements \Drupal\field\Plugin\Type\Widget\WidgetInterface::formElement().
*/
public
function
formElement
(
FieldItemListInterface
$items
,
$delta
,
array
$element
,
array
&
$form
,
array
&
$form_state
)
{
$element
[
'rgb'
]
=
$element
+
array
(
'#type'
=>
'textfield'
,
'#maxlength'
=>
7
,
$element
[
'rgb'
]
=
array
(
'#title'
=>
t
(
'Color Field'
),
'#default_value'
=>
isset
(
$items
[
$delta
][
'rgb'
])
?
$items
[
$delta
][
'rgb'
]
:
NULL
,
//'#placeholder' => $this->getSetting('placeholder'),
'#required'
=>
$element
[
'#required'
],
);
/*$element['alfa'] = $element + array(
'#type'
=>
'textfield'
,
'#maxlength'
=>
7
,
'#title' => t('Color Field'),
'#default_value' => isset($items[$delta]['alfa']) ? $items[$delta]['alfa'] : NULL,
//'#placeholder' => $this->getSetting('placeholder'),
'#required'
=>
$element
[
'#required'
],
);*/
'#default_value'
=>
isset
(
$items
[
$delta
]
->
rgb
)
?
$items
[
$delta
]
->
rgb
:
NULL
,
);
return
$element
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment