- Patch #441962 by brianV: code style and documentation clean-up.
parent
f5d0e11f61
commit
2a7c00bc4a
|
@ -272,7 +272,7 @@ function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
|
||||||
|
|
||||||
function block_admin_configure_validate($form, &$form_state) {
|
function block_admin_configure_validate($form, &$form_state) {
|
||||||
if ($form_state['values']['module'] == 'block') {
|
if ($form_state['values']['module'] == 'block') {
|
||||||
if (empty($form_state['values']['info']) || db_result(db_query("SELECT COUNT(*) FROM {box} WHERE bid != %d AND info = '%s'", $form_state['values']['delta'], $form_state['values']['info']))) {
|
if (empty($form_state['values']['info']) || db_result(db_query("SELECT COUNT(*) FROM {box} WHERE bid <> %d AND info = '%s'", $form_state['values']['delta'], $form_state['values']['info']))) {
|
||||||
form_set_error('info', t('Please ensure that each block description is unique.'));
|
form_set_error('info', t('Please ensure that each block description is unique.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Install instructions for the block module
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_schema().
|
* Implementation of hook_schema().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -413,7 +413,7 @@ function block_box_save($edit, $delta) {
|
||||||
function block_user_form(&$edit, &$account, $category = NULL) {
|
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('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE);
|
||||||
while ($block = db_fetch_object($result)) {
|
while ($block = db_fetch_object($result)) {
|
||||||
$data = module_invoke($block->module, 'block_list');
|
$data = module_invoke($block->module, 'block_list');
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Tests for the block module
|
||||||
|
*/
|
||||||
|
|
||||||
class BlockTestCase extends DrupalWebTestCase {
|
class BlockTestCase extends DrupalWebTestCase {
|
||||||
protected $regions;
|
protected $regions;
|
||||||
|
|
||||||
|
@ -116,7 +121,7 @@ class BlockTestCase extends DrupalWebTestCase {
|
||||||
|
|
||||||
// Confirm that the regions xpath is not availble
|
// Confirm that the regions xpath is not availble
|
||||||
$xpath = '//div[@id="block-block-' . $bid . '"]/*';
|
$xpath = '//div[@id="block-block-' . $bid . '"]/*';
|
||||||
$this->assertNoFieldByXPath($xpath, FALSE, t('Box found in no regions. '));
|
$this->assertNoFieldByXPath($xpath, FALSE, t('Box found in no regions.'));
|
||||||
|
|
||||||
// For convenience of developers, put the navigation block back.
|
// For convenience of developers, put the navigation block back.
|
||||||
$edit = array();
|
$edit = array();
|
||||||
|
@ -140,7 +145,7 @@ class BlockTestCase extends DrupalWebTestCase {
|
||||||
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
|
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
|
||||||
|
|
||||||
// Confirm that the block was moved to the proper region.
|
// Confirm that the block was moved to the proper region.
|
||||||
$this->assertText(t('The block settings have been updated.'), t('Block successfully moved to %region_name region.', array( '%region_name'=> $region['name'])));
|
$this->assertText(t('The block settings have been updated.'), t('Block successfully moved to %region_name region.', array( '%region_name' => $region['name'])));
|
||||||
|
|
||||||
// Confirm that the block is being displayed.
|
// Confirm that the block is being displayed.
|
||||||
$this->assertText(t($block['title']), t('Block successfully being displayed on the page.'));
|
$this->assertText(t($block['title']), t('Block successfully being displayed on the page.'));
|
||||||
|
|
Loading…
Reference in New Issue