phase2/oa_core — pull request #10 by dsnopek (2014-02-03 23:06:32+00:00)
Title: oa_buttons refactor: Moved 'Space type' and 'Section type' functionality from oa_buttons to oa_core / oa_sections

This moves the base 'Space type' and 'Section type' functionality from oa_buttons to oa_core and oa_sections. The "base functionality" is essentially:

- the space_type and section_type taxonomies themselves
- the ability to assign a Panelizer default to the taxonomy terms
- the fields on Space and Section which point to the type terms
- the ability to override the type and set a different Panelizer default

The goal is to make it so that oa_buttons only deals with integrating command buttons with Space and Section Types.

And this pull request pretty much accomplishes that! If it were possible to disable oa_buttons (unfortunately oa_permissions depends on it), you'd get the 'Panelizer default' stuff without any of the 'Node type' stuff.

There are a couple things which it doesn't do, though:

1. **It doesn't change/fix any of the field names.** There are some terribly chosen field names in oa_buttons. It seems like Sections were done first, so many of the fields have "section" in the name where they actually pertain to both Spaces and Sections. There is also the inconsistancy with field_oa_space_type connecting Spaces to their types, but field_oa_section connecting Sections to their types. *Anyway, I didn't change any field names - just moved them to the right module, because renaming fields is an update nightmare! This can be handled later if we want to do it.*

2. **The default Space/Section Types are still created in oa_buttons.** Since it's oa_buttons that defines the 'Node type' stuff, and the 'Node type' is important to the default Section Types, I couldn't think of an easy way to pull them out of oa_buttons. So, they're still created in oa_buttons for now.

Anyway, all the big stuff is moved to the correct place from a seperation of concerns perspective! So, even though it misses the above, it's still a huge improvement.

If everything in this pull request is working correctly, you shouldn't notice any change in functionality. A cache clear is probably required after pulling the code.