The function _colorbox_active() only checks for the configured paths to include/exclude colorbox from the page. Unfortunately this is not flexible enough (at least for our needs ;)).
Guess you wan't include colorbox on admin pages (as done by default using the path "admin*" in the configuration "Show colorbox on specific pages" but need to add it to a specific administration page. Currently there is no way to include one specific path but exclude all others of this type.

Proposal: add an alter-hook to _colorbox_active() so other modules can change the state of colorbox.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stBorchert’s picture

Status: Active » Needs review
FileSize
1.08 KB

Here is a patch which simply adds drupal_alter('colorbox_active').

frjo’s picture

Looks like a solid patch that would improve Colorbox without any bad side effects.

What do you think about changing the hook_alter parameter name from "$page_match" to "$activate"? Seems lika a more logical wording for the hook?

stBorchert’s picture

Changed the name of the parameter in colorbox.api.php to $active (which sounds more like a state).

Patch built on top of current HEAD.

  • frjo committed 97a4ff1 on 7.x-2.x authored by stBorchert
    Issue #2374425 by stBorchert: Added Allow other modules to enable...
frjo’s picture

Status: Needs review » Fixed

Committed to 7.x-2.x. Thanks for the contribution!

Status: Fixed » Closed (fixed)

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