From df39b3cc0aa39db56d93ff736bc70132f3f1a0f7 Mon Sep 17 00:00:00 2001 From: Chaitanya Anil Kulkarni Date: Aug 19, 2016 5:42:03 PM replaced deprecated methods diff --git a/ds.api.php b/ds.api.php index d24d57b..d9de96e 100644 --- a/ds.api.php +++ b/ds.api.php @@ -153,7 +153,7 @@ */ function hook_ds_views_row_render_entity(\Drupal\Core\Entity\EntityInterface $entity, $view_mode) { $entity = Drupal\ds\Plugin\DsField\Node::load(1); - return \Drupal::entityManager()->getViewBuilder('node')->view($entity, $view_mode); + return \Drupal::entityTypeManager()->getViewBuilder('node')->view($entity, $view_mode); } /** diff --git a/includes/field_ui.inc b/includes/field_ui.inc index f4b86a1..0234c27 100644 --- a/includes/field_ui.inc +++ b/includes/field_ui.inc @@ -18,6 +18,7 @@ use Drupal\field\FieldConfigInterface; use Drupal\field_ui\FieldUI; use Drupal\layout_plugin\Layout; +use Drupal\Core\Link; /** * Adds the Display Suite fields and layouts to the form. @@ -106,7 +107,7 @@ $form['modes']['#weight'] = -10; if ($view_mode_admin_access) { $url = Url::fromRoute('field_ui.display_mode'); - $form['modes']['view_modes_custom']['#description'] = \Drupal::l(t('Manage display modes'), $url); + $form['modes']['view_modes_custom']['#description'] = Link::fromTextAndUrl(t('Manage display modes'), $url)->toString(); } } } diff --git a/modules/ds_extras/src/Plugin/DsField/SwitchField.php b/modules/ds_extras/src/Plugin/DsField/SwitchField.php index ec427c4..335b681 100644 --- a/modules/ds_extras/src/Plugin/DsField/SwitchField.php +++ b/modules/ds_extras/src/Plugin/DsField/SwitchField.php @@ -8,6 +8,7 @@ use Drupal\Core\Url; use Drupal\ds\Plugin\DsField\DsFieldBase; use Symfony\Component\DependencyInjection\ContainerInterface; +use Drupal\Core\Link; /** * Plugin that generates a link to switch view mode with via ajax. @@ -82,7 +83,7 @@ // If the label is empty, do not create a link. if (!empty($value)) { $route_parameters['viewMode'] = $key == 'default' ? 'full' : $key; - $items[] = \Drupal::l($value, Url::fromRoute('ds_extras.switch_view_mode', $route_parameters, $route_options)); + $items[] = Link::fromTextAndUrl($value, Url::fromRoute('ds_extras.switch_view_mode', $route_parameters, $route_options))->toString(); } } } diff --git a/src/Plugin/DsField/Field.php b/src/Plugin/DsField/Field.php index ddfa08a..67b8e11 100644 --- a/src/Plugin/DsField/Field.php +++ b/src/Plugin/DsField/Field.php @@ -3,6 +3,7 @@ namespace Drupal\ds\Plugin\DsField; use Drupal\Component\Utility\Html; +use Drupal\Core\Link; /** * The base plugin to create DS fields. @@ -45,7 +46,7 @@ if (!empty($config['link class'])) { $url_info->setOption('attributes', array('class' => explode(' ', $config['link class']))); } - $output = \Drupal::l($output, $url_info); + $output = Link::fromTextAndUrl($output, $url_info)->toString(); } else { $output = Html::escape($output); diff --git a/src/Plugin/DsLayout.php b/src/Plugin/DsLayout.php index 7b56eb0..bc68414 100644 --- a/src/Plugin/DsLayout.php +++ b/src/Plugin/DsLayout.php @@ -7,6 +7,7 @@ use Drupal\Core\Url; use Drupal\ds\Ds; use Drupal\layout_plugin\Plugin\Layout\LayoutBase; +use Drupal\Core\Link; /** * Layout class for all Display Suite layouts. @@ -164,7 +165,7 @@ $url = Url::fromRoute('ds.classes'); $destination = \Drupal::destination()->getAsArray(); $url->setOption('query', $destination); - $form['ds_classes']['info'] = array('#markup' => \Drupal::l(t('Manage region and field CSS classes'), $url)); + $form['ds_classes']['info'] = array('#markup' => Link::fromTextAndUrl(t('Manage region and field CSS classes'), $url)->toString()); } } else { @@ -172,7 +173,7 @@ $url = Url::fromRoute('ds.classes'); $destination = \Drupal::destination()->getAsArray(); $url->setOption('query', $destination); - $form['ds_classes']['info'] = array('#markup' => '

' . $this->t('You have not defined any CSS classes which can be used on regions.') . '

' . \Drupal::l(t('Manage region and field CSS classes'), $url) . '

'); + $form['ds_classes']['info'] = array('#markup' => '

' . $this->t('You have not defined any CSS classes which can be used on regions.') . '

' . Link::fromTextAndUrl(t('Manage region and field CSS classes'), $url)->toString() . '

'); } else { $form['ds_classes']['#access'] = FALSE;