Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.906 diff -u -p -r1.906 common.inc --- includes/common.inc 20 May 2009 06:03:06 -0000 1.906 +++ includes/common.inc 20 May 2009 20:18:10 -0000 @@ -2959,7 +2959,9 @@ function _drupal_bootstrap_full() { // Undo magic quotes fix_gpc_magic(); // Load all enabled modules - module_load_all(); + drupal_load('module', 'system'); + drupal_load('module', 'filter'); + #module_load_all(); // Let all modules take action before menu system handles the request // We do not want this while running update.php. @@ -4242,7 +4244,7 @@ function drupal_flush_all_caches() { drupal_theme_rebuild(); // Rebuild content types, menu will be rebuilt as well. - node_types_rebuild(); + module_invoke('node', 'types_rebuild'); // Don't clear cache_form - in-progress form submissions may break. // Ordered so clearing the page cache will always be the last action. $core = array('cache', 'cache_filter', 'cache_registry', 'cache_page'); Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.324 diff -u -p -r1.324 menu.inc --- includes/menu.inc 14 May 2009 08:35:58 -0000 1.324 +++ includes/menu.inc 20 May 2009 19:22:45 -0000 @@ -399,6 +399,11 @@ function menu_execute_active_handler($pa if ($router_item = menu_get_item($path)) { if ($router_item['access']) { if (drupal_function_exists($router_item['page_callback'])) { + preg_match('/^[^_]+/', $router_item['page_callback'], $matches); + if ($matches[0] == 'drupal') { + preg_match('/^[^_]+/', $router_item['page_arguments'][0], $matches); + } + drupal_load('module', $matches[0]); return call_user_func_array($router_item['page_callback'], $router_item['page_arguments']); } } Index: modules/aggregator/aggregator.bootstrap.inc =================================================================== RCS file: modules/aggregator/aggregator.bootstrap.inc diff -N modules/aggregator/aggregator.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/aggregator/aggregator.bootstrap.inc 20 May 2009 18:49:55 -0000 @@ -0,0 +1,43 @@ +' . t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
'; + $output .= '' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the main aggregator display or by their source. Administrators can add, edit and delete feeds and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the blocks administration page. A machine-readable OPML file of all feeds is available. A correctly configured cron maintenance task is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Aggregator module.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '
'; + return $output; + case 'admin/content/aggregator': + $output = '' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
'; + $output .= '' . t('Current feeds are listed below, and new feeds may be added. For each feed or feed category, the latest items block may be enabled at the blocks administration page.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) . '
'; + return $output; + case 'admin/content/aggregator/add/feed': + return '' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '
'; + case 'admin/content/aggregator/add/category': + return '' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named Sports. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the Categorize page available from feed item listings). Each category provides its own feed page and block.') . '
'; + case 'admin/content/aggregator/add/opml': + return '' . t('OPML is an XML format used to exchange multiple feeds between aggregators. A single OPML document may contain a collection of many feeds. Drupal can parse such a file and import all feeds at once, saving you the effort of adding them manually. You may either upload a local file from your computer or enter a URL where Drupal can download it.') . '
'; + } +} + Index: modules/aggregator/aggregator.info =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.info,v retrieving revision 1.11 diff -u -p -r1.11 aggregator.info --- modules/aggregator/aggregator.info 15 Mar 2009 18:59:05 -0000 1.11 +++ modules/aggregator/aggregator.info 20 May 2009 18:49:55 -0000 @@ -11,3 +11,5 @@ files[] = aggregator.fetcher.inc files[] = aggregator.parser.inc files[] = aggregator.processor.inc files[] = aggregator.install +files[] = aggregator.registry.inc +files[] = aggregator.bootstrap.inc Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.409 diff -u -p -r1.409 aggregator.module --- modules/aggregator/aggregator.module 18 May 2009 14:23:22 -0000 1.409 +++ modules/aggregator/aggregator.module 20 May 2009 18:49:55 -0000 @@ -2,234 +2,6 @@ // $Id: aggregator.module,v 1.409 2009/05/18 14:23:22 dries Exp $ /** - * @file - * Used to aggregate syndicated content (RSS, RDF, and Atom). - */ - -/** - * Implementation of hook_help(). - */ -function aggregator_help($path, $arg) { - switch ($path) { - case 'admin/help#aggregator': - $output = '' . t('The aggregator is a powerful on-site syndicator and news reader that gathers fresh content from RSS-, RDF-, and Atom-based feeds made available across the web. Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
'; - $output .= '' . t('Feeds contain feed items, or individual posts published by the site providing the feed. Feeds may be grouped in categories, generally by topic. Users view feed items in the main aggregator display or by their source. Administrators can add, edit and delete feeds and choose how often to check each feed for newly updated items. The most recent items in either a feed or category can be displayed as a block through the blocks administration page. A machine-readable OPML file of all feeds is available. A correctly configured cron maintenance task is required to update feeds automatically.', array('@aggregator' => url('aggregator'), '@aggregator-sources' => url('aggregator/sources'), '@feededit' => url('admin/content/aggregator'), '@admin-block' => url('admin/build/block'), '@aggregator-opml' => url('aggregator/opml'), '@cron' => url('admin/reports/status'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Aggregator module.', array('@aggregator' => 'http://drupal.org/handbook/modules/aggregator/')) . '
'; - return $output; - case 'admin/content/aggregator': - $output = '' . t('Thousands of sites (particularly news sites and blogs) publish their latest headlines and posts in feeds, using a number of standardized XML-based formats. Formats supported by the aggregator include RSS, RDF, and Atom.', array('@rss' => 'http://cyber.law.harvard.edu/rss/', '@rdf' => 'http://www.w3.org/RDF/', '@atom' => 'http://www.atomenabled.org')) . '
'; - $output .= '' . t('Current feeds are listed below, and new feeds may be added. For each feed or feed category, the latest items block may be enabled at the blocks administration page.', array('@addfeed' => url('admin/content/aggregator/add/feed'), '@block' => url('admin/build/block'))) . '
'; - return $output; - case 'admin/content/aggregator/add/feed': - return '' . t('Add a feed in RSS, RDF or Atom format. A feed may only have one entry.') . '
'; - case 'admin/content/aggregator/add/category': - return '' . t('Categories allow feed items from different feeds to be grouped together. For example, several sport-related feeds may belong to a category named Sports. Feed items may be grouped automatically (by selecting a category when creating or editing a feed) or manually (via the Categorize page available from feed item listings). Each category provides its own feed page and block.') . '
'; - case 'admin/content/aggregator/add/opml': - return '' . t('OPML is an XML format used to exchange multiple feeds between aggregators. A single OPML document may contain a collection of many feeds. Drupal can parse such a file and import all feeds at once, saving you the effort of adding them manually. You may either upload a local file from your computer or enter a URL where Drupal can download it.') . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function aggregator_theme() { - return array( - 'aggregator_wrapper' => array( - 'arguments' => array('content' => NULL), - 'template' => 'aggregator-wrapper', - ), - 'aggregator_categorize_items' => array( - 'arguments' => array('form' => NULL), - ), - 'aggregator_feed_source' => array( - 'arguments' => array('feed' => NULL), - 'template' => 'aggregator-feed-source', - ), - 'aggregator_block_item' => array( - 'arguments' => array('item' => NULL, 'feed' => 0), - ), - 'aggregator_summary_items' => array( - 'arguments' => array('summary_items' => NULL, 'source' => NULL), - 'template' => 'aggregator-summary-items', - ), - 'aggregator_summary_item' => array( - 'arguments' => array('item' => NULL), - 'template' => 'aggregator-summary-item', - ), - 'aggregator_item' => array( - 'arguments' => array('item' => NULL), - 'template' => 'aggregator-item', - ), - 'aggregator_page_opml' => array( - 'arguments' => array('feeds' => NULL), - ), - 'aggregator_page_rss' => array( - 'arguments' => array('feeds' => NULL, 'category' => NULL), - ), - ); -} - -/** - * Implementation of hook_menu(). - */ -function aggregator_menu() { - $items['admin/content/aggregator'] = array( - 'title' => 'Feed aggregator', - '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'), - ); - $items['admin/content/aggregator/add/feed'] = array( - 'title' => 'Add feed', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_feed'), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - 'parent' => 'admin/content/aggregator', - ); - $items['admin/content/aggregator/add/category'] = array( - 'title' => 'Add category', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_category'), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - 'parent' => 'admin/content/aggregator', - ); - $items['admin/content/aggregator/add/opml'] = array( - 'title' => 'Import OPML', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_opml'), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - 'parent' => 'admin/content/aggregator', - ); - $items['admin/content/aggregator/remove/%aggregator_feed'] = array( - 'title' => 'Remove items', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_admin_remove_feed', 4), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_CALLBACK, - ); - $items['admin/content/aggregator/update/%aggregator_feed'] = array( - 'title' => 'Update items', - 'page callback' => 'aggregator_admin_refresh_feed', - 'page arguments' => array(4), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_CALLBACK, - ); - $items['admin/content/aggregator/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/settings/aggregator'] = array( - 'title' => 'Aggregator', - 'description' => 'Configure the behavior of the feed aggregator, including when to discard feed items and how to present feed items and categories.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_admin_form'), - 'access arguments' => array('administer news feeds'), - ); - $items['aggregator'] = array( - 'title' => 'Feed aggregator', - 'page callback' => 'aggregator_page_last', - 'access arguments' => array('access news feeds'), - 'weight' => 5, - ); - $items['aggregator/sources'] = array( - 'title' => 'Sources', - 'page callback' => 'aggregator_page_sources', - 'access arguments' => array('access news feeds'), - ); - $items['aggregator/categories'] = array( - 'title' => 'Categories', - 'page callback' => 'aggregator_page_categories', - 'access callback' => '_aggregator_has_categories', - ); - $items['aggregator/rss'] = array( - 'title' => 'RSS feed', - 'page callback' => 'aggregator_page_rss', - 'access arguments' => array('access news feeds'), - 'type' => MENU_CALLBACK, - ); - $items['aggregator/opml'] = array( - 'title' => 'OPML feed', - 'page callback' => 'aggregator_page_opml', - 'access arguments' => array('access news feeds'), - 'type' => MENU_CALLBACK, - ); - $items['aggregator/categories/%aggregator_category'] = array( - 'title callback' => '_aggregator_category_title', - 'title arguments' => array(2), - 'page callback' => 'aggregator_page_category', - 'page arguments' => array(2), - 'access callback' => 'user_access', - 'access arguments' => array('access news feeds'), - ); - $items['aggregator/categories/%aggregator_category/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['aggregator/categories/%aggregator_category/categorize'] = array( - 'title' => 'Categorize', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_page_category', 2), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - ); - $items['aggregator/categories/%aggregator_category/configure'] = array( - 'title' => 'Configure', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_category', 2), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - $items['aggregator/sources/%aggregator_feed'] = array( - 'page callback' => 'aggregator_page_source', - 'page arguments' => array(2), - 'access arguments' => array('access news feeds'), - 'type' => MENU_CALLBACK, - ); - $items['aggregator/sources/%aggregator_feed/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['aggregator/sources/%aggregator_feed/categorize'] = array( - 'title' => 'Categorize', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_page_source', 2), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - ); - $items['aggregator/sources/%aggregator_feed/configure'] = array( - 'title' => 'Configure', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_feed', 2), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - $items['admin/content/aggregator/edit/feed/%aggregator_feed'] = array( - 'title' => 'Edit feed', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_feed', 5), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_CALLBACK, - ); - $items['admin/content/aggregator/edit/category/%aggregator_category'] = array( - 'title' => 'Edit category', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('aggregator_form_category', 5), - 'access arguments' => array('administer news feeds'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Menu callback. * * @return @@ -240,13 +12,6 @@ function _aggregator_category_title($cat } /** - * Implementation of hook_init(). - */ -function aggregator_init() { - drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.css'); -} - -/** * Find out whether there are any aggregator categories. * * @return Index: modules/aggregator/aggregator.registry.inc =================================================================== RCS file: modules/aggregator/aggregator.registry.inc diff -N modules/aggregator/aggregator.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/aggregator/aggregator.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,208 @@ + 'Feed aggregator', + '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'), + ); + $items['admin/content/aggregator/add/feed'] = array( + 'title' => 'Add feed', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_feed'), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + 'parent' => 'admin/content/aggregator', + ); + $items['admin/content/aggregator/add/category'] = array( + 'title' => 'Add category', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_category'), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + 'parent' => 'admin/content/aggregator', + ); + $items['admin/content/aggregator/add/opml'] = array( + 'title' => 'Import OPML', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_opml'), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + 'parent' => 'admin/content/aggregator', + ); + $items['admin/content/aggregator/remove/%aggregator_feed'] = array( + 'title' => 'Remove items', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_admin_remove_feed', 4), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_CALLBACK, + ); + $items['admin/content/aggregator/update/%aggregator_feed'] = array( + 'title' => 'Update items', + 'page callback' => 'aggregator_admin_refresh_feed', + 'page arguments' => array(4), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_CALLBACK, + ); + $items['admin/content/aggregator/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/settings/aggregator'] = array( + 'title' => 'Aggregator', + 'description' => 'Configure the behavior of the feed aggregator, including when to discard feed items and how to present feed items and categories.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_admin_form'), + 'access arguments' => array('administer news feeds'), + ); + $items['aggregator'] = array( + 'title' => 'Feed aggregator', + 'page callback' => 'aggregator_page_last', + 'access arguments' => array('access news feeds'), + 'weight' => 5, + ); + $items['aggregator/sources'] = array( + 'title' => 'Sources', + 'page callback' => 'aggregator_page_sources', + 'access arguments' => array('access news feeds'), + ); + $items['aggregator/categories'] = array( + 'title' => 'Categories', + 'page callback' => 'aggregator_page_categories', + 'access callback' => '_aggregator_has_categories', + ); + $items['aggregator/rss'] = array( + 'title' => 'RSS feed', + 'page callback' => 'aggregator_page_rss', + 'access arguments' => array('access news feeds'), + 'type' => MENU_CALLBACK, + ); + $items['aggregator/opml'] = array( + 'title' => 'OPML feed', + 'page callback' => 'aggregator_page_opml', + 'access arguments' => array('access news feeds'), + 'type' => MENU_CALLBACK, + ); + $items['aggregator/categories/%aggregator_category'] = array( + 'title callback' => '_aggregator_category_title', + 'title arguments' => array(2), + 'page callback' => 'aggregator_page_category', + 'page arguments' => array(2), + 'access callback' => 'user_access', + 'access arguments' => array('access news feeds'), + ); + $items['aggregator/categories/%aggregator_category/view'] = array( + 'title' => 'View', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['aggregator/categories/%aggregator_category/categorize'] = array( + 'title' => 'Categorize', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_page_category', 2), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + ); + $items['aggregator/categories/%aggregator_category/configure'] = array( + 'title' => 'Configure', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_category', 2), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 1, + ); + $items['aggregator/sources/%aggregator_feed'] = array( + 'page callback' => 'aggregator_page_source', + 'page arguments' => array(2), + 'access arguments' => array('access news feeds'), + 'type' => MENU_CALLBACK, + ); + $items['aggregator/sources/%aggregator_feed/view'] = array( + 'title' => 'View', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['aggregator/sources/%aggregator_feed/categorize'] = array( + 'title' => 'Categorize', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_page_source', 2), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + ); + $items['aggregator/sources/%aggregator_feed/configure'] = array( + 'title' => 'Configure', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_feed', 2), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 1, + ); + $items['admin/content/aggregator/edit/feed/%aggregator_feed'] = array( + 'title' => 'Edit feed', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_feed', 5), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_CALLBACK, + ); + $items['admin/content/aggregator/edit/category/%aggregator_category'] = array( + 'title' => 'Edit category', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('aggregator_form_category', 5), + 'access arguments' => array('administer news feeds'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function aggregator_theme() { + return array( + 'aggregator_wrapper' => array( + 'arguments' => array('content' => NULL), + 'template' => 'aggregator-wrapper', + ), + 'aggregator_categorize_items' => array( + 'arguments' => array('form' => NULL), + ), + 'aggregator_feed_source' => array( + 'arguments' => array('feed' => NULL), + 'template' => 'aggregator-feed-source', + ), + 'aggregator_block_item' => array( + 'arguments' => array('item' => NULL, 'feed' => 0), + ), + 'aggregator_summary_items' => array( + 'arguments' => array('summary_items' => NULL, 'source' => NULL), + 'template' => 'aggregator-summary-items', + ), + 'aggregator_summary_item' => array( + 'arguments' => array('item' => NULL), + 'template' => 'aggregator-summary-item', + ), + 'aggregator_item' => array( + 'arguments' => array('item' => NULL), + 'template' => 'aggregator-item', + ), + 'aggregator_page_opml' => array( + 'arguments' => array('feeds' => NULL), + ), + 'aggregator_page_rss' => array( + 'arguments' => array('feeds' => NULL, 'category' => NULL), + ), + ); +} + Index: modules/aggregator/tests/aggregator_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/tests/aggregator_test.info,v retrieving revision 1.1 diff -u -p -r1.1 aggregator_test.info --- modules/aggregator/tests/aggregator_test.info 2 Apr 2009 20:50:37 -0000 1.1 +++ modules/aggregator/tests/aggregator_test.info 20 May 2009 17:36:41 -0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = aggregator_test.module hidden = TRUE +files[] = aggregator_test.registry.inc Index: modules/aggregator/tests/aggregator_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/tests/aggregator_test.module,v retrieving revision 1.2 diff -u -p -r1.2 aggregator_test.module --- modules/aggregator/tests/aggregator_test.module 22 Apr 2009 09:45:02 -0000 1.2 +++ modules/aggregator/tests/aggregator_test.module 20 May 2009 17:28:58 -0000 @@ -2,20 +2,6 @@ // $Id: aggregator_test.module,v 1.2 2009/04/22 09:45:02 dries Exp $ /** - * Implementation of hook_menu(). - */ -function aggregator_test_menu() { - $items['aggregator/test-feed'] = array( - 'title' => 'Test feed static last modified date', - 'description' => "A cached test feed with a static last modified date.", - 'page callback' => 'aggregator_test_feed', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Page callback. Generates a test feed and simulates last-modified and etags. * * @param $use_last_modified Index: modules/aggregator/tests/aggregator_test.registry.inc =================================================================== RCS file: modules/aggregator/tests/aggregator_test.registry.inc diff -N modules/aggregator/tests/aggregator_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/aggregator/tests/aggregator_test.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,22 @@ + 'Test feed static last modified date', + 'description' => "A cached test feed with a static last modified date.", + 'page callback' => 'aggregator_test_feed', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + Index: modules/block/block.alter.inc =================================================================== RCS file: modules/block/block.alter.inc diff -N modules/block/block.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/block/block.alter.inc 20 May 2009 22:22:53 -0000 @@ -0,0 +1,88 @@ +' . $regions[$region] . ''; + $page[$region]['blocks']['block_description'] = array('#markup' => $description); + } + } + } +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + */ +function block_form_system_performance_settings_alter(&$form, &$form_state) { + + // Add the block cache fieldset on the performance settings page. + $form['block_cache'] = array( + '#type' => 'fieldset', + '#title' => t('Block cache'), + '#description' => t('Enabling the block cache can offer a performance increase for all users by preventing blocks from being reconstructed on each page load. If the page cache is also enabled, performance increases from enabling the block cache will mainly benefit authenticated users.'), + '#weight' => 0, + ); + + $form['block_cache']['block_cache'] = array( + '#type' => 'radios', + '#title' => t('Block cache'), + '#default_value' => variable_get('block_cache', CACHE_DISABLED), + '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Enabled (recommended)')), + '#disabled' => count(module_implements('node_grants')), + '#description' => t('Note that block caching is inactive when modules defining content access restrictions are enabled.'), + ); + + // Check if the "Who's online" block is enabled. + $online_block_enabled = db_select('block') + ->condition('module', 'user') + ->condition('delta', 'online') + ->condition('status', 1) + ->countQuery() + ->execute() + ->fetchField(); + + // If the "Who's online" block is enabled, append some descriptive text to + // the end of the form description. + if ($online_block_enabled) { + $form['page_cache']['cache']['#description'] .= '' . t('When caching is enabled, anonymous user sessions are only saved to the database when needed, so the "Who\'s online" block does not display the number of anonymous users.') . '
'; + } + +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + */ +function block_form_system_themes_form_alter(&$form, &$form_state) { + $form['#submit'][] = 'block_system_themes_form_submit'; +} + Index: modules/block/block.bootstrap.inc =================================================================== RCS file: modules/block/block.bootstrap.inc diff -N modules/block/block.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/block/block.bootstrap.inc 20 May 2009 18:49:55 -0000 @@ -0,0 +1,94 @@ +' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) . ''; + $output .= '' . t('Although blocks are usually generated automatically by modules (like the User login block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available text format.', array('@text-format' => url('admin/settings/filter'))) . '
'; + $output .= '' . t('When working with blocks, remember that:') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Block module.', array('@block' => 'http://drupal.org/handbook/modules/block/')) . '
'; + return $output; + case 'admin/build/block': + $output = '' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the Block column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
'; + $output .= '' . t('Click the configure link next to each block to configure its specific title and visibility settings. Use the add block page to create a custom block.', array('@add-block' => url('admin/build/block/add'))) . '
'; + return $output; + case 'admin/build/block/add': + return '' . t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.', array('@blocks' => url('admin/build/block'))) . '
'; + } +} + Index: modules/block/block.info =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.info,v retrieving revision 1.12 diff -u -p -r1.12 block.info --- modules/block/block.info 3 Feb 2009 12:30:14 -0000 1.12 +++ modules/block/block.info 20 May 2009 21:14:45 -0000 @@ -8,3 +8,6 @@ core = 7.x files[] = block.module files[] = block.admin.inc files[] = block.install +files[] = block.registry.inc +files[] = block.bootstrap.inc +files[] = block.alter.inc Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.332 diff -u -p -r1.332 block.module --- modules/block/block.module 16 May 2009 15:23:15 -0000 1.332 +++ modules/block/block.module 20 May 2009 22:23:02 -0000 @@ -2,108 +2,6 @@ // $Id: block.module,v 1.332 2009/05/16 15:23:15 webchick Exp $ /** - * @file - * Controls the boxes that are displayed around the main content. - */ - -/** - * Denotes that a block is not enabled in any region and should not be shown. - */ -define('BLOCK_REGION_NONE', -1); - -/** - * Constants defining cache granularity for blocks. - * - * Modules specify the caching patterns for their blocks using binary - * combinations of these constants in their hook_block_list(): - * $block[delta]['cache'] = BLOCK_CACHE_PER_ROLE | BLOCK_CACHE_PER_PAGE; - * BLOCK_CACHE_PER_ROLE is used as a default when no caching pattern is - * specified. - * - * The block cache is cleared in cache_clear_all(), and uses the same clearing - * policy than page cache (node, comment, user, taxonomy added or updated...). - * Blocks requiring more fine-grained clearing might consider disabling the - * built-in block cache (BLOCK_NO_CACHE) and roll their own. - * - * Note that user 1 is excluded from block caching. - */ - -/** - * The block should not get cached. This setting should be used: - * - for simple blocks (notably those that do not perform any db query), - * where querying the db cache would be more expensive than directly generating - * the content. - * - for blocks that change too frequently. - */ -define('BLOCK_NO_CACHE', -1); - -/** - * The block can change depending on the roles the user viewing the page belongs to. - * This is the default setting, used when the block does not specify anything. - */ -define('BLOCK_CACHE_PER_ROLE', 0x0001); - -/** - * The block can change depending on the user viewing the page. - * This setting can be resource-consuming for sites with large number of users, - * and thus should only be used when BLOCK_CACHE_PER_ROLE is not sufficient. - */ -define('BLOCK_CACHE_PER_USER', 0x0002); - -/** - * The block can change depending on the page being viewed. - */ -define('BLOCK_CACHE_PER_PAGE', 0x0004); - -/** - * The block is the same for every user on every page where it is visible. - */ -define('BLOCK_CACHE_GLOBAL', 0x0008); - -/** - * Implementation of hook_help(). - */ -function block_help($path, $arg) { - switch ($path) { - case 'admin/help#block': - $output = '' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The blocks administration page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/build/block'))) . '
'; - $output .= '' . t('Although blocks are usually generated automatically by modules (like the User login block, for example), administrators can also define custom blocks. Custom blocks have a title, description, and body. The body of the block can be as long as necessary, and can contain content supported by any available text format.', array('@text-format' => url('admin/settings/filter'))) . '
'; - $output .= '' . t('When working with blocks, remember that:') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Block module.', array('@block' => 'http://drupal.org/handbook/modules/block/')) . '
'; - return $output; - case 'admin/build/block': - $output = '' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the Block column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page.') . '
'; - $output .= '' . t('Click the configure link next to each block to configure its specific title and visibility settings. Use the add block page to create a custom block.', array('@add-block' => url('admin/build/block/add'))) . '
'; - return $output; - case 'admin/build/block/add': - return '' . t('Use this page to create a new custom block. New blocks are disabled by default, and must be moved to a region on the blocks administration page to be visible.', array('@blocks' => url('admin/build/block'))) . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function block_theme() { - return array( - 'block' => array( - 'arguments' => array('block' => NULL), - 'template' => 'block', - ), - 'block_admin_display_form' => array( - 'template' => 'block-admin-display-form', - 'arguments' => array('form' => NULL), - ), - ); -} - -/** * Implementation of hook_perm(). */ function block_perm() { @@ -116,62 +14,6 @@ function block_perm() { } /** - * Implementation of hook_menu(). - */ -function block_menu() { - $items['admin/build/block'] = array( - 'title' => 'Blocks', - 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', - 'page callback' => 'block_admin_display', - 'access arguments' => array('administer blocks'), - ); - $items['admin/build/block/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/build/block/list/js'] = array( - 'title' => 'JavaScript List Form', - 'page callback' => 'block_admin_display_js', - 'access arguments' => array('administer blocks'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/block/configure'] = array( - 'title' => 'Configure block', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('block_admin_configure'), - 'access arguments' => array('administer blocks'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/block/delete'] = array( - 'title' => 'Delete block', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('block_box_delete'), - 'access arguments' => array('administer blocks'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/block/add'] = array( - 'title' => 'Add block', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('block_add_block_form'), - 'access arguments' => array('administer blocks'), - 'type' => MENU_LOCAL_TASK, - ); - $default = variable_get('theme_default', 'garland'); - foreach (list_themes() as $key => $theme) { - $items['admin/build/block/list/' . $key] = array( - 'title' => check_plain($theme->info['name']), - 'page arguments' => array($key), - 'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, - 'weight' => $key == $default ? -10 : 0, - 'access callback' => '_block_themes_access', - 'access arguments' => array($theme), - ); - } - return $items; -} - -/** * Menu item access callback - only admin or enabled themes can be accessed. */ function _block_themes_access($theme) { @@ -225,39 +67,6 @@ function block_block_view($delta = 0, $e } /** - * Implementation of hook_page_alter(). - * - * Render blocks into their regions. - */ -function block_page_alter($page) { - global $theme; - - // The theme system might not yet be initialized. We need $theme. - init_theme(); - - // Populate all block regions - $regions = system_region_list($theme); - - // Load all region content assigned via blocks. - foreach (array_keys($regions) as $region) { - // Prevent left and right regions from rendering blocks when 'show_blocks' == FALSE. - if ($page['#show_blocks'] || ($region != 'left' && $region != 'right')) { - // Assign blocks to region. - if ($blocks = block_get_blocks_by_region($region)) { - $page[$region]['blocks'] = $blocks; - } - - // Append region description if we are rendering the block admin page. - $item = menu_get_item(); - if ($item['path'] == 'admin/build/block') { - $description = '' . t('When caching is enabled, anonymous user sessions are only saved to the database when needed, so the "Who\'s online" block does not display the number of anonymous users.') . '
'; - } - -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function block_form_system_themes_form_alter(&$form, &$form_state) { - $form['#submit'][] = 'block_system_themes_form_submit'; -} - -/** * Initialize blocks for enabled themes. */ function block_system_themes_form_submit(&$form, &$form_state) { Index: modules/block/block.registry.inc =================================================================== RCS file: modules/block/block.registry.inc diff -N modules/block/block.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/block/block.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,80 @@ + 'Blocks', + 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', + 'page callback' => 'block_admin_display', + 'access arguments' => array('administer blocks'), + ); + $items['admin/build/block/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/build/block/list/js'] = array( + 'title' => 'JavaScript List Form', + 'page callback' => 'block_admin_display_js', + 'access arguments' => array('administer blocks'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/block/configure'] = array( + 'title' => 'Configure block', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('block_admin_configure'), + 'access arguments' => array('administer blocks'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/block/delete'] = array( + 'title' => 'Delete block', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('block_box_delete'), + 'access arguments' => array('administer blocks'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/block/add'] = array( + 'title' => 'Add block', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('block_add_block_form'), + 'access arguments' => array('administer blocks'), + 'type' => MENU_LOCAL_TASK, + ); + $default = variable_get('theme_default', 'garland'); + foreach (list_themes() as $key => $theme) { + $items['admin/build/block/list/' . $key] = array( + 'title' => check_plain($theme->info['name']), + 'page arguments' => array($key), + 'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, + 'weight' => $key == $default ? -10 : 0, + 'access callback' => '_block_themes_access', + 'access arguments' => array($theme), + ); + } + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function block_theme() { + return array( + 'block' => array( + 'arguments' => array('block' => NULL), + 'template' => 'block', + ), + 'block_admin_display_form' => array( + 'template' => 'block-admin-display-form', + 'arguments' => array('form' => NULL), + ), + ); +} + Index: modules/blog/blog.bootstrap.inc =================================================================== RCS file: modules/blog/blog.bootstrap.inc diff -N modules/blog/blog.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/blog/blog.bootstrap.inc 20 May 2009 21:29:05 -0000 @@ -0,0 +1,35 @@ + array( + 'name' => t('Blog entry'), + 'base' => 'blog', + 'description' => t('A blog entry is a single post to an online journal, or blog.'), + ) + ); +} + +/** + * Implementation of hook_help(). + */ +function blog_help($path, $arg) { + switch ($path) { + case 'admin/help#blog': + $output = '' . t('The blog module allows registered users to maintain an online journal, or blog. Blogs are made up of individual blog entries, and the blog entries are most often displayed in descending order by creation time.') . '
'; + $output .= '' . t('There is an (optional) Blogs menu item added to the Navigation menu, which displays all blogs available on your site, and a My blog item displaying the current user\'s blog entries. The Blog entry menu item under Create content allows new blog entries to be created.') . '
'; + $output .= '' . t('Each blog entry is displayed with an automatic link to other blogs created by the same user. By default, blog entries have comments enabled and are automatically promoted to the site front page. The blog module also creates a Recent blog posts block that may be enabled at the blocks administration page.', array('@blocks' => url('admin/build/block'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Blog module.', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) . '
'; + return $output; + } +} + Index: modules/blog/blog.info =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.info,v retrieving revision 1.10 diff -u -p -r1.10 blog.info --- modules/blog/blog.info 11 Oct 2008 02:32:36 -0000 1.10 +++ modules/blog/blog.info 20 May 2009 18:49:54 -0000 @@ -7,3 +7,5 @@ version = VERSION core = 7.x files[] = blog.module files[] = blog.pages.inc +files[] = blog.registry.inc +files[] = blog.bootstrap.inc Index: modules/blog/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v retrieving revision 1.319 diff -u -p -r1.319 blog.module --- modules/blog/blog.module 3 May 2009 10:11:33 -0000 1.319 +++ modules/blog/blog.module 20 May 2009 22:41:28 -0000 @@ -7,19 +7,6 @@ */ /** - * Implementation of hook_node_info(). - */ -function blog_node_info() { - return array( - 'blog' => array( - 'name' => t('Blog entry'), - 'base' => 'blog', - 'description' => t('A blog entry is a single post to an online journal, or blog.'), - ) - ); -} - -/** * Implementation of hook_perm(). */ function blog_perm() { @@ -56,20 +43,6 @@ function blog_user_view(&$edit, &$user, } /** - * Implementation of hook_help(). - */ -function blog_help($path, $arg) { - switch ($path) { - case 'admin/help#blog': - $output = '' . t('The blog module allows registered users to maintain an online journal, or blog. Blogs are made up of individual blog entries, and the blog entries are most often displayed in descending order by creation time.') . '
'; - $output .= '' . t('There is an (optional) Blogs menu item added to the Navigation menu, which displays all blogs available on your site, and a My blog item displaying the current user\'s blog entries. The Blog entry menu item under Create content allows new blog entries to be created.') . '
'; - $output .= '' . t('Each blog entry is displayed with an automatic link to other blogs created by the same user. By default, blog entries have comments enabled and are automatically promoted to the site front page. The blog module also creates a Recent blog posts block that may be enabled at the blocks administration page.', array('@blocks' => url('admin/build/block'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Blog module.', array('@blog' => 'http://drupal.org/handbook/modules/blog/')) . '
'; - return $output; - } -} - -/** * Implementation of hook_form(). */ function blog_form($node, $form_state) { @@ -113,41 +86,6 @@ function blog_node_view($node, $teaser = } /** - * Implementation of hook_menu(). - */ -function blog_menu() { - $items['blog'] = array( - 'title' => 'Blogs', - 'page callback' => 'blog_page_last', - 'access arguments' => array('access content'), - 'type' => MENU_SUGGESTED_ITEM, - ); - $items['blog/%user_uid_optional'] = array( - 'title' => 'My blog', - 'page callback' => 'blog_page_user', - 'page arguments' => array(1), - 'access callback' => 'blog_page_user_access', - 'access arguments' => array(1), - ); - $items['blog/%user/feed'] = array( - 'title' => 'Blogs', - 'page callback' => 'blog_feed_user', - 'page arguments' => array(1), - 'access callback' => 'blog_page_user_access', - 'access arguments' => array(1), - 'type' => MENU_CALLBACK, - ); - $items['blog/feed'] = array( - 'title' => 'Blogs', - 'page callback' => 'blog_feed_last', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Access callback for user blog pages. */ function blog_page_user_access($account) { Index: modules/blog/blog.registry.inc =================================================================== RCS file: modules/blog/blog.registry.inc diff -N modules/blog/blog.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/blog/blog.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,43 @@ + 'Blogs', + 'page callback' => 'blog_page_last', + 'access arguments' => array('access content'), + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['blog/%user_uid_optional'] = array( + 'title' => 'My blog', + 'page callback' => 'blog_page_user', + 'page arguments' => array(1), + 'access callback' => 'blog_page_user_access', + 'access arguments' => array(1), + ); + $items['blog/%user/feed'] = array( + 'title' => 'Blogs', + 'page callback' => 'blog_feed_user', + 'page arguments' => array(1), + 'access callback' => 'blog_page_user_access', + 'access arguments' => array(1), + 'type' => MENU_CALLBACK, + ); + $items['blog/feed'] = array( + 'title' => 'Blogs', + 'page callback' => 'blog_feed_last', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + Index: modules/blogapi/blogapi.bootstrap.inc =================================================================== RCS file: modules/blogapi/blogapi.bootstrap.inc diff -N modules/blogapi/blogapi.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/blogapi/blogapi.bootstrap.inc 20 May 2009 21:31:56 -0000 @@ -0,0 +1,60 @@ + 'EditURI', + 'type' => 'application/rsd+xml', + 'title' => t('RSD'), + 'href' => url('blogapi/rsd', array('absolute' => TRUE)))); + } +} + +/** + * @file + * Enable users to post using applications that support XML-RPC blog APIs. + */ + +/** + * Implementation of hook_help(). + */ +function blogapi_help($path, $arg) { + switch ($path) { + case 'admin/help#blogapi': + $output = '' . t("The Blog API module allows your site's users to access and post to their blogs from external blogging clients. External blogging clients are available for a wide range of desktop operating systems, and generally provide a feature-rich graphical environment for creating and editing posts.") . '
'; + $output .= '' . t('Ecto, a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports Blogger API, MetaWeblog API, and most of the Movable Type API. Blogging clients and other services (e.g. Flickr\'s "post to blog") that support these APIs may also be compatible.', array('@ecto-link' => url('http://infinite-sushi.com/software/ecto/'), '@blogger-api' => url('http://www.blogger.com/developers/api/1_docs/'), '@metaweblog-api' => url('http://www.xmlrpc.com/metaWeblogApi'), '@movabletype-api' => url('http://www.movabletype.org/docs/mtmanual_programmatic.html'), '@flickr' => url('http://www.flickr.com'))) . '
'; + $output .= '' . t('Select the content types available to external clients on the Blog API settings page. If supported and available, each content type will be displayed as a separate "blog" by the external client.', array('@blogapi-settings' => url('admin/settings/blogapi'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Blog API module.', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) . '
'; + return $output; + } +} + +/** + * Blogging API callback. Returns profile information about a user. + */ +function blogapi_blogger_get_user_info($appkey, $username, $password) { + $user = blogapi_validate_user($username, $password); + + if ($user->uid) { + $name = explode(' ', $user->realname ? $user->realname : $user->name, 2); + return array( + 'userid' => $user->uid, + 'lastname' => $name[1], + 'firstname' => $name[0], + 'nickname' => $user->name, + 'email' => $user->mail, + 'url' => url('user/' . $user->uid, array('absolute' => TRUE))); + } + else { + return blogapi_error($user); + } +} + Index: modules/blogapi/blogapi.info =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.info,v retrieving revision 1.9 diff -u -p -r1.9 blogapi.info --- modules/blogapi/blogapi.info 11 Oct 2008 02:32:37 -0000 1.9 +++ modules/blogapi/blogapi.info 20 May 2009 18:49:54 -0000 @@ -7,3 +7,5 @@ version = VERSION core = 7.x files[] = blogapi.module files[] = blogapi.install +files[] = blogapi.registry.inc +files[] = blogapi.bootstrap.inc Index: modules/blogapi/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v retrieving revision 1.150 diff -u -p -r1.150 blogapi.module --- modules/blogapi/blogapi.module 9 May 2009 18:28:11 -0000 1.150 +++ modules/blogapi/blogapi.module 20 May 2009 21:31:56 -0000 @@ -2,25 +2,6 @@ // $Id: blogapi.module,v 1.150 2009/05/09 18:28:11 dries Exp $ /** - * @file - * Enable users to post using applications that support XML-RPC blog APIs. - */ - -/** - * Implementation of hook_help(). - */ -function blogapi_help($path, $arg) { - switch ($path) { - case 'admin/help#blogapi': - $output = '' . t("The Blog API module allows your site's users to access and post to their blogs from external blogging clients. External blogging clients are available for a wide range of desktop operating systems, and generally provide a feature-rich graphical environment for creating and editing posts.") . '
'; - $output .= '' . t('Ecto, a blogging client available for both Mac OS X and Microsoft Windows, can be used with Blog API. Blog API also supports Blogger API, MetaWeblog API, and most of the Movable Type API. Blogging clients and other services (e.g. Flickr\'s "post to blog") that support these APIs may also be compatible.', array('@ecto-link' => url('http://infinite-sushi.com/software/ecto/'), '@blogger-api' => url('http://www.blogger.com/developers/api/1_docs/'), '@metaweblog-api' => url('http://www.xmlrpc.com/metaWeblogApi'), '@movabletype-api' => url('http://www.movabletype.org/docs/mtmanual_programmatic.html'), '@flickr' => url('http://www.flickr.com'))) . '
'; - $output .= '' . t('Select the content types available to external clients on the Blog API settings page. If supported and available, each content type will be displayed as a separate "blog" by the external client.', array('@blogapi-settings' => url('admin/settings/blogapi'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Blog API module.', array('@blogapi' => url('http://drupal.org/handbook/modules/blogapi/'))) . '
'; - return $output; - } -} - -/** * Implementation of hook_perm(). */ function blogapi_perm() { @@ -159,27 +140,6 @@ function blogapi_blogger_get_users_blogs } /** - * Blogging API callback. Returns profile information about a user. - */ -function blogapi_blogger_get_user_info($appkey, $username, $password) { - $user = blogapi_validate_user($username, $password); - - if ($user->uid) { - $name = explode(' ', $user->realname ? $user->realname : $user->name, 2); - return array( - 'userid' => $user->uid, - 'lastname' => $name[1], - 'firstname' => $name[0], - 'nickname' => $user->name, - 'email' => $user->mail, - 'url' => url('user/' . $user->uid, array('absolute' => TRUE))); - } - else { - return blogapi_error($user); - } -} - -/** * Blogging API callback. Inserts a new blog post as a node. */ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $content, $publish) { @@ -808,40 +768,6 @@ function blogapi_admin_settings() { return system_settings_form($form, FALSE); } -/** - * Implementation of hook_menu(). - */ -function blogapi_menu() { - $items['blogapi/rsd'] = array( - 'title' => 'RSD', - 'page callback' => 'blogapi_rsd', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['admin/settings/blogapi'] = array( - 'title' => 'Blog API', - 'description' => 'Configure the content types available to external blogging clients.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('blogapi_admin_settings'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_NORMAL_ITEM, - ); - - return $items; -} - -/** - * Implementation of hook_init(). - */ -function blogapi_init() { - if (drupal_is_front_page()) { - drupal_add_link(array('rel' => 'EditURI', - 'type' => 'application/rsd+xml', - 'title' => t('RSD'), - 'href' => url('blogapi/rsd', array('absolute' => TRUE)))); - } -} - function blogapi_rsd() { global $base_url; Index: modules/blogapi/blogapi.registry.inc =================================================================== RCS file: modules/blogapi/blogapi.registry.inc diff -N modules/blogapi/blogapi.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/blogapi/blogapi.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,30 @@ + 'RSD', + 'page callback' => 'blogapi_rsd', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/blogapi'] = array( + 'title' => 'Blog API', + 'description' => 'Configure the content types available to external blogging clients.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('blogapi_admin_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_NORMAL_ITEM, + ); + + return $items; +} + Index: modules/book/book.alter.inc =================================================================== RCS file: modules/book/book.alter.inc diff -N modules/book/book.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/book/book.alter.inc 20 May 2009 22:23:21 -0000 @@ -0,0 +1,75 @@ +book['mlid']) && !empty($node->nid)) || book_type_is_allowed($node->type))) { + // Already in the book hierarchy, or this node type is allowed. + $access = TRUE; + } + } + + if ($access) { + _book_add_form_elements($form, $node); + $form['book']['pick-book'] = array( + '#type' => 'submit', + '#value' => t('Change book (update list of parents)'), + // Submit the node form so the parent select options get updated. + // This is typically only used when JS is disabled. Since the parent options + // won't be changed via AJAX, a button is provided in the node form to submit + // the form and generate options in the parent select corresponding to the + // selected book. This is similar to what happens during a node preview. + '#submit' => array('node_form_submit_build_node'), + '#weight' => 20, + ); + } + } +} + +/** + * Implementation of hook_page_alter(). + * + * Add the book menu to the list of menus used to build the active trail when + * viewing a book page. + */ +function book_page_alter(&$page) { + if (($node = menu_get_object()) && !empty($node->book['bid'])) { + $active_menus = menu_get_active_menu_names(); + $active_menus[] = $node->book['menu_name']; + menu_set_active_menu_names($active_menus); + } +} + +/** + * Form altering function for the confirm form for a single node deletion. + */ +function book_form_node_delete_confirm_alter(&$form, $form_state) { + $node = node_load($form['nid']['#value']); + + if (isset($node->book) && $node->book['has_children']) { + $form['book_warning'] = array( + '#markup' => '' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '
', + '#weight' => -10, + ); + } +} + Index: modules/book/book.bootstrap.inc =================================================================== RCS file: modules/book/book.bootstrap.inc diff -N modules/book/book.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/book/book.bootstrap.inc 20 May 2009 18:49:54 -0000 @@ -0,0 +1,38 @@ +' . t('The book module is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.') . ''; + $output .= '' . t('Pages in the book hierarchy have navigation elements at the bottom of the page for moving through the text. These links lead to the previous and next pages in the book, and to the level above the current page in the book\'s structure. More comprehensive navigation may be provided by enabling the book navigation block on the blocks administration page.', array('@admin-block' => url('admin/build/block'))) . '
'; + $output .= '' . t('Users can select the printer-friendly version link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') . '
'; + $output .= '' . t("Users with the administer book outlines permission can add a post of any content type to a book, by selecting the appropriate book while editing the post or by using the interface available on the post's outline tab.") . '
'; + $output .= '' . t('Administrators can view a list of all books on the book administration page. The Outline page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Book module.', array('@book' => 'http://drupal.org/handbook/modules/book/')) . '
'; + + return $output; + + case 'admin/content/book': + return '' . t('The book module offers a means to organize a collection of related posts, collectively known as a book. When viewed, these posts automatically display links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '
'; + + case 'node/%/outline': + return '' . t('The outline feature allows you to include posts in the book hierarchy, as well as move them within the hierarchy or to reorder an entire book.', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) . '
'; + } +} + Index: modules/book/book.info =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.info,v retrieving revision 1.11 diff -u -p -r1.11 book.info --- modules/book/book.info 13 Oct 2008 19:59:41 -0000 1.11 +++ modules/book/book.info 20 May 2009 21:14:45 -0000 @@ -9,3 +9,6 @@ files[] = book.module files[] = book.admin.inc files[] = book.pages.inc files[] = book.install +files[] = book.registry.inc +files[] = book.bootstrap.inc +files[] = book.alter.inc Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.493 diff -u -p -r1.493 book.module --- modules/book/book.module 9 May 2009 18:28:11 -0000 1.493 +++ modules/book/book.module 20 May 2009 22:23:12 -0000 @@ -2,41 +2,6 @@ // $Id: book.module,v 1.493 2009/05/09 18:28:11 dries Exp $ /** - * @file - * Allows users to create and organize related content in an outline. - */ - -/** - * Implementation of hook_theme(). - */ -function book_theme() { - return array( - 'book_navigation' => array( - 'arguments' => array('book_link' => NULL), - 'template' => 'book-navigation', - ), - 'book_export_html' => array( - 'arguments' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), - 'template' => 'book-export-html', - ), - 'book_admin_table' => array( - 'arguments' => array('form' => NULL), - ), - 'book_title_link' => array( - 'arguments' => array('link' => NULL), - ), - 'book_all_books_block' => array( - 'arguments' => array('book_menus' => array()), - 'template' => 'book-all-books-block', - ), - 'book_node_export_html' => array( - 'arguments' => array('node' => NULL, 'children' => NULL), - 'template' => 'book-node-export-html', - ), - ); -} - -/** * Implementation of hook_perm(). */ function book_perm() { @@ -96,74 +61,6 @@ function book_node_view_link($node, $tea } /** - * Implementation of hook_menu(). - */ -function book_menu() { - $items['admin/content/book'] = array( - 'title' => 'Books', - 'description' => "Manage your site's book outlines.", - 'page callback' => 'book_admin_overview', - 'access arguments' => array('administer book outlines'), - ); - $items['admin/content/book/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/content/book/settings'] = array( - 'title' => 'Settings', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('book_admin_settings'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 8, - ); - $items['admin/content/book/%node'] = array( - 'title' => 'Re-order book pages and change titles', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('book_admin_edit', 3), - 'access callback' => '_book_outline_access', - 'access arguments' => array(3), - 'type' => MENU_CALLBACK, - ); - $items['book'] = array( - 'title' => 'Books', - 'page callback' => 'book_render', - 'access arguments' => array('access content'), - 'type' => MENU_SUGGESTED_ITEM, - ); - $items['book/export/%/%'] = array( - 'page callback' => 'book_export', - 'page arguments' => array(2, 3), - 'access arguments' => array('access printer-friendly version'), - 'type' => MENU_CALLBACK, - ); - $items['node/%node/outline'] = array( - 'title' => 'Outline', - 'page callback' => 'book_outline', - 'page arguments' => array(1), - 'access callback' => '_book_outline_access', - 'access arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - $items['node/%node/outline/remove'] = array( - 'title' => 'Remove from outline', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('book_remove_form', 1), - 'access callback' => '_book_outline_remove_access', - 'access arguments' => array(1), - 'type' => MENU_CALLBACK, - ); - $items['book/js/form'] = array( - 'page callback' => 'book_form_update', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Menu item access callback - determine if the outline tab is accessible. */ function _book_outline_access($node) { @@ -178,13 +75,6 @@ function _book_outline_remove_access($no } /** - * Implementation of hook_init(). - */ -function book_init() { - drupal_add_css(drupal_get_path('module', 'book') . '/book.css'); -} - -/** * Implementation of hook_block_list(). */ function book_block_list() { @@ -326,45 +216,6 @@ function book_get_books() { } /** - * Implementation of hook_form_alter(). - * - * Adds the book fieldset to the node form. - * - * @see book_pick_book_submit() - * @see book_submit() - */ -function book_form_alter(&$form, $form_state, $form_id) { - - if (!empty($form['#node_edit_form'])) { - // Add elements to the node form. - $node = $form['#node']; - - $access = user_access('administer book outlines'); - if (!$access) { - if (user_access('add content to books') && ((!empty($node->book['mlid']) && !empty($node->nid)) || book_type_is_allowed($node->type))) { - // Already in the book hierarchy, or this node type is allowed. - $access = TRUE; - } - } - - if ($access) { - _book_add_form_elements($form, $node); - $form['book']['pick-book'] = array( - '#type' => 'submit', - '#value' => t('Change book (update list of parents)'), - // Submit the node form so the parent select options get updated. - // This is typically only used when JS is disabled. Since the parent options - // won't be changed via AJAX, a button is provided in the node form to submit - // the form and generate options in the parent select corresponding to the - // selected book. This is similar to what happens during a node preview. - '#submit' => array('node_form_submit_build_node'), - '#weight' => 20, - ); - } - } -} - -/** * Build the parent selection form element for the node form or outline tab. * * This function is also called when generating a new set of options during the @@ -721,20 +572,6 @@ function book_node_view($node, $teaser) } /** - * Implementation of hook_page_alter(). - * - * Add the book menu to the list of menus used to build the active trail when - * viewing a book page. - */ -function book_page_alter(&$page) { - if (($node = menu_get_object()) && !empty($node->book['bid'])) { - $active_menus = menu_get_active_menu_names(); - $active_menus[] = $node->book['menu_name']; - menu_set_active_menu_names($active_menus); - } -} - -/** * Implementation of hook_node_presave(). */ function book_node_presave($node) { @@ -845,20 +682,6 @@ function _book_parent_depth_limit($book_ } /** - * Form altering function for the confirm form for a single node deletion. - */ -function book_form_node_delete_confirm_alter(&$form, $form_state) { - $node = node_load($form['nid']['#value']); - - if (isset($node->book) && $node->book['has_children']) { - $form['book_warning'] = array( - '#markup' => '' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->title)) . '
', - '#weight' => -10, - ); - } -} - -/** * Return an array with default values for a book link. */ function _book_link_defaults($nid) { @@ -1094,29 +917,6 @@ function book_node_type($op, $type) { } /** - * Implementation of hook_help(). - */ -function book_help($path, $arg) { - switch ($path) { - case 'admin/help#book': - $output = '' . t('The book module is suited for creating structured, multi-page hypertexts such as site resource guides, manuals, and Frequently Asked Questions (FAQs). It permits a document to have chapters, sections, subsections, etc. Authors with suitable permissions can add pages to a collaborative book, placing them into the existing document by adding them to a table of contents menu.') . '
'; - $output .= '' . t('Pages in the book hierarchy have navigation elements at the bottom of the page for moving through the text. These links lead to the previous and next pages in the book, and to the level above the current page in the book\'s structure. More comprehensive navigation may be provided by enabling the book navigation block on the blocks administration page.', array('@admin-block' => url('admin/build/block'))) . '
'; - $output .= '' . t('Users can select the printer-friendly version link visible at the bottom of a book page to generate a printer-friendly display of the page and all of its subsections. ') . '
'; - $output .= '' . t("Users with the administer book outlines permission can add a post of any content type to a book, by selecting the appropriate book while editing the post or by using the interface available on the post's outline tab.") . '
'; - $output .= '' . t('Administrators can view a list of all books on the book administration page. The Outline page for each book allows section titles to be edited or rearranged.', array('@admin-node-book' => url('admin/content/book'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Book module.', array('@book' => 'http://drupal.org/handbook/modules/book/')) . '
'; - - return $output; - - case 'admin/content/book': - return '' . t('The book module offers a means to organize a collection of related posts, collectively known as a book. When viewed, these posts automatically display links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '
'; - - case 'node/%/outline': - return '' . t('The outline feature allows you to include posts in the book hierarchy, as well as move them within the hierarchy or to reorder an entire book.', array('@book' => url('book'), '@book-admin' => url('admin/content/book'))) . '
'; - } -} - -/** * Like menu_link_load(), but adds additional data from the {book} table. * * Do not call when loading a node, since this function may call node_load(). Index: modules/book/book.registry.inc =================================================================== RCS file: modules/book/book.registry.inc diff -N modules/book/book.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/book/book.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,111 @@ + 'Books', + 'description' => "Manage your site's book outlines.", + 'page callback' => 'book_admin_overview', + 'access arguments' => array('administer book outlines'), + ); + $items['admin/content/book/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/content/book/settings'] = array( + 'title' => 'Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('book_admin_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 8, + ); + $items['admin/content/book/%node'] = array( + 'title' => 'Re-order book pages and change titles', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('book_admin_edit', 3), + 'access callback' => '_book_outline_access', + 'access arguments' => array(3), + 'type' => MENU_CALLBACK, + ); + $items['book'] = array( + 'title' => 'Books', + 'page callback' => 'book_render', + 'access arguments' => array('access content'), + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['book/export/%/%'] = array( + 'page callback' => 'book_export', + 'page arguments' => array(2, 3), + 'access arguments' => array('access printer-friendly version'), + 'type' => MENU_CALLBACK, + ); + $items['node/%node/outline'] = array( + 'title' => 'Outline', + 'page callback' => 'book_outline', + 'page arguments' => array(1), + 'access callback' => '_book_outline_access', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + $items['node/%node/outline/remove'] = array( + 'title' => 'Remove from outline', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('book_remove_form', 1), + 'access callback' => '_book_outline_remove_access', + 'access arguments' => array(1), + 'type' => MENU_CALLBACK, + ); + $items['book/js/form'] = array( + 'page callback' => 'book_form_update', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * @file + * Allows users to create and organize related content in an outline. + */ + +/** + * Implementation of hook_theme(). + */ +function book_theme() { + return array( + 'book_navigation' => array( + 'arguments' => array('book_link' => NULL), + 'template' => 'book-navigation', + ), + 'book_export_html' => array( + 'arguments' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), + 'template' => 'book-export-html', + ), + 'book_admin_table' => array( + 'arguments' => array('form' => NULL), + ), + 'book_title_link' => array( + 'arguments' => array('link' => NULL), + ), + 'book_all_books_block' => array( + 'arguments' => array('book_menus' => array()), + 'template' => 'book-all-books-block', + ), + 'book_node_export_html' => array( + 'arguments' => array('node' => NULL, 'children' => NULL), + 'template' => 'book-node-export-html', + ), + ); +} + Index: modules/color/color.alter.inc =================================================================== RCS file: modules/color/color.alter.inc diff -N modules/color/color.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/color/color.alter.inc 20 May 2009 22:23:52 -0000 @@ -0,0 +1,114 @@ +download method is set to public.', array('@url' => url('admin/settings/file-system'))), 'warning'); + } + else { + $form['color'] = array( + '#type' => 'fieldset', + '#title' => t('Color scheme'), + '#weight' => -1, + '#attributes' => array('id' => 'color_scheme_form'), + '#theme' => 'color_scheme_form', + ); + $form['color'] += color_scheme_form($form_state, arg(4)); + $form['#submit'][] = 'color_scheme_form_submit'; + } + } +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + */ +function color_form_system_themes_alter(&$form, &$form_state) { + _color_theme_select_form_alter($form, $form_state); +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + */ +function color_form_system_theme_select_form_alter(&$form, &$form_state) { + _color_theme_select_form_alter($form, $form_state); +} + +/** + * Helper for hook_form_FORM_ID_alter() implementations. + */ +function _color_theme_select_form_alter(&$form, &$form_state) { + // Use the generated screenshot in the theme list. + $themes = list_themes(); + foreach (element_children($form) as $theme) { + if ($screenshot = variable_get('color_' . $theme . '_screenshot')) { + if (isset($form[$theme]['screenshot'])) { + $form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE); + } + } + } +} + +/** + * Callback for the theme to alter the resources used. + */ +function _color_page_alter(&$vars) { + global $language, $theme_key; + + // Override stylesheets. + $color_paths = variable_get('color_' . $theme_key . '_stylesheets', array()); + if (!empty($color_paths)) { + // Loop over theme CSS files and try to rebuild CSS array with rewritten + // stylesheets. Keep the original order intact for CSS cascading. + $new_theme_css = array(); + + foreach ($vars['css']['all']['theme'] as $old_path => $old_preprocess) { + // Add the non-colored stylesheet first as we might not find a + // re-colored stylesheet for replacement later. + $new_theme_css[$old_path] = $old_preprocess; + + // Loop over the path array with recolored CSS files to find matching + // paths which could replace the non-recolored paths. + foreach ($color_paths as $color_path) { + // Color module currently requires unique file names to be used, + // which allows us to compare different file paths. + if (basename($old_path) == basename($color_path)) { + // Pull out the non-colored and add rewritten stylesheet. + unset($new_theme_css[$old_path]); + $new_theme_css[$color_path] = $old_preprocess; + + // If the current language is RTL and the CSS file had an RTL variant, + // pull out the non-colored and add rewritten RTL stylesheet. + if ($language->direction == LANGUAGE_RTL) { + $rtl_old_path = str_replace('.css', '-rtl.css', $old_path); + $rtl_color_path = str_replace('.css', '-rtl.css', $color_path); + if (file_exists($rtl_color_path)) { + unset($new_theme_css[$rtl_old_path]); + $new_theme_css[$rtl_color_path] = $old_preprocess; + } + } + break; + } + } + } + $vars['css']['all']['theme'] = $new_theme_css; + $vars['styles'] = drupal_get_css($vars['css']); + } + + // Override logo. + $logo = variable_get('color_' . $theme_key . '_logo'); + if ($logo && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) { + $vars['logo'] = base_path() . $logo; + } +} + Index: modules/color/color.bootstrap.inc =================================================================== RCS file: modules/color/color.bootstrap.inc diff -N modules/color/color.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/color/color.bootstrap.inc 20 May 2009 21:31:56 -0000 @@ -0,0 +1,35 @@ +' . t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although not all themes support color module, both Garland (the default theme) and Minnelli were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) . ''; + $output .= '' . t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") . '
'; + $output .= '' . t('To change the color settings for a compatible theme, select the "configure" link for the theme on the themes administration page.', array('@themes' => url('admin/build/themes'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Color module.', array('@color' => 'http://drupal.org/handbook/modules/color/')) . '
'; + + return $output; + } +} + +/** + * Retrieve the color.module info for a particular theme. + */ +function color_get_info($theme) { + $path = drupal_get_path('theme', $theme); + $file = DRUPAL_ROOT . '/' . $path . '/color/color.inc'; + if ($path && file_exists($file)) { + include $file; + return $info; + } +} + Index: modules/color/color.info =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.info,v retrieving revision 1.9 diff -u -p -r1.9 color.info --- modules/color/color.info 11 Oct 2008 02:32:40 -0000 1.9 +++ modules/color/color.info 20 May 2009 21:14:45 -0000 @@ -7,3 +7,6 @@ version = VERSION core = 7.x files[] = color.module files[] = color.install +files[] = color.registry.inc +files[] = color.bootstrap.inc +files[] = color.alter.inc Index: modules/color/color.module =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.module,v retrieving revision 1.58 diff -u -p -r1.58 color.module --- modules/color/color.module 16 May 2009 16:08:57 -0000 1.58 +++ modules/color/color.module 20 May 2009 22:23:43 -0000 @@ -2,150 +2,6 @@ // $Id: color.module,v 1.58 2009/05/16 16:08:57 dries Exp $ /** - * Implementation of hook_help(). - */ -function color_help($path, $arg) { - switch ($path) { - case 'admin/help#color': - $output = '' . t('The color module allows a site administrator to quickly and easily change the color scheme of certain themes. Although not all themes support color module, both Garland (the default theme) and Minnelli were designed to take advantage of its features. By using color module with a compatible theme, you can easily change the color of links, backgrounds, text, and other theme elements. Color module requires that your file download method be set to public.', array('@url' => url('admin/settings/file-system'))) . '
'; - $output .= '' . t("It is important to remember that color module saves a modified copy of the theme's specified stylesheets in the files directory. This means that if you make any manual changes to your theme's stylesheet, you must save your color settings again, even if they haven't changed. This causes the color module generated version of the stylesheets in the files directory to be recreated using the new version of the original file.") . '
'; - $output .= '' . t('To change the color settings for a compatible theme, select the "configure" link for the theme on the themes administration page.', array('@themes' => url('admin/build/themes'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Color module.', array('@color' => 'http://drupal.org/handbook/modules/color/')) . '
'; - - return $output; - } -} - -/** - * Implementation of hook_theme(). - */ -function color_theme() { - return array( - 'color_scheme_form' => array( - 'arguments' => array('form' => NULL), - ), - ); -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function color_form_system_theme_settings_alter(&$form, &$form_state) { - if (color_get_info(arg(4)) && function_exists('gd_info')) { - if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) != FILE_DOWNLOADS_PUBLIC) { - // Disables the color changer when the private download method is used. - // TODO: This should be solved in a different way. See issue #181003. - drupal_set_message(t('The color picker only works if the download method is set to public.', array('@url' => url('admin/settings/file-system'))), 'warning'); - } - else { - $form['color'] = array( - '#type' => 'fieldset', - '#title' => t('Color scheme'), - '#weight' => -1, - '#attributes' => array('id' => 'color_scheme_form'), - '#theme' => 'color_scheme_form', - ); - $form['color'] += color_scheme_form($form_state, arg(4)); - $form['#submit'][] = 'color_scheme_form_submit'; - } - } -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function color_form_system_themes_alter(&$form, &$form_state) { - _color_theme_select_form_alter($form, $form_state); -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function color_form_system_theme_select_form_alter(&$form, &$form_state) { - _color_theme_select_form_alter($form, $form_state); -} - -/** - * Helper for hook_form_FORM_ID_alter() implementations. - */ -function _color_theme_select_form_alter(&$form, &$form_state) { - // Use the generated screenshot in the theme list. - $themes = list_themes(); - foreach (element_children($form) as $theme) { - if ($screenshot = variable_get('color_' . $theme . '_screenshot')) { - if (isset($form[$theme]['screenshot'])) { - $form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => 'screenshot'), FALSE); - } - } - } -} - -/** - * Callback for the theme to alter the resources used. - */ -function _color_page_alter(&$vars) { - global $language, $theme_key; - - // Override stylesheets. - $color_paths = variable_get('color_' . $theme_key . '_stylesheets', array()); - if (!empty($color_paths)) { - // Loop over theme CSS files and try to rebuild CSS array with rewritten - // stylesheets. Keep the original order intact for CSS cascading. - $new_theme_css = array(); - - foreach ($vars['css']['all']['theme'] as $old_path => $old_preprocess) { - // Add the non-colored stylesheet first as we might not find a - // re-colored stylesheet for replacement later. - $new_theme_css[$old_path] = $old_preprocess; - - // Loop over the path array with recolored CSS files to find matching - // paths which could replace the non-recolored paths. - foreach ($color_paths as $color_path) { - // Color module currently requires unique file names to be used, - // which allows us to compare different file paths. - if (basename($old_path) == basename($color_path)) { - // Pull out the non-colored and add rewritten stylesheet. - unset($new_theme_css[$old_path]); - $new_theme_css[$color_path] = $old_preprocess; - - // If the current language is RTL and the CSS file had an RTL variant, - // pull out the non-colored and add rewritten RTL stylesheet. - if ($language->direction == LANGUAGE_RTL) { - $rtl_old_path = str_replace('.css', '-rtl.css', $old_path); - $rtl_color_path = str_replace('.css', '-rtl.css', $color_path); - if (file_exists($rtl_color_path)) { - unset($new_theme_css[$rtl_old_path]); - $new_theme_css[$rtl_color_path] = $old_preprocess; - } - } - break; - } - } - } - $vars['css']['all']['theme'] = $new_theme_css; - $vars['styles'] = drupal_get_css($vars['css']); - } - - // Override logo. - $logo = variable_get('color_' . $theme_key . '_logo'); - if ($logo && $vars['logo'] && preg_match('!' . $theme_key . '/logo.png$!', $vars['logo'])) { - $vars['logo'] = base_path() . $logo; - } -} - -/** - * Retrieve the color.module info for a particular theme. - */ -function color_get_info($theme) { - $path = drupal_get_path('theme', $theme); - $file = DRUPAL_ROOT . '/' . $path . '/color/color.inc'; - if ($path && file_exists($file)) { - include $file; - return $info; - } -} - -/** * Helper function to retrieve the color palette for a particular theme. */ function color_get_palette($theme, $default = FALSE) { Index: modules/color/color.registry.inc =================================================================== RCS file: modules/color/color.registry.inc diff -N modules/color/color.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/color/color.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,19 @@ + array( + 'arguments' => array('form' => NULL), + ), + ); +} + Index: modules/comment/comment.alter.inc =================================================================== RCS file: modules/comment/comment.alter.inc diff -N modules/comment/comment.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/comment/comment.alter.inc 20 May 2009 22:20:10 -0000 @@ -0,0 +1,143 @@ + 'fieldset', + '#access' => user_access('administer comments'), + '#title' => t('Comment settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#group' => 'additional_settings', + '#attached_js' => array(drupal_get_path('module', 'comment') . '/comment-node-form.js'), + '#weight' => 30, + ); + $comment_count = isset($node->nid) ? db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField() : 0; + $comment_settings = ($node->comment == COMMENT_NODE_HIDDEN && empty($comment_count)) ? COMMENT_NODE_CLOSED : $node->comment; + $form['comment_settings']['comment'] = array( + '#type' => 'radios', + '#parents' => array('comment'), + '#default_value' => $comment_settings, + '#options' => array( + COMMENT_NODE_OPEN => t('Open'), + COMMENT_NODE_CLOSED => t('Closed'), + COMMENT_NODE_HIDDEN => t('Hidden'), + ), + COMMENT_NODE_OPEN => array( + '#type' => 'radio', + '#title' => t('Open'), + '#description' => theme('indentation') . t("Users with 'post comments' permission can post comments."), + '#return_value' => COMMENT_NODE_OPEN, + '#default_value' => $comment_settings, + '#id' => 'edit-comment-2', + '#parents' => array('comment'), + ), + COMMENT_NODE_CLOSED => array( + '#type' => 'radio', + '#title' => t('Closed'), + '#description' => theme('indentation') . t('Users cannot post comments, but existing comments will be displayed.'), + '#return_value' => COMMENT_NODE_CLOSED, + '#default_value' => $comment_settings, + '#id' => 'edit-comment-1', + '#parents' => array('comment'), + ), + COMMENT_NODE_HIDDEN => array( + '#type' => 'radio', + '#title' => t('Hidden'), + '#description' => theme('indentation') . t('Comments are hidden from view.'), + '#return_value' => COMMENT_NODE_HIDDEN, + '#default_value' => $comment_settings, + '#id' => 'edit-comment-0', + '#parents' => array('comment'), + ), + ); + // If the node doesn't have any comments, the "hidden" option makes no + // sense, so don't even bother presenting it to the user. + if (empty($comment_count)) { + unset($form['comment_settings']['comment']['#options'][COMMENT_NODE_HIDDEN]); + unset($form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]); + $form['comment_settings']['comment'][COMMENT_NODE_CLOSED]['#description'] = theme('indentation') . t('Users cannot post comments.'); + } + } +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + */ +function comment_form_node_type_form_alter(&$form, $form_state) { + if (isset($form['identity']['type'])) { + $form['comment'] = array( + '#type' => 'fieldset', + '#title' => t('Comment settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['comment']['comment'] = array( + '#type' => 'radios', + '#title' => t('Default comment setting'), + '#default_value' => variable_get('comment_' . $form['#node_type']->type, COMMENT_NODE_OPEN), + '#options' => array(t('Hidden'), t('Closed'), t('Open')), + '#description' => t('Users with the administer comments permission will be able to override this setting.'), + ); + $form['comment']['comment_default_mode'] = array( + '#type' => 'radios', + '#title' => t('Default display mode'), + '#default_value' => variable_get('comment_default_mode_' . $form['#node_type']->type, COMMENT_MODE_THREADED_EXPANDED), + '#options' => _comment_get_modes(), + '#description' => t('Expanded views display the body of the comment. Threaded views keep replies together.'), + ); + $form['comment']['comment_default_per_page'] = array( + '#type' => 'select', + '#title' => t('Comments per page'), + '#default_value' => variable_get('comment_default_per_page_' . $form['#node_type']->type, 50), + '#options' => _comment_per_page(), + '#description' => t('Additional comments will be displayed on separate pages.'), + ); + $form['comment']['comment_anonymous'] = array( + '#type' => 'radios', + '#title' => t('Anonymous commenting'), + '#default_value' => variable_get('comment_anonymous_' . $form['#node_type']->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT), + '#options' => array( + COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'), + COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'), + COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information')), + '#description' => t('This option is enabled when anonymous users have permission to post comments on the permissions page.', array('@url' => url('admin/user/permissions', array('fragment' => 'module-comment')))), + ); + + if (!user_access('post comments', drupal_anonymous_user())) { + $form['comment']['comment_anonymous']['#disabled'] = TRUE; + } + + $form['comment']['comment_subject_field'] = array( + '#type' => 'radios', + '#title' => t('Comment subject field'), + '#default_value' => variable_get('comment_subject_field_' . $form['#node_type']->type, 1), + '#options' => array(t('Disabled'), t('Enabled')), + '#description' => t('Can users provide a unique subject for their comments?'), + ); + $form['comment']['comment_preview'] = array( + '#type' => 'radios', + '#title' => t('Preview comment'), + '#default_value' => variable_get('comment_preview_' . $form['#node_type']->type, COMMENT_PREVIEW_REQUIRED), + '#options' => array(t('Optional'), t('Required')), + '#description' => t("Forces a user to look at their comment by clicking on a 'Preview' button before they can actually add the comment"), + ); + $form['comment']['comment_form_location'] = array( + '#type' => 'radios', + '#title' => t('Location of comment submission form'), + '#default_value' => variable_get('comment_form_location_' . $form['#node_type']->type, COMMENT_FORM_SEPARATE_PAGE), + '#options' => array(t('Display on separate page'), t('Display below post or comments')), + ); + } +} + Index: modules/comment/comment.bootstrap.inc =================================================================== RCS file: modules/comment/comment.bootstrap.inc diff -N modules/comment/comment.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/comment/comment.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,165 @@ +' . t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any content type may have its Default comment setting set to Open to allow comments, Hidden to hide existing comments and prevent new comments or Closed to allow existing comments to be viewed but no new comments added. Comment display settings and other controls may also be customized for each content type.', array('@content-type' => url('admin/build/types'))) . ''; + $output .= '' . t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same text formats and HTML tags available when creating other forms of content.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Comment module.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '
'; + + return $output; + + case 'admin/content/comment': + return '' . t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '
'; + + case 'admin/content/comment/approval': + return '' . t("Below is a list of the unapproved comments posted to your site. To approve comments, select them with the checkbox, choose Publish the selected comments from Update options and click the Update button. To delete them, choose Delete the selected comments instead. Use edit to individually modify a comment's content.") . '
'; + } +} + +/** + * Implementation of hook_hook_info(). + */ +function comment_hook_info() { + return array( + 'comment' => array( + 'comment' => array( + 'insert' => array( + 'runs when' => t('After saving a new comment'), + ), + 'update' => array( + 'runs when' => t('After saving an updated comment'), + ), + 'delete' => array( + 'runs when' => t('After deleting a comment') + ), + 'view' => array( + 'runs when' => t('When a comment is being viewed by an authenticated user') + ), + ), + ), + ); +} + +/** + * Implementation of hook_action_info(). + */ +function comment_action_info() { + return array( + 'comment_unpublish_action' => array( + 'description' => t('Unpublish comment'), + 'type' => 'comment', + 'configurable' => FALSE, + 'hooks' => array( + 'comment' => array('insert', 'update'), + ) + ), + 'comment_unpublish_by_keyword_action' => array( + 'description' => t('Unpublish comment containing keyword(s)'), + 'type' => 'comment', + 'configurable' => TRUE, + 'hooks' => array( + 'comment' => array('insert', 'update'), + ) + ) + ); +} + Index: modules/comment/comment.info =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.info,v retrieving revision 1.9 diff -u -p -r1.9 comment.info --- modules/comment/comment.info 11 Oct 2008 02:32:41 -0000 1.9 +++ modules/comment/comment.info 20 May 2009 21:14:45 -0000 @@ -9,3 +9,6 @@ files[] = comment.module files[] = comment.admin.inc files[] = comment.pages.inc files[] = comment.install +files[] = comment.registry.inc +files[] = comment.bootstrap.inc +files[] = comment.alter.inc Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.709 diff -u -p -r1.709 comment.module --- modules/comment/comment.module 12 May 2009 08:37:44 -0000 1.709 +++ modules/comment/comment.module 20 May 2009 22:21:15 -0000 @@ -2,218 +2,6 @@ // $Id: comment.module,v 1.709 2009/05/12 08:37:44 dries Exp $ /** - * @file - * Enables users to comment on published content. - * - * When enabled, the Drupal comment module creates a discussion - * board for each Drupal node. Users can post comments to discuss - * a forum topic, weblog post, story, collaborative book page, etc. - */ - -/** - * Comment is awaiting approval. - */ -define('COMMENT_NOT_PUBLISHED', 0); - -/** - * Comment is published. - */ -define('COMMENT_PUBLISHED', 1); - -/** - * Comments are displayed in a flat list - collapsed. - */ -define('COMMENT_MODE_FLAT_COLLAPSED', 1); - -/** - * Comments are displayed in a flat list - expanded. - */ -define('COMMENT_MODE_FLAT_EXPANDED', 2); - -/** - * Comments are displayed as a threaded list - collapsed. - */ -define('COMMENT_MODE_THREADED_COLLAPSED', 3); - -/** - * Comments are displayed as a threaded list - expanded. - */ -define('COMMENT_MODE_THREADED_EXPANDED', 4); - -/** - * Anonymous posters cannot enter their contact information. - */ -define('COMMENT_ANONYMOUS_MAYNOT_CONTACT', 0); - -/** - * Anonymous posters may leave their contact information. - */ -define('COMMENT_ANONYMOUS_MAY_CONTACT', 1); - -/** - * Anonymous posters are required to leave their contact information. - */ -define('COMMENT_ANONYMOUS_MUST_CONTACT', 2); - -/** - * Comment form should be displayed on a separate page. - */ -define('COMMENT_FORM_SEPARATE_PAGE', 0); - -/** - * Comment form should be shown below post or list of comments. - */ -define('COMMENT_FORM_BELOW', 1); - -/** - * Comments for this node are hidden. - */ -define('COMMENT_NODE_HIDDEN', 0); - -/** - * Comments for this node are closed. - */ -define('COMMENT_NODE_CLOSED', 1); - -/** - * Comments for this node are open. - */ -define('COMMENT_NODE_OPEN', 2); - -/** - * Comment preview is optional. - */ -define('COMMENT_PREVIEW_OPTIONAL', 0); - -/** - * Comment preview is required. - */ -define('COMMENT_PREVIEW_REQUIRED', 1); - -/** - * Implementation of hook_help(). - */ -function comment_help($path, $arg) { - switch ($path) { - case 'admin/help#comment': - $output = '' . t('The comment module allows visitors to comment on your posts, creating ad hoc discussion boards. Any content type may have its Default comment setting set to Open to allow comments, Hidden to hide existing comments and prevent new comments or Closed to allow existing comments to be viewed but no new comments added. Comment display settings and other controls may also be customized for each content type.', array('@content-type' => url('admin/build/types'))) . '
'; - $output .= '' . t('Comment permissions are assigned to user roles, and are used to determine whether anonymous users (or other roles) are allowed to comment on posts. If anonymous users are allowed to comment, their individual contact information may be retained in cookies stored on their local computer for use in later comment submissions. When a comment has no replies, it may be (optionally) edited by its author. The comment module uses the same text formats and HTML tags available when creating other forms of content.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Comment module.', array('@comment' => 'http://drupal.org/handbook/modules/comment/')) . '
'; - - return $output; - - case 'admin/content/comment': - return '' . t("Below is a list of the latest comments posted to your site. Click on a subject to see the comment, the author's name to edit the author's user information, 'edit' to modify the text, and 'delete' to remove their submission.") . '
'; - - case 'admin/content/comment/approval': - return '' . t("Below is a list of the unapproved comments posted to your site. To approve comments, select them with the checkbox, choose Publish the selected comments from Update options and click the Update button. To delete them, choose Delete the selected comments instead. Use edit to individually modify a comment's content.") . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function comment_theme() { - return array( - 'comment_block' => array( - 'arguments' => array(), - ), - 'comment_preview' => array( - 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1), - ), - 'comment_view' => array( - 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1), - ), - 'comment' => array( - 'template' => 'comment', - 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array()), - ), - 'comment_form_box' => array( - 'arguments' => array('edit' => NULL, 'title' => NULL), - ), - 'comment_folded' => array( - 'template' => 'comment-folded', - 'arguments' => array('comment' => NULL), - ), - 'comment_flat_collapsed' => array( - 'arguments' => array('comment' => NULL, 'node' => NULL), - ), - 'comment_flat_expanded' => array( - 'arguments' => array('comment' => NULL, 'node' => NULL), - ), - 'comment_thread_collapsed' => array( - 'arguments' => array('comment' => NULL, 'node' => NULL), - ), - 'comment_thread_expanded' => array( - 'arguments' => array('comment' => NULL, 'node' => NULL), - ), - 'comment_post_forbidden' => array( - 'arguments' => array('nid' => NULL), - ), - 'comment_wrapper' => array( - 'template' => 'comment-wrapper', - 'arguments' => array('content' => NULL, 'node' => NULL), - ), - 'comment_submitted' => array( - 'arguments' => array('comment' => NULL), - ), - ); -} - -/** - * Implementation of hook_menu(). - */ -function comment_menu() { - $items['admin/content/comment'] = array( - 'title' => 'Comments', - 'description' => 'List and edit site comments and the comment approval queue.', - 'page callback' => 'comment_admin', - 'access arguments' => array('administer comments'), - ); - // Tabs begin here. - $items['admin/content/comment/new'] = array( - 'title' => 'Published comments', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/content/comment/approval'] = array( - 'title' => 'Approval queue', - 'page arguments' => array('approval'), - 'access arguments' => array('administer comments'), - 'type' => MENU_LOCAL_TASK, - ); - $items['comment/delete'] = array( - 'title' => 'Delete comment', - 'page callback' => 'comment_delete', - 'access arguments' => array('administer comments'), - 'type' => MENU_CALLBACK, - ); - $items['comment/edit'] = array( - 'title' => 'Edit comment', - 'page callback' => 'comment_edit', - 'access arguments' => array('post comments'), - 'type' => MENU_CALLBACK, - ); - $items['comment/reply/%node'] = array( - 'title' => 'Reply to comment', - 'page callback' => 'comment_reply', - 'page arguments' => array(2), - 'access callback' => 'node_access', - 'access arguments' => array('view', 2), - 'type' => MENU_CALLBACK, - ); - $items['comment/approve'] = array( - 'title' => 'Approve a comment', - 'page callback' => 'comment_approve', - 'page arguments' => array(2), - 'access arguments' => array('administer comments'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Implementation of hook_node_type(). */ function comment_node_type($op, $info) { @@ -509,141 +297,6 @@ function comment_node_view($node, $tease } /** - * Implementation of hook_form_FORM_ID_alter(). - */ -function comment_form_node_type_form_alter(&$form, $form_state) { - if (isset($form['identity']['type'])) { - $form['comment'] = array( - '#type' => 'fieldset', - '#title' => t('Comment settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - ); - $form['comment']['comment'] = array( - '#type' => 'radios', - '#title' => t('Default comment setting'), - '#default_value' => variable_get('comment_' . $form['#node_type']->type, COMMENT_NODE_OPEN), - '#options' => array(t('Hidden'), t('Closed'), t('Open')), - '#description' => t('Users with the administer comments permission will be able to override this setting.'), - ); - $form['comment']['comment_default_mode'] = array( - '#type' => 'radios', - '#title' => t('Default display mode'), - '#default_value' => variable_get('comment_default_mode_' . $form['#node_type']->type, COMMENT_MODE_THREADED_EXPANDED), - '#options' => _comment_get_modes(), - '#description' => t('Expanded views display the body of the comment. Threaded views keep replies together.'), - ); - $form['comment']['comment_default_per_page'] = array( - '#type' => 'select', - '#title' => t('Comments per page'), - '#default_value' => variable_get('comment_default_per_page_' . $form['#node_type']->type, 50), - '#options' => _comment_per_page(), - '#description' => t('Additional comments will be displayed on separate pages.'), - ); - $form['comment']['comment_anonymous'] = array( - '#type' => 'radios', - '#title' => t('Anonymous commenting'), - '#default_value' => variable_get('comment_anonymous_' . $form['#node_type']->type, COMMENT_ANONYMOUS_MAYNOT_CONTACT), - '#options' => array( - COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'), - COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'), - COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information')), - '#description' => t('This option is enabled when anonymous users have permission to post comments on the permissions page.', array('@url' => url('admin/user/permissions', array('fragment' => 'module-comment')))), - ); - - if (!user_access('post comments', drupal_anonymous_user())) { - $form['comment']['comment_anonymous']['#disabled'] = TRUE; - } - - $form['comment']['comment_subject_field'] = array( - '#type' => 'radios', - '#title' => t('Comment subject field'), - '#default_value' => variable_get('comment_subject_field_' . $form['#node_type']->type, 1), - '#options' => array(t('Disabled'), t('Enabled')), - '#description' => t('Can users provide a unique subject for their comments?'), - ); - $form['comment']['comment_preview'] = array( - '#type' => 'radios', - '#title' => t('Preview comment'), - '#default_value' => variable_get('comment_preview_' . $form['#node_type']->type, COMMENT_PREVIEW_REQUIRED), - '#options' => array(t('Optional'), t('Required')), - '#description' => t("Forces a user to look at their comment by clicking on a 'Preview' button before they can actually add the comment"), - ); - $form['comment']['comment_form_location'] = array( - '#type' => 'radios', - '#title' => t('Location of comment submission form'), - '#default_value' => variable_get('comment_form_location_' . $form['#node_type']->type, COMMENT_FORM_SEPARATE_PAGE), - '#options' => array(t('Display on separate page'), t('Display below post or comments')), - ); - } -} - -/** - * Implementation of hook_form_alter(). - */ -function comment_form_alter(&$form, $form_state, $form_id) { - if (!empty($form['#node_edit_form'])) { - $node = $form['#node']; - $form['comment_settings'] = array( - '#type' => 'fieldset', - '#access' => user_access('administer comments'), - '#title' => t('Comment settings'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'comment') . '/comment-node-form.js'), - '#weight' => 30, - ); - $comment_count = isset($node->nid) ? db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array(':nid' => $node->nid))->fetchField() : 0; - $comment_settings = ($node->comment == COMMENT_NODE_HIDDEN && empty($comment_count)) ? COMMENT_NODE_CLOSED : $node->comment; - $form['comment_settings']['comment'] = array( - '#type' => 'radios', - '#parents' => array('comment'), - '#default_value' => $comment_settings, - '#options' => array( - COMMENT_NODE_OPEN => t('Open'), - COMMENT_NODE_CLOSED => t('Closed'), - COMMENT_NODE_HIDDEN => t('Hidden'), - ), - COMMENT_NODE_OPEN => array( - '#type' => 'radio', - '#title' => t('Open'), - '#description' => theme('indentation') . t("Users with 'post comments' permission can post comments."), - '#return_value' => COMMENT_NODE_OPEN, - '#default_value' => $comment_settings, - '#id' => 'edit-comment-2', - '#parents' => array('comment'), - ), - COMMENT_NODE_CLOSED => array( - '#type' => 'radio', - '#title' => t('Closed'), - '#description' => theme('indentation') . t('Users cannot post comments, but existing comments will be displayed.'), - '#return_value' => COMMENT_NODE_CLOSED, - '#default_value' => $comment_settings, - '#id' => 'edit-comment-1', - '#parents' => array('comment'), - ), - COMMENT_NODE_HIDDEN => array( - '#type' => 'radio', - '#title' => t('Hidden'), - '#description' => theme('indentation') . t('Comments are hidden from view.'), - '#return_value' => COMMENT_NODE_HIDDEN, - '#default_value' => $comment_settings, - '#id' => 'edit-comment-0', - '#parents' => array('comment'), - ), - ); - // If the node doesn't have any comments, the "hidden" option makes no - // sense, so don't even bother presenting it to the user. - if (empty($comment_count)) { - unset($form['comment_settings']['comment']['#options'][COMMENT_NODE_HIDDEN]); - unset($form['comment_settings']['comment'][COMMENT_NODE_HIDDEN]); - $form['comment_settings']['comment'][COMMENT_NODE_CLOSED]['#description'] = theme('indentation') . t('Users cannot post comments.'); - } - } -} - -/** * Implementation of hook_node_load(). */ function comment_node_load($nodes, $types) { @@ -2110,54 +1763,6 @@ function vancode2int($c = '00') { } /** - * Implementation of hook_hook_info(). - */ -function comment_hook_info() { - return array( - 'comment' => array( - 'comment' => array( - 'insert' => array( - 'runs when' => t('After saving a new comment'), - ), - 'update' => array( - 'runs when' => t('After saving an updated comment'), - ), - 'delete' => array( - 'runs when' => t('After deleting a comment') - ), - 'view' => array( - 'runs when' => t('When a comment is being viewed by an authenticated user') - ), - ), - ), - ); -} - -/** - * Implementation of hook_action_info(). - */ -function comment_action_info() { - return array( - 'comment_unpublish_action' => array( - 'description' => t('Unpublish comment'), - 'type' => 'comment', - 'configurable' => FALSE, - 'hooks' => array( - 'comment' => array('insert', 'update'), - ) - ), - 'comment_unpublish_by_keyword_action' => array( - 'description' => t('Unpublish comment containing keyword(s)'), - 'type' => 'comment', - 'configurable' => TRUE, - 'hooks' => array( - 'comment' => array('insert', 'update'), - ) - ) - ); -} - -/** * Drupal action to unpublish a comment. * * @param $context Index: modules/comment/comment.registry.inc =================================================================== RCS file: modules/comment/comment.registry.inc diff -N modules/comment/comment.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/comment/comment.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,111 @@ + 'Comments', + 'description' => 'List and edit site comments and the comment approval queue.', + 'page callback' => 'comment_admin', + 'access arguments' => array('administer comments'), + ); + // Tabs begin here. + $items['admin/content/comment/new'] = array( + 'title' => 'Published comments', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/content/comment/approval'] = array( + 'title' => 'Approval queue', + 'page arguments' => array('approval'), + 'access arguments' => array('administer comments'), + 'type' => MENU_LOCAL_TASK, + ); + $items['comment/delete'] = array( + 'title' => 'Delete comment', + 'page callback' => 'comment_delete', + 'access arguments' => array('administer comments'), + 'type' => MENU_CALLBACK, + ); + $items['comment/edit'] = array( + 'title' => 'Edit comment', + 'page callback' => 'comment_edit', + 'access arguments' => array('post comments'), + 'type' => MENU_CALLBACK, + ); + $items['comment/reply/%node'] = array( + 'title' => 'Reply to comment', + 'page callback' => 'comment_reply', + 'page arguments' => array(2), + 'access callback' => 'node_access', + 'access arguments' => array('view', 2), + 'type' => MENU_CALLBACK, + ); + $items['comment/approve'] = array( + 'title' => 'Approve a comment', + 'page callback' => 'comment_approve', + 'page arguments' => array(2), + 'access arguments' => array('administer comments'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function comment_theme() { + return array( + 'comment_block' => array( + 'arguments' => array(), + ), + 'comment_preview' => array( + 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1), + ), + 'comment_view' => array( + 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array(), 'visible' => 1), + ), + 'comment' => array( + 'template' => 'comment', + 'arguments' => array('comment' => NULL, 'node' => NULL, 'links' => array()), + ), + 'comment_form_box' => array( + 'arguments' => array('edit' => NULL, 'title' => NULL), + ), + 'comment_folded' => array( + 'template' => 'comment-folded', + 'arguments' => array('comment' => NULL), + ), + 'comment_flat_collapsed' => array( + 'arguments' => array('comment' => NULL, 'node' => NULL), + ), + 'comment_flat_expanded' => array( + 'arguments' => array('comment' => NULL, 'node' => NULL), + ), + 'comment_thread_collapsed' => array( + 'arguments' => array('comment' => NULL, 'node' => NULL), + ), + 'comment_thread_expanded' => array( + 'arguments' => array('comment' => NULL, 'node' => NULL), + ), + 'comment_post_forbidden' => array( + 'arguments' => array('nid' => NULL), + ), + 'comment_wrapper' => array( + 'template' => 'comment-wrapper', + 'arguments' => array('content' => NULL, 'node' => NULL), + ), + 'comment_submitted' => array( + 'arguments' => array('comment' => NULL), + ), + ); +} + Index: modules/contact/contact.bootstrap.inc =================================================================== RCS file: modules/contact/contact.bootstrap.inc diff -N modules/contact/contact.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/contact/contact.bootstrap.inc 20 May 2009 18:49:54 -0000 @@ -0,0 +1,39 @@ +' . t('The contact module facilitates communication via e-mail, by allowing your site\'s visitors to contact one another (personal contact forms), and by providing a simple way to direct messages to a set of administrator-defined recipients (the contact page). With either form, users specify a subject, write their message, and (optionally) have a copy of their message sent to their own e-mail address.', array('@contact' => url('contact'))) . ''; + $output .= '' . t("Personal contact forms allow users to be contacted via e-mail, while keeping recipient e-mail addresses private. Users may enable or disable their personal contact forms by editing their My account page. If enabled, a Contact tab leading to their personal contact form is available on their user profile. Site administrators have access to all personal contact forms (even if they have been disabled). The Contact tab is only visible when viewing another user's profile (users do not see their own Contact tab).") . '
'; + $output .= '' . t('The contact page provides a simple form for visitors to leave comments, feedback, or other requests. Messages are routed by selecting a category from a list of administrator-defined options; each category has its own set of e-mail recipients. Common categories for a business site include, for example, "Website feedback" (messages are forwarded to web site administrators) and "Product information" (messages are forwarded to members of the sales department). The actual e-mail addresses defined within a category are not displayed. Only users in roles with the access site-wide contact form permission may access the contact page.', array('@contact' => url('contact'))) . '
'; + $output .= '' . t('A link to your site\'s contact page from the main Navigation menu is created, but is disabled by default. Create a similar link on another menu by adding a menu item pointing to the path "contact"', array('@contact' => url('contact'))) . '
'; + $output .= '' . t('Customize the contact page with additional information (like physical location, mailing address, and telephone number) using the contact form settings page. The settings page also provides configuration options for the maximum number of contact form submissions a user may perform per hour, and the default status of users\' personal contact forms.', array('@contact-settings' => url('admin/build/contact/settings'), '@contact' => url('contact'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) . '
'; + return $output; + case 'admin/build/contact': + $output = '' . t('This page lets you set up your site-wide contact form. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the settings page, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'))) . '
'; + if (!module_exists('menu')) { + $menu_note = t('The menu item can be customized and configured only once the menu module has been enabled.', array('@modules-page' => url('admin/settings/modules'))); + } + else { + $menu_note = ''; + } + $output .= '' . t('The contact module also adds a menu item (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) . ' ' . $menu_note . '
'; + return $output; + } +} + Index: modules/contact/contact.info =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.info,v retrieving revision 1.8 diff -u -p -r1.8 contact.info --- modules/contact/contact.info 11 Oct 2008 02:32:42 -0000 1.8 +++ modules/contact/contact.info 20 May 2009 18:49:54 -0000 @@ -8,3 +8,5 @@ files[] = contact.module files[] = contact.admin.inc files[] = contact.pages.inc files[] = contact.install +files[] = contact.registry.inc +files[] = contact.bootstrap.inc Index: modules/contact/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v retrieving revision 1.114 diff -u -p -r1.114 contact.module --- modules/contact/contact.module 10 May 2009 18:24:06 -0000 1.114 +++ modules/contact/contact.module 20 May 2009 18:49:54 -0000 @@ -2,37 +2,6 @@ // $Id: contact.module,v 1.114 2009/05/10 18:24:06 dries Exp $ /** - * @file - * Enables the use of personal and site-wide contact forms. - */ - -/** - * Implementation of hook_help(). - */ -function contact_help($path, $arg) { - switch ($path) { - case 'admin/help#contact': - $output = '' . t('The contact module facilitates communication via e-mail, by allowing your site\'s visitors to contact one another (personal contact forms), and by providing a simple way to direct messages to a set of administrator-defined recipients (the contact page). With either form, users specify a subject, write their message, and (optionally) have a copy of their message sent to their own e-mail address.', array('@contact' => url('contact'))) . '
'; - $output .= '' . t("Personal contact forms allow users to be contacted via e-mail, while keeping recipient e-mail addresses private. Users may enable or disable their personal contact forms by editing their My account page. If enabled, a Contact tab leading to their personal contact form is available on their user profile. Site administrators have access to all personal contact forms (even if they have been disabled). The Contact tab is only visible when viewing another user's profile (users do not see their own Contact tab).") . '
'; - $output .= '' . t('The contact page provides a simple form for visitors to leave comments, feedback, or other requests. Messages are routed by selecting a category from a list of administrator-defined options; each category has its own set of e-mail recipients. Common categories for a business site include, for example, "Website feedback" (messages are forwarded to web site administrators) and "Product information" (messages are forwarded to members of the sales department). The actual e-mail addresses defined within a category are not displayed. Only users in roles with the access site-wide contact form permission may access the contact page.', array('@contact' => url('contact'))) . '
'; - $output .= '' . t('A link to your site\'s contact page from the main Navigation menu is created, but is disabled by default. Create a similar link on another menu by adding a menu item pointing to the path "contact"', array('@contact' => url('contact'))) . '
'; - $output .= '' . t('Customize the contact page with additional information (like physical location, mailing address, and telephone number) using the contact form settings page. The settings page also provides configuration options for the maximum number of contact form submissions a user may perform per hour, and the default status of users\' personal contact forms.', array('@contact-settings' => url('admin/build/contact/settings'), '@contact' => url('contact'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Contact module.', array('@contact' => url('http://drupal.org/handbook/modules/contact/', array('absolute' => TRUE)))) . '
'; - return $output; - case 'admin/build/contact': - $output = '' . t('This page lets you set up your site-wide contact form. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the settings page, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact'))) . '
'; - if (!module_exists('menu')) { - $menu_note = t('The menu item can be customized and configured only once the menu module has been enabled.', array('@modules-page' => url('admin/settings/modules'))); - } - else { - $menu_note = ''; - } - $output .= '' . t('The contact module also adds a menu item (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) . ' ' . $menu_note . '
'; - return $output; - } -} - -/** * Implementation of hook_perm(). */ function contact_perm() { @@ -49,69 +18,6 @@ function contact_perm() { } /** - * Implementation of hook_menu(). - */ -function contact_menu() { - $items['admin/build/contact'] = array( - 'title' => 'Contact form', - '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'), - ); - $items['admin/build/contact/list'] = array( - 'title' => 'List', - 'page callback' => 'contact_admin_categories', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/build/contact/add'] = array( - 'title' => 'Add category', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('contact_admin_edit', 3), - 'access arguments' => array('administer site-wide contact form'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - $items['admin/build/contact/edit/%contact'] = array( - 'title' => 'Edit contact category', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('contact_admin_edit', 3, 4), - 'access arguments' => array('administer site-wide contact form'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/contact/delete/%contact'] = array( - 'title' => 'Delete contact', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('contact_admin_delete', 4), - 'access arguments' => array('administer site-wide contact form'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/contact/settings'] = array( - 'title' => 'Settings', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('contact_admin_settings'), - 'access arguments' => array('administer site-wide contact form'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - $items['contact'] = array( - 'title' => 'Contact', - 'page callback' => 'contact_site_page', - 'access arguments' => array('access site-wide contact form'), - 'type' => MENU_SUGGESTED_ITEM, - ); - $items['user/%user/contact'] = array( - 'title' => 'Contact', - 'page callback' => 'contact_personal_page', - 'page arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - 'access callback' => '_contact_personal_tab_access', - 'access arguments' => array(1), - 'weight' => 2, - ); - return $items; -} - -/** * Determine permission to a user's personal contact form. */ function _contact_personal_tab_access($account) { Index: modules/contact/contact.registry.inc =================================================================== RCS file: modules/contact/contact.registry.inc diff -N modules/contact/contact.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/contact/contact.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,71 @@ + 'Contact form', + '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'), + ); + $items['admin/build/contact/list'] = array( + 'title' => 'List', + 'page callback' => 'contact_admin_categories', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/build/contact/add'] = array( + 'title' => 'Add category', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('contact_admin_edit', 3), + 'access arguments' => array('administer site-wide contact form'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 1, + ); + $items['admin/build/contact/edit/%contact'] = array( + 'title' => 'Edit contact category', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('contact_admin_edit', 3, 4), + 'access arguments' => array('administer site-wide contact form'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/contact/delete/%contact'] = array( + 'title' => 'Delete contact', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('contact_admin_delete', 4), + 'access arguments' => array('administer site-wide contact form'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/contact/settings'] = array( + 'title' => 'Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('contact_admin_settings'), + 'access arguments' => array('administer site-wide contact form'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + $items['contact'] = array( + 'title' => 'Contact', + 'page callback' => 'contact_site_page', + 'access arguments' => array('access site-wide contact form'), + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['user/%user/contact'] = array( + 'title' => 'Contact', + 'page callback' => 'contact_personal_page', + 'page arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + 'access callback' => '_contact_personal_tab_access', + 'access arguments' => array(1), + 'weight' => 2, + ); + return $items; +} + Index: modules/dblog/dblog.bootstrap.inc =================================================================== RCS file: modules/dblog/dblog.bootstrap.inc diff -N modules/dblog/dblog.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/dblog/dblog.bootstrap.inc 20 May 2009 20:19:05 -0000 @@ -0,0 +1,30 @@ + FALSE)); + } +} + +/** + * Implementation of hook_help(). + */ +function dblog_help($path, $arg) { + switch ($path) { + case 'admin/help#dblog': + $output = '' . t('The dblog module monitors your system, capturing system events in a log to be reviewed by an authorized individual at a later time. This is useful for site administrators who want a quick overview of activities on their site. The logs also record the sequence of events, so it can be useful for debugging site errors.') . '
'; + $output .= '' . t('The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. Administrators should check the dblog report on a regular basis to ensure their site is working properly.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Dblog module.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog/')) . '
'; + return $output; + case 'admin/reports/dblog': + return '' . t('The dblog module monitors your website, capturing system events in a log to be reviewed by an authorized individual at a later time. The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the dblog report on a regular basis as it is often the only way to tell what is going on.') . '
'; + } +} + Index: modules/dblog/dblog.info =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.info,v retrieving revision 1.6 diff -u -p -r1.6 dblog.info --- modules/dblog/dblog.info 11 Oct 2008 02:32:44 -0000 1.6 +++ modules/dblog/dblog.info 20 May 2009 18:49:54 -0000 @@ -7,3 +7,5 @@ core = 7.x files[] = dblog.module files[] = dblog.admin.inc files[] = dblog.install +files[] = dblog.registry.inc +files[] = dblog.bootstrap.inc Index: modules/dblog/dblog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v retrieving revision 1.37 diff -u -p -r1.37 dblog.module --- modules/dblog/dblog.module 13 Apr 2009 08:48:58 -0000 1.37 +++ modules/dblog/dblog.module 20 May 2009 21:23:11 -0000 @@ -13,76 +13,6 @@ */ /** - * Implementation of hook_help(). - */ -function dblog_help($path, $arg) { - switch ($path) { - case 'admin/help#dblog': - $output = '' . t('The dblog module monitors your system, capturing system events in a log to be reviewed by an authorized individual at a later time. This is useful for site administrators who want a quick overview of activities on their site. The logs also record the sequence of events, so it can be useful for debugging site errors.') . '
'; - $output .= '' . t('The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. Administrators should check the dblog report on a regular basis to ensure their site is working properly.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Dblog module.', array('@dblog' => 'http://drupal.org/handbook/modules/dblog/')) . '
'; - return $output; - case 'admin/reports/dblog': - return '' . t('The dblog module monitors your website, capturing system events in a log to be reviewed by an authorized individual at a later time. The dblog log is simply a list of recorded events containing usage data, performance data, errors, warnings and operational information. It is vital to check the dblog report on a regular basis as it is often the only way to tell what is going on.') . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function dblog_theme() { - return array( - 'dblog_filters' => array( - 'arguments' => array('form' => NULL), - ), - ); -} - -/** - * Implementation of hook_menu(). - */ -function dblog_menu() { - $items['admin/reports/dblog'] = array( - 'title' => 'Recent log entries', - 'description' => 'View events that have recently been logged.', - 'page callback' => 'dblog_overview', - 'access arguments' => array('access site reports'), - 'weight' => -1, - ); - $items['admin/reports/page-not-found'] = array( - 'title' => "Top 'page not found' errors", - 'description' => "View 'page not found' errors (404s).", - 'page callback' => 'dblog_top', - 'page arguments' => array('page not found'), - 'access arguments' => array('access site reports'), - ); - $items['admin/reports/access-denied'] = array( - 'title' => "Top 'access denied' errors", - 'description' => "View 'access denied' errors (403s).", - 'page callback' => 'dblog_top', - 'page arguments' => array('access denied'), - 'access arguments' => array('access site reports'), - ); - $items['admin/reports/event/%'] = array( - 'title' => 'Details', - 'page callback' => 'dblog_event', - 'page arguments' => array(3), - 'access arguments' => array('access site reports'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -function dblog_init() { - if (arg(0) == 'admin' && arg(1) == 'reports') { - // Add the CSS for this module - drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', array('preprocess' => FALSE)); - } -} - - - -/** * Implementation of hook_cron(). * * Remove expired log messages and flood control events. Index: modules/dblog/dblog.registry.inc =================================================================== RCS file: modules/dblog/dblog.registry.inc diff -N modules/dblog/dblog.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/dblog/dblog.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,54 @@ + 'Recent log entries', + 'description' => 'View events that have recently been logged.', + 'page callback' => 'dblog_overview', + 'access arguments' => array('access site reports'), + 'weight' => -1, + ); + $items['admin/reports/page-not-found'] = array( + 'title' => "Top 'page not found' errors", + 'description' => "View 'page not found' errors (404s).", + 'page callback' => 'dblog_top', + 'page arguments' => array('page not found'), + 'access arguments' => array('access site reports'), + ); + $items['admin/reports/access-denied'] = array( + 'title' => "Top 'access denied' errors", + 'description' => "View 'access denied' errors (403s).", + 'page callback' => 'dblog_top', + 'page arguments' => array('access denied'), + 'access arguments' => array('access site reports'), + ); + $items['admin/reports/event/%'] = array( + 'title' => 'Details', + 'page callback' => 'dblog_event', + 'page arguments' => array(3), + 'access arguments' => array('access site reports'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function dblog_theme() { + return array( + 'dblog_filters' => array( + 'arguments' => array('form' => NULL), + ), + ); +} + Index: modules/field/field.bootstrap.inc =================================================================== RCS file: modules/field/field.bootstrap.inc diff -N modules/field/field.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/field.bootstrap.inc 20 May 2009 21:27:06 -0000 @@ -0,0 +1,63 @@ +' . t('The Field API allows custom data fields to be attached to Drupal objects and takes care of storing, loading, editing, and rendering field data. Any object type (node, user, etc.) can use the Field API to make itself "fieldable" and thus allow fields to be attached to it.') . ''; + $output .= '' .t('The Field API provides no user interface on its own. Use the Content Construction Kit (CCK) contrib module to manage custom fields via a web browser.') . '
'; + return $output; + } +} + Index: modules/field/field.info =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.info,v retrieving revision 1.2 diff -u -p -r1.2 field.info --- modules/field/field.info 10 May 2009 18:56:56 -0000 1.2 +++ modules/field/field.info 20 May 2009 18:49:54 -0000 @@ -14,3 +14,5 @@ files[] = field.form.inc files[] = field.autoload.inc dependencies[] = field_sql_storage required = TRUE +files[] = field.registry.inc +files[] = field.bootstrap.inc Index: modules/field/field.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.module,v retrieving revision 1.7 diff -u -p -r1.7 field.module --- modules/field/field.module 26 Mar 2009 13:31:24 -0000 1.7 +++ modules/field/field.module 20 May 2009 21:27:00 -0000 @@ -48,35 +48,6 @@ * in the local SQL database. */ -/** - * Value for $field['cardinality'] property to indicate it can hold an - * unlimited number of values. - */ -define('FIELD_CARDINALITY_UNLIMITED', -1); - -/** - * TODO - */ -define('FIELD_BEHAVIOR_NONE', 0x0001); -/** - * TODO - */ -define('FIELD_BEHAVIOR_DEFAULT', 0x0002); -/** - * TODO - */ -define('FIELD_BEHAVIOR_CUSTOM', 0x0004); - -/** - * Age argument for loading the most recent version of an object's - * field data with field_attach_load(). - */ -define('FIELD_LOAD_CURRENT', 'FIELD_LOAD_CURRENT'); -/** - * Age argument for loading the version of an object's field data - * specified in the object with field_attach_load(). - */ -define('FIELD_LOAD_REVISION', 'FIELD_LOAD_REVISION'); /** @@ -95,72 +66,6 @@ function field_flush_caches() { } /** - * Implementation of hook_help(). - */ -function field_help($path, $arg) { - switch ($path) { - case 'admin/help#field': - $output = '' . t('The Field API allows custom data fields to be attached to Drupal objects and takes care of storing, loading, editing, and rendering field data. Any object type (node, user, etc.) can use the Field API to make itself "fieldable" and thus allow fields to be attached to it.') . '
'; - $output .= '' .t('The Field API provides no user interface on its own. Use the Content Construction Kit (CCK) contrib module to manage custom fields via a web browser.') . '
'; - return $output; - } -} - -/** - * Implementation of hook_init(). - * - * TODO D7: Determine which functions need to always be "loaded", and - * put autoloaders for them into field.autoload.inc. Also figure out - * how to make this work during installation. - */ -function field_init() { - module_load_include('inc', 'field', 'field.crud'); - module_load_include('inc', 'field', 'field.autoload'); - drupal_add_css(drupal_get_path('module', 'field') . '/theme/field.css'); -} - -/** - * Implementation of hook_menu(). - */ -function field_menu() { - $items = array(); - - // Callback for AHAH add more buttons. - $items['field/js_add_more'] = array( - 'page callback' => 'field_add_more_js', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** - * Implementation of hook_theme(). - */ -function field_theme() { - $path = drupal_get_path('module', 'field') . '/theme'; - - return array( - 'field' => array( - 'template' => 'field', - 'arguments' => array('element' => NULL), - 'path' => $path, - ), - // TODO D7 : do we need exclude in core? See [#367215]. - // This is just adding '#post_render' => array('field_wrapper_post_render') - // at the right places in the render array generated by field_default_view(). - // Can be done in hook_field_attach_post_view if we want. - 'field_exclude' => array( - 'arguments' => array('content' => NULL, 'object' => array(), 'context' => NULL), - ), - 'field_multiple_value_form' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** * Implementation of hook_modules_installed(). */ function field_modules_installed($modules) { Index: modules/field/field.registry.inc =================================================================== RCS file: modules/field/field.registry.inc diff -N modules/field/field.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/field.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,49 @@ + 'field_add_more_js', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function field_theme() { + $path = drupal_get_path('module', 'field') . '/theme'; + + return array( + 'field' => array( + 'template' => 'field', + 'arguments' => array('element' => NULL), + 'path' => $path, + ), + // TODO D7 : do we need exclude in core? See [#367215]. + // This is just adding '#post_render' => array('field_wrapper_post_render') + // at the right places in the render array generated by field_default_view(). + // Can be done in hook_field_attach_post_view if we want. + 'field_exclude' => array( + 'arguments' => array('content' => NULL, 'object' => array(), 'context' => NULL), + ), + 'field_multiple_value_form' => array( + 'arguments' => array('element' => NULL), + ), + ); +} + Index: modules/field/modules/field_sql_storage/field_sql_storage.bootstrap.inc =================================================================== RCS file: modules/field/modules/field_sql_storage/field_sql_storage.bootstrap.inc diff -N modules/field/modules/field_sql_storage/field_sql_storage.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/field_sql_storage/field_sql_storage.bootstrap.inc 20 May 2009 18:49:54 -0000 @@ -0,0 +1,24 @@ +' . t('The Field SQL Storage module stores Field API data in the database. It is the default field storage module, but other field storage modules may be available in the contributions repository.') . ''; + return $output; + } +} + Index: modules/field/modules/field_sql_storage/field_sql_storage.info =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/field_sql_storage/field_sql_storage.info,v retrieving revision 1.2 diff -u -p -r1.2 field_sql_storage.info --- modules/field/modules/field_sql_storage/field_sql_storage.info 10 May 2009 18:56:56 -0000 1.2 +++ modules/field/modules/field_sql_storage/field_sql_storage.info 20 May 2009 18:49:54 -0000 @@ -7,3 +7,4 @@ core = 7.x files[] = field_sql_storage.module files[] = field_sql_storage.install required = TRUE +files[] = field_sql_storage.bootstrap.inc Index: modules/field/modules/field_sql_storage/field_sql_storage.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/field_sql_storage/field_sql_storage.module,v retrieving revision 1.9 diff -u -p -r1.9 field_sql_storage.module --- modules/field/modules/field_sql_storage/field_sql_storage.module 20 May 2009 09:48:47 -0000 1.9 +++ modules/field/modules/field_sql_storage/field_sql_storage.module 20 May 2009 18:49:54 -0000 @@ -2,22 +2,6 @@ // $Id: field_sql_storage.module,v 1.9 2009/05/20 09:48:47 dries Exp $ /** - * @file - * Default implementation of the field storage API. - */ - -/** - * Implementation of hook_help(). - */ -function field_sql_storage_help($path, $arg) { - switch ($path) { - case 'admin/help#field_sql_storage': - $output = '' . t('The Field SQL Storage module stores Field API data in the database. It is the default field storage module, but other field storage modules may be available in the contributions repository.') . '
'; - return $output; - } -} - -/** * Generate a table name for a field data table. * * @param $name Index: modules/field/modules/list/list.bootstrap.inc =================================================================== RCS file: modules/field/modules/list/list.bootstrap.inc diff -N modules/field/modules/list/list.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/list/list.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,66 @@ + array( + 'label' => t('List'), + 'description' => t('This field stores numeric keys from key/value lists of allowed values where the key is a simple alias for the position of the value, i.e. 0|First option, 1|Second option, 2|Third option.'), + 'settings' => array('allowed_values_function' => ''), + 'default_widget' => 'options_select', + 'default_formatter' => 'list_default', + ), + 'list_boolean' => array( + 'label' => t('Boolean'), + 'description' => t('This field stores simple on/off or yes/no options.'), + 'settings' => array('allowed_values_function' => ''), + 'default_widget' => 'options_select', + 'default_formatter' => 'list_default', + ), + 'list_number' => array( + 'label' => t('List (numeric)'), + 'description' => t('This field stores keys from key/value lists of allowed numbers where the stored numeric key has significance and must be preserved, i.e. \'Lifetime in days\': 1|1 day, 7|1 week, 31|1 month.'), + 'settings' => array('allowed_values_function' => ''), + 'default_widget' => 'options_select', + 'default_formatter' => 'list_default', + ), + 'list_text' => array( + 'label' => t('List (text)'), + 'description' => t('This field stores keys from key/value lists of allowed values where the stored key has significance and must be a varchar, i.e. \'US States\': IL|Illinois, IA|Iowa, IN|Indiana'), + 'settings' => array('allowed_values_function' => ''), + 'default_widget' => 'options_select', + 'default_formatter' => 'list_default', + ), + ); +} + +/** + * Implementation of hook_field_formatter_info(). + */ +function list_field_formatter_info() { + return array( + 'list_default' => array( + 'label' => t('Default'), + 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'list_key' => array( + 'label' => t('Key'), + 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + ); +} + Index: modules/field/modules/list/list.info =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.info,v retrieving revision 1.3 diff -u -p -r1.3 list.info --- modules/field/modules/list/list.info 10 May 2009 18:56:56 -0000 1.3 +++ modules/field/modules/list/list.info 20 May 2009 21:31:56 -0000 @@ -5,3 +5,5 @@ package = Core - fields version = VERSION core = 7.x files[]=list.module +files[] = list.registry.inc +files[] = list.bootstrap.inc Index: modules/field/modules/list/list.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.module,v retrieving revision 1.5 diff -u -p -r1.5 list.module --- modules/field/modules/list/list.module 20 May 2009 09:48:47 -0000 1.5 +++ modules/field/modules/list/list.module 20 May 2009 21:33:54 -0000 @@ -2,61 +2,6 @@ // $Id: list.module,v 1.5 2009/05/20 09:48:47 dries Exp $ /** - * @file - * Defines list field types that can be used with the Options module. - */ - -/** - * Implementation of hook_theme(). - */ -function list_theme() { - return array( - 'field_formatter_list_default' => array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_list_key' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** - * Implementation of hook_field_info(). - */ -function list_field_info() { - return array( - 'list' => array( - 'label' => t('List'), - 'description' => t('This field stores numeric keys from key/value lists of allowed values where the key is a simple alias for the position of the value, i.e. 0|First option, 1|Second option, 2|Third option.'), - 'settings' => array('allowed_values_function' => ''), - 'default_widget' => 'options_select', - 'default_formatter' => 'list_default', - ), - 'list_boolean' => array( - 'label' => t('Boolean'), - 'description' => t('This field stores simple on/off or yes/no options.'), - 'settings' => array('allowed_values_function' => ''), - 'default_widget' => 'options_select', - 'default_formatter' => 'list_default', - ), - 'list_number' => array( - 'label' => t('List (numeric)'), - 'description' => t('This field stores keys from key/value lists of allowed numbers where the stored numeric key has significance and must be preserved, i.e. \'Lifetime in days\': 1|1 day, 7|1 week, 31|1 month.'), - 'settings' => array('allowed_values_function' => ''), - 'default_widget' => 'options_select', - 'default_formatter' => 'list_default', - ), - 'list_text' => array( - 'label' => t('List (text)'), - 'description' => t('This field stores keys from key/value lists of allowed values where the stored key has significance and must be a varchar, i.e. \'US States\': IL|Illinois, IA|Iowa, IN|Indiana'), - 'settings' => array('allowed_values_function' => ''), - 'default_widget' => 'options_select', - 'default_formatter' => 'list_default', - ), - ); -} - -/** * Implementation of hook_field_schema(). */ function list_field_schema($field) { @@ -128,28 +73,6 @@ function list_field_is_empty($item, $fie } /** - * Implementation of hook_field_formatter_info(). - */ -function list_field_formatter_info() { - return array( - 'list_default' => array( - 'label' => t('Default'), - 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'list_key' => array( - 'label' => t('Key'), - 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - ); -} - -/** * Theme function for 'default' list field formatter. */ function theme_field_formatter_list_default($element) { Index: modules/field/modules/list/list.registry.inc =================================================================== RCS file: modules/field/modules/list/list.registry.inc diff -N modules/field/modules/list/list.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/list/list.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,27 @@ + array( + 'arguments' => array('element' => NULL), + ), + 'field_formatter_list_key' => array( + 'arguments' => array('element' => NULL), + ), + ); +} + Index: modules/field/modules/number/number.bootstrap.inc =================================================================== RCS file: modules/field/modules/number/number.bootstrap.inc diff -N modules/field/modules/number/number.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/number/number.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,101 @@ + array( + 'label' => t('Integer'), + 'description' => t('This field stores a number in the database as an integer.'), + 'instance_settings' => array('min' => '', 'max' => '', 'prefix' => '', 'suffix' => ''), + 'default_widget' => 'number', + 'default_formatter' => 'number_integer', + ), + 'number_decimal' => array( + 'label' => t('Decimal'), + 'description' => t('This field stores a number in the database in a fixed decimal format.'), + 'settings' => array('precision' => 10, 'scale' => 2, 'decimal' => ' .'), + 'instance_settings' => array('min' => '', 'max' => '', 'prefix' => '', 'suffix' => ''), + 'default_widget' => 'number', + 'default_formatter' => 'number_integer', + ), + 'number_float' => array( + 'label' => t('Float'), + 'description' => t('This field stores a number in the database in a floating point format.'), + 'instance_settings' => array('min' => '', 'max' => '', 'prefix' => '', 'suffix' => ''), + 'default_widget' => 'number', + 'default_formatter' => 'number_integer', + ), + ); +} + +/** + * Implementation of hook_field_formatter_info(). + */ +function number_field_formatter_info() { + return array( + 'number_integer' => array( + 'label' => t('default'), + 'field types' => array('number_integer'), + 'settings' => array( + 'thousand_separator' => ' ', + 'decimal_separator' => '.', + 'scale' => 0, + 'prefix_suffix' => TRUE, + ), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'number_decimal' => array( + 'label' => t('default'), + 'field types' => array('number_decimal', 'number_float'), + 'settings' => array( + 'thousand_separator' => ' ', + 'decimal_separator' => '.', + 'scale' => 2, + 'prefix_suffix' => TRUE, + ), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'number_unformatted' => array( + 'label' => t('unformatted'), + 'field types' => array('number_integer', 'number_decimal', 'number_float'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + ); +} + +/** + * Implementation of FAPI hook_elements(). + * + * Any FAPI callbacks needed for individual widgets can be declared here, + * and the element will be passed to those callbacks for processing. + * + * Drupal will automatically theme the element using a theme with + * the same name as the hook_elements key. + * + * Includes a regex to check for valid values as an additional parameter + * the validator can use. The regex can be overridden if necessary. + */ +function number_elements() { + return array( + 'number' => array( + '#input' => TRUE, + '#columns' => array('value'), '#delta' => 0, + '#process' => array('number_process'), + ), + ); +} + Index: modules/field/modules/number/number.info =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/number/number.info,v retrieving revision 1.3 diff -u -p -r1.3 number.info --- modules/field/modules/number/number.info 10 May 2009 18:56:56 -0000 1.3 +++ modules/field/modules/number/number.info 20 May 2009 21:31:56 -0000 @@ -5,3 +5,5 @@ package = Core - fields version = VERSION core = 7.x files[]=number.module +files[] = number.registry.inc +files[] = number.bootstrap.inc Index: modules/field/modules/number/number.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/number/number.module,v retrieving revision 1.8 diff -u -p -r1.8 number.module --- modules/field/modules/number/number.module 20 May 2009 09:48:47 -0000 1.8 +++ modules/field/modules/number/number.module 20 May 2009 21:34:25 -0000 @@ -2,53 +2,6 @@ // $Id: number.module,v 1.8 2009/05/20 09:48:47 dries Exp $ /** - * @file - * Defines numeric field types. - */ - -/** - * Implementation of hook_theme(). - */ -function number_theme() { - return array( - 'number' => array('arguments' => array('element' => NULL)), - 'field_formatter_number_integer' => array('arguments' => array('element' => NULL), 'function' => 'theme_field_formatter_number'), - 'field_formatter_number_decimal' => array('arguments' => array('element' => NULL), 'function' => 'theme_field_formatter_number'), - 'field_formatter_number_unformatted' => array('arguments' => array('element' => NULL)), - ); -} - -/** - * Implementation of hook_field_info(). - */ -function number_field_info() { - return array( - 'number_integer' => array( - 'label' => t('Integer'), - 'description' => t('This field stores a number in the database as an integer.'), - 'instance_settings' => array('min' => '', 'max' => '', 'prefix' => '', 'suffix' => ''), - 'default_widget' => 'number', - 'default_formatter' => 'number_integer', - ), - 'number_decimal' => array( - 'label' => t('Decimal'), - 'description' => t('This field stores a number in the database in a fixed decimal format.'), - 'settings' => array('precision' => 10, 'scale' => 2, 'decimal' => ' .'), - 'instance_settings' => array('min' => '', 'max' => '', 'prefix' => '', 'suffix' => ''), - 'default_widget' => 'number', - 'default_formatter' => 'number_integer', - ), - 'number_float' => array( - 'label' => t('Float'), - 'description' => t('This field stores a number in the database in a floating point format.'), - 'instance_settings' => array('min' => '', 'max' => '', 'prefix' => '', 'suffix' => ''), - 'default_widget' => 'number', - 'default_formatter' => 'number_integer', - ), - ); -} - -/** * Implementation of hook_field_schema(). */ function number_field_schema($field) { @@ -124,47 +77,6 @@ function number_field_is_empty($item, $f } /** - * Implementation of hook_field_formatter_info(). - */ -function number_field_formatter_info() { - return array( - 'number_integer' => array( - 'label' => t('default'), - 'field types' => array('number_integer'), - 'settings' => array( - 'thousand_separator' => ' ', - 'decimal_separator' => '.', - 'scale' => 0, - 'prefix_suffix' => TRUE, - ), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'number_decimal' => array( - 'label' => t('default'), - 'field types' => array('number_decimal', 'number_float'), - 'settings' => array( - 'thousand_separator' => ' ', - 'decimal_separator' => '.', - 'scale' => 2, - 'prefix_suffix' => TRUE, - ), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'number_unformatted' => array( - 'label' => t('unformatted'), - 'field types' => array('number_integer', 'number_decimal', 'number_float'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - ); -} - -/** * Theme function for 'unformatted' number field formatter. */ function theme_field_formatter_number_unformatted($element) { @@ -223,28 +135,6 @@ function number_field_widget_info() { } /** - * Implementation of FAPI hook_elements(). - * - * Any FAPI callbacks needed for individual widgets can be declared here, - * and the element will be passed to those callbacks for processing. - * - * Drupal will automatically theme the element using a theme with - * the same name as the hook_elements key. - * - * Includes a regex to check for valid values as an additional parameter - * the validator can use. The regex can be overridden if necessary. - */ -function number_elements() { - return array( - 'number' => array( - '#input' => TRUE, - '#columns' => array('value'), '#delta' => 0, - '#process' => array('number_process'), - ), - ); -} - -/** * Implementation of hook_field_widget(). * * Attach a single form element to the form. It will be built out and Index: modules/field/modules/number/number.registry.inc =================================================================== RCS file: modules/field/modules/number/number.registry.inc diff -N modules/field/modules/number/number.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/number/number.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,25 @@ + array('arguments' => array('element' => NULL)), + 'field_formatter_number_integer' => array('arguments' => array('element' => NULL), 'function' => 'theme_field_formatter_number'), + 'field_formatter_number_decimal' => array('arguments' => array('element' => NULL), 'function' => 'theme_field_formatter_number'), + 'field_formatter_number_unformatted' => array('arguments' => array('element' => NULL)), + ); +} + Index: modules/field/modules/options/options.bootstrap.inc =================================================================== RCS file: modules/field/modules/options/options.bootstrap.inc diff -N modules/field/modules/options/options.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/options/options.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,80 @@ + array( + 'label' => t('Select list'), + 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_CUSTOM, + 'default value' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'options_buttons' => array( + 'label' => t('Check boxes/radio buttons'), + 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_CUSTOM, + 'default value' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'options_onoff' => array( + 'label' => t('Single on/off checkbox'), + 'field types' => array('list_boolean'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_CUSTOM, + 'default value' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + ); +} + +/** + * Implementation of FAPI hook_elements(). + * + * Any FAPI callbacks needed for individual widgets can be declared here, + * and the element will be passed to those callbacks for processing. + * + * Drupal will automatically theme the element using a theme with + * the same name as the hook_elements key. + */ +function options_elements() { + return array( + 'options_select' => array( + '#input' => TRUE, + '#columns' => array('value'), '#delta' => 0, + '#process' => array('options_select_process'), + ), + 'options_buttons' => array( + '#input' => TRUE, + '#columns' => array('value'), '#delta' => 0, + '#process' => array('options_buttons_process'), + ), + 'options_onoff' => array( + '#input' => TRUE, + '#columns' => array('value'), '#delta' => 0, + '#process' => array('options_onoff_process'), + ), + ); +} + Index: modules/field/modules/options/options.info =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/options/options.info,v retrieving revision 1.2 diff -u -p -r1.2 options.info --- modules/field/modules/options/options.info 10 May 2009 18:56:57 -0000 1.2 +++ modules/field/modules/options/options.info 20 May 2009 21:31:56 -0000 @@ -5,3 +5,5 @@ package = Core - fields version = VERSION core = 7.x files[]=options.module +files[] = options.registry.inc +files[] = options.bootstrap.inc Index: modules/field/modules/options/options.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/options/options.module,v retrieving revision 1.5 diff -u -p -r1.5 options.module --- modules/field/modules/options/options.module 12 Apr 2009 02:18:51 -0000 1.5 +++ modules/field/modules/options/options.module 20 May 2009 21:33:54 -0000 @@ -2,103 +2,6 @@ // $Id: options.module,v 1.5 2009/04/12 02:18:51 webchick Exp $ /** - * @file - * Defines selection, check box and radio button widgets for text and numeric fields. - */ - -/** - * Implementation of hook_theme(). - */ -function options_theme() { - return array( - 'options_select' => array( - 'arguments' => array('element' => NULL), - ), - 'options_buttons' => array( - 'arguments' => array('element' => NULL), - ), - 'options_onoff' => array( - 'arguments' => array('element' => NULL), - ), - 'options_none' => array( - 'arguments' => array('widget_type' => NULL, 'field_name' => NULL, 'node_type' => NULL), - ), - ); -} - -/** - * Implementation of hook_field_widget_info(). - * - * We need custom handling of multiple values because we need - * to combine them into a options list rather than display - * cardinality elements. We will use the field module's default - * handling for default values. - * - * Callbacks can be omitted if default handing is used. - * They're included here just so this module can be used - * as an example for custom modules that might do things - * differently. - */ -function options_field_widget_info() { - - return array( - 'options_select' => array( - 'label' => t('Select list'), - 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_CUSTOM, - 'default value' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'options_buttons' => array( - 'label' => t('Check boxes/radio buttons'), - 'field types' => array('list', 'list_boolean', 'list_text', 'list_number'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_CUSTOM, - 'default value' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'options_onoff' => array( - 'label' => t('Single on/off checkbox'), - 'field types' => array('list_boolean'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_CUSTOM, - 'default value' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - ); -} - -/** - * Implementation of FAPI hook_elements(). - * - * Any FAPI callbacks needed for individual widgets can be declared here, - * and the element will be passed to those callbacks for processing. - * - * Drupal will automatically theme the element using a theme with - * the same name as the hook_elements key. - */ -function options_elements() { - return array( - 'options_select' => array( - '#input' => TRUE, - '#columns' => array('value'), '#delta' => 0, - '#process' => array('options_select_process'), - ), - 'options_buttons' => array( - '#input' => TRUE, - '#columns' => array('value'), '#delta' => 0, - '#process' => array('options_buttons_process'), - ), - 'options_onoff' => array( - '#input' => TRUE, - '#columns' => array('value'), '#delta' => 0, - '#process' => array('options_onoff_process'), - ), - ); -} - -/** * Implementation of hook_field_widget(). */ function options_field_widget(&$form, &$form_state, $field, $instance, $items, $delta = NULL) { Index: modules/field/modules/options/options.registry.inc =================================================================== RCS file: modules/field/modules/options/options.registry.inc diff -N modules/field/modules/options/options.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/options/options.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,33 @@ + array( + 'arguments' => array('element' => NULL), + ), + 'options_buttons' => array( + 'arguments' => array('element' => NULL), + ), + 'options_onoff' => array( + 'arguments' => array('element' => NULL), + ), + 'options_none' => array( + 'arguments' => array('widget_type' => NULL, 'field_name' => NULL, 'node_type' => NULL), + ), + ); +} + Index: modules/field/modules/text/text.bootstrap.inc =================================================================== RCS file: modules/field/modules/text/text.bootstrap.inc diff -N modules/field/modules/text/text.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/text/text.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,91 @@ + array( + 'label' => t('Text'), + 'description' => t('This field stores varchar text in the database.'), + 'settings' => array('max_length' => 255), + 'instance_settings' => array('text_processing' => 0), + 'widget_settings' => array('size' => 60), + 'default_widget' => 'text_textfield', + 'default_formatter' => 'text_default', + ), + 'text_long' => array( + 'label' => t('Long text'), + 'description' => t('This field stores long text in the database.'), + 'instance_settings' => array('text_processing' => 0), + 'widget_settings' => array('rows' => 5), + 'default_widget' => 'text_textarea', + 'default_formatter' => 'text_default', + ), + ); +} + +/** + * Implementation of hook_field_formatter_info(). + */ +function text_field_formatter_info() { + return array( + 'text_default' => array( + 'label' => t('Default'), + 'field types' => array('text', 'text_long'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'text_plain' => array( + 'label' => t('Plain text'), + 'field types' => array('text', 'text_long'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + 'text_trimmed' => array( + 'label' => t('Trimmed'), + 'field types' => array('text', 'text_long'), + 'behaviors' => array( + 'multiple values' => FIELD_BEHAVIOR_DEFAULT, + ), + ), + ); +} + +/** + * Implementation of FAPI hook_elements(). + * + * Any FAPI callbacks needed for individual widgets can be declared here, + * and the element will be passed to those callbacks for processing. + * + * Drupal will automatically theme the element using a theme with + * the same name as the hook_elements key. + * + * Autocomplete_path is not used by text_field_widget but other + * widgets can use it (see nodereference and userreference). + */ +function text_elements() { + return array( + 'text_textfield' => array( + '#input' => TRUE, + '#columns' => array('value'), '#delta' => 0, + '#process' => array('text_textfield_process'), + '#autocomplete_path' => FALSE, + ), + 'text_textarea' => array( + '#input' => TRUE, + '#columns' => array('value', 'format'), '#delta' => 0, + '#process' => array('text_textarea_process'), + '#filter_value' => FILTER_FORMAT_DEFAULT, + ), + ); +} + Index: modules/field/modules/text/text.info =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.info,v retrieving revision 1.3 diff -u -p -r1.3 text.info --- modules/field/modules/text/text.info 10 May 2009 18:56:57 -0000 1.3 +++ modules/field/modules/text/text.info 20 May 2009 21:31:56 -0000 @@ -5,3 +5,5 @@ package = Core - fields version = VERSION core = 7.x files[]=text.module +files[] = text.registry.inc +files[] = text.bootstrap.inc Index: modules/field/modules/text/text.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v retrieving revision 1.7 diff -u -p -r1.7 text.module --- modules/field/modules/text/text.module 20 May 2009 09:48:47 -0000 1.7 +++ modules/field/modules/text/text.module 20 May 2009 21:33:54 -0000 @@ -2,59 +2,6 @@ // $Id: text.module,v 1.7 2009/05/20 09:48:47 dries Exp $ /** - * @file - * Defines simple text field types. - */ - -/** - * Implementation of hook_theme(). - */ -function text_theme() { - return array( - 'text_textarea' => array( - 'arguments' => array('element' => NULL), - ), - 'text_textfield' => array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_text_default' => array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_text_plain' => array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_text_trimmed' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** - * Implementation of hook_field_info(). - */ -function text_field_info() { - return array( - 'text' => array( - 'label' => t('Text'), - 'description' => t('This field stores varchar text in the database.'), - 'settings' => array('max_length' => 255), - 'instance_settings' => array('text_processing' => 0), - 'widget_settings' => array('size' => 60), - 'default_widget' => 'text_textfield', - 'default_formatter' => 'text_default', - ), - 'text_long' => array( - 'label' => t('Long text'), - 'description' => t('This field stores long text in the database.'), - 'instance_settings' => array('text_processing' => 0), - 'widget_settings' => array('rows' => 5), - 'default_widget' => 'text_textarea', - 'default_formatter' => 'text_default', - ), - ); -} - -/** * Implementation of hook_field_schema(). */ function text_field_schema($field) { @@ -136,35 +83,6 @@ function text_field_is_empty($item, $fie } /** - * Implementation of hook_field_formatter_info(). - */ -function text_field_formatter_info() { - return array( - 'text_default' => array( - 'label' => t('Default'), - 'field types' => array('text', 'text_long'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'text_plain' => array( - 'label' => t('Plain text'), - 'field types' => array('text', 'text_long'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - 'text_trimmed' => array( - 'label' => t('Trimmed'), - 'field types' => array('text', 'text_long'), - 'behaviors' => array( - 'multiple values' => FIELD_BEHAVIOR_DEFAULT, - ), - ), - ); -} - -/** * Theme function for 'default' text field formatter. */ function theme_field_formatter_text_default($element) { @@ -222,35 +140,6 @@ function text_field_widget_info() { } /** - * Implementation of FAPI hook_elements(). - * - * Any FAPI callbacks needed for individual widgets can be declared here, - * and the element will be passed to those callbacks for processing. - * - * Drupal will automatically theme the element using a theme with - * the same name as the hook_elements key. - * - * Autocomplete_path is not used by text_field_widget but other - * widgets can use it (see nodereference and userreference). - */ -function text_elements() { - return array( - 'text_textfield' => array( - '#input' => TRUE, - '#columns' => array('value'), '#delta' => 0, - '#process' => array('text_textfield_process'), - '#autocomplete_path' => FALSE, - ), - 'text_textarea' => array( - '#input' => TRUE, - '#columns' => array('value', 'format'), '#delta' => 0, - '#process' => array('text_textarea_process'), - '#filter_value' => FILTER_FORMAT_DEFAULT, - ), - ); -} - -/** * Implementation of hook_field_widget(). * * Attach a single form element to the form. It will be built out and Index: modules/field/modules/text/text.registry.inc =================================================================== RCS file: modules/field/modules/text/text.registry.inc diff -N modules/field/modules/text/text.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/field/modules/text/text.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,36 @@ + array( + 'arguments' => array('element' => NULL), + ), + 'text_textfield' => array( + 'arguments' => array('element' => NULL), + ), + 'field_formatter_text_default' => array( + 'arguments' => array('element' => NULL), + ), + 'field_formatter_text_plain' => array( + 'arguments' => array('element' => NULL), + ), + 'field_formatter_text_trimmed' => array( + 'arguments' => array('element' => NULL), + ), + ); +} + Index: modules/filter/filter.bootstrap.inc =================================================================== RCS file: modules/filter/filter.bootstrap.inc diff -N modules/filter/filter.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/filter/filter.bootstrap.inc 20 May 2009 21:25:37 -0000 @@ -0,0 +1,34 @@ +' . t("The filter module allows administrators to configure text formats for use on your site. A text format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two formats included by default are Filtered HTML (which allows only an administrator-approved subset of HTML tags) and Full HTML (which allows the full set of HTML tags). Additional formats may be created by an administrator.") . ''; + $output .= '' . t('Each text format uses filters to manipulate text, and most formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') . '
'; + $output .= '' . t('Users with access to more than one text format can use the Text format fieldset to choose between available text formats when creating or editing multi-line content. Administrators determine the text formats available to each user role, select a default text format, and control the order of formats listed in the Text format fieldset.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Filter module.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) . '
'; + return $output; + case 'admin/settings/filter': + $output = '' . t('Use the list below to review the text formats available to each user role, to select a default text format, and to control the order of formats listed in the Text format fieldset. (The Text format fieldset is displayed below textareas when users with access to more than one text format create multi-line content.) The text format selected as Default is available to all users and, unless another format is selected, is applied to all content. All text formats are available to users in roles with the "administer filters" permission.') . '
'; + $output .= '' . t('Since text formats, if available, are presented in the same order as the list below, it may be helpful to arrange the formats in descending order of your preference for their use. To change the order of an text format, grab a drag-and-drop handle under the Name column and drag to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save changes button at the bottom of the page.') . '
'; + return $output; + case 'admin/settings/filter/%': + return '' . t('Every filter performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this format. If you notice some filters are causing conflicts in the output, you can rearrange them.', array('@rearrange' => url('admin/settings/filter/' . $arg[3] . '/order'))) . '
'; + case 'admin/settings/filter/%/configure': + return '' . t('If you cannot find the settings for a certain filter, make sure you have enabled it on the edit tab first.', array('@url' => url('admin/settings/filter/' . $arg[3]))) . '
'; + case 'admin/settings/filter/%/order': + $output = '' . t('Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted to a clickable link. When this happens, rearrange the order of the filters.') . '
'; + $output .= '' . t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the Weight column or grab a drag-and-drop handle under the Name column and drag filters to new locations in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.") . '
'; + return $output; + } +} + Index: modules/filter/filter.info =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.info,v retrieving revision 1.11 diff -u -p -r1.11 filter.info --- modules/filter/filter.info 12 Oct 2008 01:23:03 -0000 1.11 +++ modules/filter/filter.info 20 May 2009 18:49:54 -0000 @@ -9,3 +9,5 @@ files[] = filter.admin.inc files[] = filter.pages.inc files[] = filter.install required = TRUE +files[] = filter.registry.inc +files[] = filter.bootstrap.inc Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.250 diff -u -p -r1.250 filter.module --- modules/filter/filter.module 14 May 2009 08:23:14 -0000 1.250 +++ modules/filter/filter.module 20 May 2009 21:25:49 -0000 @@ -14,122 +14,6 @@ */ define('FILTER_FORMAT_DEFAULT', 0); -/** - * Implementation of hook_help(). - */ -function filter_help($path, $arg) { - switch ($path) { - case 'admin/help#filter': - $output = '' . t("The filter module allows administrators to configure text formats for use on your site. A text format defines the HTML tags, codes, and other input allowed in both content and comments, and is a key feature in guarding against potentially damaging input from malicious users. Two formats included by default are Filtered HTML (which allows only an administrator-approved subset of HTML tags) and Full HTML (which allows the full set of HTML tags). Additional formats may be created by an administrator.") . '
'; - $output .= '' . t('Each text format uses filters to manipulate text, and most formats apply several different filters to text in a specific order. Each filter is designed for a specific purpose, and generally either adds, removes or transforms elements within user-entered text before it is displayed. A filter does not change the actual content of a post, but instead, modifies it temporarily before it is displayed. A filter may remove unapproved HTML tags, for instance, while another automatically adds HTML to make links referenced in text clickable.') . '
'; - $output .= '' . t('Users with access to more than one text format can use the Text format fieldset to choose between available text formats when creating or editing multi-line content. Administrators determine the text formats available to each user role, select a default text format, and control the order of formats listed in the Text format fieldset.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Filter module.', array('@filter' => 'http://drupal.org/handbook/modules/filter/')) . '
'; - return $output; - case 'admin/settings/filter': - $output = '' . t('Use the list below to review the text formats available to each user role, to select a default text format, and to control the order of formats listed in the Text format fieldset. (The Text format fieldset is displayed below textareas when users with access to more than one text format create multi-line content.) The text format selected as Default is available to all users and, unless another format is selected, is applied to all content. All text formats are available to users in roles with the "administer filters" permission.') . '
'; - $output .= '' . t('Since text formats, if available, are presented in the same order as the list below, it may be helpful to arrange the formats in descending order of your preference for their use. To change the order of an text format, grab a drag-and-drop handle under the Name column and drag to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save changes button at the bottom of the page.') . '
'; - return $output; - case 'admin/settings/filter/%': - return '' . t('Every filter performs one particular change on the user input, for example stripping out malicious HTML or making URLs clickable. Choose which filters you want to apply to text in this format. If you notice some filters are causing conflicts in the output, you can rearrange them.', array('@rearrange' => url('admin/settings/filter/' . $arg[3] . '/order'))) . '
'; - case 'admin/settings/filter/%/configure': - return '' . t('If you cannot find the settings for a certain filter, make sure you have enabled it on the edit tab first.', array('@url' => url('admin/settings/filter/' . $arg[3]))) . '
'; - case 'admin/settings/filter/%/order': - $output = '' . t('Because of the flexible filtering system, you might encounter a situation where one filter prevents another from doing its job. For example: a word in an URL gets converted into a glossary term, before the URL can be converted to a clickable link. When this happens, rearrange the order of the filters.') . '
'; - $output .= '' . t("Filters are executed from top-to-bottom. To change the order of the filters, modify the values in the Weight column or grab a drag-and-drop handle under the Name column and drag filters to new locations in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.") . '
'; - return $output; - } -} - -/** - * Implementation of hook_theme(). - */ -function filter_theme() { - return array( - 'filter_admin_overview' => array( - 'arguments' => array('form' => NULL), - ), - 'filter_admin_order' => array( - 'arguments' => array('form' => NULL), - ), - 'filter_tips' => array( - 'arguments' => array('tips' => NULL, 'long' => FALSE), - ), - 'filter_tips_more_info' => array( - 'arguments' => array(), - ), - 'filter_guidelines' => array( - 'arguments' => array('format' => NULL), - ), - ); -} - -/** - * Implementation of hook_menu(). - */ -function filter_menu() { - $items['admin/settings/filter'] = array( - 'title' => 'Text formats', - 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('filter_admin_overview'), - 'access arguments' => array('administer filters'), - ); - $items['admin/settings/filter/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/settings/filter/add'] = array( - 'title' => 'Add text format', - 'page callback' => 'filter_admin_format_page', - 'access arguments' => array('administer filters'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - $items['admin/settings/filter/delete'] = array( - 'title' => 'Delete text format', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('filter_admin_delete'), - 'access arguments' => array('administer filters'), - 'type' => MENU_CALLBACK, - ); - $items['filter/tips'] = array( - 'title' => 'Compose tips', - 'page callback' => 'filter_tips_long', - 'access callback' => TRUE, - 'type' => MENU_SUGGESTED_ITEM, - ); - $items['admin/settings/filter/%filter_format'] = array( - 'type' => MENU_CALLBACK, - 'title callback' => 'filter_admin_format_title', - 'title arguments' => array(3), - 'page callback' => 'filter_admin_format_page', - 'page arguments' => array(3), - 'access arguments' => array('administer filters'), - ); - $items['admin/settings/filter/%filter_format/edit'] = array( - 'title' => 'Edit', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => 0, - ); - $items['admin/settings/filter/%filter_format/configure'] = array( - 'title' => 'Configure', - 'page callback' => 'filter_admin_configure_page', - 'page arguments' => array(3), - 'access arguments' => array('administer filters'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 1, - ); - $items['admin/settings/filter/%filter_format/order'] = array( - 'title' => 'Rearrange', - 'page callback' => 'filter_admin_order_page', - 'page arguments' => array(3), - 'access arguments' => array('administer filters'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - return $items; -} - function filter_format_load($arg) { return filter_formats($arg); } Index: modules/filter/filter.registry.inc =================================================================== RCS file: modules/filter/filter.registry.inc diff -N modules/filter/filter.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/filter/filter.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,98 @@ + 'Text formats', + 'description' => 'Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('filter_admin_overview'), + 'access arguments' => array('administer filters'), + ); + $items['admin/settings/filter/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/settings/filter/add'] = array( + 'title' => 'Add text format', + 'page callback' => 'filter_admin_format_page', + 'access arguments' => array('administer filters'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 1, + ); + $items['admin/settings/filter/delete'] = array( + 'title' => 'Delete text format', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('filter_admin_delete'), + 'access arguments' => array('administer filters'), + 'type' => MENU_CALLBACK, + ); + $items['filter/tips'] = array( + 'title' => 'Compose tips', + 'page callback' => 'filter_tips_long', + 'access callback' => TRUE, + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['admin/settings/filter/%filter_format'] = array( + 'type' => MENU_CALLBACK, + 'title callback' => 'filter_admin_format_title', + 'title arguments' => array(3), + 'page callback' => 'filter_admin_format_page', + 'page arguments' => array(3), + 'access arguments' => array('administer filters'), + ); + $items['admin/settings/filter/%filter_format/edit'] = array( + 'title' => 'Edit', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => 0, + ); + $items['admin/settings/filter/%filter_format/configure'] = array( + 'title' => 'Configure', + 'page callback' => 'filter_admin_configure_page', + 'page arguments' => array(3), + 'access arguments' => array('administer filters'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 1, + ); + $items['admin/settings/filter/%filter_format/order'] = array( + 'title' => 'Rearrange', + 'page callback' => 'filter_admin_order_page', + 'page arguments' => array(3), + 'access arguments' => array('administer filters'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function filter_theme() { + return array( + 'filter_admin_overview' => array( + 'arguments' => array('form' => NULL), + ), + 'filter_admin_order' => array( + 'arguments' => array('form' => NULL), + ), + 'filter_tips' => array( + 'arguments' => array('tips' => NULL, 'long' => FALSE), + ), + 'filter_tips_more_info' => array( + 'arguments' => array(), + ), + 'filter_guidelines' => array( + 'arguments' => array('format' => NULL), + ), + ); +} + Index: modules/forum/forum.alter.inc =================================================================== RCS file: modules/forum/forum.alter.inc diff -N modules/forum/forum.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/forum/forum.alter.inc 20 May 2009 21:14:44 -0000 @@ -0,0 +1,41 @@ + t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'), + '#weight' => -1, + ); + $form['content_types']['nodes']['#required'] = TRUE; + $form['hierarchy'] = array('#type' => 'value', '#value' => 1); + $form['settings']['required'] = array('#type' => 'value', '#value' => FALSE); + $form['settings']['relations'] = array('#type' => 'value', '#value' => FALSE); + $form['settings']['tags'] = array('#type' => 'value', '#value' => FALSE); + $form['settings']['multiple'] = array('#type' => 'value', '#value' => FALSE); + unset($form['delete']); + } + // Hide multiple parents select from forum terms. + elseif ($form_id == 'taxonomy_form_term') { + $form['advanced']['parent']['#access'] = FALSE; + } + } + if ($form_id == 'forum_node_form') { + // Make the vocabulary required for 'real' forum-nodes. + $vid = variable_get('forum_nav_vocabulary', ''); + $form['taxonomy'][$vid]['#required'] = TRUE; + $form['taxonomy'][$vid]['#options'][''] = t('- Please choose -'); + } +} + Index: modules/forum/forum.bootstrap.inc =================================================================== RCS file: modules/forum/forum.bootstrap.inc diff -N modules/forum/forum.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/forum/forum.bootstrap.inc 20 May 2009 21:31:56 -0000 @@ -0,0 +1,60 @@ +' . t('The forum module lets you create threaded discussion forums with functionality similar to other message board systems. Forums are useful because they allow community members to discuss topics with one another while ensuring those conversations are archived for later reference. The forum topic menu item (under Create content on the Navigation menu) creates the initial post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'))) . ''; + $output .= '' . t('A threaded discussion occurs as people leave comments on a forum topic (or on other comments within that topic). A forum topic is contained within a forum, which may hold many similar or related forum topics. Forums are (optionally) nested within a container, which may hold many similar or related forums. Both containers and forums may be nested within other containers and forums, and provide structure for your message board. By carefully planning this structure, you make it easier for users to find and comment on a specific forum topic.') . '
'; + $output .= '' . t('When administering a forum, note that:') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Forum module.', array('@forum' => 'http://drupal.org/handbook/modules/forum/')) . '
'; + return $output; + case 'admin/build/forum': + return '' . t('This page displays a list of existing forums and containers. Containers (optionally) hold forums, and forums hold forum topics (a forum topic is the initial post to a threaded discussion). To provide structure, both containers and forums may be placed inside other containers and forums. To rearrange forums and containers, grab a drag-and-drop handle under the Name column and drag the forum or container to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save button at the bottom of the page.') . '
'; + case 'admin/build/forum/add/container': + return '' . t('By grouping related or similar forums, containers help organize forums. For example, a container named "Food" may hold two forums named "Fruit" and "Vegetables", respectively.') . '
'; + case 'admin/build/forum/add/forum': + return '' . t('A forum holds related or similar forum topics (a forum topic is the initial post to a threaded discussion). For example, a forum named "Fruit" may contain forum topics titled "Apples" and "Bananas", respectively.') . '
'; + case 'admin/build/forum/settings': + return '' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the Content types on the forum vocabulary page.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary', '')))) . '
'; + } +} + +/** + * Implementation of hook_node_info(). + */ +function forum_node_info() { + return array( + 'forum' => array( + 'name' => t('Forum topic'), + 'base' => 'forum', + 'description' => t('A forum topic is the initial post to a new discussion thread within a forum.'), + 'title_label' => t('Subject'), + ) + ); +} + Index: modules/forum/forum.info =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.info,v retrieving revision 1.11 diff -u -p -r1.11 forum.info --- modules/forum/forum.info 11 Oct 2008 02:32:46 -0000 1.11 +++ modules/forum/forum.info 20 May 2009 21:14:44 -0000 @@ -10,3 +10,6 @@ files[] = forum.module files[] = forum.admin.inc files[] = forum.pages.inc files[] = forum.install +files[] = forum.registry.inc +files[] = forum.bootstrap.inc +files[] = forum.alter.inc Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.492 diff -u -p -r1.492 forum.module --- modules/forum/forum.module 9 May 2009 18:28:12 -0000 1.492 +++ modules/forum/forum.module 20 May 2009 21:31:56 -0000 @@ -2,69 +2,6 @@ // $Id: forum.module,v 1.492 2009/05/09 18:28:12 dries Exp $ /** - * @file - * Provides discussion forums. - */ - -/** - * Implementation of hook_help(). - */ -function forum_help($path, $arg) { - switch ($path) { - case 'admin/help#forum': - $output = '' . t('The forum module lets you create threaded discussion forums with functionality similar to other message board systems. Forums are useful because they allow community members to discuss topics with one another while ensuring those conversations are archived for later reference. The forum topic menu item (under Create content on the Navigation menu) creates the initial post of a new threaded discussion, or thread.', array('@create-topic' => url('node/add/forum'))) . '
'; - $output .= '' . t('A threaded discussion occurs as people leave comments on a forum topic (or on other comments within that topic). A forum topic is contained within a forum, which may hold many similar or related forum topics. Forums are (optionally) nested within a container, which may hold many similar or related forums. Both containers and forums may be nested within other containers and forums, and provide structure for your message board. By carefully planning this structure, you make it easier for users to find and comment on a specific forum topic.') . '
'; - $output .= '' . t('When administering a forum, note that:') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Forum module.', array('@forum' => 'http://drupal.org/handbook/modules/forum/')) . '
'; - return $output; - case 'admin/build/forum': - return '' . t('This page displays a list of existing forums and containers. Containers (optionally) hold forums, and forums hold forum topics (a forum topic is the initial post to a threaded discussion). To provide structure, both containers and forums may be placed inside other containers and forums. To rearrange forums and containers, grab a drag-and-drop handle under the Name column and drag the forum or container to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save button at the bottom of the page.') . '
'; - case 'admin/build/forum/add/container': - return '' . t('By grouping related or similar forums, containers help organize forums. For example, a container named "Food" may hold two forums named "Fruit" and "Vegetables", respectively.') . '
'; - case 'admin/build/forum/add/forum': - return '' . t('A forum holds related or similar forum topics (a forum topic is the initial post to a threaded discussion). For example, a forum named "Fruit" may contain forum topics titled "Apples" and "Bananas", respectively.') . '
'; - case 'admin/build/forum/settings': - return '' . t('These settings allow you to adjust the display of your forum topics. The content types available for use within a forum may be selected by editing the Content types on the forum vocabulary page.', array('@forum-vocabulary' => url('admin/content/taxonomy/edit/vocabulary/' . variable_get('forum_nav_vocabulary', '')))) . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function forum_theme() { - return array( - 'forums' => array( - 'template' => 'forums', - 'arguments' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), - ), - 'forum_list' => array( - 'template' => 'forum-list', - 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), - ), - 'forum_topic_list' => array( - 'template' => 'forum-topic-list', - 'arguments' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), - ), - 'forum_icon' => array( - 'template' => 'forum-icon', - 'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), - ), - 'forum_topic_navigation' => array( - 'template' => 'forum-topic-navigation', - 'arguments' => array('node' => NULL), - ), - 'forum_submitted' => array( - 'template' => 'forum-submitted', - 'arguments' => array('topic' => NULL), - ), - ); -} - -/** * Fetch a forum term. * * @param $tid @@ -79,83 +16,6 @@ function forum_term_load($tid) { } /** - * Implementation of hook_menu(). - */ -function forum_menu() { - $items['forum'] = array( - 'title' => 'Forums', - 'page callback' => 'forum_page', - 'access arguments' => array('access content'), - 'type' => MENU_SUGGESTED_ITEM, - ); - $items['admin/build/forum'] = array( - 'title' => 'Forums', - 'description' => 'Control forums and their hierarchy and change forum settings.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('forum_overview'), - 'access arguments' => array('administer forums'), - ); - $items['admin/build/forum/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/build/forum/add/container'] = array( - 'title' => 'Add container', - 'page callback' => 'forum_form_main', - 'page arguments' => array('container'), - 'access arguments' => array('administer forums'), - 'type' => MENU_LOCAL_TASK, - 'parent' => 'admin/build/forum', - ); - $items['admin/build/forum/add/forum'] = array( - 'title' => 'Add forum', - 'page callback' => 'forum_form_main', - 'page arguments' => array('forum'), - 'access arguments' => array('administer forums'), - 'type' => MENU_LOCAL_TASK, - 'parent' => 'admin/build/forum', - ); - $items['admin/build/forum/settings'] = array( - 'title' => 'Settings', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('forum_admin_settings'), - 'access arguments' => array('administer forums'), - 'weight' => 5, - 'type' => MENU_LOCAL_TASK, - 'parent' => 'admin/build/forum', - ); - $items['admin/build/forum/edit/%forum_term'] = array( - 'page callback' => 'forum_form_main', - 'access arguments' => array('administer forums'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/forum/edit/container/%forum_term'] = array( - 'title' => 'Edit container', - 'page callback' => 'forum_form_main', - 'page arguments' => array('container', 5), - 'access arguments' => array('administer forums'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/forum/edit/forum/%forum_term'] = array( - 'title' => 'Edit forum', - 'page callback' => 'forum_form_main', - 'page arguments' => array('forum', 5), - 'access arguments' => array('administer forums'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - - -/** - * Implementation of hook_init(). - */ -function forum_init() { - drupal_add_css(drupal_get_path('module', 'forum') . '/forum.css'); -} - -/** * _forum_node_check_node_type * * @param mixed $node @@ -366,20 +226,6 @@ function forum_node_load($nodes, $types) } /** - * Implementation of hook_node_info(). - */ -function forum_node_info() { - return array( - 'forum' => array( - 'name' => t('Forum topic'), - 'base' => 'forum', - 'description' => t('A forum topic is the initial post to a new discussion thread within a forum.'), - 'title_label' => t('Subject'), - ) - ); -} - -/** * Implementation of hook_access(). */ function forum_access($op, $node, $account) { @@ -435,39 +281,6 @@ function forum_taxonomy($op, $type, $ter } /** - * Implementation of hook_form_alter(). - */ -function forum_form_alter(&$form, $form_state, $form_id) { - $vid = variable_get('forum_nav_vocabulary', ''); - if (isset($form['vid']) && $form['vid']['#value'] == $vid) { - // Hide critical options from forum vocabulary. - if ($form_id == 'taxonomy_form_vocabulary') { - $form['help_forum_vocab'] = array( - '#markup' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'), - '#weight' => -1, - ); - $form['content_types']['nodes']['#required'] = TRUE; - $form['hierarchy'] = array('#type' => 'value', '#value' => 1); - $form['settings']['required'] = array('#type' => 'value', '#value' => FALSE); - $form['settings']['relations'] = array('#type' => 'value', '#value' => FALSE); - $form['settings']['tags'] = array('#type' => 'value', '#value' => FALSE); - $form['settings']['multiple'] = array('#type' => 'value', '#value' => FALSE); - unset($form['delete']); - } - // Hide multiple parents select from forum terms. - elseif ($form_id == 'taxonomy_form_term') { - $form['advanced']['parent']['#access'] = FALSE; - } - } - if ($form_id == 'forum_node_form') { - // Make the vocabulary required for 'real' forum-nodes. - $vid = variable_get('forum_nav_vocabulary', ''); - $form['taxonomy'][$vid]['#required'] = TRUE; - $form['taxonomy'][$vid]['#options'][''] = t('- Please choose -'); - } -} - -/** * Implementation of hook_block_list(). */ function forum_block_list() { Index: modules/forum/forum.registry.inc =================================================================== RCS file: modules/forum/forum.registry.inc diff -N modules/forum/forum.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/forum/forum.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,110 @@ + 'Forums', + 'page callback' => 'forum_page', + 'access arguments' => array('access content'), + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['admin/build/forum'] = array( + 'title' => 'Forums', + 'description' => 'Control forums and their hierarchy and change forum settings.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('forum_overview'), + 'access arguments' => array('administer forums'), + ); + $items['admin/build/forum/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/build/forum/add/container'] = array( + 'title' => 'Add container', + 'page callback' => 'forum_form_main', + 'page arguments' => array('container'), + 'access arguments' => array('administer forums'), + 'type' => MENU_LOCAL_TASK, + 'parent' => 'admin/build/forum', + ); + $items['admin/build/forum/add/forum'] = array( + 'title' => 'Add forum', + 'page callback' => 'forum_form_main', + 'page arguments' => array('forum'), + 'access arguments' => array('administer forums'), + 'type' => MENU_LOCAL_TASK, + 'parent' => 'admin/build/forum', + ); + $items['admin/build/forum/settings'] = array( + 'title' => 'Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('forum_admin_settings'), + 'access arguments' => array('administer forums'), + 'weight' => 5, + 'type' => MENU_LOCAL_TASK, + 'parent' => 'admin/build/forum', + ); + $items['admin/build/forum/edit/%forum_term'] = array( + 'page callback' => 'forum_form_main', + 'access arguments' => array('administer forums'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/forum/edit/container/%forum_term'] = array( + 'title' => 'Edit container', + 'page callback' => 'forum_form_main', + 'page arguments' => array('container', 5), + 'access arguments' => array('administer forums'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/forum/edit/forum/%forum_term'] = array( + 'title' => 'Edit forum', + 'page callback' => 'forum_form_main', + 'page arguments' => array('forum', 5), + 'access arguments' => array('administer forums'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + + +/** + * Implementation of hook_theme(). + */ +function forum_theme() { + return array( + 'forums' => array( + 'template' => 'forums', + 'arguments' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + ), + 'forum_list' => array( + 'template' => 'forum-list', + 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + ), + 'forum_topic_list' => array( + 'template' => 'forum-topic-list', + 'arguments' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + ), + 'forum_icon' => array( + 'template' => 'forum-icon', + 'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + ), + 'forum_topic_navigation' => array( + 'template' => 'forum-topic-navigation', + 'arguments' => array('node' => NULL), + ), + 'forum_submitted' => array( + 'template' => 'forum-submitted', + 'arguments' => array('topic' => NULL), + ), + ); +} + Index: modules/help/help.bootstrap.inc =================================================================== RCS file: modules/help/help.bootstrap.inc diff -N modules/help/help.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/help/help.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,22 @@ +' . t('This guide provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . ''; + return $output; + case 'admin/help#help': + $output = '' . t('The help module provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Help module.', array('@help' => 'http://drupal.org/handbook/modules/help/')) . '
'; + return $output; + } +} Index: modules/help/help.info =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.info,v retrieving revision 1.7 diff -u -p -r1.7 help.info --- modules/help/help.info 11 Oct 2008 02:32:47 -0000 1.7 +++ modules/help/help.info 20 May 2009 18:49:53 -0000 @@ -6,3 +6,5 @@ version = VERSION core = 7.x files[] = help.module files[] = help.admin.inc +files[] = help.registry.inc +files[] = help.bootstrap.inc Index: modules/help/help.module =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.module,v retrieving revision 1.81 diff -u -p -r1.81 help.module --- modules/help/help.module 6 May 2008 12:18:47 -0000 1.81 +++ modules/help/help.module 20 May 2009 18:49:53 -0000 @@ -1,46 +1,3 @@ 'Help', - 'page callback' => 'help_main', - 'access arguments' => array('access administration pages'), - 'weight' => 9, - ); - - foreach (module_implements('help', TRUE) as $module) { - $items['admin/help/' . $module] = array( - 'title' => $module, - 'page callback' => 'help_page', - 'page arguments' => array(2), - 'access arguments' => array('access administration pages'), - 'type' => MENU_CALLBACK, - ); - } - - return $items; -} - -/** - * Implementation of hook_help(). - */ -function help_help($path, $arg) { - switch ($path) { - case 'admin/help': - $output = '' . t('This guide provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '
'; - return $output; - case 'admin/help#help': - $output = '' . t('The help module provides context sensitive help on the use and configuration of Drupal and its modules, and is a supplement to the more extensive online Drupal handbook. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Help module.', array('@help' => 'http://drupal.org/handbook/modules/help/')) . '
'; - return $output; - } -} Index: modules/help/help.registry.inc =================================================================== RCS file: modules/help/help.registry.inc diff -N modules/help/help.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/help/help.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,37 @@ + 'Help', + 'page callback' => 'help_main', + 'access arguments' => array('access administration pages'), + 'weight' => 9, + ); + + foreach (module_implements('help', TRUE) as $module) { + $items['admin/help/' . $module] = array( + 'title' => $module, + 'page callback' => 'help_page', + 'page arguments' => array(2), + 'access arguments' => array('access administration pages'), + 'type' => MENU_CALLBACK, + ); + } + + return $items; +} + Index: modules/locale/locale.alter.inc =================================================================== RCS file: modules/locale/locale.alter.inc diff -N modules/locale/locale.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/locale/locale.alter.inc 20 May 2009 22:32:53 -0000 @@ -0,0 +1,124 @@ + 'select', + '#title' => t('Language'), + '#options' => array('' => t('All languages')) + locale_language_list('name'), + '#default_value' => $form['language']['#value'], + '#weight' => -10, + '#description' => t('A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for All languages.'), + ); +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + */ +function locale_form_node_type_form_alter(&$form, &$form_state) { + if (isset($form['identity']['type'])) { + $form['workflow']['language_content_type'] = array( + '#type' => 'radios', + '#title' => t('Multilingual support'), + '#default_value' => variable_get('language_content_type_' . $form['#node_type']->type, 0), + '#options' => array(t('Disabled'), t('Enabled')), + '#description' => t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/international/language'))), + ); + } +} + +/** + * Implementation of hook_form_alter(). Adds language fields to forms. + */ +function locale_form_alter(&$form, &$form_state, $form_id) { + if (isset($form['#id']) && $form['#id'] == 'node-form') { + if (isset($form['#node']->type) && variable_get('language_content_type_' . $form['#node']->type, 0)) { + $form['language'] = array( + '#type' => 'select', + '#title' => t('Language'), + '#default_value' => (isset($form['#node']->language) ? $form['#node']->language : ''), + '#options' => array('' => t('Language neutral')) + locale_language_list('name'), + ); + } + // Node type without language selector: assign the default for new nodes + elseif (!isset($form['#node']->nid)) { + $default = language_default(); + $form['language'] = array( + '#type' => 'value', + '#value' => $default->language + ); + } + } +} + +/** + * Implementation of hook_js_alter(). + * + * This function checks all JavaScript files currently added via drupal_add_js() + * and invokes parsing if they have not yet been parsed for Drupal.t() + * and Drupal.formatPlural() calls. Also refreshes the JavaScript translation + * file if necessary, and adds it to the page. + */ +function locale_js_alter(&$javascript) { + global $language; + + $dir = file_create_path(variable_get('locale_js_directory', 'languages')); + $parsed = variable_get('javascript_parsed', array()); + $files = $new_files = FALSE; + + drupal_function_exists('locale_inc_callback'); + foreach ($javascript as $item) { + if ($item['type'] == 'file') { + $files = TRUE; + $filepath = $item['data']; + if (!in_array($filepath, $parsed)) { + // Don't parse our own translations files. + if (substr($filepath, 0, strlen($dir)) != $dir) { + locale_inc_callback('_locale_parse_js_file', $filepath); + watchdog('locale', 'Parsed JavaScript file %file.', array('%file' => $filepath)); + $parsed[] = $filepath; + $new_files = TRUE; + } + } + } + } + + // If there are any new source files we parsed, invalidate existing + // JavaScript translation files for all languages, adding the refresh + // flags into the existing array. + if ($new_files) { + $parsed += locale_inc_callback('_locale_invalidate_js'); + } + + // If necessary, rebuild the translation file for the current language. + if (!empty($parsed['refresh:' . $language->language])) { + // Don't clear the refresh flag on failure, so that another try will + // be performed later. + if (locale_inc_callback('_locale_rebuild_js')) { + unset($parsed['refresh:' . $language->language]); + } + // Store any changes after refresh was attempted. + variable_set('javascript_parsed', $parsed); + } + // If no refresh was attempted, but we have new source files, we need + // to store them too. This occurs if current page is in English. + elseif ($new_files) { + variable_set('javascript_parsed', $parsed); + } + + // Add the translation JavaScript file to the page. + if ($files && !empty($language->javascript)) { + // Add the translation JavaScript file to the page. + $file = $dir . '/' . $language->language . '_' . $language->javascript . '.js'; + $javascript[$file] = drupal_js_defaults($file); + } +} + Index: modules/locale/locale.bootstrap.inc =================================================================== RCS file: modules/locale/locale.bootstrap.inc diff -N modules/locale/locale.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/locale/locale.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,58 @@ +' . t('The locale module allows your Drupal site to be presented in languages other than the default English, a defining feature of multi-lingual websites. The locale module works by examining text as it is about to be displayed: when a translation of the text is available in the language to be displayed, the translation is displayed rather than the original text. When a translation is unavailable, the original text is displayed, and then stored for later review by a translator.') . ''; + $output .= '' . t('Beyond translation of the Drupal interface, the locale module provides a feature set tailored to the needs of a multi-lingual site. Language negotiation allows your site to automatically change language based on the domain or path used for each request. Users may (optionally) select their preferred language on their My account page, and your site can be configured to honor a web browser\'s preferred language settings. Your site content can be created in (and translated to) any enabled language, and each post may have a language-appropriate alias for each of its translations. The locale module works in concert with the content translation module to manage translated content.', array('@content-help' => url('admin/help/translation'))) . '
'; + $output .= '' . t('Translations may be provided by:') . '
'; + $output .= '' . t('If an existing translation package does not meet your needs, the Gettext Portable Object (.po) files within a package may be modified, or new .po files may be created, using a desktop Gettext editor. The locale module\'s import feature allows the translated strings from a new or modified .po file to be added to your site. The locale module\'s export feature generates files from your site\'s translated strings, that can either be shared with others or edited offline by a Gettext translation editor.', array('@import' => url('admin/international/translate/import'), '@export' => url('admin/international/translate/export'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Locale module.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) . '
'; + return $output; + case 'admin/international/language': + $output = '' . t("This page provides an overview of your site's enabled languages. If multiple languages are available and enabled, the text on your site interface may be translated, registered users may select their preferred language on the My account page, and site authors may indicate a specific language when creating posts. Languages will be displayed in the order you specify in places such as the language switcher block, or the language dropdown when creating or editing posts. The site's default language is used for anonymous visitors and for users who have not selected a preferred language.") . '
'; + $output .= '' . t('For each language available on the site, use the edit link to configure language details, including name, an optional language-specific path or domain, and whether the language is natively presented either left-to-right or right-to-left. These languages also appear in the Language selection when creating a post of a content type with multilingual support.') . '
'; + $output .= '' . t('Use the add language page to enable additional languages (and automatically import files from a translation package, if available), the translate interface page to locate strings for manual translation, or the import page to add translations from individual .po files. A number of contributed translation packages containing .po files are available on the Drupal.org translations page.', array('@add-language' => url('admin/international/language/add'), '@search' => url('admin/international/translate/translate'), '@import' => url('admin/international/translate/import'), '@translations' => 'http://drupal.org/project/translations')) . '
'; + $output .= '' . t('To rearrange languages, grab a drag-and-drop handle under the English name column and drag the item to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.') . '
'; + return $output; + case 'admin/international/language/add': + return '' . t('Add all languages to be supported by your site. If your desired language is not available in the Language name drop-down, click Custom language and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') . '
'; + case 'admin/international/language/configure': + $output = '' . t("Language negotiation settings determine the site's presentation language. Available options include:") . '
'; + $output .= '' . t('The path prefix or domain name for a language may be set by editing the available languages. In the absence of an appropriate match, the site is displayed in the default language.', array('@languages' => url('admin/international/language'))) . '
'; + return $output; + case 'admin/international/translate': + $output = '' . t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') . '
'; + $output .= '' . t('Review the languages page for more information on adding support for additional languages.', array('@languages' => url('admin/international/language'))) . '
'; + return $output; + case 'admin/international/translate/import': + $output = '' . t('This page imports the translated strings contained in an individual Gettext Portable Object (.po) file. Normally distributed as part of a translation package (each translation package may contain several .po files), a .po file may need to be imported after offline editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.') . '
'; + $output .= '' . t('Note that the .po files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one .po file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and add the language (which automatically imports all .po files within the package). Translation packages are available for download on the Drupal translation page.', array('@language-add' => url('admin/international/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '
'; + return $output; + case 'admin/international/translate/export': + return '' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (.po) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (.pot) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '
'; + case 'admin/international/translate/translate': + return '' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to export strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/international/translate/export'))) . '
'; + case 'admin/build/block/configure': + if ($arg[4] == 'locale' && $arg[5] == 0) { + return '' . t('This block is only shown if at least two languages are enabled and language negotiation is set to something other than None.', array('@languages' => url('admin/international/language'), '@configuration' => url('admin/international/language/configure'))) . '
'; + } + break; + } +} + Index: modules/locale/locale.info =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.info,v retrieving revision 1.10 diff -u -p -r1.10 locale.info --- modules/locale/locale.info 11 Oct 2008 02:32:49 -0000 1.10 +++ modules/locale/locale.info 20 May 2009 21:14:44 -0000 @@ -6,3 +6,6 @@ version = VERSION core = 7.x files[] = locale.module files[] = locale.install +files[] = locale.registry.inc +files[] = locale.bootstrap.inc +files[] = locale.alter.inc Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.238 diff -u -p -r1.238 locale.module --- modules/locale/locale.module 31 Mar 2009 02:02:21 -0000 1.238 +++ modules/locale/locale.module 20 May 2009 22:25:08 -0000 @@ -16,163 +16,6 @@ // Hook implementations /** - * Implementation of hook_help(). - */ -function locale_help($path, $arg) { - switch ($path) { - case 'admin/help#locale': - $output = '' . t('The locale module allows your Drupal site to be presented in languages other than the default English, a defining feature of multi-lingual websites. The locale module works by examining text as it is about to be displayed: when a translation of the text is available in the language to be displayed, the translation is displayed rather than the original text. When a translation is unavailable, the original text is displayed, and then stored for later review by a translator.') . '
'; - $output .= '' . t('Beyond translation of the Drupal interface, the locale module provides a feature set tailored to the needs of a multi-lingual site. Language negotiation allows your site to automatically change language based on the domain or path used for each request. Users may (optionally) select their preferred language on their My account page, and your site can be configured to honor a web browser\'s preferred language settings. Your site content can be created in (and translated to) any enabled language, and each post may have a language-appropriate alias for each of its translations. The locale module works in concert with the content translation module to manage translated content.', array('@content-help' => url('admin/help/translation'))) . '
'; - $output .= '' . t('Translations may be provided by:') . '
'; - $output .= '' . t('If an existing translation package does not meet your needs, the Gettext Portable Object (.po) files within a package may be modified, or new .po files may be created, using a desktop Gettext editor. The locale module\'s import feature allows the translated strings from a new or modified .po file to be added to your site. The locale module\'s export feature generates files from your site\'s translated strings, that can either be shared with others or edited offline by a Gettext translation editor.', array('@import' => url('admin/international/translate/import'), '@export' => url('admin/international/translate/export'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Locale module.', array('@locale' => 'http://drupal.org/handbook/modules/locale/')) . '
'; - return $output; - case 'admin/international/language': - $output = '' . t("This page provides an overview of your site's enabled languages. If multiple languages are available and enabled, the text on your site interface may be translated, registered users may select their preferred language on the My account page, and site authors may indicate a specific language when creating posts. Languages will be displayed in the order you specify in places such as the language switcher block, or the language dropdown when creating or editing posts. The site's default language is used for anonymous visitors and for users who have not selected a preferred language.") . '
'; - $output .= '' . t('For each language available on the site, use the edit link to configure language details, including name, an optional language-specific path or domain, and whether the language is natively presented either left-to-right or right-to-left. These languages also appear in the Language selection when creating a post of a content type with multilingual support.') . '
'; - $output .= '' . t('Use the add language page to enable additional languages (and automatically import files from a translation package, if available), the translate interface page to locate strings for manual translation, or the import page to add translations from individual .po files. A number of contributed translation packages containing .po files are available on the Drupal.org translations page.', array('@add-language' => url('admin/international/language/add'), '@search' => url('admin/international/translate/translate'), '@import' => url('admin/international/translate/import'), '@translations' => 'http://drupal.org/project/translations')) . '
'; - $output .= '' . t('To rearrange languages, grab a drag-and-drop handle under the English name column and drag the item to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.') . '
'; - return $output; - case 'admin/international/language/add': - return '' . t('Add all languages to be supported by your site. If your desired language is not available in the Language name drop-down, click Custom language and provide a language code and other details manually. When providing a language code manually, be sure to enter a standardized language code, since this code may be used by browsers to determine an appropriate display language.') . '
'; - case 'admin/international/language/configure': - $output = '' . t("Language negotiation settings determine the site's presentation language. Available options include:") . '
'; - $output .= '' . t('The path prefix or domain name for a language may be set by editing the available languages. In the absence of an appropriate match, the site is displayed in the default language.', array('@languages' => url('admin/international/language'))) . '
'; - return $output; - case 'admin/international/translate': - $output = '' . t('This page provides an overview of available translatable strings. Drupal displays translatable strings in text groups; modules may define additional text groups containing other translatable strings. Because text groups provide a method of grouping related strings, they are often used to focus translation efforts on specific areas of the Drupal interface.') . '
'; - $output .= '' . t('Review the languages page for more information on adding support for additional languages.', array('@languages' => url('admin/international/language'))) . '
'; - return $output; - case 'admin/international/translate/import': - $output = '' . t('This page imports the translated strings contained in an individual Gettext Portable Object (.po) file. Normally distributed as part of a translation package (each translation package may contain several .po files), a .po file may need to be imported after offline editing in a Gettext translation editor. Importing an individual .po file may be a lengthy process.') . '
'; - $output .= '' . t('Note that the .po files within a translation package are imported automatically (if available) when new modules or themes are enabled, or as new languages are added. Since this page only allows the import of one .po file at a time, it may be simpler to download and extract a translation package into your Drupal installation directory and add the language (which automatically imports all .po files within the package). Translation packages are available for download on the Drupal translation page.', array('@language-add' => url('admin/international/language/add'), '@translations' => 'http://drupal.org/project/translations')) . '
'; - return $output; - case 'admin/international/translate/export': - return '' . t('This page exports the translated strings used by your site. An export file may be in Gettext Portable Object (.po) form, which includes both the original string and the translation (used to share translations with others), or in Gettext Portable Object Template (.pot) form, which includes the original strings only (used to create new translations with a Gettext translation editor).') . '
'; - case 'admin/international/translate/translate': - return '' . t('This page allows a translator to search for specific translated and untranslated strings, and is used when creating or editing translations. (Note: For translation tasks involving many strings, it may be more convenient to export strings for offline editing in a desktop Gettext translation editor.) Searches may be limited to strings found within a specific text group or in a specific language.', array('@export' => url('admin/international/translate/export'))) . '
'; - case 'admin/build/block/configure': - if ($arg[4] == 'locale' && $arg[5] == 0) { - return '' . t('This block is only shown if at least two languages are enabled and language negotiation is set to something other than None.', array('@languages' => url('admin/international/language'), '@configuration' => url('admin/international/language/configure'))) . '
'; - } - break; - } -} - -/** - * Implementation of hook_menu(). - */ -function locale_menu() { - // Manage languages - $items['admin/international'] = array( - 'title' => 'International', - 'description' => 'Localization and translation.', - 'position' => 'left', - 'weight' => -7, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - ); - $items['admin/international/language'] = array( - 'title' => 'Languages', - 'description' => 'Configure languages for content and the user interface.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('locale_languages_overview_form'), - 'access arguments' => array('administer languages'), - ); - $items['admin/international/language/overview'] = array( - 'title' => 'List', - 'weight' => 0, - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/international/language/add'] = array( - 'title' => 'Add language', - 'page callback' => 'locale_languages_add_screen', // two forms concatenated - 'access arguments' => array('administer languages'), - 'weight' => 5, - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/international/language/configure'] = array( - 'title' => 'Configure', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('locale_languages_configure_form'), - 'access arguments' => array('administer languages'), - 'weight' => 10, - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/international/language/edit/%'] = array( - 'title' => 'Edit language', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('locale_languages_edit_form', 4), - 'access arguments' => array('administer languages'), - 'type' => MENU_CALLBACK, - ); - $items['admin/international/language/delete/%'] = array( - 'title' => 'Confirm', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('locale_languages_delete_form', 4), - 'access arguments' => array('administer languages'), - 'type' => MENU_CALLBACK, - ); - - // Translation functionality - $items['admin/international/translate'] = array( - 'title' => 'Translate interface', - 'description' => 'Translate the built in interface and optionally other text.', - 'page callback' => 'locale_translate_overview_screen', // not a form, just a table - 'access arguments' => array('translate interface'), - ); - $items['admin/international/translate/overview'] = array( - 'title' => 'Overview', - 'weight' => 0, - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/international/translate/translate'] = array( - 'title' => 'Translate', - 'weight' => 10, - 'type' => MENU_LOCAL_TASK, - 'page callback' => 'locale_translate_seek_screen', // search results and form concatenated - 'access arguments' => array('translate interface'), - ); - $items['admin/international/translate/import'] = array( - 'title' => 'Import', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('locale_translate_import_form'), - 'access arguments' => array('translate interface'), - 'weight' => 20, - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/international/translate/export'] = array( - 'title' => 'Export', - 'page callback' => 'locale_translate_export_screen', // possibly multiple forms concatenated - 'access arguments' => array('translate interface'), - 'weight' => 30, - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/international/translate/edit/%'] = array( - 'title' => 'Edit string', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('locale_translate_edit_form', 4), - 'access arguments' => array('translate interface'), - 'type' => MENU_CALLBACK, - ); - $items['admin/international/translate/delete/%'] = array( - 'title' => 'Delete string', - 'page callback' => 'locale_translate_delete_page', - 'page arguments' => array(4), - 'access arguments' => array('translate interface'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Wrapper function to be able to set callbacks in locale.inc */ function locale_inc_callback() { @@ -261,73 +104,6 @@ function locale_language_selector_form($ return $form; } -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function locale_form_path_admin_form_alter(&$form, &$form_state) { - $form['language'] = array( - '#type' => 'select', - '#title' => t('Language'), - '#options' => array('' => t('All languages')) + locale_language_list('name'), - '#default_value' => $form['language']['#value'], - '#weight' => -10, - '#description' => t('A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for All languages.'), - ); -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function locale_form_node_type_form_alter(&$form, &$form_state) { - if (isset($form['identity']['type'])) { - $form['workflow']['language_content_type'] = array( - '#type' => 'radios', - '#title' => t('Multilingual support'), - '#default_value' => variable_get('language_content_type_' . $form['#node_type']->type, 0), - '#options' => array(t('Disabled'), t('Enabled')), - '#description' => t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/international/language'))), - ); - } -} - -/** - * Implementation of hook_form_alter(). Adds language fields to forms. - */ -function locale_form_alter(&$form, &$form_state, $form_id) { - if (isset($form['#id']) && $form['#id'] == 'node-form') { - if (isset($form['#node']->type) && variable_get('language_content_type_' . $form['#node']->type, 0)) { - $form['language'] = array( - '#type' => 'select', - '#title' => t('Language'), - '#default_value' => (isset($form['#node']->language) ? $form['#node']->language : ''), - '#options' => array('' => t('Language neutral')) + locale_language_list('name'), - ); - } - // Node type without language selector: assign the default for new nodes - elseif (!isset($form['#node']->nid)) { - $default = language_default(); - $form['language'] = array( - '#type' => 'value', - '#value' => $default->language - ); - } - } -} - -/** - * Implementation of hook_theme(). - */ -function locale_theme() { - return array( - 'locale_languages_overview_form' => array( - 'arguments' => array('form' => array()), - ), - 'locale_translation_filters' => array( - 'arguments' => array('form' => array()), - ), - ); -} - // --------------------------------------------------------------------------------- // Locale core functionality @@ -503,68 +279,6 @@ function locale_system_update($component } } -/** - * Implementation of hook_js_alter(). - * - * This function checks all JavaScript files currently added via drupal_add_js() - * and invokes parsing if they have not yet been parsed for Drupal.t() - * and Drupal.formatPlural() calls. Also refreshes the JavaScript translation - * file if necessary, and adds it to the page. - */ -function locale_js_alter(&$javascript) { - global $language; - - $dir = file_create_path(variable_get('locale_js_directory', 'languages')); - $parsed = variable_get('javascript_parsed', array()); - $files = $new_files = FALSE; - - foreach ($javascript as $item) { - if ($item['type'] == 'file') { - $files = TRUE; - $filepath = $item['data']; - if (!in_array($filepath, $parsed)) { - // Don't parse our own translations files. - if (substr($filepath, 0, strlen($dir)) != $dir) { - locale_inc_callback('_locale_parse_js_file', $filepath); - watchdog('locale', 'Parsed JavaScript file %file.', array('%file' => $filepath)); - $parsed[] = $filepath; - $new_files = TRUE; - } - } - } - } - - // If there are any new source files we parsed, invalidate existing - // JavaScript translation files for all languages, adding the refresh - // flags into the existing array. - if ($new_files) { - $parsed += locale_inc_callback('_locale_invalidate_js'); - } - - // If necessary, rebuild the translation file for the current language. - if (!empty($parsed['refresh:' . $language->language])) { - // Don't clear the refresh flag on failure, so that another try will - // be performed later. - if (locale_inc_callback('_locale_rebuild_js')) { - unset($parsed['refresh:' . $language->language]); - } - // Store any changes after refresh was attempted. - variable_set('javascript_parsed', $parsed); - } - // If no refresh was attempted, but we have new source files, we need - // to store them too. This occurs if current page is in English. - elseif ($new_files) { - variable_set('javascript_parsed', $parsed); - } - - // Add the translation JavaScript file to the page. - if ($files && !empty($language->javascript)) { - // Add the translation JavaScript file to the page. - $file = $dir . '/' . $language->language . '_' . $language->javascript . '.js'; - $javascript[$file] = drupal_js_defaults($file); - } -} - // --------------------------------------------------------------------------------- // Language switcher block Index: modules/locale/locale.registry.inc =================================================================== RCS file: modules/locale/locale.registry.inc diff -N modules/locale/locale.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/locale/locale.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,129 @@ + 'International', + 'description' => 'Localization and translation.', + 'position' => 'left', + 'weight' => -7, + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + ); + $items['admin/international/language'] = array( + 'title' => 'Languages', + 'description' => 'Configure languages for content and the user interface.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('locale_languages_overview_form'), + 'access arguments' => array('administer languages'), + ); + $items['admin/international/language/overview'] = array( + 'title' => 'List', + 'weight' => 0, + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/international/language/add'] = array( + 'title' => 'Add language', + 'page callback' => 'locale_languages_add_screen', // two forms concatenated + 'access arguments' => array('administer languages'), + 'weight' => 5, + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/international/language/configure'] = array( + 'title' => 'Configure', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('locale_languages_configure_form'), + 'access arguments' => array('administer languages'), + 'weight' => 10, + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/international/language/edit/%'] = array( + 'title' => 'Edit language', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('locale_languages_edit_form', 4), + 'access arguments' => array('administer languages'), + 'type' => MENU_CALLBACK, + ); + $items['admin/international/language/delete/%'] = array( + 'title' => 'Confirm', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('locale_languages_delete_form', 4), + 'access arguments' => array('administer languages'), + 'type' => MENU_CALLBACK, + ); + + // Translation functionality + $items['admin/international/translate'] = array( + 'title' => 'Translate interface', + 'description' => 'Translate the built in interface and optionally other text.', + 'page callback' => 'locale_translate_overview_screen', // not a form, just a table + 'access arguments' => array('translate interface'), + ); + $items['admin/international/translate/overview'] = array( + 'title' => 'Overview', + 'weight' => 0, + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/international/translate/translate'] = array( + 'title' => 'Translate', + 'weight' => 10, + 'type' => MENU_LOCAL_TASK, + 'page callback' => 'locale_translate_seek_screen', // search results and form concatenated + 'access arguments' => array('translate interface'), + ); + $items['admin/international/translate/import'] = array( + 'title' => 'Import', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('locale_translate_import_form'), + 'access arguments' => array('translate interface'), + 'weight' => 20, + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/international/translate/export'] = array( + 'title' => 'Export', + 'page callback' => 'locale_translate_export_screen', // possibly multiple forms concatenated + 'access arguments' => array('translate interface'), + 'weight' => 30, + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/international/translate/edit/%'] = array( + 'title' => 'Edit string', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('locale_translate_edit_form', 4), + 'access arguments' => array('translate interface'), + 'type' => MENU_CALLBACK, + ); + $items['admin/international/translate/delete/%'] = array( + 'title' => 'Delete string', + 'page callback' => 'locale_translate_delete_page', + 'page arguments' => array(4), + 'access arguments' => array('translate interface'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function locale_theme() { + return array( + 'locale_languages_overview_form' => array( + 'arguments' => array('form' => array()), + ), + 'locale_translation_filters' => array( + 'arguments' => array('form' => array()), + ), + ); +} + Index: modules/locale/tests/locale_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/tests/locale_test.info,v retrieving revision 1.2 diff -u -p -r1.2 locale_test.info --- modules/locale/tests/locale_test.info 26 Apr 2009 15:14:55 -0000 1.2 +++ modules/locale/tests/locale_test.info 20 May 2009 17:36:40 -0000 @@ -6,3 +6,4 @@ package = Testing files[] = locale_test.module version = VERSION hidden = TRUE +files[] = locale_test.registry.inc Index: modules/menu/menu.alter.inc =================================================================== RCS file: modules/menu/menu.alter.inc diff -N modules/menu/menu.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/menu/menu.alter.inc 20 May 2009 21:14:44 -0000 @@ -0,0 +1,78 @@ + 'fieldset', + '#title' => t('Menu settings'), + '#access' => user_access('administer menu'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#group' => 'additional_settings', + '#attached_js' => array(drupal_get_path('module', 'menu') . '/menu.js'), + '#tree' => TRUE, + '#weight' => -2, + '#attributes' => array('class' => 'menu-item-form'), + ); + $item = $form['#node']->menu; + + if ($item['mlid']) { + // There is an existing link. + $form['menu']['delete'] = array( + '#type' => 'checkbox', + '#title' => t('Delete this menu item.'), + ); + } + if (!$item['link_title']) { + $form['menu']['#collapsed'] = TRUE; + } + + foreach (array('mlid', 'module', 'hidden', 'has_children', 'customized', 'options', 'expanded', 'hidden', 'parent_depth_limit') as $key) { + $form['menu'][$key] = array('#type' => 'value', '#value' => $item[$key]); + } + $form['menu']['#item'] = $item; + + $form['menu']['link_title'] = array('#type' => 'textfield', + '#title' => t('Menu link title'), + '#default_value' => $item['link_title'], + '#description' => t('The link text corresponding to this item that should appear in the menu. Leave blank if you do not wish to add this post to the menu.'), + '#required' => FALSE, + ); + // Generate a list of possible parents (not including this item or descendants). + $options = menu_parent_options(menu_get_menus(), $item); + $default = $item['menu_name'] . ':' . $item['plid']; + if (!isset($options[$default])) { + $default = 'main-menu:0'; + } + $form['menu']['parent'] = array( + '#type' => 'select', + '#title' => t('Parent item'), + '#default_value' => $default, + '#options' => $options, + '#description' => t('The maximum depth for an item and all its children is fixed at !maxdepth. Some menu items may not be available as parents if selecting them would exceed this limit.', array('!maxdepth' => MENU_MAX_DEPTH)), + '#attributes' => array('class' => 'menu-title-select'), + ); + $form['#submit'][] = 'menu_node_form_submit'; + + $form['menu']['weight'] = array( + '#type' => 'weight', + '#title' => t('Weight'), + '#delta' => 50, + '#default_value' => $item['weight'], + '#description' => t('Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'), + ); + } +} + Index: modules/menu/menu.bootstrap.inc =================================================================== RCS file: modules/menu/menu.bootstrap.inc diff -N modules/menu/menu.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/menu/menu.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,40 @@ +' . t("The menu module provides an interface to control and customize Drupal's powerful menu system. Menus are a hierarchical collection of links used to navigate a website. Each menu is rendered in a block that may be positioned and displayed using Drupal's flexible block system. Five menus are provided by Drupal and are always present: Navigation, Management, User menu, Main menu, and Secondary menu. The Management menu contains links for administration and content creation, while the Navigation menu is the default location for site navigation links created by newly enabled modules. Both of these are often displayed in either the left or right sidebar. Most Drupal themes also provide support for the Main links and Secondary links, by displaying them in either the header or footer of each page. The Main menu is the default source for the Main links and the User menu is the default source for the Secondary links. By default, the User menu has links to take the current user to their account or allow them to log out, while the Main menu and Secondary menu contain no menu links but may be configured to contain custom menu items specific to your site. You may create an unlimited number of additional menus, each of which will automatically have an associated block.") . ''; + $output .= '' . t('The menus page displays all menus currently available on your site. Select a menu from this list to add or edit a menu link, or to rearrange links within the menu. Create new menus using the add menu page (the block containing a new menu must also be enabled on the blocks administration page).', array('@menu' => url('admin/build/menu'), '@add-menu' => url('admin/build/menu/add'), '@blocks' => url('admin/build/block'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Menu module.', array('@menu' => 'http://drupal.org/handbook/modules/menu/')) . '
'; + return $output; + case 'admin/build/menu': + return '' . t('Menus are a collection of links used to navigate a website. If the Block module is enabled, each menu has a corresponding block that is managed on the blocks administration page. Select an existing menu from this list to manage its menu links.', array('@blocks' => url('admin/build/block'))) . '
'; + case 'admin/build/menu/add': + return '' . t('Enter the name for your new menu. Remember to enable the newly created block in the blocks administration page.', array('@blocks' => url('admin/build/block'))) . '
'; + case 'admin/build/menu-customize/%': + return '' . t('To rearrange menu links, grab a drag-and-drop handle under the Menu link column and drag the link (or group of links) to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.') . '
'; + case 'admin/build/menu/item/add': + return '' . t('Enter the title and path for your new menu link.') . '
'; + } +} + Index: modules/menu/menu.info =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.info,v retrieving revision 1.8 diff -u -p -r1.8 menu.info --- modules/menu/menu.info 11 Oct 2008 02:32:50 -0000 1.8 +++ modules/menu/menu.info 20 May 2009 21:14:44 -0000 @@ -7,3 +7,6 @@ core = 7.x files[] = menu.module files[] = menu.admin.inc files[] = menu.install +files[] = menu.registry.inc +files[] = menu.bootstrap.inc +files[] = menu.alter.inc Index: modules/menu/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v retrieving revision 1.187 diff -u -p -r1.187 menu.module --- modules/menu/menu.module 14 May 2009 08:23:15 -0000 1.187 +++ modules/menu/menu.module 20 May 2009 21:14:44 -0000 @@ -2,38 +2,6 @@ // $Id: menu.module,v 1.187 2009/05/14 08:23:15 dries Exp $ /** - * @file - * Allows administrators to customize the site navigation menu. - */ - -/** - * Maximum length of menu name as entered by the user. Database length is 32 - * and we add a menu- prefix. - */ -define('MENU_MAX_MENU_NAME_LENGTH_UI', 27); - -/** - * Implementation of hook_help(). - */ -function menu_help($path, $arg) { - switch ($path) { - case 'admin/help#menu': - $output = '' . t("The menu module provides an interface to control and customize Drupal's powerful menu system. Menus are a hierarchical collection of links used to navigate a website. Each menu is rendered in a block that may be positioned and displayed using Drupal's flexible block system. Five menus are provided by Drupal and are always present: Navigation, Management, User menu, Main menu, and Secondary menu. The Management menu contains links for administration and content creation, while the Navigation menu is the default location for site navigation links created by newly enabled modules. Both of these are often displayed in either the left or right sidebar. Most Drupal themes also provide support for the Main links and Secondary links, by displaying them in either the header or footer of each page. The Main menu is the default source for the Main links and the User menu is the default source for the Secondary links. By default, the User menu has links to take the current user to their account or allow them to log out, while the Main menu and Secondary menu contain no menu links but may be configured to contain custom menu items specific to your site. You may create an unlimited number of additional menus, each of which will automatically have an associated block.") . '
'; - $output .= '' . t('The menus page displays all menus currently available on your site. Select a menu from this list to add or edit a menu link, or to rearrange links within the menu. Create new menus using the add menu page (the block containing a new menu must also be enabled on the blocks administration page).', array('@menu' => url('admin/build/menu'), '@add-menu' => url('admin/build/menu/add'), '@blocks' => url('admin/build/block'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Menu module.', array('@menu' => 'http://drupal.org/handbook/modules/menu/')) . '
'; - return $output; - case 'admin/build/menu': - return '' . t('Menus are a collection of links used to navigate a website. If the Block module is enabled, each menu has a corresponding block that is managed on the blocks administration page. Select an existing menu from this list to manage its menu links.', array('@blocks' => url('admin/build/block'))) . '
'; - case 'admin/build/menu/add': - return '' . t('Enter the name for your new menu. Remember to enable the newly created block in the blocks administration page.', array('@blocks' => url('admin/build/block'))) . '
'; - case 'admin/build/menu-customize/%': - return '' . t('To rearrange menu links, grab a drag-and-drop handle under the Menu link column and drag the link (or group of links) to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.') . '
'; - case 'admin/build/menu/item/add': - return '' . t('Enter the title and path for your new menu link.') . '
'; - } -} - -/** * Implementation of hook_perm(). */ function menu_perm() { @@ -46,110 +14,6 @@ function menu_perm() { } /** - * Implementation of hook_menu(). - */ -function menu_menu() { - $items['admin/build/menu'] = array( - 'title' => 'Menus', - 'description' => 'Add new menus to your site, edit existing menus, and rename and reorganize menu links.', - 'page callback' => 'menu_overview_page', - 'access callback' => 'user_access', - 'access arguments' => array('administer menu'), - ); - $items['admin/build/menu/list'] = array( - 'title' => 'List menus', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/build/menu/add'] = array( - 'title' => 'Add menu', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_edit_menu', 'add'), - 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/menu/settings'] = array( - 'title' => 'Settings', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_configure'), - 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 5, - ); - $items['admin/build/menu-customize/%menu'] = array( - 'title' => 'Customize menu', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_overview_form', 3), - 'title callback' => 'menu_overview_title', - 'title arguments' => array(3), - 'access arguments' => array('administer menu'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/menu-customize/%menu/list'] = array( - 'title' => 'List links', - 'weight' => -10, - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/build/menu-customize/%menu/add'] = array( - 'title' => 'Add link', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_edit_item', 'add', NULL, 3), - 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/menu-customize/%menu/edit'] = array( - 'title' => 'Edit menu', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_edit_menu', 'edit', 3), - 'access arguments' => array('administer menu'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/menu-customize/%menu/delete'] = array( - 'title' => 'Delete menu', - 'page callback' => 'menu_delete_menu_page', - 'page arguments' => array(3), - 'access arguments' => array('administer menu'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/menu/item/%menu_link/edit'] = array( - 'title' => 'Edit menu link', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_edit_item', 'edit', 4, NULL), - 'access arguments' => array('administer menu'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/menu/item/%menu_link/reset'] = array( - 'title' => 'Reset menu link', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('menu_reset_item_confirm', 4), - 'access arguments' => array('administer menu'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/menu/item/%menu_link/delete'] = array( - 'title' => 'Delete menu link', - 'page callback' => 'menu_item_delete_page', - 'page arguments' => array(4), - 'access arguments' => array('administer menu'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** - * Implementation of hook_theme(). - */ -function menu_theme() { - return array( - 'menu_overview_form' => array( - 'arguments' => array('form' => NULL), - ), - 'menu_admin_overview' => array( - 'arguments' => array('title' => NULL, 'name' => NULL, 'description' => NULL), - ), - ); -} - -/** * Implementation of hook_enable(). * * Add a link for each custom menu. @@ -387,76 +251,6 @@ function _menu_parent_depth_limit($item) } /** - * Implementation of hook_form_alter(). Adds menu item fields to the node form. - */ -function menu_form_alter(&$form, $form_state, $form_id) { - if (!empty($form['#node_edit_form'])) { - // Note - doing this to make sure the delete checkbox stays in the form. - $form['#cache'] = TRUE; - - $form['menu'] = array( - '#type' => 'fieldset', - '#title' => t('Menu settings'), - '#access' => user_access('administer menu'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'menu') . '/menu.js'), - '#tree' => TRUE, - '#weight' => -2, - '#attributes' => array('class' => 'menu-item-form'), - ); - $item = $form['#node']->menu; - - if ($item['mlid']) { - // There is an existing link. - $form['menu']['delete'] = array( - '#type' => 'checkbox', - '#title' => t('Delete this menu item.'), - ); - } - if (!$item['link_title']) { - $form['menu']['#collapsed'] = TRUE; - } - - foreach (array('mlid', 'module', 'hidden', 'has_children', 'customized', 'options', 'expanded', 'hidden', 'parent_depth_limit') as $key) { - $form['menu'][$key] = array('#type' => 'value', '#value' => $item[$key]); - } - $form['menu']['#item'] = $item; - - $form['menu']['link_title'] = array('#type' => 'textfield', - '#title' => t('Menu link title'), - '#default_value' => $item['link_title'], - '#description' => t('The link text corresponding to this item that should appear in the menu. Leave blank if you do not wish to add this post to the menu.'), - '#required' => FALSE, - ); - // Generate a list of possible parents (not including this item or descendants). - $options = menu_parent_options(menu_get_menus(), $item); - $default = $item['menu_name'] . ':' . $item['plid']; - if (!isset($options[$default])) { - $default = 'main-menu:0'; - } - $form['menu']['parent'] = array( - '#type' => 'select', - '#title' => t('Parent item'), - '#default_value' => $default, - '#options' => $options, - '#description' => t('The maximum depth for an item and all its children is fixed at !maxdepth. Some menu items may not be available as parents if selecting them would exceed this limit.', array('!maxdepth' => MENU_MAX_DEPTH)), - '#attributes' => array('class' => 'menu-title-select'), - ); - $form['#submit'][] = 'menu_node_form_submit'; - - $form['menu']['weight'] = array( - '#type' => 'weight', - '#title' => t('Weight'), - '#delta' => 50, - '#default_value' => $item['weight'], - '#description' => t('Optional. In the menu, the heavier items will sink and the lighter items will be positioned nearer the top.'), - ); - } -} - -/** * Decompose the selected menu parent option into the menu_name and plid. */ function menu_node_form_submit($form, &$form_state) { Index: modules/menu/menu.registry.inc =================================================================== RCS file: modules/menu/menu.registry.inc diff -N modules/menu/menu.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/menu/menu.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,112 @@ + 'Menus', + 'description' => 'Add new menus to your site, edit existing menus, and rename and reorganize menu links.', + 'page callback' => 'menu_overview_page', + 'access callback' => 'user_access', + 'access arguments' => array('administer menu'), + ); + $items['admin/build/menu/list'] = array( + 'title' => 'List menus', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/build/menu/add'] = array( + 'title' => 'Add menu', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_edit_menu', 'add'), + 'access arguments' => array('administer menu'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/menu/settings'] = array( + 'title' => 'Settings', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_configure'), + 'access arguments' => array('administer menu'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 5, + ); + $items['admin/build/menu-customize/%menu'] = array( + 'title' => 'Customize menu', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_overview_form', 3), + 'title callback' => 'menu_overview_title', + 'title arguments' => array(3), + 'access arguments' => array('administer menu'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/menu-customize/%menu/list'] = array( + 'title' => 'List links', + 'weight' => -10, + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/build/menu-customize/%menu/add'] = array( + 'title' => 'Add link', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_edit_item', 'add', NULL, 3), + 'access arguments' => array('administer menu'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/menu-customize/%menu/edit'] = array( + 'title' => 'Edit menu', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_edit_menu', 'edit', 3), + 'access arguments' => array('administer menu'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/menu-customize/%menu/delete'] = array( + 'title' => 'Delete menu', + 'page callback' => 'menu_delete_menu_page', + 'page arguments' => array(3), + 'access arguments' => array('administer menu'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/menu/item/%menu_link/edit'] = array( + 'title' => 'Edit menu link', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_edit_item', 'edit', 4, NULL), + 'access arguments' => array('administer menu'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/menu/item/%menu_link/reset'] = array( + 'title' => 'Reset menu link', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_reset_item_confirm', 4), + 'access arguments' => array('administer menu'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/menu/item/%menu_link/delete'] = array( + 'title' => 'Delete menu link', + 'page callback' => 'menu_item_delete_page', + 'page arguments' => array(4), + 'access arguments' => array('administer menu'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function menu_theme() { + return array( + 'menu_overview_form' => array( + 'arguments' => array('form' => NULL), + ), + 'menu_admin_overview' => array( + 'arguments' => array('title' => NULL, 'name' => NULL, 'description' => NULL), + ), + ); +} + Index: modules/node/node.alter.inc =================================================================== RCS file: modules/node/node.alter.inc diff -N modules/node/node.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/node/node.alter.inc 20 May 2009 22:26:01 -0000 @@ -0,0 +1,128 @@ + 'fieldset', + '#title' => t('Advanced search'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#attributes' => array('class' => 'search-advanced'), + ); + $form['advanced']['keywords'] = array( + '#prefix' => '' . t('The node module manages content on your site, and stores all posts (regardless of type) as a "node" . In addition to basic publishing settings, including whether the post has been published, promoted to the site front page, or should remain present (or sticky) at the top of lists, the node module also records basic information about the author of a post. Optional revision control over edits is available. For additional functionality, the node module is often extended by other modules.') . '
'; + $output .= '' . t('Though each post on your site is a node, each post is also of a particular content type. Content types are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Each content type may have different default settings for Publishing options and other workflow controls. By default, the two content types in a standard Drupal installation are Page and Story. Use the content types page to add new or edit existing content types. Additional content types also become available as you enable additional core, contributed and custom modules.', array('@content-type' => url('admin/build/types'))) . '
'; + $output .= '' . t('The administrative content page allows you to review and manage your site content. The post settings page sets certain options for the display of posts. The node module makes a number of permissions available for each content type, which may be set by role on the permissions page.', array('@content' => url('admin/content/node'), '@post-settings' => url('admin/content/node-settings'), '@permissions' => url('admin/user/permissions'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Node module.', array('@node' => 'http://drupal.org/handbook/modules/node/')) . '
'; + return $output; + case 'admin/content/node': + return ' '; // Return a non-null value so that the 'more help' link is shown. + case 'admin/build/types': + return '' . t('Below is a list of all the content types on your site. All posts that exist on your site are instances of one of these content types.') . '
'; + case 'admin/build/types/add': + return '' . t('To create a new content type, enter the human-readable name, the machine-readable name, and all other relevant fields that are on this page. Once created, users of your site will be able to create posts that are instances of this content type.') . '
'; + case 'node/%/revisions': + return '' . t('The revisions let you track differences between multiple versions of a post.') . '
'; + case 'node/%/edit': + $node = node_load($arg[1]); + $type = node_get_types('type', $node->type); + return (!empty($type->help) ? '' . filter_xss_admin($type->help) . '
' : ''); + } + + if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) { + $type = node_get_types('type', str_replace('-', '_', $arg[2])); + return (!empty($type->help) ? '' . filter_xss_admin($type->help) . '
' : ''); + } +} + +/** + * Implementation of hook_fieldable_info(). + */ +function node_fieldable_info() { + $return = array( + 'node' => array( + 'name' => t('Node'), + 'id key' => 'nid', + 'revision key' => 'vid', + 'bundle key' => 'type', + // Node.module handles its own caching. + // 'cacheable' => FALSE, + // Bundles must provide human readable name so + // we can create help and error messages about them. + 'bundles' => node_get_types('names'), + ), + ); + return $return; +} + + +/** + * Implementation of hook_hook_info(). + */ +function node_hook_info() { + return array( + 'node' => array( + 'node' => array( + 'presave' => array( + 'runs when' => t('When either saving a new post or updating an existing post'), + ), + 'insert' => array( + 'runs when' => t('After saving a new post'), + ), + 'update' => array( + 'runs when' => t('After saving an updated post'), + ), + 'delete' => array( + 'runs when' => t('After deleting a post') + ), + 'view' => array( + 'runs when' => t('When content is viewed by an authenticated user') + ), + ), + ), + ); +} + +/** + * Implementation of hook_elements(). + */ +function node_elements() { + $type['node_links'] = array('#theme' => 'node_links'); + + return $type; +} + Index: modules/node/node.info =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.info,v retrieving revision 1.10 diff -u -p -r1.10 node.info --- modules/node/node.info 12 Oct 2008 01:23:04 -0000 1.10 +++ modules/node/node.info 20 May 2009 21:14:44 -0000 @@ -10,3 +10,6 @@ files[] = node.admin.inc files[] = node.pages.inc files[] = node.install required = TRUE +files[] = node.registry.inc +files[] = node.bootstrap.inc +files[] = node.alter.inc Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1050 diff -u -p -r1.1050 node.module --- modules/node/node.module 20 May 2009 05:39:45 -0000 1.1050 +++ modules/node/node.module 20 May 2009 22:25:51 -0000 @@ -2,143 +2,6 @@ // $Id: node.module,v 1.1050 2009/05/20 05:39:45 webchick Exp $ /** - * @file - * The core that allows content to be submitted to the site. Modules and - * scripts may programmatically submit nodes using the usual form API pattern. - */ - -/** - * Nodes changed before this time are always marked as read. - * - * Nodes changed after this time may be marked new, updated, or read, depending - * on their state for the current user. Defaults to 30 days ago. - */ -define('NODE_NEW_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60); - -/** - * Node is being built before being viewed normally. - */ -define('NODE_BUILD_NORMAL', 0); - -/** - * Node is being built before being previewed. - */ -define('NODE_BUILD_PREVIEW', 1); - -/** - * Node is being built before being indexed by search module. - */ -define('NODE_BUILD_SEARCH_INDEX', 2); - -/** - * Node is being built before being displayed as a search result. - */ -define('NODE_BUILD_SEARCH_RESULT', 3); - -/** - * Node is being built before being displayed as part of an RSS feed. - */ -define('NODE_BUILD_RSS', 4); - -/** - * Node is being built before being printed. - */ -define('NODE_BUILD_PRINT', 5); - -/** - * Implementation of hook_help(). - */ -function node_help($path, $arg) { - // Remind site administrators about the {node_access} table being flagged - // for rebuild. We don't need to issue the message on the confirm form, or - // while the rebuild is being processed. - if ($path != 'admin/content/node-settings/rebuild' && $path != 'batch' && strpos($path, '#') === FALSE - && user_access('access administration pages') && node_access_needs_rebuild()) { - if ($path == 'admin/content/node-settings') { - $message = t('The content access permissions need to be rebuilt.'); - } - else { - $message = t('The content access permissions need to be rebuilt. Please visit this page.', array('@node_access_rebuild' => url('admin/content/node-settings/rebuild'))); - } - drupal_set_message($message, 'error'); - } - - switch ($path) { - case 'admin/help#node': - $output = '' . t('The node module manages content on your site, and stores all posts (regardless of type) as a "node" . In addition to basic publishing settings, including whether the post has been published, promoted to the site front page, or should remain present (or sticky) at the top of lists, the node module also records basic information about the author of a post. Optional revision control over edits is available. For additional functionality, the node module is often extended by other modules.') . '
'; - $output .= '' . t('Though each post on your site is a node, each post is also of a particular content type. Content types are used to define the characteristics of a post, including the title and description of the fields displayed on its add and edit pages. Each content type may have different default settings for Publishing options and other workflow controls. By default, the two content types in a standard Drupal installation are Page and Story. Use the content types page to add new or edit existing content types. Additional content types also become available as you enable additional core, contributed and custom modules.', array('@content-type' => url('admin/build/types'))) . '
'; - $output .= '' . t('The administrative content page allows you to review and manage your site content. The post settings page sets certain options for the display of posts. The node module makes a number of permissions available for each content type, which may be set by role on the permissions page.', array('@content' => url('admin/content/node'), '@post-settings' => url('admin/content/node-settings'), '@permissions' => url('admin/user/permissions'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Node module.', array('@node' => 'http://drupal.org/handbook/modules/node/')) . '
'; - return $output; - case 'admin/content/node': - return ' '; // Return a non-null value so that the 'more help' link is shown. - case 'admin/build/types': - return '' . t('Below is a list of all the content types on your site. All posts that exist on your site are instances of one of these content types.') . '
'; - case 'admin/build/types/add': - return '' . t('To create a new content type, enter the human-readable name, the machine-readable name, and all other relevant fields that are on this page. Once created, users of your site will be able to create posts that are instances of this content type.') . '
'; - case 'node/%/revisions': - return '' . t('The revisions let you track differences between multiple versions of a post.') . '
'; - case 'node/%/edit': - $node = node_load($arg[1]); - $type = node_get_types('type', $node->type); - return (!empty($type->help) ? '' . filter_xss_admin($type->help) . '
' : ''); - } - - if ($arg[0] == 'node' && $arg[1] == 'add' && $arg[2]) { - $type = node_get_types('type', str_replace('-', '_', $arg[2])); - return (!empty($type->help) ? '' . filter_xss_admin($type->help) . '
' : ''); - } -} - -/** - * Implementation of hook_theme(). - */ -function node_theme() { - return array( - 'node' => array( - 'arguments' => array('elements' => NULL), - 'template' => 'node', - ), - 'node_list' => array( - 'arguments' => array('items' => NULL, 'title' => NULL), - ), - 'node_search_admin' => array( - 'arguments' => array('form' => NULL), - ), - 'node_filter_form' => array( - 'arguments' => array('form' => NULL), - ), - 'node_filters' => array( - 'arguments' => array('form' => NULL), - ), - 'node_admin_nodes' => array( - 'arguments' => array('form' => NULL), - ), - 'node_add_list' => array( - 'arguments' => array('content' => NULL), - ), - 'node_form' => array( - 'arguments' => array('form' => NULL), - ), - 'node_preview' => array( - 'arguments' => array('node' => NULL), - ), - 'node_log_message' => array( - 'arguments' => array('log' => NULL), - ), - 'node_submitted' => array( - 'arguments' => array('node' => NULL), - ), - 'node_admin_overview' => array( - 'arguments' => array('name' => NULL, 'type' => NULL), - ), - 'node_links' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** * Implementation of hook_cron(). */ function node_cron() { @@ -148,27 +11,6 @@ function node_cron() { } /** - * Implementation of hook_fieldable_info(). - */ -function node_fieldable_info() { - $return = array( - 'node' => array( - 'name' => t('Node'), - 'id key' => 'nid', - 'revision key' => 'vid', - 'bundle key' => 'type', - // Node.module handles its own caching. - // 'cacheable' => FALSE, - // Bundles must provide human readable name so - // we can create help and error messages about them. - 'bundles' => node_get_types('names'), - ), - ); - return $return; -} - - -/** * Implementation of hook_field_build_modes(). */ function node_field_build_modes($obj_type) { @@ -1725,187 +1567,12 @@ function _node_add_access() { } /** - * Implementation of hook_menu(). - */ -function node_menu() { - $items['admin/content/node'] = array( - 'title' => 'Content', - 'description' => "View, edit, and delete your site's content.", - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_admin_content'), - 'access arguments' => array('administer nodes'), - ); - - $items['admin/content/node/overview'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - - $items['admin/content/node-settings'] = array( - 'title' => 'Post settings', - 'description' => 'Control posting behavior, such as teaser length, requiring previews before posting, and the number of posts on the front page.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_configure'), - 'access arguments' => array('administer nodes'), - ); - $items['admin/content/node-settings/rebuild'] = array( - 'title' => 'Rebuild permissions', - 'page arguments' => array('node_configure_rebuild_confirm'), - // Any user than can potentially trigger a node_access_needs_rebuild(TRUE) - // has to be allowed access to the 'node access rebuild' confirm form. - 'access arguments' => array('access administration pages'), - 'type' => MENU_CALLBACK, - ); - - $items['admin/build/types'] = array( - 'title' => 'Content types', - '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'), - ); - $items['admin/build/types/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/build/types/add'] = array( - 'title' => 'Add content type', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_type_form'), - 'access arguments' => array('administer content types'), - 'type' => MENU_LOCAL_TASK, - ); - $items['node'] = array( - 'title' => 'Content', - 'page callback' => 'node_page_default', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['node/add'] = array( - 'title' => 'Create content', - 'page callback' => 'node_add_page', - 'access callback' => '_node_add_access', - 'weight' => 1, - 'menu_name' => 'management', - ); - $items['rss.xml'] = array( - 'title' => 'RSS feed', - 'page callback' => 'node_feed', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - foreach (node_get_types('types', NULL, TRUE) as $type) { - $type_url_str = str_replace('_', '-', $type->type); - $items['node/add/' . $type_url_str] = array( - 'title' => $type->name, - 'title callback' => 'check_plain', - 'page callback' => 'node_add', - 'page arguments' => array(2), - 'access callback' => 'node_access', - 'access arguments' => array('create', $type->type), - 'description' => $type->description, - ); - $items['admin/build/node-type/' . $type_url_str] = array( - 'title' => $type->name, - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_type_form', $type), - 'access arguments' => array('administer content types'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/node-type/' . $type_url_str . '/edit'] = array( - 'title' => 'Edit', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/build/node-type/' . $type_url_str . '/delete'] = array( - 'title' => 'Delete', - 'page arguments' => array('node_type_delete_confirm', $type), - 'access arguments' => array('administer content types'), - 'type' => MENU_CALLBACK, - ); - } - $items['node/%node'] = array( - 'title callback' => 'node_page_title', - 'title arguments' => array(1), - 'page callback' => 'node_page_view', - 'page arguments' => array(1), - 'access callback' => 'node_access', - 'access arguments' => array('view', 1), - 'type' => MENU_CALLBACK); - $items['node/%node/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10); - $items['node/%node/edit'] = array( - 'title' => 'Edit', - 'page callback' => 'node_page_edit', - 'page arguments' => array(1), - 'access callback' => 'node_access', - 'access arguments' => array('update', 1), - 'weight' => 1, - 'type' => MENU_LOCAL_TASK, - ); - $items['node/%node/delete'] = array( - 'title' => 'Delete', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_delete_confirm', 1), - 'access callback' => 'node_access', - 'access arguments' => array('delete', 1), - 'weight' => 1, - 'type' => MENU_CALLBACK); - $items['node/%node/revisions'] = array( - 'title' => 'Revisions', - 'page callback' => 'node_revision_overview', - 'page arguments' => array(1), - 'access callback' => '_node_revision_access', - 'access arguments' => array(1), - 'weight' => 2, - 'type' => MENU_LOCAL_TASK, - ); - $items['node/%node/revisions/%/view'] = array( - 'title' => 'Revisions', - 'load arguments' => array(3), - 'page callback' => 'node_show', - 'page arguments' => array(1, TRUE), - 'access callback' => '_node_revision_access', - 'access arguments' => array(1), - 'type' => MENU_CALLBACK, - ); - $items['node/%node/revisions/%/revert'] = array( - 'title' => 'Revert to earlier revision', - 'load arguments' => array(3), - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_revision_revert_confirm', 1), - 'access callback' => '_node_revision_access', - 'access arguments' => array(1, 'update'), - 'type' => MENU_CALLBACK, - ); - $items['node/%node/revisions/%/delete'] = array( - 'title' => 'Delete earlier revision', - 'load arguments' => array(3), - 'page callback' => 'drupal_get_form', - 'page arguments' => array('node_revision_delete_confirm', 1), - 'access callback' => '_node_revision_access', - 'access arguments' => array(1, 'delete'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Title callback. */ function node_page_title($node) { return $node->title; } -/** - * Implementation of hook_init(). - */ -function node_init() { - drupal_add_css(drupal_get_path('module', 'node') . '/node.css'); -} - function node_last_changed($nid) { return db_query('SELECT changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetch()->changed; } @@ -2144,90 +1811,6 @@ function _node_index_node($node) { } /** - * Implementation of hook_form_FORM_ID_alter(). - */ -function node_form_search_form_alter(&$form, $form_state) { - if ($form['module']['#value'] == 'node' && user_access('use advanced search')) { - // Keyword boxes: - $form['advanced'] = array( - '#type' => 'fieldset', - '#title' => t('Advanced search'), - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#attributes' => array('class' => 'search-advanced'), - ); - $form['advanced']['keywords'] = array( - '#prefix' => '' . t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the free public providers. You can find out more about OpenID at this website.', array('@openid-providers' => url('http://openid.net/get/'), '@openid-net' => url('http://openid.net'))) . '
'; + $output .= '' . t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') . '
'; + return $output; + + case 'admin/help#openid': + $output = '' . t('OpenID is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated; including your site.') . '
'; + $output .= '' . t('Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. OpenID is not a trust system, so email verification is still necessary. The benefit stems from the fact that users can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually.') . '
'; + $output .= '' . t('The basic concept is as follows: A user has an account on an OpenID server. This account provides them with a unique URL (such as myusername.openidprovider.com). When the user comes to your site, they are presented with the option of entering this URL. Your site then communicates with the OpenID server, asking it to verify the identity of the user. If the user is logged into their OpenID server, the server communicates back to your site, verifying the user. If they are not logged in, the OpenID server will ask the user for their password. At no point does your site record, or need to record the user\'s password.') . '
'; + $output .= '' . t('More information on OpenID is available at OpenID.net.', array('@openid-net' => url('http://openid.net'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for OpenID module.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) . '
'; + return $output; + } +} + Index: modules/openid/openid.info =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.info,v retrieving revision 1.6 diff -u -p -r1.6 openid.info --- modules/openid/openid.info 11 Oct 2008 02:32:53 -0000 1.6 +++ modules/openid/openid.info 20 May 2009 21:14:44 -0000 @@ -9,3 +9,6 @@ files[] = openid.inc files[] = openid.pages.inc files[] = xrds.inc files[] = openid.install +files[] = openid.registry.inc +files[] = openid.bootstrap.inc +files[] = openid.alter.inc Index: modules/openid/openid.module =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v retrieving revision 1.45 diff -u -p -r1.45 openid.module --- modules/openid/openid.module 29 Apr 2009 07:29:59 -0000 1.45 +++ modules/openid/openid.module 20 May 2009 22:26:30 -0000 @@ -2,61 +2,6 @@ // $Id: openid.module,v 1.45 2009/04/29 07:29:59 dries Exp $ /** - * @file - * Implement OpenID Relying Party support for Drupal - */ - -/** - * Implementation of hook_menu(). - */ -function openid_menu() { - $items['openid/authenticate'] = array( - 'title' => 'OpenID Login', - 'page callback' => 'openid_authentication_page', - 'access callback' => 'user_is_anonymous', - 'type' => MENU_CALLBACK, - ); - $items['user/%user/openid'] = array( - 'title' => 'OpenID identities', - 'page callback' => 'openid_user_identities', - 'page arguments' => array(1), - 'access callback' => 'user_edit_access', - 'access arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - ); - $items['user/%user/openid/delete'] = array( - 'title' => 'Delete OpenID', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('openid_user_delete_form', 1), - 'access callback' => 'user_edit_access', - 'access arguments' => array(1), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** - * Implementation of hook_help(). - */ -function openid_help($path, $arg) { - switch ($path) { - case 'user/%/openid': - $output = '' . t('This site supports OpenID, a secure way to log into many websites using a single username and password. OpenID can reduce the necessity of managing many usernames and passwords for many websites.', array('@openid-net' => url('http://openid.net'))) . '
'; - $output .= '' . t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the free public providers. You can find out more about OpenID at this website.', array('@openid-providers' => url('http://openid.net/get/'), '@openid-net' => url('http://openid.net'))) . '
'; - $output .= '' . t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') . '
'; - return $output; - - case 'admin/help#openid': - $output = '' . t('OpenID is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated; including your site.') . '
'; - $output .= '' . t('Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. OpenID is not a trust system, so email verification is still necessary. The benefit stems from the fact that users can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually.') . '
'; - $output .= '' . t('The basic concept is as follows: A user has an account on an OpenID server. This account provides them with a unique URL (such as myusername.openidprovider.com). When the user comes to your site, they are presented with the option of entering this URL. Your site then communicates with the OpenID server, asking it to verify the identity of the user. If the user is logged into their OpenID server, the server communicates back to your site, verifying the user. If they are not logged in, the OpenID server will ask the user for their password. At no point does your site record, or need to record the user\'s password.') . '
'; - $output .= '' . t('More information on OpenID is available at OpenID.net.', array('@openid-net' => url('http://openid.net'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for OpenID module.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) . '
'; - return $output; - } -} - -/** * Implementation of hook_user_insert(). */ function openid_user_insert(&$edit, &$account, $category = NULL) { @@ -70,77 +15,6 @@ function openid_user_insert(&$edit, &$ac } /** - * Implementation of hook_form_FORM_ID_alter(). - */ -function openid_form_user_login_block_alter(&$form, &$form_state) { - _openid_user_login_form_alter($form, $form_state); -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function openid_form_user_login_alter(&$form, &$form_state) { - _openid_user_login_form_alter($form, $form_state); -} - -function _openid_user_login_form_alter(&$form, &$form_state) { - drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css'); - drupal_add_js(drupal_get_path('module', 'openid') . '/openid.js'); - if (!empty($form_state['input']['openid_identifier'])) { - $form['name']['#required'] = FALSE; - $form['pass']['#required'] = FALSE; - unset($form['#submit']); - $form['#validate'] = array('openid_login_validate'); - } - - $items = array(); - $items[] = array( - 'data' => l(t('Log in using OpenID'), '#'), - 'class' => 'openid-link', - ); - $items[] = array( - 'data' => l(t('Cancel OpenID login'), '#'), - 'class' => 'user-link', - ); - - $form['openid_links'] = array( - '#markup' => theme('item_list', $items), - '#weight' => 1, - ); - - $form['links']['#weight'] = 2; - - $form['openid_identifier'] = array( - '#type' => 'textfield', - '#title' => t('Log in using OpenID'), - '#size' => $form['name']['#size'], - '#maxlength' => 255, - '#weight' => -1, - '#description' => l(t('What is OpenID?'), 'http://openid.net/', array('external' => TRUE)), - ); - $form['openid.return_to'] = array('#type' => 'hidden', '#value' => url('openid/authenticate', array('absolute' => TRUE, 'query' => drupal_get_destination()))); -} - -/** - * Implementation of hook_form_alter(). Adds OpenID login to the login forms. - */ -function openid_form_user_register_alter(&$form, &$form_state) { - if (isset($_SESSION['openid']['values'])) { - // We were unable to auto-register a new user. Prefill the registration - // form with the values we have. - $form['name']['#default_value'] = $_SESSION['openid']['values']['name']; - $form['mail']['#default_value'] = $_SESSION['openid']['values']['mail']; - // If user_email_verification is off, hide the password field and just fill - // with random password to avoid confusion. - if (!variable_get('user_email_verification', TRUE)) { - $form['pass']['#type'] = 'hidden'; - $form['pass']['#value'] = user_password(); - } - $form['auth_openid'] = array('#type' => 'hidden', '#value' => $_SESSION['openid']['values']['auth_openid']); - } -} - -/** * Login form _validate hook */ function openid_login_validate($form, &$form_state) { Index: modules/openid/openid.registry.inc =================================================================== RCS file: modules/openid/openid.registry.inc diff -N modules/openid/openid.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/openid/openid.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,42 @@ + 'OpenID Login', + 'page callback' => 'openid_authentication_page', + 'access callback' => 'user_is_anonymous', + 'type' => MENU_CALLBACK, + ); + $items['user/%user/openid'] = array( + 'title' => 'OpenID identities', + 'page callback' => 'openid_user_identities', + 'page arguments' => array(1), + 'access callback' => 'user_edit_access', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + ); + $items['user/%user/openid/delete'] = array( + 'title' => 'Delete OpenID', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('openid_user_delete_form', 1), + 'access callback' => 'user_edit_access', + 'access arguments' => array(1), + 'type' => MENU_CALLBACK, + ); + return $items; +} + Index: modules/openid/tests/openid_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/tests/openid_test.info,v retrieving revision 1.1 diff -u -p -r1.1 openid_test.info --- modules/openid/tests/openid_test.info 8 May 2009 21:44:48 -0000 1.1 +++ modules/openid/tests/openid_test.info 20 May 2009 17:36:40 -0000 @@ -8,3 +8,4 @@ files[] = openid_test.install files[] = openid_test.module dependencies[] = openid hidden = TRUE +files[] = openid_test.registry.inc Index: modules/openid/tests/openid_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/tests/openid_test.module,v retrieving revision 1.1 diff -u -p -r1.1 openid_test.module --- modules/openid/tests/openid_test.module 8 May 2009 21:44:48 -0000 1.1 +++ modules/openid/tests/openid_test.module 20 May 2009 17:28:58 -0000 @@ -2,69 +2,6 @@ // $Id: openid_test.module,v 1.1 2009/05/08 21:44:48 dries Exp $ /** - * @file - * Dummy OpenID Provider used with SimpleTest. - * - * The provider simply responds positively to all authentication requests. In - * addition to a Provider Endpoint (a URL used for Drupal to communicate with - * the provider using the OpenID Authentication protocol) the module provides - * URLs used by the various discovery mechanisms. - * - * When a user enters an OpenID identity, the Relying Party (in the testing - * scenario, this is the OpenID module) looks up the URL of the Provider - * Endpoint using one of several discovery mechanisms. The Relying Party then - * redirects the user to Provider Endpoint. The provider verifies the user's - * identity and redirects the user back to the Relying Party accompanied by a - * signed message confirming the identity. Before redirecting to a provider for - * the first time, the Relying Party fetches a secret MAC key from the provider - * by doing a direct "associate" HTTP request to the Provider Endpoint. This - * key is used for verifying the signed messages from the provider. - */ - -/** - * Implementation of hook_menu(). - */ -function openid_test_menu() { - $items['openid-test/yadis/xrds'] = array( - 'title' => 'XRDS service document', - 'page callback' => 'openid_test_yadis_xrds', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['openid-test/yadis/x-xrds-location'] = array( - 'title' => 'Yadis discovery using X-XRDS-Location header', - 'page callback' => 'openid_test_yadis_x_xrds_location', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['openid-test/yadis/http-equiv'] = array( - 'title' => 'Yadis discovery using ', - 'page callback' => 'openid_test_yadis_http_equiv', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['openid-test/html/openid1'] = array( - 'title' => 'HTML-based discovery using ', - 'page callback' => 'openid_test_html_openid1', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['openid-test/html/openid2'] = array( - 'title' => 'HTML-based discovery using ', - 'page callback' => 'openid_test_html_openid2', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['openid-test/endpoint'] = array( - 'title' => 'OpenID Provider Endpoint', - 'page callback' => 'openid_test_endpoint', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Menu callback; XRDS document that references the OP Endpoint URL. */ function openid_test_yadis_xrds() { Index: modules/openid/tests/openid_test.registry.inc =================================================================== RCS file: modules/openid/tests/openid_test.registry.inc diff -N modules/openid/tests/openid_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/openid/tests/openid_test.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,71 @@ + 'XRDS service document', + 'page callback' => 'openid_test_yadis_xrds', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['openid-test/yadis/x-xrds-location'] = array( + 'title' => 'Yadis discovery using X-XRDS-Location header', + 'page callback' => 'openid_test_yadis_x_xrds_location', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['openid-test/yadis/http-equiv'] = array( + 'title' => 'Yadis discovery using ', + 'page callback' => 'openid_test_yadis_http_equiv', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['openid-test/html/openid1'] = array( + 'title' => 'HTML-based discovery using ', + 'page callback' => 'openid_test_html_openid1', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['openid-test/html/openid2'] = array( + 'title' => 'HTML-based discovery using ', + 'page callback' => 'openid_test_html_openid2', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['openid-test/endpoint'] = array( + 'title' => 'OpenID Provider Endpoint', + 'page callback' => 'openid_test_endpoint', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + return $items; +} + Index: modules/path/path.alter.inc =================================================================== RCS file: modules/path/path.alter.inc diff -N modules/path/path.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/path/path.alter.inc 20 May 2009 21:14:44 -0000 @@ -0,0 +1,46 @@ +path) ? $form['#node']->path : NULL; + $form['path'] = array( + '#type' => 'fieldset', + '#title' => t('URL path settings'), + '#collapsible' => TRUE, + '#collapsed' => empty($path), + '#group' => 'additional_settings', + '#attached_js' => array(drupal_get_path('module', 'path') . '/path.js'), + '#access' => user_access('create url aliases'), + '#weight' => 30, + ); + $form['path']['path'] = array( + '#type' => 'textfield', + '#title' => t('URL alias'), + '#default_value' => $path, + '#maxlength' => 128, + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'), + ); + if ($path) { + $form['path']['pid'] = array( + '#type' => 'value', + '#value' => db_query("SELECT pid FROM {url_alias} WHERE dst = :dst AND language = :language", array( + ':dst' => $path, + ':language' => $form['#node']->language + )) + ->fetchField(), + ); + } + } +} + Index: modules/path/path.bootstrap.inc =================================================================== RCS file: modules/path/path.bootstrap.inc diff -N modules/path/path.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/path/path.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,36 @@ +' . t('The path module allows you to specify aliases for Drupal URLs. Such aliases improve readability of URLs for your users and may help internet search engines to index your content more effectively. More than one alias may be created for a given page.') . ''; + $output .= '' . t('Some examples of URL aliases are:') . '
'; + $output .= '' . t('The path module enables appropriately permissioned users to specify an optional alias in all node input and editing forms, and provides an interface to view and edit all URL aliases. The two permissions related to URL aliasing are administer url aliases and create url aliases.') . '
'; + $output .= '' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Path module.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '
'; + return $output; + case 'admin/build/path': + return '' . t("Drupal provides complete control over URLs through aliasing, which is often used to make URLs more readable or easy to remember. For example, the alias 'about' may be mapped onto the post at the system path 'node/1', creating a more meaningful URL. Each system path can have multiple aliases.") . '
'; + case 'admin/build/path/add': + return '' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '
'; + } +} + Index: modules/path/path.info =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.info,v retrieving revision 1.7 diff -u -p -r1.7 path.info --- modules/path/path.info 11 Oct 2008 02:32:54 -0000 1.7 +++ modules/path/path.info 20 May 2009 21:14:44 -0000 @@ -6,3 +6,6 @@ version = VERSION core = 7.x files[] = path.module files[] = path.admin.inc +files[] = path.registry.inc +files[] = path.bootstrap.inc +files[] = path.alter.inc Index: modules/path/path.module =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.module,v retrieving revision 1.157 diff -u -p -r1.157 path.module --- modules/path/path.module 10 May 2009 16:50:19 -0000 1.157 +++ modules/path/path.module 20 May 2009 21:14:44 -0000 @@ -2,72 +2,6 @@ // $Id: path.module,v 1.157 2009/05/10 16:50:19 dries Exp $ /** - * @file - * Enables users to rename URLs. - */ - -/** - * Implementation of hook_help(). - */ -function path_help($path, $arg) { - switch ($path) { - case 'admin/help#path': - $output = '' . t('The path module allows you to specify aliases for Drupal URLs. Such aliases improve readability of URLs for your users and may help internet search engines to index your content more effectively. More than one alias may be created for a given page.') . '
'; - $output .= '' . t('Some examples of URL aliases are:') . '
'; - $output .= '' . t('The path module enables appropriately permissioned users to specify an optional alias in all node input and editing forms, and provides an interface to view and edit all URL aliases. The two permissions related to URL aliasing are administer url aliases and create url aliases.') . '
'; - $output .= '' . t('This module also provides user-defined mass URL aliasing capabilities, which is useful if you wish to uniformly use URLs different from the default. For example, you may want to have your URLs presented in a different language. Access to the Drupal source code on the web server is required to set up mass URL aliasing.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Path module.', array('@path' => 'http://drupal.org/handbook/modules/path/')) . '
'; - return $output; - case 'admin/build/path': - return '' . t("Drupal provides complete control over URLs through aliasing, which is often used to make URLs more readable or easy to remember. For example, the alias 'about' may be mapped onto the post at the system path 'node/1', creating a more meaningful URL. Each system path can have multiple aliases.") . '
'; - case 'admin/build/path/add': - return '' . t('Enter the path you wish to create the alias for, followed by the name of the new alias.') . '
'; - } -} - -/** - * Implementation of hook_menu(). - */ -function path_menu() { - $items['admin/build/path'] = array( - 'title' => 'URL aliases', - 'description' => "Change your site's URL paths by aliasing them.", - 'page callback' => 'path_admin_overview', - 'access arguments' => array('administer url aliases'), - ); - $items['admin/build/path/edit'] = array( - 'title' => 'Edit alias', - 'page callback' => 'path_admin_edit', - 'access arguments' => array('administer url aliases'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/path/delete'] = array( - 'title' => 'Delete alias', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('path_admin_delete_confirm'), - 'access arguments' => array('administer url aliases'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/path/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/build/path/add'] = array( - 'title' => 'Add alias', - 'page callback' => 'path_admin_edit', - 'access arguments' => array('administer url aliases'), - 'type' => MENU_LOCAL_TASK, - ); - - return $items; -} - -/** * Post-confirmation; delete an URL alias. */ function path_admin_delete($pid = 0) { @@ -218,44 +152,6 @@ function path_node_delete($node) { } /** - * Implementation of hook_form_alter(). - */ -function path_form_alter(&$form, $form_state, $form_id) { - if (!empty($form['#node_edit_form'])) { - $path = isset($form['#node']->path) ? $form['#node']->path : NULL; - $form['path'] = array( - '#type' => 'fieldset', - '#title' => t('URL path settings'), - '#collapsible' => TRUE, - '#collapsed' => empty($path), - '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'path') . '/path.js'), - '#access' => user_access('create url aliases'), - '#weight' => 30, - ); - $form['path']['path'] = array( - '#type' => 'textfield', - '#title' => t('URL alias'), - '#default_value' => $path, - '#maxlength' => 128, - '#collapsible' => TRUE, - '#collapsed' => TRUE, - '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'), - ); - if ($path) { - $form['path']['pid'] = array( - '#type' => 'value', - '#value' => db_query("SELECT pid FROM {url_alias} WHERE dst = :dst AND language = :language", array( - ':dst' => $path, - ':language' => $form['#node']->language - )) - ->fetchField(), - ); - } - } -} - -/** * Implementation of hook_perm(). */ function path_perm() { Index: modules/path/path.registry.inc =================================================================== RCS file: modules/path/path.registry.inc diff -N modules/path/path.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/path/path.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,46 @@ + 'URL aliases', + 'description' => "Change your site's URL paths by aliasing them.", + 'page callback' => 'path_admin_overview', + 'access arguments' => array('administer url aliases'), + ); + $items['admin/build/path/edit'] = array( + 'title' => 'Edit alias', + 'page callback' => 'path_admin_edit', + 'access arguments' => array('administer url aliases'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/path/delete'] = array( + 'title' => 'Delete alias', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('path_admin_delete_confirm'), + 'access arguments' => array('administer url aliases'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/path/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/build/path/add'] = array( + 'title' => 'Add alias', + 'page callback' => 'path_admin_edit', + 'access arguments' => array('administer url aliases'), + 'type' => MENU_LOCAL_TASK, + ); + + return $items; +} + Index: modules/php/php.bootstrap.inc =================================================================== RCS file: modules/php/php.bootstrap.inc diff -N modules/php/php.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/php/php.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,28 @@ +' . t('The PHP filter adds the ability to include PHP code in posts. PHP is a general-purpose scripting language widely-used for web development; the content management system used by this website has been developed using PHP.') . ''; + $output .= '' . t('Through the PHP filter, users with the proper permission may include custom PHP code within a page of the site. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use.') . '
'; + $output .= '' . t('Drupal.org offers some example PHP snippets, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for PHP module.', array('@php' => 'http://drupal.org/handbook/modules/php/')) . '
'; + return $output; + } +} + Index: modules/php/php.info =================================================================== RCS file: /cvs/drupal/drupal/modules/php/php.info,v retrieving revision 1.6 diff -u -p -r1.6 php.info --- modules/php/php.info 11 Oct 2008 02:32:56 -0000 1.6 +++ modules/php/php.info 20 May 2009 18:49:53 -0000 @@ -6,3 +6,5 @@ version = VERSION core = 7.x files[] = php.module files[] = php.install +files[] = php.registry.inc +files[] = php.bootstrap.inc Index: modules/php/php.module =================================================================== RCS file: /cvs/drupal/drupal/modules/php/php.module,v retrieving revision 1.13 diff -u -p -r1.13 php.module --- modules/php/php.module 7 May 2009 15:29:08 -0000 1.13 +++ modules/php/php.module 20 May 2009 18:49:53 -0000 @@ -2,26 +2,6 @@ // $Id: php.module,v 1.13 2009/05/07 15:29:08 webchick Exp $ /** - * @file - * Additional filter for PHP input. - */ - - -/** - * Implementation of hook_help(). - */ -function php_help($path, $arg) { - switch ($path) { - case 'admin/help#php': - $output = '' . t('The PHP filter adds the ability to include PHP code in posts. PHP is a general-purpose scripting language widely-used for web development; the content management system used by this website has been developed using PHP.') . '
'; - $output .= '' . t('Through the PHP filter, users with the proper permission may include custom PHP code within a page of the site. While this is a powerful and flexible feature if used by a trusted user with PHP experience, it is a significant and dangerous security risk in the hands of a malicious user. Even a trusted user may accidentally compromise the site by entering malformed or incorrect PHP code. Only the most trusted users should be granted permission to use the PHP filter, and all PHP code added through the PHP filter should be carefully examined before use.') . '
'; - $output .= '' . t('Drupal.org offers some example PHP snippets, or you can create your own with some PHP experience and knowledge of the Drupal system.', array('@drupal' => url('http://drupal.org'), '@php-snippets' => url('http://drupal.org/handbook/customization/php-snippets'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for PHP module.', array('@php' => 'http://drupal.org/handbook/modules/php/')) . '
'; - return $output; - } -} - -/** * Implementation of hook_perm(). */ function php_perm() { Index: modules/poll/poll.bootstrap.inc =================================================================== RCS file: modules/poll/poll.bootstrap.inc diff -N modules/poll/poll.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/poll/poll.bootstrap.inc 20 May 2009 21:31:56 -0000 @@ -0,0 +1,49 @@ +' . t('The poll module can be used to create simple polls for site users. A poll is a simple, multiple choice questionnaire which displays the cumulative results of the answers to the poll. Having polls on the site is a good way to receive feedback from community members.') . ''; + $output .= '' . t('When creating a poll, enter the question being posed, as well as the potential choices (and beginning vote counts for each choice). The status and duration (length of time the poll remains active for new votes) can also be specified. Use the poll menu item to view all current polls. To vote in or view the results of a specific poll, click on the poll itself.', array('@poll' => url('poll'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Poll module.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) . '
'; + return $output; + } +} + +/** + * Implementation of hook_node_info(). + */ +function poll_node_info() { + return array( + 'poll' => array( + 'name' => t('Poll'), + 'base' => 'poll', + 'description' => t('A poll is a question with a set of possible responses. A poll, once created, automatically provides a simple running count of the number of votes received for each response.'), + 'title_label' => t('Question'), + 'has_body' => FALSE, + ) + ); +} + Index: modules/poll/poll.info =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.info,v retrieving revision 1.8 diff -u -p -r1.8 poll.info --- modules/poll/poll.info 11 Oct 2008 02:32:57 -0000 1.8 +++ modules/poll/poll.info 20 May 2009 18:49:53 -0000 @@ -7,3 +7,5 @@ core = 7.x files[] = poll.module files[] = poll.pages.inc files[] = poll.install +files[] = poll.registry.inc +files[] = poll.bootstrap.inc Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.294 diff -u -p -r1.294 poll.module --- modules/poll/poll.module 12 May 2009 08:37:45 -0000 1.294 +++ modules/poll/poll.module 20 May 2009 21:31:56 -0000 @@ -2,55 +2,6 @@ // $Id: poll.module,v 1.294 2009/05/12 08:37:45 dries Exp $ /** - * @file - * Enables your site to capture votes on different topics in the form of multiple - * choice questions. - */ - -/** - * Implementation of hook_help(). - */ -function poll_help($path, $arg) { - switch ($path) { - case 'admin/help#poll': - $output = '' . t('The poll module can be used to create simple polls for site users. A poll is a simple, multiple choice questionnaire which displays the cumulative results of the answers to the poll. Having polls on the site is a good way to receive feedback from community members.') . '
'; - $output .= '' . t('When creating a poll, enter the question being posed, as well as the potential choices (and beginning vote counts for each choice). The status and duration (length of time the poll remains active for new votes) can also be specified. Use the poll menu item to view all current polls. To vote in or view the results of a specific poll, click on the poll itself.', array('@poll' => url('poll'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Poll module.', array('@poll' => 'http://drupal.org/handbook/modules/poll/')) . '
'; - return $output; - } -} - -/** - * Implementation of hook_init(). - */ -function poll_init() { - drupal_add_css(drupal_get_path('module', 'poll') . '/poll.css'); -} - -/** - * Implementation of hook_theme(). - */ -function poll_theme() { - return array( - 'poll_vote' => array( - 'template' => 'poll-vote', - 'arguments' => array('form' => NULL), - ), - 'poll_choices' => array( - 'arguments' => array('form' => NULL), - ), - 'poll_results' => array( - 'template' => 'poll-results', - 'arguments' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL), - ), - 'poll_bar' => array( - 'template' => 'poll-bar', - 'arguments' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), - ), - ); -} - -/** * Implementation of hook_perm(). */ function poll_perm() { @@ -88,40 +39,6 @@ function poll_access($op, $node, $accoun } /** - * Implementation of hook_menu(). - */ -function poll_menu() { - $items['poll'] = array( - 'title' => 'Polls', - 'page callback' => 'poll_page', - 'access arguments' => array('access content'), - 'type' => MENU_SUGGESTED_ITEM, - ); - - $items['node/%node/votes'] = array( - 'title' => 'Votes', - 'page callback' => 'poll_votes', - 'page arguments' => array(1), - 'access callback' => '_poll_menu_access', - 'access arguments' => array(1, 'inspect all votes', FALSE), - 'weight' => 3, - 'type' => MENU_LOCAL_TASK, - ); - - $items['node/%node/results'] = array( - 'title' => 'Results', - 'page callback' => 'poll_results', - 'page arguments' => array(1), - 'access callback' => '_poll_menu_access', - 'access arguments' => array(1, 'access content', TRUE), - 'weight' => 3, - 'type' => MENU_LOCAL_TASK, - ); - - return $items; -} - -/** * Callback function to see if a node is acceptable for poll menu items. */ function _poll_menu_access($node, $perm, $inspect_allowvotes) { @@ -184,21 +101,6 @@ function poll_cron() { } /** - * Implementation of hook_node_info(). - */ -function poll_node_info() { - return array( - 'poll' => array( - 'name' => t('Poll'), - 'base' => 'poll', - 'description' => t('A poll is a question with a set of possible responses. A poll, once created, automatically provides a simple running count of the number of votes received for each response.'), - 'title_label' => t('Question'), - 'has_body' => FALSE, - ) - ); -} - -/** * Implementation of hook_form(). */ function poll_form($node, $form_state) { Index: modules/poll/poll.registry.inc =================================================================== RCS file: modules/poll/poll.registry.inc diff -N modules/poll/poll.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/poll/poll.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,65 @@ + 'Polls', + 'page callback' => 'poll_page', + 'access arguments' => array('access content'), + 'type' => MENU_SUGGESTED_ITEM, + ); + + $items['node/%node/votes'] = array( + 'title' => 'Votes', + 'page callback' => 'poll_votes', + 'page arguments' => array(1), + 'access callback' => '_poll_menu_access', + 'access arguments' => array(1, 'inspect all votes', FALSE), + 'weight' => 3, + 'type' => MENU_LOCAL_TASK, + ); + + $items['node/%node/results'] = array( + 'title' => 'Results', + 'page callback' => 'poll_results', + 'page arguments' => array(1), + 'access callback' => '_poll_menu_access', + 'access arguments' => array(1, 'access content', TRUE), + 'weight' => 3, + 'type' => MENU_LOCAL_TASK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function poll_theme() { + return array( + 'poll_vote' => array( + 'template' => 'poll-vote', + 'arguments' => array('form' => NULL), + ), + 'poll_choices' => array( + 'arguments' => array('form' => NULL), + ), + 'poll_results' => array( + 'template' => 'poll-results', + 'arguments' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL), + ), + 'poll_bar' => array( + 'template' => 'poll-bar', + 'arguments' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), + ), + ); +} + Index: modules/profile/profile.bootstrap.inc =================================================================== RCS file: modules/profile/profile.bootstrap.inc diff -N modules/profile/profile.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/profile/profile.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,55 @@ +' . t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the My Account section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') . ''; + $output .= '' . t('The following types of fields can be added to a user profile:') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Profile module.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) . '
'; + return $output; + case 'admin/user/profile': + return '' . t("This page displays a list of the existing custom profile fields to be displayed on a user's My Account page. To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name. To change the category of a field or the order of fields within a category, grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.") . '
'; + } +} + Index: modules/profile/profile.info =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.info,v retrieving revision 1.8 diff -u -p -r1.8 profile.info --- modules/profile/profile.info 11 Oct 2008 02:32:59 -0000 1.8 +++ modules/profile/profile.info 20 May 2009 18:49:53 -0000 @@ -8,3 +8,5 @@ files[] = profile.module files[] = profile.admin.inc files[] = profile.pages.inc files[] = profile.install +files[] = profile.registry.inc +files[] = profile.bootstrap.inc Index: modules/profile/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v retrieving revision 1.254 diff -u -p -r1.254 profile.module --- modules/profile/profile.module 16 May 2009 15:23:16 -0000 1.254 +++ modules/profile/profile.module 20 May 2009 18:49:53 -0000 @@ -2,129 +2,6 @@ // $Id: profile.module,v 1.254 2009/05/16 15:23:16 webchick Exp $ /** - * @file - * Support for configurable user profiles. - */ - -/** - * Private field, content only available to privileged users. - */ -define('PROFILE_PRIVATE', 1); - -/** - * Public field, content shown on profile page but not used on member list pages. - */ -define('PROFILE_PUBLIC', 2); - -/** - * Public field, content shown on profile page and on member list pages. - */ -define('PROFILE_PUBLIC_LISTINGS', 3); - -/** - * Hidden profile field, only accessible by administrators, modules and themes. - */ -define('PROFILE_HIDDEN', 4); - -/** - * Implementation of hook_help(). - */ -function profile_help($path, $arg) { - switch ($path) { - case 'admin/help#profile': - $output = '' . t('The profile module allows custom fields (such as country, full name, or age) to be defined and displayed in the My Account section. This permits users of a site to share more information about themselves, and can help community-based sites organize users around specific information.') . '
'; - $output .= '' . t('The following types of fields can be added to a user profile:') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Profile module.', array('@profile' => 'http://drupal.org/handbook/modules/profile/')) . '
'; - return $output; - case 'admin/user/profile': - return '' . t("This page displays a list of the existing custom profile fields to be displayed on a user's My Account page. To provide structure, similar or related fields may be placed inside a category. To add a new category (or edit an existing one), edit a profile field and provide a new category name. To change the category of a field or the order of fields within a category, grab a drag-and-drop handle under the Title column and drag the field to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save configuration button at the bottom of the page.") . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function profile_theme() { - return array( - 'profile_block' => array( - 'arguments' => array('account' => NULL, 'fields' => array()), - 'template' => 'profile-block', - ), - 'profile_listing' => array( - 'arguments' => array('account' => NULL, 'fields' => array()), - 'template' => 'profile-listing', - ), - 'profile_wrapper' => array( - 'arguments' => array('content' => NULL), - 'template' => 'profile-wrapper', - ), - 'profile_admin_overview' => array( - 'arguments' => array('form' => NULL), - ) - ); -} - -/** - * Implementation of hook_menu(). - */ -function profile_menu() { - $items['profile'] = array( - 'title' => 'User list', - 'page callback' => 'profile_browse', - 'access arguments' => array('access user profiles'), - 'type' => MENU_SUGGESTED_ITEM, - ); - $items['admin/user/profile'] = array( - 'title' => 'Profiles', - 'description' => 'Create customizable fields for your users.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('profile_admin_overview'), - 'access arguments' => array('administer users'), - ); - $items['admin/user/profile/add'] = array( - 'title' => 'Add field', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('profile_field_form'), - 'access arguments' => array('administer users'), - 'type' => MENU_CALLBACK, - ); - $items['admin/user/profile/autocomplete'] = array( - 'title' => 'Profile category autocomplete', - 'page callback' => 'profile_admin_settings_autocomplete', - 'access arguments' => array('administer users'), - 'type' => MENU_CALLBACK, - ); - $items['admin/user/profile/edit'] = array( - 'title' => 'Edit field', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('profile_field_form'), - 'access arguments' => array('administer users'), - 'type' => MENU_CALLBACK, - ); - $items['admin/user/profile/delete'] = array( - 'title' => 'Delete field', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('profile_field_delete'), - 'access arguments' => array('administer users'), - 'type' => MENU_CALLBACK, - ); - $items['profile/autocomplete'] = array( - 'title' => 'Profile autocomplete', - 'page callback' => 'profile_autocomplete', - 'access arguments' => array('access user profiles'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Implementation of hook_block_list(). */ function profile_block_list() { Index: modules/profile/profile.registry.inc =================================================================== RCS file: modules/profile/profile.registry.inc diff -N modules/profile/profile.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/profile/profile.registry.inc 20 May 2009 17:28:58 -0000 @@ -0,0 +1,84 @@ + 'User list', + 'page callback' => 'profile_browse', + 'access arguments' => array('access user profiles'), + 'type' => MENU_SUGGESTED_ITEM, + ); + $items['admin/user/profile'] = array( + 'title' => 'Profiles', + 'description' => 'Create customizable fields for your users.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('profile_admin_overview'), + 'access arguments' => array('administer users'), + ); + $items['admin/user/profile/add'] = array( + 'title' => 'Add field', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('profile_field_form'), + 'access arguments' => array('administer users'), + 'type' => MENU_CALLBACK, + ); + $items['admin/user/profile/autocomplete'] = array( + 'title' => 'Profile category autocomplete', + 'page callback' => 'profile_admin_settings_autocomplete', + 'access arguments' => array('administer users'), + 'type' => MENU_CALLBACK, + ); + $items['admin/user/profile/edit'] = array( + 'title' => 'Edit field', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('profile_field_form'), + 'access arguments' => array('administer users'), + 'type' => MENU_CALLBACK, + ); + $items['admin/user/profile/delete'] = array( + 'title' => 'Delete field', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('profile_field_delete'), + 'access arguments' => array('administer users'), + 'type' => MENU_CALLBACK, + ); + $items['profile/autocomplete'] = array( + 'title' => 'Profile autocomplete', + 'page callback' => 'profile_autocomplete', + 'access arguments' => array('access user profiles'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function profile_theme() { + return array( + 'profile_block' => array( + 'arguments' => array('account' => NULL, 'fields' => array()), + 'template' => 'profile-block', + ), + 'profile_listing' => array( + 'arguments' => array('account' => NULL, 'fields' => array()), + 'template' => 'profile-listing', + ), + 'profile_wrapper' => array( + 'arguments' => array('content' => NULL), + 'template' => 'profile-wrapper', + ), + 'profile_admin_overview' => array( + 'arguments' => array('form' => NULL), + ) + ); +} + Index: modules/search/search.bootstrap.inc =================================================================== RCS file: modules/search/search.bootstrap.inc diff -N modules/search/search.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/search/search.bootstrap.inc 20 May 2009 18:49:53 -0000 @@ -0,0 +1,118 @@ +' . t('The search module adds the ability to search for content by keywords. Search is often the only practical way to find content on a large site, and is useful for finding both users and posts.') . ''; + $output .= '' . t('To provide keyword searching, the search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the search settings page; for example, the Number of items to index per cron run sets the maximum number of items indexed in each pass of a cron maintenance task. If necessary, reduce this number to prevent timeouts and memory errors when indexing.', array('@cron' => url('admin/reports/status'), '@searchsettings' => url('admin/settings/search'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Search module.', array('@search' => 'http://drupal.org/handbook/modules/search/')) . '
'; + return $output; + case 'admin/settings/search': + return '' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '
'; + case 'search#noresults': + return t('' . t('The search module adds the ability to search for content by keywords. Search is often the only practical way to find content on a large site, and is useful for finding both users and posts.') . '
'; - $output .= '' . t('To provide keyword searching, the search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the search settings page; for example, the Number of items to index per cron run sets the maximum number of items indexed in each pass of a cron maintenance task. If necessary, reduce this number to prevent timeouts and memory errors when indexing.', array('@cron' => url('admin/reports/status'), '@searchsettings' => url('admin/settings/search'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Search module.', array('@search' => 'http://drupal.org/handbook/modules/search/')) . '
'; - return $output; - case 'admin/settings/search': - return '' . t('The search engine maintains an index of words found in your site\'s content. To build and maintain this index, a correctly configured cron maintenance task is required. Indexing behavior can be adjusted using the settings below.', array('@cron' => url('admin/reports/status'))) . '
'; - case 'search#noresults': - return t('' . t('Visit Administer >> Site building >> SimpleTest to display a list of available tests. For comprehensive testing, select all tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.)', array('@admin-simpletest' => url('admin/development/testing'))) .'
'; + $output .= '' . t('After the tests have run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that a test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were fails or exceptions, the results are expanded, and the tests that had issues will be indicated in red or pink rows. Use these results to refine your code and tests until all tests return a pass.') .'
'; + $output .= '' . t('For more information on creating and modifying your own tests, see the SimpleTest API Documentation in the Drupal handbook.', array('@simpletest-api' => 'http://drupal.org/simpletest')) .'
'; + $output .= '' . t('For more information, see the online handbook entry for SimpleTest module.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest')) .'
'; + return $output; + } +} + Index: modules/simpletest/simpletest.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.info,v retrieving revision 1.5 diff -u -p -r1.5 simpletest.info --- modules/simpletest/simpletest.info 1 May 2009 11:01:53 -0000 1.5 +++ modules/simpletest/simpletest.info 20 May 2009 21:14:44 -0000 @@ -7,3 +7,6 @@ core = 7.x files[] = simpletest.module files[] = simpletest.pages.inc files[] = simpletest.install +files[] = simpletest.registry.inc +files[] = simpletest.bootstrap.inc +files[] = simpletest.alter.inc Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.44 diff -u -p -r1.44 simpletest.module --- modules/simpletest/simpletest.module 17 May 2009 10:49:40 -0000 1.44 +++ modules/simpletest/simpletest.module 20 May 2009 21:14:44 -0000 @@ -7,51 +7,6 @@ */ /** - * Implementation of hook_help(). - */ -function simpletest_help($path, $arg) { - switch ($path) { - case 'admin/help#simpletest': - $output = '' . t('The SimpleTest module is a framework for running automated unit tests in Drupal. It can be used to verify a working state of Drupal before and after any code changes, or as a means for developers to write and execute tests for their modules.') .'
'; - $output .= '' . t('Visit Administer >> Site building >> SimpleTest to display a list of available tests. For comprehensive testing, select all tests, or individually select tests for more targeted testing. Note that it might take several minutes for all tests to complete.)', array('@admin-simpletest' => url('admin/development/testing'))) .'
'; - $output .= '' . t('After the tests have run, a message will be displayed next to each test group indicating whether tests within it passed, failed, or had exceptions. A pass means that a test returned the expected results, while fail means that it did not. An exception normally indicates an error outside of the test, such as a PHP warning or notice. If there were fails or exceptions, the results are expanded, and the tests that had issues will be indicated in red or pink rows. Use these results to refine your code and tests until all tests return a pass.') .'
'; - $output .= '' . t('For more information on creating and modifying your own tests, see the SimpleTest API Documentation in the Drupal handbook.', array('@simpletest-api' => 'http://drupal.org/simpletest')) .'
'; - $output .= '' . t('For more information, see the online handbook entry for SimpleTest module.', array('@simpletest' => 'http://drupal.org/handbook/modules/simpletest')) .'
'; - return $output; - } -} - -/** - * Implementation of hook_menu(). - */ -function simpletest_menu() { - $items['admin/development'] = array( - 'title' => 'Development', - 'description' => 'Development tools.', - 'position' => 'right', - 'weight' => -7, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - ); - $items['admin/development/testing'] = array( - 'title' => 'Testing', - 'page callback' => 'drupal_get_form', - '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'), - ); - $items['admin/development/testing/results/%'] = array( - 'title' => 'Test result', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('simpletest_result_form', 4), - 'description' => 'View result of tests.', - 'access arguments' => array('administer unit tests'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Implementation of hook_perm(). */ function simpletest_perm() { @@ -63,32 +18,6 @@ function simpletest_perm() { ); } -/** - * Implementation of hook_theme(). - */ -function simpletest_theme() { - return array( - 'simpletest_test_table' => array( - 'arguments' => array('table' => NULL), - ), - 'simpletest_result_summary' => array( - 'arguments' => array('form' => NULL), - ), - ); -} - -/** - * Implementation of hook_js_alter(). - */ -function simpletest_js_alter(&$javascript) { - // Since SimpleTest is a special use case for the table select, stick the - // SimpleTest JavaScript above the table select. - $simpletest = drupal_get_path('module', 'simpletest') . '/simpletest.js'; - if (array_key_exists($simpletest, $javascript) && array_key_exists('misc/tableselect.js', $javascript)) { - $javascript[$simpletest]['weight'] = $javascript['misc/tableselect.js']['weight'] - 1; - } -} - function _simpletest_format_summary_line($summary) { return t('@pass, @fail, and @exception', array( '@pass' => format_plural(isset($summary['#pass']) ? $summary['#pass'] : 0, '1 pass', '@count passes'), Index: modules/simpletest/simpletest.registry.inc =================================================================== RCS file: modules/simpletest/simpletest.registry.inc diff -N modules/simpletest/simpletest.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/simpletest.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,52 @@ + 'Development', + 'description' => 'Development tools.', + 'position' => 'right', + 'weight' => -7, + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + ); + $items['admin/development/testing'] = array( + 'title' => 'Testing', + 'page callback' => 'drupal_get_form', + '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'), + ); + $items['admin/development/testing/results/%'] = array( + 'title' => 'Test result', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('simpletest_result_form', 4), + 'description' => 'View result of tests.', + 'access arguments' => array('administer unit tests'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function simpletest_theme() { + return array( + 'simpletest_test_table' => array( + 'arguments' => array('table' => NULL), + ), + 'simpletest_result_summary' => array( + 'arguments' => array('form' => NULL), + ), + ); +} + Index: modules/simpletest/tests/database_test.alter.inc =================================================================== RCS file: modules/simpletest/tests/database_test.alter.inc diff -N modules/simpletest/tests/database_test.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/database_test.alter.inc 20 May 2009 21:14:44 -0000 @@ -0,0 +1,40 @@ +hasTag('database_test_alter_add_range')) { + $query->range(0, 2); + } + + if ($query->hasTag('database_test_alter_add_join')) { + $people_alias = $query->join('test', 'people', "test_task.pid=people.id"); + $name_field = $query->addField('people', 'name', 'name'); + $query->condition($people_alias . '.id', 2); + } + + if ($query->hasTag('database_test_alter_change_conditional')) { + $conditions =& $query->conditions(); + $conditions[0]['value'] = 2; + } + + if ($query->hasTag('database_test_alter_change_fields')) { + $fields =& $query->getFields(); + unset($fields['age']); + } + + if ($query->hasTag('database_test_alter_change_expressions')) { + $expressions =& $query->getExpressions(); + $expressions['double_age']['expression'] = 'age*3'; + } +} + + Index: modules/simpletest/tests/database_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.info,v retrieving revision 1.2 diff -u -p -r1.2 database_test.info --- modules/simpletest/tests/database_test.info 9 Oct 2008 22:51:40 -0000 1.2 +++ modules/simpletest/tests/database_test.info 20 May 2009 21:14:44 -0000 @@ -7,3 +7,5 @@ files[] = database_test.module files[] = database_test.install version = VERSION hidden = TRUE +files[] = database_test.registry.inc +files[] = database_test.alter.inc Index: modules/simpletest/tests/database_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.module,v retrieving revision 1.7 diff -u -p -r1.7 database_test.module --- modules/simpletest/tests/database_test.module 22 Feb 2009 16:53:41 -0000 1.7 +++ modules/simpletest/tests/database_test.module 20 May 2009 21:14:44 -0000 @@ -2,38 +2,6 @@ // $Id: database_test.module,v 1.7 2009/02/22 16:53:41 dries Exp $ /** - * Implementation of hook_query_alter(). - */ -function database_test_query_alter(QueryAlterableInterface $query) { - - if ($query->hasTag('database_test_alter_add_range')) { - $query->range(0, 2); - } - - if ($query->hasTag('database_test_alter_add_join')) { - $people_alias = $query->join('test', 'people', "test_task.pid=people.id"); - $name_field = $query->addField('people', 'name', 'name'); - $query->condition($people_alias . '.id', 2); - } - - if ($query->hasTag('database_test_alter_change_conditional')) { - $conditions =& $query->conditions(); - $conditions[0]['value'] = 2; - } - - if ($query->hasTag('database_test_alter_change_fields')) { - $fields =& $query->getFields(); - unset($fields['age']); - } - - if ($query->hasTag('database_test_alter_change_expressions')) { - $expressions =& $query->getExpressions(); - $expressions['double_age']['expression'] = 'age*3'; - } -} - - -/** * Implementation of hook_query_TAG_alter(). Called by DatabaseTestCase::testAlterRemoveRange. */ function database_test_query_database_test_alter_remove_range_alter(QueryAlterableInterface $query) { @@ -41,30 +9,6 @@ function database_test_query_database_te } /** - * Implementation of hook_menu(). - */ -function database_test_menu() { - $items['database_test/db_query_temporary'] = array( - 'access callback' => TRUE, - 'page callback' => 'database_test_db_query_temporary', - ); - $items['database_test/pager_query_even'] = array( - 'access callback' => TRUE, - 'page callback' => 'database_test_even_pager_query', - ); - $items['database_test/pager_query_odd'] = array( - 'access callback' => TRUE, - 'page callback' => 'database_test_odd_pager_query', - ); - $items['database_test/tablesort'] = array( - 'access callback' => TRUE, - 'page callback' => 'database_test_tablesort', - ); - - return $items; -} - -/** * Run a db_query_temporary and output the table name and its number of rows. * * We need to test that the table created is temporary, so we run it here, in a Index: modules/simpletest/tests/database_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/database_test.registry.inc diff -N modules/simpletest/tests/database_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/database_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,32 @@ + TRUE, + 'page callback' => 'database_test_db_query_temporary', + ); + $items['database_test/pager_query_even'] = array( + 'access callback' => TRUE, + 'page callback' => 'database_test_even_pager_query', + ); + $items['database_test/pager_query_odd'] = array( + 'access callback' => TRUE, + 'page callback' => 'database_test_odd_pager_query', + ); + $items['database_test/tablesort'] = array( + 'access callback' => TRUE, + 'page callback' => 'database_test_tablesort', + ); + + return $items; +} + Index: modules/simpletest/tests/field_test.bootstrap.inc =================================================================== RCS file: modules/simpletest/tests/field_test.bootstrap.inc diff -N modules/simpletest/tests/field_test.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/field_test.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,69 @@ + 'Test Bundle')); + return array( + 'test_entity' => array( + 'name' => t('Test Entity'), + 'id key' => 'ftid', + 'revision key' => 'ftvid', + 'cacheable' => FALSE, + 'bundle key' => 'fttype', + 'bundles' => $bundles, + ), + // This entity type doesn't get form handling for now... + 'test_cacheable_entity' => array( + 'name' => t('Test Entity, cacheable'), + 'id key' => 'ftid', + 'revision key' => 'ftvid', + 'cacheable' => TRUE, + 'bundle key' => 'fttype', + 'bundles' => $bundles, + ), + ); +} + +/** + * + * 'Field type' API. + * + */ + +/** + * Implementation of hook_field_info(). + * + * This field provides a textfield which only accepts the value 1. + */ +function field_test_field_info() { + return array( + 'test_field' => array( + 'label' => t('Test Field'), + 'settings' => array( + 'test_field_setting' => 'dummy test string', + ), + 'instance_settings' => array( + 'test_instance_setting' => 'dummy test string', + 'test_hook_field_load' => FALSE, + ), + 'default_widget' => 'test_field_widget', + 'default_formatter' => 'field_test_default', + ), + ); +} + Index: modules/simpletest/tests/field_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.info,v retrieving revision 1.2 diff -u -p -r1.2 field_test.info --- modules/simpletest/tests/field_test.info 8 Feb 2009 21:22:59 -0000 1.2 +++ modules/simpletest/tests/field_test.info 20 May 2009 21:31:56 -0000 @@ -7,3 +7,5 @@ files[] = field_test.module files[] = field_test.install version = VERSION hidden = TRUE +files[] = field_test.registry.inc +files[] = field_test.bootstrap.inc Index: modules/simpletest/tests/field_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v retrieving revision 1.8 diff -u -p -r1.8 field_test.module --- modules/simpletest/tests/field_test.module 20 May 2009 09:48:47 -0000 1.8 +++ modules/simpletest/tests/field_test.module 20 May 2009 21:33:54 -0000 @@ -22,68 +22,6 @@ function field_test_perm() { } /** - * Implementation of hook_menu(). - */ -function field_test_menu() { - $items = array(); - $info = field_test_fieldable_info(); - - foreach (array_keys($info['test_entity']['bundles']) as $bundle) { - $bundle_url_str = str_replace('_', '-', $bundle); - $items['test-entity/add/' . $bundle_url_str] = array( - 'title' => "Add $bundle test_entity", - 'page callback' => 'field_test_entity_add', - 'page arguments' => array(2), - 'access arguments' => array('administer field_test content'), - 'type' => MENU_NORMAL_ITEM, - ); - } - $items['test-entity/%field_test_entity/edit'] = array( - 'title' => 'Edit test entity', - 'page callback' => 'field_test_entity_edit', - 'page arguments' => array(1), - 'access arguments' => array('administer field_test content'), - 'type' => MENU_NORMAL_ITEM, - ); - - return $items; -} - - -/** - * - * 'Field attach' API. - * - */ - - -/** - * Define a test fieldable entity. - */ -function field_test_fieldable_info() { - $bundles = variable_get('field_test_bundles', array('test_bundle' => 'Test Bundle')); - return array( - 'test_entity' => array( - 'name' => t('Test Entity'), - 'id key' => 'ftid', - 'revision key' => 'ftvid', - 'cacheable' => FALSE, - 'bundle key' => 'fttype', - 'bundles' => $bundles, - ), - // This entity type doesn't get form handling for now... - 'test_cacheable_entity' => array( - 'name' => t('Test Entity, cacheable'), - 'id key' => 'ftid', - 'revision key' => 'ftvid', - 'cacheable' => TRUE, - 'bundle key' => 'fttype', - 'bundles' => $bundles, - ), - ); -} - -/** * Create a new bundle for test_entity objects. * * @param $bundle @@ -320,34 +258,6 @@ function field_test_entity_form_submit_b } /** - * - * 'Field type' API. - * - */ - -/** - * Implementation of hook_field_info(). - * - * This field provides a textfield which only accepts the value 1. - */ -function field_test_field_info() { - return array( - 'test_field' => array( - 'label' => t('Test Field'), - 'settings' => array( - 'test_field_setting' => 'dummy test string', - ), - 'instance_settings' => array( - 'test_instance_setting' => 'dummy test string', - 'test_hook_field_load' => FALSE, - ), - 'default_widget' => 'test_field_widget', - 'default_formatter' => 'field_test_default', - ), - ); -} - -/** * Implementation of hook_field_schema(). */ function field_test_field_schema($field) { @@ -532,20 +442,6 @@ function field_test_field_load($obj_type } /** - * Implementation of hook_theme(). - */ -function field_test_theme() { - return array( - 'field_formatter_field_test_default' => array( - 'arguments' => array('element' => NULL), - ), - 'field_formatter_field_test_multiple' => array( - 'arguments' => array('element' => NULL), - ), - ); -} - -/** * Theme function for 'field_test_default' formatter. */ function theme_field_formatter_field_test_default($element) { Index: modules/simpletest/tests/field_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/field_test.registry.inc diff -N modules/simpletest/tests/field_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/field_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,51 @@ + "Add $bundle test_entity", + 'page callback' => 'field_test_entity_add', + 'page arguments' => array(2), + 'access arguments' => array('administer field_test content'), + 'type' => MENU_NORMAL_ITEM, + ); + } + $items['test-entity/%field_test_entity/edit'] = array( + 'title' => 'Edit test entity', + 'page callback' => 'field_test_entity_edit', + 'page arguments' => array(1), + 'access arguments' => array('administer field_test content'), + 'type' => MENU_NORMAL_ITEM, + ); + + return $items; +} + + +/** + * Implementation of hook_theme(). + */ +function field_test_theme() { + return array( + 'field_formatter_field_test_default' => array( + 'arguments' => array('element' => NULL), + ), + 'field_formatter_field_test_multiple' => array( + 'arguments' => array('element' => NULL), + ), + ); +} + Index: modules/simpletest/tests/file_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file_test.info,v retrieving revision 1.1 diff -u -p -r1.1 file_test.info --- modules/simpletest/tests/file_test.info 20 Sep 2008 07:35:53 -0000 1.1 +++ modules/simpletest/tests/file_test.info 20 May 2009 17:36:39 -0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = file_test.module hidden = TRUE +files[] = file_test.registry.inc Index: modules/simpletest/tests/file_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file_test.module,v retrieving revision 1.8 diff -u -p -r1.8 file_test.module --- modules/simpletest/tests/file_test.module 20 Jan 2009 02:56:05 -0000 1.8 +++ modules/simpletest/tests/file_test.module 20 May 2009 17:28:57 -0000 @@ -2,28 +2,6 @@ // $Id: file_test.module,v 1.8 2009/01/20 02:56:05 webchick Exp $ /** - * @file - * Helper module for the file tests. - * - * The caller is must call file_test_reset() to initializing this module before - * calling file_test_get_calls() or file_test_set_return(). - */ - -/** - * Implementation of hook_menu(). - */ -function file_test_menu() { - $items['file-test/upload'] = array( - 'title' => t('Upload test'), - 'page callback' => 'drupal_get_form', - 'page arguments' => array('_file_test_form'), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Form to test file uploads. */ function _file_test_form(&$form_state) { Index: modules/simpletest/tests/file_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/file_test.registry.inc diff -N modules/simpletest/tests/file_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/file_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,30 @@ + t('Upload test'), + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_file_test_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + Index: modules/simpletest/tests/form_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.info,v retrieving revision 1.1 diff -u -p -r1.1 form_test.info --- modules/simpletest/tests/form_test.info 28 Jan 2009 07:43:26 -0000 1.1 +++ modules/simpletest/tests/form_test.info 20 May 2009 17:36:39 -0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = form_test.module hidden = TRUE +files[] = form_test.registry.inc Index: modules/simpletest/tests/form_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.module,v retrieving revision 1.6 diff -u -p -r1.6 form_test.module --- modules/simpletest/tests/form_test.module 12 May 2009 08:37:45 -0000 1.6 +++ modules/simpletest/tests/form_test.module 20 May 2009 17:28:57 -0000 @@ -2,74 +2,6 @@ // $Id: form_test.module,v 1.6 2009/05/12 08:37:45 dries Exp $ /** - * @file - * Helper module for the form API tests. - */ - -/** - * Implementation of hook_menu(). - */ -function form_test_menu() { - $items = array(); - - $items['form_test/tableselect/multiple-true'] = array( - 'title' => 'Tableselect checkboxes test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('_form_test_tableselect_multiple_true_form'), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['form_test/tableselect/multiple-false'] = array( - 'title' => 'Tableselect radio button test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('_form_test_tableselect_multiple_false_form'), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['form_test/tableselect/empty-text'] = array( - 'title' => 'Tableselect empty text test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('_form_test_tableselect_empty_form'), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['form_test/tableselect/advanced-select'] = array( - 'title' => 'Tableselect js_select tests', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('_form_test_tableselect_js_select_form'), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['form_test/form_clean_id'] = array( - 'title' => 'form_clean_id test', - 'page callback' => 'form_test_form_clean_id_page', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['form_test/drupal_form_submit_batch_api'] = array( - 'title' => 'BatchAPI Drupal_form_submit tests', - 'page callback' => 'form_test_drupal_form_submit_batch_api', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['form_test/form-storage'] = array( - 'title' => 'Form storage test', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('form_storage_test_form'), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Generate a page with three forms, to test the clean_id generation. */ function form_test_form_clean_id_page() { Index: modules/simpletest/tests/form_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/form_test.registry.inc diff -N modules/simpletest/tests/form_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/form_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,76 @@ + 'Tableselect checkboxes test', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_form_test_tableselect_multiple_true_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['form_test/tableselect/multiple-false'] = array( + 'title' => 'Tableselect radio button test', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_form_test_tableselect_multiple_false_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['form_test/tableselect/empty-text'] = array( + 'title' => 'Tableselect empty text test', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_form_test_tableselect_empty_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['form_test/tableselect/advanced-select'] = array( + 'title' => 'Tableselect js_select tests', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('_form_test_tableselect_js_select_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['form_test/form_clean_id'] = array( + 'title' => 'form_clean_id test', + 'page callback' => 'form_test_form_clean_id_page', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['form_test/drupal_form_submit_batch_api'] = array( + 'title' => 'BatchAPI Drupal_form_submit tests', + 'page callback' => 'form_test_drupal_form_submit_batch_api', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['form_test/form-storage'] = array( + 'title' => 'Form storage test', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('form_storage_test_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + Index: modules/simpletest/tests/image_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/image_test.info,v retrieving revision 1.1 diff -u -p -r1.1 image_test.info --- modules/simpletest/tests/image_test.info 9 Mar 2009 11:44:54 -0000 1.1 +++ modules/simpletest/tests/image_test.info 20 May 2009 17:36:39 -0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = image_test.module hidden = TRUE +files[] = image_test.registry.inc Index: modules/simpletest/tests/menu_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu_test.info,v retrieving revision 1.1 diff -u -p -r1.1 menu_test.info --- modules/simpletest/tests/menu_test.info 28 Dec 2008 18:27:14 -0000 1.1 +++ modules/simpletest/tests/menu_test.info 20 May 2009 17:36:39 -0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = menu_test.module hidden = TRUE +files[] = menu_test.registry.inc Index: modules/simpletest/tests/menu_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu_test.module,v retrieving revision 1.4 diff -u -p -r1.4 menu_test.module --- modules/simpletest/tests/menu_test.module 13 Apr 2009 12:18:52 -0000 1.4 +++ modules/simpletest/tests/menu_test.module 20 May 2009 17:28:57 -0000 @@ -2,52 +2,6 @@ // $Id: menu_test.module,v 1.4 2009/04/13 12:18:52 dries Exp $ /** - * @file - * Dummy module implementing hook menu. - */ - -/** - * Implementation of hook_menu(). - */ -function menu_test_menu() { - // The name of the menu changes during the course of the test. Using a $_GET. - $items['menu_name_test'] = array( - 'title' => 'Test menu_name router item', - 'page callback' => 'node_save', - 'menu_name' => isset($_GET["hook_menu_name"]) ? $_GET["hook_menu_name"] : 'original', - ); - // Use FALSE as 'title callback' to bypass t(). - $items['menu_no_title_callback'] = array( - 'title' => 'A title with @placeholder', - 'title callback' => FALSE, - 'title arguments' => array('@placeholder' => 'some other text'), - 'page callback' => 'menu_test_callback', - 'access arguments' => array('access content'), - ); - - // Hidden link for menu_link_maintain tests - $items['menu_test_maintain/%'] = array( - 'title' => 'Menu maintain test', - 'page callback' => 'node_page_default', - 'access arguments' => array('access content'), - ); - // Hierarchical tests. - $items['menu-test/hierarchy/parent'] = array( - 'title' => 'Parent menu router', - 'page callback' => 'node_page_default', - ); - $items['menu-test/hierarchy/parent/child'] = array( - 'title' => 'Child menu router', - 'page callback' => 'node_page_default', - ); - $items['menu-test/hierarchy/parent/child2/child'] = array( - 'title' => 'Unattached subchild router', - 'page callback' => 'node_page_default', - ); - return $items; -} - -/** * Dummy callback for hook_menu() to point to. * * @return Index: modules/simpletest/tests/menu_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/menu_test.registry.inc diff -N modules/simpletest/tests/menu_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/menu_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,54 @@ + 'Test menu_name router item', + 'page callback' => 'node_save', + 'menu_name' => isset($_GET["hook_menu_name"]) ? $_GET["hook_menu_name"] : 'original', + ); + // Use FALSE as 'title callback' to bypass t(). + $items['menu_no_title_callback'] = array( + 'title' => 'A title with @placeholder', + 'title callback' => FALSE, + 'title arguments' => array('@placeholder' => 'some other text'), + 'page callback' => 'menu_test_callback', + 'access arguments' => array('access content'), + ); + + // Hidden link for menu_link_maintain tests + $items['menu_test_maintain/%'] = array( + 'title' => 'Menu maintain test', + 'page callback' => 'node_page_default', + 'access arguments' => array('access content'), + ); + // Hierarchical tests. + $items['menu-test/hierarchy/parent'] = array( + 'title' => 'Parent menu router', + 'page callback' => 'node_page_default', + ); + $items['menu-test/hierarchy/parent/child'] = array( + 'title' => 'Child menu router', + 'page callback' => 'node_page_default', + ); + $items['menu-test/hierarchy/parent/child2/child'] = array( + 'title' => 'Unattached subchild router', + 'page callback' => 'node_page_default', + ); + return $items; +} + Index: modules/simpletest/tests/session_test.bootstrap.inc =================================================================== RCS file: modules/simpletest/tests/session_test.bootstrap.inc diff -N modules/simpletest/tests/session_test.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/session_test.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,27 @@ + t('Session value'), - 'page callback' => '_session_test_get', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['session-test/id'] = array( - 'title' => t('Session ID value'), - 'page callback' => '_session_test_id', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['session-test/set/%'] = array( - 'title' => t('Set Session value'), - 'page callback' => '_session_test_set', - 'page arguments' => array(2), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['session-test/no-set/%'] = array( - 'title' => t('Disabled session set value'), - 'page callback' => '_session_test_no_set', - 'page arguments' => array(2), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['session-test/set-message'] = array( - 'title' => t('Session value'), - 'page callback' => '_session_test_set_message', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['session-test/set-not-started'] = array( - 'title' => t('Session value'), - 'page callback' => '_session_test_set_not_started', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** - * Implement hook_boot(). - */ -function session_test_boot() { - header('X-Session-Cookie: ' . intval(isset($_COOKIE[session_name()]))); - header('X-Session-Started: ' . intval(drupal_session_is_started())); - header('X-Session-Empty: ' . intval(empty($_SESSION))); -} - -/** - * Implement hook_init(). - */ -function session_test_init() { - // hook_init() is called later in the bootstrap process, but not in cached - // requests. Here the header set in hook_boot() is overwritten, so the - // session state is reported as late in the bootstrap process as possible. - header('X-Session-Started: ' . intval(drupal_session_is_started())); -} - -/** * Page callback, prints the stored session value to the screen. */ function _session_test_get() { Index: modules/simpletest/tests/session_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/session_test.registry.inc diff -N modules/simpletest/tests/session_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/session_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,54 @@ + t('Session value'), + 'page callback' => '_session_test_get', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['session-test/id'] = array( + 'title' => t('Session ID value'), + 'page callback' => '_session_test_id', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['session-test/set/%'] = array( + 'title' => t('Set Session value'), + 'page callback' => '_session_test_set', + 'page arguments' => array(2), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['session-test/no-set/%'] = array( + 'title' => t('Disabled session set value'), + 'page callback' => '_session_test_no_set', + 'page arguments' => array(2), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['session-test/set-message'] = array( + 'title' => t('Session value'), + 'page callback' => '_session_test_set_message', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['session-test/set-not-started'] = array( + 'title' => t('Session value'), + 'page callback' => '_session_test_set_not_started', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + Index: modules/simpletest/tests/system_test.bootstrap.inc =================================================================== RCS file: modules/simpletest/tests/system_test.bootstrap.inc diff -N modules/simpletest/tests/system_test.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/system_test.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,32 @@ + 'system_test_basic_auth_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['system-test/redirect/%'] = array( - 'title' => 'Redirect', - 'page callback' => 'system_test_redirect', - 'page arguments' => array(2), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['system-test/set-header'] = array( - 'page callback' => 'system_test_set_header', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['system-test/redirect-noscheme'] = array( - 'page callback' => 'system_test_redirect_noscheme', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['system-test/redirect-noparse'] = array( - 'page callback' => 'system_test_redirect_noparse', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['system-test/redirect-invalid-scheme'] = array( - 'page callback' => 'system_test_redirect_invalid_scheme', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - $items['system-test/destination'] = array( - 'title' => 'Redirect', - 'page callback' => 'system_test_destination', - 'page arguments' => array(2), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['system-test/variable-get'] = array( - 'title' => 'Variable Get', - 'page callback' => 'variable_get', - 'page arguments' => array('simpletest_bootstrap_variable_test', NULL), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['system-test/generate-warnings'] = array( - 'title' => 'Generate warnings', - 'page callback' => 'system_test_generate_warnings', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items['system-test/generate-warnings-with-report'] = array( - 'title' => 'Generate warnings with Simpletest reporting', - 'page callback' => 'system_test_generate_warnings', - 'page arguments' => array(TRUE), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items['system-test/trigger-exception'] = array( - 'title' => 'Trigger an exception', - 'page callback' => 'system_test_trigger_exception', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items['system-test/trigger-pdo-exception'] = array( - 'title' => 'Trigger a PDO exception', - 'page callback' => 'system_test_trigger_pdo_exception', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - return $items; -} - function system_test_basic_auth_page() { $output = t('$_SERVER[\'PHP_AUTH_USER\'] is @username.', array('@username' => $_SERVER['PHP_AUTH_USER'])); $output .= t('$_SERVER[\'PHP_AUTH_PW\'] is @password.', array('@password' => $_SERVER['PHP_AUTH_PW'])); @@ -161,30 +77,6 @@ function system_test_modules_uninstalled } /** - * Implementation of hook_boot(). - */ -function system_test_boot() { - watchdog('system_test', 'hook_boot'); -} - -/** - * Implementation of hook_init(). - */ -function system_test_init() { - // Used by FrontPageTestCase to get the results of drupal_is_front_page(). - if (variable_get('front_page_output', 0) && drupal_is_front_page()) { - drupal_set_message(t('On front page.')); - } -} - -/** - * Implementation of hook_exit(). - */ -function system_test_exit() { - watchdog('system_test', 'hook_exit'); -} - -/** * Menu callback; generate warnings to test the error handler. */ function system_test_generate_warnings($collect_errors = FALSE) { Index: modules/simpletest/tests/system_test.registry.inc =================================================================== RCS file: modules/simpletest/tests/system_test.registry.inc diff -N modules/simpletest/tests/system_test.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/system_test.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,92 @@ + 'system_test_basic_auth_page', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['system-test/redirect/%'] = array( + 'title' => 'Redirect', + 'page callback' => 'system_test_redirect', + 'page arguments' => array(2), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['system-test/set-header'] = array( + 'page callback' => 'system_test_set_header', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['system-test/redirect-noscheme'] = array( + 'page callback' => 'system_test_redirect_noscheme', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['system-test/redirect-noparse'] = array( + 'page callback' => 'system_test_redirect_noparse', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['system-test/redirect-invalid-scheme'] = array( + 'page callback' => 'system_test_redirect_invalid_scheme', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + $items['system-test/destination'] = array( + 'title' => 'Redirect', + 'page callback' => 'system_test_destination', + 'page arguments' => array(2), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['system-test/variable-get'] = array( + 'title' => 'Variable Get', + 'page callback' => 'variable_get', + 'page arguments' => array('simpletest_bootstrap_variable_test', NULL), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['system-test/generate-warnings'] = array( + 'title' => 'Generate warnings', + 'page callback' => 'system_test_generate_warnings', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['system-test/generate-warnings-with-report'] = array( + 'title' => 'Generate warnings with Simpletest reporting', + 'page callback' => 'system_test_generate_warnings', + 'page arguments' => array(TRUE), + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['system-test/trigger-exception'] = array( + 'title' => 'Trigger an exception', + 'page callback' => 'system_test_trigger_exception', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['system-test/trigger-pdo-exception'] = array( + 'title' => 'Trigger a PDO exception', + 'page callback' => 'system_test_trigger_pdo_exception', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + return $items; +} + Index: modules/simpletest/tests/taxonomy_test.alter.inc =================================================================== RCS file: modules/simpletest/tests/taxonomy_test.alter.inc diff -N modules/simpletest/tests/taxonomy_test.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/simpletest/tests/taxonomy_test.alter.inc 20 May 2009 21:14:44 -0000 @@ -0,0 +1,23 @@ + 'textarea', + '#title' => t('Antonyms'), + '#default_value' => !empty($antonyms) ? implode("\n", $antonyms) : NULL, + '#description' => t('Antonyms of this term, one antonym per line.') + ); + } +} + Index: modules/simpletest/tests/taxonomy_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/taxonomy_test.info,v retrieving revision 1.3 diff -u -p -r1.3 taxonomy_test.info --- modules/simpletest/tests/taxonomy_test.info 5 Apr 2009 12:21:12 -0000 1.3 +++ modules/simpletest/tests/taxonomy_test.info 20 May 2009 21:14:44 -0000 @@ -7,3 +7,5 @@ core = 7.x files[] = taxonomy_test.module hidden = TRUE dependencies[] = taxonomy +files[] = taxonomy_test.registry.inc +files[] = taxonomy_test.alter.inc Index: modules/simpletest/tests/taxonomy_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/taxonomy_test.module,v retrieving revision 1.3 diff -u -p -r1.3 taxonomy_test.module --- modules/simpletest/tests/taxonomy_test.module 5 Dec 2008 22:18:45 -0000 1.3 +++ modules/simpletest/tests/taxonomy_test.module 20 May 2009 21:14:44 -0000 @@ -50,21 +50,6 @@ function taxonomy_test_taxonomy_term_del } /** - * Implementation of hook_form_alter(). - */ -function taxonomy_test_form_alter(&$form, $form_state, $form_id) { - if ($form_id == 'taxonomy_form_term') { - $antonyms = taxonomy_test_get_antonyms($form['#term']['tid']); - $form['advanced']['antonyms'] = array( - '#type' => 'textarea', - '#title' => t('Antonyms'), - '#default_value' => !empty($antonyms) ? implode("\n", $antonyms) : NULL, - '#description' => t('Antonyms of this term, one antonym per line.') - ); - } -} - -/** * Return an array of antonyms of the given term ID. */ function taxonomy_test_get_antonyms($tid) { Index: modules/simpletest/tests/xmlrpc_test.info =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/xmlrpc_test.info,v retrieving revision 1.1 diff -u -p -r1.1 xmlrpc_test.info --- modules/simpletest/tests/xmlrpc_test.info 9 Aug 2008 12:41:22 -0000 1.1 +++ modules/simpletest/tests/xmlrpc_test.info 20 May 2009 17:36:39 -0000 @@ -6,3 +6,4 @@ version = VERSION core = 7.x files[] = xmlrpc_test.module hidden = TRUE +files[] = xmlrpc_test.registry.inc Index: modules/statistics/statistics.bootstrap.inc =================================================================== RCS file: modules/statistics/statistics.bootstrap.inc diff -N modules/statistics/statistics.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/statistics/statistics.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,87 @@ +' . t('The statistics module keeps track of numerous site usage statistics, including the number of times, and from where, each of your posts is viewed. These statistics are useful in determining how users are interacting with each other and with your site, and are required for the display of some Drupal blocks.') . ''; + $output .= '' . t('The statistics module provides:') . '
'; + $output .= '' . t('Configuring the statistics module') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Statistics module.', array('@statistics' => 'http://drupal.org/handbook/modules/statistics/')) . '
'; + return $output; + case 'admin/settings/statistics': + return '' . t('Settings for the statistical information that Drupal will keep about the site. See site statistics for the actual information.', array('@statistics' => url('admin/reports/hits'))) . '
'; + case 'admin/reports/hits': + return '' . t("This page displays the site's most recent hits.") . '
'; + case 'admin/reports/referrers': + return '' . t('This page displays all external referrers, or external references to your website.') . '
'; + case 'admin/reports/visitors': + return '' . t("When you ban a visitor, you prevent the visitor's IP address from accessing your site. Unlike blocking a user, banning a visitor works even for anonymous users. This is most commonly used to block resource-intensive bots or web crawlers.") . '
'; + } +} + +/** + * Implementation of hook_exit(). + * + * This is where statistics are gathered on page accesses. + */ +function statistics_exit() { + global $user; + + drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH); + + if (variable_get('statistics_count_content_views', 0)) { + // We are counting content views. + if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '') { + // A node has been viewed, so update the node's counters. + db_merge('node_counter') + ->key(array('nid' => arg(1))) + ->fields(array( + 'daycount' => 1, + 'totalcount' => 1, + 'timestamp' => REQUEST_TIME, + )) + ->expression('daycount', 'daycount + 1') + ->expression('totalcount', 'totalcount + 1') + ->execute(); + } + } + if (variable_get('statistics_enable_access_log', 0)) { + // Log this page access. + db_insert('accesslog') + ->fields(array( + 'title' => strip_tags(drupal_get_title()), + 'path' => $_GET['q'], + 'url' => $_SERVER['HTTP_REFERER'], + 'hostname' => ip_address(), + 'uid' => $user->uid, + 'sid' => session_id(), + 'timer' => (int) timer_read('page'), + 'timestamp' => REQUEST_TIME, + )) + ->execute(); + } +} + Index: modules/statistics/statistics.info =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.info,v retrieving revision 1.8 diff -u -p -r1.8 statistics.info --- modules/statistics/statistics.info 11 Oct 2008 02:33:02 -0000 1.8 +++ modules/statistics/statistics.info 20 May 2009 18:49:52 -0000 @@ -8,3 +8,5 @@ files[] = statistics.module files[] = statistics.admin.inc files[] = statistics.pages.inc files[] = statistics.install +files[] = statistics.registry.inc +files[] = statistics.bootstrap.inc Index: modules/statistics/statistics.module =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v retrieving revision 1.303 diff -u -p -r1.303 statistics.module --- modules/statistics/statistics.module 3 May 2009 10:11:35 -0000 1.303 +++ modules/statistics/statistics.module 20 May 2009 18:49:52 -0000 @@ -2,85 +2,6 @@ // $Id: statistics.module,v 1.303 2009/05/03 10:11:35 dries Exp $ /** - * @file - * Logs access statistics for your site. - */ - -/** - * Implementation of hook_help(). - */ -function statistics_help($path, $arg) { - switch ($path) { - case 'admin/help#statistics': - $output = '' . t('The statistics module keeps track of numerous site usage statistics, including the number of times, and from where, each of your posts is viewed. These statistics are useful in determining how users are interacting with each other and with your site, and are required for the display of some Drupal blocks.') . '
'; - $output .= '' . t('The statistics module provides:') . '
'; - $output .= '' . t('Configuring the statistics module') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Statistics module.', array('@statistics' => 'http://drupal.org/handbook/modules/statistics/')) . '
'; - return $output; - case 'admin/settings/statistics': - return '' . t('Settings for the statistical information that Drupal will keep about the site. See site statistics for the actual information.', array('@statistics' => url('admin/reports/hits'))) . '
'; - case 'admin/reports/hits': - return '' . t("This page displays the site's most recent hits.") . '
'; - case 'admin/reports/referrers': - return '' . t('This page displays all external referrers, or external references to your website.') . '
'; - case 'admin/reports/visitors': - return '' . t("When you ban a visitor, you prevent the visitor's IP address from accessing your site. Unlike blocking a user, banning a visitor works even for anonymous users. This is most commonly used to block resource-intensive bots or web crawlers.") . '
'; - } -} - -/** - * Implementation of hook_exit(). - * - * This is where statistics are gathered on page accesses. - */ -function statistics_exit() { - global $user; - - drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH); - - if (variable_get('statistics_count_content_views', 0)) { - // We are counting content views. - if ((arg(0) == 'node') && is_numeric(arg(1)) && arg(2) == '') { - // A node has been viewed, so update the node's counters. - db_merge('node_counter') - ->key(array('nid' => arg(1))) - ->fields(array( - 'daycount' => 1, - 'totalcount' => 1, - 'timestamp' => REQUEST_TIME, - )) - ->expression('daycount', 'daycount + 1') - ->expression('totalcount', 'totalcount + 1') - ->execute(); - } - } - if (variable_get('statistics_enable_access_log', 0)) { - // Log this page access. - db_insert('accesslog') - ->fields(array( - 'title' => strip_tags(drupal_get_title()), - 'path' => $_GET['q'], - 'url' => $_SERVER['HTTP_REFERER'], - 'hostname' => ip_address(), - 'uid' => $user->uid, - 'sid' => session_id(), - 'timer' => (int) timer_read('page'), - 'timestamp' => REQUEST_TIME, - )) - ->execute(); - } -} - -/** * Implementation of hook_perm(). */ function statistics_perm() { @@ -121,71 +42,6 @@ function statistics_node_view($node, $te } /** - * Implementation of hook_menu(). - */ -function statistics_menu() { - $items['admin/reports/hits'] = array( - 'title' => 'Recent hits', - 'description' => 'View pages that have recently been visited.', - 'page callback' => 'statistics_recent_hits', - 'access arguments' => array('access statistics'), - ); - $items['admin/reports/pages'] = array( - 'title' => 'Top pages', - 'description' => 'View pages that have been hit frequently.', - 'page callback' => 'statistics_top_pages', - 'access arguments' => array('access statistics'), - 'weight' => 1, - ); - $items['admin/reports/visitors'] = array( - 'title' => 'Top visitors', - 'description' => 'View visitors that hit many pages.', - 'page callback' => 'statistics_top_visitors', - 'access arguments' => array('access statistics'), - 'weight' => 2, - ); - $items['admin/reports/referrers'] = array( - 'title' => 'Top referrers', - 'description' => 'View top referrers.', - 'page callback' => 'statistics_top_referrers', - 'access arguments' => array('access statistics'), - ); - $items['admin/reports/access/%'] = array( - 'title' => 'Details', - 'description' => 'View access log.', - 'page callback' => 'statistics_access_log', - 'page arguments' => array(3), - 'access arguments' => array('access statistics'), - 'type' => MENU_CALLBACK, - ); - $items['admin/settings/statistics'] = array( - 'title' => 'Statistics', - 'description' => 'Control details about what and how your site logs access statistics.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('statistics_settings_form'), - 'access arguments' => array('administer statistics'), - ); - $items['user/%user/track/navigation'] = array( - 'title' => 'Track page visits', - 'page callback' => 'statistics_user_tracker', - 'access callback' => 'user_access', - 'access arguments' => array('access statistics'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - $items['node/%node/track'] = array( - 'title' => 'Track', - 'page callback' => 'statistics_node_tracker', - 'access callback' => 'user_access', - 'access arguments' => array('access statistics'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - - return $items; -} - -/** * Implementation of hook_user_cancel(). */ function statistics_user_cancel($edit, $account, $method) { Index: modules/statistics/statistics.registry.inc =================================================================== RCS file: modules/statistics/statistics.registry.inc diff -N modules/statistics/statistics.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/statistics/statistics.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,73 @@ + 'Recent hits', + 'description' => 'View pages that have recently been visited.', + 'page callback' => 'statistics_recent_hits', + 'access arguments' => array('access statistics'), + ); + $items['admin/reports/pages'] = array( + 'title' => 'Top pages', + 'description' => 'View pages that have been hit frequently.', + 'page callback' => 'statistics_top_pages', + 'access arguments' => array('access statistics'), + 'weight' => 1, + ); + $items['admin/reports/visitors'] = array( + 'title' => 'Top visitors', + 'description' => 'View visitors that hit many pages.', + 'page callback' => 'statistics_top_visitors', + 'access arguments' => array('access statistics'), + 'weight' => 2, + ); + $items['admin/reports/referrers'] = array( + 'title' => 'Top referrers', + 'description' => 'View top referrers.', + 'page callback' => 'statistics_top_referrers', + 'access arguments' => array('access statistics'), + ); + $items['admin/reports/access/%'] = array( + 'title' => 'Details', + 'description' => 'View access log.', + 'page callback' => 'statistics_access_log', + 'page arguments' => array(3), + 'access arguments' => array('access statistics'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/statistics'] = array( + 'title' => 'Statistics', + 'description' => 'Control details about what and how your site logs access statistics.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('statistics_settings_form'), + 'access arguments' => array('administer statistics'), + ); + $items['user/%user/track/navigation'] = array( + 'title' => 'Track page visits', + 'page callback' => 'statistics_user_tracker', + 'access callback' => 'user_access', + 'access arguments' => array('access statistics'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + $items['node/%node/track'] = array( + 'title' => 'Track', + 'page callback' => 'statistics_node_tracker', + 'access callback' => 'user_access', + 'access arguments' => array('access statistics'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + + return $items; +} + Index: modules/syslog/syslog.alter.inc =================================================================== RCS file: modules/syslog/syslog.alter.inc diff -N modules/syslog/syslog.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/syslog/syslog.alter.inc 20 May 2009 21:15:40 -0000 @@ -0,0 +1,23 @@ + 'select', + '#title' => t('Send events to this syslog facility'), + '#default_value' => variable_get('syslog_facility', DEFAULT_SYSLOG_FACILITY), + '#options' => syslog_facility_list(), + '#description' => t('Select the syslog facility code under which Drupal\'s messages should be sent. On UNIX/Linux systems, Drupal can flag its messages with the code LOG_LOCAL0 through LOG_LOCAL7; for Microsoft Windows, all messages are flagged with the code LOG_USER. Depending on the system configuration, syslog and other logging tools use this code to identify or filter Drupal messages from within the entire system log. For more information on syslog, see Syslog help.', array( + '@syslog_help' => url('admin/help/syslog'))), + ); + $form['buttons']['#weight'] = 1; +} + Index: modules/syslog/syslog.bootstrap.inc =================================================================== RCS file: modules/syslog/syslog.bootstrap.inc diff -N modules/syslog/syslog.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/syslog/syslog.bootstrap.inc 20 May 2009 20:21:52 -0000 @@ -0,0 +1,21 @@ +' . t("The syslog module enables Drupal to send messages to the operating system's logging facility.") . ''; + $output .= '' . t('Syslog is an operating system administrative logging tool, and provides valuable information for use in system management and security auditing. Most suited to medium and large sites, syslog provides filtering tools that allow messages to be routed by type and severity. On UNIX/Linux systems, the file /etc/syslog.conf defines this routing configuration; on Microsoft Windows, all messages are sent to the Event Log. For more information on syslog facilities, severity levels, and how to set up a syslog.conf file, see UNIX/Linux syslog.conf and PHP\'s openlog and syslog functions.', array('@syslog_conf' => url('http://www.rt.com/man/syslog.5.html'), '@php_openlog' => url('http://www.php.net/manual/function.openlog.php'), '@php_syslog' => url('http://www.php.net/manual/function.syslog.php'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Syslog module.', array('@syslog' => 'http://drupal.org/handbook/modules/syslog')) . '
'; + return $output; + } +} + Index: modules/syslog/syslog.info =================================================================== RCS file: /cvs/drupal/drupal/modules/syslog/syslog.info,v retrieving revision 1.5 diff -u -p -r1.5 syslog.info --- modules/syslog/syslog.info 11 Oct 2008 02:33:03 -0000 1.5 +++ modules/syslog/syslog.info 20 May 2009 21:14:44 -0000 @@ -5,3 +5,6 @@ package = Core version = VERSION core = 7.x files[] = syslog.module +files[] = syslog.registry.inc +files[] = syslog.bootstrap.inc +files[] = syslog.alter.inc Index: modules/syslog/syslog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/syslog/syslog.module,v retrieving revision 1.22 diff -u -p -r1.22 syslog.module --- modules/syslog/syslog.module 13 Apr 2009 08:49:01 -0000 1.22 +++ modules/syslog/syslog.module 20 May 2009 21:15:47 -0000 @@ -13,34 +13,6 @@ else { define('DEFAULT_SYSLOG_FACILITY', LOG_USER); } -/** - * Implementation of hook_help(). - */ -function syslog_help($path, $arg) { - switch ($path) { - case 'admin/help#syslog': - $output = '' . t("The syslog module enables Drupal to send messages to the operating system's logging facility.") . '
'; - $output .= '' . t('Syslog is an operating system administrative logging tool, and provides valuable information for use in system management and security auditing. Most suited to medium and large sites, syslog provides filtering tools that allow messages to be routed by type and severity. On UNIX/Linux systems, the file /etc/syslog.conf defines this routing configuration; on Microsoft Windows, all messages are sent to the Event Log. For more information on syslog facilities, severity levels, and how to set up a syslog.conf file, see UNIX/Linux syslog.conf and PHP\'s openlog and syslog functions.', array('@syslog_conf' => url('http://www.rt.com/man/syslog.5.html'), '@php_openlog' => url('http://www.php.net/manual/function.openlog.php'), '@php_syslog' => url('http://www.php.net/manual/function.syslog.php'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Syslog module.', array('@syslog' => 'http://drupal.org/handbook/modules/syslog')) . '
'; - return $output; - } -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - */ -function syslog_form_system_logging_settings_alter(&$form, &$form_state) { - $form['syslog_facility'] = array( - '#type' => 'select', - '#title' => t('Send events to this syslog facility'), - '#default_value' => variable_get('syslog_facility', DEFAULT_SYSLOG_FACILITY), - '#options' => syslog_facility_list(), - '#description' => t('Select the syslog facility code under which Drupal\'s messages should be sent. On UNIX/Linux systems, Drupal can flag its messages with the code LOG_LOCAL0 through LOG_LOCAL7; for Microsoft Windows, all messages are flagged with the code LOG_USER. Depending on the system configuration, syslog and other logging tools use this code to identify or filter Drupal messages from within the entire system log. For more information on syslog, see Syslog help.', array( - '@syslog_help' => url('admin/help/syslog'))), - ); - $form['buttons']['#weight'] = 1; -} - function syslog_facility_list() { $facility_list = array( LOG_USER => t('LOG_USER - User level messages. Use this for Windows.'), Index: modules/system/system.bootstrap.inc =================================================================== RCS file: modules/system/system.bootstrap.inc diff -N modules/system/system.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/system/system.bootstrap.inc 20 May 2009 21:33:54 -0000 @@ -0,0 +1,412 @@ +' . t('The system module is at the foundation of your Drupal website, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the system module, including caching, enabling or disabling of modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the system module.') . ''; + $output .= '' . t('The system module provides:') . '
'; + $output .= '' . t('For more information, see the online handbook entry for System module.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '
'; + return $output; + case 'admin/by-module': + return '' . t('This page shows you all available administration tasks for each module.') . '
'; + case 'admin/build/themes': + $output = '' . t('Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternatively, to override these settings in a specific theme, click the "configure" link for that theme. Note that different themes may have different regions available for displaying content; for consistency in presentation, you may wish to enable only one theme.') . '
'; + $output .= '' . t('To change the appearance of your site, a number of contributed themes are available.', array('@themes' => 'http://drupal.org/project/themes')) . '
'; + return $output; + case 'admin/build/themes/settings/' . $arg[4]: + $reference = explode('.', $arg[4], 2); + $theme = array_pop($reference); + return '' . t('These options control the display settings for the %template theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the global settings for this theme.', array('%template' => $theme, '@global' => url('admin/build/themes/settings'))) . '
' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '
'; + case 'admin/build/modules': + $output = '' . t('Modules are plugins that extend Drupal\'s core functionality. To enable modules, select the Enabled checkboxes below and click the Save configuration button. To further extend your site\'s functionality, a number of contributed modules are available for download.', array('@permissions' => url('admin/user/permissions'), '@modules' => 'http://drupal.org/project/modules')) . '
'; + $output .= '' . t('Module-related tasks can be located on the administration by module page. New module-related permissions may also become available as new modules are enabled.', array('@by-module' => url('admin/by-module'), '@permissions' => url('admin/user/permissions'))) . '
'; + $output .= '' . t('Each time a module is updated, it is important that update.php is run. To help manage the update process, the Update status module, if enabled, provides information on new versions of modules (and themes) as they are released. Regular review of the available updates page is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'))) . '
'; + return $output; + case 'admin/build/modules/uninstall': + return '' . t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it. Not all modules support this feature.') . '
'; + case 'admin/build/block/configure': + if ($arg[4] == 'system' && $arg[5] == 'powered-by') { + return '' . t('The Powered by Drupal block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '
'; + } + break; + case 'admin/settings/actions': + case 'admin/settings/actions/manage': + $output = '' . t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Modules, such as the trigger module, can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions.') . '
'; + $output .= '' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration, and are listed here automatically. Advanced actions can do more than simple actions; for example, send an e-mail to a specified address, or check for certain words within a piece of content. These actions need to be created and configured first before they may be used. To create an advanced action, select the action from the drop-down below and click the Create button.') . '
'; + if (module_exists('trigger')) { + $output .= '' . t('You may proceed to the Triggers page to assign these actions to system events.', array('@url' => url('admin/build/trigger'))) . '
'; + } + return $output; + case 'admin/settings/actions/configure': + return t('An advanced action offers additional configuration options which may be filled out below. Changing the Description field is recommended, in order to better identify the precise action taking place. This description will be displayed in modules such as the trigger module when assigning actions to system events, so it is best if it is as descriptive as possible (for example, "Send e-mail to Moderation Team" rather than simply "Send e-mail").'); + case 'admin/settings/ip-blocking': + return '' . t('IP addresses listed here are blocked from your site before any modules are loaded. You may add IP addresses to the list, or delete existing entries.') . '
'; + case 'admin/reports/status': + return '' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues.") . '
'; + } +} + +/** + * Implementation of hook_hook_info(). + */ +function system_hook_info() { + return array( + 'system' => array( + 'cron' => array( + 'run' => array( + 'runs when' => t('When cron runs'), + ), + ), + ), + ); +} + +/** + * Implementation of hook_action_info(). + */ +function system_action_info() { + return array( + 'system_message_action' => array( + 'type' => 'system', + 'description' => t('Display a message to the user'), + 'configurable' => TRUE, + 'hooks' => array( + 'node' => array('view', 'insert', 'update', 'delete'), + 'comment' => array('view', 'insert', 'update', 'delete'), + 'user' => array('view', 'insert', 'update', 'delete', 'login'), + 'taxonomy' => array('insert', 'update', 'delete'), + ), + ), + 'system_send_email_action' => array( + 'description' => t('Send e-mail'), + 'type' => 'system', + 'configurable' => TRUE, + 'hooks' => array( + 'node' => array('view', 'insert', 'update', 'delete'), + 'comment' => array('view', 'insert', 'update', 'delete'), + 'user' => array('view', 'insert', 'update', 'delete', 'login'), + 'taxonomy' => array('insert', 'update', 'delete'), + 'cron' => array('run'), + ) + ), + 'system_block_ip_action' => array( + 'description' => t('Ban IP address of current user'), + 'type' => 'user', + 'configurable' => FALSE, + 'hooks' => array(), + ), + 'system_goto_action' => array( + 'description' => t('Redirect to URL'), + 'type' => 'system', + 'configurable' => TRUE, + 'hooks' => array( + 'node' => array('view', 'insert', 'update', 'delete'), + 'comment' => array('view', 'insert', 'update', 'delete'), + 'user' => array('view', 'insert', 'update', 'delete', 'login'), + ) + ) + ); +} + +/** + * Implementation of hook_elements(). + */ +function system_elements() { + // Top level form + $type['form'] = array( + '#method' => 'post', + '#action' => request_uri(), + '#theme_wrapper' => 'form', + ); + + $type['page'] = array( + '#show_messages' => TRUE, + '#show_blocks' => TRUE, + '#theme' => 'page', + ); + + $type['list'] = array( + '#title' => '', + '#list_type' => 'ul', + '#attributes' => array(), + '#items' => array(), + ); + + /** + * Input elements. + */ + $type['submit'] = array( + '#input' => TRUE, + '#name' => 'op', + '#button_type' => 'submit', + '#executes_submit_callback' => TRUE, + '#process' => array('form_process_ahah'), + '#theme_wrapper' => 'button', + ); + + $type['button'] = array( + '#input' => TRUE, + '#name' => 'op', + '#button_type' => 'submit', + '#executes_submit_callback' => FALSE, + '#process' => array('form_process_ahah'), + '#theme_wrapper' => 'button', + ); + + $type['image_button'] = array( + '#input' => TRUE, + '#button_type' => 'submit', + '#executes_submit_callback' => TRUE, + '#process' => array('form_process_ahah'), + '#return_value' => TRUE, + '#has_garbage_value' => TRUE, + '#src' => NULL, + '#theme_wrapper' => 'image_button', + ); + + $type['textfield'] = array( + '#input' => TRUE, + '#size' => 60, + '#maxlength' => 128, + '#autocomplete_path' => FALSE, + '#process' => array('form_process_text_format', 'form_process_ahah'), + '#theme' => 'textfield', + '#theme_wrapper' => 'form_element', + ); + + $type['password'] = array( + '#input' => TRUE, + '#size' => 60, + '#maxlength' => 128, + '#process' => array('form_process_ahah'), + '#theme' => 'password', + '#theme_wrapper' => 'form_element', + ); + + $type['password_confirm'] = array( + '#input' => TRUE, + '#process' => array('form_process_password_confirm'), + '#theme_wrapper' => 'form_element', + ); + + $type['textarea'] = array( + '#input' => TRUE, + '#cols' => 60, + '#rows' => 5, + '#resizable' => TRUE, + '#process' => array('form_process_text_format', 'form_process_ahah'), + '#theme' => 'textarea', + '#theme_wrapper' => 'form_element', + ); + + $type['radios'] = array( + '#input' => TRUE, + '#process' => array('form_process_radios'), + '#theme_wrapper' => 'radios', + '#pre_render' => array('form_pre_render_conditional_form_element'), + ); + + $type['radio'] = array( + '#input' => TRUE, + '#default_value' => NULL, + '#process' => array('form_process_ahah'), + '#theme' => 'radio', + '#theme_wrapper' => 'form_element', + '#form_element_skip_title' => TRUE, + ); + + $type['checkboxes'] = array( + '#input' => TRUE, + '#tree' => TRUE, + '#process' => array('form_process_checkboxes'), + '#theme_wrapper' => 'checkboxes', + '#pre_render' => array('form_pre_render_conditional_form_element'), + ); + + $type['checkbox'] = array( + '#input' => TRUE, + '#return_value' => 1, + '#process' => array('form_process_ahah'), + '#theme' => 'checkbox', + '#theme_wrapper' => 'form_element', + '#form_element_skip_title' => TRUE, + ); + + $type['select'] = array( + '#input' => TRUE, + '#size' => 0, + '#multiple' => FALSE, + '#process' => array('form_process_ahah'), + '#theme' => 'select', + '#theme_wrapper' => 'form_element', + ); + + $type['weight'] = array( + '#input' => TRUE, + '#delta' => 10, + '#default_value' => 0, + '#process' => array('form_process_weight', 'form_process_ahah'), + ); + + $type['date'] = array( + '#input' => TRUE, + '#element_validate' => array('date_validate'), + '#process' => array('form_process_date'), + '#theme' => 'date', + '#theme_wrapper' => 'form_element', + ); + + $type['file'] = array( + '#input' => TRUE, + '#size' => 60, + '#theme' => 'file', + '#theme_wrapper' => 'form_element', + ); + + $type['tableselect'] = array( + '#input' => TRUE, + '#js_select' => TRUE, + '#multiple' => TRUE, + '#process' => array('form_process_tableselect'), + '#options' => array(), + '#empty' => '', + '#theme' => 'tableselect' + ); + + /** + * Form structure. + */ + $type['item'] = array( + '#markup' => '', + '#theme' => 'markup', + '#theme_wrapper' => 'form_element', + ); + + $type['hidden'] = array( + '#input' => TRUE, + '#process' => array('form_process_ahah'), + '#theme' => 'hidden', + ); + + $type['value'] = array( + '#input' => TRUE, + ); + + $type['markup'] = array( + '#markup' => '', + '#theme' => 'markup', + ); + + $type['fieldset'] = array( + '#collapsible' => FALSE, + '#collapsed' => FALSE, + '#value' => NULL, + '#process' => array('form_process_fieldset', 'form_process_ahah'), + '#pre_render' => array('form_pre_render_fieldset'), + '#theme_wrapper' => 'fieldset', + ); + + $type['vertical_tabs'] = array( + '#theme_wrapper' => 'vertical_tabs', + '#default_tab' => '', + '#process' => array('form_process_vertical_tabs'), + ); + + $type['token'] = array( + '#input' => TRUE, + '#theme' => array('hidden'), + ); + + return $type; +} + Index: modules/system/system.info =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.info,v retrieving revision 1.12 diff -u -p -r1.12 system.info --- modules/system/system.info 6 May 2009 10:37:28 -0000 1.12 +++ modules/system/system.info 20 May 2009 18:49:52 -0000 @@ -10,3 +10,5 @@ files[] = system.queue.inc files[] = image.gd.inc files[] = system.install required = TRUE +files[] = system.registry.inc +files[] = system.bootstrap.inc Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.694 diff -u -p -r1.694 system.module --- modules/system/system.module 16 May 2009 18:34:23 -0000 1.694 +++ modules/system/system.module 20 May 2009 21:33:54 -0000 @@ -2,167 +2,6 @@ // $Id: system.module,v 1.694 2009/05/16 18:34:23 dries Exp $ /** - * @file - * Configuration system that lets administrators modify the workings of the site. - */ - -/** - * The current system version. - */ -define('VERSION', '7.0-dev'); - -/** - * Core API compatibility. - */ -define('DRUPAL_CORE_COMPATIBILITY', '7.x'); - -/** - * Minimum supported version of PHP. - */ -define('DRUPAL_MINIMUM_PHP', '5.2.0'); - -/** - * Minimum recommended value of PHP memory_limit. - */ -define('DRUPAL_MINIMUM_PHP_MEMORY_LIMIT', '16M'); - -/** - * Minimum supported version of MySQL, if it is used. - */ -define('DRUPAL_MINIMUM_MYSQL', '5.0'); - -/** - * Minimum supported version of PostgreSQL, if it is used. - */ -define('DRUPAL_MINIMUM_PGSQL', '8.3'); - -/** - * Maximum age of temporary files in seconds. - */ -define('DRUPAL_MAXIMUM_TEMP_FILE_AGE', 21600); - -/** - * New users will be set to the default time zone at registration. - */ -define('DRUPAL_USER_TIMEZONE_DEFAULT', 0); - -/** - * New users will get an empty time zone at registration. - */ -define('DRUPAL_USER_TIMEZONE_EMPTY', 1); - -/** - * New users will select their own timezone at registration. - */ -define('DRUPAL_USER_TIMEZONE_SELECT', 2); - -/** - * Implementation of hook_help(). - */ -function system_help($path, $arg) { - global $base_url; - - switch ($path) { - case 'admin/help#system': - $output = '' . t('The system module is at the foundation of your Drupal website, and provides basic but extensible functionality for use by other modules and themes. Some integral elements of Drupal are contained in and managed by the system module, including caching, enabling or disabling of modules and themes, preparing and displaying the administrative page, and configuring fundamental site settings. A number of key system maintenance operations are also part of the system module.') . '
'; - $output .= '' . t('The system module provides:') . '
'; - $output .= '' . t('For more information, see the online handbook entry for System module.', array('@system' => 'http://drupal.org/handbook/modules/system/')) . '
'; - return $output; - case 'admin/by-module': - return '' . t('This page shows you all available administration tasks for each module.') . '
'; - case 'admin/build/themes': - $output = '' . t('Select which themes are available to your users and specify the default theme. To configure site-wide display settings, click the "configure" task above. Alternatively, to override these settings in a specific theme, click the "configure" link for that theme. Note that different themes may have different regions available for displaying content; for consistency in presentation, you may wish to enable only one theme.') . '
'; - $output .= '' . t('To change the appearance of your site, a number of contributed themes are available.', array('@themes' => 'http://drupal.org/project/themes')) . '
'; - return $output; - case 'admin/build/themes/settings/' . $arg[4]: - $reference = explode('.', $arg[4], 2); - $theme = array_pop($reference); - return '' . t('These options control the display settings for the %template theme. When your site is displayed using this theme, these settings will be used. By clicking "Reset to defaults," you can choose to use the global settings for this theme.', array('%template' => $theme, '@global' => url('admin/build/themes/settings'))) . '
' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '
'; - case 'admin/build/modules': - $output = '' . t('Modules are plugins that extend Drupal\'s core functionality. To enable modules, select the Enabled checkboxes below and click the Save configuration button. To further extend your site\'s functionality, a number of contributed modules are available for download.', array('@permissions' => url('admin/user/permissions'), '@modules' => 'http://drupal.org/project/modules')) . '
'; - $output .= '' . t('Module-related tasks can be located on the administration by module page. New module-related permissions may also become available as new modules are enabled.', array('@by-module' => url('admin/by-module'), '@permissions' => url('admin/user/permissions'))) . '
'; - $output .= '' . t('Each time a module is updated, it is important that update.php is run. To help manage the update process, the Update status module, if enabled, provides information on new versions of modules (and themes) as they are released. Regular review of the available updates page is essential to maintaining a secure and current site.', array('@update-php' => $base_url . '/update.php', '@updates' => url('admin/reports/updates'))) . '
'; - return $output; - case 'admin/build/modules/uninstall': - return '' . t('The uninstall process removes all data related to a module. To uninstall a module, you must first disable it. Not all modules support this feature.') . '
'; - case 'admin/build/block/configure': - if ($arg[4] == 'system' && $arg[5] == 'powered-by') { - return '' . t('The Powered by Drupal block is an optional link to the home page of the Drupal project. While there is absolutely no requirement that sites feature this link, it may be used to show support for Drupal.') . '
'; - } - break; - case 'admin/settings/actions': - case 'admin/settings/actions/manage': - $output = '' . t('Actions are individual tasks that the system can do, such as unpublishing a piece of content or banning a user. Modules, such as the trigger module, can fire these actions when certain system events happen; for example, when a new post is added or when a user logs in. Modules may also provide additional actions.') . '
'; - $output .= '' . t('There are two types of actions: simple and advanced. Simple actions do not require any additional configuration, and are listed here automatically. Advanced actions can do more than simple actions; for example, send an e-mail to a specified address, or check for certain words within a piece of content. These actions need to be created and configured first before they may be used. To create an advanced action, select the action from the drop-down below and click the Create button.') . '
'; - if (module_exists('trigger')) { - $output .= '' . t('You may proceed to the Triggers page to assign these actions to system events.', array('@url' => url('admin/build/trigger'))) . '
'; - } - return $output; - case 'admin/settings/actions/configure': - return t('An advanced action offers additional configuration options which may be filled out below. Changing the Description field is recommended, in order to better identify the precise action taking place. This description will be displayed in modules such as the trigger module when assigning actions to system events, so it is best if it is as descriptive as possible (for example, "Send e-mail to Moderation Team" rather than simply "Send e-mail").'); - case 'admin/settings/ip-blocking': - return '' . t('IP addresses listed here are blocked from your site before any modules are loaded. You may add IP addresses to the list, or delete existing entries.') . '
'; - case 'admin/reports/status': - return '' . t("Here you can find a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on drupal.org's support forums and project issue queues.") . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function system_theme() { - return array_merge(drupal_common_theme(), array( - 'system_theme_select_form' => array( - 'arguments' => array('form' => NULL), - ), - 'system_themes_form' => array( - 'arguments' => array('form' => NULL), - ), - 'system_modules_fieldset' => array( - 'arguments' => array('form' => NULL), - ), - 'system_modules_incompatible' => array( - 'arguments' => array('message' => NULL), - ), - 'system_modules_uninstall' => array( - 'arguments' => array('form' => NULL), - ), - 'status_report' => array( - 'arguments' => array('requirements' => NULL), - ), - 'admin_page' => array( - 'arguments' => array('blocks' => NULL), - ), - 'admin_block' => array( - 'arguments' => array('block' => NULL), - ), - 'admin_block_content' => array( - 'arguments' => array('content' => NULL), - ), - 'system_admin_by_module' => array( - 'arguments' => array('menu_items' => NULL), - ), - 'system_powered_by' => array( - 'arguments' => array('image_path' => NULL), - ), - 'meta_generator_html' => array( - 'arguments' => array('version' => NULL), - ), - 'meta_generator_header' => array( - 'arguments' => array('version' => NULL), - ), - 'system_compact_link' => array(), - )); -} - -/** * Implementation of hook_perm(). */ function system_perm() { @@ -218,543 +57,6 @@ function system_rdf_namespaces() { } /** - * Implementation of hook_elements(). - */ -function system_elements() { - // Top level form - $type['form'] = array( - '#method' => 'post', - '#action' => request_uri(), - '#theme_wrapper' => 'form', - ); - - $type['page'] = array( - '#show_messages' => TRUE, - '#show_blocks' => TRUE, - '#theme' => 'page', - ); - - $type['list'] = array( - '#title' => '', - '#list_type' => 'ul', - '#attributes' => array(), - '#items' => array(), - ); - - /** - * Input elements. - */ - $type['submit'] = array( - '#input' => TRUE, - '#name' => 'op', - '#button_type' => 'submit', - '#executes_submit_callback' => TRUE, - '#process' => array('form_process_ahah'), - '#theme_wrapper' => 'button', - ); - - $type['button'] = array( - '#input' => TRUE, - '#name' => 'op', - '#button_type' => 'submit', - '#executes_submit_callback' => FALSE, - '#process' => array('form_process_ahah'), - '#theme_wrapper' => 'button', - ); - - $type['image_button'] = array( - '#input' => TRUE, - '#button_type' => 'submit', - '#executes_submit_callback' => TRUE, - '#process' => array('form_process_ahah'), - '#return_value' => TRUE, - '#has_garbage_value' => TRUE, - '#src' => NULL, - '#theme_wrapper' => 'image_button', - ); - - $type['textfield'] = array( - '#input' => TRUE, - '#size' => 60, - '#maxlength' => 128, - '#autocomplete_path' => FALSE, - '#process' => array('form_process_text_format', 'form_process_ahah'), - '#theme' => 'textfield', - '#theme_wrapper' => 'form_element', - ); - - $type['password'] = array( - '#input' => TRUE, - '#size' => 60, - '#maxlength' => 128, - '#process' => array('form_process_ahah'), - '#theme' => 'password', - '#theme_wrapper' => 'form_element', - ); - - $type['password_confirm'] = array( - '#input' => TRUE, - '#process' => array('form_process_password_confirm'), - '#theme_wrapper' => 'form_element', - ); - - $type['textarea'] = array( - '#input' => TRUE, - '#cols' => 60, - '#rows' => 5, - '#resizable' => TRUE, - '#process' => array('form_process_text_format', 'form_process_ahah'), - '#theme' => 'textarea', - '#theme_wrapper' => 'form_element', - ); - - $type['radios'] = array( - '#input' => TRUE, - '#process' => array('form_process_radios'), - '#theme_wrapper' => 'radios', - '#pre_render' => array('form_pre_render_conditional_form_element'), - ); - - $type['radio'] = array( - '#input' => TRUE, - '#default_value' => NULL, - '#process' => array('form_process_ahah'), - '#theme' => 'radio', - '#theme_wrapper' => 'form_element', - '#form_element_skip_title' => TRUE, - ); - - $type['checkboxes'] = array( - '#input' => TRUE, - '#tree' => TRUE, - '#process' => array('form_process_checkboxes'), - '#theme_wrapper' => 'checkboxes', - '#pre_render' => array('form_pre_render_conditional_form_element'), - ); - - $type['checkbox'] = array( - '#input' => TRUE, - '#return_value' => 1, - '#process' => array('form_process_ahah'), - '#theme' => 'checkbox', - '#theme_wrapper' => 'form_element', - '#form_element_skip_title' => TRUE, - ); - - $type['select'] = array( - '#input' => TRUE, - '#size' => 0, - '#multiple' => FALSE, - '#process' => array('form_process_ahah'), - '#theme' => 'select', - '#theme_wrapper' => 'form_element', - ); - - $type['weight'] = array( - '#input' => TRUE, - '#delta' => 10, - '#default_value' => 0, - '#process' => array('form_process_weight', 'form_process_ahah'), - ); - - $type['date'] = array( - '#input' => TRUE, - '#element_validate' => array('date_validate'), - '#process' => array('form_process_date'), - '#theme' => 'date', - '#theme_wrapper' => 'form_element', - ); - - $type['file'] = array( - '#input' => TRUE, - '#size' => 60, - '#theme' => 'file', - '#theme_wrapper' => 'form_element', - ); - - $type['tableselect'] = array( - '#input' => TRUE, - '#js_select' => TRUE, - '#multiple' => TRUE, - '#process' => array('form_process_tableselect'), - '#options' => array(), - '#empty' => '', - '#theme' => 'tableselect' - ); - - /** - * Form structure. - */ - $type['item'] = array( - '#markup' => '', - '#theme' => 'markup', - '#theme_wrapper' => 'form_element', - ); - - $type['hidden'] = array( - '#input' => TRUE, - '#process' => array('form_process_ahah'), - '#theme' => 'hidden', - ); - - $type['value'] = array( - '#input' => TRUE, - ); - - $type['markup'] = array( - '#markup' => '', - '#theme' => 'markup', - ); - - $type['fieldset'] = array( - '#collapsible' => FALSE, - '#collapsed' => FALSE, - '#value' => NULL, - '#process' => array('form_process_fieldset', 'form_process_ahah'), - '#pre_render' => array('form_pre_render_fieldset'), - '#theme_wrapper' => 'fieldset', - ); - - $type['vertical_tabs'] = array( - '#theme_wrapper' => 'vertical_tabs', - '#default_tab' => '', - '#process' => array('form_process_vertical_tabs'), - ); - - $type['token'] = array( - '#input' => TRUE, - '#theme' => array('hidden'), - ); - - return $type; -} - -/** - * Implementation of hook_menu(). - */ -function system_menu() { - $items['system/files'] = array( - 'title' => 'File download', - 'page callback' => 'file_download', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['system/ahah'] = array( - 'title' => 'AHAH callback', - 'page callback' => 'form_ahah_callback', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['system/timezone'] = array( - 'title' => 'Time zone', - 'page callback' => 'system_timezone', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - $items['admin'] = array( - 'title' => 'Administer', - 'access arguments' => array('access administration pages'), - 'page callback' => 'system_main_admin_page', - 'weight' => 9, - 'menu_name' => 'management', - ); - $items['admin/compact'] = array( - 'title' => 'Compact mode', - 'page callback' => 'system_admin_compact_page', - 'access arguments' => array('access administration pages'), - 'type' => MENU_CALLBACK, - ); - $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, - ); - $items['admin/by-module'] = array( - 'title' => 'By module', - 'page callback' => 'system_admin_by_module', - 'access arguments' => array('access administration pages'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - $items['admin/content'] = array( - 'title' => 'Content management', - 'description' => "Manage your site's content.", - 'position' => 'left', - 'weight' => -10, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - ); - - // menu items that are basically just menu blocks - $items['admin/settings'] = array( - 'title' => 'Site configuration', - 'description' => 'Configure site settings.', - 'position' => 'right', - 'weight' => -5, - 'page callback' => 'system_settings_overview', - 'access arguments' => array('access administration pages'), - ); - $items['admin/build'] = array( - 'title' => 'Site building', - 'description' => 'Control how your site looks and feels.', - 'position' => 'right', - 'weight' => -10, - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - ); - // Themes: - $items['admin/build/themes'] = array( - 'title' => 'Themes', - 'description' => 'Change which theme your site uses or allows users to set.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_themes_form'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/build/themes/select'] = array( - 'title' => 'List', - 'description' => 'Select the default theme for your site.', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -1, - ); - $items['admin/build/themes/settings'] = array( - 'title' => 'Configure', - 'page arguments' => array('system_theme_settings'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_LOCAL_TASK, - ); - // Theme configuration subtabs - $items['admin/build/themes/settings/global'] = array( - 'title' => 'Global settings', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -1, - ); - - foreach (list_themes() as $theme) { - $items['admin/build/themes/settings/' . $theme->name] = array( - 'title' => $theme->info['name'], - 'page arguments' => array('system_theme_settings', $theme->name), - 'type' => MENU_LOCAL_TASK, - 'access callback' => '_system_themes_access', - 'access arguments' => array($theme), - ); - } - - // Modules: - $items['admin/build/modules'] = array( - 'title' => 'Modules', - 'description' => 'Enable or disable add-on modules for your site.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_modules'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/build/modules/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['admin/build/modules/list/confirm'] = array( - 'title' => 'List', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK, - ); - $items['admin/build/modules/uninstall'] = array( - 'title' => 'Uninstall', - 'page arguments' => array('system_modules_uninstall'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/modules/uninstall/confirm'] = array( - 'title' => 'Uninstall', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK, - ); - - // Actions: - $items['admin/settings/actions'] = array( - 'title' => 'Actions', - 'description' => 'Manage the actions defined for your site.', - 'access arguments' => array('administer actions'), - 'page callback' => 'system_actions_manage' - ); - $items['admin/settings/actions/manage'] = array( - 'title' => 'Manage actions', - 'description' => 'Manage the actions defined for your site.', - 'page callback' => 'system_actions_manage', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -2, - ); - $items['admin/settings/actions/configure'] = array( - 'title' => 'Configure an advanced action', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_actions_configure'), - 'access arguments' => array('administer actions'), - 'type' => MENU_CALLBACK, - ); - $items['admin/settings/actions/delete/%actions'] = array( - 'title' => 'Delete action', - 'description' => 'Delete an action.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_actions_delete_form', 4), - 'access arguments' => array('administer actions'), - 'type' => MENU_CALLBACK, - ); - $items['admin/settings/actions/orphan'] = array( - 'title' => 'Remove orphans', - 'page callback' => 'system_actions_remove_orphans', - 'access arguments' => array('administer actions'), - 'type' => MENU_CALLBACK, - ); - - // IP address blocking. - $items['admin/settings/ip-blocking'] = array( - 'title' => 'IP address blocking', - 'description' => 'Manage blocked IP addresses.', - 'page callback' => 'system_ip_blocking', - 'access arguments' => array('block IP addresses'), - ); - $items['admin/settings/ip-blocking/%'] = array( - 'title' => 'IP address blocking', - 'description' => 'Manage blocked IP addresses.', - 'page callback' => 'system_ip_blocking', - 'access arguments' => array('block IP addresses'), - 'type' => MENU_CALLBACK, - ); - $items['admin/settings/ip-blocking/delete/%blocked_ip'] = array( - 'title' => 'Delete IP address', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_ip_blocking_delete', 4), - 'access arguments' => array('block IP addresses'), - 'type' => MENU_CALLBACK, - ); - - // Settings: - $items['admin/settings/site-information'] = array( - 'title' => 'Site information', - 'description' => 'Change basic site information, such as the site name, slogan, e-mail address, mission, front page and more.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_site_information_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/logging'] = array( - 'title' => 'Logging and errors', - 'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.", - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_logging_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/logging/settings'] = array( - 'title' => 'Settings', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -1, - ); - $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'), - ); - $items['admin/settings/file-system'] = array( - 'title' => 'File system', - 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_file_system_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/image-toolkit'] = array( - 'title' => 'Image toolkit', - 'description' => 'Choose which image toolkit to use if you have installed optional toolkits.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_image_toolkit_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/content/rss-publishing'] = array( - 'title' => 'RSS publishing', - 'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_rss_feeds_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/regional-settings'] = array( - 'title' => 'Regional settings', - 'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.", - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_regional_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/regional-settings/lookup'] = array( - 'title' => 'Date and time lookup', - 'type' => MENU_CALLBACK, - 'page callback' => 'system_date_time_lookup', - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/maintenance-mode'] = array( - 'title' => 'Maintenance mode', - 'description' => 'Take the site offline for maintenance or bring it back online.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_site_maintenance_mode'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/clean-urls'] = array( - 'title' => 'Clean URLs', - 'description' => 'Enable or disable clean URLs for your site.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('system_clean_url_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/settings/clean-urls/check'] = array( - 'title' => 'Clean URL check', - 'page callback' => 'drupal_json', - 'page arguments' => array(array('status' => TRUE)), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - // Reports: - $items['admin/reports'] = array( - 'title' => 'Reports', - 'description' => 'View reports from system logs and other status information.', - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access site reports'), - 'weight' => 5, - 'position' => 'left', - ); - $items['admin/reports/status'] = array( - 'title' => 'Status report', - 'description' => "Get a status report about your site's operation and any detected problems.", - 'page callback' => 'system_status', - 'weight' => 10, - 'access arguments' => array('administer site configuration'), - ); - $items['admin/reports/status/run-cron'] = array( - 'title' => 'Run cron', - 'page callback' => 'system_run_cron', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK, - ); - $items['admin/reports/status/php'] = array( - 'title' => 'PHP', - 'page callback' => 'system_php', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK, - ); - $items['admin/reports/status/sql'] = array( - 'title' => 'SQL', - 'page callback' => 'system_sql', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK, - ); - // Default page for batch operations - $items['batch'] = array( - 'page callback' => 'system_batch_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - return $items; -} - -/** * Retrieve a blocked IP address from the database. * * @param $iid integer @@ -775,23 +77,6 @@ function _system_themes_access($theme) { } /** - * Implementation of hook_init(). - */ -function system_init() { - // Use the administrative theme if the user is looking at a page in the admin/* path. - if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) { - global $custom_theme; - $custom_theme = variable_get('admin_theme', 0); - drupal_add_css(drupal_get_path('module', 'system') . '/admin.css'); - } - - // Add the CSS for this module. - drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css'); - drupal_add_css(drupal_get_path('module', 'system') . '/system.css'); - drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css'); -} - -/** * Implementation of MODULE_preprocess_HOOK(). */ function system_preprocess_page(&$variables) { @@ -1608,68 +893,6 @@ function system_cron() { } /** - * Implementation of hook_hook_info(). - */ -function system_hook_info() { - return array( - 'system' => array( - 'cron' => array( - 'run' => array( - 'runs when' => t('When cron runs'), - ), - ), - ), - ); -} - -/** - * Implementation of hook_action_info(). - */ -function system_action_info() { - return array( - 'system_message_action' => array( - 'type' => 'system', - 'description' => t('Display a message to the user'), - 'configurable' => TRUE, - 'hooks' => array( - 'node' => array('view', 'insert', 'update', 'delete'), - 'comment' => array('view', 'insert', 'update', 'delete'), - 'user' => array('view', 'insert', 'update', 'delete', 'login'), - 'taxonomy' => array('insert', 'update', 'delete'), - ), - ), - 'system_send_email_action' => array( - 'description' => t('Send e-mail'), - 'type' => 'system', - 'configurable' => TRUE, - 'hooks' => array( - 'node' => array('view', 'insert', 'update', 'delete'), - 'comment' => array('view', 'insert', 'update', 'delete'), - 'user' => array('view', 'insert', 'update', 'delete', 'login'), - 'taxonomy' => array('insert', 'update', 'delete'), - 'cron' => array('run'), - ) - ), - 'system_block_ip_action' => array( - 'description' => t('Ban IP address of current user'), - 'type' => 'user', - 'configurable' => FALSE, - 'hooks' => array(), - ), - 'system_goto_action' => array( - 'description' => t('Redirect to URL'), - 'type' => 'system', - 'configurable' => TRUE, - 'hooks' => array( - 'node' => array('view', 'insert', 'update', 'delete'), - 'comment' => array('view', 'insert', 'update', 'delete'), - 'user' => array('view', 'insert', 'update', 'delete', 'login'), - ) - ) - ); -} - -/** * Menu callback. Display an overview of available and configured actions. */ function system_actions_manage() { Index: modules/system/system.registry.inc =================================================================== RCS file: modules/system/system.registry.inc diff -N modules/system/system.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/system/system.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,381 @@ + 'File download', + 'page callback' => 'file_download', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['system/ahah'] = array( + 'title' => 'AHAH callback', + 'page callback' => 'form_ahah_callback', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['system/timezone'] = array( + 'title' => 'Time zone', + 'page callback' => 'system_timezone', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + $items['admin'] = array( + 'title' => 'Administer', + 'access arguments' => array('access administration pages'), + 'page callback' => 'system_main_admin_page', + 'weight' => 9, + 'menu_name' => 'management', + ); + $items['admin/compact'] = array( + 'title' => 'Compact mode', + 'page callback' => 'system_admin_compact_page', + 'access arguments' => array('access administration pages'), + 'type' => MENU_CALLBACK, + ); + $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, + ); + $items['admin/by-module'] = array( + 'title' => 'By module', + 'page callback' => 'system_admin_by_module', + 'access arguments' => array('access administration pages'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + $items['admin/content'] = array( + 'title' => 'Content management', + 'description' => "Manage your site's content.", + 'position' => 'left', + 'weight' => -10, + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + ); + + // menu items that are basically just menu blocks + $items['admin/settings'] = array( + 'title' => 'Site configuration', + 'description' => 'Configure site settings.', + 'position' => 'right', + 'weight' => -5, + 'page callback' => 'system_settings_overview', + 'access arguments' => array('access administration pages'), + ); + $items['admin/build'] = array( + 'title' => 'Site building', + 'description' => 'Control how your site looks and feels.', + 'position' => 'right', + 'weight' => -10, + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + ); + // Themes: + $items['admin/build/themes'] = array( + 'title' => 'Themes', + 'description' => 'Change which theme your site uses or allows users to set.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_themes_form'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/build/themes/select'] = array( + 'title' => 'List', + 'description' => 'Select the default theme for your site.', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -1, + ); + $items['admin/build/themes/settings'] = array( + 'title' => 'Configure', + 'page arguments' => array('system_theme_settings'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + ); + // Theme configuration subtabs + $items['admin/build/themes/settings/global'] = array( + 'title' => 'Global settings', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -1, + ); + + foreach (list_themes() as $theme) { + $items['admin/build/themes/settings/' . $theme->name] = array( + 'title' => $theme->info['name'], + 'page arguments' => array('system_theme_settings', $theme->name), + 'type' => MENU_LOCAL_TASK, + 'access callback' => '_system_themes_access', + 'access arguments' => array($theme), + ); + } + + // Modules: + $items['admin/build/modules'] = array( + 'title' => 'Modules', + 'description' => 'Enable or disable add-on modules for your site.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_modules'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/build/modules/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['admin/build/modules/list/confirm'] = array( + 'title' => 'List', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + $items['admin/build/modules/uninstall'] = array( + 'title' => 'Uninstall', + 'page arguments' => array('system_modules_uninstall'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/modules/uninstall/confirm'] = array( + 'title' => 'Uninstall', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + + // Actions: + $items['admin/settings/actions'] = array( + 'title' => 'Actions', + 'description' => 'Manage the actions defined for your site.', + 'access arguments' => array('administer actions'), + 'page callback' => 'system_actions_manage' + ); + $items['admin/settings/actions/manage'] = array( + 'title' => 'Manage actions', + 'description' => 'Manage the actions defined for your site.', + 'page callback' => 'system_actions_manage', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -2, + ); + $items['admin/settings/actions/configure'] = array( + 'title' => 'Configure an advanced action', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_actions_configure'), + 'access arguments' => array('administer actions'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/actions/delete/%actions'] = array( + 'title' => 'Delete action', + 'description' => 'Delete an action.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_actions_delete_form', 4), + 'access arguments' => array('administer actions'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/actions/orphan'] = array( + 'title' => 'Remove orphans', + 'page callback' => 'system_actions_remove_orphans', + 'access arguments' => array('administer actions'), + 'type' => MENU_CALLBACK, + ); + + // IP address blocking. + $items['admin/settings/ip-blocking'] = array( + 'title' => 'IP address blocking', + 'description' => 'Manage blocked IP addresses.', + 'page callback' => 'system_ip_blocking', + 'access arguments' => array('block IP addresses'), + ); + $items['admin/settings/ip-blocking/%'] = array( + 'title' => 'IP address blocking', + 'description' => 'Manage blocked IP addresses.', + 'page callback' => 'system_ip_blocking', + 'access arguments' => array('block IP addresses'), + 'type' => MENU_CALLBACK, + ); + $items['admin/settings/ip-blocking/delete/%blocked_ip'] = array( + 'title' => 'Delete IP address', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_ip_blocking_delete', 4), + 'access arguments' => array('block IP addresses'), + 'type' => MENU_CALLBACK, + ); + + // Settings: + $items['admin/settings/site-information'] = array( + 'title' => 'Site information', + 'description' => 'Change basic site information, such as the site name, slogan, e-mail address, mission, front page and more.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_site_information_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/logging'] = array( + 'title' => 'Logging and errors', + 'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.", + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_logging_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/logging/settings'] = array( + 'title' => 'Settings', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -1, + ); + $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'), + ); + $items['admin/settings/file-system'] = array( + 'title' => 'File system', + 'description' => 'Tell Drupal where to store uploaded files and how they are accessed.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_file_system_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/image-toolkit'] = array( + 'title' => 'Image toolkit', + 'description' => 'Choose which image toolkit to use if you have installed optional toolkits.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_image_toolkit_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/content/rss-publishing'] = array( + 'title' => 'RSS publishing', + 'description' => 'Configure the site description, the number of items per feed and whether feeds should be titles/teasers/full-text.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_rss_feeds_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/regional-settings'] = array( + 'title' => 'Regional settings', + 'description' => "Settings for how Drupal displays date and time, as well as the system's default time zone.", + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_regional_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/regional-settings/lookup'] = array( + 'title' => 'Date and time lookup', + 'type' => MENU_CALLBACK, + 'page callback' => 'system_date_time_lookup', + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/maintenance-mode'] = array( + 'title' => 'Maintenance mode', + 'description' => 'Take the site offline for maintenance or bring it back online.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_site_maintenance_mode'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/clean-urls'] = array( + 'title' => 'Clean URLs', + 'description' => 'Enable or disable clean URLs for your site.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('system_clean_url_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/settings/clean-urls/check'] = array( + 'title' => 'Clean URL check', + 'page callback' => 'drupal_json', + 'page arguments' => array(array('status' => TRUE)), + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + // Reports: + $items['admin/reports'] = array( + 'title' => 'Reports', + 'description' => 'View reports from system logs and other status information.', + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access site reports'), + 'weight' => 5, + 'position' => 'left', + ); + $items['admin/reports/status'] = array( + 'title' => 'Status report', + 'description' => "Get a status report about your site's operation and any detected problems.", + 'page callback' => 'system_status', + 'weight' => 10, + 'access arguments' => array('administer site configuration'), + ); + $items['admin/reports/status/run-cron'] = array( + 'title' => 'Run cron', + 'page callback' => 'system_run_cron', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + $items['admin/reports/status/php'] = array( + 'title' => 'PHP', + 'page callback' => 'system_php', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + $items['admin/reports/status/sql'] = array( + 'title' => 'SQL', + 'page callback' => 'system_sql', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + // Default page for batch operations + $items['batch'] = array( + 'page callback' => 'system_batch_page', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function system_theme() { + return array_merge(drupal_common_theme(), array( + 'system_theme_select_form' => array( + 'arguments' => array('form' => NULL), + ), + 'system_themes_form' => array( + 'arguments' => array('form' => NULL), + ), + 'system_modules_fieldset' => array( + 'arguments' => array('form' => NULL), + ), + 'system_modules_incompatible' => array( + 'arguments' => array('message' => NULL), + ), + 'system_modules_uninstall' => array( + 'arguments' => array('form' => NULL), + ), + 'status_report' => array( + 'arguments' => array('requirements' => NULL), + ), + 'admin_page' => array( + 'arguments' => array('blocks' => NULL), + ), + 'admin_block' => array( + 'arguments' => array('block' => NULL), + ), + 'admin_block_content' => array( + 'arguments' => array('content' => NULL), + ), + 'system_admin_by_module' => array( + 'arguments' => array('menu_items' => NULL), + ), + 'system_powered_by' => array( + 'arguments' => array('image_path' => NULL), + ), + 'meta_generator_html' => array( + 'arguments' => array('version' => NULL), + ), + 'meta_generator_header' => array( + 'arguments' => array('version' => NULL), + ), + 'system_compact_link' => array(), + )); +} + Index: modules/taxonomy/taxonomy.alter.inc =================================================================== RCS file: modules/taxonomy/taxonomy.alter.inc diff -N modules/taxonomy/taxonomy.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/taxonomy/taxonomy.alter.inc 20 May 2009 21:14:44 -0000 @@ -0,0 +1,96 @@ +taxonomy)) { + $terms = empty($node->nid) ? array() : taxonomy_node_get_terms($node); + } + else { + // After preview the terms must be converted to objects. + if (isset($form_state['node_preview'])) { + $node->taxonomy = taxonomy_preview_terms($node); + } + $terms = $node->taxonomy; + } + $query = db_select('taxonomy_vocabulary', 'v'); + $query->join('taxonomy_vocabulary_node_type', 'n', 'v.vid = n.vid'); + $query->addTag('term_access'); + + $result = $query + ->fields('v') + ->condition('n.type', $node->type) + ->orderBy('v.weight') + ->orderBy('v.name') + ->execute(); + + foreach ($result as $vocabulary) { + if ($vocabulary->tags) { + if (isset($form_state['node_preview'])) { + // Typed string can be changed by the user before preview, + // so we just insert the tags directly as provided in the form. + $typed_string = $node->taxonomy['tags'][$vocabulary->vid]; + } + else { + $typed_string = taxonomy_implode_tags($terms, $vocabulary->vid) . (array_key_exists('tags', $terms) ? $terms['tags'][$vocabulary->vid] : NULL); + } + if ($vocabulary->help) { + $help = filter_xss_admin($vocabulary->help); + } + else { + $help = t('A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc."'); + } + $form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', + '#title' => $vocabulary->name, + '#description' => $help, + '#required' => $vocabulary->required, + '#default_value' => $typed_string, + '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid, + '#weight' => $vocabulary->weight, + '#maxlength' => 1024, + ); + } + else { + // Extract terms belonging to the vocabulary in question. + $default_terms = array(); + foreach ($terms as $term) { + // Free tagging has no default terms and also no vid after preview. + if (isset($term->vid) && $term->vid == $vocabulary->vid) { + $default_terms[$term->tid] = $term; + } + } + $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, array_keys($default_terms), filter_xss_admin($vocabulary->help)); + $form['taxonomy'][$vocabulary->vid]['#weight'] = $vocabulary->weight; + $form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required; + } + } + if (!empty($form['taxonomy']) && is_array($form['taxonomy'])) { + if (count($form['taxonomy']) > 1) { + // Add fieldset only if form has more than 1 element. + $form['taxonomy'] += array( + '#type' => 'fieldset', + '#title' => t('Vocabularies'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + ); + } + $form['taxonomy']['#weight'] = -3; + $form['taxonomy']['#tree'] = TRUE; + } + } +} + Index: modules/taxonomy/taxonomy.bootstrap.inc =================================================================== RCS file: modules/taxonomy/taxonomy.bootstrap.inc diff -N modules/taxonomy/taxonomy.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/taxonomy/taxonomy.bootstrap.inc 20 May 2009 21:31:56 -0000 @@ -0,0 +1,65 @@ +' . t('The taxonomy module allows you to categorize content using various systems of classification. Free-tagging vocabularies are created by users on the fly when they submit posts (as commonly found in blogs and social bookmarking applications). Controlled vocabularies allow for administrator-defined short lists of terms as well as complex hierarchies with multiple relationships between different terms. These methods can be applied to different content types and combined together to create a powerful and flexible method of classifying and presenting your content.') . ''; + $output .= '' . t('For example, when creating a recipe site, you might want to classify posts by both the type of meal and preparation time. A vocabulary for each allows you to categorize using each criteria independently instead of creating a tag for every possible combination.') . '
'; + $output .= '' . t('Type of Meal: Appetizer, Main Course, Salad, Dessert') . '
'; + $output .= '' . t('Preparation Time: 0-30mins, 30-60mins, 1-2 hrs, 2hrs+') . '
'; + $output .= '' . t("Each taxonomy term (often called a 'category' or 'tag' in other systems) automatically provides lists of posts and a corresponding RSS feed. These taxonomy/term URLs can be manipulated to generate AND and OR lists of posts classified with terms. In our recipe site example, it then becomes easy to create pages displaying 'Main courses', '30 minute recipes', or '30 minute main courses and appetizers' by using terms on their own or in combination with others. There are a significant number of contributed modules which you to alter and extend the behavior of the core module for both display and organization of terms.") . '
'; + $output .= '' . t("Terms can also be organized in parent/child relationships from the admin interface. An example would be a vocabulary grouping countries under their parent geo-political regions. The taxonomy module also enables advanced implementations of hierarchy, for example placing Turkey in both the 'Middle East' and 'Europe'.") . '
'; + $output .= '' . t('The taxonomy module supports the use of both synonyms and related terms, but does not directly use this functionality. However, optional contributed or custom modules may make full use of these advanced features.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Taxonomy module.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '
'; + return $output; + case 'admin/content/taxonomy': + $output = '' . t("The taxonomy module allows you to categorize your content using both tags and administrator defined terms. It is a flexible tool for classifying content with many advanced features. To begin, create a 'Vocabulary' to hold one set of terms or tags. You can create one free-tagging vocabulary for everything, or separate controlled vocabularies to define the various properties of your content, for example 'Countries' or 'Colors'.") . '
'; + $output .= '' . t('Use the list below to configure and review the vocabularies defined on your site, or to list and manage the terms (tags) they contain. A vocabulary may (optionally) be tied to specific content types as shown in the Type column and, if so, will be displayed when creating or editing posts of that type. Multiple vocabularies tied to the same content type will be displayed in the order shown below. To change the order of a vocabulary, grab a drag-and-drop handle under the Name column and drag it to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save button at the bottom of the page.') . '
'; + return $output; + case 'admin/content/taxonomy/%/list': + $vocabulary = taxonomy_vocabulary_load($arg[3]); + if ($vocabulary->tags) { + return '' . t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '
'; + } + switch ($vocabulary->hierarchy) { + case 0: + return '' . t('%capital_name is a flat vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '
'; + case 1: + return '' . t('%capital_name is a single hierarchy vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '
'; + case 2: + return '' . t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the edit link next to the term. Drag and drop of multiple hierarchies is not supported, but you can re-enable drag and drop support by editing each term to include only a single parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '
'; + } + case 'admin/content/taxonomy/add': + return '' . t('Define how your vocabulary will be presented to administrators and users, and which content types to categorize with it. Tags allows users to create terms when submitting posts by typing a comma separated list. Otherwise terms are chosen from a select list and can only be created by users with the "administer taxonomy" permission.') . '
'; + } +} + +/** + * Implementation of hook_hook_info(). + */ +function taxonomy_hook_info() { + return array( + 'taxonomy' => array( + 'taxonomy' => array( + 'insert' => array( + 'runs when' => t('After saving a new term to the database'), + ), + 'update' => array( + 'runs when' => t('After saving an updated term to the database'), + ), + 'delete' => array( + 'runs when' => t('After deleting a term') + ), + ), + ), + ); +} Index: modules/taxonomy/taxonomy.info =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.info,v retrieving revision 1.8 diff -u -p -r1.8 taxonomy.info --- modules/taxonomy/taxonomy.info 11 Oct 2008 02:33:06 -0000 1.8 +++ modules/taxonomy/taxonomy.info 20 May 2009 21:14:44 -0000 @@ -8,3 +8,6 @@ files[] = taxonomy.module files[] = taxonomy.admin.inc files[] = taxonomy.pages.inc files[] = taxonomy.install +files[] = taxonomy.registry.inc +files[] = taxonomy.bootstrap.inc +files[] = taxonomy.alter.inc Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.473 diff -u -p -r1.473 taxonomy.module --- modules/taxonomy/taxonomy.module 19 May 2009 19:01:51 -0000 1.473 +++ modules/taxonomy/taxonomy.module 20 May 2009 21:31:56 -0000 @@ -19,23 +19,6 @@ function taxonomy_perm() { } /** - * Implementation of hook_theme(). - */ -function taxonomy_theme() { - return array( - 'taxonomy_term_select' => array( - 'arguments' => array('element' => NULL), - ), - 'taxonomy_overview_vocabularies' => array( - 'arguments' => array('form' => array()), - ), - 'taxonomy_overview_terms' => array( - 'arguments' => array('form' => array()), - ), - ); -} - -/** * An implementation of hook_node_view(). */ function taxonomy_node_view($node) { @@ -112,97 +95,6 @@ function taxonomy_term_path($term) { } /** - * Implementation of hook_menu(). - */ -function taxonomy_menu() { - $items['admin/content/taxonomy'] = array( - 'title' => 'Taxonomy', - 'description' => 'Manage tagging, categorization, and classification of your content.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('taxonomy_overview_vocabularies'), - 'access arguments' => array('administer taxonomy'), - ); - - $items['admin/content/taxonomy/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - - $items['admin/content/taxonomy/add'] = array( - 'title' => 'Add vocabulary', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('taxonomy_form_vocabulary'), - 'access arguments' => array('administer taxonomy'), - 'type' => MENU_LOCAL_TASK, - ); - - $items['taxonomy/term/%taxonomy_terms'] = array( - 'title' => 'Taxonomy term', - 'page callback' => 'taxonomy_term_page', - 'page arguments' => array(2), - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['taxonomy/term/%taxonomy_terms/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - - $items['taxonomy/term/%taxonomy_term/edit'] = array( - 'title' => 'Edit term', - 'page callback' => 'taxonomy_term_edit', - 'page arguments' => array(2), - 'access arguments' => array('administer taxonomy'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 10, - ); - - $items['taxonomy/autocomplete'] = array( - 'title' => 'Autocomplete taxonomy', - 'page callback' => 'taxonomy_autocomplete', - 'access arguments' => array('access content'), - 'type' => MENU_CALLBACK, - ); - - $items['admin/content/taxonomy/%taxonomy_vocabulary'] = array( - 'title' => 'Vocabulary', // this is replaced by callback - 'page callback' => 'drupal_get_form', - 'page arguments' => array('taxonomy_form_vocabulary', 3), - 'title callback' => 'taxonomy_admin_vocabulary_title_callback', - 'title arguments' => array(3), - 'access arguments' => array('administer taxonomy'), - 'type' => MENU_CALLBACK, - ); - - $items['admin/content/taxonomy/%taxonomy_vocabulary/edit'] = array( - 'title' => 'Edit vocabulary', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -20, - ); - - $items['admin/content/taxonomy/%taxonomy_vocabulary/list'] = array( - 'title' => 'List terms', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('taxonomy_overview_terms', 3), - 'access arguments' => array('administer taxonomy'), - 'type' => MENU_LOCAL_TASK, - 'weight' => -10, - ); - - $items['admin/content/taxonomy/%taxonomy_vocabulary/add'] = array( - 'title' => 'Add term', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('taxonomy_form_term', 3), - 'access arguments' => array('administer taxonomy'), - 'type' => MENU_LOCAL_TASK, - ); - - return $items; -} - -/** * Return the vocabulary name given the vocabulary object. */ function taxonomy_admin_vocabulary_title_callback($vocabulary) { @@ -572,94 +464,6 @@ function taxonomy_get_vocabularies($type } /** - * Implementation of hook_form_alter(). - * Generate a form for selecting terms to associate with a node. - * We check for taxonomy_override_selector before loading the full - * vocabulary, so contrib modules can intercept before hook_form_alter - * and provide scalable alternatives. - */ -function taxonomy_form_alter(&$form, $form_state, $form_id) { - if (!variable_get('taxonomy_override_selector', FALSE) && !empty($form['#node_edit_form'])) { - $node = $form['#node']; - - if (!isset($node->taxonomy)) { - $terms = empty($node->nid) ? array() : taxonomy_node_get_terms($node); - } - else { - // After preview the terms must be converted to objects. - if (isset($form_state['node_preview'])) { - $node->taxonomy = taxonomy_preview_terms($node); - } - $terms = $node->taxonomy; - } - $query = db_select('taxonomy_vocabulary', 'v'); - $query->join('taxonomy_vocabulary_node_type', 'n', 'v.vid = n.vid'); - $query->addTag('term_access'); - - $result = $query - ->fields('v') - ->condition('n.type', $node->type) - ->orderBy('v.weight') - ->orderBy('v.name') - ->execute(); - - foreach ($result as $vocabulary) { - if ($vocabulary->tags) { - if (isset($form_state['node_preview'])) { - // Typed string can be changed by the user before preview, - // so we just insert the tags directly as provided in the form. - $typed_string = $node->taxonomy['tags'][$vocabulary->vid]; - } - else { - $typed_string = taxonomy_implode_tags($terms, $vocabulary->vid) . (array_key_exists('tags', $terms) ? $terms['tags'][$vocabulary->vid] : NULL); - } - if ($vocabulary->help) { - $help = filter_xss_admin($vocabulary->help); - } - else { - $help = t('A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc."'); - } - $form['taxonomy']['tags'][$vocabulary->vid] = array('#type' => 'textfield', - '#title' => $vocabulary->name, - '#description' => $help, - '#required' => $vocabulary->required, - '#default_value' => $typed_string, - '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid, - '#weight' => $vocabulary->weight, - '#maxlength' => 1024, - ); - } - else { - // Extract terms belonging to the vocabulary in question. - $default_terms = array(); - foreach ($terms as $term) { - // Free tagging has no default terms and also no vid after preview. - if (isset($term->vid) && $term->vid == $vocabulary->vid) { - $default_terms[$term->tid] = $term; - } - } - $form['taxonomy'][$vocabulary->vid] = taxonomy_form($vocabulary->vid, array_keys($default_terms), filter_xss_admin($vocabulary->help)); - $form['taxonomy'][$vocabulary->vid]['#weight'] = $vocabulary->weight; - $form['taxonomy'][$vocabulary->vid]['#required'] = $vocabulary->required; - } - } - if (!empty($form['taxonomy']) && is_array($form['taxonomy'])) { - if (count($form['taxonomy']) > 1) { - // Add fieldset only if form has more than 1 element. - $form['taxonomy'] += array( - '#type' => 'fieldset', - '#title' => t('Vocabularies'), - '#collapsible' => TRUE, - '#collapsed' => FALSE, - ); - } - $form['taxonomy']['#weight'] = -3; - $form['taxonomy']['#tree'] = TRUE; - } - } -} - -/** * Helper function to convert terms after a preview. * * After preview the tags are an array instead of proper objects. This function @@ -1687,43 +1491,6 @@ function taxonomy_terms_parse_string($st } /** - * Implementation of hook_help(). - */ -function taxonomy_help($path, $arg) { - switch ($path) { - case 'admin/help#taxonomy': - $output = '' . t('The taxonomy module allows you to categorize content using various systems of classification. Free-tagging vocabularies are created by users on the fly when they submit posts (as commonly found in blogs and social bookmarking applications). Controlled vocabularies allow for administrator-defined short lists of terms as well as complex hierarchies with multiple relationships between different terms. These methods can be applied to different content types and combined together to create a powerful and flexible method of classifying and presenting your content.') . '
'; - $output .= '' . t('For example, when creating a recipe site, you might want to classify posts by both the type of meal and preparation time. A vocabulary for each allows you to categorize using each criteria independently instead of creating a tag for every possible combination.') . '
'; - $output .= '' . t('Type of Meal: Appetizer, Main Course, Salad, Dessert') . '
'; - $output .= '' . t('Preparation Time: 0-30mins, 30-60mins, 1-2 hrs, 2hrs+') . '
'; - $output .= '' . t("Each taxonomy term (often called a 'category' or 'tag' in other systems) automatically provides lists of posts and a corresponding RSS feed. These taxonomy/term URLs can be manipulated to generate AND and OR lists of posts classified with terms. In our recipe site example, it then becomes easy to create pages displaying 'Main courses', '30 minute recipes', or '30 minute main courses and appetizers' by using terms on their own or in combination with others. There are a significant number of contributed modules which you to alter and extend the behavior of the core module for both display and organization of terms.") . '
'; - $output .= '' . t("Terms can also be organized in parent/child relationships from the admin interface. An example would be a vocabulary grouping countries under their parent geo-political regions. The taxonomy module also enables advanced implementations of hierarchy, for example placing Turkey in both the 'Middle East' and 'Europe'.") . '
'; - $output .= '' . t('The taxonomy module supports the use of both synonyms and related terms, but does not directly use this functionality. However, optional contributed or custom modules may make full use of these advanced features.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Taxonomy module.', array('@taxonomy' => 'http://drupal.org/handbook/modules/taxonomy/')) . '
'; - return $output; - case 'admin/content/taxonomy': - $output = '' . t("The taxonomy module allows you to categorize your content using both tags and administrator defined terms. It is a flexible tool for classifying content with many advanced features. To begin, create a 'Vocabulary' to hold one set of terms or tags. You can create one free-tagging vocabulary for everything, or separate controlled vocabularies to define the various properties of your content, for example 'Countries' or 'Colors'.") . '
'; - $output .= '' . t('Use the list below to configure and review the vocabularies defined on your site, or to list and manage the terms (tags) they contain. A vocabulary may (optionally) be tied to specific content types as shown in the Type column and, if so, will be displayed when creating or editing posts of that type. Multiple vocabularies tied to the same content type will be displayed in the order shown below. To change the order of a vocabulary, grab a drag-and-drop handle under the Name column and drag it to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Remember that your changes will not be saved until you click the Save button at the bottom of the page.') . '
'; - return $output; - case 'admin/content/taxonomy/%/list': - $vocabulary = taxonomy_vocabulary_load($arg[3]); - if ($vocabulary->tags) { - return '' . t('%capital_name is a free-tagging vocabulary. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '
'; - } - switch ($vocabulary->hierarchy) { - case 0: - return '' . t('%capital_name is a flat vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '
'; - case 1: - return '' . t('%capital_name is a single hierarchy vocabulary. You may organize the terms in the %name vocabulary by using the handles on the left side of the table. To change the name or description of a term, click the edit link next to the term.', array('%capital_name' => drupal_ucfirst($vocabulary->name), '%name' => $vocabulary->name)) . '
'; - case 2: - return '' . t('%capital_name is a multiple hierarchy vocabulary. To change the name or description of a term, click the edit link next to the term. Drag and drop of multiple hierarchies is not supported, but you can re-enable drag and drop support by editing each term to include only a single parent.', array('%capital_name' => drupal_ucfirst($vocabulary->name))) . '
'; - } - case 'admin/content/taxonomy/add': - return '' . t('Define how your vocabulary will be presented to administrators and users, and which content types to categorize with it. Tags allows users to create terms when submitting posts by typing a comma separated list. Otherwise terms are chosen from a select list and can only be created by users with the "administer taxonomy" permission.') . '
'; - } -} - -/** * Helper function for array_map purposes. */ function _taxonomy_get_tid_from_term($term) { @@ -1750,23 +1517,3 @@ function taxonomy_implode_tags($tags, $v return implode(', ', $typed_tags); } -/** - * Implementation of hook_hook_info(). - */ -function taxonomy_hook_info() { - return array( - 'taxonomy' => array( - 'taxonomy' => array( - 'insert' => array( - 'runs when' => t('After saving a new term to the database'), - ), - 'update' => array( - 'runs when' => t('After saving an updated term to the database'), - ), - 'delete' => array( - 'runs when' => t('After deleting a term') - ), - ), - ), - ); -} Index: modules/taxonomy/taxonomy.registry.inc =================================================================== RCS file: modules/taxonomy/taxonomy.registry.inc diff -N modules/taxonomy/taxonomy.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/taxonomy/taxonomy.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,116 @@ + 'Taxonomy', + 'description' => 'Manage tagging, categorization, and classification of your content.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('taxonomy_overview_vocabularies'), + 'access arguments' => array('administer taxonomy'), + ); + + $items['admin/content/taxonomy/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + + $items['admin/content/taxonomy/add'] = array( + 'title' => 'Add vocabulary', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('taxonomy_form_vocabulary'), + 'access arguments' => array('administer taxonomy'), + 'type' => MENU_LOCAL_TASK, + ); + + $items['taxonomy/term/%taxonomy_terms'] = array( + 'title' => 'Taxonomy term', + 'page callback' => 'taxonomy_term_page', + 'page arguments' => array(2), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['taxonomy/term/%taxonomy_terms/view'] = array( + 'title' => 'View', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + + $items['taxonomy/term/%taxonomy_term/edit'] = array( + 'title' => 'Edit term', + 'page callback' => 'taxonomy_term_edit', + 'page arguments' => array(2), + 'access arguments' => array('administer taxonomy'), + 'type' => MENU_LOCAL_TASK, + 'weight' => 10, + ); + + $items['taxonomy/autocomplete'] = array( + 'title' => 'Autocomplete taxonomy', + 'page callback' => 'taxonomy_autocomplete', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/content/taxonomy/%taxonomy_vocabulary'] = array( + 'title' => 'Vocabulary', // this is replaced by callback + 'page callback' => 'drupal_get_form', + 'page arguments' => array('taxonomy_form_vocabulary', 3), + 'title callback' => 'taxonomy_admin_vocabulary_title_callback', + 'title arguments' => array(3), + 'access arguments' => array('administer taxonomy'), + 'type' => MENU_CALLBACK, + ); + + $items['admin/content/taxonomy/%taxonomy_vocabulary/edit'] = array( + 'title' => 'Edit vocabulary', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -20, + ); + + $items['admin/content/taxonomy/%taxonomy_vocabulary/list'] = array( + 'title' => 'List terms', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('taxonomy_overview_terms', 3), + 'access arguments' => array('administer taxonomy'), + 'type' => MENU_LOCAL_TASK, + 'weight' => -10, + ); + + $items['admin/content/taxonomy/%taxonomy_vocabulary/add'] = array( + 'title' => 'Add term', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('taxonomy_form_term', 3), + 'access arguments' => array('administer taxonomy'), + 'type' => MENU_LOCAL_TASK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function taxonomy_theme() { + return array( + 'taxonomy_term_select' => array( + 'arguments' => array('element' => NULL), + ), + 'taxonomy_overview_vocabularies' => array( + 'arguments' => array('form' => array()), + ), + 'taxonomy_overview_terms' => array( + 'arguments' => array('form' => array()), + ), + ); +} + Index: modules/tracker/tracker.bootstrap.inc =================================================================== RCS file: modules/tracker/tracker.bootstrap.inc diff -N modules/tracker/tracker.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/tracker/tracker.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,26 @@ +' . t('The tracker module displays the most recently added or updated content on your site, and provides user-level tracking to follow the contributions of particular authors.') . ''; + $output .= '' . t("The Recent posts page is available via a link in the navigation menu block and displays new and recently-updated content (including the content type, the title, the author's name, number of comments, and time of last update) in reverse chronological order. Posts are marked updated when changes occur in the text, or when new comments are added. To use the tracker module to follow a specific user's contributions, select the Track tab from the user's profile page.") . '
'; + $output .= '' . t('For more information, see the online handbook entry for Tracker module.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) . '
'; + return $output; + } +} + Index: modules/tracker/tracker.info =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.info,v retrieving revision 1.8 diff -u -p -r1.8 tracker.info --- modules/tracker/tracker.info 11 Oct 2008 02:33:07 -0000 1.8 +++ modules/tracker/tracker.info 20 May 2009 18:49:52 -0000 @@ -7,3 +7,5 @@ version = VERSION core = 7.x files[] = tracker.module files[] = tracker.pages.inc +files[] = tracker.registry.inc +files[] = tracker.bootstrap.inc Index: modules/tracker/tracker.module =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.module,v retrieving revision 1.157 diff -u -p -r1.157 tracker.module --- modules/tracker/tracker.module 6 May 2008 12:18:51 -0000 1.157 +++ modules/tracker/tracker.module 20 May 2009 18:49:52 -0000 @@ -2,61 +2,6 @@ // $Id: tracker.module,v 1.157 2008/05/06 12:18:51 dries Exp $ /** - * @file - * Enables tracking of recent posts for users. - */ - -/** - * Implementation of hook_help(). - */ -function tracker_help($path, $arg) { - switch ($path) { - case 'admin/help#tracker': - $output = '' . t('The tracker module displays the most recently added or updated content on your site, and provides user-level tracking to follow the contributions of particular authors.') . '
'; - $output .= '' . t("The Recent posts page is available via a link in the navigation menu block and displays new and recently-updated content (including the content type, the title, the author's name, number of comments, and time of last update) in reverse chronological order. Posts are marked updated when changes occur in the text, or when new comments are added. To use the tracker module to follow a specific user's contributions, select the Track tab from the user's profile page.") . '
'; - $output .= '' . t('For more information, see the online handbook entry for Tracker module.', array('@tracker' => 'http://drupal.org/handbook/modules/tracker/')) . '
'; - return $output; - } -} - -/** - * Implementation of hook_menu(). - */ -function tracker_menu() { - $items['tracker'] = array( - 'title' => 'Recent posts', - 'page callback' => 'tracker_page', - 'access arguments' => array('access content'), - 'weight' => 1, - ); - $items['tracker/all'] = array( - 'title' => 'All recent posts', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - $items['tracker/%user_uid_optional'] = array( - 'title' => 'My recent posts', - 'access callback' => '_tracker_myrecent_access', - 'access arguments' => array(1), - 'page arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - ); - - $items['user/%user/track'] = array( - 'title' => 'Track', - 'page callback' => 'tracker_page', - 'page arguments' => array(1, TRUE), - 'access callback' => '_tracker_user_access', - 'access arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - ); - $items['user/%user/track/posts'] = array( - 'title' => 'Track posts', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - return $items; -} - -/** * Access callback for tracker/%user_uid_optional */ function _tracker_myrecent_access($account) { Index: modules/tracker/tracker.registry.inc =================================================================== RCS file: modules/tracker/tracker.registry.inc diff -N modules/tracker/tracker.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/tracker/tracker.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,45 @@ + 'Recent posts', + 'page callback' => 'tracker_page', + 'access arguments' => array('access content'), + 'weight' => 1, + ); + $items['tracker/all'] = array( + 'title' => 'All recent posts', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + $items['tracker/%user_uid_optional'] = array( + 'title' => 'My recent posts', + 'access callback' => '_tracker_myrecent_access', + 'access arguments' => array(1), + 'page arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + ); + + $items['user/%user/track'] = array( + 'title' => 'Track', + 'page callback' => 'tracker_page', + 'page arguments' => array(1, TRUE), + 'access callback' => '_tracker_user_access', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + ); + $items['user/%user/track/posts'] = array( + 'title' => 'Track posts', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + return $items; +} + Index: modules/translation/translation.alter.inc =================================================================== RCS file: modules/translation/translation.alter.inc diff -N modules/translation/translation.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/translation/translation.alter.inc 20 May 2009 22:27:21 -0000 @@ -0,0 +1,76 @@ +enabled languages. You can also turn on translation for this content type, which lets you have content translated to any of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/settings/language'))); +} + +/** + * Implementation of hook_form_alter(). + * + * - Add translation option to content type form. + * - Alters language fields on node forms when a translation + * is about to be created. + */ +function translation_form_alter(&$form, &$form_state, $form_id) { + if (isset($form['#id']) && $form['#id'] == 'node-form' && translation_supported_type($form['#node']->type)) { + $node = $form['#node']; + if (!empty($node->translation_source)) { + // We are creating a translation. Add values and lock language field. + $form['translation_source'] = array('#type' => 'value', '#value' => $node->translation_source); + $form['language']['#disabled'] = TRUE; + } + elseif (!empty($node->nid) && !empty($node->tnid)) { + // Disable languages for existing translations, so it is not possible to switch this + // node to some language which is already in the translation set. Also remove the + // language neutral option. + unset($form['language']['#options']['']); + foreach (translation_node_get_translations($node->tnid) as $translation) { + if ($translation->nid != $node->nid) { + unset($form['language']['#options'][$translation->language]); + } + } + // Add translation values and workflow options. + $form['tnid'] = array('#type' => 'value', '#value' => $node->tnid); + $form['translation'] = array( + '#type' => 'fieldset', + '#title' => t('Translation settings'), + '#access' => user_access('translate content'), + '#collapsible' => TRUE, + '#collapsed' => !$node->translate, + '#tree' => TRUE, + '#weight' => 30, + ); + if ($node->tnid == $node->nid) { + // This is the source node of the translation + $form['translation']['retranslate'] = array( + '#type' => 'checkbox', + '#title' => t('Flag translations as outdated'), + '#default_value' => 0, + '#description' => t('If you made a significant change, which means translations should be updated, you can flag all translations of this post as outdated. This will not change any other property of those posts, like whether they are published or not.'), + ); + $form['translation']['status'] = array('#type' => 'value', '#value' => 0); + } + else { + $form['translation']['status'] = array( + '#type' => 'checkbox', + '#title' => t('This translation needs to be updated'), + '#default_value' => $node->translate, + '#description' => t('When this option is checked, this translation needs to be updated because the source post has changed. Uncheck when the translation is up to date again.'), + ); + } + } + } +} + Index: modules/translation/translation.bootstrap.inc =================================================================== RCS file: modules/translation/translation.bootstrap.inc diff -N modules/translation/translation.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/translation/translation.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,57 @@ +' . t('The content translation module allows content to be translated into different languages. Working with the locale module (which manages enabled languages and provides translation for the site interface), the content translation module is key to creating and maintaining translated site content.', array('@locale' => url('admin/help/locale'))) . ''; + $output .= '' . t('Configuring content translation and translation-enabled content types:') . '
'; + $output .= '' . t('Working with translation-enabled content types:') . '
'; + $output .= '' . t('Use the language switcher block provided by locale module to allow users to select a language. If available, both the site interface and site content are presented in the language selected.', array('@blocks' => url('admin/build/block'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Translation module.', array('@translation' => 'http://drupal.org/handbook/modules/translation/')) . '
'; + return $output; + case 'node/%/translate': + $output = '' . t('Translations of a piece of content are managed with translation sets. Each translation set has one source post and any number of translations in any of the enabled languages. All translations are tracked to be up to date or outdated based on whether the source post was modified significantly.', array('!languages' => url('admin/settings/language'))) . '
'; + return $output; + } +} + Index: modules/translation/translation.info =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.info,v retrieving revision 1.4 diff -u -p -r1.4 translation.info --- modules/translation/translation.info 11 Oct 2008 02:33:09 -0000 1.4 +++ modules/translation/translation.info 20 May 2009 21:14:44 -0000 @@ -7,3 +7,6 @@ version = VERSION core = 7.x files[] = translation.module files[] = translation.pages.inc +files[] = translation.registry.inc +files[] = translation.bootstrap.inc +files[] = translation.alter.inc Index: modules/translation/translation.module =================================================================== RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v retrieving revision 1.45 diff -u -p -r1.45 translation.module --- modules/translation/translation.module 18 May 2009 09:45:01 -0000 1.45 +++ modules/translation/translation.module 20 May 2009 22:27:13 -0000 @@ -2,72 +2,6 @@ // $Id: translation.module,v 1.45 2009/05/18 09:45:01 dries Exp $ /** - * @file - * Manages content translations. - * - * Translations are managed in sets of posts, which represent the same - * information in different languages. Only content types for which the - * administrator explicitly enabled translations could have translations - * associated. Translations are managed in sets with exactly one source - * post per set. The source post is used to translate to different - * languages, so if the source post is significantly updated, the - * editor can decide to mark all translations outdated. - * - * The node table stores the values used by this module: - * - 'tnid' is the translation set id, which equals the node id - * of the source post. - * - 'translate' is a flag, either indicating that the translation - * is up to date (0) or needs to be updated (1). - */ - -/** - * Identifies a content type which has translation support enabled. - */ -define('TRANSLATION_ENABLED', 2); - -/** - * Implementation of hook_help(). - */ -function translation_help($path, $arg) { - switch ($path) { - case 'admin/help#translation': - $output = '' . t('The content translation module allows content to be translated into different languages. Working with the locale module (which manages enabled languages and provides translation for the site interface), the content translation module is key to creating and maintaining translated site content.', array('@locale' => url('admin/help/locale'))) . '
'; - $output .= '' . t('Configuring content translation and translation-enabled content types:') . '
'; - $output .= '' . t('Working with translation-enabled content types:') . '
'; - $output .= '' . t('Use the language switcher block provided by locale module to allow users to select a language. If available, both the site interface and site content are presented in the language selected.', array('@blocks' => url('admin/build/block'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Translation module.', array('@translation' => 'http://drupal.org/handbook/modules/translation/')) . '
'; - return $output; - case 'node/%/translate': - $output = '' . t('Translations of a piece of content are managed with translation sets. Each translation set has one source post and any number of translations in any of the enabled languages. All translations are tracked to be up to date or outdated based on whether the source post was modified significantly.', array('!languages' => url('admin/settings/language'))) . '
'; - return $output; - } -} - -/** - * Implementation of hook_menu(). - */ -function translation_menu() { - $items = array(); - $items['node/%node/translate'] = array( - 'title' => 'Translate', - 'page callback' => 'translation_node_overview', - 'page arguments' => array(1), - 'access callback' => '_translation_tab_access', - 'access arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - ); - return $items; -} - -/** * Menu access callback. * * Only display translation tab for node types, which have translation enabled @@ -94,74 +28,6 @@ function translation_perm() { } /** - * Implementation of hook_form_FORM_ID_alter(). - */ -function translation_form_node_type_form_alter(&$form, &$form_state) { - // Add translation option to content type form. - $form['workflow']['language_content_type']['#options'][TRANSLATION_ENABLED] = t('Enabled, with translation'); - // Description based on text from locale.module. - $form['workflow']['language_content_type']['#description'] = t('Enable multilingual support for this content type. If enabled, a language selection field will be added to the editing form, allowing you to select from one of the enabled languages. You can also turn on translation for this content type, which lets you have content translated to any of the enabled languages. If disabled, new posts are saved with the default language. Existing content will not be affected by changing this option.', array('!languages' => url('admin/settings/language'))); -} - -/** - * Implementation of hook_form_alter(). - * - * - Add translation option to content type form. - * - Alters language fields on node forms when a translation - * is about to be created. - */ -function translation_form_alter(&$form, &$form_state, $form_id) { - if (isset($form['#id']) && $form['#id'] == 'node-form' && translation_supported_type($form['#node']->type)) { - $node = $form['#node']; - if (!empty($node->translation_source)) { - // We are creating a translation. Add values and lock language field. - $form['translation_source'] = array('#type' => 'value', '#value' => $node->translation_source); - $form['language']['#disabled'] = TRUE; - } - elseif (!empty($node->nid) && !empty($node->tnid)) { - // Disable languages for existing translations, so it is not possible to switch this - // node to some language which is already in the translation set. Also remove the - // language neutral option. - unset($form['language']['#options']['']); - foreach (translation_node_get_translations($node->tnid) as $translation) { - if ($translation->nid != $node->nid) { - unset($form['language']['#options'][$translation->language]); - } - } - // Add translation values and workflow options. - $form['tnid'] = array('#type' => 'value', '#value' => $node->tnid); - $form['translation'] = array( - '#type' => 'fieldset', - '#title' => t('Translation settings'), - '#access' => user_access('translate content'), - '#collapsible' => TRUE, - '#collapsed' => !$node->translate, - '#tree' => TRUE, - '#weight' => 30, - ); - if ($node->tnid == $node->nid) { - // This is the source node of the translation - $form['translation']['retranslate'] = array( - '#type' => 'checkbox', - '#title' => t('Flag translations as outdated'), - '#default_value' => 0, - '#description' => t('If you made a significant change, which means translations should be updated, you can flag all translations of this post as outdated. This will not change any other property of those posts, like whether they are published or not.'), - ); - $form['translation']['status'] = array('#type' => 'value', '#value' => 0); - } - else { - $form['translation']['status'] = array( - '#type' => 'checkbox', - '#title' => t('This translation needs to be updated'), - '#default_value' => $node->translate, - '#description' => t('When this option is checked, this translation needs to be updated because the source post has changed. Uncheck when the translation is up to date again.'), - ); - } - } - } -} - -/** * Implementation of hook_node_view(). * * Display translation links with native language names, if this node Index: modules/translation/translation.registry.inc =================================================================== RCS file: modules/translation/translation.registry.inc diff -N modules/translation/translation.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/translation/translation.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,25 @@ + 'Translate', + 'page callback' => 'translation_node_overview', + 'page arguments' => array(1), + 'access callback' => '_translation_tab_access', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + 'weight' => 2, + ); + return $items; +} + Index: modules/trigger/trigger.bootstrap.inc =================================================================== RCS file: modules/trigger/trigger.bootstrap.inc diff -N modules/trigger/trigger.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/trigger/trigger.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,32 @@ +' . t('Triggers are system events, such as when new content is added or when a user logs in. Trigger module combines these triggers with actions (functional tasks), such as unpublishing content or e-mailing an administrator. The Actions settings page contains a list of existing actions and provides the ability to create and configure additional actions.', array('@url' => url('admin/settings/actions'))) . ''; + switch ($path) { + case 'admin/build/trigger/comment': + return $explanation . '' . t('Below you can assign actions to run when certain comment-related triggers happen. For example, you could promote a post to the front page when a comment is added.') . '
'; + case 'admin/build/trigger/node': + return $explanation . '' . t('Below you can assign actions to run when certain content-related triggers happen. For example, you could send an e-mail to an administrator when a post is created or updated.') . '
'; + case 'admin/build/trigger/cron': + return $explanation . '' . t('Below you can assign actions to run during each pass of a cron maintenance task.', array('@cron' => url('admin/reports/status'))) . '
'; + case 'admin/build/trigger/taxonomy': + return $explanation . '' . t('Below you can assign actions to run when certain taxonomy-related triggers happen. For example, you could send an e-mail to an administrator when a term is deleted.') . '
'; + case 'admin/build/trigger/user': + return $explanation . '' . t("Below you can assign actions to run when certain user-related triggers happen. For example, you could send an e-mail to an administrator when a user account is deleted.") . '
'; + case 'admin/help#trigger': + $output = '' . t('The Trigger module provides the ability to trigger actions upon system events, such as when new content is added or when a user logs in.', array('@actions' => url('admin/settings/actions'))) . '
'; + $output .= '' . t('The combination of actions and triggers can perform many useful tasks, such as e-mailing an administrator if a user account is deleted, or automatically unpublishing comments that contain certain words. By default, there are five "contexts" of events (Comments, Content, Cron, Taxonomy, and Users), but more may be added by additional modules.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Trigger module.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) . '
'; + return $output; + } +} + Index: modules/trigger/trigger.info =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.info,v retrieving revision 1.5 diff -u -p -r1.5 trigger.info --- modules/trigger/trigger.info 11 Oct 2008 02:33:10 -0000 1.5 +++ modules/trigger/trigger.info 20 May 2009 18:49:52 -0000 @@ -7,3 +7,5 @@ core = 7.x files[] = trigger.module files[] = trigger.admin.inc files[] = trigger.install +files[] = trigger.registry.inc +files[] = trigger.bootstrap.inc Index: modules/trigger/trigger.module =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v retrieving revision 1.33 diff -u -p -r1.33 trigger.module --- modules/trigger/trigger.module 14 May 2009 08:23:15 -0000 1.33 +++ modules/trigger/trigger.module 20 May 2009 22:51:15 -0000 @@ -8,114 +8,6 @@ */ /** - * Implementation of hook_help(). - */ -function trigger_help($path, $arg) { - $explanation = '' . t('Triggers are system events, such as when new content is added or when a user logs in. Trigger module combines these triggers with actions (functional tasks), such as unpublishing content or e-mailing an administrator. The Actions settings page contains a list of existing actions and provides the ability to create and configure additional actions.', array('@url' => url('admin/settings/actions'))) . '
'; - switch ($path) { - case 'admin/build/trigger/comment': - return $explanation . '' . t('Below you can assign actions to run when certain comment-related triggers happen. For example, you could promote a post to the front page when a comment is added.') . '
'; - case 'admin/build/trigger/node': - return $explanation . '' . t('Below you can assign actions to run when certain content-related triggers happen. For example, you could send an e-mail to an administrator when a post is created or updated.') . '
'; - case 'admin/build/trigger/cron': - return $explanation . '' . t('Below you can assign actions to run during each pass of a cron maintenance task.', array('@cron' => url('admin/reports/status'))) . '
'; - case 'admin/build/trigger/taxonomy': - return $explanation . '' . t('Below you can assign actions to run when certain taxonomy-related triggers happen. For example, you could send an e-mail to an administrator when a term is deleted.') . '
'; - case 'admin/build/trigger/user': - return $explanation . '' . t("Below you can assign actions to run when certain user-related triggers happen. For example, you could send an e-mail to an administrator when a user account is deleted.") . '
'; - case 'admin/help#trigger': - $output = '' . t('The Trigger module provides the ability to trigger actions upon system events, such as when new content is added or when a user logs in.', array('@actions' => url('admin/settings/actions'))) . '
'; - $output .= '' . t('The combination of actions and triggers can perform many useful tasks, such as e-mailing an administrator if a user account is deleted, or automatically unpublishing comments that contain certain words. By default, there are five "contexts" of events (Comments, Content, Cron, Taxonomy, and Users), but more may be added by additional modules.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Trigger module.', array('@trigger' => 'http://drupal.org/handbook/modules/trigger/')) . '
'; - return $output; - } -} - -/** - * Implementation of hook_menu(). - */ -function trigger_menu() { - $items['admin/build/trigger'] = array( - 'title' => 'Triggers', - 'description' => 'Tell Drupal when to execute actions.', - 'page callback' => 'trigger_assign', - 'access callback' => 'trigger_access_check', - 'access arguments' => array('node'), - ); - // We don't use a menu wildcard here because these are tabs, - // not invisible items. - $items['admin/build/trigger/node'] = array( - 'title' => 'Content', - 'page callback' => 'trigger_assign', - 'page arguments' => array('node'), - 'access callback' => 'trigger_access_check', - 'access arguments' => array('node'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/trigger/user'] = array( - 'title' => 'Users', - 'page callback' => 'trigger_assign', - 'page arguments' => array('user'), - 'access callback' => 'trigger_access_check', - 'access arguments' => array('user'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/trigger/comment'] = array( - 'title' => 'Comments', - 'page callback' => 'trigger_assign', - 'page arguments' => array('comment'), - 'access callback' => 'trigger_access_check', - 'access arguments' => array('comment'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/trigger/taxonomy'] = array( - 'title' => 'Taxonomy', - 'page callback' => 'trigger_assign', - 'page arguments' => array('taxonomy'), - 'access callback' => 'trigger_access_check', - 'access arguments' => array('taxonomy'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/build/trigger/cron'] = array( - 'title' => 'Cron', - 'page callback' => 'trigger_assign', - 'page arguments' => array('cron'), - 'access arguments' => array('administer actions'), - 'type' => MENU_LOCAL_TASK, - ); - - // We want contributed modules to be able to describe - // their hooks and have actions assignable to them. - $hooks = module_invoke_all('hook_info'); - foreach ($hooks as $module => $hook) { - // We've already done these. - if (in_array($module, array('node', 'comment', 'user', 'system', 'taxonomy'))) { - continue; - } - $info = db_result(db_query("SELECT info FROM {system} WHERE name = '%s'", $module)); - $info = unserialize($info); - $nice_name = $info['name']; - $items["admin/build/trigger/$module"] = array( - 'title' => $nice_name, - 'page callback' => 'trigger_assign', - 'page arguments' => array($module), - 'access arguments' => array($module), - 'type' => MENU_LOCAL_TASK, - ); - } - $items['admin/build/trigger/unassign'] = array( - 'title' => 'Unassign', - 'description' => 'Unassign an action from a trigger.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('trigger_unassign'), - 'access arguments' => array('administer actions'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** * Access callback for menu system. */ function trigger_access_check($module) { @@ -143,17 +35,6 @@ function _trigger_get_hook_aids($hook, $ } /** - * Implementation of hook_theme(). - */ -function trigger_theme() { - return array( - 'trigger_display' => array( - 'arguments' => array('element'), - ), - ); -} - -/** * Implementation of hook_forms(). We reuse code by using the * same assignment form definition for each node-op combination. */ Index: modules/trigger/trigger.registry.inc =================================================================== RCS file: modules/trigger/trigger.registry.inc diff -N modules/trigger/trigger.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/trigger/trigger.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,103 @@ + 'Triggers', + 'description' => 'Tell Drupal when to execute actions.', + 'page callback' => 'trigger_assign', + 'access callback' => 'trigger_access_check', + 'access arguments' => array('node'), + ); + // We don't use a menu wildcard here because these are tabs, + // not invisible items. + $items['admin/build/trigger/node'] = array( + 'title' => 'Content', + 'page callback' => 'trigger_assign', + 'page arguments' => array('node'), + 'access callback' => 'trigger_access_check', + 'access arguments' => array('node'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/trigger/user'] = array( + 'title' => 'Users', + 'page callback' => 'trigger_assign', + 'page arguments' => array('user'), + 'access callback' => 'trigger_access_check', + 'access arguments' => array('user'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/trigger/comment'] = array( + 'title' => 'Comments', + 'page callback' => 'trigger_assign', + 'page arguments' => array('comment'), + 'access callback' => 'trigger_access_check', + 'access arguments' => array('comment'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/trigger/taxonomy'] = array( + 'title' => 'Taxonomy', + 'page callback' => 'trigger_assign', + 'page arguments' => array('taxonomy'), + 'access callback' => 'trigger_access_check', + 'access arguments' => array('taxonomy'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/build/trigger/cron'] = array( + 'title' => 'Cron', + 'page callback' => 'trigger_assign', + 'page arguments' => array('cron'), + 'access arguments' => array('administer actions'), + 'type' => MENU_LOCAL_TASK, + ); + + // We want contributed modules to be able to describe + // their hooks and have actions assignable to them. + $hooks = module_invoke_all('hook_info'); + foreach ($hooks as $module => $hook) { + // We've already done these. + if (in_array($module, array('node', 'comment', 'user', 'system', 'taxonomy'))) { + continue; + } + $info = db_result(db_query("SELECT info FROM {system} WHERE name = '%s'", $module)); + $info = unserialize($info); + $nice_name = $info['name']; + $items["admin/build/trigger/$module"] = array( + 'title' => $nice_name, + 'page callback' => 'trigger_assign', + 'page arguments' => array($module), + 'access arguments' => array($module), + 'type' => MENU_LOCAL_TASK, + ); + } + $items['admin/build/trigger/unassign'] = array( + 'title' => 'Unassign', + 'description' => 'Unassign an action from a trigger.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('trigger_unassign'), + 'access arguments' => array('administer actions'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function trigger_theme() { + return array( + 'trigger_display' => array( + 'arguments' => array('element'), + ), + ); +} + Index: modules/update/update.alter.inc =================================================================== RCS file: modules/update/update.alter.inc diff -N modules/update/update.alter.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/update/update.alter.inc 20 May 2009 22:30:03 -0000 @@ -0,0 +1,32 @@ +' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . ''; + $output .= '' . t('To extend the functionality or to change the look of your site, a number of contributed modules and themes are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) . '
'; + $output .= '' . t('Each time Drupal core or a contributed module or theme is updated, it is important that update.php is run.', array('@update-php' => url($base_url . '/update.php', array('external' => TRUE)))) . '
'; + return $output; + case 'admin/build/themes': + case 'admin/build/modules': + include_once DRUPAL_ROOT . '/includes/install.inc'; + $status = update_requirements('runtime'); + foreach (array('core', 'contrib') as $report_type) { + $type = 'update_' . $report_type; + if (isset($status[$type]['severity'])) { + if ($status[$type]['severity'] == REQUIREMENT_ERROR) { + drupal_set_message($status[$type]['description'], 'error'); + } + elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) { + drupal_set_message($status[$type]['description'], 'warning'); + } + } + } + + case 'admin/reports/updates/settings': + case 'admin/reports/status': + // These two pages don't need additional nagging. + break; + + case 'admin/help#update': + $output = '' . t("The Update status module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts you to available updates.") . '
'; + $output .= '' . t('The report of available updates will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the Update status module settings page.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/settings/updates'))) . '
'; + $output .= '' . t('Please note that in order to provide this information, anonymous usage statistics are sent to drupal.org. If desired, you may disable the Update status module from the module administration page.', array('@modules' => url('admin/build/modules'))) . '
'; + $output .= '' . t('For more information, see the online handbook entry for Update status module.', array('@update' => 'http://drupal.org/handbook/modules/update')) . '
'; + return $output; + + default: + // Otherwise, if we're on *any* admin page and there's a security + // update missing, print an error message about it. + if (arg(0) == 'admin' && strpos($path, '#') === FALSE + && user_access('administer site configuration')) { + include_once DRUPAL_ROOT . '/includes/install.inc'; + $status = update_requirements('runtime'); + foreach (array('core', 'contrib') as $report_type) { + $type = 'update_' . $report_type; + if (isset($status[$type]) + && isset($status[$type]['reason']) + && $status[$type]['reason'] === UPDATE_NOT_SECURE) { + drupal_set_message($status[$type]['description'], 'error'); + } + } + } + + } +} + Index: modules/update/update.info =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.info,v retrieving revision 1.5 diff -u -p -r1.5 update.info --- modules/update/update.info 11 Oct 2008 02:33:12 -0000 1.5 +++ modules/update/update.info 20 May 2009 21:14:44 -0000 @@ -10,3 +10,6 @@ files[] = update.fetch.inc files[] = update.report.inc files[] = update.settings.inc files[] = update.install +files[] = update.registry.inc +files[] = update.bootstrap.inc +files[] = update.alter.inc Index: modules/update/update.module =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.module,v retrieving revision 1.33 diff -u -p -r1.33 update.module --- modules/update/update.module 13 May 2009 18:21:42 -0000 1.33 +++ modules/update/update.module 20 May 2009 22:29:58 -0000 @@ -2,163 +2,6 @@ // $Id: update.module,v 1.33 2009/05/13 18:21:42 webchick Exp $ /** - * @file - * The "Update status" module checks for available updates of Drupal core and - * any installed contributed modules and themes. It warns site administrators - * if newer releases are available via the system status report - * (admin/reports/status), the module and theme pages, and optionally via email. - */ - -/** - * URL to check for updates, if a given project doesn't define its own. - */ -define('UPDATE_DEFAULT_URL', 'http://updates.drupal.org/release-history'); - -// These are internally used constants for this code, do not modify. - -/** - * Project is missing security update(s). - */ -define('UPDATE_NOT_SECURE', 1); - -/** - * Current release has been unpublished and is no longer available. - */ -define('UPDATE_REVOKED', 2); - -/** - * Current release is no longer supported by the project maintainer. - */ -define('UPDATE_NOT_SUPPORTED', 3); - -/** - * Project has a new release available, but it is not a security release. - */ -define('UPDATE_NOT_CURRENT', 4); - -/** - * Project is up to date. - */ -define('UPDATE_CURRENT', 5); - -/** - * Project's status cannot be checked. - */ -define('UPDATE_NOT_CHECKED', -1); - -/** - * No available update data was found for project. - */ -define('UPDATE_UNKNOWN', -2); - - -/** - * Implementation of hook_help(). - */ -function update_help($path, $arg) { - switch ($path) { - case 'admin/reports/updates': - global $base_url; - $output = '' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
'; - $output .= '' . t('To extend the functionality or to change the look of your site, a number of contributed modules and themes are available.', array('@modules' => 'http://drupal.org/project/modules', '@themes' => 'http://drupal.org/project/themes')) . '
'; - $output .= '' . t('Each time Drupal core or a contributed module or theme is updated, it is important that update.php is run.', array('@update-php' => url($base_url . '/update.php', array('external' => TRUE)))) . '
'; - return $output; - case 'admin/build/themes': - case 'admin/build/modules': - include_once DRUPAL_ROOT . '/includes/install.inc'; - $status = update_requirements('runtime'); - foreach (array('core', 'contrib') as $report_type) { - $type = 'update_' . $report_type; - if (isset($status[$type]['severity'])) { - if ($status[$type]['severity'] == REQUIREMENT_ERROR) { - drupal_set_message($status[$type]['description'], 'error'); - } - elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) { - drupal_set_message($status[$type]['description'], 'warning'); - } - } - } - - case 'admin/reports/updates/settings': - case 'admin/reports/status': - // These two pages don't need additional nagging. - break; - - case 'admin/help#update': - $output = '' . t("The Update status module periodically checks for new versions of your site's software (including contributed modules and themes), and alerts you to available updates.") . '
'; - $output .= '' . t('The report of available updates will alert you when new releases are available for download. You may configure options for update checking frequency and notifications at the Update status module settings page.', array('@update-report' => url('admin/reports/updates'), '@update-settings' => url('admin/settings/updates'))) . '
'; - $output .= '' . t('Please note that in order to provide this information, anonymous usage statistics are sent to drupal.org. If desired, you may disable the Update status module from the module administration page.', array('@modules' => url('admin/build/modules'))) . '
'; - $output .= '' . t('For more information, see the online handbook entry for Update status module.', array('@update' => 'http://drupal.org/handbook/modules/update')) . '
'; - return $output; - - default: - // Otherwise, if we're on *any* admin page and there's a security - // update missing, print an error message about it. - if (arg(0) == 'admin' && strpos($path, '#') === FALSE - && user_access('administer site configuration')) { - include_once DRUPAL_ROOT . '/includes/install.inc'; - $status = update_requirements('runtime'); - foreach (array('core', 'contrib') as $report_type) { - $type = 'update_' . $report_type; - if (isset($status[$type]) - && isset($status[$type]['reason']) - && $status[$type]['reason'] === UPDATE_NOT_SECURE) { - drupal_set_message($status[$type]['description'], 'error'); - } - } - } - - } -} - -/** - * Implementation of hook_menu(). - */ -function update_menu() { - $items = array(); - - $items['admin/reports/updates'] = array( - 'title' => 'Available updates', - 'description' => 'Get a status report about available updates for your installed modules and themes.', - 'page callback' => 'update_status', - 'access arguments' => array('administer site configuration'), - 'weight' => 10, - ); - $items['admin/settings/updates'] = array( - 'title' => 'Updates', - 'description' => 'Change frequency of checks for available updates to your installed modules and themes, and how you would like to be notified.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('update_settings'), - 'access arguments' => array('administer site configuration'), - ); - $items['admin/reports/updates/check'] = array( - 'title' => 'Manual update check', - 'page callback' => 'update_manual_status', - 'access arguments' => array('administer site configuration'), - 'type' => MENU_CALLBACK, - ); - - return $items; -} - -/** - * Implementation of the hook_theme() registry. - */ -function update_theme() { - return array( - 'update_settings' => array( - 'arguments' => array('form' => NULL), - ), - 'update_report' => array( - 'arguments' => array('data' => NULL), - ), - 'update_version' => array( - 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => NULL), - ), - ); -} - -/** * Implementation of hook_requirements(). * * @return @@ -286,30 +129,6 @@ function update_cron() { } /** - * Implementation of hook_form_FORM_ID_alter(). - * - * Adds a submit handler to the system modules and themes forms, so that if a - * site admin saves either form, we invalidate the cache of available updates. - * - * @see _update_cache_clear() - */ -function update_form_system_themes_form_alter(&$form, $form_state) { - $form['#submit'][] = 'update_cache_clear_submit'; -} - -/** - * Implementation of hook_form_FORM_ID_alter(). - * - * Adds a submit handler to the system modules and themes forms, so that if a - * site admin saves either form, we invalidate the cache of available updates. - * - * @see _update_cache_clear() - */ -function update_form_system_modules_alter(&$form, $form_state) { - $form['#submit'][] = 'update_cache_clear_submit'; -} - -/** * Helper function for use as a form submit callback. */ function update_cache_clear_submit($form, &$form_state) { Index: modules/update/update.registry.inc =================================================================== RCS file: modules/update/update.registry.inc diff -N modules/update/update.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/update/update.registry.inc 20 May 2009 17:28:57 -0000 @@ -0,0 +1,55 @@ + 'Available updates', + 'description' => 'Get a status report about available updates for your installed modules and themes.', + 'page callback' => 'update_status', + 'access arguments' => array('administer site configuration'), + 'weight' => 10, + ); + $items['admin/settings/updates'] = array( + 'title' => 'Updates', + 'description' => 'Change frequency of checks for available updates to your installed modules and themes, and how you would like to be notified.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('update_settings'), + 'access arguments' => array('administer site configuration'), + ); + $items['admin/reports/updates/check'] = array( + 'title' => 'Manual update check', + 'page callback' => 'update_manual_status', + 'access arguments' => array('administer site configuration'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of the hook_theme() registry. + */ +function update_theme() { + return array( + 'update_settings' => array( + 'arguments' => array('form' => NULL), + ), + 'update_report' => array( + 'arguments' => array('data' => NULL), + ), + 'update_version' => array( + 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => NULL), + ), + ); +} + Index: modules/upload/upload.bootstrap.inc =================================================================== RCS file: modules/upload/upload.bootstrap.inc diff -N modules/upload/upload.bootstrap.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/upload/upload.bootstrap.inc 20 May 2009 18:49:52 -0000 @@ -0,0 +1,29 @@ +' . t('The upload module allows users to upload files to the site. The ability to upload files is important for members of a community who want to share work. It is also useful to administrators who want to keep uploaded files connected to posts.') . ''; + $output .= '' . t('Users with the upload files permission can upload attachments to posts. Uploads may be enabled for specific content types on the content types settings page. Each user role can be customized to limit or control the file size of uploads, or the maximum dimension of image files.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for Upload module.', array('@upload' => 'http://drupal.org/handbook/modules/upload/')) . '
'; + return $output; + case 'admin/settings/upload': + return '' . t('Users with the upload files permission can upload attachments. Users with the view uploaded files permission can view uploaded attachments. You can choose which post types can take attachments on the content types settings page.', array('@permissions' => url('admin/user/permissions'), '@types' => url('admin/settings/types'))) . '
'; + } +} + Index: modules/upload/upload.info =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.info,v retrieving revision 1.8 diff -u -p -r1.8 upload.info --- modules/upload/upload.info 11 Oct 2008 02:33:13 -0000 1.8 +++ modules/upload/upload.info 20 May 2009 22:30:48 -0000 @@ -7,3 +7,6 @@ core = 7.x files[] = upload.module files[] = upload.admin.inc files[] = upload.install +files[] = upload.registry.inc +files[] = upload.bootstrap.inc +files[] = upload.alter.inc Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.238 diff -u -p -r1.238 upload.module --- modules/upload/upload.module 16 May 2009 15:23:16 -0000 1.238 +++ modules/upload/upload.module 20 May 2009 22:30:20 -0000 @@ -2,44 +2,6 @@ // $Id: upload.module,v 1.238 2009/05/16 15:23:16 webchick Exp $ /** - * @file - * File-handling and attaching files to nodes. - * - */ - -/** - * Implementation of hook_help(). - */ -function upload_help($path, $arg) { - switch ($path) { - case 'admin/help#upload': - $output = '' . t('The upload module allows users to upload files to the site. The ability to upload files is important for members of a community who want to share work. It is also useful to administrators who want to keep uploaded files connected to posts.') . '
'; - $output .= '' . t('Users with the upload files permission can upload attachments to posts. Uploads may be enabled for specific content types on the content types settings page. Each user role can be customized to limit or control the file size of uploads, or the maximum dimension of image files.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for Upload module.', array('@upload' => 'http://drupal.org/handbook/modules/upload/')) . '
'; - return $output; - case 'admin/settings/upload': - return '' . t('Users with the upload files permission can upload attachments. Users with the view uploaded files permission can view uploaded attachments. You can choose which post types can take attachments on the content types settings page.', array('@permissions' => url('admin/user/permissions'), '@types' => url('admin/settings/types'))) . '
'; - } -} - -/** - * Implementation of hook_theme(). - */ -function upload_theme() { - return array( - 'upload_attachments' => array( - 'arguments' => array('elements' => NULL), - ), - 'upload_form_current' => array( - 'arguments' => array('form' => NULL), - ), - 'upload_form_new' => array( - 'arguments' => array('form' => NULL), - ), - ); -} - -/** * Implementation of hook_perm(). */ function upload_perm() { @@ -83,26 +45,6 @@ function upload_node_links($node, $tease } /** - * Implementation of hook_menu(). - */ -function upload_menu() { - $items['upload/js'] = array( - 'page callback' => 'upload_js', - 'access arguments' => array('upload files'), - 'type' => MENU_CALLBACK, - ); - $items['admin/settings/uploads'] = array( - 'title' => 'File uploads', - 'description' => 'Control how files may be attached to content.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('upload_admin_settings'), - 'access arguments' => array('administer site configuration'), - 'type' => MENU_NORMAL_ITEM, - ); - return $items; -} - -/** * Determine the limitations on files that a given user may upload. The user * may be in multiple roles so we select the most permissive limitations from * all of their roles. @@ -209,61 +151,6 @@ function upload_node_form_submit(&$form, } } -function upload_form_alter(&$form, $form_state, $form_id) { - if ($form_id == 'node_type_form' && isset($form['identity']['type'])) { - $form['workflow']['upload'] = array( - '#type' => 'radios', - '#title' => t('Attachments'), - '#default_value' => variable_get('upload_' . $form['#node_type']->type, 1), - '#options' => array(t('Disabled'), t('Enabled')), - ); - } - - if (!empty($form['#node_edit_form'])) { - $node = $form['#node']; - if (variable_get("upload_$node->type", TRUE)) { - // Attachments fieldset - $form['attachments'] = array( - '#type' => 'fieldset', - '#access' => user_access('upload files'), - '#title' => t('File attachments'), - '#collapsible' => TRUE, - '#collapsed' => empty($node->files), - '#group' => 'additional_settings', - '#attached_js' => array(drupal_get_path('module', 'upload') . '/upload.js'), - '#description' => t('Changes made to the attachments are not permanent until you save this post. The first "listed" file will be included in RSS feeds.'), - '#weight' => 30, - ); - - // Wrapper for fieldset contents (used by ahah.js). - $form['attachments']['wrapper'] = array( - '#prefix' => '' . t("Users can use their own name or handle and can specify personal configuration settings through their individual My account page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") . '
'; + $output .= '' . t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') . '
'; + $output .= '' . t('For more information, see the online handbook entry for User module.', array('@user' => 'http://drupal.org/handbook/modules/user/')) . '
'; + return $output; + case 'admin/user/user': + return '' . t('Drupal allows users to register, login, log out, maintain user profiles, etc. Users of the site may not use their own names to post content until they have signed up for a user account.') . '
'; + case 'admin/user/user/create': + case 'admin/user/user/account/create': + return '' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '
'; + case 'admin/user/permissions': + return '' . t('Permissions let you control what users can do on your site. Each user role (defined on the user roles page) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) . '
'; + case 'admin/user/roles': + return t('Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the role names of the various roles. To delete a role choose "edit".
By default, Drupal comes with two user roles:
+' . t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') . '
'; + } +} + +/** + * Implementation of hook_fieldable_info(). + */ +function user_fieldable_info() { + $return = array( + 'user' => array( + 'name' => t('User'), + 'id key' => 'uid', + ), + ); + return $return; +} + +/** + * Implementation of hook_hook_info(). + */ +function user_hook_info() { + return array( + 'user' => array( + 'user' => array( + 'insert' => array( + 'runs when' => t('After a user account has been created'), + ), + 'update' => array( + 'runs when' => t("After a user's profile has been updated"), + ), + 'delete' => array( + 'runs when' => t('After a user has been deleted') + ), + 'login' => array( + 'runs when' => t('After a user has logged in') + ), + 'logout' => array( + 'runs when' => t('After a user has logged out') + ), + 'view' => array( + 'runs when' => t("When a user's profile is being viewed") + ), + ), + ), + ); +} + +/** + * Implementation of hook_elements(). + */ +function user_elements() { + return array( + 'user_profile_category' => array( + '#theme_wrapper' => 'user_profile_category' + ), + 'user_profile_item' => array( + '#theme' => 'user_profile_item' + ), + ); +} + Index: modules/user/user.info =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.info,v retrieving revision 1.10 diff -u -p -r1.10 user.info --- modules/user/user.info 12 Oct 2008 01:23:07 -0000 1.10 +++ modules/user/user.info 20 May 2009 18:49:52 -0000 @@ -9,3 +9,5 @@ files[] = user.admin.inc files[] = user.pages.inc files[] = user.install required = TRUE +files[] = user.registry.inc +files[] = user.bootstrap.inc Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.987 diff -u -p -r1.987 user.module --- modules/user/user.module 16 May 2009 15:23:16 -0000 1.987 +++ modules/user/user.module 20 May 2009 21:33:53 -0000 @@ -31,64 +31,6 @@ function user_module_invoke($type, &$arr } /** - * Implementation of hook_theme(). - */ -function user_theme() { - return array( - 'user_picture' => array( - 'arguments' => array('account' => NULL), - 'template' => 'user-picture', - ), - 'user_profile' => array( - 'arguments' => array('elements' => NULL), - 'template' => 'user-profile', - ), - 'user_profile_category' => array( - 'arguments' => array('element' => NULL), - 'template' => 'user-profile-category', - ), - 'user_profile_item' => array( - 'arguments' => array('element' => NULL), - 'template' => 'user-profile-item', - ), - 'user_list' => array( - 'arguments' => array('users' => NULL, 'title' => NULL), - ), - 'user_admin_perm' => array( - 'arguments' => array('form' => NULL), - ), - 'user_admin_new_role' => array( - 'arguments' => array('form' => NULL), - ), - 'user_admin_account' => array( - 'arguments' => array('form' => NULL), - ), - 'user_filter_form' => array( - 'arguments' => array('form' => NULL), - ), - 'user_filters' => array( - 'arguments' => array('form' => NULL), - ), - 'user_signature' => array( - 'arguments' => array('signature' => NULL), - ), - ); -} - -/** - * Implementation of hook_fieldable_info(). - */ -function user_fieldable_info() { - $return = array( - 'user' => array( - 'name' => t('User'), - 'id key' => 'uid', - ), - ); - return $return; -} - -/** * Implementation of hook_field_build_modes(). */ function user_field_build_modes($obj_type) { @@ -877,20 +819,6 @@ function user_search($op = 'search', $ke } /** - * Implementation of hook_elements(). - */ -function user_elements() { - return array( - 'user_profile_category' => array( - '#theme_wrapper' => 'user_profile_category' - ), - 'user_profile_item' => array( - '#theme' => 'user_profile_item' - ), - ); -} - -/** * Implementation of hook_user_view(). */ function user_user_view(&$edit, &$account, $category = NULL) { @@ -1262,193 +1190,6 @@ function user_load_self($arg) { return $arg; } -/** - * Implementation of hook_menu(). - */ -function user_menu() { - $items['user/autocomplete'] = array( - 'title' => 'User autocomplete', - 'page callback' => 'user_autocomplete', - 'access callback' => 'user_access', - 'access arguments' => array('access user profiles'), - 'type' => MENU_CALLBACK, - ); - - // Registration and login pages. - $items['user'] = array( - 'title' => 'User account', - 'page callback' => 'user_page', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items['user/login'] = array( - 'title' => 'Log in', - 'access callback' => 'user_is_anonymous', - 'type' => MENU_DEFAULT_LOCAL_TASK, - ); - - $items['user/register'] = array( - 'title' => 'Create new account', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_register'), - 'access callback' => 'user_register_access', - 'type' => MENU_LOCAL_TASK, - ); - - $items['user/password'] = array( - 'title' => 'Request new password', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_pass'), - 'access callback' => 'user_is_anonymous', - 'type' => MENU_LOCAL_TASK, - ); - $items['user/reset/%/%/%'] = array( - 'title' => 'Reset password', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_pass_reset', 2, 3, 4), - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items['user/logout'] = array( - 'title' => 'Log out', - 'access callback' => 'user_is_logged_in', - 'page callback' => 'user_logout', - 'weight' => 10, - 'menu_name' => 'user-menu', - ); - - // User administration pages. - $items['admin/user'] = array( - 'title' => 'User management', - 'description' => "Manage your site's users, groups and access to site features.", - 'position' => 'left', - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('access administration pages'), - ); - $items['admin/user/user'] = array( - 'title' => 'Users', - 'description' => 'List, add, and edit users.', - 'page callback' => 'user_admin', - 'page arguments' => array('list'), - 'access arguments' => array('administer users'), - ); - $items['admin/user/user/list'] = array( - 'title' => 'List', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - $items['admin/user/user/create'] = array( - 'title' => 'Add user', - 'page arguments' => array('create'), - 'access arguments' => array('administer users'), - 'type' => MENU_LOCAL_TASK, - ); - $items['admin/user/settings'] = array( - 'title' => 'User settings', - 'description' => 'Configure default behavior of users, including registration requirements, e-mails, and user pictures.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_admin_settings'), - 'access arguments' => array('administer users'), - ); - - // Permission administration pages. - $items['admin/user/permissions'] = array( - 'title' => 'Permissions', - 'description' => 'Determine access to features by selecting permissions for roles.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_admin_perm'), - 'access arguments' => array('administer permissions'), - ); - $items['admin/user/roles'] = array( - 'title' => 'Roles', - 'description' => 'List, edit, or add user roles.', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_admin_new_role'), - 'access arguments' => array('administer permissions'), - ); - $items['admin/user/roles/edit'] = array( - 'title' => 'Edit role', - 'page arguments' => array('user_admin_role'), - 'access arguments' => array('administer permissions'), - 'type' => MENU_CALLBACK, - ); - - $items['user/%user_uid_optional'] = array( - 'title' => 'My account', - 'title callback' => 'user_page_title', - 'title arguments' => array(1), - 'page callback' => 'user_view', - 'page arguments' => array(1), - 'access callback' => 'user_view_access', - 'access arguments' => array(1), - 'weight' => -10, - 'menu_name' => 'user-menu', - ); - - $items['user/%user/view'] = array( - 'title' => 'View', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10, - ); - - $items['user/%user/cancel'] = array( - 'title' => 'Cancel account', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('user_cancel_confirm_form', 1), - 'access callback' => 'user_cancel_access', - 'access arguments' => array(1), - 'type' => MENU_CALLBACK, - ); - - $items['user/%user/cancel/confirm/%/%'] = array( - 'title' => 'Confirm account cancellation', - 'page callback' => 'user_cancel_confirm', - 'page arguments' => array(1, 4, 5), - 'access callback' => 'user_cancel_access', - 'access arguments' => array(1), - 'type' => MENU_CALLBACK, - ); - - $items['user/%user/edit'] = array( - 'title' => 'Edit', - 'page callback' => 'user_edit', - 'page arguments' => array(1), - 'access callback' => 'user_edit_access', - 'access arguments' => array(1), - 'type' => MENU_LOCAL_TASK, - ); - - $items['user/%user_category/edit/account'] = array( - 'title' => 'Account', - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'load arguments' => array('%map', '%index'), - ); - - $empty_account = new stdClass(); - if (($categories = _user_categories($empty_account)) && (count($categories) > 1)) { - foreach ($categories as $key => $category) { - // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK. - if ($category['name'] != 'account') { - $items['user/%user_category/edit/' . $category['name']] = array( - 'title callback' => 'check_plain', - 'title arguments' => array($category['title']), - 'page callback' => 'user_edit', - 'page arguments' => array(1, 3), - 'access callback' => isset($category['access callback']) ? $category['access callback'] : 'user_edit_access', - 'access arguments' => isset($category['access arguments']) ? $category['access arguments'] : array(1), - 'type' => MENU_LOCAL_TASK, - 'weight' => $category['weight'], - 'load arguments' => array('%map', '%index'), - 'tab_parent' => 'user/%/edit', - ); - } - } - } - return $items; -} - function user_init() { drupal_add_css(drupal_get_path('module', 'user') . '/user.css'); } @@ -2370,37 +2111,6 @@ function user_multiple_cancel_confirm_su } /** - * Implementation of hook_help(). - */ -function user_help($path, $arg) { - global $user; - - switch ($path) { - case 'admin/help#user': - $output = '' . t('The user module allows users to register, login, and log out. Users benefit from being able to sign on because it associates content they create with their account and allows various permissions to be set for their roles. The user module supports user roles which establish fine grained permissions allowing each role to do only what the administrator wants them to. Each user is assigned to one or more roles. By default there are two roles anonymous - a user who has not logged in, and authenticated a user who has signed up and who has been authorized.') . '
'; - $output .= '' . t("Users can use their own name or handle and can specify personal configuration settings through their individual My account page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") . '
'; - $output .= '' . t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') . '
'; - $output .= '' . t('For more information, see the online handbook entry for User module.', array('@user' => 'http://drupal.org/handbook/modules/user/')) . '
'; - return $output; - case 'admin/user/user': - return '' . t('Drupal allows users to register, login, log out, maintain user profiles, etc. Users of the site may not use their own names to post content until they have signed up for a user account.') . '
'; - case 'admin/user/user/create': - case 'admin/user/user/account/create': - return '' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '
'; - case 'admin/user/permissions': - return '' . t('Permissions let you control what users can do on your site. Each user role (defined on the user roles page) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) . '
'; - case 'admin/user/roles': - return t('Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the role names of the various roles. To delete a role choose "edit".
By default, Drupal comes with two user roles:
-' . t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') . '
'; - } -} - -/** * Retrieve a list of all user setting/information categories and sort them by weight. */ function _user_categories($account) { @@ -2664,36 +2374,6 @@ function _user_password_dynamic_validati } /** - * Implementation of hook_hook_info(). - */ -function user_hook_info() { - return array( - 'user' => array( - 'user' => array( - 'insert' => array( - 'runs when' => t('After a user account has been created'), - ), - 'update' => array( - 'runs when' => t("After a user's profile has been updated"), - ), - 'delete' => array( - 'runs when' => t('After a user has been deleted') - ), - 'login' => array( - 'runs when' => t('After a user has logged in') - ), - 'logout' => array( - 'runs when' => t('After a user has logged out') - ), - 'view' => array( - 'runs when' => t("When a user's profile is being viewed") - ), - ), - ), - ); -} - -/** * Implementation of hook_action_info(). */ function user_action_info() { Index: modules/user/user.registry.inc =================================================================== RCS file: modules/user/user.registry.inc diff -N modules/user/user.registry.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/user/user.registry.inc 20 May 2009 17:17:17 -0000 @@ -0,0 +1,240 @@ + 'User autocomplete', + 'page callback' => 'user_autocomplete', + 'access callback' => 'user_access', + 'access arguments' => array('access user profiles'), + 'type' => MENU_CALLBACK, + ); + + // Registration and login pages. + $items['user'] = array( + 'title' => 'User account', + 'page callback' => 'user_page', + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['user/login'] = array( + 'title' => 'Log in', + 'access callback' => 'user_is_anonymous', + 'type' => MENU_DEFAULT_LOCAL_TASK, + ); + + $items['user/register'] = array( + 'title' => 'Create new account', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_register'), + 'access callback' => 'user_register_access', + 'type' => MENU_LOCAL_TASK, + ); + + $items['user/password'] = array( + 'title' => 'Request new password', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_pass'), + 'access callback' => 'user_is_anonymous', + 'type' => MENU_LOCAL_TASK, + ); + $items['user/reset/%/%/%'] = array( + 'title' => 'Reset password', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_pass_reset', 2, 3, 4), + 'access callback' => TRUE, + 'type' => MENU_CALLBACK, + ); + + $items['user/logout'] = array( + 'title' => 'Log out', + 'access callback' => 'user_is_logged_in', + 'page callback' => 'user_logout', + 'weight' => 10, + 'menu_name' => 'user-menu', + ); + + // User administration pages. + $items['admin/user'] = array( + 'title' => 'User management', + 'description' => "Manage your site's users, groups and access to site features.", + 'position' => 'left', + 'page callback' => 'system_admin_menu_block_page', + 'access arguments' => array('access administration pages'), + ); + $items['admin/user/user'] = array( + 'title' => 'Users', + 'description' => 'List, add, and edit users.', + 'page callback' => 'user_admin', + 'page arguments' => array('list'), + 'access arguments' => array('administer users'), + ); + $items['admin/user/user/list'] = array( + 'title' => 'List', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + $items['admin/user/user/create'] = array( + 'title' => 'Add user', + 'page arguments' => array('create'), + 'access arguments' => array('administer users'), + 'type' => MENU_LOCAL_TASK, + ); + $items['admin/user/settings'] = array( + 'title' => 'User settings', + 'description' => 'Configure default behavior of users, including registration requirements, e-mails, and user pictures.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_admin_settings'), + 'access arguments' => array('administer users'), + ); + + // Permission administration pages. + $items['admin/user/permissions'] = array( + 'title' => 'Permissions', + 'description' => 'Determine access to features by selecting permissions for roles.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_admin_perm'), + 'access arguments' => array('administer permissions'), + ); + $items['admin/user/roles'] = array( + 'title' => 'Roles', + 'description' => 'List, edit, or add user roles.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_admin_new_role'), + 'access arguments' => array('administer permissions'), + ); + $items['admin/user/roles/edit'] = array( + 'title' => 'Edit role', + 'page arguments' => array('user_admin_role'), + 'access arguments' => array('administer permissions'), + 'type' => MENU_CALLBACK, + ); + + $items['user/%user_uid_optional'] = array( + 'title' => 'My account', + 'title callback' => 'user_page_title', + 'title arguments' => array(1), + 'page callback' => 'user_view', + 'page arguments' => array(1), + 'access callback' => 'user_view_access', + 'access arguments' => array(1), + 'weight' => -10, + 'menu_name' => 'user-menu', + ); + + $items['user/%user/view'] = array( + 'title' => 'View', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'weight' => -10, + ); + + $items['user/%user/cancel'] = array( + 'title' => 'Cancel account', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('user_cancel_confirm_form', 1), + 'access callback' => 'user_cancel_access', + 'access arguments' => array(1), + 'type' => MENU_CALLBACK, + ); + + $items['user/%user/cancel/confirm/%/%'] = array( + 'title' => 'Confirm account cancellation', + 'page callback' => 'user_cancel_confirm', + 'page arguments' => array(1, 4, 5), + 'access callback' => 'user_cancel_access', + 'access arguments' => array(1), + 'type' => MENU_CALLBACK, + ); + + $items['user/%user/edit'] = array( + 'title' => 'Edit', + 'page callback' => 'user_edit', + 'page arguments' => array(1), + 'access callback' => 'user_edit_access', + 'access arguments' => array(1), + 'type' => MENU_LOCAL_TASK, + ); + + $items['user/%user_category/edit/account'] = array( + 'title' => 'Account', + 'type' => MENU_DEFAULT_LOCAL_TASK, + 'load arguments' => array('%map', '%index'), + ); + + $empty_account = new stdClass(); + if (($categories = _user_categories($empty_account)) && (count($categories) > 1)) { + foreach ($categories as $key => $category) { + // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK. + if ($category['name'] != 'account') { + $items['user/%user_category/edit/' . $category['name']] = array( + 'title callback' => 'check_plain', + 'title arguments' => array($category['title']), + 'page callback' => 'user_edit', + 'page arguments' => array(1, 3), + 'access callback' => isset($category['access callback']) ? $category['access callback'] : 'user_edit_access', + 'access arguments' => isset($category['access arguments']) ? $category['access arguments'] : array(1), + 'type' => MENU_LOCAL_TASK, + 'weight' => $category['weight'], + 'load arguments' => array('%map', '%index'), + 'tab_parent' => 'user/%/edit', + ); + } + } + } + return $items; +} + +/** + * Implementation of hook_theme(). + */ +function user_theme() { + return array( + 'user_picture' => array( + 'arguments' => array('account' => NULL), + 'template' => 'user-picture', + ), + 'user_profile' => array( + 'arguments' => array('elements' => NULL), + 'template' => 'user-profile', + ), + 'user_profile_category' => array( + 'arguments' => array('element' => NULL), + 'template' => 'user-profile-category', + ), + 'user_profile_item' => array( + 'arguments' => array('element' => NULL), + 'template' => 'user-profile-item', + ), + 'user_list' => array( + 'arguments' => array('users' => NULL, 'title' => NULL), + ), + 'user_admin_perm' => array( + 'arguments' => array('form' => NULL), + ), + 'user_admin_new_role' => array( + 'arguments' => array('form' => NULL), + ), + 'user_admin_account' => array( + 'arguments' => array('form' => NULL), + ), + 'user_filter_form' => array( + 'arguments' => array('form' => NULL), + ), + 'user_filters' => array( + 'arguments' => array('form' => NULL), + ), + 'user_signature' => array( + 'arguments' => array('signature' => NULL), + ), + ); +} + Index: themes/garland/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/template.php,v retrieving revision 1.20 diff -u -p -r1.20 template.php --- themes/garland/template.php 20 Jan 2009 03:18:41 -0000 1.20 +++ themes/garland/template.php 20 May 2009 20:22:50 -0000 @@ -50,7 +50,7 @@ function garland_preprocess_page(&$vars) $vars['site_html'] = implode(' ', $site_fields); // Hook into color.module - if (module_exists('color')) { + if (drupal_function_exists('_color_page_alter')) { _color_page_alter($vars); } }