1 installer.browser.inc _installer_browser_is_project_enabled($type, $name)

Checks if a project is enabled.

Parameters

string $type: The type of project. Could be 'theme' or 'module' or 'layout'.

string $name: The short name of the project.

Return value

TRUE if the project is enabled, FALSE otherwise.:

File

core/modules/installer/installer.browser.inc, line 18
Various functions that are required by the Installer browse pages.

Code

function _installer_browser_is_project_enabled($type, $name) {
  switch ($type) {
    case 'module':
      return module_exists($name);
      break;
    case 'theme':
      $themes = list_themes();
      return isset($themes[$name]) && $themes[$name]->status;
      break;
    case 'layout':
      $excluded_templates = config_get('layout.settings', 'excluded_templates');
      return layout_get_layout_template_info($name) && !in_array($name, $excluded_templates);
      break;
  }
  return FALSE;
}