Index: modules/paging/paging.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/paging/paging.module,v
retrieving revision 1.15
diff -u -r1.15 paging.module
--- modules/paging/paging.module	12 Oct 2006 19:18:18 -0000	1.15
+++ modules/paging/paging.module	22 Nov 2006 18:53:32 -0000
@@ -5,7 +5,6 @@
 // by Earl Miles.
 
 define('PAGING_SEPARATOR', variable_get('paging_separator', '<!--pagebreak-->'));
-define('PAGING_SEPARATOR_PRINT', str_replace(array('<', '>'), array('&lt;', '&gt;'), PAGING_SEPARATOR));
 
 function paging_help($section) {
   switch ($section) {
@@ -17,12 +16,27 @@
                "%separator\n" .
                "second page here.\n" .
                "%separator\n" .
-               "more pages here.\n", array('%separator' => PAGING_SEPARATOR_PRINT));
-    case 'admin/modules#description':
-      return t("Allow users to use a tag to break a node up, for specified content types, into multiple pages.");
+               "more pages here.\n", array('%separator' => PAGING_SEPARATOR));
   }
 }
 
+function paging_menu($maycache) {
+
+  if ($maycache) {
+    $items[] = array(
+      'path' => 'admin/settings/paging',
+      'title' => t('Paging'),
+      'description' => t('Choose what node types to enable paging for & change the page breaking string'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => 'paging_settings',
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM,
+    );
+  }
+
+  return $items;
+}
+
 /*
  * Implementation of hook_settings()
  */
@@ -42,7 +56,7 @@
     '#description' => t('Paging separator string.  You should use an HTML tag that will render reasonably when paging is not enabled such as &lt;!--pagebreak--&gt; or &lt;HR /&gt;'),
   );
   $form['paging_config']['paging_read_more_enabled'] = array(
-    '#type' => 'checkboxe',
+    '#type' => 'checkbox',
     '#title' => t('Link read more to next page'),
 	'#description' => t('If enabled, "read more" link under teasers will link to the next content page. Note: Only works if teaser and first page have the same content. Usage not recommended, unless you are willing to customize it with your theme.'),
     '#default_value' => variable_get('paging_read_more_enabled', 0)
@@ -52,10 +66,10 @@
     '#title' => t('Node Types'),
     '#description' => t('Set the node types you want to enable Paging for.'),
     '#default_value' => variable_get('paging_node_types_enabled', array()),
-    '#options' => node_get_types(),
+    '#options' => node_get_types('names'),
   );
 
-  return $form;
+  return system_settings_form($form);
 }
 
 /*
@@ -90,26 +104,20 @@
     case 'view':
 	  $node_type = in_array($node->type, variable_get('paging_node_types_enabled', array()), TRUE);
       if (!$node->in_preview && $node_type && ereg('<!--paging_filter-->', $teaser ? $nodeteaser : $nodebody)) {
-        $element = 1; // to try and avoid breaking with comments
-        // check paging is really needed and avoid paging
-        // printer friendly pages as well.
+        $element = 1;
         if (!$teaser && $node->pages_count > 1 && arg(2) != 'print' && arg(2) != 'full') {
           global $pager_page_array, $pager_total;
           $page = isset($_GET['page']) ? $_GET['page'] : '';
           $pager_page_array = explode(',', $page);
           $pager_total[$element] = $node->pages_count;
           $page = isset($pager_page_array[$element]) ? $pager_page_array[$element] : 0;
-          $nodebody = check_markup($node->pages[$page], $node->format, false);
-          $nodebody .= theme('pager', NULL, 1, $element);
-		  if (module_exist('book') && $node->type=='book') {
-		  $node->body .= theme('book_navigation', $node); // temporary fix for book nav links
-		  }
+          $node->content['body']['#value'] = check_markup($node->pages[$page], $node->format, false);
+          $node->content['body']['#value'] .= theme('pager', NULL, 1, $element);
         }
         elseif ($teaser && $node->pages_count > 1 && strlen($node->teaser) > strlen($node->pages[0])) {
           // check to see if the teaser is longer than our first page.
-          $node->teaser = check_markup($node->pages[0], $node->format, false);
+          $node->content['body']['#value'] = check_markup($node->pages[0], $node->format, false);
           $node->pagemore = true;
-          // $node->paging_filter = true; // whats this for?
         }
       }
       break;
@@ -128,8 +136,12 @@
     }
 
     if ($main == 1 && $node->teaser && $node->pagemore && variable_get('paging_read_more_enabled', 0)) {
-	  theme_add_style(drupal_get_path('module', 'paging') . '/paging.css');
-      $links[] = l(t('read more'), "node/$node->nid", array('title' => t('Read the rest of this posting.'), 'class' => 'read-more-paging'), 'page=0,1');
+	  $links['node_read_more'] = array(
+        'title' => t('Read more'),
+        'href' => drupal_get_path_alias("node/$node->nid"),
+        'attributes' => array('title' => t('Read the rest of this posting.'), 'class' => 'read-more-paging'),
+        'query' => 'page=0,1'
+      );
     }
   }
 
@@ -144,7 +156,7 @@
     case 'list':
       return array(t("Paging"));
     case 'description':
-      return t('Allows content to be broken up into pages, using the %separator tag, configurable ' . l('here', 'admin/settings/paging') . '.', array('%separator' => PAGING_SEPARATOR_PRINT));
+      return t('Allows content to be broken up into pages, using the %separator tag, configurable ' . l('here', 'admin/settings/paging') . '.', array('%separator' => PAGING_SEPARATOR));
 
     // the filter gets called before the nodeapi 'view' so,
     // add a comment to the body to inform the nodapi to apply the filter
@@ -164,6 +176,6 @@
     return t('<h1>Paging Help</h1>') .  paging_help('admin/help#paging');
   }
   else {
-    return t('Use %separator to create page breaks.', array('%separator' => PAGING_SEPARATOR_PRINT));
+    return t('Use %separator to create page breaks.', array('%separator' => PAGING_SEPARATOR));
   }
 }
