summaryrefslogtreecommitdiff
path: root/modules/book/book.module
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-10-15 19:33:27 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-10-15 19:33:27 +0000
commit59150295800f9a918c26da25855e41dba78eb5b8 (patch)
tree255e14eaf09e027f568e53f93087dd6a1fd2a3b1 /modules/book/book.module
parent0a61aff2518f149cf3317ef47b9eb1cc7347f78e (diff)
downloadbrdo-59150295800f9a918c26da25855e41dba78eb5b8.tar.gz
brdo-59150295800f9a918c26da25855e41dba78eb5b8.tar.bz2
#181125 by quicksketch and dmitrig01: AHAH usability improvements for book module
- book outline form reordering in real-time - better context sensitive book parent editing
Diffstat (limited to 'modules/book/book.module')
-rw-r--r--modules/book/book.module22
1 files changed, 14 insertions, 8 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index 3fb34a486..da000663d 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -131,13 +131,19 @@ function book_menu() {
'type' => MENU_CALLBACK,
'file' => 'book.pages.inc',
);
- $items['book-form-update/%/%'] = array(
+ $items['book/js/form'] = array(
'page callback' => 'book_form_update',
- 'page arguments' => array(1, 2),
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'book.pages.inc',
);
+ $items['book/js/admin/%node'] = array(
+ 'page callback' => 'book_admin_js_update',
+ 'access callback' => '_book_outline_access',
+ 'access arguments' => array(3),
+ 'type' => MENU_CALLBACK,
+ 'file' => 'book.admin.inc',
+ );
return $items;
}
@@ -366,14 +372,9 @@ 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, $node) {
- $settings['book']['formCallback'] = url('book-form-update' , array());
- $settings['book']['formId'] = $form['#id'];
- drupal_add_js($settings, 'setting');
- drupal_add_js(drupal_get_path('module', 'book') .'/book.js');
- drupal_add_js('misc/progress.js');
-
// Need this for AJAX.
$form['#cache'] = TRUE;
+ drupal_add_js("if (Drupal.jsEnabled) { $(document).ready(function() { $('#edit-book-pick-book').css('display', 'none'); }); }", 'inline');
$form['book'] = array(
'#type' => 'fieldset',
@@ -433,6 +434,11 @@ function _book_add_form_elements(&$form, $node) {
'#description' => t('Your page will be a part of the selected book.'),
'#weight' => -5,
'#attributes' => array('class' => 'book-title-select'),
+ '#ahah' => array(
+ 'path' => 'book/js/form',
+ 'wrapper' => 'edit-book-plid-wrapper',
+ 'effect' => 'slide',
+ ),
);
}