Index: outline.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/outline/outline.module,v retrieving revision 1.58 diff -u -p -r1.58 outline.module --- outline.module 4 May 2009 21:35:56 -0000 1.58 +++ outline.module 22 Jul 2009 19:52:24 -0000 @@ -32,7 +32,7 @@ function outline_form_alter(&$form, $form_state, $form_id) { // Site wide settings. - if ('book_admin_settings' == $form_id) { + if ('book_admin_settings' == $form_id && variable_get('outline_add_child_link', 1)) { $form['book_child_type']['#description'] .= '
' . t('This setting is the site-wide default. Outline.module allows you to have a per-book default and a per node value.') . ''; } @@ -173,7 +173,7 @@ function outline_link($type, $node = NUL $child_type = $child_type_book_default; } - if (node_access('create', $child_type) && 1 == $node->status && $node->book['depth'] < MENU_MAX_DEPTH) { + if (node_access('create', $child_type) && 1 == $node->status && $node->book['depth'] < MENU_MAX_DEPTH && variable_get('outline_add_child_link', 1)) { $links['outline_add_child'] = array( 'title' => t('Add child !node_type', array( '!node_type' => node_get_types('name', $child_type))), 'href' => "node/add/". str_replace('_', '-', $child_type), @@ -817,6 +817,16 @@ function outline_admin_settings_form() { '#default_value' => variable_get('toc_default_depth', 5), '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9)), ); + $add_child_link_description = t('Book.module allows site-wide setting of the content type for the Add child page link. '); + $add_child_link_description .= t("Outline.module allows you to have a per-book default and a per node value by taking over Book.module's links. "); + $add_child_link_description .= t("You may disable that feature here (if for example you want another module to modify Book.module's core links)."); + $form['outline_add_child_link'] = array( + '#type' => 'checkbox', + '#title' => t('Enable per-book default and optional per node value for Add child page link'), + '#return_value' => 1, + '#default_value' => variable_get('outline_add_child_link', 1), + '#description' => $add_child_link_description + ); return $form; }