|
Server IP : 10.2.73.233 / Your IP : 216.73.216.223 Web Server : Apache/2.4.59 (Debian) System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : www-data ( 33) PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/ilpnowa/../baltic/web/modules/php/../dashboard/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* @file
* Install, update and uninstall functions for the dashboard module.
*/
/**
* Implements hook_disable().
*
* Stash a list of blocks enabled on the dashboard, so they can be re-enabled
* if the dashboard is re-enabled. Then disable those blocks, since the
* dashboard regions will no longer be defined.
*/
function dashboard_disable() {
// Stash a list of currently enabled blocks.
$stashed_blocks = array();
$result = db_select('block', 'b')
->fields('b', array('module', 'delta', 'region'))
->condition('b.region', dashboard_regions(), 'IN')
->execute();
foreach ($result as $block) {
$stashed_blocks[] = array(
'module' => $block->module,
'delta' => $block->delta,
'region' => $block->region,
);
}
variable_set('dashboard_stashed_blocks', $stashed_blocks);
// Disable the dashboard blocks.
db_update('block')
->fields(array(
'status' => 0,
'region' => BLOCK_REGION_NONE,
))
->condition('region', dashboard_regions(), 'IN')
->execute();
}
/**
* Implements hook_enable().
*
* Restores blocks to the dashboard that were there when the dashboard module
* was disabled.
*/
function dashboard_enable() {
global $theme_key;
if (!$stashed_blocks = variable_get('dashboard_stashed_blocks')) {
return;
}
if (!$admin_theme = variable_get('admin_theme')) {
drupal_theme_initialize();
$admin_theme = $theme_key;
}
foreach ($stashed_blocks as $block) {
db_update('block')
->fields(array(
'status' => 1,
'region' => $block['region']
))
->condition('module', $block['module'])
->condition('delta', $block['delta'])
->condition('theme', $admin_theme)
->condition('status', 0)
->execute();
}
variable_del('dashboard_stashed_blocks');
}
/**
* Implements hook_uninstall().
*/
function dashboard_uninstall() {
variable_del('dashboard_stashed_blocks');
}