summaryrefslogtreecommitdiff
path: root/modules/poll
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-10-31 07:34:47 +0000
committerDries Buytaert <dries@buytaert.net>2004-10-31 07:34:47 +0000
commitb3adcf05a31fef1d86b8ef87c73c9f3ade3585b2 (patch)
tree906ba3dd9ce31d3268812a8dc6dd190f2556d44f /modules/poll
parent8daed9cbf353de947bc3916f103206edd121de33 (diff)
downloadbrdo-b3adcf05a31fef1d86b8ef87c73c9f3ade3585b2.tar.gz
brdo-b3adcf05a31fef1d86b8ef87c73c9f3ade3585b2.tar.bz2
- Patch #11875 by Neil Drumm: block module configuration improvements.
The primary goal of this patch is to take the 'custom' and 'path' columns of the block overview page and make them into something understandable. As of Drupal 4.5 'custom' lacked an explanation which wasn't buried in help text and path required dealing with regular expressions. Every block now has a configuration page to control these options. This gives more space to make form controls which do not require a lengthy explanation. This page also gives modules a chance to put their block configuration options in a place that makes sense using new operations in the block hook. The only required changes to modules implementing hook_block() is to be careful about what is returned. Do not return anything if $op is not 'list' or 'view'. Once this change is made, modules will still be compatible with Drupal 4.5. Required changes to core modules are included in this path. An additional optional change to modules is to implement the additional $op options added. 'configure' should return a string containing the configuration form for the block with the appropriate $delta. 'configure save' will come with an additional $edit argument, which will contain the submitted form data for saving. These changes to core modules are also included in this patch.
Diffstat (limited to 'modules/poll')
-rw-r--r--modules/poll/poll.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index eaef156eb..2c078f629 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -49,7 +49,7 @@ function poll_block($op = 'list', $delta = 0) {
$blocks[0]['info'] = t('Most recent poll');
return $blocks;
}
- else {
+ else if ($op == 'view') {
// Retrieve the latest poll.
$timestamp = db_result(db_query('SELECT MAX(n.created) FROM {node} n '. node_access_join_sql() ." WHERE n.type = 'poll' AND n.status = 1 AND ". node_access_where_sql() .' AND n.moderate = 0'));
if ($timestamp) {