Attached is a first version of the D7UX overlay we've been working hard for some time. Specs for the overlay was that it would provide specially themed admin pages on top of the real website, so one can navigate the admin area of a site on top of the actual site via the Drupal 7 admin toolbar. Goods example of the admin overlay in action are at http://www.d7ux.org/content/
So we took the Modal Frame API code, updated that to Drupal 7 () and started tinkering with a mapper module for our style/layout and linking style. Because Modal Frame API was still a bit beyond what we need for the admin overlay, we refactored some of the code we built on top of it and built all into one module we called the overlay module. I believe the jQuery UI dialogs this module reuses are already there to provide a level of abstraction, so we looked at providing a thin layer on top of it to provide the overlay functionality for Drupal 7.
Interesting challenges posed by the task:
- most links opened from the admin toolbar should open in the popup; the top menu bar was specified to not retain an active state when clicked, so that users will not assume that the lower bar is context sensitive; the lower bar should retain state to show which button's action is activated
- when pages open in the overlay, the page should use the admin theme; we used the "render=overlay" GET param to achieve this, so when this is in the URL, the page is themed with the admin theme in a style suitable for the overlay (only the content and help regions are perserved); otherwise if on an admin page, Drupal itself displays the admin page in the admin theme
- with pages displayed in the overlay, links clicked should still open in the overlay (we get this with iframes by default), but to keep the overlay theming, we need the "render=overlay" param passed on with the links
- with forms displayed in the overlay (such as with most admin forms), the results of the form submission should still be displayed in the overlay; when should we actually close the overlay on form submission and when should we keep it is up for discussion; it could highly depend on the button clicked in the form and could require Form API level information
- links with "class=to-overlay" get a click handler; this amusingly disallows right-clicking; ideally if you right-click and open in a new tab, that would not use the overlay theming, but only left-clicking would do the overlay theming and overlay display
- we need to identify links which should not keep being displayed in the overlay; from "Find content" for example, one finds posts; when admin links on the posts are clicked, that should open in the overlay; when the post link itself is clicked, that should break out of the overlay
- same goes for form submissions as detailed above; multistep forms, "save and edit" type of buttons, etc. should keep the overlay, but when a node is submitted for example, the form should close, and the new node should be redirected to in the site's theme in the main window
- more tricky are node previews (and any other type of preview which unlike Views would like to display the output in-place in the real site theme); the D7UX effort's answer to node preview's is to break out of the overlay for a preview and display a "minibar" at the top (like in http://www.d7ux.org/edit-on-page/) to "Edit again" or "Publish" based on the previewed look
- some tricky forms and admin pages still redirect to non-overlay-themed versions of the admin pages; such as when you manually run cron or check for clean URLs; we either need a systemic way to keep the "rendering mode" or need to identify these places and fix individually
Not all of the TODO items should be solved in the initial committed version of the overlay I'd say, since one patch can only attract so many collaborators. However, if anyone is interested in collaborating on fixing issues with the overlay patch as it is so far, feel free to ask for contributor access to our open Subversion repository at http://code.google.com/p/d7ux/ (Check out testing versions of the overlay coupled with the D7UX admin theme from there too).
The overlay works with Garland and should work with arbitrary admin themes, but ATM works best with the initial d7ux admin theme from. This is how it looks:
This patch has contributions from at least the original Modal Frame API maintainer (Markus Petrux) as well as Charlie Gordon and Philip Vergunst.
|#416||overlay-517688-416.patch||68.54 KB||Gábor Hojtsy|
Passed: 14288 passes, 0 fails, 0 exceptions View
Passed: 14255 passes, 0 fails, 0 exceptions View