system_status.module in System Status 8.2
Same filename and directory in other branches
Drupal system status.
File
system_status.moduleView source
<?php
/**
* @file
* Drupal system status.
*/
/**
* Implements hook_help().
*
* Displays help and module information.
*/
function system_status_help($path, $arg) {
switch ($path) {
case 'admin/help#system_status':
$output = '<h2>' . $this
->t('System Status module information') . '</h2>';
$output .= '<p>' . $this
->t('System Status provides an easy way to get an overview of all the available updates for your Drupal websites.') . '<br/>';
$output .= $this
->t('Enable the System Status module on all your Drupal websites and allow reporting to DrupalStatus.org for a centralized overview and email summaries of available updates and installed versions.') . '</p>';
$output .= '<p>' . $this
->t('The accompanying service offered by DrupalStatus.org is free but if you do not want to use this service this lightweight module allows you to built your own overviews and dashboard.') . '</p>';
$output .= '<p>' . $this
->t('How does it work?') . '</p>';
$output .= '<ul>';
$output .= '<li>' . $this
->t('Enable the System Status module on your Drupal website') . '</li>';
$output .= '<li>' . $this
->t('Click the "Add this site to your DrupalStatus.org overview" button to be redirected to the DrupalStatus website with the necessary credentials.') . '</li>';
$output .= '</ul>';
return $output;
break;
}
}
/**
* Implements hook_menu().
*/
function system_status_menu() {
$items = [];
$items['admin/config/system/system_status'] = [
'title' => 'System Status',
'description' => 'Configuration for System status module',
'route_name' => 'system_status.admin_settings',
'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
];
return $items;
}
/**
* Access callback: Check authorized IP.
*
* @see system_status_menu()
*
* TODO $request->attributes->get('_raw_variables')->get('system_status_token')
*/
function system_status_access_callback($token = FALSE) {
$config = \Drupal::config('system_status.settings');
if ($config
->get('system_status_service_allow_external') == 0 || $token !== $config
->get('system_status_token')) {
return FALSE;
}
return TRUE;
}
Functions
Name | Description |
---|---|
system_status_access_callback | Access callback: Check authorized IP. |
system_status_help | Implements hook_help(). |
system_status_menu | Implements hook_menu(). |