1 block.overview_content.inc DashboardOverviewContentBlock::__construct($plugin_name, array $data)

Create a new Block object.

Parameters

string $plugin_name: The Layout plugin name. In the case of a block, this is a key identifying the block module, delta, and (if applicable) child delta, separated by colons.

array $data: Settings that provide current configuration of the block, such as access rules, style settings, block settings, etc.

Overrides Block::__construct

File

core/modules/dashboard/includes/block.overview_content.inc, line 14
Dashboard block displaying information about content, including:

Class

DashboardOverviewContentBlock
@file Dashboard block displaying information about content, including:

Code

function __construct($plugin_name, array $data) {
  parent::__construct($plugin_name, $data);

  // Set defaults.
  $all_types = array_keys(node_type_get_names());

  // Default status for comment types.
  $enabled_comment_types = array('post', 'article', 'blog');
  $enabled_comment_types = array_intersect_key($enabled_comment_types, $all_types);

  $this->settings += array(
    'types' => array(),
    'comment_enabled' => TRUE,
    'comment_include_unapproved' => TRUE,
    'comment_types' => $enabled_comment_types,
  );
}