--- page.module 2005-02-08 20:44:39.000000000 +0100 +++ page.module 2005-08-31 12:23:58.000000000 +0200 @@ -77,4 +77,78 @@ function page_form(&$node) { return $output; } +/** + * Implementation of hook_view(). + */ + +function page_view(&$node, $teaser = FALSE, $page = FALSE) { + // prepare the node content + + if (ereg("", $node->body)) { + + $temp_array = explode("", $node->body); + + if (array_key_exists("chunk", $_GET) && + is_int($_GET["chunk"]) && ($_GET["chunk"] > 1)) { + + $chunk = $_GET["chunk"] - 1; + + }//THEN + else if (count($temp_array) > 1) { + + $chunk = 0; + + }//THEN + + $node->body = $temp_array[$chunk]; + + $node->body .= "
"; + + if ($chunk > 0) { + + $node->body .= "precedente | "; + + }//THEN + + for ($i = 1; $i <= count($temp_array); $i++) { + + if ($chunk + 1 == $i) { + + $node->body .= $i; + + if ($i != count($temp_array)) { + + $node->body .= " | "; + + }//THEN + + }//THEN + else { + + $node->body .= "".$i." | "; + + }//ELSE + + }//FOR + + if ($chunk < count($temp_array) - 1) { + + $node->body .= "successivo"; + }//THEN + + $node->body .= "
"; + + }//THEN + +} + ?>