Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
a7e98179
Commit
a7e98179
authored
Jan 18, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1740470
follow-up by Wim Leers, larowlan, jibran: Clean-ups to phone field.
parent
1dab0e1c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
11 deletions
+10
-11
core/CHANGELOG.txt
core/CHANGELOG.txt
+1
-0
core/modules/telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php
...lephone/Plugin/field/formatter/TelephoneLinkFormatter.php
+6
-8
core/modules/telephone/lib/Drupal/telephone/Plugin/field/widget/TelephoneDefaultWidget.php
.../telephone/Plugin/field/widget/TelephoneDefaultWidget.php
+2
-2
core/modules/telephone/lib/Drupal/telephone/Tests/TelephoneFieldTest.php
...lephone/lib/Drupal/telephone/Tests/TelephoneFieldTest.php
+1
-1
core/modules/telephone/telephone.info
core/modules/telephone/telephone.info
+0
-0
core/modules/telephone/telephone.install
core/modules/telephone/telephone.install
+0
-0
core/modules/telephone/telephone.module
core/modules/telephone/telephone.module
+0
-0
No files found.
core/CHANGELOG.txt
View file @
a7e98179
...
...
@@ -97,6 +97,7 @@ Drupal 8.0, xxxx-xx-xx (development version)
* Added language select form element in the Form API.
- Added E-mail field type to core.
- Added Link field type to core.
- Added Phone number field type to core.
- Added local image input filter, to enable secure image posting.
- Added Views and Views UI module to core.
...
...
core/modules/
field/modules/
telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php
→
core/modules/telephone/lib/Drupal/telephone/Plugin/field/formatter/TelephoneLinkFormatter.php
View file @
a7e98179
...
...
@@ -2,7 +2,7 @@
/**
* @file
*
Definition of
Drupal\telephone\Plugin\field\formatter\TelephoneLinkFormatter.
*
Contains \
Drupal\telephone\Plugin\field\formatter\TelephoneLinkFormatter.
*/
namespace
Drupal\telephone\Plugin\field\formatter
;
...
...
@@ -30,7 +30,7 @@
class
TelephoneLinkFormatter
extends
FormatterBase
{
/**
* Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::settingsForm().
* Implements
\
Drupal\field\Plugin\Type\Formatter\FormatterInterface::settingsForm().
*/
public
function
settingsForm
(
array
$form
,
array
&
$form_state
)
{
$elements
[
'title'
]
=
array
(
...
...
@@ -43,7 +43,7 @@ public function settingsForm(array $form, array &$form_state) {
}
/**
* Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::settingsSummary().
* Implements
\
Drupal\field\Plugin\Type\Formatter\FormatterInterface::settingsSummary().
*/
public
function
settingsSummary
()
{
$settings
=
$this
->
getSettings
();
...
...
@@ -59,7 +59,7 @@ public function settingsSummary() {
}
/**
* Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::prepareView().
* Implements
\
Drupal\field\Plugin\Type\Formatter\FormatterInterface::prepareView().
*/
public
function
prepareView
(
array
$entities
,
$langcode
,
array
&
$items
)
{
$settings
=
$this
->
getSettings
();
...
...
@@ -74,19 +74,17 @@ public function prepareView(array $entities, $langcode, array &$items) {
else
{
$item
[
'title'
]
=
$item
[
'value'
];
}
}
}
}
/**
* Implements Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
* Implements
\
Drupal\field\Plugin\Type\Formatter\FormatterInterface::viewElements().
*/
public
function
viewElements
(
EntityInterface
$entity
,
$langcode
,
array
$items
)
{
$element
=
array
();
foreach
(
$items
as
$delta
=>
$item
)
{
// Prepend 'tel:' to the telephone number.
$href
=
'tel:'
.
rawurlencode
(
preg_replace
(
'/\s+/'
,
''
,
$item
[
'value'
]));
...
...
@@ -97,8 +95,8 @@ public function viewElements(EntityInterface $entity, $langcode, array $items) {
'#href'
=>
$href
,
'#options'
=>
array
(
'external'
=>
TRUE
),
);
}
return
$element
;
}
}
core/modules/
field/modules/
telephone/lib/Drupal/telephone/Plugin/field/widget/TelephoneDefaultWidget.php
→
core/modules/telephone/lib/Drupal/telephone/Plugin/field/widget/TelephoneDefaultWidget.php
View file @
a7e98179
...
...
@@ -2,7 +2,7 @@
/**
* @file
*
Definition of
Drupal\telephone\Plugin\field\widget\TelephoneDefaultWidget.
*
Contains \
Drupal\telephone\Plugin\field\widget\TelephoneDefaultWidget.
*/
namespace
Drupal\telephone\Plugin\field\widget
;
...
...
@@ -26,7 +26,7 @@
class
TelephoneDefaultWidget
extends
WidgetBase
{
/**
* Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::formElement().
* Implements
\
Drupal\field\Plugin\Type\Widget\WidgetInterface::formElement().
*/
public
function
formElement
(
array
$items
,
$delta
,
array
$element
,
$langcode
,
array
&
$form
,
array
&
$form_state
)
{
$element
[
'value'
]
=
$element
+
array
(
...
...
core/modules/
field/modules/
telephone/lib/Drupal/telephone/Tests/TelephoneFieldTest.php
→
core/modules/telephone/lib/Drupal/telephone/Tests/TelephoneFieldTest.php
View file @
a7e98179
...
...
@@ -2,7 +2,7 @@
/**
* @file
*
Definition of
Drupal\telephone\TelephoneFieldTest.
*
Contains \
Drupal\telephone\TelephoneFieldTest.
*/
namespace
Drupal\telephone\Tests
;
...
...
core/modules/
field/modules/
telephone/telephone.info
→
core/modules/telephone/telephone.info
View file @
a7e98179
File moved
core/modules/
field/modules/
telephone/telephone.install
→
core/modules/telephone/telephone.install
View file @
a7e98179
File moved
core/modules/
field/modules/
telephone/telephone.module
→
core/modules/telephone/telephone.module
View file @
a7e98179
File moved
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