I like the idea of being able to just edit the children of the current node, any thoughts to rolling this type of functionality in with the outline designer (http://drupal.org/project/outline_designer)? It's all about UX improvement for the book system and that sounds like the two could serve each other quite nicely if integrated properly.

Comments

btopro’s picture

Status: Active » Needs review

Try this, I think it'll provide the correct integration. I'm testing it right now but it appears to function correctly, just need to make sure it still respects permissions correctly

/**
 * Implementation of hook_form_alter(). 
 * Adds a radio select to choose between a link or a tab.
 */
function rearrange_child_pages_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'book_admin_settings') {
    $form['rearrange_child_pages_type'] = array(
      '#type' => 'radios',
      '#value' => t('Display rearrange child pages on node edit form'),
      '#options' => array('tab' => 'Tab', 'link' => 'Link'),
      '#default_value' => variable_get('rearrange_child_pages_type', 'tab'),
      '#weight' => 0,    
    );
  }
  if (module_exists('outline_designer')) {
    if ($form_id == 'book_admin_edit' && arg(0) == "node" && arg(2) == 'rearrange') {
      _outline_designer_book_admin_form_alter($form, $form_state, $form_id, 'outline_designer/ajax/');
    }
  }
}

Also, you do a db check for if something has children when this property should be along for the ride in the node. Instead of the DB call you should just be able to verify with $node->book['has_children'] == 1 as long as the book property is there it should know if it has children or not

kyle_mathews’s picture

This sounds very cool. Especially if you could load the form within a little popup, that make quick edits even quicker.

nirbhasa’s picture

This looks great - im very happy to look at this. (Also Id never heard of the Outline Designer module before, but it seems to be just what I need!!!) Also, you're right about the $node object.

I'm on vacation at moment, but I hope to look at this in the next week. Thanks!

btopro’s picture

Yeah, most people haven't but that's the typical reaction ;)

An issue that's still in OD's issue queue that this module seems like it might be able to help out with as well is this #794732: Expose interface to normal users...

You're project exposes based on just the admin-book-outlines permission, it would be awesome if we could come up with a permission that allowed someone to reorder the child pages of the content they have the ability to edit (or the admin book outlines permission).

Shoot me an email after you get back from vacation, I'd like to discuss plans for outline designer more as your project complements it extremely well.

btopro’s picture

Or I guess we could allow people with the "add content to books" permission to do it since they already have access to the outline tab. Maybe this module instead of adding it's tab it could add it's tab and remove the outline tab (or hijack it entirely) since this will provide a more usable solution then the outline select fields :p

btopro’s picture

Had any thought about this project / patch? Honestly I'd really like to just include this as a outline designer sub-module. I have an organic groups sub-module already and I think this would be another great one to add in. You could be added on as a project co-maintainer if you're interested. If you don't want to merge I'd just ask that you roll in the patch here since really I think most of my users should be using your module as well.

nirbhasa’s picture

Hmmm..you know what - I think merging into the outline designer module would actually be a good idea. Theres way too many modules out there, and I dont want to be accused of adding to the cruft.

IMHO, I wouldn't even include it as a sub-module, i would just add the hooks and settings. If they just want the rearrange child pages feature, we could arrange that via permissions or something. What do you think?

btopro’s picture

That sounds good to me (via a permission). I think this should use 2 permissions for this...

If they have admin book outlines then they can do it to anything

or a new permission for "outline own child content" (or something like that) so that if you own the node you're on (and it has items under it) then you can use the outline designer on it.

Thoughts?

nirbhasa’s picture

Sounds great. Im a little tied up for next few days, so won't be able to create a patch before the weekend. But ill add a little notice now warning that the module will be merged.

btopro’s picture

awesome. When you create a patch please add it as a new issue in the outline designer issue queue referencing this thread. Once it's accepted (which I mean as long as it works I obviously will) I'll roll it in after the Git migration.

Thanks!

btopro’s picture

I'm going to be working on rolling this into outline designer tomorrow as a sub module (much in the way that OG was integrated). I love the functionality but don't want to freak out my user-base if tabs start showing up in their UIs that they don't expect :)

nirbhasa’s picture

Please do! Things have been a bit nuts my end, and Im not sure when i can sit down and look at it. If you want to move this issue into the Outline Designer queue that's fine. Then i'll point everyone towards the outline designer project page when its done

btopro’s picture

I'll create a new issue in outline designer and reference this one, hopefully I'll have it added by the end of the day, working in a few other patches atm.

btopro’s picture

Assigned: Unassigned » btopro
Status: Needs review » Fixed

This can now be found in Outline Designer 1.3, go get it! http://drupal.org/node/1063848

nirbhasa’s picture

Thanks btopro! I've update module page accordingly.

Can I refer outstanding feature requests to the Outline Designer issue queue, and you can judge them on their merits?

btopro’s picture

that sounds good to me

Status: Fixed » Closed (fixed)

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