72 lines
2.0 KiB
Plaintext
72 lines
2.0 KiB
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Allows site administrators to modify configuration.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_help().
|
|
*/
|
|
function config_help($path, $arg) {
|
|
switch ($path) {
|
|
case 'admin/help#config':
|
|
$output = '';
|
|
$output .= '<h3>' . t('About') . '</h3>';
|
|
$output .= '<p>' . t('The Configuration manager module provides a user interface for importing and exporting configuration changes; i.e., for staging configuration data between multiple instances of this web site. For more information, see the online handbook entry for <a href="!url">Configuration manager module</a>', array(
|
|
'!url' => 'http://drupal.org/documentation/administer/config',
|
|
)) . '</p>';
|
|
return $output;
|
|
|
|
case 'admin/config/development/configuration/sync':
|
|
$output = '';
|
|
$output .= '<p>' . t('Import configuration that is placed in your staging directory. All changes, deletions, renames, and additions are listed below.') . '</p>';
|
|
return $output;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements hook_permission().
|
|
*/
|
|
function config_permission() {
|
|
$permissions['synchronize configuration'] = array(
|
|
'title' => t('Synchronize configuration'),
|
|
'restrict access' => TRUE,
|
|
);
|
|
$permissions['export configuration'] = array(
|
|
'title' => t('Export configuration'),
|
|
'restrict access' => TRUE,
|
|
);
|
|
$permissions['import configuration'] = array(
|
|
'title' => t('Import configuration'),
|
|
'restrict access' => TRUE,
|
|
);
|
|
return $permissions;
|
|
}
|
|
|
|
/**
|
|
* Implements hook_file_download().
|
|
*/
|
|
function config_file_download($uri) {
|
|
$scheme = file_uri_scheme($uri);
|
|
$target = file_uri_target($uri);
|
|
if ($scheme == 'temporary' && $target == 'config.tar.gz') {
|
|
return array(
|
|
'Content-disposition' => 'attachment; filename="config.tar.gz"',
|
|
);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implements hook_menu().
|
|
*/
|
|
function config_menu() {
|
|
$items['admin/config/development/configuration'] = array(
|
|
'title' => 'Configuration management',
|
|
'description' => 'Import, export, or synchronize your site configuration.',
|
|
'route_name' => 'config.sync',
|
|
);
|
|
|
|
return $items;
|
|
}
|