It would be nice if a module could declare block editing links that zen would use. The attached patch checks to see if there's already a $vars['edit_links'] declared. If it's an array of links, zen_preprocess_block_editing will add to it, otherwise it will just quit, assuming the module doesn't want zen to add its links.

This will be nice because then modules can declare links that it may use for things like modal block editing that it otherwise couldn't do without altering the theme registry so that it's hook_preprocess_block is called after zen's.

Comments

johnalbin’s picture

Version: 6.x-1.0 » 6.x-2.x-dev
StatusFileSize
new3.48 KB

James, like all good ideas, this seems obvious after you suggested it. Nice!

I’m not crazy about your implementation though. Here’s the patch I’m going to commit. It allows modules to add links into the $vars['edit_links_array'] variable. You, of course, could still add a flattend-to-string version of that in $vars['edit_links'], but Zen will continue to use the array version of the variable to re-create the edit links. Make sense?

johnalbin’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Needs review » Fixed

Ok. Commited to HEAD (6.x-2.x-dev) and to DRUPAL-6--1 (6.x-1.x-dev).

Thanks, James!

q0rban’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Fixed » Needs work

JohnAlbin, yeah, I wasn't crazy about the implementation either, but I couldn't think of a good way to allow the module to just completely bypass zen altogether if it wanted to. So, correct me if I'm wrong, but your patch doesn't actually allow for the module to do that. So, I'd like to think of a way that you're ok with, where modules can actually override the links that are there, not just add to them.

johnalbin’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Status: Needs work » Fixed

Unfortunately, the theme layer always gets last whack at the variables and the html. So a module can't override anything a theme does. What I committed allows a module to add links to Zen’s block editing links, but not to alter or modify the ones Zen adds.

Unless you do some theme registry wizardry, of course. But you don't need to patch Zen for that.

Status: Fixed » Closed (fixed)

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