diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-08 10:02:41 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-11-08 10:02:41 +0000 |
commit | 4d46b7cdf838900dc3f052197b63a9ce80d3992b (patch) | |
tree | b3ea3efb3c29a98afb8724c5655b82864395b928 /modules/book | |
parent | 370d07e9f75bf5ebdd6ac87de0f0b956d3f8dabd (diff) | |
download | brdo-4d46b7cdf838900dc3f052197b63a9ce80d3992b.tar.gz brdo-4d46b7cdf838900dc3f052197b63a9ce80d3992b.tar.bz2 |
Roll-back of #595084; type-hinting parameters at stdClass makes it so you can't ever pass in another type of class.
Diffstat (limited to 'modules/book')
-rw-r--r-- | modules/book/book.admin.inc | 4 | ||||
-rw-r--r-- | modules/book/book.module | 24 | ||||
-rw-r--r-- | modules/book/book.pages.inc | 6 | ||||
-rw-r--r-- | modules/book/book.test | 2 |
4 files changed, 18 insertions, 18 deletions
diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index 0840e3f34..072908862 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -77,7 +77,7 @@ function book_admin_settings_validate($form, &$form_state) { * * @ingroup forms. */ -function book_admin_edit($form, $form_state, stdClass $node) { +function book_admin_edit($form, $form_state, $node) { drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); $form['#node'] = $node; _book_admin_table($node, $form); @@ -151,7 +151,7 @@ function book_admin_edit_submit($form, &$form_state) { * * @see book_admin_edit() */ -function _book_admin_table(stdClass $node, &$form) { +function _book_admin_table($node, &$form) { $form['table'] = array( '#theme' => 'book_admin_table', '#tree' => TRUE, diff --git a/modules/book/book.module b/modules/book/book.module index 91ad6a123..08abba08a 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -63,7 +63,7 @@ function book_permission() { /** * Inject links into $node as needed. */ -function book_node_view_link(stdClass $node, $build_mode) { +function book_node_view_link($node, $build_mode) { $links = array(); if (isset($node->book['depth'])) { @@ -177,14 +177,14 @@ function book_menu() { /** * Menu item access callback - determine if the outline tab is accessible. */ -function _book_outline_access(stdClass $node) { +function _book_outline_access($node) { return user_access('administer book outlines') && node_access('view', $node); } /** * Menu item access callback - determine if the user can remove nodes from the outline. */ -function _book_outline_remove_access(stdClass $node) { +function _book_outline_remove_access($node) { return isset($node->book) && ($node->book['bid'] != $node->nid) && _book_outline_access($node); } @@ -439,7 +439,7 @@ function _book_parent_select($book_link) { /** * Build the common elements of the book form for the node and outline forms. */ -function _book_add_form_elements(&$form, stdClass $node) { +function _book_add_form_elements(&$form, $node) { // Need this for AJAX. $form['#cache'] = TRUE; @@ -520,7 +520,7 @@ function _book_add_form_elements(&$form, stdClass $node) { * Performs all additions and updates to the book outline through node addition, * node editing, node deletion, or the outline tab. */ -function _book_update_outline(stdClass $node) { +function _book_update_outline($node) { if (empty($node->book['bid'])) { return FALSE; } @@ -736,7 +736,7 @@ function book_node_load($nodes, $types) { /** * Implement hook_node_view(). */ -function book_node_view(stdClass $node, $build_mode) { +function book_node_view($node, $build_mode) { if ($build_mode == 'full') { if (!empty($node->book['bid']) && empty($node->in_preview)) { $node->content['book_navigation'] = array( @@ -768,7 +768,7 @@ function book_page_alter(&$page) { /** * Implement hook_node_presave(). */ -function book_node_presave(stdClass $node) { +function book_node_presave($node) { // Always save a revision for non-administrators. if (!empty($node->book['bid']) && !user_access('administer nodes')) { $node->revision = 1; @@ -786,7 +786,7 @@ function book_node_presave(stdClass $node) { /** * Implement hook_node_insert(). */ -function book_node_insert(stdClass $node) { +function book_node_insert($node) { if (!empty($node->book['bid'])) { if ($node->book['bid'] == 'new') { // New nodes that are their own book. @@ -801,7 +801,7 @@ function book_node_insert(stdClass $node) { /** * Implement hook_node_update(). */ -function book_node_update(stdClass $node) { +function book_node_update($node) { if (!empty($node->book['bid'])) { if ($node->book['bid'] == 'new') { // New nodes that are their own book. @@ -816,7 +816,7 @@ function book_node_update(stdClass $node) { /** * Implement hook_node_delete(). */ -function book_node_delete(stdClass $node) { +function book_node_delete($node) { if (!empty($node->book['bid'])) { if ($node->nid == $node->book['bid']) { // Handle deletion of a top-level post. @@ -839,7 +839,7 @@ function book_node_delete(stdClass $node) { /** * Implement hook_node_prepare(). */ -function book_node_prepare(stdClass $node) { +function book_node_prepare($node) { // Prepare defaults for the add/edit form. if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) { $node->book = array(); @@ -1086,7 +1086,7 @@ function book_export_traverse($tree, $visit_func) { * @return * The HTML generated for the given node. */ -function book_node_export(stdClass $node, $children = '') { +function book_node_export($node, $children = '') { $build = node_build($node, 'print'); unset($build['#theme']); // @todo Rendering should happen in the template using render(). diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc index 5a7b3c9ea..1e360ab8c 100644 --- a/modules/book/book.pages.inc +++ b/modules/book/book.pages.inc @@ -89,7 +89,7 @@ function book_export_html($nid) { /** * Menu callback; show the outline form for a single node. */ -function book_outline(stdClass $node) { +function book_outline($node) { drupal_set_title($node->title[FIELD_LANGUAGE_NONE][0]['value']); return drupal_get_form('book_outline_form', $node); } @@ -102,7 +102,7 @@ function book_outline(stdClass $node) { * * @ingroup forms */ -function book_outline_form($form, &$form_state, stdClass $node) { +function book_outline_form($form, &$form_state, $node) { if (!isset($node->book)) { // The node is not part of any book yet - set default options. $node->book = _book_link_defaults($node->nid); @@ -186,7 +186,7 @@ function book_outline_form_submit($form, &$form_state) { * * @ingroup forms */ -function book_remove_form($form, &$form_state, stdClass $node) { +function book_remove_form($form, &$form_state, $node) { $form['#node'] = $node; $title = array('%title' => $node->title[FIELD_LANGUAGE_NONE][0]['value']); diff --git a/modules/book/book.test b/modules/book/book.test index 4ccd2a616..9a0f9a476 100644 --- a/modules/book/book.test +++ b/modules/book/book.test @@ -94,7 +94,7 @@ class BookTestCase extends DrupalWebTestCase { * @param $breadcrumb * The nodes that should be displayed in the breadcrumb. */ - function checkBookNode(stdClass $node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) { + function checkBookNode($node, $nodes, $previous = FALSE, $up = FALSE, $next = FALSE, array $breadcrumb) { // $number does not use drupal_static as it should not be reset // since it uniquely identifies each call to checkBookNode(). static $number = 0; |