summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-16 23:57:33 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-16 23:57:33 +0000
commit574a2e47eea1bc8e2ea13240e407a32e4b728560 (patch)
tree7c124110e7e71df958fff50b2fb8e0832dd18204 /modules/comment/comment.module
parent18d22419f3da39ca4bf92f46d605a25957f311be (diff)
downloadbrdo-574a2e47eea1bc8e2ea13240e407a32e4b728560.tar.gz
brdo-574a2e47eea1bc8e2ea13240e407a32e4b728560.tar.bz2
- Patch #345866 by alexanderpas, justinrandell, Dave Reid: remove from hook_block().
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module64
1 files changed, 36 insertions, 28 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index eb088a95e..e3e4d5243 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -261,39 +261,47 @@ function comment_perm() {
}
/**
- * Implementation of hook_block().
- *
- * Generates a block with the most recent comments.
+ * Implementation of hook_block_list().
*/
-function comment_block($op = 'list', $delta = '', $edit = array()) {
- switch ($op) {
- case 'list':
- $blocks['recent']['info'] = t('Recent comments');
-
- return $blocks;
-
- case 'configure':
- $form['comment_block_count'] = array(
- '#type' => 'select',
- '#title' => t('Number of recent comments'),
- '#default_value' => variable_get('comment_block_count', 10),
- '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)),
- '#description' => t('Number of comments displayed in the <em>Recent comments</em> block.'),
- );
+function comment_block_list() {
+ $blocks['recent']['info'] = t('Recent comments');
- return $form;
+ return $blocks;
+}
- case 'save':
- variable_set('comment_block_count', (int)$edit['comment_block_count']);
- break;
+/**
+ * Implementation of hook_block_configure().
+ */
+function comment_block_configure($delta = '') {
+ $form['comment_block_count'] = array(
+ '#type' => 'select',
+ '#title' => t('Number of recent comments'),
+ '#default_value' => variable_get('comment_block_count', 10),
+ '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)),
+ '#description' => t('Number of comments displayed in the <em>Recent comments</em> block.'),
+ );
- case 'view':
- if (user_access('access comments')) {
- $block['subject'] = t('Recent comments');
- $block['content'] = theme('comment_block');
+ return $form;
+}
- return $block;
- }
+/**
+ * Implementation of hook_block_save().
+ */
+function comment_block_save($delta = '', $edit = array()) {
+ variable_set('comment_block_count', (int)$edit['comment_block_count']);
+}
+
+/**
+ * Implementation of hook_block_view().
+ *
+ * Generates a block with the most recent comments.
+ */
+function comment_block_view($delta = '') {
+ if (user_access('access comments')) {
+ $block['subject'] = t('Recent comments');
+ $block['content'] = theme('comment_block');
+
+ return $block;
}
}