Closed (fixed)
Project:
Skinr
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2011 at 02:13 UTC
Updated:
6 Jun 2011 at 01:11 UTC
Jump to comment: Most recent file
See #1029058: [META ISSUE] Change skin configuration for details.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | patch_commit_60ad7e141418.patch | 35.49 KB | moonray |
| #10 | patch_commit_fe92cfd27cee.patch | 29.1 KB | moonray |
| #7 | skinr_1044222_7.patch | 28.13 KB | moonray |
| #6 | skinr_1044222_6.patch | 28.11 KB | moonray |
| #3 | skinr-HEAD.config-form.3.patch | 39.89 KB | sun |
Comments
Comment #1
jacineI'm really happy about this one. Been wanting this for a while. :D
Comment #2
sunUgh. @
Comment #3
sunTechnically, it should go like this...
Comment #4
coltraneIn #1029058: [META ISSUE] Change skin configuration sun said,
and looking at the patch I understand what it's doing, but for sake of newbies to Skinr (like me), can you explain what the purpose of this issue is? What is the ultimate goal?
Comment #5
moonray commentedWell, looks like we're going to run into a big problem with panels (again) if we want to remove third-party forms. The way they do their contextual links is all custom, and they don't have a hook to get in there. Here a link to the issue I opened for it: #1051418: Need a hook_panels_pane_admin_links_alter() in template_preprocess_panels_pane()
As for removing all the above (see patch), I think that's way over the top. We need to keep skinr functional. I'll post a more reasonable patch that removes ONLY the third party forms (though we'd need panels to patch things in order for skinr to work with it... again).
Comment #6
moonray commentedAttached patch only removes skinr config from third-party forms. It adds a few comments (for clarity), and the
panels_panels_pane_admin_links_alter()function which will only work if above patch gets in (we can omit the function, but without it skinr can't be configured for panels).Comment #7
moonray commentedHere's an updated patch using the suggested
hook_panels_pane_content_alter()to make contextual links for panel panes. There is, however, no way to do this for displays or panel regions that I'm aware of (they don't have preprocess hooks for skinr to work with), so we would loose the ability to affect these if we implement this patch.EDIT: Ran tests locally. No fails.
Comment #8
moonray commentedComment #9
rickmanelius commentedSo is the patch posted by mooray sufficient to fulfill the agreed upon request by sun and jacine?
Which 3rd party form would I test on to prove it's working?
Comment #10
moonray commentedRerolled the patch.
As noted above, this will make it so there no longer is access to the following:
You can still edit skins for panel panes, though.
This is due to Panels module limitations (the display and regions both don't have proper preprocess functions and compatible template files).
Comment #11
moonray commentedIt looks like views changed things around and made it nearly impossible to add contextual links. Why always these custom implementations of good APIs?
Comment #12
moonray commented#1149726: Create an 'add skin configuration' form to edit any element on the site should take care of elements that are inaccessible through contextual links (the cog).
Attached patch fixes views (see #1147912: Views contextual links should allow custom (non-views) contextual links) and panel pane contextual links. I've also updated the element names to use the '__' (double underscore) which is now fairly standard in drupal 7. It also allows us to avoid potential problems with postgres (see #1073108: Use of three-parameter concat function is bad for postgres compatibility). It also fixes a small bug where contextual links for regions would output the same as for a page.
Comment #13
moonray commentedAnd let's review it.
Comment #14
moonray commentedCommitted this. See http://drupalcode.org/project/skinr.git/commit/dd98548
Since I'm not getting any feedback, I'm going to just go ahead and commit things. If stuff breaks, file a bug report.
Comment #15
sunThanks for moving forward and making progress, @moonray :)
The committed patch looks good, code-wise. Especially happy to see lots of ugly code being removed.
AFAICS, the next best step in terms of major API changes and clean-up would be to entirely remove/simplify the following fugly construct:
The entire "index handler" thing is a very weird construct. IIRC, I starred for quite some time at it, but wasn't really able to figure out WTF it means and how it's supposed to work.
Given that we now rely on renderable elements (for runtime operation) as well as contextual links (for administrative UI), we should be able to completely revamp this essential part of Skinr (the actual API to integrate with other modules). Ideally, we standardize it to only allow for one way to integrate with Skinr. And that API standard should be very easy to understand for anyone who wants to integrate with Skinr.
This is highly important for Skinr's adoption throughout the Drupal community. Skinr is only going to be successful, if developers are able to grok and easily implement what Skinr asks for.
I'm not sure whether you already have ideas or plans in this direction, but we should definitely create a new issue for it, figure out what kind of tasks the remaining API/include files are performing, and lastly, discuss how that can be completely revamped and simplified.
Comment #16
moonray commented@sun I would love to clean up the functionality plugins. I'm just not sure what a better way to handle this would be.
We have the following callbacks left after this last patch:
EDIT: Are you suggesting we change these into hooks (e.g. hook_skinr_ui_preprocess_hooks(&$form, $form_state), hook_skinr_elements(&$variables), hook_skinr_preprocess_hooks(&$variables))?
Comment #17
moonray commentedRegarding the
block_skinr_form_index_handler()function... that was supposed to be removed with the above patch. Did that in this follow-up commit: http://drupalcode.org/project/skinr.git/commit/1c68fa8.Comment #18
sunI guess it would make sense to create a new issue for the API changes discussed since #15.
I'd have to have a closer look at the current code. However, it would be ideal if we could write down something along the lines of #16 in the new issue - but with some more essential details; for example, (not having looked at the code yet) the purpose of contextual_links_handler is not clear to me - I don't understand why some other module has to deal or assist with contextual links for Skinr UI at all. In such cases, we should also clarify the difference to having modules simply implement hook_contextual_links_view_alter() instead, or why that wouldn't be feasible.
The goal should be to have a single hook_skinr_config_info() [or whatever it was/is named] with clear and concise info properties being returned, and most of the module integration information being cached or cacheable. If something is based on dynamic values (retrieval/assignment), then there should be a dedicated hook that is being invoked, getting clear function arguments (for example, passing $form and $form_state to a preprocess_hook_callback is... highly confusing for me). Ideally, there should be default implementations provided by Skinr itself for the 80% use-case, so most module integration code doesn't have to implement common logic.
Comment #19
vrajak@gmail.com commentedLate to the thread here, but I just wanted to comment that the patch in #12 works fine. Tested skins after patching and no errors etc.