You are here

public function TotalControlMenuLink::getDerivativeDefinitions in Total Control Admin Dashboard 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Derivative/TotalControlMenuLink.php \Drupal\total_control\Plugin\Derivative\TotalControlMenuLink::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/Derivative/TotalControlMenuLink.php, line 55

Class

TotalControlMenuLink
Represents a menu link for a Total Control Menu Link.

Namespace

Drupal\total_control\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $router = \Drupal::service('router.route_provider');
  if (!empty($router
    ->getRoutesByNames([
    'page_manager.page_view_total_control_dashboard_total_control_dashboard-http_status_code-0',
  ]))) {
    $links['system.total_control_dashboard'] = [
      'title' => $this
        ->t('Dashboard'),
      'route_name' => 'page_manager.page_view_total_control_dashboard_total_control_dashboard-http_status_code-0',
      'parent' => 'system.admin',
      'weight' => '-20',
    ] + $base_plugin_definition;
    return $links;
  }
  return [];
}