diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-24 00:10:46 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-24 00:10:46 +0000 |
commit | e63e85020b6846c35624f04c60b40f1aa11db3b1 (patch) | |
tree | 908a1151a45ce37ae82dce00fffedb26b33ccde0 /modules | |
parent | 4ae238ea577ed0140df6fd034b06bfd7b0f0cdb4 (diff) | |
download | brdo-e63e85020b6846c35624f04c60b40f1aa11db3b1.tar.gz brdo-e63e85020b6846c35624f04c60b40f1aa11db3b1.tar.bz2 |
Of all the patches to accidentally commit without a message. :( Rolling back registry rip. Let's try that again.
Diffstat (limited to 'modules')
53 files changed, 218 insertions, 476 deletions
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc index c425c6d3c..b6361aba6 100644 --- a/modules/aggregator/aggregator.admin.inc +++ b/modules/aggregator/aggregator.admin.inc @@ -391,6 +391,7 @@ function aggregator_admin_refresh_feed($feed) { * @ingroup forms */ function aggregator_admin_form($form_state) { + // Make sure configuration is sane. aggregator_sanitize_configuration(); diff --git a/modules/aggregator/aggregator.fetcher.inc b/modules/aggregator/aggregator.fetcher.inc index 8798796b7..fcad26578 100644 --- a/modules/aggregator/aggregator.fetcher.inc +++ b/modules/aggregator/aggregator.fetcher.inc @@ -34,6 +34,7 @@ function aggregator_aggregator_fetch($feed) { // Request feed. $result = drupal_http_request($feed->url, array('headers' => $headers)); + // Process HTTP response code. switch ($result->code) { case 304: diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 89664ceec..a95c64bed 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -91,7 +91,6 @@ function aggregator_menu() { 'description' => "Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized.", 'page callback' => 'aggregator_admin_overview', 'access arguments' => array('administer news feeds'), - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/add/feed'] = array( 'title' => 'Add feed', @@ -100,7 +99,6 @@ function aggregator_menu() { 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_ACTION, 'parent' => 'admin/settings/aggregator', - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/add/category'] = array( 'title' => 'Add category', @@ -109,7 +107,6 @@ function aggregator_menu() { 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_ACTION, 'parent' => 'admin/settings/aggregator', - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/add/opml'] = array( 'title' => 'Import OPML', @@ -118,7 +115,6 @@ function aggregator_menu() { 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_ACTION, 'parent' => 'admin/settings/aggregator', - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/remove/%aggregator_feed'] = array( 'title' => 'Remove items', @@ -126,7 +122,6 @@ function aggregator_menu() { 'page arguments' => array('aggregator_admin_remove_feed', 4), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/update/%aggregator_feed'] = array( 'title' => 'Update items', @@ -134,7 +129,6 @@ function aggregator_menu() { 'page arguments' => array(4), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/list'] = array( 'title' => 'List', @@ -147,40 +141,34 @@ function aggregator_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('aggregator_admin_form'), 'access arguments' => array('administer news feeds'), - 'file' => 'aggregator.admin.inc', ); $items['aggregator'] = array( 'title' => 'Feed aggregator', 'page callback' => 'aggregator_page_last', 'access arguments' => array('access news feeds'), 'weight' => 5, - 'file' => 'aggregator.pages.inc', ); $items['aggregator/sources'] = array( 'title' => 'Sources', 'page callback' => 'aggregator_page_sources', 'access arguments' => array('access news feeds'), - 'file' => 'aggregator.pages.inc', ); $items['aggregator/categories'] = array( 'title' => 'Categories', 'page callback' => 'aggregator_page_categories', 'access callback' => '_aggregator_has_categories', - 'file' => 'aggregator.pages.inc', ); $items['aggregator/rss'] = array( 'title' => 'RSS feed', 'page callback' => 'aggregator_page_rss', 'access arguments' => array('access news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.pages.inc', ); $items['aggregator/opml'] = array( 'title' => 'OPML feed', 'page callback' => 'aggregator_page_opml', 'access arguments' => array('access news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.pages.inc', ); $items['aggregator/categories/%aggregator_category'] = array( 'title callback' => '_aggregator_category_title', @@ -189,7 +177,6 @@ function aggregator_menu() { 'page arguments' => array(2), 'access callback' => 'user_access', 'access arguments' => array('access news feeds'), - 'file' => 'aggregator.pages.inc', ); $items['aggregator/categories/%aggregator_category/view'] = array( 'title' => 'View', @@ -202,7 +189,6 @@ function aggregator_menu() { 'page arguments' => array('aggregator_page_category', 2), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, - 'file' => 'aggregator.pages.inc', ); $items['aggregator/categories/%aggregator_category/configure'] = array( 'title' => 'Configure', @@ -211,14 +197,12 @@ function aggregator_menu() { 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, - 'file' => 'aggregator.admin.inc', ); $items['aggregator/sources/%aggregator_feed'] = array( 'page callback' => 'aggregator_page_source', 'page arguments' => array(2), 'access arguments' => array('access news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.pages.inc', ); $items['aggregator/sources/%aggregator_feed/view'] = array( 'title' => 'View', @@ -231,7 +215,6 @@ function aggregator_menu() { 'page arguments' => array('aggregator_page_source', 2), 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, - 'file' => 'aggregator.pages.inc', ); $items['aggregator/sources/%aggregator_feed/configure'] = array( 'title' => 'Configure', @@ -240,7 +223,6 @@ function aggregator_menu() { 'access arguments' => array('administer news feeds'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/edit/feed/%aggregator_feed'] = array( 'title' => 'Edit feed', @@ -248,7 +230,6 @@ function aggregator_menu() { 'page arguments' => array('aggregator_form_feed', 5), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.admin.inc', ); $items['admin/settings/aggregator/edit/category/%aggregator_category'] = array( 'title' => 'Edit category', @@ -256,7 +237,6 @@ function aggregator_menu() { 'page arguments' => array('aggregator_form_category', 5), 'access arguments' => array('administer news feeds'), 'type' => MENU_CALLBACK, - 'file' => 'aggregator.admin.inc', ); return $items; @@ -534,7 +514,6 @@ function aggregator_save_feed($edit) { * An object describing the feed to be cleared. */ function aggregator_remove($feed) { - _aggregator_get_variables(); // Call hook_aggregator_remove() on all modules. module_invoke_all('aggregator_remove', $feed); // Reset feed. @@ -551,23 +530,6 @@ function aggregator_remove($feed) { ->execute(); } -function _aggregator_get_variables() { - // Fetch the feed. - $fetcher = variable_get('aggregator_fetcher', 'aggregator'); - if ($fetcher == 'aggregator') { - include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/aggregator.fetcher.inc'; - } - $parser = variable_get('aggregator_parser', 'aggregator'); - if ($parser == 'aggregator') { - include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/aggregator.parser.inc'; - } - $processors = variable_get('aggregator_processors', array('aggregator')); - if (in_array('aggregator', $processors)) { - include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/aggregator.processor.inc'; - } - return array($fetcher, $parser, $processors); -} - /** * Checks a news feed for new items. * @@ -575,22 +537,25 @@ function _aggregator_get_variables() { * An object describing the feed to be refreshed. */ function aggregator_refresh($feed) { - list($fetcher, $parser, $processors) = _aggregator_get_variables(); + // Fetch the feed. + $fetcher = variable_get('aggregator_fetcher', 'aggregator'); module_invoke($fetcher, 'aggregator_fetch', $feed); if ($feed->source_string !== FALSE) { // Parse the feed. + $parser = variable_get('aggregator_parser', 'aggregator'); module_invoke($parser, 'aggregator_parse', $feed); // If there are items on the feed, let all enabled processors do their work on it. if (@count($feed->items)) { + $processors = variable_get('aggregator_processors', array('aggregator')); foreach ($processors as $processor) { module_invoke($processor, 'aggregator_process', $feed); } } } // Expire old feed items. - if (function_exists('aggregator_expire')) { + if (drupal_function_exists('aggregator_expire')) { aggregator_expire($feed); } } @@ -670,13 +635,15 @@ function aggregator_filter_xss($value) { */ function aggregator_sanitize_configuration() { $reset = FALSE; - list($fetcher, $parser, $processors) = _aggregator_get_variables(); + $fetcher = variable_get('aggregator_fetcher', 'aggregator'); if (!module_exists($fetcher)) { $reset = TRUE; } + $parser = variable_get('aggregator_parser', 'aggregator'); if (!module_exists($parser)) { $reset = TRUE; } + $processors = variable_get('aggregator_processors', array('aggregator')); foreach ($processors as $processor) { if (!module_exists($processor)) { $reset = TRUE; diff --git a/modules/block/block.module b/modules/block/block.module index 6227927cd..67119f072 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -125,7 +125,6 @@ function block_menu() { 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', 'page callback' => 'block_admin_display', 'access arguments' => array('administer blocks'), - 'file' => 'block.admin.inc', ); $items['admin/structure/block/list'] = array( 'title' => 'List', @@ -137,7 +136,6 @@ function block_menu() { 'page callback' => 'block_admin_display_js', 'access arguments' => array('administer blocks'), 'type' => MENU_CALLBACK, - 'file' => 'block.admin.inc', ); $items['admin/structure/block/configure'] = array( 'title' => 'Configure block', @@ -145,7 +143,6 @@ function block_menu() { 'page arguments' => array('block_admin_configure'), 'access arguments' => array('administer blocks'), 'type' => MENU_CALLBACK, - 'file' => 'block.admin.inc', ); $items['admin/structure/block/delete'] = array( 'title' => 'Delete block', @@ -153,7 +150,6 @@ function block_menu() { 'page arguments' => array('block_box_delete'), 'access arguments' => array('administer blocks'), 'type' => MENU_CALLBACK, - 'file' => 'block.admin.inc', ); $items['admin/structure/block/add'] = array( 'title' => 'Add block', @@ -161,7 +157,6 @@ function block_menu() { 'page arguments' => array('block_add_block_form'), 'access arguments' => array('administer blocks'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'block.admin.inc', ); $default = variable_get('theme_default', 'garland'); foreach (list_themes() as $key => $theme) { @@ -172,7 +167,6 @@ function block_menu() { 'weight' => $key == $default ? -10 : 0, 'access callback' => '_block_themes_access', 'access arguments' => array($theme), - 'file' => 'block.admin.inc', ); } return $items; diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 735678832..1c43261a1 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -94,7 +94,6 @@ function blog_menu() { 'page callback' => 'blog_page_last', 'access arguments' => array('access content'), 'type' => MENU_SUGGESTED_ITEM, - 'file' => 'blog.pages.inc', ); $items['blog/%user_uid_optional'] = array( 'title' => 'My blog', @@ -102,7 +101,6 @@ function blog_menu() { 'page arguments' => array(1), 'access callback' => 'blog_page_user_access', 'access arguments' => array(1), - 'file' => 'blog.pages.inc', ); $items['blog/%user/feed'] = array( 'title' => 'Blogs', @@ -111,14 +109,12 @@ function blog_menu() { 'access callback' => 'blog_page_user_access', 'access arguments' => array(1), 'type' => MENU_CALLBACK, - 'file' => 'blog.pages.inc', ); $items['blog/feed'] = array( 'title' => 'Blogs', 'page callback' => 'blog_feed_last', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, - 'file' => 'blog.pages.inc', ); return $items; diff --git a/modules/blogapi/blogapi.test b/modules/blogapi/blogapi.test index 18a72f218..9a57be643 100644 --- a/modules/blogapi/blogapi.test +++ b/modules/blogapi/blogapi.test @@ -12,6 +12,9 @@ class BlogAPITestCase extends DrupalWebTestCase { function setUp() { parent::setUp('blog', 'blogapi', 'taxonomy'); + + // Force loading the xmlrpc.inc to have the xmlrpc() function. + drupal_function_exists('xmlrpc'); } /** diff --git a/modules/book/book.module b/modules/book/book.module index fa433fd4c..4e5ac9597 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -105,7 +105,6 @@ function book_menu() { 'page callback' => 'book_admin_overview', 'access arguments' => array('administer book outlines'), 'type' => MENU_LOCAL_TASK, - 'file' => 'book.admin.inc', ); $items['admin/content/book/list'] = array( 'title' => 'List', @@ -118,7 +117,6 @@ function book_menu() { 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, 'weight' => 8, - 'file' => 'book.admin.inc', ); $items['admin/content/book/%node'] = array( 'title' => 'Re-order book pages and change titles', @@ -127,21 +125,18 @@ function book_menu() { 'access callback' => '_book_outline_access', 'access arguments' => array(3), 'type' => MENU_CALLBACK, - 'file' => 'book.admin.inc', ); $items['book'] = array( 'title' => 'Books', 'page callback' => 'book_render', 'access arguments' => array('access content'), 'type' => MENU_SUGGESTED_ITEM, - 'file' => 'book.pages.inc', ); $items['book/export/%/%'] = array( 'page callback' => 'book_export', 'page arguments' => array(2, 3), 'access arguments' => array('access printer-friendly version'), 'type' => MENU_CALLBACK, - 'file' => 'book.pages.inc', ); $items['node/%node/outline'] = array( 'title' => 'Outline', @@ -151,7 +146,6 @@ function book_menu() { 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'book.pages.inc', ); $items['node/%node/outline/remove'] = array( 'title' => 'Remove from outline', @@ -160,13 +154,11 @@ function book_menu() { 'access callback' => '_book_outline_remove_access', 'access arguments' => array(1), 'type' => MENU_CALLBACK, - 'file' => 'book.pages.inc', ); $items['book/js/form'] = array( 'page callback' => 'book_form_update', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, - 'file' => 'book.pages.inc', ); return $items; diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 010c84742..41c621945 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -133,7 +133,6 @@ function comment_menu() { 'page callback' => 'comment_admin', 'access arguments' => array('administer comments'), 'type' => MENU_LOCAL_TASK, - 'file' => 'comment.admin.inc', ); // Tabs begin here. $items['admin/content/comment/new'] = array( @@ -152,7 +151,6 @@ function comment_menu() { 'page callback' => 'comment_delete_page', 'access arguments' => array('administer comments'), 'type' => MENU_CALLBACK, - 'file' => 'comment.admin.inc', ); $items['comment/edit/%comment'] = array( 'title' => 'Edit comment', @@ -169,7 +167,6 @@ function comment_menu() { 'access callback' => 'node_access', 'access arguments' => array('view', 2), 'type' => MENU_CALLBACK, - 'file' => 'comment.pages.inc', ); $items['comment/approve'] = array( 'title' => 'Approve a comment', @@ -177,7 +174,6 @@ function comment_menu() { 'page arguments' => array(2), 'access arguments' => array('administer comments'), 'type' => MENU_CALLBACK, - 'file' => 'comment.pages.inc', ); $items['comment/%comment'] = array( 'title' => 'Comment permalink', diff --git a/modules/contact/contact.module b/modules/contact/contact.module index a0e6eab75..0274940fa 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -57,13 +57,11 @@ function contact_menu() { 'description' => 'Create a system contact form and set up categories for the form to use.', 'page callback' => 'contact_admin_categories', 'access arguments' => array('administer site-wide contact form'), - 'file' => 'contact.admin.inc', ); $items['admin/structure/contact/list'] = array( 'title' => 'List', 'page callback' => 'contact_admin_categories', 'type' => MENU_DEFAULT_LOCAL_TASK, - 'file' => 'contact.admin.inc', ); $items['admin/structure/contact/add'] = array( 'title' => 'Add category', @@ -72,7 +70,6 @@ function contact_menu() { 'access arguments' => array('administer site-wide contact form'), 'type' => MENU_LOCAL_ACTION, 'weight' => 1, - 'file' => 'contact.admin.inc', ); $items['admin/structure/contact/edit/%contact'] = array( 'title' => 'Edit contact category', @@ -80,7 +77,6 @@ function contact_menu() { 'page arguments' => array('contact_admin_edit', 3, 4), 'access arguments' => array('administer site-wide contact form'), 'type' => MENU_CALLBACK, - 'file' => 'contact.admin.inc', ); $items['admin/structure/contact/delete/%contact'] = array( 'title' => 'Delete contact', @@ -88,7 +84,6 @@ function contact_menu() { 'page arguments' => array('contact_admin_delete', 4), 'access arguments' => array('administer site-wide contact form'), 'type' => MENU_CALLBACK, - 'file' => 'contact.admin.inc', ); $items['admin/settings/contact'] = array( 'title' => 'Contact form', @@ -96,14 +91,12 @@ function contact_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('contact_admin_settings'), 'access arguments' => array('administer site-wide contact form'), - 'file' => 'contact.admin.inc', ); $items['contact'] = array( 'title' => 'Contact', 'page callback' => 'contact_site_page', 'access arguments' => array('access site-wide contact form'), 'type' => MENU_SUGGESTED_ITEM, - 'file' => 'contact.pages.inc', ); $items['user/%user/contact'] = array( 'title' => 'Contact', @@ -113,7 +106,6 @@ function contact_menu() { 'access callback' => '_contact_personal_tab_access', 'access arguments' => array(1), 'weight' => 2, - 'file' => 'contact.pages.inc', ); return $items; } diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index ed9b79857..9623cc1e8 100644 --- a/modules/dblog/dblog.admin.inc +++ b/modules/dblog/dblog.admin.inc @@ -7,6 +7,20 @@ */ /** + * Implement hook_form_FORM_ID_alter(). + */ +function dblog_form_system_logging_settings_alter(&$form, $form_state) { + $form['dblog_row_limit'] = array( + '#type' => 'select', + '#title' => t('Database log entries to keep'), + '#default_value' => variable_get('dblog_row_limit', 1000), + '#options' => drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)), + '#description' => t('The maximum number of entries to keep in the database log. Requires a <a href="@cron">cron maintenance task</a>.', array('@cron' => url('admin/reports/status'))) + ); + $form['buttons']['#weight'] = 1; +} + +/** * Menu callback; displays a listing of log messages. */ function dblog_overview() { @@ -79,9 +93,9 @@ function dblog_overview() { } $build['dblog_table'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, '#attributes' => array('id' => 'admin-dblog'), ); $build['dblog_pager'] = array('#theme' => 'pager'); @@ -125,8 +139,8 @@ function dblog_top($type) { } $build['dblog_top_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows, ); $build['dblog_top_pager'] = array('#theme' => 'pager'); @@ -180,8 +194,8 @@ function dblog_event($id) { ), ); $build['dblog_table'] = array( - '#theme' => 'table', - '#rows' => $rows, + '#theme' => 'table', + '#rows' => $rows, '#attributes' => array('class' => array('dblog-event')), ); return $build; diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index 28f7d2f43..761d76acf 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -48,7 +48,6 @@ function dblog_menu() { 'page callback' => 'dblog_overview', 'access arguments' => array('access site reports'), 'weight' => -1, - 'file' => 'dblog.admin.inc', ); $items['admin/reports/page-not-found'] = array( 'title' => "Top 'page not found' errors", @@ -56,7 +55,6 @@ function dblog_menu() { 'page callback' => 'dblog_top', 'page arguments' => array('page not found'), 'access arguments' => array('access site reports'), - 'file' => 'dblog.admin.inc', ); $items['admin/reports/access-denied'] = array( 'title' => "Top 'access denied' errors", @@ -64,7 +62,6 @@ function dblog_menu() { 'page callback' => 'dblog_top', 'page arguments' => array('access denied'), 'access arguments' => array('access site reports'), - 'file' => 'dblog.admin.inc', ); $items['admin/reports/event/%'] = array( 'title' => 'Details', @@ -72,7 +69,6 @@ function dblog_menu() { 'page arguments' => array(3), 'access arguments' => array('access site reports'), 'type' => MENU_CALLBACK, - 'file' => 'dblog.admin.inc', ); return $items; } @@ -153,20 +149,6 @@ function dblog_watchdog(array $log_entry) { } /** - * Implement hook_form_FORM_ID_alter(). - */ -function dblog_form_system_logging_settings_alter(&$form, $form_state) { - $form['dblog_row_limit'] = array( - '#type' => 'select', - '#title' => t('Database log entries to keep'), - '#default_value' => variable_get('dblog_row_limit', 1000), - '#options' => drupal_map_assoc(array(100, 1000, 10000, 100000, 1000000)), - '#description' => t('The maximum number of entries to keep in the database log. Requires a <a href="@cron">cron maintenance task</a>.', array('@cron' => url('admin/reports/status'))) - ); - $form['buttons']['#weight'] = 1; -} - -/** * Theme dblog administration filter selector. * * @ingroup themeable diff --git a/modules/field/field.attach.inc b/modules/field/field.attach.inc index f5f5de5b0..51ee56b1f 100644 --- a/modules/field/field.attach.inc +++ b/modules/field/field.attach.inc @@ -207,7 +207,7 @@ function _field_invoke($op, $obj_type, $object, &$a = NULL, &$b = NULL, $options // Invoke the field hook and collect results. $function = $options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op; - if (function_exists($function)) { + if (drupal_function_exists($function)) { // Iterate over all the field translations. foreach ($field_translations as $langcode => $items) { $result = $function($obj_type, $object, $field, $instance, $langcode, $items, $a, $b); @@ -336,7 +336,7 @@ function _field_invoke_multiple($op, $obj_type, $objects, &$a = NULL, &$b = NULL foreach ($fields as $field_id => $field) { $field_name = $field['field_name']; $function = $options['default'] ? 'field_default_' . $op : $field['module'] . '_field_' . $op; - if (function_exists($function)) { + if (drupal_function_exists($function)) { // Iterate over all the field translations. foreach ($grouped_items[$field_id] as $langcode => $items) { $results = $function($obj_type, $grouped_objects[$field_id], $field, $grouped_instances[$field_id], $langcode, $grouped_items[$field_id][$langcode], $options, $a, $b); diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 937b6d226..088642daf 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -56,7 +56,7 @@ function field_default_form($obj_type, $object, $field, $instance, $langcode, $i else { $delta = isset($get_delta) ? $get_delta : 0; $function = $instance['widget']['module'] . '_field_widget'; - if (function_exists($function)) { + if (drupal_function_exists($function)) { if ($element = $function($form, $form_state, $field, $instance, $items, $delta)) { $defaults = array( '#required' => $get_delta > 0 ? FALSE : $instance['required'], @@ -155,7 +155,7 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form, ); $function = $instance['widget']['module'] . '_field_widget'; - if (function_exists($function)) { + if (drupal_function_exists($function)) { for ($delta = 0; $delta <= $max; $delta++) { if ($element = $function($form, $form_state, $field, $instance, $items, $delta)) { $multiple = $field['cardinality'] > 1 || $field['cardinality'] == FIELD_CARDINALITY_UNLIMITED; @@ -295,7 +295,7 @@ function field_default_form_errors($obj_type, $object, $field, $instance, $langc $field_name = $field['field_name']; if (!empty($errors[$field_name][$langcode])) { $function = $instance['widget']['module'] . '_field_widget_error'; - $function_exists = function_exists($function); + $function_exists = drupal_function_exists($function); // Walk the form down to where the widget lives. $form_path = $form['#fields'][$field_name]['form_path']; @@ -330,7 +330,7 @@ function field_default_form_errors($obj_type, $object, $field, $instance, $langc */ function field_add_more_submit($form, &$form_state) { // Set the form to rebuild and run submit handlers. - if (isset($form['#builder_function']) && function_exists($form['#builder_function'])) { + if (isset($form['#builder_function']) && drupal_function_exists($form['#builder_function'])) { $entity = $form['#builder_function']($form, $form_state); // Make the changes we want to the form state. diff --git a/modules/field/field.module b/modules/field/field.module index 5781ae116..f73acc360 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -11,11 +11,9 @@ * every page request. */ require(DRUPAL_ROOT . '/modules/field/field.crud.inc'); -require(DRUPAL_ROOT . '/modules/field/field.default.inc'); require(DRUPAL_ROOT . '/modules/field/field.info.inc'); require(DRUPAL_ROOT . '/modules/field/field.multilingual.inc'); require(DRUPAL_ROOT . '/modules/field/field.attach.inc'); -require(DRUPAL_ROOT . '/modules/field/field.form.inc'); /** * @defgroup field Field API @@ -166,7 +164,6 @@ function field_menu() { 'page callback' => 'field_add_more_js', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, - 'file' => 'field.form.inc', ); return $items; @@ -292,7 +289,7 @@ function field_get_default_value($obj_type, $object, $field, $instance, $langcod $items = array(); if (!empty($instance['default_value_function'])) { $function = $instance['default_value_function']; - if (function_exists($function)) { + if (drupal_function_exists($function)) { $items = $function($obj_type, $object, $field, $instance, $langcode); } } @@ -318,7 +315,7 @@ function field_get_default_value($obj_type, $object, $field, $instance, $langcod function field_set_empty($field, $items) { $function = $field['module'] . '_field_is_empty'; // We ensure the function is loaded, but explicitly break if it is missing. - function_exists($function); + drupal_function_exists($function); foreach ((array) $items as $delta => $item) { if ($function($item, $field)) { unset($items[$delta]); @@ -604,7 +601,7 @@ function field_view_field($obj_type, $object, $field, $instance, $build_mode = ' // One-field equivalent to _field_invoke('sanitize'). $function = $field['module'] . '_field_sanitize'; - if (function_exists($function)) { + if (drupal_function_exists($function)) { $function($obj_type, $object, $field, $instance, $items); $object->$field['field_name'] = $items; } @@ -726,4 +723,4 @@ function template_preprocess_field(&$variables) { /** * @} End of "defgroup field" - */ + */
\ No newline at end of file diff --git a/modules/field/modules/list/list.module b/modules/field/modules/list/list.module index 4f9fbe917..ad1335df0 100644 --- a/modules/field/modules/list/list.module +++ b/modules/field/modules/list/list.module @@ -151,7 +151,7 @@ function list_allowed_values($field) { $allowed_values[$field['field_name']] = array(); $function = $field['settings']['allowed_values_function']; - if (!empty($function) && function_exists($function)) { + if (!empty($function) && drupal_function_exists($function)) { $allowed_values[$field['field_name']] = $function($field); } elseif (!empty($field['settings']['allowed_values'])) { diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc index bb7c01669..eec5cb525 100644 --- a/modules/field_ui/field_ui.admin.inc +++ b/modules/field_ui/field_ui.admin.inc @@ -1205,7 +1205,7 @@ function field_ui_default_value_widget($field, $instance, &$form, &$form_state) 'instance' => $instance, ), ); - function_exists('field_default_form'); + drupal_function_exists('field_default_form'); // @todo Allow multiple values (requires more work on 'add more' JS handler). $widget_form = field_default_form(NULL, NULL, $field, $instance, FIELD_LANGUAGE_NONE, $items, $form, $form_state, 0); $form['instance']['default_value_widget'] += $widget_form; @@ -1257,7 +1257,7 @@ function field_ui_field_edit_form_validate($form, &$form_state) { // Widget now does its own validation, should be no need to add anything // for widget validation here. - if (function_exists($field_function)) { + if (drupal_function_exists($field_function)) { $field_function('validate', $node, $field, $default_value, $form, NULL); } // The field validation routine won't set an error on the right field, so diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module index 3a26c8392..00db4681c 100644 --- a/modules/field_ui/field_ui.module +++ b/modules/field_ui/field_ui.module @@ -38,7 +38,6 @@ function field_ui_menu() { 'page callback' => 'field_ui_fields_list', 'access arguments' => array('administer content types'), 'type' => MENU_NORMAL_ITEM, - 'file' => 'field_ui.admin.inc', ); // Ensure the following is not executed until field_bundles is working and @@ -61,7 +60,6 @@ function field_ui_menu() { 'page arguments' => array('field_ui_field_overview_form', $obj_type, $bundle_arg), 'type' => MENU_LOCAL_TASK, 'weight' => 1, - 'file' => 'field_ui.admin.inc', ) + $access; $instance_position = count(explode('/', $path)) + 1; $items["$path/fields/%field_ui_menu"] = array( @@ -71,7 +69,6 @@ function field_ui_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position), 'type' => MENU_LOCAL_TASK, - 'file' => 'field_ui.admin.inc', ) + $access; $items["$path/fields/%field_ui_menu/edit"] = array( 'title' => 'Edit instance settings', @@ -79,7 +76,6 @@ function field_ui_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_edit_form', $obj_type, $bundle_arg, $instance_position), 'type' => MENU_DEFAULT_LOCAL_TASK, - 'file' => 'field_ui.admin.inc', ) + $access; $items["$path/fields/%field_ui_menu/field-settings"] = array( 'title' => 'Edit field settings', @@ -87,7 +83,6 @@ function field_ui_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_settings_form', $obj_type, $bundle_arg, $instance_position), 'type' => MENU_LOCAL_TASK, - 'file' => 'field_ui.admin.inc', ) + $access; $items["$path/fields/%field_ui_menu/widget-type"] = array( 'title' => 'Change widget type', @@ -95,7 +90,6 @@ function field_ui_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_widget_type_form', $obj_type, $bundle_arg, $instance_position), 'type' => MENU_LOCAL_TASK, - 'file' => 'field_ui.admin.inc', ) + $access; $items["$path/fields/%field_ui_menu/delete"] = array( 'title' => 'Delete instance', @@ -103,7 +97,6 @@ function field_ui_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('field_ui_field_delete_form', $obj_type, $bundle_arg, $instance_position), 'type' => MENU_LOCAL_TASK, - 'file' => 'field_ui.admin.inc', ) + $access; // 'Display fields' tab and context secondary tabs. @@ -113,7 +106,6 @@ function field_ui_menu() { 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'field_ui.admin.inc', ) + $access; $tabs = field_ui_build_modes_tabs($obj_type); foreach ($tabs as $key => $tab) { @@ -122,7 +114,6 @@ function field_ui_menu() { 'page arguments' => array('field_ui_display_overview_form', $obj_type, $bundle_arg, $key), 'type' => $key == 'basic' ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, 'weight' => $key == 'basic' ? 0 : 1, - 'file' => 'field_ui.admin.inc', ) + $access; } } diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc index 6f3257757..f827218a1 100644 --- a/modules/filter/filter.admin.inc +++ b/modules/filter/filter.admin.inc @@ -352,7 +352,7 @@ function filter_admin_configure(&$form_state, $format) { $form = array(); foreach ($list as $filter) { $filter_info = module_invoke($filter->module, 'filter_info'); - if (isset($filter_info[$filter->name]['settings callback']) && function_exists($filter_info[$filter->name]['settings callback'])) { + if (isset($filter_info[$filter->name]['settings callback']) && drupal_function_exists($filter_info[$filter->name]['settings callback'])) { $form_module = call_user_func($filter_info[$filter->name]['settings callback'], $format->format); } if (isset($form_module) && is_array($form_module)) { diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 32398ee6d..2dcbbd8af 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -76,7 +76,6 @@ function filter_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('filter_admin_overview'), 'access arguments' => array('administer filters'), - 'file' => 'filter.admin.inc', ); $items['admin/settings/formats/list'] = array( 'title' => 'List', @@ -88,7 +87,6 @@ function filter_menu() { 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_ACTION, 'weight' => 1, - 'file' => 'filter.admin.inc', ); $items['admin/settings/formats/delete'] = array( 'title' => 'Delete text format', @@ -96,14 +94,12 @@ function filter_menu() { 'page arguments' => array('filter_admin_delete'), 'access arguments' => array('administer filters'), 'type' => MENU_CALLBACK, - 'file' => 'filter.admin.inc', ); $items['filter/tips'] = array( 'title' => 'Compose tips', 'page callback' => 'filter_tips_long', 'access callback' => TRUE, 'type' => MENU_SUGGESTED_ITEM, - 'file' => 'filter.pages.inc', ); $items['admin/settings/formats/%filter_format'] = array( 'type' => MENU_CALLBACK, @@ -112,7 +108,6 @@ function filter_menu() { 'page callback' => 'filter_admin_format_page', 'page arguments' => array(3), 'access arguments' => array('administer filters'), - 'file' => 'filter.admin.inc', ); $items['admin/settings/formats/%filter_format/edit'] = array( 'title' => 'Edit', @@ -126,7 +121,6 @@ function filter_menu() { 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_TASK, 'weight' => 1, - 'file' => 'filter.admin.inc', ); $items['admin/settings/formats/%filter_format/order'] = array( 'title' => 'Rearrange', @@ -135,7 +129,6 @@ function filter_menu() { 'access arguments' => array('administer filters'), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'filter.admin.inc', ); return $items; } @@ -266,7 +259,7 @@ function _filter_html_tips($format, $long = FALSE) { $output .= theme('table', $header, $rows); return $output; } - + else { return t('Allowed HTML tags: @tags', array('@tags' => $allowed_html)); } @@ -277,7 +270,7 @@ function _filter_autop_tips($format, $long = FALSE) { if ($long) { return t('Lines and paragraphs are automatically recognized. The <br /> line break, <p> paragraph and </p> close paragraph tags are inserted automatically. If paragraphs are not recognized simply add a couple blank lines.'); } - else { + else { return t('Lines and paragraphs break automatically.'); } } @@ -453,7 +446,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c // Give filters the chance to escape HTML-like data such as code or formulas. foreach ($filters as $filter) { $filter_info = module_invoke($filter->module, 'filter_info'); - if (isset($filter_info[$filter->name]['prepare callback']) && function_exists($filter_info[$filter->name]['prepare callback'])) { + if (isset($filter_info[$filter->name]['prepare callback']) && drupal_function_exists($filter_info[$filter->name]['prepare callback'])) { $text = call_user_func($filter_info[$filter->name]['prepare callback'], $text, $format, $langcode, $cache_id); } } @@ -461,7 +454,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $langcode = '', $c // Perform filtering. foreach ($filters as $filter) { $filter_info = module_invoke($filter->module, 'filter_info'); - if (isset($filter_info[$filter->name]['process callback']) && function_exists($filter_info[$filter->name]['process callback'])) { + if (isset($filter_info[$filter->name]['process callback']) && drupal_function_exists($filter_info[$filter->name]['process callback'])) { $text = call_user_func($filter_info[$filter->name]['process callback'], $text, $format, $langcode, $cache_id); } } @@ -573,7 +566,7 @@ function _filter_tips($format, $long = FALSE) { $tips[$format->name] = array(); foreach ($filters as $id => $filter) { $filter_info = module_invoke($filter->module, 'filter_info'); - if (isset($filter_info[$filter->name]['tips callback']) && function_exists($filter_info[$filter->name]['tips callback'])) { + if (isset($filter_info[$filter->name]['tips callback']) && drupal_function_exists($filter_info[$filter->name]['tips callback'])) { $tip = call_user_func($filter_info[$filter->name]['tips callback'],$format->format, $long); $tips[$format->name][] = array('tip' => $tip, 'id' => $id); } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index c576effc9..c9cf6e339 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -87,7 +87,6 @@ function forum_menu() { 'title' => 'Forums', 'page callback' => 'forum_page', 'access arguments' => array('access content'), - 'file' => 'forum.pages.inc', ); $items['admin/structure/forum'] = array( 'title' => 'Forums', @@ -95,7 +94,6 @@ function forum_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('forum_overview'), 'access arguments' => array('administer forums'), - 'file' => 'forum.admin.inc', ); $items['admin/structure/forum/list'] = array( 'title' => 'List', @@ -109,7 +107,6 @@ function forum_menu() { 'access arguments' => array('administer forums'), 'type' => MENU_LOCAL_ACTION, 'parent' => 'admin/structure/forum', - 'file' => 'forum.admin.inc', ); $items['admin/structure/forum/add/forum'] = array( 'title' => 'Add forum', @@ -118,7 +115,6 @@ function forum_menu() { 'access arguments' => array('administer forums'), 'type' => MENU_LOCAL_ACTION, 'parent' => 'admin/structure/forum', - 'file' => 'forum.admin.inc', ); $items['admin/structure/forum/settings'] = array( 'title' => 'Settings', @@ -128,13 +124,11 @@ function forum_menu() { 'weight' => 5, 'type' => MENU_LOCAL_TASK, 'parent' => 'admin/structure/forum', - 'file' => 'forum.admin.inc', ); $items['admin/structure/forum/edit/%forum_term'] = array( 'page callback' => 'forum_form_main', 'access arguments' => array('administer forums'), 'type' => MENU_CALLBACK, - 'file' => 'forum.admin.inc', ); $items['admin/structure/forum/edit/container/%forum_term'] = array( 'title' => 'Edit container', @@ -142,7 +136,6 @@ function forum_menu() { 'page arguments' => array('container', 5), 'access arguments' => array('administer forums'), 'type' => MENU_CALLBACK, - 'file' => 'forum.admin.inc', ); $items['admin/structure/forum/edit/forum/%forum_term'] = array( 'title' => 'Edit forum', @@ -150,7 +143,6 @@ function forum_menu() { 'page arguments' => array('forum', 5), 'access arguments' => array('administer forums'), 'type' => MENU_CALLBACK, - 'file' => 'forum.admin.inc', ); return $items; } diff --git a/modules/help/help.module b/modules/help/help.module index 525b173a7..a8be2739e 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -15,7 +15,6 @@ function help_menu() { 'page callback' => 'help_main', 'access arguments' => array('access administration pages'), 'weight' => 9, - 'file' => 'help.admin.inc', ); foreach (module_implements('help', TRUE) as $module) { @@ -25,7 +24,6 @@ function help_menu() { 'page arguments' => array(2), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, - 'file' => 'help.admin.inc', ); } diff --git a/modules/help/help.test b/modules/help/help.test index 4cc73c181..be269085c 100644 --- a/modules/help/help.test +++ b/modules/help/help.test @@ -81,7 +81,7 @@ class HelpTestCase extends DrupalWebTestCase { $this->modules = array(); $result = db_query("SELECT name, filename, info FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC"); foreach ($result as $module) { - if (file_exists($module->filename) && function_exists($module->name . '_help')) { + if (file_exists($module->filename) && drupal_function_exists($module->name . '_help')) { $fullname = unserialize($module->info); $this->modules[$module->name] = $fullname['name']; } diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index 5f96f50e0..45942c08e 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -315,7 +315,7 @@ function image_effect_form(&$form_state, $style, $effect) { '#tree' => TRUE, '#attached_css' => array(drupal_get_path('module', 'image') . '/image.admin.css' => array('preprocess' => FALSE)), ); - if (function_exists($effect['form callback'])) { + if (drupal_function_exists($effect['form callback'])) { $form['data'] = call_user_func($effect['form callback'], $effect['data']); } diff --git a/modules/image/image.module b/modules/image/image.module index 274742e44..b468a5546 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -51,7 +51,6 @@ function image_menu() { 'description' => 'Configure styles that can be used for resizing or adjusting images on display.', 'page callback' => 'image_style_list', 'access arguments' => array('administer image styles'), - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/list'] = array( 'title' => 'List', @@ -60,7 +59,6 @@ function image_menu() { 'access arguments' => array('administer image styles'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => 1, - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/add'] = array( 'title' => 'Add style', @@ -70,7 +68,6 @@ function image_menu() { 'access arguments' => array('administer image styles'), 'type' => MENU_LOCAL_ACTION, 'weight' => 2, - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/edit/%image_style'] = array( 'title' => 'Edit style', @@ -79,7 +76,6 @@ function image_menu() { 'page arguments' => array('image_style_form', 5), 'access arguments' => array('administer image styles'), 'type' => MENU_CALLBACK, - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/delete/%image_style'] = array( 'title' => 'Delete style', @@ -88,7 +84,6 @@ function image_menu() { 'page arguments' => array('image_style_delete_form', 5, TRUE), 'access arguments' => array('administer image styles'), 'type' => MENU_CALLBACK, - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/edit/%image_style/effects/%image_effect'] = array( 'title' => 'Edit image effect', @@ -97,7 +92,6 @@ function image_menu() { 'page arguments' => array('image_effect_form', 5, 7), 'access arguments' => array('administer image styles'), 'type' => MENU_CALLBACK, - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/edit/%image_style/effects/%image_effect/delete'] = array( 'title' => 'Delete image effect', @@ -106,7 +100,6 @@ function image_menu() { 'page arguments' => array('image_effect_delete_form', 5, 7), 'access arguments' => array('administer image styles'), 'type' => MENU_CALLBACK, - 'file' => 'image.admin.inc', ); $items['admin/config/media/image-styles/edit/%image_style/add/%image_effect_definition'] = array( 'title' => 'Add image effect', @@ -115,7 +108,6 @@ function image_menu() { 'page arguments' => array('image_effect_form', 5, 7), 'access arguments' => array('administer image styles'), 'type' => MENU_CALLBACK, - 'file' => 'image.admin.inc', ); return $items; @@ -575,7 +567,7 @@ function image_style_url($style_name, $path) { // Set a cache entry to grant access to this style/image path. This will be // checked by image_style_generate(). cache_set('access:' . $style_name . ':' . md5($path), 1, 'cache_image', REQUEST_TIME + 600); - + $scheme = file_uri_scheme($path); $target = file_uri_target($path); @@ -622,7 +614,6 @@ function image_effect_definitions() { } else { $effects = array(); - include_once DRUPAL_ROOT . '/modules/image/image.effects.inc'; foreach (module_implements('image_effect_info') as $module) { foreach (module_invoke($module, 'image_effect_info') as $name => $effect) { // Ensure the current toolkit supports the effect. @@ -765,7 +756,7 @@ function image_effect_delete($effect) { * TRUE on success. FALSE if unable to perform the image effect on the image. */ function image_effect_apply($image, $effect) { - if (function_exists($effect['effect callback'])) { + if (drupal_function_exists($effect['effect callback'])) { return call_user_func($effect['effect callback'], $image, $effect['data']); } return FALSE; diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 0c0c6da76..63eecc0eb 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -76,8 +76,6 @@ function locale_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('locale_languages_overview_form'), 'access arguments' => array('administer languages'), - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/language/overview'] = array( 'title' => 'List', @@ -90,8 +88,6 @@ function locale_menu() { 'access arguments' => array('administer languages'), 'weight' => 5, 'type' => MENU_LOCAL_ACTION, - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/language/configure'] = array( 'title' => 'Configure', @@ -99,8 +95,6 @@ function locale_menu() { 'page arguments' => array('locale_languages_configure_form'), 'access arguments' => array('administer languages'), 'weight' => 10, - 'file' => 'locale.inc', - 'file path' => 'includes', 'type' => MENU_LOCAL_TASK, ); $items['admin/config/regional/language/edit/%'] = array( @@ -108,8 +102,6 @@ function locale_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('locale_languages_edit_form', 5), 'access arguments' => array('administer languages'), - 'file' => 'locale.inc', - 'file path' => 'includes', 'type' => MENU_CALLBACK, ); $items['admin/config/regional/language/delete/%'] = array( @@ -117,8 +109,6 @@ function locale_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('locale_languages_delete_form', 5), 'access arguments' => array('administer languages'), - 'file' => 'locale.inc', - 'file path' => 'includes', 'type' => MENU_CALLBACK, ); @@ -126,11 +116,8 @@ function locale_menu() { $items['admin/config/regional/translate'] = array( 'title' => 'Translate interface', 'description' => 'Translate the built in interface and optionally other text.', - 'page callback' => 'locale_inc_callback', - 'page arguments' => array('locale_translate_overview_screen'), // not a form, just a table + 'page callback' => 'locale_translate_overview_screen', // not a form, just a table 'access arguments' => array('translate interface'), - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/translate/overview'] = array( 'title' => 'Overview', @@ -143,8 +130,6 @@ function locale_menu() { 'type' => MENU_LOCAL_TASK, 'page callback' => 'locale_translate_seek_screen', // search results and form concatenated 'access arguments' => array('translate interface'), - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/translate/import'] = array( 'title' => 'Import', @@ -153,8 +138,6 @@ function locale_menu() { 'access arguments' => array('translate interface'), 'weight' => 20, 'type' => MENU_LOCAL_TASK, - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/translate/export'] = array( 'title' => 'Export', @@ -162,8 +145,6 @@ function locale_menu() { 'access arguments' => array('translate interface'), 'weight' => 30, 'type' => MENU_LOCAL_TASK, - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/translate/edit/%'] = array( 'title' => 'Edit string', @@ -171,8 +152,6 @@ function locale_menu() { 'page arguments' => array('locale_translate_edit_form', 5), 'access arguments' => array('translate interface'), 'type' => MENU_CALLBACK, - 'file' => 'locale.inc', - 'file path' => 'includes', ); $items['admin/config/regional/translate/delete/%'] = array( 'title' => 'Delete string', @@ -180,8 +159,6 @@ function locale_menu() { 'page arguments' => array(5), 'access arguments' => array('translate interface'), 'type' => MENU_CALLBACK, - 'file' => 'locale.inc', - 'file path' => 'includes', ); return $items; diff --git a/modules/menu/menu.module b/modules/menu/menu.module index 45983e55e..beb29590b 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -54,7 +54,6 @@ function menu_menu() { 'page callback' => 'menu_overview_page', 'access callback' => 'user_access', 'access arguments' => array('administer menu'), - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu/list'] = array( 'title' => 'List menus', @@ -67,7 +66,6 @@ function menu_menu() { 'page arguments' => array('menu_edit_menu', 'add'), 'access arguments' => array('administer menu'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu/settings'] = array( 'title' => 'Settings', @@ -76,7 +74,6 @@ function menu_menu() { 'access arguments' => array('administer menu'), 'type' => MENU_LOCAL_TASK, 'weight' => 5, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu-customize/%menu'] = array( 'title' => 'Customize menu', @@ -86,7 +83,6 @@ function menu_menu() { 'title arguments' => array(3), 'access arguments' => array('administer menu'), 'type' => MENU_CALLBACK, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu-customize/%menu/list'] = array( 'title' => 'List links', @@ -99,7 +95,6 @@ function menu_menu() { 'page arguments' => array('menu_edit_item', 'add', NULL, 3), 'access arguments' => array('administer menu'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu-customize/%menu/edit'] = array( 'title' => 'Edit menu', @@ -107,7 +102,6 @@ function menu_menu() { 'page arguments' => array('menu_edit_menu', 'edit', 3), 'access arguments' => array('administer menu'), 'type' => MENU_LOCAL_TASK, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu-customize/%menu/delete'] = array( 'title' => 'Delete menu', @@ -115,7 +109,6 @@ function menu_menu() { 'page arguments' => array(3), 'access arguments' => array('administer menu'), 'type' => MENU_CALLBACK, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu/item/%menu_link/edit'] = array( 'title' => 'Edit menu link', @@ -123,7 +116,6 @@ function menu_menu() { 'page arguments' => array('menu_edit_item', 'edit', 4, NULL), 'access arguments' => array('administer menu'), 'type' => MENU_CALLBACK, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu/item/%menu_link/reset'] = array( 'title' => 'Reset menu link', @@ -131,7 +123,6 @@ function menu_menu() { 'page arguments' => array('menu_reset_item_confirm', 4), 'access arguments' => array('administer menu'), 'type' => MENU_CALLBACK, - 'file' => 'menu.admin.inc', ); $items['admin/structure/menu/item/%menu_link/delete'] = array( 'title' => 'Delete menu link', @@ -139,7 +130,6 @@ function menu_menu() { 'page arguments' => array(4), 'access arguments' => array('administer menu'), 'type' => MENU_CALLBACK, - 'file' => 'menu.admin.inc', ); return $items; } @@ -167,7 +157,7 @@ function menu_theme() { */ function menu_enable() { menu_rebuild(); - $base_link = db_query("SELECT mlid AS plid, menu_name FROM {menu_links} WHERE link_path = 'admin/structure/menu' AND module = 'system'")->fetchAssoc(); + $base_link = db_query("SELECT mlid AS plid, menu_name from {menu_links} WHERE link_path = 'admin/structure/menu' AND module = 'system'")->fetchAssoc(); $base_link['router_path'] = 'admin/structure/menu-customize/%'; $base_link['module'] = 'menu'; $result = db_query("SELECT * FROM {menu_custom}", array(), array('fetch' => PDO::FETCH_ASSOC)); diff --git a/modules/node/node.module b/modules/node/node.module index b915d7e77..2a43d95b9 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1699,7 +1699,6 @@ function node_menu() { 'page arguments' => array('node_admin_content'), 'access arguments' => array('administer nodes'), 'weight' => -10, - 'file' => 'node.admin.inc', ); $items['admin/content/node'] = array( 'title' => 'Content', @@ -1715,7 +1714,6 @@ function node_menu() { // has to be allowed access to the 'node access rebuild' confirm form. 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, - 'file' => 'node.admin.inc', ); $items['admin/structure/types'] = array( @@ -1723,7 +1721,6 @@ function node_menu() { 'description' => 'Manage posts by content type, including default status, front page promotion, comment settings, etc.', 'page callback' => 'node_overview_types', 'access arguments' => array('administer content types'), - 'file' => 'content_types.inc', ); $items['admin/structure/types/list'] = array( 'title' => 'List', @@ -1736,7 +1733,6 @@ function node_menu() { 'page arguments' => array('node_type_form'), 'access arguments' => array('administer content types'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'content_types.inc', ); $items['node'] = array( 'title' => 'Content', @@ -1750,7 +1746,6 @@ function node_menu() { 'access callback' => '_node_add_access', 'weight' => 1, 'menu_name' => 'management', - 'file' => 'node.pages.inc', ); $items['rss.xml'] = array( 'title' => 'RSS feed', @@ -1770,7 +1765,6 @@ function node_menu() { 'access callback' => 'node_access', 'access arguments' => array('create', $type->type), 'description' => $type->description, - 'file' => 'node.pages.inc', ); $items['admin/structure/node-type/' . $type_url_str] = array( 'title' => $type->name, @@ -1778,7 +1772,6 @@ function node_menu() { 'page arguments' => array('node_type_form', $type), 'access arguments' => array('administer content types'), 'type' => MENU_CALLBACK, - 'file' => 'content_types.inc', ); $items['admin/structure/node-type/' . $type_url_str . '/edit'] = array( 'title' => 'Edit', @@ -1789,7 +1782,6 @@ function node_menu() { 'page arguments' => array('node_type_delete_confirm', $type), 'access arguments' => array('administer content types'), 'type' => MENU_CALLBACK, - 'file' => 'content_types.inc', ); } $items['node/%node'] = array( @@ -1812,7 +1804,6 @@ function node_menu() { 'access arguments' => array('update', 1), 'weight' => 1, 'type' => MENU_LOCAL_TASK, - 'file' => 'node.pages.inc', ); $items['node/%node/delete'] = array( 'title' => 'Delete', @@ -1821,9 +1812,7 @@ function node_menu() { 'access callback' => 'node_access', 'access arguments' => array('delete', 1), 'weight' => 1, - 'type' => MENU_CALLBACK, - 'file' => 'node.pages.inc', - ); + 'type' => MENU_CALLBACK); $items['node/%node/revisions'] = array( 'title' => 'Revisions', 'page callback' => 'node_revision_overview', @@ -1832,7 +1821,6 @@ function node_menu() { 'access arguments' => array(1), 'weight' => 2, 'type' => MENU_LOCAL_TASK, - 'file' => 'node.pages.inc', ); $items['node/%node/revisions/%/view'] = array( 'title' => 'Revisions', @@ -1851,7 +1839,6 @@ function node_menu() { 'access callback' => '_node_revision_access', 'access arguments' => array(1, 'update'), 'type' => MENU_CALLBACK, - 'file' => 'node.pages.inc', ); $items['node/%node/revisions/%/delete'] = array( 'title' => 'Delete earlier revision', @@ -1861,7 +1848,6 @@ function node_menu() { 'access callback' => '_node_revision_access', 'access arguments' => array(1, 'delete'), 'type' => MENU_CALLBACK, - 'file' => 'node.pages.inc', ); return $items; } diff --git a/modules/openid/openid.module b/modules/openid/openid.module index c1a026672..842606d7d 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -15,7 +15,6 @@ function openid_menu() { 'page callback' => 'openid_authentication_page', 'access callback' => 'user_is_anonymous', 'type' => MENU_CALLBACK, - 'file' => 'openid.pages.inc', ); $items['user/%user/openid'] = array( 'title' => 'OpenID identities', @@ -24,7 +23,6 @@ function openid_menu() { 'access callback' => 'user_edit_access', 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, - 'file' => 'openid.pages.inc', ); $items['user/%user/openid/delete'] = array( 'title' => 'Delete OpenID', @@ -33,7 +31,6 @@ function openid_menu() { 'access callback' => 'user_edit_access', 'access arguments' => array(1), 'type' => MENU_CALLBACK, - 'file' => 'openid.pages.inc', ); return $items; } diff --git a/modules/path/path.module b/modules/path/path.module index 33b0e98cd..d65dd5ec9 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -38,14 +38,12 @@ function path_menu() { 'description' => "Change your site's URL paths by aliasing them.", 'page callback' => 'path_admin_overview', 'access arguments' => array('administer url aliases'), - 'file' => 'path.admin.inc', ); $items['admin/settings/path/edit'] = array( 'title' => 'Edit alias', 'page callback' => 'path_admin_edit', 'access arguments' => array('administer url aliases'), 'type' => MENU_CALLBACK, - 'file' => 'path.admin.inc', ); $items['admin/settings/path/delete'] = array( 'title' => 'Delete alias', @@ -53,7 +51,6 @@ function path_menu() { 'page arguments' => array('path_admin_delete_confirm'), 'access arguments' => array('administer url aliases'), 'type' => MENU_CALLBACK, - 'file' => 'path.admin.inc', ); $items['admin/settings/path/list'] = array( 'title' => 'List', @@ -65,7 +62,6 @@ function path_menu() { 'page callback' => 'path_admin_edit', 'access arguments' => array('administer url aliases'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'path.admin.inc', ); return $items; @@ -214,7 +210,7 @@ function path_node_update($node) { function path_node_delete($node) { path_set_alias('node/' . $node->nid); } - + /** * Implement hook_taxonomy_term_delete(). */ @@ -273,7 +269,7 @@ function path_form_taxonomy_form_term_alter(&$form, $form_state) { else { $url = 'taxonomy/term/' . $form['#term']['tid']; $alias = drupal_get_path_alias($url); - + // Since drupal_get_path_alias() can return the default path, check if we really have an alias. if ($alias != $url) { $path = $alias; diff --git a/modules/poll/poll.module b/modules/poll/poll.module index 5c715d981..84a84b0e0 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -81,7 +81,6 @@ function poll_menu() { 'page callback' => 'poll_page', 'access arguments' => array('access content'), 'type' => MENU_SUGGESTED_ITEM, - 'file' => 'poll.pages.inc', ); $items['node/%node/votes'] = array( @@ -92,7 +91,6 @@ function poll_menu() { 'access arguments' => array(1, 'inspect all votes', FALSE), 'weight' => 3, 'type' => MENU_LOCAL_TASK, - 'file' => 'poll.pages.inc', ); $items['node/%node/results'] = array( @@ -103,7 +101,6 @@ function poll_menu() { 'access arguments' => array(1, 'access content', TRUE), 'weight' => 3, 'type' => MENU_LOCAL_TASK, - 'file' => 'poll.pages.inc', ); return $items; @@ -325,7 +322,6 @@ function poll_form($node, $form_state) { * entire form is rebuilt during the page reload. */ function poll_more_choices_submit($form, &$form_state) { - include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'node') . '/node.pages.inc'; // Set the form to rebuild and run submit handlers. node_form_submit_build_node($form, $form_state); diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 28872b4b2..ea99c4dc2 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -80,7 +80,6 @@ function profile_menu() { 'title' => 'User list', 'page callback' => 'profile_browse', 'access arguments' => array('access user profiles'), - 'file' => 'profile.pages.inc', 'type' => MENU_SUGGESTED_ITEM, ); $items['admin/config/people/profile'] = array( @@ -89,21 +88,18 @@ function profile_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('profile_admin_overview'), 'access arguments' => array('administer users'), - 'file' => 'profile.admin.inc', ); $items['admin/config/people/profile/add'] = array( 'title' => 'Add field', 'page callback' => 'drupal_get_form', 'page arguments' => array('profile_field_form'), 'access arguments' => array('administer users'), - 'file' => 'profile.admin.inc', 'type' => MENU_CALLBACK, ); $items['admin/config/people/profile/autocomplete'] = array( 'title' => 'Profile category autocomplete', 'page callback' => 'profile_admin_settings_autocomplete', 'access arguments' => array('administer users'), - 'file' => 'profile.admin.inc', 'type' => MENU_CALLBACK, ); $items['admin/config/people/profile/edit'] = array( @@ -111,7 +107,6 @@ function profile_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('profile_field_form'), 'access arguments' => array('administer users'), - 'file' => 'profile.admin.inc', 'type' => MENU_CALLBACK, ); $items['admin/config/people/profile/delete'] = array( @@ -119,14 +114,12 @@ function profile_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('profile_field_delete'), 'access arguments' => array('administer users'), - 'file' => 'profile.admin.inc', 'type' => MENU_CALLBACK, ); $items['profile/autocomplete'] = array( 'title' => 'Profile autocomplete', 'page callback' => 'profile_autocomplete', 'access arguments' => array('access user profiles'), - 'file' => 'profile.pages.inc', 'type' => MENU_CALLBACK, ); return $items; @@ -135,7 +128,7 @@ function profile_menu() { /** * Implement hook_block_list(). */ - function profile_block_list() { +function profile_block_list() { $blocks['author-information']['info'] = t('Author information'); $blocks['author-information']['cache'] = BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE; return $blocks; diff --git a/modules/search/search.module b/modules/search/search.module index 2038765f5..e8d63ea96 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -190,7 +190,6 @@ function search_menu() { 'page callback' => 'search_view', 'access arguments' => array('search content'), 'type' => MENU_SUGGESTED_ITEM, - 'file' => 'search.pages.inc', ); $items['admin/settings/search'] = array( 'title' => 'Search settings', @@ -199,7 +198,6 @@ function search_menu() { 'page arguments' => array('search_admin_settings'), 'access arguments' => array('administer search'), 'type' => MENU_NORMAL_ITEM, - 'file' => 'search.admin.inc', ); $items['admin/settings/search/reindex'] = array( 'title' => 'Clear index', @@ -207,7 +205,6 @@ function search_menu() { 'page arguments' => array('search_reindex_confirm'), 'access arguments' => array('administer search'), 'type' => MENU_CALLBACK, - 'file' => 'search.admin.inc', ); $items['admin/reports/search'] = array( 'title' => 'Top search phrases', @@ -216,7 +213,6 @@ function search_menu() { 'page arguments' => array('search'), 'access arguments' => array('access site reports'), 'file path' => drupal_get_path('module', 'dblog'), - 'file' => 'dblog.admin.inc', ); foreach (module_implements('search') as $module) { @@ -229,7 +225,6 @@ function search_menu() { 'access arguments' => array($module), 'type' => MENU_LOCAL_TASK, 'parent' => 'search', - 'file' => 'search.pages.inc', ); } return $items; diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index 8ef61367a..c23081467 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -519,7 +519,7 @@ abstract class DrupalTestCase { * * These tests can not access the database nor files. Calling any Drupal * function that needs the database will throw exceptions. These include - * watchdog(), function_exists(), module_implements(), + * watchdog(), drupal_function_exists(), module_implements(), * module_invoke_all() etc. */ class DrupalUnitTestCase extends DrupalTestCase { @@ -549,7 +549,7 @@ class DrupalUnitTestCase extends DrupalTestCase { if (isset($module_list['locale'])) { $this->originalModuleList = $module_list; unset($module_list['locale']); - module_list(TRUE, FALSE, FALSE, $module_list); + module_list(TRUE, FALSE, $module_list); } } @@ -561,7 +561,7 @@ class DrupalUnitTestCase extends DrupalTestCase { $db_prefix = $this->originalPrefix; // Restore modules if necessary. if (isset($this->originalModuleList)) { - module_list(TRUE, FALSE, FALSE, $this->originalModuleList); + module_list(TRUE, FALSE, $this->originalModuleList); } } } @@ -1203,7 +1203,7 @@ class DrupalWebTestCase extends DrupalTestCase { // Reload module list and implementations to ensure that test module hooks // aren't called after tests. module_list(TRUE); - module_implements('', FALSE, TRUE); + module_implements(MODULE_IMPLEMENTS_CLEAR_CACHE); // Reset the Field API. field_cache_clear(); diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index af176b031..cbbd45388 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -31,7 +31,6 @@ function simpletest_menu() { 'page arguments' => array('simpletest_test_form'), 'description' => 'Run tests against Drupal core and your active modules. These tests help assure that your site code is working as designed.', 'access arguments' => array('administer unit tests'), - 'file' => 'simpletest.pages.inc', ); $items['admin/config/development/testing/list'] = array( 'title' => 'List', @@ -43,7 +42,6 @@ function simpletest_menu() { 'page arguments' => array('simpletest_settings_form'), 'access arguments' => array('administer unit tests'), 'type' => MENU_LOCAL_TASK, - 'file' => 'simpletest.pages.inc', ); $items['admin/config/development/testing/results/%'] = array( 'title' => 'Test result', @@ -52,7 +50,6 @@ function simpletest_menu() { 'description' => 'View result of tests.', 'access arguments' => array('administer unit tests'), 'type' => MENU_CALLBACK, - 'file' => 'simpletest.pages.inc', ); return $items; } diff --git a/modules/simpletest/tests/batch.test b/modules/simpletest/tests/batch.test index a3ace7b9e..65c5309ff 100644 --- a/modules/simpletest/tests/batch.test +++ b/modules/simpletest/tests/batch.test @@ -69,6 +69,8 @@ class BatchAPIPercentagesTestCase extends DrupalWebTestCase { * testCases class variable. */ function testBatchAPIPercentages() { + // Include batch.inc if it's not already included. + drupal_function_exists('_batch_api_percentage'); foreach ($this->testCases as $expected_result => $arguments) { // PHP sometimes casts numeric strings that are array keys to integers, // cast them back here. @@ -84,4 +86,4 @@ class BatchAPIPercentagesTestCase extends DrupalWebTestCase { } } } -} +}
\ No newline at end of file diff --git a/modules/simpletest/tests/image.test b/modules/simpletest/tests/image.test index 3eeb602a8..7047576b6 100644 --- a/modules/simpletest/tests/image.test +++ b/modules/simpletest/tests/image.test @@ -255,7 +255,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase { */ function testManipulations() { // If GD isn't available don't bother testing this. - if (!function_exists('image_gd_check_settings') || !image_gd_check_settings()) { + if (!drupal_function_exists('image_gd_check_settings') || !image_gd_check_settings()) { $this->pass(t('Image manipulations for the GD toolkit were skipped because the GD toolkit is not available.')); return; } @@ -325,7 +325,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase { ); // Systems using non-bundled GD2 don't have imagerotate. Test if available. - if (function_exists('imagerotate')) { + if (drupal_function_exists('imagerotate')) { $operations += array( 'rotate_5' => array( 'function' => 'rotate', @@ -359,7 +359,7 @@ class ImageToolkitGdTestCase extends DrupalWebTestCase { } // Systems using non-bundled GD2 don't have imagefilter. Test if available. - if (function_exists('imagefilter')) { + if (drupal_function_exists('imagefilter')) { $operations += array( 'desaturate' => array( 'function' => 'desaturate', diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test index a157c957a..5c703c287 100644 --- a/modules/simpletest/tests/module.test +++ b/modules/simpletest/tests/module.test @@ -60,7 +60,7 @@ class ModuleUnitTest extends DrupalWebTestCase { 'system' => array('filename' => drupal_get_path('module', 'system')), 'menu' => array('filename' => drupal_get_path('module', 'menu')), ); - module_list(FALSE, FALSE, FALSE, $fixed_list); + module_list(FALSE, FALSE, $fixed_list); $new_module_list = array_combine(array_keys($fixed_list), array_keys($fixed_list)); $this->assertModuleList($new_module_list, t('When using a fixed list')); @@ -79,7 +79,7 @@ class ModuleUnitTest extends DrupalWebTestCase { $expected_values = array_combine($expected_values, $expected_values); $this->assertIdentical($expected_values, module_list(), t('@condition: module_list() returns correct results', array('@condition' => $condition))); ksort($expected_values); - $this->assertIdentical($expected_values, module_list(FALSE, FALSE, TRUE), t('@condition: module_list() returns correctly sorted results', array('@condition' => $condition))); + $this->assertIdentical($expected_values, module_list(FALSE, TRUE), t('@condition: module_list() returns correctly sorted results', array('@condition' => $condition))); } } diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test index 09464922c..53ee3127f 100644 --- a/modules/simpletest/tests/registry.test +++ b/modules/simpletest/tests/registry.test @@ -12,6 +12,7 @@ class RegistryParseFileTestCase extends DrupalWebTestCase { function setUp() { $this->fileName = 'registry_test_' . md5(rand()); + $this->functionName = 'registry_test_function' . md5(rand()); $this->className = 'registry_test_class' . md5(rand()); $this->interfaceName = 'registry_test_interface' . md5(rand()); parent::setUp(); @@ -22,7 +23,7 @@ class RegistryParseFileTestCase extends DrupalWebTestCase { */ function testRegistryParseFile() { _registry_parse_file($this->fileName, $this->getFileContents()); - foreach (array('className', 'interfaceName') as $resource) { + foreach (array('functionName', 'className', 'interfaceName') as $resource) { $foundName = db_query('SELECT name FROM {registry} WHERE name = :name', array(':name' => $this->$resource))->fetchField(); $this->assertTrue($this->$resource == $foundName, t('Resource "@resource" found.', array('@resource' => $this->$resource))); } @@ -35,6 +36,8 @@ class RegistryParseFileTestCase extends DrupalWebTestCase { $file_contents = <<<CONTENTS <?php +function {$this->functionName}() {} + class {$this->className} {} interface {$this->interfaceName} {} @@ -63,6 +66,7 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { foreach ($this->fileTypes as $fileType) { $this->$fileType = new stdClass(); $this->$fileType->fileName = file_directory_path() . '/registry_test_' . md5(rand()); + $this->$fileType->functionName = 'registry_test_function' . md5(rand()); $this->$fileType->className = 'registry_test_class' . md5(rand()); $this->$fileType->interfaceName = 'registry_test_interface' . md5(rand()); $this->$fileType->contents = $this->getFileContents($fileType); @@ -78,7 +82,7 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { ->execute(); // Insert some fake resource records. - foreach (array('class', 'interface') as $type) { + foreach (array('function', 'class', 'interface') as $type) { db_insert('registry') ->fields(array( 'name' => $type . md5(rand()), @@ -98,7 +102,7 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { _registry_parse_files($this->getFiles()); foreach ($this->fileTypes as $fileType) { // Test that we have all the right resources. - foreach (array('className', 'interfaceName') as $resource) { + foreach (array('functionName', 'className', 'interfaceName') as $resource) { $foundName = db_query('SELECT name FROM {registry} WHERE name = :name', array(':name' => $this->$fileType->$resource))->fetchField(); $this->assertTrue($this->$fileType->$resource == $foundName, t('Resource "@resource" found.', array('@resource' => $this->$fileType->$resource))); } @@ -131,6 +135,8 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { $file_contents = <<<CONTENTS <?php +function {$this->$fileType->functionName}() {} + class {$this->$fileType->className} {} interface {$this->$fileType->interfaceName} {} @@ -140,3 +146,33 @@ CONTENTS; } } + +class RegistrySkipBodyTestCase extends DrupalUnitTestCase { + public static function getInfo() { + return array( + 'name' => 'Skip function body test', + 'description' => 'Tokenize a simple function and check that the body is skipped right', + 'group' => 'System', + ); + } + + function testRegistrySkipBody() { + // This string contains all three kinds of opening braces. + $function = '<?php function foo () { $x = "{$y}"; $x = "${y}"; }'; + $tokens = token_get_all($function); + require_once DRUPAL_ROOT . '/includes/registry.inc'; + _registry_skip_body($tokens); + // Consume the last } + each($tokens); + $this->assertIdentical(each($tokens), FALSE, t('Tokens skipped')); + + // Check workaround for PHP < 5.2.3 regarding tokenization of strings + // containing variables. The { contained in the string should not be + // treated as a separate token. + $function = '<?php function foo() { $x = "$y {"; $x = `$y {`; $x = ' . "<<<EOD\n\$y {\nEOD\n; } function bar() {}"; + $tokens = token_get_all($function); + _registry_skip_body($tokens); + $this->assertTrue(each($tokens), t('Tokens not skipped to end of file.')); + } + +} diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test index 232665a95..8cdaec1d5 100644 --- a/modules/simpletest/tests/xmlrpc.test +++ b/modules/simpletest/tests/xmlrpc.test @@ -12,6 +12,9 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase { function setUp() { parent::setUp('xmlrpc_test'); + + // Force loading the xmlrpc.inc to have the xmlrpc() function. + drupal_function_exists('xmlrpc'); } /** @@ -132,6 +135,9 @@ class XMLRPCMessagesTestCase extends DrupalWebTestCase { function setUp() { parent::setUp('xmlrpc_test'); + + // Force loading the xmlrpc.inc to have the xmlrpc() function. + drupal_function_exists('xmlrpc'); } /** diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 424203262..9194fcd49 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -130,7 +130,6 @@ function statistics_menu() { 'description' => 'View pages that have recently been visited.', 'page callback' => 'statistics_recent_hits', 'access arguments' => array('access statistics'), - 'file' => 'statistics.admin.inc', ); $items['admin/reports/pages'] = array( 'title' => 'Top pages', @@ -138,7 +137,6 @@ function statistics_menu() { 'page callback' => 'statistics_top_pages', 'access arguments' => array('access statistics'), 'weight' => 1, - 'file' => 'statistics.admin.inc', ); $items['admin/reports/visitors'] = array( 'title' => 'Top visitors', @@ -146,14 +144,12 @@ function statistics_menu() { 'page callback' => 'statistics_top_visitors', 'access arguments' => array('access statistics'), 'weight' => 2, - 'file' => 'statistics.admin.inc', ); $items['admin/reports/referrers'] = array( 'title' => 'Top referrers', 'description' => 'View top referrers.', 'page callback' => 'statistics_top_referrers', 'access arguments' => array('access statistics'), - 'file' => 'statistics.admin.inc', ); $items['admin/reports/access/%'] = array( 'title' => 'Details', @@ -162,7 +158,6 @@ function statistics_menu() { 'page arguments' => array(3), 'access arguments' => array('access statistics'), 'type' => MENU_CALLBACK, - 'file' => 'statistics.admin.inc', ); $items['admin/settings/statistics'] = array( 'title' => 'Statistics', @@ -170,7 +165,6 @@ function statistics_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('statistics_settings_form'), 'access arguments' => array('administer statistics'), - 'file' => 'statistics.admin.inc', ); $items['user/%user/track/navigation'] = array( 'title' => 'Track page visits', @@ -179,7 +173,6 @@ function statistics_menu() { 'access arguments' => array('access statistics'), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'statistics.pages.inc', ); $items['node/%node/track'] = array( 'title' => 'Track', @@ -188,7 +181,6 @@ function statistics_menu() { 'access arguments' => array('access statistics'), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'statistics.pages.inc', ); return $items; diff --git a/modules/system/image.gd.inc b/modules/system/image.gd.inc index 23e34677b..706395439 100644 --- a/modules/system/image.gd.inc +++ b/modules/system/image.gd.inc @@ -118,7 +118,7 @@ function image_gd_resize(stdClass $image, $width, $height) { */ function image_gd_rotate(stdClass $image, $degrees, $background = NULL) { // PHP installations using non-bundled GD do not have imagerotate. - if (!function_exists('imagerotate')) { + if (!drupal_function_exists('imagerotate')) { watchdog('image', 'The image %file could not be rotated because the imagerotate() function is not available in this PHP installation.', array('%file' => $image->source)); return FALSE; } @@ -215,7 +215,7 @@ function image_gd_crop(stdClass $image, $x, $y, $width, $height) { */ function image_gd_desaturate(stdClass $image) { // PHP installations using non-bundled GD do not have imagefilter. - if (!function_exists('imagefilter')) { + if (!drupal_function_exists('imagefilter')) { watchdog('image', 'The image %file could not be desaturated because the imagefilter() function is not available in this PHP installation.', array('%file' => $image->source)); return FALSE; } diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index e3926043e..f80d2a8fc 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -52,7 +52,7 @@ function system_main_admin_page($arg = NULL) { $block['show'] = TRUE; if (empty($content)) { // If no items found below, but access checks did not fail, show. - $block['title'] = l($item['title'], $item['href'], $item['localized_options']); + $block['title'] = l($item['title'], $item['href'], $item['localized_options']); } else { // Theme items below. @@ -1552,7 +1552,7 @@ function system_image_toolkit_settings() { // Get the toolkit's settings form. $function = 'image_' . $current_toolkit . '_settings'; - if (function_exists($function)) { + if (drupal_function_exists($function)) { $form['image_toolkit_settings'] = $function(); } diff --git a/modules/system/system.install b/modules/system/system.install index df678015a..d8c2e5e65 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -44,7 +44,7 @@ function system_requirements($phase) { 'severity' => REQUIREMENT_INFO, 'weight' => -9 ); - } + } } // Web server information. @@ -953,11 +953,6 @@ function system_schema() { 'not null' => TRUE, 'default' => 0, ), - 'file' => array( - 'description' => 'The file to include for this element, usually the page callback function lives in this file.', - 'type' => 'text', - 'size' => 'medium' - ), ), 'indexes' => array( 'fit' => array('fit'), @@ -1242,6 +1237,13 @@ function system_schema() { 'not null' => TRUE, 'default' => '' ), + 'suffix' => array( + 'description' => "The part of the function name after the module, which is the hook this function implements, if any.", + 'type' => 'varchar', + 'length' => 68, + 'not null' => TRUE, + 'default' => '' + ), 'weight' => array( 'description' => "The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name.", 'type' => 'int', @@ -1251,7 +1253,7 @@ function system_schema() { ), 'primary key' => array('name', 'type'), 'indexes' => array( - 'hook' => array('type', 'weight', 'module'), + 'hook' => array('type', 'suffix', 'weight', 'module'), ), ); @@ -1397,12 +1399,6 @@ function system_schema() { 'not null' => TRUE, 'default' => 0, ), - 'bootstrap' => array( - 'description' => "Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted).", - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), 'schema_version' => array( 'description' => "The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed.", 'type' => 'int', @@ -1425,7 +1421,6 @@ function system_schema() { 'primary key' => array('filename'), 'indexes' => array( 'modules' => array('type', 'status', 'weight', 'name'), - 'bootstrap' => array('type', 'status', 'bootstrap', 'weight', 'name'), 'type_name' => array('type', 'name'), ), ); @@ -1716,17 +1711,19 @@ function system_update_7005() { */ function system_update_7006() { $ret = array(); + db_drop_field($ret, 'menu_router', 'file'); $schema['registry'] = array( 'fields' => array( 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'type' => array('type' => 'varchar', 'length' => 9, 'not null' => TRUE, 'default' => ''), 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'suffix' => array('type' => 'varchar', 'length' => 68, 'not null' => TRUE, 'default' => ''), 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), ), 'primary key' => array('name', 'type'), 'indexes' => array( - 'hook' => array('type', 'weight', 'module'), + 'hook' => array('type', 'suffix', 'weight', 'module'), ), ); $schema['registry_file'] = array( @@ -1922,10 +1919,11 @@ function system_update_7013() { } /** - * Drop the bootstrap column from the {system} table. This was reverted. + * Drop the bootstrap column from the {system} table. */ function system_update_7014() { $ret = array(); + db_drop_field($ret, 'system', 'bootstrap'); return $ret; } diff --git a/modules/system/system.module b/modules/system/system.module index 0d01643ee..c304bf061 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -501,22 +501,18 @@ function system_menu() { 'page callback' => 'ajax_form_callback', 'access callback' => TRUE, 'type' => MENU_CALLBACK, - 'file path' => 'includes', - 'file' => 'form.inc', ); $items['system/timezone'] = array( 'title' => 'Time zone', 'page callback' => 'system_timezone', 'access callback' => TRUE, 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['system/run-cron-image'] = array( 'title' => 'Execute cron', 'page callback' => 'system_run_cron_image', 'access callback' => 'system_run_cron_image_access', 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['admin'] = array( 'title' => 'Administer', @@ -524,21 +520,18 @@ function system_menu() { 'page callback' => 'system_main_admin_page', 'weight' => 9, 'menu_name' => 'management', - 'file' => 'system.admin.inc', ); $items['admin/compact'] = array( 'title' => 'Compact mode', 'page callback' => 'system_admin_compact_page', 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['admin/by-task'] = array( 'title' => 'By task', 'page callback' => 'system_main_admin_page', 'access arguments' => array('access administration pages'), 'type' => MENU_DEFAULT_LOCAL_TASK, - 'file' => 'system.admin.inc', ); $items['admin/by-module'] = array( 'title' => 'By module', @@ -546,7 +539,6 @@ function system_menu() { 'access arguments' => array('access administration pages'), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'system.admin.inc', ); // Menu items that are basically just menu blocks. @@ -558,7 +550,6 @@ function system_menu() { 'page callback' => 'system_settings_overview', 'access callback' => 'system_admin_menu_block_access', 'access arguments' => array('admin/settings', 'access administration pages'), - 'file' => 'system.admin.inc', ); $items['admin/structure'] = array( 'title' => 'Structure', @@ -568,7 +559,6 @@ function system_menu() { 'page callback' => 'system_admin_menu_block_page', 'access callback' => 'system_admin_menu_block_access', 'access arguments' => array('admin/structure', 'access administration pages'), - 'file' => 'system.admin.inc', ); // Appearance. $items['admin/appearance'] = array( @@ -579,21 +569,18 @@ function system_menu() { 'access arguments' => array('administer site configuration'), 'position' => 'left', 'weight' => -6, - 'file' => 'system.admin.inc', ); $items['admin/appearance/select'] = array( 'title' => 'List', 'description' => 'Select the default theme for your site.', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1, - 'file' => 'system.admin.inc', ); $items['admin/appearance/settings'] = array( 'title' => 'Configure', 'page arguments' => array('system_theme_settings'), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, - 'file' => 'system.admin.inc', ); // Theme configuration subtabs. $items['admin/appearance/settings/global'] = array( @@ -609,7 +596,6 @@ function system_menu() { 'type' => MENU_LOCAL_TASK, 'access callback' => '_system_themes_access', 'access arguments' => array($theme), - 'file' => 'system.admin.inc', ); } @@ -618,14 +604,12 @@ function system_menu() { 'title' => 'Configuration and modules', 'page callback' => 'system_admin_config_page', 'access arguments' => array('access administration pages'), - 'file' => 'system.admin.inc', ); $items['admin/config/config'] = array( 'title' => 'Configuration', 'access arguments' => array('administer site configuration'), 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, - 'file' => 'system.admin.inc', ); $items['admin/config/modules'] = array( 'title' => 'Modules', @@ -633,7 +617,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_modules'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', 'type' => MENU_LOCAL_TASK, 'weight' => 10, ); @@ -651,25 +634,11 @@ function system_menu() { 'page arguments' => array('system_modules_uninstall'), 'access arguments' => array('administer site configuration'), 'type' => MENU_LOCAL_TASK, - 'file' => 'system.admin.inc', ); $items['admin/config/modules/uninstall/confirm'] = array( 'title' => 'Uninstall', 'access arguments' => array('administer site configuration'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', - ); - - // Development menu category. - $items['admin/development'] = array( - 'title' => 'Development', - 'description' => 'Development tools.', - 'position' => 'right', - 'weight' => -7, - 'page callback' => 'system_admin_menu_block_page', - 'access callback' => 'system_admin_menu_block_access', - 'access arguments' => array('admin/development', 'access administration pages'), - 'file' => 'system.admin.inc', ); // Actions. @@ -677,8 +646,7 @@ function system_menu() { 'title' => 'Actions', 'description' => 'Manage the actions defined for your site.', 'access arguments' => array('administer actions'), - 'page callback' => 'system_actions_manage', - 'file' => 'system.admin.inc', + 'page callback' => 'system_actions_manage' ); $items['admin/settings/actions/manage'] = array( 'title' => 'Manage actions', @@ -686,7 +654,6 @@ function system_menu() { 'page callback' => 'system_actions_manage', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -2, - 'file' => 'system.admin.inc', ); $items['admin/settings/actions/configure'] = array( 'title' => 'Configure an advanced action', @@ -694,7 +661,6 @@ function system_menu() { 'page arguments' => array('system_actions_configure'), 'access arguments' => array('administer actions'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['admin/settings/actions/delete/%actions'] = array( 'title' => 'Delete action', @@ -703,14 +669,12 @@ function system_menu() { 'page arguments' => array('system_actions_delete_form', 4), 'access arguments' => array('administer actions'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['admin/settings/actions/orphan'] = array( 'title' => 'Remove orphans', 'page callback' => 'system_actions_remove_orphans', 'access arguments' => array('administer actions'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); // IP address blocking. @@ -719,7 +683,6 @@ function system_menu() { 'description' => 'Manage blocked IP addresses.', 'page callback' => 'system_ip_blocking', 'access arguments' => array('block IP addresses'), - 'file' => 'system.admin.inc', ); $items['admin/settings/ip-blocking/%'] = array( 'title' => 'IP address blocking', @@ -727,7 +690,6 @@ function system_menu() { 'page callback' => 'system_ip_blocking', 'access arguments' => array('block IP addresses'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['admin/settings/ip-blocking/delete/%blocked_ip'] = array( 'title' => 'Delete IP address', @@ -735,19 +697,17 @@ function system_menu() { 'page arguments' => array('system_ip_blocking_delete', 4), 'access arguments' => array('block IP addresses'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); // Configuration. $items['admin/config/development'] = array( - 'title' => 'Development', - 'description' => 'Development tools.', - 'position' => 'left', - 'weight' => 10, - 'page callback' => 'system_admin_menu_block_page', - 'access callback' => 'system_admin_menu_block_access', - 'access arguments' => array('admin/config/development', 'access administration pages'), - 'file' => 'system.admin.inc', + 'title' => 'Development', + 'description' => 'Development tools.', + 'position' => 'left', + 'weight' => 10, + 'page callback' => 'system_admin_menu_block_page', + 'access callback' => 'system_admin_menu_block_access', + 'access arguments' => array('admin/config/development', 'access administration pages'), ); $items['admin/config/development/maintenance'] = array( 'title' => 'Maintenance mode', @@ -755,7 +715,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_site_maintenance_mode'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/config/development/performance'] = array( 'title' => 'Performance', @@ -763,17 +722,15 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_performance_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/config/media'] = array( - 'title' => 'Media', - 'description' => 'Media tools.', - 'position' => 'left', - 'weight' => 10, - 'page callback' => 'system_admin_menu_block_page', - 'access callback' => 'system_admin_menu_block_access', - 'access arguments' => array('admin/config/media', 'access administration pages'), - 'file' => 'system.admin.inc', + 'title' => 'Media', + 'description' => 'Media tools.', + 'position' => 'left', + 'weight' => 10, + 'page callback' => 'system_admin_menu_block_page', + 'access callback' => 'system_admin_menu_block_access', + 'access arguments' => array('admin/config/media', 'access administration pages'), ); $items['admin/config/media/file-system'] = array( 'title' => 'File system', @@ -781,7 +738,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_file_system_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/config/media/image-toolkit'] = array( 'title' => 'Image toolkit', @@ -789,15 +745,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_image_toolkit_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', - ); - $items['admin/settings/performance'] = array( - 'title' => 'Performance', - 'description' => 'Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_performance_settings'), - 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/config/development/logging'] = array( 'title' => 'Logging and errors', @@ -805,17 +752,15 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_logging_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/config/regional'] = array( - 'title' => 'Regional and language', - 'description' => 'Regional settings, localization and translation.', - 'position' => 'left', - 'weight' => -7, - 'page callback' => 'system_admin_menu_block_page', - 'access callback' => 'system_admin_menu_block_access', - 'access arguments' => array('admin/config/regional', 'access administration pages'), - 'file' => 'system.admin.inc', + 'title' => 'Regional and language', + 'description' => 'Regional settings, localization and translation.', + 'position' => 'left', + 'weight' => -7, + 'page callback' => 'system_admin_menu_block_page', + 'access callback' => 'system_admin_menu_block_access', + 'access arguments' => array('admin/config/regional', 'access administration pages'), ); $items['admin/config/regional/settings'] = array( 'title' => 'Regional settings', @@ -824,16 +769,14 @@ function system_menu() { 'page arguments' => array('system_regional_settings'), 'access arguments' => array('administer site configuration'), 'weight' => -10, - 'file' => 'system.admin.inc', ); $items['admin/config/regional/settings/lookup'] = array( 'title' => 'Date and time lookup', 'type' => MENU_CALLBACK, 'page callback' => 'system_date_time_lookup', 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); - + // Settings. $items['admin/settings/site-information'] = array( 'title' => 'Site information', @@ -841,7 +784,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_site_information_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/settings/rss-publishing'] = array( 'title' => 'RSS publishing', @@ -849,7 +791,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_rss_feeds_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/settings/clean-urls'] = array( 'title' => 'Clean URLs', @@ -857,7 +798,6 @@ function system_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('system_clean_url_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/settings/clean-urls/check'] = array( 'title' => 'Clean URL check', @@ -865,7 +805,6 @@ function system_menu() { 'page arguments' => array(array('status' => TRUE)), 'access callback' => TRUE, 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); // Reports. @@ -877,7 +816,6 @@ function system_menu() { 'access arguments' => array('admin/reports', 'access site reports'), 'weight' => 5, 'position' => 'left', - 'file' => 'system.admin.inc', ); $items['admin/reports/status'] = array( 'title' => 'Status report', @@ -885,28 +823,24 @@ function system_menu() { 'page callback' => 'system_status', 'weight' => 10, 'access arguments' => array('administer site configuration'), - 'file' => 'system.admin.inc', ); $items['admin/reports/status/run-cron'] = array( 'title' => 'Run cron', 'page callback' => 'system_run_cron', 'access arguments' => array('administer site configuration'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); $items['admin/reports/status/php'] = array( 'title' => 'PHP', 'page callback' => 'system_php', 'access arguments' => array('administer site configuration'), 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); // Default page for batch operations. $items['batch'] = array( 'page callback' => 'system_batch_page', 'access callback' => TRUE, 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', ); return $items; } @@ -1341,7 +1275,7 @@ function system_filetransfer_backends() { 'weight' => 0, ); } - + if (ini_get('allow_url_fopen')) { $backends['ftp_wrapper'] = array( 'title' => t('FTP using file streams'), @@ -1350,7 +1284,7 @@ function system_filetransfer_backends() { 'weight' => 10, ); } - + // SSH2 lib connection is only available if the proper PHP extension is // installed. if (function_exists('ssh2_connect')) { @@ -1376,7 +1310,7 @@ function system_filetransfer_backends() { function system_get_filetransfer_settings_form($filetransfer_backend_name, $defaults) { $available_backends = module_invoke_all('filetransfer_backends'); $form = call_user_func($available_backends[$filetransfer_backend_name]['settings_form']); - + foreach ($form as $name => &$element) { if (isset($defaults[$name])) { $element['#default_value'] = $defaults[$name]; @@ -1408,30 +1342,30 @@ function system_filetransfer_backend_form_ssh() { */ function _system_filetransfer_backend_form_common() { $form = array(); - + $form['hostname'] = array ( '#type' => 'textfield', '#title' => t('Host'), '#default_value' => 'localhost', ); - + $form['port'] = array ( '#type' => 'textfield', '#title' => t('Port'), '#default_value' => NULL, ); - + $form['username'] = array ( '#type' => 'textfield', '#title' => t('Username'), ); - + $form['password'] = array ( '#type' => 'password', '#title' => t('Password'), '#description' => t('This is not saved in the database and is only used to test the connection'), ); - + return $form; } @@ -1710,7 +1644,7 @@ function system_admin_menu_block($item) { */ function system_check_directory($form_element) { $directory = $form_element['#value']; - + if (!is_dir($directory) && !drupal_mkdir($directory, NULL, TRUE)) { // If the directory does not exists and cannot be created. form_set_error($form_element['#parents'][0], t('The directory %directory does not exist and could not be created.', array('%directory' => $directory))); @@ -1867,7 +1801,6 @@ function _system_get_module_data() { 'version' => NULL, 'php' => DRUPAL_MINIMUM_PHP, 'files' => array(), - 'bootstrap' => 0, ); // Read info files for each module. @@ -1906,22 +1839,6 @@ function system_get_module_data() { ksort($modules); system_get_files_database($modules, 'module'); system_update_files_database($modules, 'module'); - // Refresh bootstrap status. - $bootstrap_modules = array(); - foreach (bootstrap_hooks() as $hook) { - foreach (module_implements($hook) as $module) { - $bootstrap_modules[] = $module; - } - } - $query = db_update('system')->fields(array('bootstrap' => 0)); - if ($bootstrap_modules) { - db_update('system') - ->fields(array('bootstrap' => 1)) - ->condition('name', $bootstrap_modules, 'IN') - ->execute(); - $query->condition('name', $bootstrap_modules, 'NOT IN'); - } - $query->execute(); $modules = _module_build_dependencies($modules); return $modules; } @@ -2671,7 +2588,7 @@ function system_actions_configure($form_state, $action = NULL) { function system_actions_configure_validate($form, $form_state) { $function = actions_function_lookup($form_state['values']['actions_action']) . '_validate'; // Hand off validation to the action. - if (function_exists($function)) { + if (drupal_function_exists($function)) { $function($form, $form_state); } } @@ -2831,7 +2748,7 @@ function system_send_email_action($object, $context) { } $recipient = token_replace($context['recipient'], $context); - + $language = user_preferred_language($account); $params = array('context' => $context); @@ -3024,11 +2941,10 @@ function theme_meta_generator_header($version = VERSION) { * Implement hook_image_toolkits(). */ function system_image_toolkits() { - include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'system') . '/' . 'image.gd.inc'; return array( 'gd' => array( 'title' => t('GD2 image manipulation toolkit'), - 'available' => function_exists('image_gd_check_settings') && image_gd_check_settings(), + 'available' => drupal_function_exists('image_gd_check_settings') && image_gd_check_settings(), ), ); } @@ -3056,18 +2972,18 @@ function system_retrieve_file($url, $destination = NULL, $overwrite = TRUE) { } $parsed_url = parse_url($url); $local = is_dir(file_directory_path() . '/' . $destination) ? $destination . '/' . basename($parsed_url['path']) : $destination; - + if (!$overwrite && file_exists($local)) { drupal_set_message(t('@remote could not be saved. @local already exists', array('@remote' => $url, '@local' => $local)), 'error'); return FALSE; } - + $result = drupal_http_request($url); if ($result->code != 200 || !file_save_data($result->data, $local)) { drupal_set_message(t('@remote could not be saved.', array('@remote' => $url)), 'error'); return FALSE; } - + return $local; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 495aa28fd..f2cfa376e 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -196,7 +196,6 @@ function taxonomy_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('taxonomy_overview_vocabularies'), 'access arguments' => array('administer taxonomy'), - 'file' => 'taxonomy.admin.inc', ); $items['admin/structure/taxonomy/list'] = array( @@ -211,7 +210,6 @@ function taxonomy_menu() { 'page arguments' => array('taxonomy_form_vocabulary'), 'access arguments' => array('administer taxonomy'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'taxonomy.admin.inc', ); $items['taxonomy/term/%taxonomy_term'] = array( @@ -222,7 +220,6 @@ function taxonomy_menu() { 'page arguments' => array(2), 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, - 'file' => 'taxonomy.pages.inc', ); $items['taxonomy/term/%taxonomy_term/view'] = array( @@ -237,7 +234,6 @@ function taxonomy_menu() { 'access arguments' => array('administer taxonomy'), 'type' => MENU_LOCAL_TASK, 'weight' => 10, - 'file' => 'taxonomy.pages.inc', ); $items['taxonomy/term/%taxonomy_term/feed'] = array( 'title' => 'Taxonomy term', @@ -247,14 +243,12 @@ function taxonomy_menu() { 'page arguments' => array(2), 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, - 'file' => 'taxonomy.feeds.inc', ); $items['taxonomy/autocomplete'] = array( 'title' => 'Autocomplete taxonomy', 'page callback' => 'taxonomy_autocomplete', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, - 'file' => 'taxonomy.pages.inc', ); // TODO: remove with taxonomy_term_node_* $items['taxonomy/autocomplete/legacy'] = array( @@ -272,7 +266,6 @@ function taxonomy_menu() { 'title arguments' => array(3), 'access arguments' => array('administer taxonomy'), 'type' => MENU_CALLBACK, - 'file' => 'taxonomy.admin.inc', ); $items['admin/structure/taxonomy/%taxonomy_vocabulary/edit'] = array( @@ -288,7 +281,6 @@ function taxonomy_menu() { 'access arguments' => array('administer taxonomy'), 'type' => MENU_LOCAL_TASK, 'weight' => -10, - 'file' => 'taxonomy.admin.inc', ); $items['admin/structure/taxonomy/%taxonomy_vocabulary/list/add'] = array( @@ -297,7 +289,6 @@ function taxonomy_menu() { 'page arguments' => array('taxonomy_form_term', 3), 'access arguments' => array('administer taxonomy'), 'type' => MENU_LOCAL_ACTION, - 'file' => 'taxonomy.admin.inc', ); return $items; @@ -1942,7 +1933,7 @@ function taxonomy_field_schema($field) { function taxonomy_field_validate($obj_type, $object, $field, $instance, $langcode, $items, &$errors) { $allowed_values = taxonomy_allowed_values($field); $widget = field_info_widget_types($instance['widget']['type']); - + // Check we don't exceed the allowed number of values for widgets with custom // behavior for multiple values (taxonomy_autocomplete widget). if ($widget['behaviors']['multiple values'] == FIELD_BEHAVIOR_CUSTOM && $field['cardinality'] >= 2) { @@ -2101,7 +2092,7 @@ function _taxonomy_clean_field_cache($term) { foreach ($field['settings']['allowed_values'] as $tree) { $vids[$tree['vid']] = $tree['vid']; } - + // Check this term's vocabulary against those used for the field's options. if (in_array($term->vid, $vids)) { $conditions = array(array('value', $term->tid)); diff --git a/modules/taxonomy/taxonomy.pages.inc b/modules/taxonomy/taxonomy.pages.inc index 488db5762..7d50436da 100644 --- a/modules/taxonomy/taxonomy.pages.inc +++ b/modules/taxonomy/taxonomy.pages.inc @@ -82,7 +82,6 @@ function taxonomy_term_feed($term) { function taxonomy_term_edit($term) { if (isset($term)) { drupal_set_title($term->name); - include_once DRUPAL_ROOT . '/'. drupal_get_path('module', 'taxonomy') . '/taxonomy.admin.inc'; return drupal_get_form('taxonomy_form_term', taxonomy_vocabulary_load($term->vid), (array)$term); } return drupal_not_found(); diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 89ea0e826..11c0f7d5a 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -28,7 +28,6 @@ function tracker_menu() { 'page callback' => 'tracker_page', 'access arguments' => array('access content'), 'weight' => 1, - 'file' => 'tracker.pages.inc', ); $items['tracker/all'] = array( 'title' => 'All recent posts', @@ -49,7 +48,6 @@ function tracker_menu() { 'access callback' => '_tracker_user_access', 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, - 'file' => 'tracker.pages.inc', ); $items['user/%user/track/posts'] = array( 'title' => 'Track posts', diff --git a/modules/translation/translation.module b/modules/translation/translation.module index 8c1b5b07f..6bfef4e18 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -63,7 +63,6 @@ function translation_menu() { 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, 'weight' => 2, - 'file' => 'translation.pages.inc', ); return $items; } diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module index c085741a0..d6fedc64f 100644 --- a/modules/trigger/trigger.module +++ b/modules/trigger/trigger.module @@ -40,7 +40,6 @@ function trigger_menu() { 'description' => 'Tell Drupal when to execute actions.', 'page callback' => 'trigger_assign', 'access arguments' => array('administer actions'), - 'file' => 'trigger.admin.inc', ); // Explicitly define the system menu item so we can label it "cron" rather @@ -51,7 +50,6 @@ function trigger_menu() { 'page arguments' => array('system'), 'access arguments' => array('administer actions'), 'type' => MENU_LOCAL_TASK, - 'file' => 'trigger.admin.inc', ); // We want contributed modules to be able to describe @@ -75,7 +73,6 @@ function trigger_menu() { 'page arguments' => array($module), 'access arguments' => array('administer actions'), 'type' => MENU_LOCAL_TASK, - 'file' => 'trigger.admin.inc', ); } $items['admin/structure/trigger/unassign'] = array( @@ -85,7 +82,6 @@ function trigger_menu() { 'page arguments' => array('trigger_unassign'), 'access arguments' => array('administer actions'), 'type' => MENU_CALLBACK, - 'file' => 'trigger.admin.inc', ); return $items; diff --git a/modules/update/update.module b/modules/update/update.module index f41ec8b61..626560e92 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -132,7 +132,6 @@ function update_menu() { 'page callback' => 'update_status', 'access arguments' => array('administer site configuration'), 'weight' => 10, - 'file' => 'update.report.inc', ); $items['admin/settings/updates'] = array( 'title' => 'Updates', @@ -140,14 +139,12 @@ function update_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('update_settings'), 'access arguments' => array('administer site configuration'), - 'file' => 'update.settings.inc', ); $items['admin/reports/updates/check'] = array( 'title' => 'Manual update check', 'page callback' => 'update_manual_status', 'access arguments' => array('administer site configuration'), 'type' => MENU_CALLBACK, - 'file' => 'update.fetch.inc', ); return $items; diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 26a284439..9625e8263 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -99,7 +99,6 @@ function upload_menu() { 'page arguments' => array('upload_admin_settings'), 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, - 'file' => 'upload.admin.inc', ); return $items; } diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index b7f3ff4a1..1ec1221b2 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -938,3 +938,41 @@ function theme_user_filters($form) { return $output; } + +/** + * Implementation of hook_modules_installed(). + */ +function user_modules_installed($modules) { + // Assign all available permissions to the administrator role. + $rid = variable_get('user_admin_role', 0); + if ($rid) { + foreach ($modules as $module) { + if ($permissions = module_invoke($module, 'permission')) { + foreach (array_keys($permissions) as $permission) { + db_insert('role_permission') + ->fields(array( + 'rid' => $rid, + 'permission' => $permission, + ))->execute(); + } + } + } + } +} + +/** + * Implement hook_modules_uninstalled(). + */ +function user_modules_uninstalled($modules) { + $permissions = array(); + foreach ($modules as $module) { + if (drupal_function_exists($module . '_permission')) { + $permissions = array_merge($permissions, array_keys(module_invoke($module, 'permission'))); + } + } + if (!empty($permissions)) { + db_delete('role_permission') + ->condition('permission', $permissions, 'IN') + ->execute(); + } +} diff --git a/modules/user/user.module b/modules/user/user.module index 926e6cc32..a35154dc2 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -433,7 +433,7 @@ function user_save($account, $edit = array(), $category = 'account') { if (($picture->status & FILE_STATUS_PERMANENT) == 0) { $info = image_get_info($picture->uri); $picture_directory = variable_get('file_default_scheme', 'public') . '://' . variable_get('user_picture_path', 'pictures'); - + // Prepare the pictures directory. file_prepare_directory($picture_directory, FILE_CREATE_DIRECTORY); $destination = file_stream_wrapper_uri_normalize($picture_directory . '/picture-' . $account->uid . '.' . $info['extension']); @@ -1298,7 +1298,6 @@ function user_menu() { 'access callback' => 'user_access', 'access arguments' => array('access user profiles'), 'type' => MENU_CALLBACK, - 'file' => 'user.pages.inc', ); // Registration and login pages. @@ -1307,7 +1306,6 @@ function user_menu() { 'page callback' => 'user_page', 'access callback' => TRUE, 'type' => MENU_CALLBACK, - 'file' => 'user.pages.inc', ); $items['user/login'] = array( @@ -1330,7 +1328,6 @@ function user_menu() { 'page arguments' => array('user_pass'), 'access callback' => 'user_is_anonymous', 'type' => MENU_LOCAL_TASK, - 'file' => 'user.pages.inc', ); $items['user/reset/%/%/%'] = array( 'title' => 'Reset password', @@ -1338,7 +1335,6 @@ function user_menu() { 'page arguments' => array('user_pass_reset', 2, 3, 4), 'access callback' => TRUE, 'type' => MENU_CALLBACK, - 'file' => 'user.pages.inc', ); $items['user/logout'] = array( @@ -1347,7 +1343,6 @@ function user_menu() { 'page callback' => 'user_logout', 'weight' => 10, 'menu_name' => 'user-menu', - 'file' => 'user.pages.inc', ); // User listing pages. @@ -1359,7 +1354,6 @@ function user_menu() { 'access arguments' => array('administer users'), 'position' => 'left', 'weight' => -4, - 'file' => 'user.admin.inc', ); $items['admin/people/list'] = array( 'title' => 'List', @@ -1388,7 +1382,6 @@ function user_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('user_admin_settings'), 'access arguments' => array('administer users'), - 'file' => 'user.admin.inc', 'weight' => -10, ); $items['admin/config/people/accounts/settings'] = array( @@ -1404,7 +1397,6 @@ function user_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('user_admin_new_role'), 'access arguments' => array('administer permissions'), - 'file' => 'user.admin.inc', 'weight' => -9, ); $items['admin/config/people/roles/edit'] = array( @@ -1419,7 +1411,6 @@ function user_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('user_admin_permissions'), 'access arguments' => array('administer permissions'), - 'file' => 'user.admin.inc', 'weight' => -8, ); @@ -1433,7 +1424,6 @@ function user_menu() { 'access arguments' => array(1), 'weight' => -10, 'menu_name' => 'user-menu', - 'file' => 'user.pages.inc', ); $items['user/%user/view'] = array( @@ -1449,7 +1439,6 @@ function user_menu() { 'access callback' => 'user_cancel_access', 'access arguments' => array(1), 'type' => MENU_CALLBACK, - 'file' => 'user.pages.inc', ); $items['user/%user/cancel/confirm/%/%'] = array( @@ -1459,7 +1448,6 @@ function user_menu() { 'access callback' => 'user_cancel_access', 'access arguments' => array(1), 'type' => MENU_CALLBACK, - 'file' => 'user.pages.inc', ); $items['user/%user/edit'] = array( @@ -1469,7 +1457,6 @@ function user_menu() { 'access callback' => 'user_edit_access', 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, - 'file' => 'user.pages.inc', ); $items['user/%user_category/edit/account'] = array( @@ -1493,7 +1480,6 @@ function user_menu() { 'weight' => $category['weight'], 'load arguments' => array('%map', '%index'), 'tab_parent' => 'user/%/edit', - 'file' => 'user.pages.inc', ); } } @@ -1725,7 +1711,7 @@ function user_login_authenticate_validate($form, &$form_state) { /** * The final validation handler on the login form. - * + * * Sets a form error if user has not been authenticated, or if too many * logins have been attempted. This validation function should always * be the last one. @@ -3039,41 +3025,3 @@ function _user_forms(&$edit, $account, $category, $hook = 'form') { return empty($groups) ? FALSE : $groups; } - -/** - * Implementation of hook_modules_installed(). - */ -function user_modules_installed($modules) { - // Assign all available permissions to the administrator role. - $rid = variable_get('user_admin_role', 0); - if ($rid) { - foreach ($modules as $module) { - if ($permissions = module_invoke($module, 'permission')) { - foreach (array_keys($permissions) as $permission) { - db_insert('role_permission') - ->fields(array( - 'rid' => $rid, - 'permission' => $permission, - ))->execute(); - } - } - } - } -} - -/** - * Implement hook_modules_uninstalled(). - */ -function user_modules_uninstalled($modules) { - $permissions = array(); - foreach ($modules as $module) { - if (function_exists($module . '_permission')) { - $permissions = array_merge($permissions, array_keys(module_invoke($module, 'permission'))); - } - } - if (!empty($permissions)) { - db_delete('role_permission') - ->condition('permission', $permissions, 'IN') - ->execute(); - } -} |