Commit de096973 authored by pifagor's avatar pifagor
Browse files

Issue #2945131: Fix coding standards module.

parent eed0cf14
.link-field-column {
float: right;
}
.link-field-column.link-field-url .form-text {
direction: ltr;
text-align: left;
......
......@@ -2,7 +2,6 @@
float: left;
width: 48%;
}
.link-field-column .form-text {
width: 95%;
}
......@@ -269,7 +269,7 @@ function link_field_settings_form_validate($element, &$form_state, $complete_for
form_set_error('instance][settings][title_value', t('A default title must be provided if the title is a static value.'));
}
if ($form_state['values']['instance']['settings']['title'] === 'select'
&& empty($form_state['values']['instance']['settings']['title_allowed_values'])) {
&& empty($form_state['values']['instance']['settings']['title_allowed_values'])) {
form_set_error('instance][settings][title_allowed_values', t('You must enter one or more allowed values for link Title, the title is a selected value.'));
}
if (!empty($form_state['values']['instance']['settings']['display']['url_cutoff']) && !is_numeric($form_state['values']['instance']['settings']['display']['url_cutoff'])) {
......@@ -497,7 +497,7 @@ function _link_validate(&$item, $delta, $field, $entity, $instance, $langcode, &
// In a totally bizzaro case, where URLs and titles are optional but the field
// is required, ensure there is at least one link.
if ($instance['settings']['url'] === 'optional' && $instance['settings']['title'] === 'optional'
&& (strlen(trim($item['url'])) !== 0 || strlen(trim($item['title'])) !== 0)) {
&& (strlen(trim($item['url'])) !== 0 || strlen(trim($item['title'])) !== 0)) {
$optional_field_found = TRUE;
}
// Require entire field.
......@@ -539,7 +539,7 @@ function _link_sanitize(&$item, $delta, &$field, $instance, &$entity) {
$entity_info = entity_get_info($entity_type);
$property_id = $entity_info['entity keys']['id'];
$entity_token_type = isset($entity_info['token type']) ? $entity_info['token type'] : (
$entity_type == 'taxonomy_term' || $entity_type == 'taxonomy_vocabulary' ? str_replace('taxonomy_', '', $entity_type) : $entity_type
$entity_type == 'taxonomy_term' || $entity_type == 'taxonomy_vocabulary' ? str_replace('taxonomy_', '', $entity_type) : $entity_type
);
if (isset($instance['settings']['enable_tokens']) && $instance['settings']['enable_tokens']) {
$text_tokens = token_scan($item['url']);
......@@ -1276,7 +1276,8 @@ function theme_link_formatter_link_separate($vars) {
/**
* Implements hook_token_list().
*
* @TODO: hook_token_list no longer exists - this should change to hook_token_info().
* @TODO: hook_token_list no longer exists - this should change to
* hook_token_info().
*/
function link_token_list($type = 'all') {
if ($type === 'field' || $type === 'all') {
......@@ -1291,7 +1292,8 @@ function link_token_list($type = 'all') {
/**
* Implements hook_token_values().
*
* @TODO: hook_token_values no longer exists - this should change to hook_tokens().
* @TODO: hook_token_values no longer exists - this should change to
* hook_tokens().
*/
function link_token_values($type, $object = NULL) {
if ($type === 'field') {
......@@ -1507,9 +1509,9 @@ function link_url_type($text) {
// @codingStandardsIgnoreEnd
$link_ichars = $link_ichars_domain . (string) html_entity_decode(implode("", array(
// ß.
"ß",
)), ENT_QUOTES, 'UTF-8');
// ß.
"ß",
)), ENT_QUOTES, 'UTF-8');
$allowed_protocols = variable_get('filter_allowed_protocols', array(
'http',
'https',
......@@ -1603,14 +1605,14 @@ function link_content_migrate_field_alter(&$field_value, $instance_value) {
$field_value['type'] = 'link_field';
// Remove settings that are now on the instance.
foreach (array(
'attributes',
'display',
'url',
'title',
'title_value',
'enable_tokens',
'validate_url',
) as $setting) {
'attributes',
'display',
'url',
'title',
'title_value',
'enable_tokens',
'validate_url',
) as $setting) {
unset($field_value['settings'][$setting]);
}
}
......@@ -1625,14 +1627,14 @@ function link_content_migrate_instance_alter(&$instance_value, $field_value) {
if ($field_value['type'] == 'link') {
// Grab settings that were previously on the field.
foreach (array(
'attributes',
'display',
'url',
'title',
'title_value',
'enable_tokens',
'validate_url',
) as $setting) {
'attributes',
'display',
'url',
'title',
'title_value',
'enable_tokens',
'validate_url',
) as $setting) {
if (isset($field_value['settings'][$setting])) {
$instance_value['settings'][$setting] = $field_value['settings'][$setting];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment