Skip to content
Snippets Groups Projects
Commit 652e4a81 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-272] Merging test into staging -c1325

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1348 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 65bf49a4
No related branches found
No related tags found
No related merge requests found
......@@ -267,6 +267,19 @@ function unl_permission() {
);
}
/**
* Implements hook_preprocess_page().
*/
function unl_preprocess_page(&$vars) {
switch (current_path()) {
case 'admin/modules':
if (!unl_user_is_administrator()) {
// Changed here rather than using hook_help because the later merely appends to the existing text.
$vars['page']['help']['system_help']['#markup'] = '<p>Not all modules can be turned on/off. If you have questions about modules on this page or modules not yet part of the UNL project contact an administrator.</p>';
}
}
}
/**
* Implementation of hook_menu().
*/
......@@ -473,6 +486,29 @@ function unl_form_field_ui_display_overview_form_alter(&$form, &$form_state, $fo
}
}
/**
* Implementation of hook_form_FORM_ID_alter() for system_modules.
*/
function unl_form_system_modules_alter(&$form, &$form_state, $form_id) {
// Whitelist of modules that Site Admin are allowed to turn on and off on admin/modules
$modules = array('aggregator', 'blog', 'book', 'comment', 'translation', 'dashboard', 'forum', 'help', 'list', 'locale', 'number', 'taxonomy', 'trigger', // Core on this line, Contrib below
'action_email_role', 'context', 'context_layouts', 'context_ui', 'features', 'unl_news', 'imce', 'imce_mkdir', 'imce_rename', 'menu_block', 'menu_block_export',
'form_builder', 'form_builder_webform_ui', 'webform', 'webform_alt_ui',
'workbench', 'workbench_access', 'workbench_files', 'workbench_media', 'workbench_moderation');
if (!unl_user_is_administrator() && isset($form['modules'])) {
foreach ($form['modules'] as $category_name => $category) {
if (is_array($category)) {
foreach ($category as $module_name => $module) {
if (!in_array($module_name, $modules) && substr($module_name,0,1) !== '#') {
$form['modules'][$category_name][$module_name]['#disabled'] = true;
}
}
}
}
}
}
/**
* Implementation of hook_form_alter().
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment