From 4cd5047722b9d011ad90df29e13f7156b6c2a1b5 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Mon, 29 Aug 2011 09:08:58 -0400 Subject: [PATCH] - Patch #233301 by catch, skwashd: more blog module clean-up --- CHANGELOG.txt | 6 ++++++ MAINTAINERS.txt | 3 --- modules/block/block.admin.inc | 2 +- modules/comment/comment.module | 2 +- modules/dashboard/dashboard.module | 2 +- modules/node/node.api.php | 14 +++++++------- modules/node/node.module | 4 ++-- modules/node/node.tpl.php | 4 ++-- modules/rdf/rdf.api.php | 19 ++++++++++++++----- modules/rdf/rdf.test | 10 +++++----- modules/simpletest/simpletest.module | 10 +++++----- modules/simpletest/tests/path.test | 28 ++++++++++++++-------------- modules/system/system.api.php | 14 +++++++------- modules/user/user.api.php | 24 +++++++++++++++++------- themes/bartik/templates/node.tpl.php | 4 ++-- 15 files changed, 84 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 039a351185e9..926a3688ccf8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,12 @@ Drupal 8.0, xxxx-xx-xx (development version) ---------------------- +- Removed modules from core + * The following modules have been removed from core, because contributed + modules with similar functionality are available: + * Blog + * Profile + Drupal 7.0, 2011-01-05 ---------------------- diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt index 3bb195ed9f99..81eb1a36e59e 100644 --- a/MAINTAINERS.txt +++ b/MAINTAINERS.txt @@ -151,9 +151,6 @@ Aggregator module Block module - John Albin Wilkins 'JohnAlbin' <http://drupal.org/user/32095> -Blog module -- ? - Book module - Peter Wolanin 'pwolanin' <http://drupal.org/user/49851> diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index d13c76caed8b..ba31b9c5b6f4 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -364,7 +364,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { BLOCK_VISIBILITY_NOTLISTED => t('All pages except those listed'), BLOCK_VISIBILITY_LISTED => t('Only the listed pages'), ); - $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')); + $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %user for the current user's page and %user-wildcard for every user page. %front is the front page.", array('%user' => 'user', '%user-wildcard' => 'user/*', '%front' => '<front>')); if (module_exists('php') && $access) { $options += array(BLOCK_VISIBILITY_PHP => t('Pages on which this PHP code returns <code>TRUE</code> (experts only)')); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 393318a21d56..8e0c7d930394 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -6,7 +6,7 @@ * * 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. + * a forum topic, story, collaborative book page, etc. */ /** diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index 08a4cd2b7659..7d5d7497b1f0 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -14,7 +14,7 @@ function dashboard_help($path, $arg) { $output .= '<dt>' . t('Tracking user activity') . '</dt>'; $output .= '<dd>' . t("By enabling blocks such as <em>Who's online</em> and <em>Who's new</em>, site users can track who is logged in and new user signups at a centralized location.") . '</dd>'; $output .= '<dt>' . t('Tracking content activity') . '</dt>'; - $output .= '<dd>' . t('By enabling blocks such as <em>Recent blog posts</em>, <em>New forum topics</em> and <em>Recent comments</em>, site users can view newly added site content at a glance.') . '</dd>'; + $output .= '<dd>' . t('By enabling blocks such as <em>New forum topics</em> and <em>Recent comments</em>, site users can view newly added site content at a glance.') . '</dd>'; $output .= '</dl>'; return $output; diff --git a/modules/node/node.api.php b/modules/node/node.api.php index 1801b6734abc..7ac62f838712 100644 --- a/modules/node/node.api.php +++ b/modules/node/node.api.php @@ -792,7 +792,6 @@ function hook_node_submit($node, $form, &$form_state) { * the RSS item generated for this node. * For details on how this is used, see node_feed(). * - * @see blog_node_view() * @see forum_node_view() * @see comment_node_view() * @@ -849,8 +848,8 @@ function hook_node_view_alter(&$build) { * Define module-provided node types. * * This hook allows a module to define one or more of its own node types. For - * example, the blog module uses it to define a blog node-type named "Blog - * entry." The name and attributes of each desired node type are specified in + * example, the forum module uses it to define a forum node-type named "Forum + * topic." The name and attributes of each desired node type are specified in * an array returned by the hook. * * Only module-provided node types should be defined through this hook. User- @@ -892,10 +891,11 @@ function hook_node_view_alter(&$build) { */ function hook_node_info() { return array( - 'blog' => array( - 'name' => t('Blog entry'), - 'base' => 'blog', - 'description' => t('Use for multi-user blogs. Every user gets a personal blog.'), + 'forum' => array( + 'name' => t('Forum topic'), + 'base' => 'forum', + 'description' => t('A <em>forum topic</em> starts a new discussion thread within a forum.'), + 'title_label' => t('Subject'), ) ); } diff --git a/modules/node/node.module b/modules/node/node.module index 1ecc09327ed3..20815df85d3f 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1319,8 +1319,8 @@ function node_view($node, $view_mode = 'full', $langcode = NULL) { * Drupal core defines the following view modes for nodes, with the following * default use cases: * - full (default): node is being displayed on its own page (node/123) - * - teaser: node is being displayed on the default home page listing, on - * taxonomy listing pages, or on blog listing pages. + * - teaser: node is being displayed on the default home page listing, or on + * taxonomy listing pages. * - rss: node displayed in an RSS feed. * If search.module is enabled: * - search_index: node is being indexed for search. diff --git a/modules/node/node.tpl.php b/modules/node/node.tpl.php index 6d0f489d71df..06dc1997bc8e 100644 --- a/modules/node/node.tpl.php +++ b/modules/node/node.tpl.php @@ -24,7 +24,7 @@ * following: * - node: The current template type, i.e., "theming hook". * - node-[type]: The current node type. For example, if the node is a - * "Blog entry" it would result in "node-blog". Note that the machine + * "Article" it would result in "node-article". Note that the machine * name will often be in a short form of the human readable label. * - node-teaser: Nodes in teaser form. * - node-preview: Nodes in preview mode. @@ -42,7 +42,7 @@ * * Other variables: * - $node: Full node object. Contains data that may not be safe. - * - $type: Node type, i.e. story, page, blog, etc. + * - $type: Node type, i.e. page, article, etc. * - $comment_count: Number of comments attached to the node. * - $uid: User ID of the node author. * - $created: Time the node was published formatted in Unix timestamp. diff --git a/modules/rdf/rdf.api.php b/modules/rdf/rdf.api.php index 691f7efa8dae..b3f95ba00097 100644 --- a/modules/rdf/rdf.api.php +++ b/modules/rdf/rdf.api.php @@ -20,7 +20,7 @@ * @return * A list of mapping structures, where each mapping is an associative array: * - type: The name of an entity type (e.g., 'node', 'comment', and so on.) - * - bundle: The name of the bundle (e.g., 'page', 'blog', or + * - bundle: The name of the bundle (e.g., 'page', 'article', or * RDF_DEFAULT_BUNDLE for default mappings.) * - mapping: The mapping structure which applies to the entity type and * bundle. A mapping structure is an array with keys corresponding to @@ -46,10 +46,10 @@ function hook_rdf_mapping() { return array( array( - 'type' => 'node', - 'bundle' => 'blog', + 'type' => 'comment', + 'bundle' => RDF_DEFAULT_BUNDLE, 'mapping' => array( - 'rdftype' => array('sioct:Weblog'), + 'rdftype' => array('sioc:Post', 'sioct:Comment'), 'title' => array( 'predicates' => array('dc:title'), ), @@ -58,9 +58,18 @@ function hook_rdf_mapping() { 'datatype' => 'xsd:dateTime', 'callback' => 'date_iso8601', ), - 'body' => array( + 'changed' => array( + 'predicates' => array('dc:modified'), + 'datatype' => 'xsd:dateTime', + 'callback' => 'date_iso8601', + ), + 'comment_body' => array( 'predicates' => array('content:encoded'), ), + 'pid' => array( + 'predicates' => array('sioc:reply_of'), + 'type' => 'rel', + ), 'uid' => array( 'predicates' => array('sioc:has_creator'), 'type' => 'rel', diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test index bd71da5d8e29..7586235cf4d5 100644 --- a/modules/rdf/rdf.test +++ b/modules/rdf/rdf.test @@ -290,7 +290,7 @@ class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase { } /** - * Create a node of type blog and test whether the RDF mapping defined for + * Create a node of type article and test whether the RDF mapping defined for * this node type in rdf_test.module is used in the node page. */ function testAttributesInMarkup1() { @@ -301,10 +301,10 @@ class RdfMappingDefinitionTestCase extends TaxonomyWebTestCase { // Ensure the default bundle mapping for node is used. These attributes come // from the node default bundle definition. - $blog_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']"); - $blog_meta = $this->xpath("//div[(@about='$url')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']"); - $this->assertTrue(!empty($blog_title), t('Property dc:title is present in meta tag.')); - $this->assertTrue(!empty($blog_meta), t('RDF type is present on post. Properties dc:date and dc:created are present on post date.')); + $node_title = $this->xpath("//meta[@property='dc:title' and @content='$node->title']"); + $node_meta = $this->xpath("//div[(@about='$url')]//span[contains(@property, 'dc:date') and contains(@property, 'dc:created') and @datatype='xsd:dateTime' and @content='$isoDate']"); + $this->assertTrue(!empty($node_title), t('Property dc:title is present in meta tag.')); + $this->assertTrue(!empty($node_meta), t('RDF type is present on post. Properties dc:date and dc:created are present on post date.')); } /** diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index 586b23ae7d50..ede9ac6ec760 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -295,11 +295,11 @@ function simpletest_log_read($test_id, $prefix, $test_class, $during_test = FALS * structure is provided below. * * @code - * $groups['Blog'] => array( - * 'BlogTestCase' => array( - * 'name' => 'Blog functionality', - * 'description' => 'Create, view, edit, delete, ...', - * 'group' => 'Blog', + * $groups['Block'] => array( + * 'BlockTestCase' => array( + * 'name' => 'Block functionality', + * 'description' => 'Add, edit and delete custom block...', + * 'group' => 'Block', * ), * ); * @endcode diff --git a/modules/simpletest/tests/path.test b/modules/simpletest/tests/path.test index 0c8ecdac4669..4701b5659b12 100644 --- a/modules/simpletest/tests/path.test +++ b/modules/simpletest/tests/path.test @@ -55,18 +55,18 @@ class DrupalMatchPathTestCase extends DrupalWebTestCase { private function drupalMatchPathTests() { return array( // Single absolute paths. - 'blog/1' => array( - 'blog/1' => TRUE, - 'blog/2' => FALSE, + 'example/1' => array( + 'example/1' => TRUE, + 'example/2' => FALSE, 'test' => FALSE, ), // Single paths with wildcards. - 'blog/*' => array( - 'blog/1' => TRUE, - 'blog/2' => TRUE, - 'blog/3/edit' => TRUE, - 'blog/' => TRUE, - 'blog' => FALSE, + 'example/*' => array( + 'example/1' => TRUE, + 'example/2' => TRUE, + 'example/3/edit' => TRUE, + 'example/' => TRUE, + 'example' => FALSE, 'test' => FALSE, ), // Single paths with multiple wildcards. @@ -102,14 +102,14 @@ class DrupalMatchPathTestCase extends DrupalWebTestCase { 'test/example' => FALSE, ), // Multiple paths with the \r delimiter. - "user/*\rblog/*" => array( + "user/*\rexample/*" => array( 'user/1' => TRUE, - 'blog/1' => TRUE, - 'user/1/blog/1' => TRUE, - 'user/blog' => TRUE, + 'example/1' => TRUE, + 'user/1/example/1' => TRUE, + 'user/example' => TRUE, 'test/example' => FALSE, 'user' => FALSE, - 'blog' => FALSE, + 'example' => FALSE, ), // Multiple paths with the \r\n delimiter. "test\r\n<front>" => array( diff --git a/modules/system/system.api.php b/modules/system/system.api.php index ab3e0fcf5c24..bcdd923220e8 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1202,15 +1202,15 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * http://drupal.org/node/102338. */ function hook_menu() { - $items['blog'] = array( - 'title' => 'blogs', - 'page callback' => 'blog_page', + $items['example'] = array( + 'title' => 'Example Page', + 'page callback' => 'example_page', 'access arguments' => array('access content'), 'type' => MENU_SUGGESTED_ITEM, ); - $items['blog/feed'] = array( - 'title' => 'RSS feed', - 'page callback' => 'blog_feed', + $items['example/feed'] = array( + 'title' => 'Example RSS feed', + 'page callback' => 'example_feed', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); @@ -1539,7 +1539,7 @@ function hook_menu_contextual_links_alter(&$links, $router_item, $root_path) { * page. Some legacy modules may not return structured content at all: their * pre-rendered markup will be located in $page['content']['main']['#markup']. * - * Pages built by Drupal's core Node and Blog modules use a standard structure: + * Pages built by Drupal's core Node module use a standard structure: * * @code * // Node body. diff --git a/modules/user/user.api.php b/modules/user/user.api.php index 069a9f880be9..0b4f38f054a3 100644 --- a/modules/user/user.api.php +++ b/modules/user/user.api.php @@ -327,14 +327,24 @@ function hook_user_logout($account) { * @see hook_entity_view() */ function hook_user_view($account, $view_mode, $langcode) { - if (user_access('create blog content', $account)) { - $account->content['summary']['blog'] = array( - '#type' => 'user_profile_item', - '#title' => t('Blog'), - '#markup' => l(t('View recent blog entries'), "blog/$account->uid", array('attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($account)))))), - '#attributes' => array('class' => array('blog')), - ); + $account->content['user_picture'] = array( + '#markup' => theme('user_picture', array('account' => $account)), + '#weight' => -10, + ); + if (!isset($account->content['summary'])) { + $account->content['summary'] = array(); } + $account->content['summary'] += array( + '#type' => 'user_profile_category', + '#attributes' => array('class' => array('user-member')), + '#weight' => 5, + '#title' => t('History'), + ); + $account->content['summary']['member_for'] = array( + '#type' => 'user_profile_item', + '#title' => t('Member for'), + '#markup' => format_interval(REQUEST_TIME - $account->created), + ); } /** diff --git a/themes/bartik/templates/node.tpl.php b/themes/bartik/templates/node.tpl.php index f215b477bb32..234b8994ab5e 100644 --- a/themes/bartik/templates/node.tpl.php +++ b/themes/bartik/templates/node.tpl.php @@ -24,7 +24,7 @@ * following: * - node: The current template type, i.e., "theming hook". * - node-[type]: The current node type. For example, if the node is a - * "Blog entry" it would result in "node-blog". Note that the machine + * "Article" it would result in "node-article". Note that the machine * name will often be in a short form of the human readable label. * - node-teaser: Nodes in teaser form. * - node-preview: Nodes in preview mode. @@ -42,7 +42,7 @@ * * Other variables: * - $node: Full node object. Contains data that may not be safe. - * - $type: Node type, i.e. story, page, blog, etc. + * - $type: Node type, i.e. page, article, etc. * - $comment_count: Number of comments attached to the node. * - $uid: User ID of the node author. * - $created: Time the node was published formatted in Unix timestamp. -- GitLab