- Patch #19837 by xmacinfo, j.somers: make 'not verified' togglable as a theme setting.

merge-requests/26/head
Dries Buytaert 2009-04-26 09:14:32 +00:00
parent 9af602fe17
commit 1c076bc89f
11 changed files with 54 additions and 49 deletions

View File

@ -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'));

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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();

View File

@ -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

View File

@ -1125,6 +1125,7 @@ function system_theme_default() {
'description' => '',
'features' => array(
'comment_user_picture',
'comment_user_verification',
'favicon',
'mission',
'logo',

View File

@ -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);
}
}
}

View File

@ -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);
}
/**

View File

@ -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.