diff --git a/includes/menu.inc b/includes/menu.inc index 488fec955a4466593070c22d8769750ae83d8c07..0984d2fe915c0935c46aa671b322bbe3391bd5ea 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -351,8 +351,7 @@ function menu_execute_active_handler() { $arguments = array_merge($arguments, explode('/', $arg)); } - call_user_func_array($menu['items'][$mid]['callback'], $arguments); - return MENU_FOUND; + return call_user_func_array($menu['items'][$mid]['callback'], $arguments); } /** diff --git a/index.php b/index.php index 89f8354f96a9061d142b6a8e30794782e4b5cedb..060c66125660779c6c516b87b8786f7ac9d70ea0 100644 --- a/index.php +++ b/index.php @@ -15,14 +15,19 @@ fix_gpc_magic(); -$status = menu_execute_active_handler(); -switch ($status) { +$return = menu_execute_active_handler(); +switch ($return) { case MENU_NOT_FOUND: drupal_not_found(); break; case MENU_ACCESS_DENIED: drupal_access_denied(); break; + default: + if (!empty($return)) { + print theme('page', $return); + } + break; } drupal_page_footer(); diff --git a/modules/aggregator.module b/modules/aggregator.module index 0d7601db3504d311e32e9bd4b34a81e000a3a6cb..d5b08456c33d802e9b044e4f6ee62fabb315f261 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -762,7 +762,7 @@ function aggregator_edit() { $output = aggregator_form_feed(aggregator_get_feed(arg(2))); } - print theme('page', $output); + return $output; } @@ -792,7 +792,7 @@ function aggregator_admin_edit_category($category = 0) { $output = aggregator_form_category(); } } - print theme('page', $output); + return $output; } /** @@ -822,7 +822,7 @@ function aggregator_admin_edit_feed($feed = 0) { $output = aggregator_form_feed(); } } - print theme('page', $output); + return $output; } /** @@ -845,7 +845,7 @@ function aggregator_admin_refresh_feed($feed) { * Menu callback; displays the aggregator administration page. */ function aggregator_admin_overview() { - print theme('page', aggregator_view()); + return aggregator_view(); } /** @@ -946,7 +946,7 @@ function _aggregator_page_list($sql, $op, $header = '') { $output .= $pager; } - print theme('page', $output); + return $output; } /** @@ -971,7 +971,7 @@ function aggregator_page_sources() { } $output .= theme('xml_icon', url('aggregator/opml')); $output .= '</div>'; - print theme('page', $output); + return $output; } /** @@ -1020,7 +1020,7 @@ function aggregator_page_categories() { } $output .= '</div>'; - print theme('page', $output); + return $output; } /** diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 0d7601db3504d311e32e9bd4b34a81e000a3a6cb..d5b08456c33d802e9b044e4f6ee62fabb315f261 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -762,7 +762,7 @@ function aggregator_edit() { $output = aggregator_form_feed(aggregator_get_feed(arg(2))); } - print theme('page', $output); + return $output; } @@ -792,7 +792,7 @@ function aggregator_admin_edit_category($category = 0) { $output = aggregator_form_category(); } } - print theme('page', $output); + return $output; } /** @@ -822,7 +822,7 @@ function aggregator_admin_edit_feed($feed = 0) { $output = aggregator_form_feed(); } } - print theme('page', $output); + return $output; } /** @@ -845,7 +845,7 @@ function aggregator_admin_refresh_feed($feed) { * Menu callback; displays the aggregator administration page. */ function aggregator_admin_overview() { - print theme('page', aggregator_view()); + return aggregator_view(); } /** @@ -946,7 +946,7 @@ function _aggregator_page_list($sql, $op, $header = '') { $output .= $pager; } - print theme('page', $output); + return $output; } /** @@ -971,7 +971,7 @@ function aggregator_page_sources() { } $output .= theme('xml_icon', url('aggregator/opml')); $output .= '</div>'; - print theme('page', $output); + return $output; } /** @@ -1020,7 +1020,7 @@ function aggregator_page_categories() { } $output .= '</div>'; - print theme('page', $output); + return $output; } /** diff --git a/modules/archive.module b/modules/archive.module index 166ffd5d191666d8cb9b0e3a8b81bb2fa11acdcf..cf38fd40adc5b8e79e7349abec7a9491ba75988e 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -249,7 +249,7 @@ function archive_page($year = 0, $month = 0, $day = 0) { $output .= node_view(node_load(array('nid' => $nid->nid)), 1); } } - print theme('page', $output); + return $output; } ?> diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 166ffd5d191666d8cb9b0e3a8b81bb2fa11acdcf..cf38fd40adc5b8e79e7349abec7a9491ba75988e 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -249,7 +249,7 @@ function archive_page($year = 0, $month = 0, $day = 0) { $output .= node_view(node_load(array('nid' => $nid->nid)), 1); } } - print theme('page', $output); + return $output; } ?> diff --git a/modules/block.module b/modules/block.module index 1a3a9d02b508212d98a01dbe0e149b0734f1e60d..d199fb09d8c54856bbf4f043e4da52dd65755f0e 100644 --- a/modules/block.module +++ b/modules/block.module @@ -299,7 +299,7 @@ function block_admin_configure($module = NULL, $delta = 0) { $form .= form_submit(t('Save block')); - print theme('page', form($form)); + return form($form); } } @@ -323,7 +323,7 @@ function block_box_add() { $output .= form($form); } - print theme('page', $output); + return $output; } /** @@ -348,7 +348,7 @@ function block_box_delete($bid = 0) { t('Delete')); } - print theme('page', $output); + return $output; } function block_box_form($edit = array()) { @@ -390,7 +390,7 @@ function block_admin() { cache_clear_all(); drupal_goto($_GET['q']); } - print theme('page', block_admin_display()); + return block_admin_display(); } /** diff --git a/modules/block/block.module b/modules/block/block.module index 1a3a9d02b508212d98a01dbe0e149b0734f1e60d..d199fb09d8c54856bbf4f043e4da52dd65755f0e 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -299,7 +299,7 @@ function block_admin_configure($module = NULL, $delta = 0) { $form .= form_submit(t('Save block')); - print theme('page', form($form)); + return form($form); } } @@ -323,7 +323,7 @@ function block_box_add() { $output .= form($form); } - print theme('page', $output); + return $output; } /** @@ -348,7 +348,7 @@ function block_box_delete($bid = 0) { t('Delete')); } - print theme('page', $output); + return $output; } function block_box_form($edit = array()) { @@ -390,7 +390,7 @@ function block_admin() { cache_clear_all(); drupal_goto($_GET['q']); } - print theme('page', block_admin_display()); + return block_admin_display(); } /** diff --git a/modules/blog.module b/modules/blog.module index 45007956bc82a156d4f7d97b2a094f2cbb263c6d..faad60764c38c7a5312f8fae45af1001ee5e2055 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -149,7 +149,7 @@ function blog_page_user($uid) { $output .= theme('xml_icon', url("blog/$account->uid/feed")); drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. $title .'" href="'. url("blog/$account->uid/feed") .'" />'); - print theme('page', $output); + return $output; } else { drupal_not_found(); @@ -173,7 +173,7 @@ function blog_page_last() { $output .= theme('xml_icon', url('blog/feed')); drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - blogs" href="'. url('blog/feed') .'" />'); - print theme('page', $output); + return $output; } /** diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 45007956bc82a156d4f7d97b2a094f2cbb263c6d..faad60764c38c7a5312f8fae45af1001ee5e2055 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -149,7 +149,7 @@ function blog_page_user($uid) { $output .= theme('xml_icon', url("blog/$account->uid/feed")); drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. $title .'" href="'. url("blog/$account->uid/feed") .'" />'); - print theme('page', $output); + return $output; } else { drupal_not_found(); @@ -173,7 +173,7 @@ function blog_page_last() { $output .= theme('xml_icon', url('blog/feed')); drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - blogs" href="'. url('blog/feed') .'" />'); - print theme('page', $output); + return $output; } /** diff --git a/modules/book.module b/modules/book.module index e14002028207cb89015140d460677189c6b85047..c9e0406a3408bb7821e69f6b3fd0ef43d772007c 100644 --- a/modules/book.module +++ b/modules/book.module @@ -288,7 +288,7 @@ function book_outline() { } drupal_set_title(check_plain($node->title)); - print theme('page', form($output)); + return form($output); } } } @@ -611,7 +611,7 @@ function book_render() { } drupal_set_title(t('Books')); - print theme('page', $output); + return $output; } /** @@ -767,7 +767,7 @@ function book_admin_orphan() { $output .= theme('table', $header, $rows); } - print theme('page', $output); + return $output; } /** @@ -785,7 +785,7 @@ function book_admin($nid = 0) { $output .= book_admin_view($nid); break; } - print theme('page', $output); + return $output; } /** diff --git a/modules/book/book.module b/modules/book/book.module index e14002028207cb89015140d460677189c6b85047..c9e0406a3408bb7821e69f6b3fd0ef43d772007c 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -288,7 +288,7 @@ function book_outline() { } drupal_set_title(check_plain($node->title)); - print theme('page', form($output)); + return form($output); } } } @@ -611,7 +611,7 @@ function book_render() { } drupal_set_title(t('Books')); - print theme('page', $output); + return $output; } /** @@ -767,7 +767,7 @@ function book_admin_orphan() { $output .= theme('table', $header, $rows); } - print theme('page', $output); + return $output; } /** @@ -785,7 +785,7 @@ function book_admin($nid = 0) { $output .= book_admin_view($nid); break; } - print theme('page', $output); + return $output; } /** diff --git a/modules/comment.module b/modules/comment.module index c473def244f0ec993966fec6554ba47fe9cfa8ce..c0152254ad3822a489e1cebe271014d1b703ad50 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -329,7 +329,7 @@ function comment_configure() { $output .= form_group(t('Comment moderation settings'), $group); } - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -361,7 +361,7 @@ function comment_edit($cid) { $comment = drupal_unpack($comment); $comment->name = $comment->uid ? $comment->registered_name : $comment->name; if (comment_access('edit', $comment)) { - print theme('page', comment_preview(object2array($comment))); + return comment_preview(object2array($comment)); } else { drupal_access_denied(); @@ -380,15 +380,13 @@ function comment_reply($nid, $pid = NULL) { $edit = $_POST['edit']; $edit = comment_validate_form($edit); drupal_set_title(t('Post comment')); - print theme('page', comment_post($edit)); - return; + return comment_post($edit); } else if ($_POST['op'] == t('Preview comment')) { $edit = $_POST['edit']; $edit = comment_validate_form($edit); drupal_set_title(t('Preview comment')); - print theme('page', comment_preview($edit)); - return; + return comment_preview($edit); } // or are we merely showing the form? @@ -423,7 +421,7 @@ function comment_reply($nid, $pid = NULL) { } drupal_set_title(t('Add new comment')); - print theme('page', $output); + return $output; } function comment_validate_form($edit) { @@ -661,7 +659,7 @@ function comment_post($edit) { } } else { - print theme('page', comment_preview($edit)); + return comment_preview($edit); } } else { @@ -945,7 +943,7 @@ function comment_admin_edit($cid) { $form .= form_hidden('nid', $comment->nid); $form .= form_hidden('cid', $comment->cid); $form .= form_submit(t('Submit')); - print theme('page', form($form)); + return form($form); } } @@ -989,7 +987,7 @@ function comment_delete($cid) { drupal_set_message(t('The comment no longer exists.')); } - print theme('page', $output); + return $output; } function comment_save($id, $edit) { @@ -1042,7 +1040,7 @@ function comment_admin_overview($type = 'new') { $rows[] = array(array('data' => t('No comments available.'), 'colspan' => '6')); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -1091,7 +1089,7 @@ function comment_matrix_settings() { $output .= theme('table', $header, $rows); if ($rows) { $output .= '<br />'. form_submit(t('Submit votes')); } - print theme('page', form($output)); + return form($output); } /** @@ -1121,7 +1119,7 @@ function comment_role_settings() { $output .= theme('table', $header, $rows); $output .= '<br />'. form_submit(t('Save scores')); - print theme('page', form($output)); + return form($output); } /** @@ -1176,7 +1174,7 @@ function comment_vote_settings($mid = 0) { $form .= form_submit(t('Add new vote')); } - print theme('page', $output . form($form)); + return $output . form($form); } /** @@ -1230,7 +1228,7 @@ function comment_threshold_settings($fid = 0) { $form .= form_submit(t('Add new threshold')); } - print theme('page', $output . form($form)); + return $output . form($form); } /** diff --git a/modules/comment/comment.module b/modules/comment/comment.module index c473def244f0ec993966fec6554ba47fe9cfa8ce..c0152254ad3822a489e1cebe271014d1b703ad50 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -329,7 +329,7 @@ function comment_configure() { $output .= form_group(t('Comment moderation settings'), $group); } - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -361,7 +361,7 @@ function comment_edit($cid) { $comment = drupal_unpack($comment); $comment->name = $comment->uid ? $comment->registered_name : $comment->name; if (comment_access('edit', $comment)) { - print theme('page', comment_preview(object2array($comment))); + return comment_preview(object2array($comment)); } else { drupal_access_denied(); @@ -380,15 +380,13 @@ function comment_reply($nid, $pid = NULL) { $edit = $_POST['edit']; $edit = comment_validate_form($edit); drupal_set_title(t('Post comment')); - print theme('page', comment_post($edit)); - return; + return comment_post($edit); } else if ($_POST['op'] == t('Preview comment')) { $edit = $_POST['edit']; $edit = comment_validate_form($edit); drupal_set_title(t('Preview comment')); - print theme('page', comment_preview($edit)); - return; + return comment_preview($edit); } // or are we merely showing the form? @@ -423,7 +421,7 @@ function comment_reply($nid, $pid = NULL) { } drupal_set_title(t('Add new comment')); - print theme('page', $output); + return $output; } function comment_validate_form($edit) { @@ -661,7 +659,7 @@ function comment_post($edit) { } } else { - print theme('page', comment_preview($edit)); + return comment_preview($edit); } } else { @@ -945,7 +943,7 @@ function comment_admin_edit($cid) { $form .= form_hidden('nid', $comment->nid); $form .= form_hidden('cid', $comment->cid); $form .= form_submit(t('Submit')); - print theme('page', form($form)); + return form($form); } } @@ -989,7 +987,7 @@ function comment_delete($cid) { drupal_set_message(t('The comment no longer exists.')); } - print theme('page', $output); + return $output; } function comment_save($id, $edit) { @@ -1042,7 +1040,7 @@ function comment_admin_overview($type = 'new') { $rows[] = array(array('data' => t('No comments available.'), 'colspan' => '6')); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -1091,7 +1089,7 @@ function comment_matrix_settings() { $output .= theme('table', $header, $rows); if ($rows) { $output .= '<br />'. form_submit(t('Submit votes')); } - print theme('page', form($output)); + return form($output); } /** @@ -1121,7 +1119,7 @@ function comment_role_settings() { $output .= theme('table', $header, $rows); $output .= '<br />'. form_submit(t('Save scores')); - print theme('page', form($output)); + return form($output); } /** @@ -1176,7 +1174,7 @@ function comment_vote_settings($mid = 0) { $form .= form_submit(t('Add new vote')); } - print theme('page', $output . form($form)); + return $output . form($form); } /** @@ -1230,7 +1228,7 @@ function comment_threshold_settings($fid = 0) { $form .= form_submit(t('Add new threshold')); } - print theme('page', $output . form($form)); + return $output . form($form); } /** diff --git a/modules/contact.module b/modules/contact.module index 7f9646bb4df90738e36216dfe728ee1918fe4646..c5703bd588180743cbc4f559260503693048ec14 100644 --- a/modules/contact.module +++ b/modules/contact.module @@ -153,7 +153,8 @@ function contact_mail_user() { $output = form($output); } - print theme('page', $output, $account->name); + drupal_set_title($account->name); + return $output; } else { drupal_not_found(); @@ -185,17 +186,17 @@ function contact_admin_edit($subject = NULL) { $form .= form_textarea(t('Auto-reply'), 'reply', $subject->reply, 50, 10, t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message.")); $form .= form_submit(t('Submit')); - print theme('page', form($form)); + return form($form); } function contact_admin_delete($subject) { if ($_POST['op'] != t('Delete')) { - print theme('page', theme('confirm', + return theme('confirm', t('Are you sure you want to delete %subject?', array('%subject' => theme('placeholder', $subject))), 'admin/contact/delete/'. $subject, t('This action cannot be undone.'), t('Delete'), - t('Cancel'))); + t('Cancel')); } else { db_query("DELETE FROM {contact} WHERE subject = '%s'", $subject); @@ -211,7 +212,7 @@ function contact_admin() { $rows[] = array($subject->subject, $subject->recipients, l(t('edit'), 'admin/contact/edit/'. $subject->subject), l(t('delete'), 'admin/contact/delete/'. $subject->subject)); } $header = array(t('Subject'), t('Recipients'), array('data' => t('Operations'), 'colspan' => 2)); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } function contact_mail_page() { @@ -302,7 +303,7 @@ function contact_mail_page() { } } - print theme('page', $output); + return $output; } ?> diff --git a/modules/contact/contact.module b/modules/contact/contact.module index 7f9646bb4df90738e36216dfe728ee1918fe4646..c5703bd588180743cbc4f559260503693048ec14 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -153,7 +153,8 @@ function contact_mail_user() { $output = form($output); } - print theme('page', $output, $account->name); + drupal_set_title($account->name); + return $output; } else { drupal_not_found(); @@ -185,17 +186,17 @@ function contact_admin_edit($subject = NULL) { $form .= form_textarea(t('Auto-reply'), 'reply', $subject->reply, 50, 10, t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message.")); $form .= form_submit(t('Submit')); - print theme('page', form($form)); + return form($form); } function contact_admin_delete($subject) { if ($_POST['op'] != t('Delete')) { - print theme('page', theme('confirm', + return theme('confirm', t('Are you sure you want to delete %subject?', array('%subject' => theme('placeholder', $subject))), 'admin/contact/delete/'. $subject, t('This action cannot be undone.'), t('Delete'), - t('Cancel'))); + t('Cancel')); } else { db_query("DELETE FROM {contact} WHERE subject = '%s'", $subject); @@ -211,7 +212,7 @@ function contact_admin() { $rows[] = array($subject->subject, $subject->recipients, l(t('edit'), 'admin/contact/edit/'. $subject->subject), l(t('delete'), 'admin/contact/delete/'. $subject->subject)); } $header = array(t('Subject'), t('Recipients'), array('data' => t('Operations'), 'colspan' => 2)); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } function contact_mail_page() { @@ -302,7 +303,7 @@ function contact_mail_page() { } } - print theme('page', $output); + return $output; } ?> diff --git a/modules/drupal.module b/modules/drupal.module index 08add863ca40037ec113d64fa387bf8546e742d5..8295d877802aedf4d13470c1ee6c0338e6ed9daf 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -199,7 +199,7 @@ function drupal_menu($may_cache) { * Menu callback; print Drupal-authentication-specific information from user/help. */ function drupal_page_help() { - print theme('page', drupal_help('user/help#drupal')); + return drupal_help('user/help#drupal'); } /** diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 08add863ca40037ec113d64fa387bf8546e742d5..8295d877802aedf4d13470c1ee6c0338e6ed9daf 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -199,7 +199,7 @@ function drupal_menu($may_cache) { * Menu callback; print Drupal-authentication-specific information from user/help. */ function drupal_page_help() { - print theme('page', drupal_help('user/help#drupal')); + return drupal_help('user/help#drupal'); } /** diff --git a/modules/filter.module b/modules/filter.module index 05d875419354845bb282f8930e4623bd95531c26..5d4b4518fa78a9e7d6c46dbcc487e79317d057fb 100644 --- a/modules/filter.module +++ b/modules/filter.module @@ -310,7 +310,7 @@ function filter_admin_overview() { $group .= form($form); $output .= '<h2>'. t('Add new input format') .'</h2>'. $group; - print theme('page', $output); + return $output; } /** @@ -403,7 +403,7 @@ function filter_admin_delete() { t('Delete'), t('Cancel'), $extra); - print theme('page', $output); + return $output; } /** @@ -449,7 +449,7 @@ function filter_admin_filters() { $group .= $tiplist; $output .= '<h2>'. t('Formatting guidelines') .'</h2>'. $group; - print theme('page', $output); + return $output; } /** @@ -505,7 +505,7 @@ function filter_admin_order() { $form .= form_submit(t('Save configuration')); $output = form($form); - print theme('page', $output); + return $output; } /** @@ -544,7 +544,7 @@ function filter_admin_configure() { $output = t('No settings are available.'); } - print theme('page', $output); + return $output; } /** @@ -764,7 +764,7 @@ function filter_tips_long() { else { $output = theme('filter_tips', _filter_tips(-1, true), true); } - print theme('page', $output); + return $output; } /** diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 05d875419354845bb282f8930e4623bd95531c26..5d4b4518fa78a9e7d6c46dbcc487e79317d057fb 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -310,7 +310,7 @@ function filter_admin_overview() { $group .= form($form); $output .= '<h2>'. t('Add new input format') .'</h2>'. $group; - print theme('page', $output); + return $output; } /** @@ -403,7 +403,7 @@ function filter_admin_delete() { t('Delete'), t('Cancel'), $extra); - print theme('page', $output); + return $output; } /** @@ -449,7 +449,7 @@ function filter_admin_filters() { $group .= $tiplist; $output .= '<h2>'. t('Formatting guidelines') .'</h2>'. $group; - print theme('page', $output); + return $output; } /** @@ -505,7 +505,7 @@ function filter_admin_order() { $form .= form_submit(t('Save configuration')); $output = form($form); - print theme('page', $output); + return $output; } /** @@ -544,7 +544,7 @@ function filter_admin_configure() { $output = t('No settings are available.'); } - print theme('page', $output); + return $output; } /** @@ -764,7 +764,7 @@ function filter_tips_long() { else { $output = theme('filter_tips', _filter_tips(-1, true), true); } - print theme('page', $output); + return $output; } /** diff --git a/modules/forum.module b/modules/forum.module index a879e1bea7fc1895bebe56f21841c701a8c797a1..dfbcb0ff147d25441b5270e74f43d56b3a86a629 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -105,7 +105,7 @@ function forum_admin() { $output = forum_overview(); } - print theme('page', $output); + return $output; } /** @@ -299,7 +299,7 @@ function forum_admin_configure() { $forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4=> t('Posts - least active first')); $output .= form_radios(t('Default order'), 'forum_order', variable_get('forum_order', '1'), $forder, t('The default display order for topics.')); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -736,11 +736,11 @@ function forum_page($tid = 0) { $topics = forum_get_topics($tid, $sortby, $forum_per_page); } - print theme('page', theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page)); + return theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page); } else { drupal_set_title(t('Warning')); - print theme('page', forum_help('admin/settings/forum')); + return forum_help('admin/settings/forum'); } } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index a879e1bea7fc1895bebe56f21841c701a8c797a1..dfbcb0ff147d25441b5270e74f43d56b3a86a629 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -105,7 +105,7 @@ function forum_admin() { $output = forum_overview(); } - print theme('page', $output); + return $output; } /** @@ -299,7 +299,7 @@ function forum_admin_configure() { $forder = array(1 => t('Date - newest first'), 2 => t('Date - oldest first'), 3 => t('Posts - most active first'), 4=> t('Posts - least active first')); $output .= form_radios(t('Default order'), 'forum_order', variable_get('forum_order', '1'), $forder, t('The default display order for topics.')); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -736,11 +736,11 @@ function forum_page($tid = 0) { $topics = forum_get_topics($tid, $sortby, $forum_per_page); } - print theme('page', theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page)); + return theme('forum_display', $forums, $topics, $parents, $tid, $sortby, $forum_per_page); } else { drupal_set_title(t('Warning')); - print theme('page', forum_help('admin/settings/forum')); + return forum_help('admin/settings/forum'); } } diff --git a/modules/help.module b/modules/help.module index f8fee8e4bc3dcb8d27470b5372ef4a0cb3686df4..ca516f2fea2f29f34e51bcf79072db0b838f3636 100644 --- a/modules/help.module +++ b/modules/help.module @@ -63,7 +63,7 @@ function help_main() { <dt>Visitor</dt><dd>A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is <strong>not</strong> logged in with that account. Also termed \"anonymous user\".</dd> </dl>", array('%Drupal' => 'http://drupal.org', '%handbook' => 'http://drupal.org/handbook', '%help_pages' => help_links_as_list(), '%taxonomy' => url('admin/help/taxonomy'))); - print theme('page', $output); + return $output; } function help_links_as_list() { @@ -103,7 +103,7 @@ function help_page() { $output .= $temp; } } - print theme('page', $output); + return $output; } ?> diff --git a/modules/help/help.module b/modules/help/help.module index f8fee8e4bc3dcb8d27470b5372ef4a0cb3686df4..ca516f2fea2f29f34e51bcf79072db0b838f3636 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -63,7 +63,7 @@ function help_main() { <dt>Visitor</dt><dd>A person who does not have an account at your Drupal site or a person who has an account at your Drupal site but is <strong>not</strong> logged in with that account. Also termed \"anonymous user\".</dd> </dl>", array('%Drupal' => 'http://drupal.org', '%handbook' => 'http://drupal.org/handbook', '%help_pages' => help_links_as_list(), '%taxonomy' => url('admin/help/taxonomy'))); - print theme('page', $output); + return $output; } function help_links_as_list() { @@ -103,7 +103,7 @@ function help_page() { $output .= $temp; } } - print theme('page', $output); + return $output; } ?> diff --git a/modules/locale.module b/modules/locale.module index 493d34a991483b0b8de93de3378132c432c50e71..aba4acab13eb5cb5407abe1e440ba9600b39c4c9 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -283,7 +283,7 @@ function locale_admin_manage() { drupal_goto('admin/locale/language/overview'); } - print theme('page', _locale_admin_manage_screen()); + return _locale_admin_manage_screen(); } /** @@ -327,7 +327,7 @@ function locale_admin_manage_delete_screen() { t('Delete'), t('Cancel'), $extra); - print theme('page', $output); + return $output; } /** @@ -364,7 +364,7 @@ function locale_admin_manage_add() { } break; } - print theme('page', _locale_admin_manage_add_screen()); + return _locale_admin_manage_add_screen(); } // --------------------------------------------------------------------------------- @@ -397,7 +397,7 @@ function locale_admin_import() { drupal_goto('admin/locale'); break; } - print theme('page', _locale_admin_import_screen()); + return _locale_admin_import_screen(); } @@ -414,7 +414,7 @@ function locale_admin_export() { _locale_export_po($_POST['edit']['langcode']); break; } - print theme('page', _locale_admin_export_screen()); + return _locale_admin_export_screen(); } @@ -449,7 +449,7 @@ function locale_admin_string() { break; default: } - print theme('page', $output); + return $output; } ?> diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 493d34a991483b0b8de93de3378132c432c50e71..aba4acab13eb5cb5407abe1e440ba9600b39c4c9 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -283,7 +283,7 @@ function locale_admin_manage() { drupal_goto('admin/locale/language/overview'); } - print theme('page', _locale_admin_manage_screen()); + return _locale_admin_manage_screen(); } /** @@ -327,7 +327,7 @@ function locale_admin_manage_delete_screen() { t('Delete'), t('Cancel'), $extra); - print theme('page', $output); + return $output; } /** @@ -364,7 +364,7 @@ function locale_admin_manage_add() { } break; } - print theme('page', _locale_admin_manage_add_screen()); + return _locale_admin_manage_add_screen(); } // --------------------------------------------------------------------------------- @@ -397,7 +397,7 @@ function locale_admin_import() { drupal_goto('admin/locale'); break; } - print theme('page', _locale_admin_import_screen()); + return _locale_admin_import_screen(); } @@ -414,7 +414,7 @@ function locale_admin_export() { _locale_export_po($_POST['edit']['langcode']); break; } - print theme('page', _locale_admin_export_screen()); + return _locale_admin_export_screen(); } @@ -449,7 +449,7 @@ function locale_admin_string() { break; default: } - print theme('page', $output); + return $output; } ?> diff --git a/modules/menu.module b/modules/menu.module index 26ac4e1278d5b4454c097622c57c8cdfeeb9d434..7baf23327724a86aa81548cfeba76d6e76c4f3e0 100644 --- a/modules/menu.module +++ b/modules/menu.module @@ -104,7 +104,7 @@ function menu_perm() { function menu_overview() { menu_rebuild(); - print theme('page', menu_overview_tree()); + return menu_overview_tree(); } /** @@ -124,7 +124,7 @@ function menu_reset() { 'admin/menu', t('Any custom additions or changes to the menu will be lost.'), t('Reset all')); - print theme('page', $output); + return $output; } } @@ -150,7 +150,7 @@ function menu_add_menu() { $output .= menu_edit_item_form($edit); } - print theme('page', $output); + return $output; } /** @@ -171,7 +171,7 @@ function menu_reset_item($mid) { 'admin/menu', t('Any customizations will be lost. This action cannot be undone.'), t('Reset')); - print theme('page', $output); + return $output; } } @@ -204,7 +204,7 @@ function menu_delete_item($mid) { $message = t('Are you sure you want to delete the custom menu item %item?', array('%item' => theme('placeholder', $menu->title))); } $output = theme('confirm', $message, 'admin/menu', t('This action cannot be undone.'), t('Delete')); - print theme('page', $output); + return $output; } } @@ -260,7 +260,7 @@ function menu_edit_item($mid = 0) { $output .= menu_edit_item_form($edit); } - print theme('page', $output); + return $output; } /** diff --git a/modules/menu/menu.module b/modules/menu/menu.module index 26ac4e1278d5b4454c097622c57c8cdfeeb9d434..7baf23327724a86aa81548cfeba76d6e76c4f3e0 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -104,7 +104,7 @@ function menu_perm() { function menu_overview() { menu_rebuild(); - print theme('page', menu_overview_tree()); + return menu_overview_tree(); } /** @@ -124,7 +124,7 @@ function menu_reset() { 'admin/menu', t('Any custom additions or changes to the menu will be lost.'), t('Reset all')); - print theme('page', $output); + return $output; } } @@ -150,7 +150,7 @@ function menu_add_menu() { $output .= menu_edit_item_form($edit); } - print theme('page', $output); + return $output; } /** @@ -171,7 +171,7 @@ function menu_reset_item($mid) { 'admin/menu', t('Any customizations will be lost. This action cannot be undone.'), t('Reset')); - print theme('page', $output); + return $output; } } @@ -204,7 +204,7 @@ function menu_delete_item($mid) { $message = t('Are you sure you want to delete the custom menu item %item?', array('%item' => theme('placeholder', $menu->title))); } $output = theme('confirm', $message, 'admin/menu', t('This action cannot be undone.'), t('Delete')); - print theme('page', $output); + return $output; } } @@ -260,7 +260,7 @@ function menu_edit_item($mid = 0) { $output .= menu_edit_item_form($edit); } - print theme('page', $output); + return $output; } /** diff --git a/modules/node.module b/modules/node.module index 86009f72c09556ab59616f951c8ef336f1e50c71..2066c6e35940e8d72ae26d3eff5a0ad55d15651a 100644 --- a/modules/node.module +++ b/modules/node.module @@ -614,7 +614,7 @@ function node_configure() { $output .= form_select(t('Length of trimmed posts'), 'teaser_length', variable_get('teaser_length', 600), array(0 => t('Unlimited'), 200 => t('200 characters'), 400 => t('400 characters'), 600 => t('600 characters'), 800 => t('800 characters'), 1000 => t('1000 characters'), 1200 => t('1200 characters'), 1400 => t('1400 characters'), 1600 => t('1600 characters'), 1800 => t('1800 characters'), 2000 => t('2000 characters')), t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'. Note that this setting will only affect new or updated content and will not affect existing teasers.")); $output .= form_radios(t('Preview post'), 'node_preview', variable_get('node_preview', 0), array(t('Optional'), t('Required')), t('Must users preview posts before submitting?')); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -958,6 +958,10 @@ function node_types_configure($type = NULL) { // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto(). if ($_POST['op']) { $_GET['q'] = 'admin/node/configure/types'; + $options = 'options_'. $type; + if (empty($node->$options)) { + $node->$options = array(); + } } system_settings_save(); @@ -968,7 +972,7 @@ function node_types_configure($type = NULL) { $output = form_group(t('Submission form'), $group); $output .= form_group(t('Workflow'), implode('', node_invoke_nodeapi($node, 'settings'))); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } else { $header = array(t('Type'), t('Operations')); @@ -978,7 +982,7 @@ function node_types_configure($type = NULL) { $rows[] = array(node_invoke($type, 'node_name'), l(t('configure'), 'admin/node/configure/types/'. $type)); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } } @@ -1111,7 +1115,7 @@ function node_admin() { default: $output = node_admin_nodes(); } - print theme('page', $output); + return $output; } /** @@ -1661,13 +1665,13 @@ function node_page() { node_feed(); return; case 'add': - print theme('page', node_add(arg(2))); + return node_add(arg(2)); break; case 'edit': - print theme('page', node_edit(arg(1))); + return node_edit(arg(1)); break; case 'revisions': - print theme('page', node_revision_overview(arg(1))); + return node_revision_overview(arg(1)); break; case 'rollback-revision': node_revision_rollback(arg(1), arg(3)); @@ -1680,7 +1684,7 @@ function node_page() { $node = node_load(array('nid' => arg(1)), $_GET['revision']); if ($node->nid) { drupal_set_title(check_plain($node->title)); - print theme('page', node_show($node, arg(2))); + return node_show($node, arg(2)); } else { drupal_not_found(); @@ -1690,7 +1694,7 @@ function node_page() { case t('Preview'): $edit = node_validate($edit); drupal_set_title(t('Preview')); - print theme('page', node_preview($edit)); + return node_preview($edit); break; case t('Submit'): if ($nid = node_submit($edit)) { @@ -1703,7 +1707,7 @@ function node_page() { } else { drupal_set_title(t('Submit')); - print theme('page', node_preview($edit)); + return node_preview($edit); } break; case 'delete': @@ -1719,11 +1723,11 @@ function node_page() { drupal_set_message(t('The node has been deleted.')); drupal_goto('admin/node'); } - print theme('page', node_delete($edit)); + return node_delete($edit); break; default: drupal_set_title(''); - print theme('page', node_page_default()); + return node_page_default(); } } diff --git a/modules/node/node.module b/modules/node/node.module index 86009f72c09556ab59616f951c8ef336f1e50c71..2066c6e35940e8d72ae26d3eff5a0ad55d15651a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -614,7 +614,7 @@ function node_configure() { $output .= form_select(t('Length of trimmed posts'), 'teaser_length', variable_get('teaser_length', 600), array(0 => t('Unlimited'), 200 => t('200 characters'), 400 => t('400 characters'), 600 => t('600 characters'), 800 => t('800 characters'), 1000 => t('1000 characters'), 1200 => t('1200 characters'), 1400 => t('1400 characters'), 1600 => t('1600 characters'), 1800 => t('1800 characters'), 2000 => t('2000 characters')), t("The maximum number of characters used in the trimmed version of a post. Drupal will use this setting to determine at which offset long posts should be trimmed. The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc. To disable teasers, set to 'Unlimited'. Note that this setting will only affect new or updated content and will not affect existing teasers.")); $output .= form_radios(t('Preview post'), 'node_preview', variable_get('node_preview', 0), array(t('Optional'), t('Required')), t('Must users preview posts before submitting?')); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -958,6 +958,10 @@ function node_types_configure($type = NULL) { // Go to the listing page when we submit this form, system_settings_save() calls drupal_goto(). if ($_POST['op']) { $_GET['q'] = 'admin/node/configure/types'; + $options = 'options_'. $type; + if (empty($node->$options)) { + $node->$options = array(); + } } system_settings_save(); @@ -968,7 +972,7 @@ function node_types_configure($type = NULL) { $output = form_group(t('Submission form'), $group); $output .= form_group(t('Workflow'), implode('', node_invoke_nodeapi($node, 'settings'))); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } else { $header = array(t('Type'), t('Operations')); @@ -978,7 +982,7 @@ function node_types_configure($type = NULL) { $rows[] = array(node_invoke($type, 'node_name'), l(t('configure'), 'admin/node/configure/types/'. $type)); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } } @@ -1111,7 +1115,7 @@ function node_admin() { default: $output = node_admin_nodes(); } - print theme('page', $output); + return $output; } /** @@ -1661,13 +1665,13 @@ function node_page() { node_feed(); return; case 'add': - print theme('page', node_add(arg(2))); + return node_add(arg(2)); break; case 'edit': - print theme('page', node_edit(arg(1))); + return node_edit(arg(1)); break; case 'revisions': - print theme('page', node_revision_overview(arg(1))); + return node_revision_overview(arg(1)); break; case 'rollback-revision': node_revision_rollback(arg(1), arg(3)); @@ -1680,7 +1684,7 @@ function node_page() { $node = node_load(array('nid' => arg(1)), $_GET['revision']); if ($node->nid) { drupal_set_title(check_plain($node->title)); - print theme('page', node_show($node, arg(2))); + return node_show($node, arg(2)); } else { drupal_not_found(); @@ -1690,7 +1694,7 @@ function node_page() { case t('Preview'): $edit = node_validate($edit); drupal_set_title(t('Preview')); - print theme('page', node_preview($edit)); + return node_preview($edit); break; case t('Submit'): if ($nid = node_submit($edit)) { @@ -1703,7 +1707,7 @@ function node_page() { } else { drupal_set_title(t('Submit')); - print theme('page', node_preview($edit)); + return node_preview($edit); } break; case 'delete': @@ -1719,11 +1723,11 @@ function node_page() { drupal_set_message(t('The node has been deleted.')); drupal_goto('admin/node'); } - print theme('page', node_delete($edit)); + return node_delete($edit); break; default: drupal_set_title(''); - print theme('page', node_page_default()); + return node_page_default(); } } diff --git a/modules/path.module b/modules/path.module index ecda91ed2bf3cfb77973aa1a0aa8e1630f74c076..e1e68e14fb3e540e5721e377b8bfc505c68005d1 100644 --- a/modules/path.module +++ b/modules/path.module @@ -95,7 +95,7 @@ function path_menu($may_cache) { * Menu callback; presents an overview of all URL aliases. */ function path_admin() { - print theme('page', path_overview()); + return path_overview(); } /** @@ -114,7 +114,7 @@ function path_admin_edit($pid = 0) { $output = path_form(); } - print theme('page', $output); + return $output; } /** diff --git a/modules/path/path.module b/modules/path/path.module index ecda91ed2bf3cfb77973aa1a0aa8e1630f74c076..e1e68e14fb3e540e5721e377b8bfc505c68005d1 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -95,7 +95,7 @@ function path_menu($may_cache) { * Menu callback; presents an overview of all URL aliases. */ function path_admin() { - print theme('page', path_overview()); + return path_overview(); } /** @@ -114,7 +114,7 @@ function path_admin_edit($pid = 0) { $output = path_form(); } - print theme('page', $output); + return $output; } /** diff --git a/modules/poll.module b/modules/poll.module index d5db9b96a7557bf4f9275ed9ea5dc53d297fccd1..a9139a2b8af7942ca39516a1d00b0affb6d90579 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -274,7 +274,7 @@ function poll_page() { } $output .= '</ul>'; $output .= theme("pager", NULL, 15); - print theme('page', $output); + return $output; } /** @@ -361,7 +361,7 @@ function poll_view_results(&$node, $teaser, $page, $block) { function poll_results() { if ($node = node_load(array('nid' => arg(1)))) { drupal_set_title(check_plain($node->title)); - print theme('page', node_show($node, 0)); + return node_show($node, 0); } else { drupal_not_found(); diff --git a/modules/poll/poll.module b/modules/poll/poll.module index d5db9b96a7557bf4f9275ed9ea5dc53d297fccd1..a9139a2b8af7942ca39516a1d00b0affb6d90579 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -274,7 +274,7 @@ function poll_page() { } $output .= '</ul>'; $output .= theme("pager", NULL, 15); - print theme('page', $output); + return $output; } /** @@ -361,7 +361,7 @@ function poll_view_results(&$node, $teaser, $page, $block) { function poll_results() { if ($node = node_load(array('nid' => arg(1)))) { drupal_set_title(check_plain($node->title)); - print theme('page', node_show($node, 0)); + return node_show($node, 0); } else { drupal_not_found(); diff --git a/modules/profile.module b/modules/profile.module index 1dde9a5acf9ab92ba19ada5fd715c8ff0200c538..91a5896f593b6211ba7bb34722145146a509d565 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -177,7 +177,7 @@ function profile_browse() { $output .= '</div>'; drupal_set_title($title); - print theme('page', $output); + return $output; } else if ($name && !$field->id) { drupal_not_found(); @@ -201,7 +201,7 @@ function profile_browse() { $output .= theme('pager', NULL, 20); drupal_set_title(t('user list')); - print theme('page', $output); + return $output; } } @@ -523,7 +523,7 @@ function profile_admin_add($type) { } drupal_set_title(t('Add new %type', array('%type' => _profile_field_types($type)))); - print theme('page', _profile_field_form($type, $data)); + return _profile_field_form($type, $data); } /** @@ -551,7 +551,7 @@ function profile_admin_edit($fid) { } drupal_set_title(t('Edit %type', array('%type' => $data['type']))); - print theme('page', _profile_field_form($data['type'], $data)); + return _profile_field_form($data['type'], $data); } /** @@ -617,7 +617,7 @@ function profile_admin_overview() { } $output .= '</ul>'; - print theme('page', $output); + return $output; } function theme_profile_block($user, $fields = array()) { diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 1dde9a5acf9ab92ba19ada5fd715c8ff0200c538..91a5896f593b6211ba7bb34722145146a509d565 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -177,7 +177,7 @@ function profile_browse() { $output .= '</div>'; drupal_set_title($title); - print theme('page', $output); + return $output; } else if ($name && !$field->id) { drupal_not_found(); @@ -201,7 +201,7 @@ function profile_browse() { $output .= theme('pager', NULL, 20); drupal_set_title(t('user list')); - print theme('page', $output); + return $output; } } @@ -523,7 +523,7 @@ function profile_admin_add($type) { } drupal_set_title(t('Add new %type', array('%type' => _profile_field_types($type)))); - print theme('page', _profile_field_form($type, $data)); + return _profile_field_form($type, $data); } /** @@ -551,7 +551,7 @@ function profile_admin_edit($fid) { } drupal_set_title(t('Edit %type', array('%type' => $data['type']))); - print theme('page', _profile_field_form($data['type'], $data)); + return _profile_field_form($data['type'], $data); } /** @@ -617,7 +617,7 @@ function profile_admin_overview() { } $output .= '</ul>'; - print theme('page', $output); + return $output; } function theme_profile_block($user, $fields = array()) { diff --git a/modules/search.module b/modules/search.module index 6a43604d88b5b522859bb7638cf996f167ba17fe..bf5eaa88011ae693db4ef25d259d374f5adc589b 100644 --- a/modules/search.module +++ b/modules/search.module @@ -162,7 +162,7 @@ function search_admin() { $group .= form_textfield(t('Minimum word length to search for'), 'remove_short', variable_get('remove_short', 3), 3, 3, t('The number of characters a word has to be to be searched for, including wildcard characters.')); $output .= form_group(t('Indexing settings'), $group); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -598,7 +598,7 @@ function search_view() { $output .= $results; - print theme('page', $output); + return $output; } else { drupal_access_denied(); diff --git a/modules/search/search.module b/modules/search/search.module index 6a43604d88b5b522859bb7638cf996f167ba17fe..bf5eaa88011ae693db4ef25d259d374f5adc589b 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -162,7 +162,7 @@ function search_admin() { $group .= form_textfield(t('Minimum word length to search for'), 'remove_short', variable_get('remove_short', 3), 3, 3, t('The number of characters a word has to be to be searched for, including wildcard characters.')); $output .= form_group(t('Indexing settings'), $group); - print theme('page', system_settings_form($output)); + return system_settings_form($output); } /** @@ -598,7 +598,7 @@ function search_view() { $output .= $results; - print theme('page', $output); + return $output; } else { drupal_access_denied(); diff --git a/modules/statistics.module b/modules/statistics.module index 27fd98e408d911aae3f17c506feb165b33dc6e8a..6161b6cb91bfe1e3d751b42b8ff7c782e293315f 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -154,7 +154,7 @@ function statistics_access_log($aid) { $output .= ' <tr><th>'. t('User') .'</th><td>'. format_name($access) .'</td></tr>'; $output .= ' <tr><th>'. t('Hostname') ."</th><td>$access->hostname</td></tr>"; $output .= '</table>'; - print theme('page', $output); + return $output; } else { drupal_not_found(); @@ -184,7 +184,7 @@ function statistics_node_tracker() { } drupal_set_title(check_plain($node->title)); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } else { drupal_not_found(); @@ -212,7 +212,7 @@ function statistics_user_tracker() { } drupal_set_title($account->name); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } else { drupal_not_found(); @@ -245,7 +245,7 @@ function statistics_recent_hits($type = 'all', $id = 0) { $rows[] = array(array('data' => $pager, 'colspan' => '4')); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -270,7 +270,7 @@ function statistics_top_pages() { } drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200))))); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -296,7 +296,7 @@ function statistics_top_users() { } drupal_set_title(t('Top users in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200))))); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -323,7 +323,7 @@ function statistics_top_referrers() { $rows[] = array(array('data' => $pager, 'colspan' => '3')); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 27fd98e408d911aae3f17c506feb165b33dc6e8a..6161b6cb91bfe1e3d751b42b8ff7c782e293315f 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -154,7 +154,7 @@ function statistics_access_log($aid) { $output .= ' <tr><th>'. t('User') .'</th><td>'. format_name($access) .'</td></tr>'; $output .= ' <tr><th>'. t('Hostname') ."</th><td>$access->hostname</td></tr>"; $output .= '</table>'; - print theme('page', $output); + return $output; } else { drupal_not_found(); @@ -184,7 +184,7 @@ function statistics_node_tracker() { } drupal_set_title(check_plain($node->title)); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } else { drupal_not_found(); @@ -212,7 +212,7 @@ function statistics_user_tracker() { } drupal_set_title($account->name); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } else { drupal_not_found(); @@ -245,7 +245,7 @@ function statistics_recent_hits($type = 'all', $id = 0) { $rows[] = array(array('data' => $pager, 'colspan' => '4')); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -270,7 +270,7 @@ function statistics_top_pages() { } drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200))))); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -296,7 +296,7 @@ function statistics_top_users() { } drupal_set_title(t('Top users in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200))))); - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** @@ -323,7 +323,7 @@ function statistics_top_referrers() { $rows[] = array(array('data' => $pager, 'colspan' => '3')); } - print theme('page', theme('table', $header, $rows)); + return theme('table', $header, $rows); } /** diff --git a/modules/system.module b/modules/system.module index a5d4133a470fa84afbef6973f035457622fab63d..59f542491e5cb5875c150a71f41da6bc6c67e89d 100644 --- a/modules/system.module +++ b/modules/system.module @@ -70,7 +70,7 @@ function system_menu($may_cache) { $items[] = array('path' => 'admin', 'title' => t('administer'), 'access' => user_access('access administration pages'), - 'callback' => 'system_admin_page', + 'callback' => 'watchdog_overview', 'weight' => 9); // Themes: @@ -119,13 +119,6 @@ function system_test() { exit; } -/** - * Menu callback; provides the main page of the administration section. - */ -function system_admin_page() { - watchdog_overview('actions'); -} - /** * Implementation of hook_user(). * @@ -574,7 +567,7 @@ function system_themes() { system_listing_save(); $form = system_theme_listing(); $form .= form_submit(t('Save configuration')); - print theme('page', form($form)); + return form($form); } /** @@ -584,7 +577,7 @@ function system_modules() { system_listing_save(); $form = system_module_listing(); $form .= form_submit(t('Save configuration')); - print theme('page', form($form)); + return form($form); } /** @@ -600,7 +593,7 @@ function system_site_settings($module = NULL) { $form = system_view_general(); } - print theme('page', system_settings_form($form)); + return system_settings_form($form); } /** @@ -711,7 +704,7 @@ function system_theme_settings($key = '') { $form .= form_submit(t('Save configuration')); $form .= form_submit(t('Reset to defaults')); - print theme('page', form($form, 'post', null, array('enctype' => 'multipart/form-data'))); + return form($form, 'post', null, array('enctype' => 'multipart/form-data')); } diff --git a/modules/system/system.module b/modules/system/system.module index a5d4133a470fa84afbef6973f035457622fab63d..59f542491e5cb5875c150a71f41da6bc6c67e89d 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -70,7 +70,7 @@ function system_menu($may_cache) { $items[] = array('path' => 'admin', 'title' => t('administer'), 'access' => user_access('access administration pages'), - 'callback' => 'system_admin_page', + 'callback' => 'watchdog_overview', 'weight' => 9); // Themes: @@ -119,13 +119,6 @@ function system_test() { exit; } -/** - * Menu callback; provides the main page of the administration section. - */ -function system_admin_page() { - watchdog_overview('actions'); -} - /** * Implementation of hook_user(). * @@ -574,7 +567,7 @@ function system_themes() { system_listing_save(); $form = system_theme_listing(); $form .= form_submit(t('Save configuration')); - print theme('page', form($form)); + return form($form); } /** @@ -584,7 +577,7 @@ function system_modules() { system_listing_save(); $form = system_module_listing(); $form .= form_submit(t('Save configuration')); - print theme('page', form($form)); + return form($form); } /** @@ -600,7 +593,7 @@ function system_site_settings($module = NULL) { $form = system_view_general(); } - print theme('page', system_settings_form($form)); + return system_settings_form($form); } /** @@ -711,7 +704,7 @@ function system_theme_settings($key = '') { $form .= form_submit(t('Save configuration')); $form .= form_submit(t('Reset to defaults')); - print theme('page', form($form, 'post', null, array('enctype' => 'multipart/form-data'))); + return form($form, 'post', null, array('enctype' => 'multipart/form-data')); } diff --git a/modules/taxonomy.module b/modules/taxonomy.module index e4c9cac09def171cafb060ea642d36c1c8140368..d72be2b6ff3d1525f9960a4ab488b0dd9bbf17ff 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -1080,7 +1080,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $operator, $depth, TRUE)); $output .= theme('xml_icon', url("taxonomy/term/$rss_tids/$depth/feed")); - print theme('page', $output); + return $output; break; case 'feed': @@ -1118,8 +1118,7 @@ function taxonomy_admin() { if (is_numeric(arg(2)) && arg(3) == 'add' && arg(4) == 'term') { if ($op != t('Submit')) { $output = taxonomy_form_term(array('vid' => arg(2))); - print theme('page', $output); - return; + return $output; } else { taxonomy_save_term($edit); @@ -1170,7 +1169,7 @@ function taxonomy_admin() { $output = taxonomy_overview(); } - print theme('page', $output); + return $output; } /** diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index e4c9cac09def171cafb060ea642d36c1c8140368..d72be2b6ff3d1525f9960a4ab488b0dd9bbf17ff 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1080,7 +1080,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $operator, $depth, TRUE)); $output .= theme('xml_icon', url("taxonomy/term/$rss_tids/$depth/feed")); - print theme('page', $output); + return $output; break; case 'feed': @@ -1118,8 +1118,7 @@ function taxonomy_admin() { if (is_numeric(arg(2)) && arg(3) == 'add' && arg(4) == 'term') { if ($op != t('Submit')) { $output = taxonomy_form_term(array('vid' => arg(2))); - print theme('page', $output); - return; + return $output; } else { taxonomy_save_term($edit); @@ -1170,7 +1169,7 @@ function taxonomy_admin() { $output = taxonomy_overview(); } - print theme('page', $output); + return $output; } /** diff --git a/modules/tracker.module b/modules/tracker.module index 951dbba4201e7c2698beb8e76df9c33e7759f1c4..a1b18530de29fbcb9cf974109628e61240c19052 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -118,7 +118,7 @@ function tracker_page($uid = 0) { $output .= theme('table', $header, $rows); $output .= '</div>'; - print theme('page', $output); + return $output; } ?> diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 951dbba4201e7c2698beb8e76df9c33e7759f1c4..a1b18530de29fbcb9cf974109628e61240c19052 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -118,7 +118,7 @@ function tracker_page($uid = 0) { $output .= theme('table', $header, $rows); $output .= '</div>'; - print theme('page', $output); + return $output; } ?> diff --git a/modules/upload.module b/modules/upload.module index 5a91504065d9ca3fbaff66ec2b895e546ca024d9..071f91aa92762305888ae1c52626d6aaef19203f 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -97,7 +97,7 @@ function upload_admin() { $output .= form_group(t('Settings for %role', array('%role' => "<em>$role</em>")), $group); } - print theme('page', system_settings_form($output)); + return system_settings_form($output); } function upload_download() { diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 5a91504065d9ca3fbaff66ec2b895e546ca024d9..071f91aa92762305888ae1c52626d6aaef19203f 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -97,7 +97,7 @@ function upload_admin() { $output .= form_group(t('Settings for %role', array('%role' => "<em>$role</em>")), $group); } - print theme('page', system_settings_form($output)); + return system_settings_form($output); } function upload_download() { diff --git a/modules/user.module b/modules/user.module index 329715990b3a0a73fe981ab285ea9642534b481e..f707b5d76b57e57a1c7ac686e6ab16f290d8517b 100644 --- a/modules/user.module +++ b/modules/user.module @@ -951,7 +951,7 @@ function user_pass() { $output .= form_textfield(t('Username'), 'name', $edit['name'], 30, 64); $output .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 64); $output .= form_submit(t('E-mail new password')); - print theme('page', form($output)); + return form($output); } } @@ -1207,8 +1207,7 @@ function user_edit($category = 'account') { 'user/'. $account->uid, t('Deleting a user will remove all their submissions as well. This action cannot be undone.'), t('Delete')); - print theme('page', $output); - return; + return $output; } } else if ($_POST['op'] == t('Delete')) { @@ -1224,7 +1223,7 @@ function user_edit($category = 'account') { $output = form($output, 'post', 0, array('enctype' => 'multipart/form-data')); drupal_set_title($account->name); - print theme('page', $output); + return $output; } function user_view($uid = 0) { @@ -1242,7 +1241,7 @@ function user_view($uid = 0) { } drupal_set_title($account->name); - print theme('page', theme('user_profile', $account, $fields)); + return theme('user_profile', $account, $fields); } else { drupal_not_found(); @@ -1262,11 +1261,11 @@ function user_page() { switch ($op) { case t('Create new account'): case 'register': - print theme('page', user_register($edit)); + return user_register($edit); break; case t('Log in'): case 'login': - print theme('page', user_login($edit)); + return user_login($edit); break; default: if (!arg(1)) { @@ -1274,7 +1273,7 @@ function user_page() { drupal_goto('user/'. $user->uid); } else { - print theme('page', user_login($edit)); + return user_login($edit); } } else { @@ -1397,7 +1396,7 @@ function user_admin_access_check() { $form .= form_submit('Check e-mail'); $output .= form($form); - print theme('page', $output); + return $output; } /** @@ -1419,7 +1418,7 @@ function user_admin_access_add() { $form = _user_admin_access_form($edit); $form .= form_submit(t('Add rule')); - print theme('page', form($form, 'post', NULL, array('id' => 'access-rules'))); + return form($form, 'post', NULL, array('id' => 'access-rules')); } /** @@ -1442,7 +1441,7 @@ function user_admin_access_delete($aid = 0) { t('Delete'), t('Cancel'), $extra); - print theme('page', $output); + return $output; } } @@ -1465,7 +1464,7 @@ function user_admin_access_edit($aid = 0) { } $form = _user_admin_access_form($edit); $form .= form_submit(t('Save rule')); - print theme('page', form($form, 'post', NULL, array('id' => 'access-rules'))); + return form($form, 'post', NULL, array('id' => 'access-rules')); } function _user_admin_access_form($edit) { @@ -1492,7 +1491,7 @@ function user_admin_access() { } $output .= theme('table', $header, $rows); - print theme('page', $output); + return $output; } function user_roles($membersonly = 0, $permission = 0) { @@ -1577,7 +1576,7 @@ function user_admin_perm() { $output = theme('table', $header, $rows, array('id' => 'permissions')); $output .= form_submit(t('Save permissions')); - print theme('page', form($output)); + return form($output); } /** @@ -1659,7 +1658,7 @@ function user_admin_role() { $output = form($output); } - print theme('page', $output); + return $output; } function user_admin_account() { @@ -1709,7 +1708,7 @@ function user_configure() { } $output = system_settings_form(user_configure_settings()); - print theme('page', $output); + return $output; } function user_admin() { @@ -1732,7 +1731,7 @@ function user_admin() { default: $output = user_admin_account(); } - print theme('page', $output); + return $output; } /** @@ -1812,7 +1811,7 @@ function user_help($section) { * Menu callback; Prints user-specific help information. */ function user_help_page() { - print theme('page', user_help('user/help#user')); + return user_help('user/help#user'); } /** diff --git a/modules/user/user.module b/modules/user/user.module index 329715990b3a0a73fe981ab285ea9642534b481e..f707b5d76b57e57a1c7ac686e6ab16f290d8517b 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -951,7 +951,7 @@ function user_pass() { $output .= form_textfield(t('Username'), 'name', $edit['name'], 30, 64); $output .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 64); $output .= form_submit(t('E-mail new password')); - print theme('page', form($output)); + return form($output); } } @@ -1207,8 +1207,7 @@ function user_edit($category = 'account') { 'user/'. $account->uid, t('Deleting a user will remove all their submissions as well. This action cannot be undone.'), t('Delete')); - print theme('page', $output); - return; + return $output; } } else if ($_POST['op'] == t('Delete')) { @@ -1224,7 +1223,7 @@ function user_edit($category = 'account') { $output = form($output, 'post', 0, array('enctype' => 'multipart/form-data')); drupal_set_title($account->name); - print theme('page', $output); + return $output; } function user_view($uid = 0) { @@ -1242,7 +1241,7 @@ function user_view($uid = 0) { } drupal_set_title($account->name); - print theme('page', theme('user_profile', $account, $fields)); + return theme('user_profile', $account, $fields); } else { drupal_not_found(); @@ -1262,11 +1261,11 @@ function user_page() { switch ($op) { case t('Create new account'): case 'register': - print theme('page', user_register($edit)); + return user_register($edit); break; case t('Log in'): case 'login': - print theme('page', user_login($edit)); + return user_login($edit); break; default: if (!arg(1)) { @@ -1274,7 +1273,7 @@ function user_page() { drupal_goto('user/'. $user->uid); } else { - print theme('page', user_login($edit)); + return user_login($edit); } } else { @@ -1397,7 +1396,7 @@ function user_admin_access_check() { $form .= form_submit('Check e-mail'); $output .= form($form); - print theme('page', $output); + return $output; } /** @@ -1419,7 +1418,7 @@ function user_admin_access_add() { $form = _user_admin_access_form($edit); $form .= form_submit(t('Add rule')); - print theme('page', form($form, 'post', NULL, array('id' => 'access-rules'))); + return form($form, 'post', NULL, array('id' => 'access-rules')); } /** @@ -1442,7 +1441,7 @@ function user_admin_access_delete($aid = 0) { t('Delete'), t('Cancel'), $extra); - print theme('page', $output); + return $output; } } @@ -1465,7 +1464,7 @@ function user_admin_access_edit($aid = 0) { } $form = _user_admin_access_form($edit); $form .= form_submit(t('Save rule')); - print theme('page', form($form, 'post', NULL, array('id' => 'access-rules'))); + return form($form, 'post', NULL, array('id' => 'access-rules')); } function _user_admin_access_form($edit) { @@ -1492,7 +1491,7 @@ function user_admin_access() { } $output .= theme('table', $header, $rows); - print theme('page', $output); + return $output; } function user_roles($membersonly = 0, $permission = 0) { @@ -1577,7 +1576,7 @@ function user_admin_perm() { $output = theme('table', $header, $rows, array('id' => 'permissions')); $output .= form_submit(t('Save permissions')); - print theme('page', form($output)); + return form($output); } /** @@ -1659,7 +1658,7 @@ function user_admin_role() { $output = form($output); } - print theme('page', $output); + return $output; } function user_admin_account() { @@ -1709,7 +1708,7 @@ function user_configure() { } $output = system_settings_form(user_configure_settings()); - print theme('page', $output); + return $output; } function user_admin() { @@ -1732,7 +1731,7 @@ function user_admin() { default: $output = user_admin_account(); } - print theme('page', $output); + return $output; } /** @@ -1812,7 +1811,7 @@ function user_help($section) { * Menu callback; Prints user-specific help information. */ function user_help_page() { - print theme('page', user_help('user/help#user')); + return user_help('user/help#user'); } /** diff --git a/modules/watchdog.module b/modules/watchdog.module index c998c91a43304434603c3b741dde18b902128960..64a580fef02b152ac1fbafe05366b4d9e223d596 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -125,7 +125,7 @@ function watchdog_overview() { $output = '<div class="container-inline">'. form($form) .'</div>'; $output .= theme('table', $header, $rows); - print theme('page', $output); + return $output; } /** @@ -146,7 +146,7 @@ function watchdog_event($id) { $output .= ' <tr><th>'. t('Hostname') ."</th><td>$watchdog->hostname</td></tr>"; $output .= '</table>'; } - print theme('page', $output); + return $output; } function _watchdog_get_message_types() { diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index c998c91a43304434603c3b741dde18b902128960..64a580fef02b152ac1fbafe05366b4d9e223d596 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -125,7 +125,7 @@ function watchdog_overview() { $output = '<div class="container-inline">'. form($form) .'</div>'; $output .= theme('table', $header, $rows); - print theme('page', $output); + return $output; } /** @@ -146,7 +146,7 @@ function watchdog_event($id) { $output .= ' <tr><th>'. t('Hostname') ."</th><td>$watchdog->hostname</td></tr>"; $output .= '</table>'; } - print theme('page', $output); + return $output; } function _watchdog_get_message_types() {