summaryrefslogtreecommitdiff
path: root/modules/book
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-15 14:07:30 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-15 14:07:30 +0000
commitf42bca3bd4a7b97e103ddba3fdb4e403f7215b2a (patch)
tree771d33dbec4ead4d7a3a20022dbbdd669bd32691 /modules/book
parentdbac31e066a95983c6a20d9cf9c69f048bb12ead (diff)
downloadbrdo-f42bca3bd4a7b97e103ddba3fdb4e403f7215b2a.tar.gz
brdo-f42bca3bd4a7b97e103ddba3fdb4e403f7215b2a.tar.bz2
- Patch #599804 by effulgentsia, catch: unify page, AJAX 'path', and AJAX 'callback' callbacks. Oh my, this is the beginning of something big.
Diffstat (limited to 'modules/book')
-rw-r--r--modules/book/book.module3
-rw-r--r--modules/book/book.pages.inc5
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index 1daf7d657..eb76ed408 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -165,6 +165,7 @@ function book_menu() {
);
$items['book/js/form'] = array(
'page callback' => 'book_form_update',
+ 'delivery callback' => 'ajax_deliver',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'book.pages.inc',
@@ -1214,7 +1215,7 @@ function book_menu_subtree_data($link) {
$menu_router_alias = $query->join('menu_router', 'm', 'm.path = ml.router_path');
$book_alias = $query->join('book', 'b', 'ml.mlid = b.mlid');
$query->fields($book_alias);
- $query->fields($menu_router_alias, array('load_functions', 'to_arg_functions', 'access_callback', 'access_arguments', 'page_callback', 'page_arguments', 'title', 'title_callback', 'title_arguments', 'type'));
+ $query->fields($menu_router_alias, array('load_functions', 'to_arg_functions', 'access_callback', 'access_arguments', 'page_callback', 'page_arguments', 'delivery_callback', 'title', 'title_callback', 'title_arguments', 'type'));
$query->fields('ml');
$query->condition('menu_name', $link['menu_name']);
for ($i = 1; $i <= MENU_MAX_DEPTH && $link["p$i"]; ++$i) {
diff --git a/modules/book/book.pages.inc b/modules/book/book.pages.inc
index 0162fa69e..1e360ab8c 100644
--- a/modules/book/book.pages.inc
+++ b/modules/book/book.pages.inc
@@ -255,5 +255,8 @@ function book_form_update() {
$commands[] = ajax_command_replace(NULL, drupal_render($form['book']['plid']));
}
- ajax_render($commands);
+ // @todo: We could and should just return $form['book']['plid'] and skip the
+ // ajax_command_replace() above. But for now, this provides a test case of
+ // returning an AJAX commands array.
+ return array('#type' => 'ajax_commands', '#ajax_commands' => $commands);
}