diff options
-rw-r--r-- | includes/theme.inc | 15 | ||||
-rw-r--r-- | modules/comment/comment.module | 13 | ||||
-rw-r--r-- | modules/comment/comment.pages.inc | 6 | ||||
-rw-r--r-- | modules/search/search.module | 3 | ||||
-rw-r--r-- | modules/search/search.pages.inc | 19 |
5 files changed, 33 insertions, 23 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 6665ab861..b575734b1 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1474,21 +1474,6 @@ function theme_tablesort_indicator($style) { } /** - * Return a themed box. - * - * @param $title - * The subject of the box. - * @param $content - * The content of the box. - * @return - * A string containing the box output. - */ -function theme_box($title, $content) { - $output = '<h2 class="title">' . $title . '</h2><div>' . $content . '</div>'; - return $output; -} - -/** * Return a themed marker, useful for marking new or updated * content. * diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 6c7e582fa..313b163b7 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -128,6 +128,9 @@ function comment_theme() { 'template' => 'comment', 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array()), ), + 'comment_form_box' => array( + 'arguments' => array('edit' => NULL, 'title' => NULL), + ), 'comment_folded' => array( 'template' => 'comment-folded', 'arguments' => array('comment' => NULL), @@ -1197,7 +1200,7 @@ function comment_render($node, $cid = 0) { // If enabled, show new comment form if it's not already being displayed. $reply = arg(0) == 'comment' && arg(1) == 'reply'; if (user_access('post comments') && $node->comment == COMMENT_NODE_OPEN && (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_BELOW) && !$reply) { - $output .= comment_form_box(array('nid' => $nid), t('Post new comment')); + $output .= theme('comment_form_box', array('nid' => $nid), t('Post new comment')); } if ($output) { $output = theme('comment_wrapper', $output, $node); @@ -1624,9 +1627,13 @@ function comment_form(&$form_state, $edit, $title = NULL) { * The form structure. * @param $title * The form title. + * @return + * A string containing the box output. */ -function comment_form_box($edit, $title = NULL) { - return theme('box', $title, drupal_get_form('comment_form', $edit, $title)); +function theme_comment_form_box($edit, $title = NULL) { + $content = drupal_get_form('comment_form', $edit, $title); + $output = '<h2 class="title">' . $title . '</h2><div>' . $content . '</div>'; + return $output; } /** diff --git a/modules/comment/comment.pages.inc b/modules/comment/comment.pages.inc index 0f8b374a3..cc13b3cbb 100644 --- a/modules/comment/comment.pages.inc +++ b/modules/comment/comment.pages.inc @@ -20,7 +20,7 @@ function comment_edit($cid) { $comment->name = $comment->uid ? $comment->registered_name : $comment->name; if (comment_access('edit', $comment)) { - return comment_form_box((array)$comment); + return theme('comment_form_box', (array)$comment); } else { drupal_access_denied(); @@ -58,7 +58,7 @@ function comment_reply($node, $pid = NULL) { // The user is previewing a comment prior to submitting it. if ($op == t('Preview')) { if (user_access('post comments')) { - $output .= comment_form_box(array('pid' => $pid, 'nid' => $node->nid), NULL); + $output .= theme('comment_form_box', array('pid' => $pid, 'nid' => $node->nid), NULL); } else { drupal_set_message(t('You are not authorized to post comments.'), 'error'); @@ -101,7 +101,7 @@ function comment_reply($node, $pid = NULL) { drupal_goto("node/$node->nid"); } elseif (user_access('post comments')) { - $output .= comment_form_box(array('pid' => $pid, 'nid' => $node->nid), t('Reply')); + $output .= theme('comment_form_box', array('pid' => $pid, 'nid' => $node->nid), t('Reply')); } else { drupal_set_message(t('You are not authorized to post comments.'), 'error'); diff --git a/modules/search/search.module b/modules/search/search.module index bc3ef5648..df9d112b5 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -134,6 +134,9 @@ function search_theme() { 'file' => 'search.pages.inc', 'template' => 'search-results', ), + 'search_results_listing' => array( + 'arguments' => array('title' => NULL, 'content' => NULL), + ), ); } diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index d4ef2bd40..502612d38 100644 --- a/modules/search/search.pages.inc +++ b/modules/search/search.pages.inc @@ -32,10 +32,10 @@ function search_view($type = 'node') { $results = search_data($keys, $type); if ($results) { - $results = theme('box', t('Search results'), $results); + $results = theme('search_results_listing', t('Search results'), $results); } else { - $results = theme('box', t('Your search yielded no results'), search_help('search#noresults', drupal_help_arg())); + $results = theme('search_results_listing', t('Your search yielded no results'), search_help('search#noresults', drupal_help_arg())); } } @@ -50,6 +50,21 @@ function search_view($type = 'node') { } /** + * Theme the listing of search results + * + * @param $title + * The subject of the listing. + * @param $content + * The content of the listing. + * @return + * A string containing the listing output. + */ +function theme_search_results_listing($title, $content) { + $output = '<h2 class="title">' . $title . '</h2><div>' . $content . '</div>'; + return $output; +} + +/** * Process variables for search-results.tpl.php. * * The $variables array contains the following arguments: |