Skip to content
Snippets Groups Projects
Commit ece9032a authored by Angie Byron's avatar Angie Byron
Browse files

#266153 by JamesAn: Add a description for user-personalizable blocks.

parent 765f6905
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -417,7 +417,14 @@ function block_user_form(&$edit, &$account, $category = NULL) { ...@@ -417,7 +417,14 @@ function block_user_form(&$edit, &$account, $category = NULL) {
if ($category == 'account') { if ($category == 'account') {
$rids = array_keys($account->roles); $rids = array_keys($account->roles);
$result = db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom <> 0 AND (r.rid IN (:rids) OR r.rid IS NULL) ORDER BY b.weight, b.module", array(':rids' => $rids)); $result = db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom <> 0 AND (r.rid IN (:rids) OR r.rid IS NULL) ORDER BY b.weight, b.module", array(':rids' => $rids));
$form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE); $form['block'] = array(
'#type' => 'fieldset',
'#title' => t('Personalize blocks'),
'#description' => t('Blocks consist of content or information that complements the main content of the page. Enable or disable optional blocks using the checkboxes below.'),
'#weight' => 3,
'#collapsible' => TRUE,
'#tree' => TRUE
);
foreach ($result as $block) { foreach ($result as $block) {
$data = module_invoke($block->module, 'block_list'); $data = module_invoke($block->module, 'block_list');
if ($data[$block->delta]['info']) { if ($data[$block->delta]['info']) {
......
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