Commit 301d3779 authored by Dries's avatar Dries

- Patch #107440 by webchick and add1sum: code cleanup.

parent 35fa5106
...@@ -1011,7 +1011,7 @@ function comment_render($node, $cid = 0) { ...@@ -1011,7 +1011,7 @@ function comment_render($node, $cid = 0) {
$divs = 0; $divs = 0;
$last_depth = 0; $last_depth = 0;
drupal_add_css(drupal_get_path('module', 'comment') . '/comment.css'); drupal_add_css(drupal_get_path('module', 'comment') .'/comment.css');
while ($comment = db_fetch_object($result)) { while ($comment = db_fetch_object($result)) {
$comment = drupal_unpack($comment); $comment = drupal_unpack($comment);
$comment->name = $comment->uid ? $comment->registered_name : $comment->name; $comment->name = $comment->uid ? $comment->registered_name : $comment->name;
...@@ -1524,7 +1524,7 @@ function comment_form($edit, $title = NULL) { ...@@ -1524,7 +1524,7 @@ function comment_form($edit, $title = NULL) {
else if (variable_get('comment_anonymous', COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) { else if (variable_get('comment_anonymous', COMMENT_ANONYMOUS_MAYNOT_CONTACT) == COMMENT_ANONYMOUS_MUST_CONTACT) {
$form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 60, '#size' => 30, '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')), '#required' => TRUE); $form['name'] = array('#type' => 'textfield', '#title' => t('Your name'), '#maxlength' => 60, '#size' => 30, '#default_value' => $edit['name'] ? $edit['name'] : variable_get('anonymous', t('Anonymous')), '#required' => TRUE);
$form['mail'] = array('#type' => 'textfield', '#title' => t('E-mail'), '#maxlength' => 64, '#size' => 30, '#default_value' => $edit['mail'],'#description' => t('The content of this field is kept private and will not be shown publicly.'), '#required' => TRUE); $form['mail'] = array('#type' => 'textfield', '#title' => t('E-mail'), '#maxlength' => 64, '#size' => 30, '#default_value' => $edit['mail'], '#description' => t('The content of this field is kept private and will not be shown publicly.'), '#required' => TRUE);
$form['homepage'] = array('#type' => 'textfield', '#title' => t('Homepage'), '#maxlength' => 255, '#size' => 30, '#default_value' => $edit['homepage']); $form['homepage'] = array('#type' => 'textfield', '#title' => t('Homepage'), '#maxlength' => 255, '#size' => 30, '#default_value' => $edit['homepage']);
} }
...@@ -1545,7 +1545,7 @@ function comment_form($edit, $title = NULL) { ...@@ -1545,7 +1545,7 @@ function comment_form($edit, $title = NULL) {
$form['uid'] = array('#type' => 'value', '#value' => $edit['uid']); $form['uid'] = array('#type' => 'value', '#value' => $edit['uid']);
$form['preview'] = array('#type' => 'button', '#value' => t('Preview comment'), '#weight' => 19); $form['preview'] = array('#type' => 'button', '#value' => t('Preview comment'), '#weight' => 19);
$form['#token'] = 'comment' . $edit['nid'] . $edit['pid']; $form['#token'] = 'comment'. $edit['nid'] . $edit['pid'];
// Only show post button if preview is optional or if we are in preview mode. // Only show post button if preview is optional or if we are in preview mode.
// We show the post button in preview mode even if there are form errors so that // We show the post button in preview mode even if there are form errors so that
...@@ -1765,7 +1765,7 @@ function comment_controls_submit($form_id, $form_values) { ...@@ -1765,7 +1765,7 @@ function comment_controls_submit($form_id, $form_values) {
function theme_comment($comment, $links = array()) { function theme_comment($comment, $links = array()) {
$output = '<div class="comment'. ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') .'">'; $output = '<div class="comment'. ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') .'">';
$output .= '<div class="subject">'. l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") . ' ' . theme('mark', $comment->new) ."</div>\n"; $output .= '<div class="subject">'. l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") .' '. theme('mark', $comment->new) ."</div>\n";
$output .= '<div class="credit">'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."</div>\n"; $output .= '<div class="credit">'. t('by %a on %b', array('%a' => theme('username', $comment), '%b' => format_date($comment->timestamp))) ."</div>\n";
$output .= '<div class="body">'. $comment->comment .'</div>'; $output .= '<div class="body">'. $comment->comment .'</div>';
$output .= '<div class="links">'. theme('links', $links) .'</div>'; $output .= '<div class="links">'. theme('links', $links) .'</div>';
...@@ -1775,7 +1775,7 @@ function theme_comment($comment, $links = array()) { ...@@ -1775,7 +1775,7 @@ function theme_comment($comment, $links = array()) {
function theme_comment_folded($comment) { function theme_comment_folded($comment) {
$output = "<div class=\"comment-folded\">\n"; $output = "<div class=\"comment-folded\">\n";
$output .= ' <span class="subject">'. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") . ' '. theme('mark', $comment->new) .'</span> '; $output .= ' <span class="subject">'. l($comment->subject, comment_node_url() .'/'. $comment->cid, NULL, NULL, "comment-$comment->cid") .' '. theme('mark', $comment->new) .'</span> ';
$output .= '<span class="credit">'. t('by') .' '. theme('username', $comment) ."</span>\n"; $output .= '<span class="credit">'. t('by') .' '. theme('username', $comment) ."</span>\n";
$output .= "</div>\n"; $output .= "</div>\n";
return $output; return $output;
...@@ -1827,7 +1827,7 @@ function theme_comment_post_forbidden($nid) { ...@@ -1827,7 +1827,7 @@ function theme_comment_post_forbidden($nid) {
* Allow themable wrapping of all comments. * Allow themable wrapping of all comments.
*/ */
function theme_comment_wrapper($content) { function theme_comment_wrapper($content) {
return '<div id="comments">' . $content . '</div>'; return '<div id="comments">'. $content .'</div>';
} }
function _comment_delete_thread($comment) { function _comment_delete_thread($comment) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment