This module needs to be ported to D7

Comments

soulfroys’s picture

+1 !!!!!!! That would be awesome!

jhr’s picture

StatusFileSize
new6.22 KB
new2.36 KB

Here's a patch, and a zip...

soulfroys’s picture

Status: Needs work » Needs review

Cool, thanks!

jhr’s picture

StatusFileSize
new2.57 KB

Already had a bug...

jhr’s picture

StatusFileSize
new5.12 KB

This one adds numbers to the navigation links in the tree below the page document, and the prev/next links. Still use the "menu block" module for a block of links.

Anandyrh’s picture

any plans for D7 official release?

jhr’s picture

Hmm.. no plans...
I'd have to go about getting commit access.... Original maintainer added this to d.o and abandoned.

tomimikola’s picture

Yes, you'd get them simply just by asking me. And now you got them. I appreciate your work. Just make sure you go through Coder results. The sandbox D7 version gave these notices:

bookchapters.module

Line 15: The control statement should be on a separate line from the control conditional
  if ( stripos(drupal_get_path_alias($_GET['q']), 'admin')===0) { return; } 
Line 16: Separate comments from comment syntax by a space.
  //if ( substr(drupal_get_path_alias($_GET['q']),-4) =='edit') { return; } 
Line 19: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
    $node->title = _bookchapters_get_chapter_numbering($node->nid) ." ". $node->title;
Line 26: Remove the empty commented line in your function documentation.
Line 30: Separate comments from comment syntax by a space.
  //Numbering must be removed when viewing node edit form.
Line 31: Separate comments from comment syntax by a space.
  //Otherwise it would be stored to database together with title.
Line 33: Control statements should have one space between the control keyword and opening parenthesis
  if( isset($node->nid) ) {
Line 35: use a space between the closing parenthesis and the open bracket
    if ( !empty($numbering) && (strpos($node->title, $numbering) == 0) ){
Line 72: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
  $item['link']['link_title'] = $chapter_numbering .' '. $item['link']['link_title'];
Line 73: String concatenation should be formatted with a space separating the operators (dot .) and the surrounding terms
  $item['link']['title'] = $chapter_numbering .' '. $item['link']['title'];
Line 76: Control statements should have one space between the control keyword and opening parenthesis
    foreach($item['below'] as $key => $value) {
Line 83: Separate comments from comment syntax by a space.
  static $bookchapter_values; //@todo change to $bookchapters =  &static_drupal(__FUNCTION__,array())
Line 93: Arrays should be formatted with a space separating each element and assignment operator
  $book_info = db_query('SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid = :nid', array(':nid'=>$nid) )->fetchAssoc();
Line 102: Arrays should be formatted with a space separating each element and assignment operator
  $book_info = db_query('SELECT nid FROM book b WHERE mlid = :mlid', array(':mlid'=>$mlid) )->fetchAssoc();
Line 102: table names should be enclosed in {curly_brackets}
  $book_info = db_query('SELECT nid FROM book b WHERE mlid = :mlid', array(':mlid'=>$mlid) )->fetchAssoc();
Line 113: Separate comments from comment syntax by a space.
  //to gain performance benefits filter using primary key field
Line 115: Arrays should be formatted with a space separating each element and assignment operator
                            array( ':menu_name'=> $menu_name, ':plid'=>$plid) );
Line 135: use a space between the closing parenthesis and the open bracket
function book_preprocess(&$variables, $hook){
jhr’s picture

Thanks!

I was gonna play with the sandbox some and get familiar with git a little more before getting in touch.

I'll work through coder.

jhr’s picture

Title: D7 version » D7 version - Done
Version: 6.x-1.0 » 7.x-1.1

Done and updated

jhr’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.