You are here

function _prod_check_devel in Production check & Production monitor 6

Same name and namespace in other branches
  1. 7 prod_check.module \_prod_check_devel()

File

./prod_check.module, line 1440

Code

function _prod_check_devel($caller = 'internal') {
  $checks = array();
  $modules = array(
    'DVL' => array(
      'name' => 'devel',
      'title' => 'Devel',
      'path' => 'admin/settings/devel',
    ),
    'DVG' => array(
      'name' => 'devel_generate',
      'title' => 'Devel generate',
      'path' => 'admin/generate',
    ),
    'DVN' => array(
      'name' => 'devel_node_access',
      'title' => 'Devel node access',
      'path' => 'admin/settings/devel',
    ),
    'DVT' => array(
      'name' => 'devel_themer',
      'title' => 'Theme developer',
      'path' => 'admin/settings/devel_themer',
    ),
  );
  foreach ($modules as $key => &$data) {
    $data['error'] = module_exists($data['name']) ? TRUE : FALSE;
    $title = $data['title'];
    $path = $data['path'];
    if ($caller != 'internal') {
      $path = PRODCHECK_BASEURL . $path;
    }
    $checks['prod_check_' . $data['name']] = array(
      '#title' => t($title),
      '#state' => !$data['error'],
      '#severity' => $caller == 'nagios' ? NAGIOS_STATUS_CRITICAL : PROD_CHECK_REQUIREMENT_ERROR,
      '#value_ok' => t('Disabled'),
      '#value_nok' => t('Enabled'),
      '#description_ok' => t('Your settings are OK for production use.'),
      '#description_nok' => t('You have enabled the !link module. This should not be running on a production environment!', prod_check_link_array($title, $path)),
      '#nagios_key' => $key,
      '#nagios_type' => 'state',
    );
  }
  return prod_check_execute_check($checks, $caller);
}