summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2009-04-26 09:14:32 (GMT)
committerDries Buytaert2009-04-26 09:14:32 (GMT)
commit1c076bc89f7a7374859e025c99f2eb5ea092188e (patch)
tree74f0307600b2b77a12bceeba6f88deafd22733f4
parent9af602fe17e6346360e640e403843494c84ecca0 (diff)
- Patch #19837 by xmacinfo, j.somers: make 'not verified' togglable as a theme setting.
-rw-r--r--includes/theme.inc39
-rw-r--r--modules/blogapi/blogapi.module4
-rw-r--r--modules/node/node.module18
-rw-r--r--modules/node/node.pages.inc4
-rw-r--r--modules/search/search.api.php6
-rw-r--r--modules/statistics/statistics.module2
-rw-r--r--modules/system/system.admin.inc21
-rw-r--r--modules/system/system.module1
-rw-r--r--modules/translation/translation.module2
-rw-r--r--modules/trigger/trigger.module4
-rw-r--r--modules/upload/upload.module2
11 files changed, 54 insertions, 49 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 4189cda..b23ba54 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -906,23 +906,24 @@ function drupal_find_theme_templates($cache, $extension, $path) {
*/
function theme_get_settings($key = NULL) {
$defaults = array(
- 'mission' => '',
- 'default_logo' => 1,
- 'logo_path' => '',
- 'default_favicon' => 1,
- 'favicon_path' => '',
- 'main_menu' => 1,
- 'secondary_menu' => 1,
- 'toggle_logo' => 1,
- 'toggle_favicon' => 1,
- 'toggle_name' => 1,
- 'toggle_search' => 0,
- 'toggle_slogan' => 0,
- 'toggle_mission' => 1,
- 'toggle_node_user_picture' => 0,
- 'toggle_comment_user_picture' => 0,
- 'toggle_main_menu' => 1,
- 'toggle_secondary_menu' => 1,
+ 'mission' => '',
+ 'default_logo' => 1,
+ 'logo_path' => '',
+ 'default_favicon' => 1,
+ 'favicon_path' => '',
+ 'main_menu' => 1,
+ 'secondary_menu' => 1,
+ 'toggle_logo' => 1,
+ 'toggle_favicon' => 1,
+ 'toggle_name' => 1,
+ 'toggle_search' => 0,
+ 'toggle_slogan' => 0,
+ 'toggle_mission' => 1,
+ 'toggle_node_user_picture' => 0,
+ 'toggle_comment_user_picture' => 0,
+ 'toggle_comment_user_verification' => 1,
+ 'toggle_main_menu' => 1,
+ 'toggle_secondary_menu' => 1,
);
$settings = array_merge($defaults, variable_get('theme_settings', array()));
@@ -1680,7 +1681,9 @@ function theme_username($object) {
$output = check_plain($object->name);
}
- $output .= ' (' . t('not verified') . ')';
+ if (theme_get_setting('toggle_comment_user_verification')) {
+ $output .= ' (' . t('not verified') . ')';
+ }
}
else {
$output = variable_get('anonymous', t('Anonymous'));
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 575a07b..58ce6ba 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -224,7 +224,7 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
$edit['date'] = format_date(REQUEST_TIME, 'custom', 'Y-m-d H:i:s O');
}
- node_invoke_node($edit, 'blogapi_new');
+ module_invoke_all('node_blogapi_new', $edit);
$valid = blogapi_status_error_check($edit, $publish);
if ($valid !== TRUE) {
@@ -282,7 +282,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
$node->body = $content;
}
- node_invoke_node($node, 'blogapi_edit');
+ module_invoke_all('node_blogapi_edit', $node);
$valid = blogapi_status_error_check($node, $original_status);
if ($valid !== TRUE) {
diff --git a/modules/node/node.module b/modules/node/node.module
index 9cb3589..cd8fad9 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1015,7 +1015,7 @@ function node_validate($node, $form = array()) {
// Do node-type-specific validation checks.
node_invoke($node, 'validate', $form);
- node_invoke_node($node, 'validate', $form);
+ module_invoke_all('node_validate', $node, $form);
}
/**
@@ -1071,7 +1071,7 @@ function node_submit($node) {
function node_save(&$node) {
field_attach_presave('node', $node);
// Let modules modify the node before it is saved to the database.
- node_invoke_node($node, 'presave');
+ module_invoke_all('node_presave', $node);
global $user;
if (!isset($node->is_new)) {
@@ -1206,7 +1206,7 @@ function node_delete($nid) {
// Call the node-specific callback (if any):
node_invoke($node, 'delete');
- node_invoke_node($node, 'delete');
+ module_invoke_all('node_delete', $node);
// Clear the page and block caches.
cache_clear_all();
@@ -1307,7 +1307,7 @@ function node_build_content($node, $teaser = FALSE) {
$node->content += field_attach_view('node', $node, $teaser);
// Allow modules to make their own additions to the node.
- node_invoke_node($node, 'view', $teaser);
+ module_invoke_all('node_view', $node, $teaser);
// Allow modules to modify the structured node.
drupal_alter('node_build', $node, $teaser);
@@ -1539,7 +1539,7 @@ function node_search($op = 'search', $keys = NULL) {
// Fetch terms for snippet.
$node->body .= module_invoke('taxonomy', 'node', $node, 'update_index');
- $extra = node_invoke_node($node, 'search_result');
+ $extra = module_invoke_all('node_search_result', $node);
$results[] = array(
'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
@@ -1998,7 +1998,7 @@ function node_feed($nids = FALSE, $channel = array()) {
}
// Allow modules to change $node->content before the node is rendered.
- node_invoke_node($item, 'view', $teaser, FALSE);
+ module_invoke_all('node_view', $item, $teaser);
// Set the proper node property, then unset unused $node property so that a
// bad theme can not open a security hole.
@@ -2013,11 +2013,11 @@ function node_feed($nids = FALSE, $channel = array()) {
}
// Allow modules to modify the fully-built node.
- node_invoke_node($item, 'alter', $teaser, FALSE);
+ module_invoke_all('node_alter', $item, $teaser, FALSE);
}
// Allow modules to add additional item fields and/or modify $item
- $extra = node_invoke_node($item, 'rss_item');
+ $extra = module_invoke_all('node_rss_item', $item);
$extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => gmdate('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
foreach ($extra as $element) {
if (isset($element['namespace'])) {
@@ -2173,7 +2173,7 @@ function _node_index_node($node) {
$text = '<h1>' . check_plain($node->title) . '</h1>' . $node->body;
// Fetch extra data normally not visible
- $extra = node_invoke_node($node, 'update_index');
+ $extra = module_invoke_all('node_update_index', $node);
foreach ($extra as $t) {
$text .= $t;
}
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 35d9656..49e93cb 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -98,7 +98,7 @@ function node_object_prepare(&$node) {
$node->revision = in_array('revision', $node_options);
node_invoke($node, 'prepare');
- node_invoke_node($node, 'prepare');
+ module_invoke_all('node_prepare', $node);
}
/**
@@ -606,7 +606,7 @@ function node_revision_delete_confirm_submit($form, &$form_state) {
->condition('nid', $node_revision->nid)
->condition('vid', $node_revision->vid)
->execute();
- node_invoke_node($node_revision, 'delete_revision');
+ module_invoke_all('node_delete_revision', $node_revision);
watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid));
drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title)));
$form_state['redirect'] = 'node/' . $node_revision->nid;
diff --git a/modules/search/search.api.php b/modules/search/search.api.php
index f20664b..5a0b022 100644
--- a/modules/search/search.api.php
+++ b/modules/search/search.api.php
@@ -177,7 +177,7 @@ function hook_search($op = 'search', $keys = null) {
// Fetch terms for snippet.
$node->body .= module_invoke('taxonomy', 'node', $node, 'update_index');
- $extra = node_invoke_node($node, 'search_result');
+ $extra = module_invoke_all('node_search_result', $node);
$results[] = array(
'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
@@ -265,12 +265,12 @@ function hook_update_index() {
$node = node_prepare($node, false);
}
// Allow modules to change $node->body before viewing.
- node_invoke_node($node, 'view', false, false);
+ module_invoke_all('node_view', $node, false, false);
$text = '<h1>' . drupal_specialchars($node->title) . '</h1>' . $node->body;
// Fetch extra data normally not visible
- $extra = node_invoke_node($node, 'update_index');
+ $extra = module_invoke_all('node_update_index', $node);
foreach ($extra as $t) {
$text .= $t;
}
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index eea3a07..f2a5a24 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -103,7 +103,7 @@ function statistics_perm() {
/**
* Implementation of hook_node_view().
*/
-function statistics_node_view($node, $teaser, $page) {
+function statistics_node_view($node, $teaser) {
global $id;
$links = array();
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 33b5aa3..5f45c36 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -354,16 +354,17 @@ function system_theme_settings(&$form_state, $key = '') {
// Toggle settings
$toggles = array(
- 'logo' => t('Logo'),
- 'name' => t('Site name'),
- 'slogan' => t('Site slogan'),
- 'mission' => t('Mission statement'),
- 'node_user_picture' => t('User pictures in posts'),
- 'comment_user_picture' => t('User pictures in comments'),
- 'search' => t('Search box'),
- 'favicon' => t('Shortcut icon'),
- 'main_menu' => t('Main menu'),
- 'secondary_menu' => t('Secondary menu'),
+ 'logo' => t('Logo'),
+ 'name' => t('Site name'),
+ 'slogan' => t('Site slogan'),
+ 'mission' => t('Mission statement'),
+ 'node_user_picture' => t('User pictures in posts'),
+ 'comment_user_picture' => t('User pictures in comments'),
+ 'comment_user_verification' => t('User verification status in comments'),
+ 'search' => t('Search box'),
+ 'favicon' => t('Shortcut icon'),
+ 'main_menu' => t('Main menu'),
+ 'secondary_menu' => t('Secondary menu'),
);
// Some features are not always available
diff --git a/modules/system/system.module b/modules/system/system.module
index fba6378..1524335 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1125,6 +1125,7 @@ function system_theme_default() {
'description' => '',
'features' => array(
'comment_user_picture',
+ 'comment_user_verification',
'favicon',
'mission',
'logo',
diff --git a/modules/translation/translation.module b/modules/translation/translation.module
index 2b4ab19..0183417 100644
--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -215,7 +215,7 @@ function translation_node_prepare($node) {
$node->title = $node->translation_source->title;
$node->body = $node->translation_source->body;
// Let every module add custom translated fields.
- node_invoke_node($node, 'prepare_translation');
+ module_invoke_all('node_prepare_translation', $node);
}
}
}
diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module
index 3d10c3b..f7c931c 100644
--- a/modules/trigger/trigger.module
+++ b/modules/trigger/trigger.module
@@ -244,8 +244,8 @@ function _trigger_node($node, $op, $a3 = NULL, $a4 = NULL) {
/**
* Implementation of hook_node_view().
*/
-function trigger_node_view($node, $teaser, $page) {
- _trigger_node($node, 'view', $teaser, $page);
+function trigger_node_view($node, $teaser) {
+ _trigger_node($node, 'view', $teaser);
}
/**
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index de58b36..a4406b1 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -340,7 +340,7 @@ function upload_node_load($nodes, $types) {
/**
* Implementation of hook_node_view().
*/
-function upload_node_view($node, $teaser, $page) {
+function upload_node_view($node, $teaser) {
if (isset($node->files) && user_access('view uploaded files')) {
// Add the attachments list to node body with a heavy
// weight to ensure they're below other elements.