You are here

function drd_server_domain_switch_maintenance in Drupal Remote Dashboard Server 7.2

Same name and namespace in other branches
  1. 6.2 drd_server.domain.inc \drd_server_domain_switch_maintenance()
  2. 6 drd_server.domain.inc \drd_server_domain_switch_maintenance()
  3. 7 drd_server.domain.inc \drd_server_domain_switch_maintenance()

DRD Server Action to switch maintenance mode on/off on the current domain.

Parameters

boolean $flag: TRUE to turn maintenance mode on, FALSE otherwise.

Return value

string Returnable string to DRD.

1 string reference to 'drd_server_domain_switch_maintenance'
drd_server_drd_server_actions in ./drd_server.module
Implements hook_drd_server_actions().

File

./drd_server.domain.inc, line 214
Provides domain related functionality triggered by DRD.

Code

function drd_server_domain_switch_maintenance($flag) {
  variable_set('maintenance_mode', $flag);
  cache_clear_all('*', 'cache_page', TRUE);
  $text = $flag ? 'Turned maintenance mode on' : 'Turned maintenance mode off';
  drupal_set_message($text);
  return drd_server_result('switch.maintenance', '');
}