You are here

public function ThemeSwitcherRuleListBuilder::buildHeader in Theme Switcher Rules 8

Builds the header row for the entity listing.

Return value

array A render array structure of header strings.

Overrides DraggableListBuilder::buildHeader

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/Controller/ThemeSwitcherRuleListBuilder.php, line 98

Class

ThemeSwitcherRuleListBuilder
Provides a listing of theme_switcher_rule.

Namespace

Drupal\theme_switcher\Controller

Code

public function buildHeader() {
  $header['label'] = $this
    ->t('Name');
  $header['machine_name'] = $this
    ->t('Machine name');
  $header['theme'] = $this
    ->t('Theme');
  $header['admin_theme'] = $this
    ->t('Admin Theme');
  $header['status'] = $this
    ->t('Status');
  $header += parent::buildHeader();

  // Only super-admins may sort theme_switcher_rule.
  if (!$this->currentUser
    ->hasPermission('administer theme switcher rules')) {
    unset($header['weight']);
  }
  return $header;
}