As it stands right now, if I want to change the IPE buttons in any way, I have to hook_page_alter() my way into them and do some pretty gross stuff. These could be altered during the add_meta() phase and allow modules collaborating in the panel display rendering process to have some say over the buttons. My use case to to allow me to hide these buttons in some cases through an access check.

Eclipse

CommentFileSizeAuthor
#2 2465193-1.patch2.03 KBeclipsegc

Comments

eclipsegc’s picture

code!

Ok, this code adds an alter into panels_ipe_toolbar_add_button() which allows us to edit each button individually as necessary. In addition to this change, I've passed the non-clean-string'd version of the IPE cache key. To compensate for this change, I clean the string before rendering the buttons in the theme function.

All of this together gives me an alter that allows me to control much about these buttons including things like access. In my own use case, I'm denying access to these buttons on workbench_moderated node types so that draft mode edits are the only way to alter the display, but that's just my own use case.

eclipsegc’s picture

Status: Active » Needs review
StatusFileSize
new2.03 KB

oops, ok code for real

Eclipse

eyilmaz’s picture

Status: Needs review » Reviewed & tested by the community

Thank you. Reviewed and tested. Works as expected.
We are using this in for the same purpose as Eclipse, but with revisioning/workflow.
Would be nice if this gets committed soon.

Anonymous’s picture

We have been using this for 6+ months in production as well with no problems.

  • japerry committed 9fc1909 on 7.x-3.x authored by EclipseGc
    Issue #2465193 by EclipseGc: Allow modules to alter IPE buttons w/o...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

This is also being used in production by lightning and some others. Looks good to me. Committed.

Status: Fixed » Closed (fixed)

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