1.20.x 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', 'module', 'layout' or 'driver'.

string $name: The short name of the project.

Return value

TRUE if the project is enabled, FALSE otherwise.:

File

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;
    case 'driver':
      $drivers = silkscreen_driver_list();
      return in_array($name, array_keys($drivers));
      break;
  }
  return FALSE;
}