varbase_core.module in Varbase Core 8.5
Same filename and directory in other branches
Contains varbase_core.module.
File
varbase_core.moduleView source
<?php
/**
* @file
* Contains varbase_core.module.
*/
// To have all varbase core general and global tokens.
\Drupal::moduleHandler()
->loadInclude('varbase_core', 'inc', 'varbase_core.tokens');
/**
* Implements hook_FORM_ID_form_alter.
*/
function varbase_core_form_node_form_alter(&$form, $form_state) {
// Override node form sidebar order.
if (isset($form['author'])) {
$form['author']['#weight'] = -6;
}
if (isset($form['field_comments'])) {
$form['field_comments']['widget'][0]['#weight'] = -5;
}
if (isset($form['path_settings'])) {
$form['path_settings']['#weight'] = -4;
}
if (isset($form['field_meta_tags'])) {
$form['field_meta_tags']['widget'][0]['#weight'] = -3;
}
if (isset($form['simple_sitemap'])) {
$form['simple_sitemap']['#weight'] = -2;
}
if (isset($form['ds_switch_view_mode'])) {
$form['ds_switch_view_mode']['#weight'] = 101;
}
}
/**
* Implements hook_template_preprocess_default_variables_alter().
*/
function varbase_core_template_preprocess_default_variables_alter(&$variables) {
$user_settings_config = \Drupal::config('user.settings');
$variables['user_settings_register_admin_only'] = $user_settings_config
->get('register') == 'admin_only' ? 1 : 0;
}
Functions
Name | Description |
---|---|
varbase_core_form_node_form_alter | Implements hook_FORM_ID_form_alter. |
varbase_core_template_preprocess_default_variables_alter | Implements hook_template_preprocess_default_variables_alter(). |