summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt39
-rw-r--r--KNOWN_ISSUES.txt91
-rw-r--r--README.txt7
-rw-r--r--UPGRADE.txt22
-rw-r--r--css/panels-dashboard.css62
-rw-r--r--css/panels.css50
-rw-r--r--css/panels_admin.css165
-rw-r--r--css/panels_dnd.css629
-rw-r--r--css/panels_page.css14
-rw-r--r--help/api.html44
-rw-r--r--help/display.html0
-rw-r--r--help/pane.html0
-rw-r--r--help/panels.help.ini74
-rw-r--r--help/plugin-layout.html80
-rw-r--r--help/plugins-layout.html78
-rw-r--r--help/plugins-style.html0
-rw-r--r--images/arrow-active.pngbin313 -> 0 bytes
-rw-r--r--images/arrow-down-light.pngbin271 -> 0 bytes
-rw-r--r--images/bg-content-modal.pngbin156 -> 0 bytes
-rw-r--r--images/bg-shade-dark.pngbin220 -> 0 bytes
-rw-r--r--images/bg-shade-light.pngbin216 -> 0 bytes
-rw-r--r--images/bg-shade-medium.pngbin221 -> 0 bytes
-rw-r--r--images/bg-shade-white-lrg.pngbin214 -> 0 bytes
-rw-r--r--images/blank.gifbin49 -> 0 bytes
-rw-r--r--images/close.gifbin949 -> 0 bytes
-rw-r--r--images/delete.pngbin795 -> 0 bytes
-rw-r--r--images/go-down.pngbin583 -> 0 bytes
-rw-r--r--images/go-right.pngbin392 -> 0 bytes
-rw-r--r--images/go-up.pngbin566 -> 0 bytes
-rw-r--r--images/icon-addcontent.pngbin818 -> 0 bytes
-rw-r--r--images/icon-cache.pngbin1001 -> 0 bytes
-rw-r--r--images/icon-configure.pngbin765 -> 0 bytes
-rw-r--r--images/icon-delete.pngbin877 -> 0 bytes
-rw-r--r--images/icon-draggable.pngbin236 -> 0 bytes
-rw-r--r--images/icon-hidepane.pngbin735 -> 0 bytes
-rw-r--r--images/icon-showpane.pngbin701 -> 0 bytes
-rw-r--r--images/no-icon.pngbin3398 -> 0 bytes
-rw-r--r--images/portlet-collapsed.pngbin108 -> 0 bytes
-rw-r--r--images/portlet-expanded.pngbin106 -> 0 bytes
-rw-r--r--images/screenshot-1.jpgbin14072 -> 0 bytes
-rw-r--r--images/screenshot-2.jpgbin43830 -> 0 bytes
-rw-r--r--images/screenshot-3.jpgbin43224 -> 0 bytes
-rw-r--r--images/screenshot-4.jpgbin73474 -> 0 bytes
-rw-r--r--images/sky.pngbin2275 -> 0 bytes
-rw-r--r--images/sprite.pngbin14325 -> 0 bytes
-rw-r--r--images/throbber.gifbin3208 -> 0 bytes
-rw-r--r--images/user-trash.pngbin507 -> 0 bytes
-rw-r--r--includes/callbacks.inc189
-rw-r--r--includes/common.inc575
-rw-r--r--includes/display-edit.inc311
-rw-r--r--includes/display-layout.inc282
-rw-r--r--includes/legacy.inc41
-rw-r--r--includes/page-wizard.inc88
-rw-r--r--includes/panels.pipelines.inc33
-rw-r--r--includes/plugins.inc495
-rw-r--r--js/display_editor.js523
-rw-r--r--js/layout.js18
-rw-r--r--js/panels-base.js28
-rw-r--r--js/panels.js28
-rw-r--r--panels.info11
-rw-r--r--panels.install322
-rw-r--r--panels.module1660
-rw-r--r--panels_ipe/css/panels_ipe.css209
-rw-r--r--panels_ipe/images/dragger.pngbin946 -> 0 bytes
-rw-r--r--panels_ipe/includes/panels_ipe.pipelines.inc44
-rw-r--r--panels_ipe/js/panels_ipe.js256
-rw-r--r--panels_ipe/panels_ipe.info7
-rw-r--r--panels_ipe/panels_ipe.module162
-rw-r--r--panels_ipe/plugins/display_renderers/ipe.inc5
-rw-r--r--panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php258
-rw-r--r--panels_mini/panels_mini.info6
-rw-r--r--panels_mini/panels_mini.install124
-rw-r--r--panels_mini/panels_mini.module429
-rw-r--r--panels_mini/plugins/content_types/icon_panels_mini.pngbin450 -> 0 bytes
-rw-r--r--panels_mini/plugins/content_types/panels_mini.inc134
-rw-r--r--panels_mini/plugins/export_ui/panels_mini.inc41
-rw-r--r--panels_mini/plugins/export_ui/panels_mini_ui.class.php291
-rw-r--r--panels_node/panels_node.info7
-rw-r--r--panels_node/panels_node.install71
-rw-r--r--panels_node/panels_node.module431
-rw-r--r--plugins/cache/simple.inc137
-rw-r--r--plugins/display_renderers/editor.inc5
-rw-r--r--plugins/display_renderers/panels_renderer_editor.class.php1889
-rw-r--r--plugins/display_renderers/panels_renderer_simple.class.php32
-rw-r--r--plugins/display_renderers/panels_renderer_standard.class.php616
-rw-r--r--plugins/display_renderers/simple.inc8
-rw-r--r--plugins/display_renderers/standard.inc5
-rw-r--r--plugins/export_ui/panels_layouts.inc23
-rw-r--r--plugins/export_ui/panels_layouts_ui.class.php230
-rw-r--r--plugins/layouts/flexible/flexible-admin.css87
-rw-r--r--plugins/layouts/flexible/flexible-admin.js413
-rw-r--r--plugins/layouts/flexible/flexible.css4
-rw-r--r--plugins/layouts/flexible/flexible.inc1781
-rw-r--r--plugins/layouts/flexible/flexible.pngbin208 -> 0 bytes
-rw-r--r--plugins/layouts/flexible/grippie-vertical.pngbin265 -> 0 bytes
-rw-r--r--plugins/layouts/onecol/onecol.css21
-rw-r--r--plugins/layouts/onecol/onecol.inc14
-rw-r--r--plugins/layouts/onecol/onecol.pngbin122 -> 0 bytes
-rw-r--r--plugins/layouts/onecol/panels-onecol.tpl.php19
-rw-r--r--plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php29
-rw-r--r--plugins/layouts/threecol_25_50_25/threecol_25_50_25.css35
-rw-r--r--plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc20
-rw-r--r--plugins/layouts/threecol_25_50_25/threecol_25_50_25.pngbin200 -> 0 bytes
-rw-r--r--plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php46
-rw-r--r--plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css45
-rw-r--r--plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc17
-rw-r--r--plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.pngbin208 -> 0 bytes
-rw-r--r--plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php31
-rw-r--r--plugins/layouts/threecol_33_34_33/threecol_33_34_33.css35
-rw-r--r--plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc15
-rw-r--r--plugins/layouts/threecol_33_34_33/threecol_33_34_33.pngbin196 -> 0 bytes
-rw-r--r--plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php46
-rw-r--r--plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css45
-rw-r--r--plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc23
-rw-r--r--plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.pngbin208 -> 0 bytes
-rw-r--r--plugins/layouts/twocol/panels-twocol.tpl.php25
-rw-r--r--plugins/layouts/twocol/twocol.css37
-rw-r--r--plugins/layouts/twocol/twocol.inc14
-rw-r--r--plugins/layouts/twocol/twocol.pngbin193 -> 0 bytes
-rw-r--r--plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php53
-rw-r--r--plugins/layouts/twocol_bricks/twocol_bricks.css46
-rw-r--r--plugins/layouts/twocol_bricks/twocol_bricks.inc25
-rw-r--r--plugins/layouts/twocol_bricks/twocol_bricks.pngbin277 -> 0 bytes
-rw-r--r--plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php40
-rw-r--r--plugins/layouts/twocol_stacked/twocol_stacked.css41
-rw-r--r--plugins/layouts/twocol_stacked/twocol_stacked.inc16
-rw-r--r--plugins/layouts/twocol_stacked/twocol_stacked.pngbin202 -> 0 bytes
-rw-r--r--plugins/page_wizards/landing_page.inc277
-rw-r--r--plugins/page_wizards/node_override.inc295
-rw-r--r--plugins/style_bases/pane/pane_plain_box/icon.pngbin3022 -> 0 bytes
-rw-r--r--plugins/style_bases/pane/pane_plain_box/pane-plain-box.css11
-rw-r--r--plugins/style_bases/pane/pane_plain_box/pane-plain-box.tpl.php16
-rw-r--r--plugins/style_bases/pane/pane_plain_box/pane_plain_box.inc93
-rw-r--r--plugins/style_bases/pane/pane_rounded_shadow/box-color.pngbin4772 -> 0 bytes
-rw-r--r--plugins/style_bases/pane/pane_rounded_shadow/box-shadow.pngbin2528 -> 0 bytes
-rw-r--r--plugins/style_bases/pane/pane_rounded_shadow/icon.pngbin3566 -> 0 bytes
-rw-r--r--plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css105
-rw-r--r--plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.tpl.php31
-rw-r--r--plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc99
-rw-r--r--plugins/style_bases/region/region_plain_box/icon.pngbin3022 -> 0 bytes
-rw-r--r--plugins/style_bases/region/region_plain_box/region-plain-box.css6
-rw-r--r--plugins/style_bases/region/region_plain_box/region-plain-box.tpl.php28
-rw-r--r--plugins/style_bases/region/region_plain_box/region_plain_box.inc65
-rw-r--r--plugins/style_bases/region/region_rounded_shadow/box-color.pngbin4772 -> 0 bytes
-rw-r--r--plugins/style_bases/region/region_rounded_shadow/box-shadow.pngbin2528 -> 0 bytes
-rw-r--r--plugins/style_bases/region/region_rounded_shadow/icon.pngbin3566 -> 0 bytes
-rw-r--r--plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css97
-rw-r--r--plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.tpl.php28
-rw-r--r--plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc71
-rw-r--r--plugins/styles/block.inc56
-rw-r--r--plugins/styles/corners/corner-bits.pngbin514 -> 0 bytes
-rw-r--r--plugins/styles/corners/panels-rounded-corners-box.tpl.php20
-rw-r--r--plugins/styles/corners/rounded_corners.inc205
-rw-r--r--plugins/styles/corners/shadow-b.pngbin140 -> 0 bytes
-rw-r--r--plugins/styles/corners/shadow-l.pngbin137 -> 0 bytes
-rw-r--r--plugins/styles/corners/shadow-r.pngbin137 -> 0 bytes
-rw-r--r--plugins/styles/corners/shadow-t.pngbin139 -> 0 bytes
-rw-r--r--plugins/styles/default.inc27
-rw-r--r--plugins/styles/list.inc58
-rw-r--r--plugins/styles/naked.inc24
-rw-r--r--plugins/styles/stylizer.inc360
-rw-r--r--plugins/task_handlers/panel_context.inc822
-rw-r--r--plugins/views/panels.views.inc25
-rw-r--r--plugins/views/panels_views_plugin_row_fields.inc192
-rw-r--r--templates/panels-dashboard-block.tpl.php13
-rw-r--r--templates/panels-dashboard-link.tpl.php12
-rw-r--r--templates/panels-dashboard.tpl.php11
-rw-r--r--templates/panels-pane.tpl.php50
168 files changed, 1 insertions, 17498 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
deleted file mode 100644
index 4d6a68f..0000000
--- a/CHANGELOG.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-CHANGELOG for Panels 3.0 for Drupal 7
-Panels 7.x-3.0-dev
-==================
-#1025716: Panels fields broken in last update.
-#1056464 by EclipseGc: Fix broken delete statement in mini panel delete.
-#954324 by EclipseGc: Fix broken delete statement in mini panel uninstall.
-#1008120: "classes" not passing through to rounded shadow pane stylizer style, preventing style from working.
-
-Panels 7.x-3.0-alpha2 (10-Jan-2011)
-=====================
-
-#920266 by dereine: Typo in cache.inc caused wsods in rare circumstances.
-#879482 by mvc: Ensure Panels and CTools module files are loaded during update. Apparently could cause WSOD if not.
-#917614 by jskulski: IPE broken in IE.
-#906520: Improve CSS for rounded shadow boxes on IE7.
-#932632 by mikeytown2: Fix notice in .install file.
-#927840: Add clear-block to dashboard HTML to ensure themes do not do weird things to it.
-#869766: Fix occasional problem with flexible layout pushing the entire layout to the left in certain fixed-width only configurations.
-#949310: E_STRICT violation on declaration of render_pane() method of display renderers.
-#940002: Custom style modal was broken.
-#953484: Panes were not properly using classes array.
-#941532: panel nodes had some serious problems do to hook_node_*.
-#954324: Mini panels failed during uninstall.
-#827628: "Add content" dialog could lose content with the same title as other content.
-Fix the naked style to support content that needs to be rendered.
-#958072: Fix panels_node_node_access to not throw warnings on menu access tests.
-#965286: Panel node update was trying to use db_insert() instead of db_update().
-#964334: Panels breaks views' row styles with the panels fields style.
-#941802: Fix radio layout butotn.
-#980696 by das-peter: Update calls to drupal_set_html_head() to D7.
-#961662 by Nick Lewis: Account for pager info in simple caching.
-#980870 by das-peter: CSS handling during caching broken.
-#970076: Remove old hook_update functions.
-#978768 by linclark: Fix notice with panel fields.
-#977296: Regions with _ such as with two column bricks would not save content.
-#987902: Fix flexible layout splitter resize brokenness.
-#967734 by das-peter and intoxination: Upgrade node_get_types() in wizard.
-#1020824: Finish fixing node template page wizard.
-Fix landing page wizard.
diff --git a/KNOWN_ISSUES.txt b/KNOWN_ISSUES.txt
deleted file mode 100644
index 6696367..0000000
--- a/KNOWN_ISSUES.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-
-Known Issue http://drupal.org/node/191771
- 'Node' panes can have two titles or have two title areas.
- Cause:
- Content that comes into a pane is already formatted, and this happens
- in theme('node'). theme('node') assumes it will be printing a title
- most of the time. However, Panels wants the titles of panes to be
- consistent, so it removes the title from the node to prevent your
- node.tpl.php from printing it. The result is often an empty h2 which
- has odd effects.
- Solution:
- Add an if statement to your node.tpl.php to prevent printing that h2
- if $node->title is empty.
-
-Known Issue http://drupal.org/node/186454
- Internet Explorer is really bad about making the rightmost panel
- fall beneath the others.
- Cause:
- Internet explorer calculates margins and padding differntly from
- everyone else, and this makes it entirely too easy for widths
- to add up to greater than the amount of allotted space, despite
- using percentage widths.
- Solution:
- There are two solutions to this problem:
- 1) In your theme, try to eliminate padding from the the <div>
- that directly contains your content; you can do this by
- adding an empty <div> inside it that surrounds the content
- and very specifically is set to margin: 0 and padding: 0
-
- 2) if that doesn't work, override the widths of the panel-panel
- divs and reduce them by 1 or 2%; usually this will give IE
- enough space to quit pushing things around.
-
-Known Issue http://drupal.org/node/154351
- TinyMCE, FCKEditor and other wysiwyg editors really blow up on Panels
- content editing.
- Cause:
- The modal dialogs that Panels uses are very particular about javascript
- and these editors are too much for them. Also, these editors get
- cranky about complicated forms with several text areas.
- Solution:
- Disable these editors on all of your panels admin pages. The important
- URLs are admin/panels/* and panels/ajax/*. More details instructions
- may follow if someone familiar with these systems submits a patch at
- the above drupal.org URL.
-
-Known Issue http://drupal.org/node/180650
- The rounded corners style shows up as just a small graphic rather than
- a full box around the panels as it shoujld.
- Cause:
- The rounded corners CSS relies on the ID for the panel, but the ID is
- optional.
- Solution:
- Make sure your panel has an ID of some sort. With mini panels there is
- no easy workaround as mini panels currently do not have IDs of their
- own.
-
-Known Issue http://drupal.org/node/165745
- You see a message similar to this:
- Table 'drupal.panels_info' doesn't exist query: SELECT * FROM panels_info
- WHERE path = 'front_page_new' in...
-
- The important piece of information is 'panels_info'.
- Cause:
- The Meta Tags module (also known as nodewords.module) directly reads the
- the panels tables and modifies its forms to add the tags. Unfortunately
- for this module, Panels has changed *greatly* in the leap from 1.0 to
- 2.0 and the tables aren't the same. However, the nodewords module doesn't
- yet know this. Look in the nodewords issue queue for panels patches and
- you should find something.
-
-Known Issue http://drupal.org/node/153399
- The drag and drop content UI doesn't seem to work at all under Safari.
-
- Cause:
- Safari 2 has some serious problems with the javascript code.
- Solution:
- Upgrade to Safari 3 if possible. If not, use an an alternative browser
- such as Firefox or Opera.
-
-Known Issue http://drupal.org/node/207859
- When using the secure pages module, the Panels administrative UI gives
- unhelpful "An error occurred" popups when trying to add or edit content.
-
- Cause:
- The secure pages module tries to move the entire administrative section
- of the site to HTTPS, but Panels' AJAX calls are using a path that
- secure pages doesn't know about. When trying to make non-secure ajax calls
- from a secure page, the browser denies the call.
- Solution:
- The solution is to simply add panels/* to your Secure Pages configuration. \ No newline at end of file
diff --git a/README.txt b/README.txt
index 557befd..854825a 100644
--- a/README.txt
+++ b/README.txt
@@ -1,6 +1 @@
-
-Welcome to Panels 2.
-
-A little documentation should go here, but Panels 2 is a beast - you're best
-off checking the online handbook on Drupal.org, or the developer/API docs,
-which are available at http://doxy.samboyer.org/panels2/
+The master branch is unused. Please see versioned branches instead.
diff --git a/UPGRADE.txt b/UPGRADE.txt
deleted file mode 100644
index d1a42f2..0000000
--- a/UPGRADE.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Upgrading from Panels-6.x-3.x to Panels-7.x-3.x
-
- - Style and layout plugins may no longer be registered by a central hook.
- Only the plugin directories method may be used.
-
- - Layout 'panels function' is now 'regions function'.
-
- - Layout 'panels' key is now 'regions'.
-
- - panels_get_pane_title() deprecated.
-
- - panels_plugin_get_function() deprecated.
-
- - panels_required_context removed. These were deprecated long ago and
- existed only to prevent crashes.
-
- - panels_optional_context removed.
-
- - $renderer->plugins['layout']['panels'] changed to $renderer->plugin['layout']['regions']
-
- - display_renderer class is now in 'renderer', not 'handler'.
-
diff --git a/css/panels-dashboard.css b/css/panels-dashboard.css
deleted file mode 100644
index a7efeae..0000000
--- a/css/panels-dashboard.css
+++ /dev/null
@@ -1,62 +0,0 @@
-
-.dashboard-entry .dashboard-link {
- font-size: 120%;
- font-weight: bold;
-}
-
-.dashboard-entry .dashboard-icon img {
- vertical-align: middle;
-}
-.dashboard-title {
- font-weight: bold;
- font-size: 140%;
- margin-bottom: .5em;
-}
-
-.dashboard-link form input {
- margin: 0;
-}
-
-.dashboard-link form select {
- margin: 0;
-}
-
-.dashboard-left {
- width: 47%;
- float: left;
-}
-
-.dashboard-right {
- margin-left: 2em;
- width: 47%;
- float: left;
-}
-
-.dashboard-question {
- margin-top: 14em;
- padding: 1em;
- text-align: center;
-}
-
-.dashboard-content table {
- margin: 0;
- width: 100%;
-}
-
-.dashboard-content {
- padding: 0 1em;
-}
-
-.panels-dashboard .links {
- text-align: right;
-}
-
-.dashboard-pages .page-manager-page-operations {
- text-align: right;
-}
-
-.dashboard-block {
- padding-bottom: 1em;
- border-bottom: 1px dotted #ddd;
- margin-bottom: 1em;
-}
diff --git a/css/panels.css b/css/panels.css
deleted file mode 100644
index 99552a9..0000000
--- a/css/panels.css
+++ /dev/null
@@ -1,50 +0,0 @@
-
-div.panel-pane div.admin-links {
- font-size: xx-small;
- margin-right: 1em;
-}
-
-div.panel-pane div.admin-links li a {
- color: #ccc;
-}
-
-div.panel-pane div.admin-links li {
- padding-bottom: 2px;
- background: white;
- z-index: 201;
-}
-
-div.panel-pane div.admin-links:hover a,
-div.panel-pane div.admin-links-hover a {
- color: #000;
-}
-
-div.panel-pane div.admin-links a:before {
- content: "[";
-}
-
-div.panel-pane div.admin-links a:after {
- content: "]";
-}
-
-div.panel-pane div.panel-hide {
- display: none;
-}
-
-/** For IE we add the class via js; for other browsers we rely on :hover **/
-div.panel-pane div.panel-hide-hover,
-div.panel-pane:hover div.panel-hide {
- display: block;
- position: absolute;
- z-index: 200;
- margin-top: -1.5em;
-}
-
-div.panel-pane div.node {
- margin: 0;
- padding: 0;
-}
-
-div.panel-pane div.feed a {
- float: right;
-}
diff --git a/css/panels_admin.css b/css/panels_admin.css
deleted file mode 100644
index 78094e2..0000000
--- a/css/panels_admin.css
+++ /dev/null
@@ -1,165 +0,0 @@
-
-.layout-link {
- float: left;
- padding: 1em;
- width: 125px;
- height: 160px;
-}
-
-.layout-link img {
- margin-left: auto;
- margin-right: auto;
-}
-
-/* general style for the layout-icon */
-.layout-icon .caption {
- width: 90px;
- margin-bottom: 1em;
-}
-
-/* styles for the basic panel-%implementation% edit page */
-.layout-container,
-.right-container {
- float: right;
- padding: 0 0 0 .5em;
- margin: 0;
- width: 48.5%;
-}
-
-.info-container,
-.left-container {
- padding-right: .5em;
- width: 48.5%;
-}
-
-.right-container fieldset,
-.left-container fieldset,
-.layout-container fieldset {
- margin-top: 0;
-}
-
-.layout-container .form-item {
- margin: 0;
-}
-
-.layout-container .form-submit {
- margin-top: 1em;
-}
-
-.layout-container .layout-icon,
-.left-container .layout-icon {
- float: right;
- margin-left: .5em;
-}
-
-.content-list ol {
- padding-left: 0;
- list-style-position: inside;
-}
-
-.content-list dt {
- font-weight: bold;
-}
-
-.content-list dd {
- margin-left: 2em;
-}
-
-/* styles for the choose layout page */
-.panels-layouts-checkboxes .form-checkboxes .form-item,
-#panels-choose-layout .form-type-radio,
-.panels-choose-layout .form-type-radio {
- float: left;
- margin-right: .5em;
- width: 90px;
-}
-
-.panels-layouts-checkboxes .form-checkboxes .form-item .layout-icon,
-#panels-choose-layout .form-type-radio .form-item .layout-icon,
-.panels-choose-layout .form-type-radio .form-item .layout-icon {
- float: none;
- height: 11em;
- width: 90px;
-}
-.panels-layouts-checkboxes .form-checkboxes .option input,
-#panels-choose-layout .form-type-radio input,
-.panels-choose-layout .form-type-radio input {
- width: 50px;
- display: block;
- text-align: center;
-}
-
-.panels-layouts-checkboxes .form-submit,
-#panels-choose-layout .form-submit {
- clear: left;
-}
-
-.panels-layouts-checkboxes .panels-layout-list label,
-#panels-choose-layout .panels-layout-list label {
- width: 300px;
- float: left;
- clear: left;
- background: url(../images/go-right.png) right no-repeat;
- margin-right: 20px;
-}
-
-.panels-layouts-checkboxes .panels-layouts-category {
- font-weight: bold;
- width: 100%;
- float: left;
-}
-
-.panels-layouts-checkboxes .description {
- clear: left;
-}
-
-.change-layout-display .layout-icon {
- float: left;
-}
-
-.change-layout-display > img {
- padding: 25px 25px 25px 0;
- float: left;
-}
-
-table .operation {
- text-align: right;
- padding-right: 6px;
-}
-
-table .argument-operation input {
- padding: 0;
- margin: 0;
- position: relative;
- top: 3px;
-}
-
-.panels-admin-view {
- padding: 1em;
- border: 1px dotted black;
- margin-bottom: 1em;
-}
-
-tr.changed td {
- background-color: #FFFFDD !important;
-}
-
-tr.changed td span.star {
- font-weight: bold;
- color: #E09010;
-}
-
-td select {
- margin: 0;
- padding: 0;
-}
-
-.panels-style-settings,
-.panels-style-settings-box,
-#panels-style-setting {
- float: left;
-}
-
-.panels-style-settings-box .form-item {
- margin: 0 1em 0 0;
-}
diff --git a/css/panels_dnd.css b/css/panels_dnd.css
deleted file mode 100644
index e46e885..0000000
--- a/css/panels_dnd.css
+++ /dev/null
@@ -1,629 +0,0 @@
-
-#panels-dnd-main {
- margin: 0.5em 0;
-}
-
-#panels-dnd-main div.panels-display {
- padding: 0 0 .5em 0;
- border: 1px dashed #ddd;
- background: #f8f8f8;
- -webkit-border-radius: 0.333em;
- -moz-border-radius: 0.333em;
-}
-
-#panels-dnd-main div.panels-display h2.label {
- color: #555;
- text-shadow: #fff 1px 1px 1px;
- text-align: center;
- font-size: 13pt;
- margin: 0 0 .5em 0;
- padding-right: 16px;
- vertical-align: middle;
-}
-
-#panels-dnd-main div.panels-display .pane-add {
- float: left;
- margin: 2px;
- background: #999;
- border: 1px solid #fff;
-}
-
-#panels-dnd-main div.panels-display .pane-add-link {
- position: relative;
- display: block;
- width: 16px;
- height: 16px;
- float: left;
- margin: 2px 2px 2px 4px;
-}
-
-div.panels-set-title-hide .panels-set-title {
- display: none !important;
-}
-
-/* Add Icon */
-#panels-dnd-main div.panels-display .pane-add-link {
-}
-#panels-dnd-main div.panels-display .pane-add-link img {
- display: none;
-}
-#panels-dnd-main div.panels-display .pane-add-link a.ctools-dropdown-image-link {
- border: none;
- width: 16px;
- height: 18px;
- float: left;
- background: url('../images/sprite.png') no-repeat 0 -1178px;
-/* background: url('../images/sprite.png') no-repeat -166px -582px; */
-}
-
-.panel-portlet {
- padding: 0em;
- background: #ffffff;
- border: 1px solid #bbb;
-}
-
-div.panels-set-title-hide .panel-pane-is-title {
- border: 1px solid #bbb;
-}
-
-.panel-pane-is-title {
- border: 2px solid #777;
-}
-
-/* Cog Icon */
-.panel-portlet .buttons a img {
- display: none;
- margin: 0;
-}
-.panel-portlet .buttons a.ctools-dropdown-image-link {
- border: none;
- width: 16px;
- height: 16px;
- margin: 0 5px 0 0;
- float: none;
- display: block;
- background: url('../images/sprite.png') no-repeat 0 -1178px;
-}
-
-#panels-dnd-main .panel-pane,
-#panels-dnd-main .helperclass {
- margin: .5em;
-}
-
-#panels-dnd-main-form .inline-icon-help {
- vertical-align: middle;
- margin: 2px 1px;
-}
-
-.panel-pane.hidden-pane {
- background: #f8f8f8;
-}
-
-.panel-portlet .pane-content {
- margin: .5em 0 .5em 0;
- padding: 0 .25em 0 .25em;
- display: none; /* initially hidden */
-}
-
-.panel-portlet .grabber {
- width: 100%;
- height: 20px;
- cursor: move;
- margin: 0 0 0.5em 0;
- overflow: hidden;
- background: #b3b3b3 url('../images/bg-shade-medium.png') repeat-x 0 100%;
- color: #fff;
- text-shadow: #555 1px 1px 1px;
- border-color: #999;
- font-weight: bold;
-}
-
-.panel-portlet.hidden-pane .grabber {
- background-color: #888;
-}
-
-.panel-portlet .changed div.grabber {
- background-color: #FFFFDD !important;
- border-bottom: 1px solid #3D9CD7 !important;
- color: black !important;
-}
-
-.panel-portlet .changed.hidden-pane div.grabber {
- background-color: #B4B488 !important;
- border-bottom: 1px solid #3D9CD7 !important;
-}
-
-.panel-portlet .changed div.grabber span.star {
- font-weight: bold;
- color: #E09010;
-}
-
-.panel-portlet .grabber:hover {
- color: #fff;
- background-color: #2F78A5;
-}
-
-.panel-portlet.hidden-pane .grabber:hover {
- background-color: #666;
-}
-
-.panel-portlet .grabber:active {
- background-color: red;
-}
-
-.panel-portlet .grabber:hover,
-.panel-portlet .grabber:active {
- background: #858585 url('../images/bg-shade-dark.png') repeat-x 0 100%;
- color: #fff;
- text-shadow: #333 1px 1px 1px;
- border-color: #858585;
-}
-
-.panel-portlet .grabber .text {
- margin-left: 3px;
- font-size: 90%;
- line-height: 20px;
-}
-
-.panel-portlet .buttons {
- float: right;
- padding: 0;
- margin: 0;
-}
-
-.panel-portlet .buttons input {
- margin: 0;
- padding: 0;
- display: inline;
-}
-
-.panel-portlet .buttons a img {
- margin: 2px 1px;
-}
-
-.panel-portlet .pane-title {
- font-size:110%;
- cursor: pointer;
-}
-
-.panel-portlet .panel-pane-collapsible {
- margin: 0;
- padding: 0;
-}
-
-.panel-portlet .toggle {
- float: left;
- width: 21px;
- height: 21px;
- cursor: pointer;
- background: url('../images/sky.png') no-repeat 6px -245px;
-}
-
-.panel-portlet .toggle-collapsed {
- background: url('../images/sky.png') no-repeat 6px -1021px;
-}
-
-/* CSS to guide a user to a place to drop */
-#panels-dnd-main .helperclass {
- border: 1px dashed red;
-}
-
-#panels-dnd-main .hoverclass {
- border: 1px solid red !important;
-}
-
-/* CSS for an area if something can be dropped in it */
-.panels-modal-content {
- background: #fff;
- color: #000;
- padding: 0;
- margin: 2px;
- border: 1px solid #000;
- width: 600px;
- text-align: left;
-}
-
-.panels-modal-content .modal-title {
- font-size: 120%;
- font-weight: bold;
- color: white;
- overflow: hidden;
- white-space: nowrap;
-}
-
-.panels-modal-content .modal-header {
- background-color: #2385c2;
- padding: 0 .25em 0 1em;
-}
-
-.panels-modal-content .modal-header a {
- color: white;
- float: right;
-}
-
-.panels-modal-content .modal-content {
- padding: 0 1em;
- overflow: auto;
- width: 575px;
- height: 400px;
-}
-
-.panels-modal-content .modal-form {
-}
-
-.panels-modal-content .form-checkboxes .form-item {
- float: left;
- width: 24%;
-}
-
-.panels-hidden,
-.panels-js-only {
- display: none;
-}
-
-a.close {
- color: white;
-}
-
-a.close:hover {
- text-decoration: none;
-}
-
-a.close img {
- position: relative;
- top: 1px;
-}
-
-.panels-section-title {
- clear: left;
- border-bottom: 1px solid #ddf;
- margin-bottom: .5em;
- text-align: left;
-}
-
-.panels-section-decorator {
-}
-
-.panels-add-content-modal .panels-modal-add-category {
- display: block;
- border-bottom: 1px solid white;
- padding-left: .5em;
- margin-left: -2px;
- position: relative;
-}
-
-.panels-add-content-modal .panels-modal-add-category.active {
- background: url(../images/arrow-active.png) center right no-repeat white;
- border-right: none;
-}
-
-.panels-add-content-modal {
- background: url(../images/bg-content-modal.png);
- height: 100%;
- margin: -1em;
- padding-top: 1em;
- padding-left: 175px;
- position: relative;
-}
-
-.panels-section-columns {
- height: 100%;
- overflow: auto;
-}
-.panels-section-column {
- width: 48%;
- float: left;
-}
-
-.panels-section-column .inside {
- padding: 0 1em;
-}
-
-.panels-section-column-categories {
- width: 173px;
- margin-left: -173px;
-}
-
-.panels-categories-description {
- padding: 0 1em;
- text-align: center;
- vertical-align: center;
-}
-
-* html .panels-section-column-categories {
- left: 173px;
- position: relative;
-}
-
-.panels-section-column-categories .panels-categories-box {
- border-top: 1px solid white;
- margin-bottom: 1em;
-}
-
-.panels-section-column-categories .inside {
- padding: 0;
- }
-
-.panels-section-column-categories .content-type-button {
- padding-left: 10px;
-}
-
-.panels-modal-add-category {
- color: #5b5b5b !important;
- font-weight: bold;
- line-height: 2em;
-}
-
-.panels-section {
- margin-bottom: 1em;
-}
-
-.panels-section-column .content-type-button {
- font-size: 8pt;
- line-height: 1em;
- overflow: hidden;
- text-align: left;
-}
-
-.content-type-button img {
- border: 2px solid white;
- float: left;
-}
-
-.content-type-button img:hover {
- border: 2px solid blue;
-}
-
-.content-type-button div {
- width: 85%;
- top: -5px;
- left: 2px;
- float: left;
- padding-left: 3px;
- padding-top: 5px;
-}
-
-#panels-preview .modal-throbber-wrapper {
- width: 100%;
- text-align: center;
- margin-left: auto;
- margin-right: auto;
-}
-/** modal forms CSS **/
-.panels-modal-content .form-item label {
- width: 8em;
- float: left;
-}
-
-.panels-modal-content .form-item label.option {
- width: auto;
- float: none;
-}
-
-.panels-modal-content .form-item .description {
- clear: left;
-}
-
-.panels-modal-content .form-item .description .tips {
- margin-left: 2em;
-}
-
-.panels-modal-content .no-float .form-item * {
- float: none;
-}
-
-.panels-modal-content .modal-form .no-float label {
- width: auto;
-}
-
-.panels-modal-content .modal-form fieldset,
-.panels-modal-content .modal-form .form-checkboxes {
- clear: left;
-}
-
-#edit-configuration-nid {
- clear: left;
-}
-
-.option-text-aligner .form-item {
- float: left;
- padding: .25em 1em .25em 0;
- margin: 0;
-}
-
-.option-text-aligner {
- clear: both;
- width: 100%;
- padding: 0;
- margin: 0;
-}
-
-
-#panels-dnd-main div.panel-pane div.ctools-dropdown-container-wrapper {
- margin-left: -158px;
- margin-top: -4px;
-}
-
-/*
-html.js div.panels-display-links div.ctools-dropdown-container {
- width: 275px;
-}
-
-html.js div.panels-display-links div.ctools-dropdown-container ul li li a {
- width: 250px;
-}
-
-html.js div.panels-display-links div.ctools-dropdown-container ul li a {
- width: 270px;
-}
-*/
-
-#panels-dnd-main .panel-pane .pane-title {
- padding: 0.25em 0.5em;
-}
-#panels-dnd-main .panel-pane .pane-title:after {
- font-size: 0.8em;
- color: crimson;
- letter-spacing: normal;
- display: block;
-}
-#panels-dnd-main .panel-pane.hidden-pane .pane-title:after {
- content: " status: hidden";
-}
-#panels-dnd-main .panel-pane.changed .pane-title:after {
- content: " status: changes not saved";
-}
-#panels-dnd-main .panel-pane.hidden-pane.changed .pane-title:after {
- content: " status: hidden & changed";
-}
-
-/* @end */
-
-
-/* @group CTools Dropdown */
-#panels-dnd-main .ctools-dropdown a.ctools-dropdown-text-link,
-html.js div.panels-display-links a.ctools-dropdown-text-link {
-
- background: url('../images/arrow-down-light.png') 0 3px no-repeat!important;
- padding-left: 12px;
-}
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container,
-html.js div.panels-display-links div.ctools-dropdown-container {
- width: 160px!important;
- background: #fff url('../images/bg-shade-white-lrg.png') repeat-x 0 100%;
- border: solid 1px #ddd!important;
- margin: 0!important;
-/* padding: 0.5em!important; */
- -webkit-border-radius: 0.333em;
- -moz-border-radius: 0.333em;
- -webkit-box-shadow: 0.333em 0.333em 0.333em rgba(0, 0, 0, 0.25);
- font-size: 0.9em;
- font-weight: bold;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li,
-html.js div.panels-display-links div.ctools-dropdown-container ul li {
-
- text-decoration: none;
- padding: 0;
- margin: 0;
- color: #555!important;
- text-shadow: #fff 1px 1px 1px;
-}
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li span.text,
-html.js div.panels-display-links div.ctools-dropdown-container ul li span.text {
-
- font-style: normal;
- color: #000;
- font-weight: bold;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li a,
-html.js div.panels-display-links div.ctools-dropdown-container ul li a {
- color: #555!important;
- font-weight: normal;
- width: auto;
- padding: 0 10px;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li span.panels-text,
-html.js div.panels-display-links div.ctools-dropdown-container ul li span.panels-text {
- width: auto;
- padding: 0 10px;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li .panels-italic,
-html.js div.panels-display-links div.ctools-dropdown-container ul li .panels-italic {
- font-style: italic;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li span.dropdown-header,
-html.js div.panels-display-links div.ctools-dropdown-container ul li span.dropdown-header {
- background-color: #fefefe;
- padding: 0 10px;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li .panels-sub-menu ul li a,
-html.js div.panels-display-links div.ctools-dropdown-container ul li .panels-sub-menu ul li a,
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li .panels-sub-menu span.panels-text,
-html.js div.panels-display-links div.ctools-dropdown-container ul li .panels-sub-menu span.panels-text {
- padding: 0 20px;
-}
-
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container hr,
-html.js div.panels-display-links div.ctools-dropdown-container hr {
- border: 0;
- color: #ddd;
- background-color: #ddd;
- height: 1px;
-}
-
-/*
-html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li a:hover,
-html.js div.panels-display-links div.ctools-dropdown-container ul li a:hover {
- background: none!important;
- color: #000!important;
-}
-*/
-/* @end */
-
-/* @group Modal */
-/* Account for the extra div coming from ctools_modal_form_render() */
-div.messages div.messages {
- background: none;
- border: none;
- margin: 0;
- padding: 0;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
-}
-div.ctools-modal-content .modal-header {
- background: #fff url('../images/bg-shade-light.png') repeat-x bottom left;
- color: #777;
- display: block;
- font-weight: 700;
- letter-spacing: normal;
- padding: 0.25em 1em;
- -moz-border-radius-topleft: 0.5em;
- -moz-border-radius-topright: 0.5em;
- -webkit-border-top-left-radius: 0.5em;
- -webkit-border-top-right-radius: 0.5em;
-}
-div.ctools-modal-content .modal-title {
- font-size: 120%;
- font-weight: bold;
- text-shadow: #fff 1px 1px 1px;
- color: #555;
-}
-div.ctools-modal-content a.close {
- color: #666;
- font-weight: normal;
- padding-left: 1.6em;
- background: url('../images/sprite.png') no-repeat -166px -1686px;
-}
-div.ctools-modal-content a.close img {
- display: none;
-}
-/** modal forms CSS **/
-div.ctools-modal-content .form-item label {
- width: 100%;
- float: none;
- clear: both;
-}
-div.ctools-modal-content .resizable-textarea {
- width: 100%;
- margin-left: 0;
- margin-right: 0;
-}
-div.ctools-modal-content {
- font-size: 12px;
- border: solid 1px #ddd;
- -webkit-border-radius: 0.5em;
- -moz-border-radius: 0.5em;
- -webkit-box-shadow: -1em 1em 1em rgba(0, 0, 0, 0.5);
-}
-#modalBackdrop {
- position: fixed!important;
- background-color: #000!important;
-}
-/* @end */
diff --git a/css/panels_page.css b/css/panels_page.css
deleted file mode 100644
index 1d731b9..0000000
--- a/css/panels_page.css
+++ /dev/null
@@ -1,14 +0,0 @@
-
-div.panels-page-type-container {
- clear: left;
-}
-
-div.panels-page-type-container .form-checkboxes .form-item {
- float: left;
- width: 15em;
-}
-
-#panels-page-settings .form-submit {
- display: block;
- clear: left;
-}
diff --git a/help/api.html b/help/api.html
deleted file mode 100644
index e0d2d4a..0000000
--- a/help/api.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<p>Panels is a pluggable rendering engine. Apart from its datastructure, almost nothing in Panels is hardcoded; every level of its rendering process is controlled by plugins (of the <a href="topic:ctools/plugins">CTools</a> variety), and therefore can be overriden. Some of these plugins' behaviors are obvious from the UI, whereas others are much more under-the-hood.</p>
-<p>Most site builders and module authors will find that plugins are the only way they need to interact with Panels to do what they want. However, if you are building whole new UIs/applications that are to be driven by the Panels engine, you'll also need the more traditional API that manages Panels editing and CRUD. Panels Node and Mini Panels are examples of 'applications' in this sense, as is <a href="http://drupal.org/project/og_panels">OG Panels</a>.</p>
-<p>This page is divided into two sections, the first dealing with Panels' rendering system & the plugins the drive it, and the second with the requirements for creating a Panels-driven application/UI. The former is a good starting place and should be of interest to anyone wanting to begin working with the Panels API.</p>
-
-<h2>The Panels Rendering System</h2>
-<p>Panels' rendering system takes a fully-loaded panels_display object and turns it into HTML. It doesn't care how that object was built or where it comes from - it's just a rendering engine. So long as the calling code provides a well-formed panels_display object, the engine will spit out HTML. Exactly how that process works is determined entirely by plugins.</p>
-<p>Panels utilizes eight different types of plugins within its rendering system, four owned by Panels and four by CTools. Let's run through that list.</p>
-<dl>
-<dt><a href="topic:panels/plugins-layout">Layout plugins</a></dt>
-<dd><em>Owned by Panels.</em></dd>
-<dd>Layout plugins provide the HTML output skeleton for any panel: they define a set of regions and (optionally) accompanying CSS/JS, very analogous to how themes define block regions. While layout plugins with complex logic are possible (the Flexible layout, for example), most layouts are nothing more than a region list, a tpl.php skeleton, and some CSS.</dd>
-<dt><a href="topic:panels/plugins-style">Style plugins</a></dt>
-<dd><em>Owned by Panels.</em></dd>
-<dd>Style plugins control the markup that wraps both individual panes and whole panel regions. A basic style plugin need not provide more than some basic CSS and a theme function or tpl.php file.</dd>
-<dt><a href="topic:ctools/plugins-style-bases">Style Bases</a></dt>
-<dd><em>Owned by CTools.</em></dd>
-<dd>Panels implements the 'style_bases' plugin type in order to interact with the Stylizer system, which technically lives in CTools, though true 'ownership' is a little blurred. Regardless, Panels uses this plugin to interact with Stylaizer in order to allow the creation of style plugins in the UI.</dd>
-<dd>This plugin is probably of interest only to module developers; site builders can safely skip it.</dd>
-<dt><a href="topic:ctools/context-context">Context plugins</a></dt>
-<dd><em>Owned by CTools.</em></dd>
-<dd>Context plugins are abstracted wrappers around bits of data - a node, user, or taxonomy term are easy examples. Panels uses context plugins so that it can work with all these different bits of data without caring about the details of the datastructure itself. Context can be a confusing concept, and you can learn more in the <a href="topic:ctools/context">CTools help</a>.</dd>
-<dd>Note that <a href="topic:ctools/context-arguments">argument</a> and <a href="topic:ctools/context-relationships">relationship</a> plugins are technically also used by Panels, but because they're really means for creating more context, they don't get separate entries in this list.</dd>
-<dt><a href="topic:ctools/plugins-content">Content Type plugins</a></dt>
-<dd><em>Owned by CTools: can utilize context.</em></dd>
-<dd>At the heart of the Panels rendering process, content type plugins define the rendering logic for every pane. Offering Panels a renderable chunk from your module means defining one of these. For those accustomed to the block system, they can be thought of as a more verbose block definition, contained neatly inside a single plugin.</dd>
-<dd>Content type plugins rely on context to provide them with source data, when necessary; this makes content plugins nice and portable.</dd>
-<dt><a href="topic:ctools/context-access">Access plugins</a></dt>
-<dd><em>Owned by CTools: can utilize context.</em></dd>
-<dd>Access plugins are essentially portable access checking logic, responsible for answering "Yes" or "No" given some contextual data. Panels uses these to define 'visibility rules' on individual panes. The other place these are commonly seen is in defining 'Selection rules' on Page Manager variants.</dd>
-<dd>If your module introduces new permissioning concepts or access logic (NOT a basic hook_perm() implementation), you may want to consider also encapsulating that logic in one or more of these plugins. For example, Organic Groups might implement an access plugin to allow/deny based on group membership, or the Date module might implement allow/deny logic based on request time.</dd>
-<dt><a href="topic:panels/plugins-cache">Cache plugins</a></dt>
-<dd><em>Owned by Panels; should utilize context.</em></dd>
-<dd>Panels cache plugins define caching strategies that can be applied to individual panes, or to whole displays. Caching plugins must deal with two basic issues: the cache backend to use for reading/writing, and TTL-managing strategies.</dd>
-<dd>TTL strategies can (and should) integrate heavily with the context, as that is where the real differential benefit of Panels-based caching is vs. standard core caching.</dd>
-<dt><a href="topic:panels/plugins-renderers">Display Renderers</a></dt>
-<dd><em>Owned by Panels: utilizes everything else.</em></dd>
-<dd>In the simplest terms, display renderers take a fully-loaded panels_display object and render it. They are very complex, powerful plugins - one could use them to cause Panels to bypass every single other plugin in this list. Fortunately, there is virtually no circumstance under which one would need to implement these plugins in the process of building a single site; only contrib developers working on highly complex use cases are likely to ever need them.</dd>
-<dd>In short, each display renderer plugin <strong>is</strong> a self-contained Panels rendering engine. If you want to grok the Panels rendering system, study these.</dd>
-</dl>
-
-
-<h2>Panels-based Applications</h2>
-<p>At its core, Panels is a rendering engine with no UI (though it does provide common elements for reuse in admin UIs). So if you're working with Panels via the web UI, it means you're working with a Panels application. The three that ship with this version of Panels are Mini Panels, Panel Nodes, and the integration with CTools' Page Manager.</p>
-<p>Panels also implements a task_handler plugin, which is owned by Page Manager in CTools. Task handlers aren't strictly a part of Panels' rendering system itself though (strictly speaking, they wrap it), so we won't cover them here.</p> \ No newline at end of file
diff --git a/help/display.html b/help/display.html
deleted file mode 100644
index e69de29..0000000
--- a/help/display.html
+++ /dev/null
diff --git a/help/pane.html b/help/pane.html
deleted file mode 100644
index e69de29..0000000
--- a/help/pane.html
+++ /dev/null
diff --git a/help/panels.help.ini b/help/panels.help.ini
deleted file mode 100644
index 570afc7..0000000
--- a/help/panels.help.ini
+++ /dev/null
@@ -1,74 +0,0 @@
-[advanced help settings]
-line break = TRUE
-
-[glossary]
-title = Panels glossary of terms
-weight = 100
-
-[about]
-title = About Panels
-weight = -100
-
-[common-tasks]
-title = Accomplishing common tasks in Panels
-weight = -50
-
-[tutorials]
-title = Panels tutorials and how-tos
-weight = -30
-
-[tutorial-landing]
-title = Creating a simple landing page
-parent = tutorials
-
-[tutorial-node]
-title = Styling a node page
-parent = tutorials
-
-[tutorial-vocabulary]
-title = Styling a vocabulary
-parent = tutorials
-
-[apps]
-title = Panels-based applications
-parent = api
-
-[panels-pages]
-title = Panel pages, via Page Manager
-parent = apps
-
-[panels-mini]
-title = Mini panels
-parent = apps
-
-[panels-node]
-title = Panel nodes
-parent = apps
-
-[api]
-title = Working with the Panels API
-weight = 50
-
-[render-api]
-title = Panels plugins
-parent = api
-
-[plugins-layout]
-title = Layout plugins
-parent = render-api
-weight = -10
-
-[plugins-style]
-title = Style plugins
-parent = render-api
-weight = -7
-
-[plugins-cache]
-title = Cache plugins
-parent = render-api
-weight = -4
-
-[plugins-renderers]
-title = Display Renderer plugins
-parent = render-api
-weight = -1
diff --git a/help/plugin-layout.html b/help/plugin-layout.html
deleted file mode 100644
index e5c0f5c..0000000
--- a/help/plugin-layout.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<h2>Getting Started:</h2>
-<p>Layout plugins are one of the simplest and most powerful sections of the panels api. There are two different ways that a layout can be implemented via panels. Panels supports both module and theme implementations of panels. The module implementation requires that hook_ctools_plugin_directory define the directory in which your layout plugins exist. (This same hook defines the directory for all panels plugins) Alternately, if you intend on implementing a layout in a theme this can be done primary through the theme's info file. The Ctools help does a great job of actually explaining this portion of the API <a href="topic:ctools/plugins-implementing">ctools: plugins</a>.</p>
-
-<p>Ctools explains even the layout hooks a little in its example, but we'll recap quickly and expand on this information. As ctools explains, the actual plugin file must be named with care as it will directly affect your naming scheme for the hook within it. This is really no different from any other hook within drupal except that we'll be using multiple replacements in this case. The function we're looking to implement is an instance of:
-<code>function YOURMODULE_PLUGINNAME_OWNERMODULE_PLUGINTYPE()</code>
-In our case we already know that the function will be:
-<code>function YOURMODULE_PLUGINNAME_panels_layouts()</code>
-This is because the plugin type we're working with is a layout, and the module that implements these layouts is the panels module. For the rest of the naming scheme "YOURMODULE" will be replaced with either the name of your module that implements this layout, or the name of the theme, and "PLUGINNAME" will be replaced with whatever the name of the plugin file is. For purposes of this example our module name us going to be "layout_sample" and our plugin will be "first_layout".</p>
-
-<h2>Directory Structure:</h2>
-<p>We're going to assume that you've laid your directory structure out very similarly to how panels does it. Something like this is rather likely:
-<pre>layout_sample
- layout_sample.info
- layout_sample.module
- plugins
- layouts
- first_layout
- first_layout.css
- first_layout.inc
- first_layout.png
- layout-sample-first-layout.tpl.php</pre>
-The name of our .inc file is going to be the key to the entire layout plugin.</p>
-
-<h2>The .inc File:</h2>
-<p>We will start with the first_layout.inc file as it's the most important file we're dealing with here. First_layout.inc will look similar to the following:
-<pre>function layout_sample_first_layout_panels_layouts() {
- $items['first_layout'] = array(
- 'title' => t('First Layout'),
- 'icon' => 'first_layout.png',
- 'theme' => 'layout_sample_first_layout',
- 'css' => 'first_layout.css',
- 'panels' => array(
- 'main' => t('Main region'),
- 'right' => t('Right region'),
- ),
- );
- return $items;
-}</pre>
-The include file defines all the other files that our layout will utilize in order to be truly useful. The array is fairly self explanitory but for the sake of specificity:
-<ol>
-<li><strong>Title:</strong><br />The title of our layout. (Utilized within the panels administration screens)</li>
-<li><strong>Icon:</strong><br />The graphical representation of our layout. (Utilized within the panels administration screens)</li>
-<li><strong>Theme:</strong><br />The template file of our layout. (Sharp eyed readers will note that the theme definition utilizes underscores instead of dashes, and does not have ".tpl.php" after it. This is refering to the layout-sample-first-layout.tpl.php file all the same, it is simply how the naming convention works. Utilize dashes in the tpl file name and underscores when refering to it in your include file.)</li>
-<li><strong>CSS:</strong><br />The css file to be utilized for our layout. (Utilized within the panels administration screens, AND when viewing the actual panel itself.)</li>
-<li><strong>Panels:</strong><br />Defines all the various regions within your panel. This will be further utilized within our tpl.php file.</li>
-</ol>
-There are many additional properties that can be added to the include file. For purposes of this document we'll also make mention of the 'admin css' property. 'Admin css' is especially useful when utilizing a fixed width layout with fixed with panel regions. This can break under most administrative circumstances, and panels provides you with the ability to give an additional css layout for the administrative section. It's a simple nicety and looks like this:
-<pre>function layout_sample_first_layout_panels_layouts() {
- $items['first_layout'] = array(
- 'title' => t('First Layout'),
- 'icon' => 'first_layout.png',
- 'theme' => 'layout_sample_first_layout',
- 'css' => 'first_layout.css',
- 'admin css' => 'first_layout_admin.css',
- 'panels' => array(
- 'main' => t('Main region'),
- 'right' => t('Right region'),
- ),
- );
- return $items;
-</pre>
-</p>
-
-<h2>The tpl.php File:</h2>
-<p>The tpl.php file is very similar to any other template file within drupal. The difference here is that we're being passed an array of regions through $content, and we also have a css id available to us for the entire panel in the form of $css_id. The template is very straight forward and will look similar to the following:
-<pre>&lt;div class="panel-display panel-stacked-twothirds-onethird clearfix" &lt;?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?&gt;&gt;
- &lt;div class="panel-panel panel-col-first panel-region-main"&gt;
- &lt;div class="inside"&gt;&lt;?php print $content['main']; ?&gt;&lt;/div&gt;
- &lt;/div&gt;
-
- &lt;div class="panel-panel panel-col-last panel-region-right"&gt;
- &lt;div class="inside"&gt;&lt;?php print $content['right']; ?&gt;&lt;/div&gt;
- &lt;/div&gt;
-&lt;/div&gt;
-</pre>
-This is simply an example of what the html could look like. You can alter an update this html to fit your own needs.
-</p>
-
-<h2>The Other Files:</h2>
-<p>The css and png files are as simple as any other css or png file you've ever utilized. Panels provides some images for its graphical representations of its layouts. I would heavily encourage you to modify these to suit your needs. The CSS files (admin and non) will be included at the appropriate times. Simply set them up to fit your purposes. If you're utilizing fixed width panel regions it's probably smart to provide an admin css file as well with your panel layout.</p>
diff --git a/help/plugins-layout.html b/help/plugins-layout.html
deleted file mode 100644
index 85a33c4..0000000
--- a/help/plugins-layout.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<h2>Getting Started:</h2>
-<p>Layout plugins are one of the simplest and most powerful sections of the panels api. There are two different ways that a layout can be implemented via panels. Panels supports both module and theme implementations of panels. The module implementation requires that hook_ctools_plugin_directory define the directory in which your layout plugins exist. (This same hook defines the directory for all panels plugins) Alternately, if you intend on implementing a layout in a theme this can be done primary through the theme's info file. The CTools help does a great job of actually explaining this portion of the API <a href="topic:ctools/plugins-implementing">ctools: plugins</a>.</p>
-
-<p>CTools explains even the layout hooks a little in its example, but we'll recap quickly and expand on this information. As ctools explains, the actual plugin file must be named with care as it will directly affect your naming scheme for the hook within it. This is really no different from any other hook within drupal except that we'll be using multiple replacements in this case. The function we're looking to implement is an instance of:
-<code>function YOURMODULE_PLUGINNAME_OWNERMODULE_PLUGINTYPE()</code>
-In our case we already know that the function will be:
-<code>function YOURMODULE_PLUGINNAME_panels_layouts()</code>
-This is because the plugin type we're working with is a layout, and the module that implements these layouts is the panels module. For the rest of the naming scheme "YOURMODULE" will be replaced with either the name of your module that implements this layout, or the name of the theme, and "PLUGINNAME" will be replaced with whatever the name of the plugin file is. For purposes of this example our module name us going to be "layout_sample" and our plugin will be "first_layout".</p>
-
-<h2>Directory Structure:</h2>
-<p>We're going to assume that you've laid your directory structure out very similarly to how panels does it. Something like this is rather likely:
-<pre>layout_sample
- layout_sample.info
- layout_sample.module
- plugins
- layouts
- first_layout
- first_layout.css
- first_layout.inc
- first_layout.png
- layout-sample-first-layout.tpl.php</pre>
-The name of our .inc file is going to be the key to the entire layout plugin.</p>
-
-<h2>The .inc File:</h2>
-<p>We will start with the first_layout.inc file as it's the most important file we're dealing with here. First_layout.inc will look similar to the following:
-<pre>
- $plugin = array(
- 'title' => t('First Layout'),
- 'icon' => 'first_layout.png',
- 'theme' => 'layout_sample_first_layout',
- 'css' => 'first_layout.css',
- 'panels' => array(
- 'main' => t('Main region'),
- 'right' => t('Right region'),
- ),
- );
-</pre>
-The include file defines all the other files that our layout will utilize in order to be truly useful. The array is fairly self explanitory but for the sake of specificity:
-<ol>
-<li><strong>Title:</strong><br />The title of our layout. (Utilized within the panels administration screens)</li>
-<li><strong>Icon:</strong><br />The graphical representation of our layout. (Utilized within the panels administration screens)</li>
-<li><strong>Theme:</strong><br />The template file of our layout. (Sharp eyed readers will note that the theme definition utilizes underscores instead of dashes, and does not have ".tpl.php" after it. This is refering to the layout-sample-first-layout.tpl.php file all the same, it is simply how the naming convention works. Utilize dashes in the tpl file name and underscores when refering to it in your include file.)</li>
-<li><strong>CSS:</strong><br />The css file to be utilized for our layout. (Utilized within the panels administration screens, AND when viewing the actual panel itself.)</li>
-<li><strong>Panels:</strong><br />Defines all the various regions within your panel. This will be further utilized within our tpl.php file.</li>
-</ol>
-There are many additional properties that can be added to the include file. For purposes of this document we'll also make mention of the 'admin css' property. 'Admin css' is especially useful when utilizing a fixed width layout with fixed with panel regions. This can break under most administrative circumstances, and panels provides you with the ability to give an additional css layout for the administrative section. It's a simple nicety and looks like this:
-<pre>
- $plugin = array(
- 'title' => t('First Layout'),
- 'icon' => 'first_layout.png',
- 'theme' => 'layout_sample_first_layout',
- 'css' => 'first_layout.css',
- 'admin css' => 'first_layout_admin.css',
- 'panels' => array(
- 'main' => t('Main region'),
- 'right' => t('Right region'),
- ),
- );
-</pre>
-</p>
-
-<h2>The tpl.php File:</h2>
-<p>The tpl.php file is very similar to any other template file within drupal. The difference here is that we're being passed an array of regions through $content, and we also have a css id available to us for the entire panel in the form of $css_id. The template is very straight forward and will look similar to the following:
-<pre>&lt;div class="panel-display panel-stacked-twothirds-onethird clearfix" &lt;?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?&gt;&gt;
- &lt;div class="panel-panel panel-col-first panel-region-main"&gt;
- &lt;div class="inside"&gt;&lt;?php print $content['main']; ?&gt;&lt;/div&gt;
- &lt;/div&gt;
-
- &lt;div class="panel-panel panel-col-last panel-region-right"&gt;
- &lt;div class="inside"&gt;&lt;?php print $content['right']; ?&gt;&lt;/div&gt;
- &lt;/div&gt;
-&lt;/div&gt;
-</pre>
-This is simply an example of what the html could look like. You can alter an update this html to fit your own needs.
-</p>
-
-<h2>The Other Files:</h2>
-<p>The css and png files are as simple as any other css or png file you've ever utilized. Panels provides some images for its graphical representations of its layouts. I would heavily encourage you to modify these to suit your needs. The CSS files (admin and non) will be included at the appropriate times. Simply set them up to fit your purposes. If you're utilizing fixed width panel regions it's probably smart to provide an admin css file as well with your panel layout.</p>
diff --git a/help/plugins-style.html b/help/plugins-style.html
deleted file mode 100644
index e69de29..0000000
--- a/help/plugins-style.html
+++ /dev/null
diff --git a/images/arrow-active.png b/images/arrow-active.png
deleted file mode 100644
index 3bbd3c2..0000000
--- a/images/arrow-active.png
+++ /dev/null
Binary files differ
diff --git a/images/arrow-down-light.png b/images/arrow-down-light.png
deleted file mode 100644
index f011ac6..0000000
--- a/images/arrow-down-light.png
+++ /dev/null
Binary files differ
diff --git a/images/bg-content-modal.png b/images/bg-content-modal.png
deleted file mode 100644
index 600d074..0000000
--- a/images/bg-content-modal.png
+++ /dev/null
Binary files differ
diff --git a/images/bg-shade-dark.png b/images/bg-shade-dark.png
deleted file mode 100644
index 1be36f2..0000000
--- a/images/bg-shade-dark.png
+++ /dev/null
Binary files differ
diff --git a/images/bg-shade-light.png b/images/bg-shade-light.png
deleted file mode 100644
index ad7167b..0000000
--- a/images/bg-shade-light.png
+++ /dev/null
Binary files differ
diff --git a/images/bg-shade-medium.png b/images/bg-shade-medium.png
deleted file mode 100644
index e4b39fe..0000000
--- a/images/bg-shade-medium.png
+++ /dev/null
Binary files differ
diff --git a/images/bg-shade-white-lrg.png b/images/bg-shade-white-lrg.png
deleted file mode 100644
index 842e5f7..0000000
--- a/images/bg-shade-white-lrg.png
+++ /dev/null
Binary files differ
diff --git a/images/blank.gif b/images/blank.gif
deleted file mode 100644
index 75b945d..0000000
--- a/images/blank.gif
+++ /dev/null
Binary files differ
diff --git a/images/close.gif b/images/close.gif
deleted file mode 100644
index 46891b0..0000000
--- a/images/close.gif
+++ /dev/null
Binary files differ
diff --git a/images/delete.png b/images/delete.png
deleted file mode 100644
index f790555..0000000
--- a/images/delete.png
+++ /dev/null
Binary files differ
diff --git a/images/go-down.png b/images/go-down.png
deleted file mode 100644
index c2def1a..0000000
--- a/images/go-down.png
+++ /dev/null
Binary files differ
diff --git a/images/go-right.png b/images/go-right.png
deleted file mode 100644
index dd6058c..0000000
--- a/images/go-right.png
+++ /dev/null
Binary files differ
diff --git a/images/go-up.png b/images/go-up.png
deleted file mode 100644
index a52c7dc..0000000
--- a/images/go-up.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-addcontent.png b/images/icon-addcontent.png
deleted file mode 100644
index 788d01f..0000000
--- a/images/icon-addcontent.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-cache.png b/images/icon-cache.png
deleted file mode 100644
index 3e6f46b..0000000
--- a/images/icon-cache.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-configure.png b/images/icon-configure.png
deleted file mode 100644
index e23d67c..0000000
--- a/images/icon-configure.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-delete.png b/images/icon-delete.png
deleted file mode 100644
index 5f0cf69..0000000
--- a/images/icon-delete.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-draggable.png b/images/icon-draggable.png
deleted file mode 100644
index dba8b67..0000000
--- a/images/icon-draggable.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-hidepane.png b/images/icon-hidepane.png
deleted file mode 100644
index 8516980..0000000
--- a/images/icon-hidepane.png
+++ /dev/null
Binary files differ
diff --git a/images/icon-showpane.png b/images/icon-showpane.png
deleted file mode 100644
index 7549dd9..0000000
--- a/images/icon-showpane.png
+++ /dev/null
Binary files differ
diff --git a/images/no-icon.png b/images/no-icon.png
deleted file mode 100644
index 30584e6..0000000
--- a/images/no-icon.png
+++ /dev/null
Binary files differ
diff --git a/images/portlet-collapsed.png b/images/portlet-collapsed.png
deleted file mode 100644
index 95a214a..0000000
--- a/images/portlet-collapsed.png
+++ /dev/null
Binary files differ
diff --git a/images/portlet-expanded.png b/images/portlet-expanded.png
deleted file mode 100644
index 46f39ec..0000000
--- a/images/portlet-expanded.png
+++ /dev/null
Binary files differ
diff --git a/images/screenshot-1.jpg b/images/screenshot-1.jpg
deleted file mode 100644
index 7204357..0000000
--- a/images/screenshot-1.jpg
+++ /dev/null
Binary files differ
diff --git a/images/screenshot-2.jpg b/images/screenshot-2.jpg
deleted file mode 100644
index 80203d8..0000000
--- a/images/screenshot-2.jpg
+++ /dev/null
Binary files differ
diff --git a/images/screenshot-3.jpg b/images/screenshot-3.jpg
deleted file mode 100644
index 2d6ce09..0000000
--- a/images/screenshot-3.jpg
+++ /dev/null
Binary files differ
diff --git a/images/screenshot-4.jpg b/images/screenshot-4.jpg
deleted file mode 100644
index bf7d77d..0000000
--- a/images/screenshot-4.jpg
+++ /dev/null
Binary files differ
diff --git a/images/sky.png b/images/sky.png
deleted file mode 100644
index 35b9380..0000000
--- a/images/sky.png
+++ /dev/null
Binary files differ
diff --git a/images/sprite.png b/images/sprite.png
deleted file mode 100644
index fe74899..0000000
--- a/images/sprite.png
+++ /dev/null
Binary files differ
diff --git a/images/throbber.gif b/images/throbber.gif
deleted file mode 100644
index 8a084b8..0000000
--- a/images/throbber.gif
+++ /dev/null
Binary files differ
diff --git a/images/user-trash.png b/images/user-trash.png
deleted file mode 100644
index 71e4c46..0000000
--- a/images/user-trash.png
+++ /dev/null
Binary files differ
diff --git a/includes/callbacks.inc b/includes/callbacks.inc
deleted file mode 100644
index 5188394..0000000
--- a/includes/callbacks.inc
+++ /dev/null
@@ -1,189 +0,0 @@
-<?php
-/**
- * @file callbacks.inc
- * Minor menu callbacks for Panels helpers.
- */
-
-/**
- * A central administrative page for Panels.
- */
-function panels_admin_page() {
- // @todo I think this should return a renderable array somehow?
- return theme('panels_dashboard');
-}
-
-function panels_dashboard_final_blocks(&$vars) {
- // Add in links for missing modules that we still want to mention:
- if (empty($vars['links']['page_manager'])) {
- $vars['links']['page_manager'] = array(
- 'weight' => -100,
- 'title' => t('Panel page'),
- 'description' => '<em>' . t('You must activate the page manager module for this functionality.') . '</em>',
- );
- }
- if (empty($vars['links']['panels_mini'])) {
- $vars['links']['panels_mini'] = array(
- 'title' => t('Mini panel'),
- 'description' => '<em>' . t('You must activate the Mini panels module for this functionality.') . '</em>',
- );
- }
- if (empty($vars['links']['panels_node'])) {
- $vars['links']['panels_mini'] = array(
- 'title' => t('Panel node'),
- 'description' => '<em>' . t('You must activate the panel node module for this functionality.') . '</em>',
- );
- }
-}
-
-/**
- * Implementation of hook_panels_dashboard_blocks().
- *
- * Adds page information to the Panels dashboard.
- */
-function panels_panels_dashboard_blocks(&$vars) {
- $vars['links']['panels_layout'] = array(
- 'title' => l(t('Custom layout'), 'admin/structure/panels/layouts/add'),
- 'description' => t('Custom layouts can add more, site-specific layouts that you can use in your panels.'),
- );
-
- // Load all mini panels and their displays.
- ctools_include('export');
- $items = ctools_export_crud_load_all('panels_layout');
- $count = 0;
- $rows = array();
-
- foreach ($items as $item) {
- $rows[] = array(
- check_plain($item->admin_title),
- array(
- 'data' => l(t('Edit'), "admin/structure/panels/layouts/list/$item->name/edit"),
- 'class' => 'links',
- ),
- );
-
- // Only show 10.
- if (++$count >= 10) {
- break;
- }
- }
-
- if ($rows) {
- $content = theme('table', array('rows' => $rows, 'attributes' => array('class' => 'panels-manage')));
- }
- else {
- $content = '<p>' . t('There are no custom layouts.') . '</p>';
- }
-
- $vars['blocks']['panels_layout'] = array(
- 'title' => t('Manage custom layouts'),
- 'link' => l(t('Go to list'), 'admin/structure/panels/layouts'),
- 'content' => $content,
- 'class' => 'dashboard-layouts',
- 'section' => 'right',
- );
-}
-
-function template_preprocess_panels_dashboard(&$vars) {
- ctools_add_css('panels-dashboard', 'panels');
- ctools_include('plugins');
-
- $vars['image_path'] = ctools_image_path('', 'panels');
-
- $vars['links'] = array();
- $vars['blocks'] = array();
-
- foreach (module_implements('panels_dashboard_blocks') as $module) {
- $function = $module . '_panels_dashboard_blocks';
- $function($vars);
- }
-
- // Add in any default links for modules that are not active
- panels_dashboard_final_blocks($vars);
-
- // If page manager module is enabled, add a very low eight block to
- // list the page wizards.
- if (module_exists('page_manager')) {
- $vars['blocks']['wizards'] = array(
- 'weight' => -101,
- 'section' => 'right',
- 'title' => t('Page wizards'),
- 'content' => '',
- 'class' => 'dashboard-wizards',
- );
-
- ctools_include('page-wizard');
- $plugins = page_manager_get_page_wizards();
- uasort($plugins, 'ctools_plugin_sort');
-
- foreach ($plugins as $id => $plugin) {
- if (isset($plugin['type']) && $plugin['type'] == 'panels') {
- $link = array(
- 'title' => l($plugin['title'], 'admin/structure/pages/wizard/' . $id),
- 'description' => $plugin['description'],
- );
-
- $vars['blocks']['wizards']['content'] .= theme('panels_dashboard_link', array('link' => $link));
- }
- }
-
- }
-
- uasort($vars['links'], 'ctools_plugin_sort');
-
- $vars['blocks']['links'] = array(
- 'weight' => -100,
- 'section' => 'left',
- 'title' => t('Create new') . '...',
- 'content' => '',
- 'class' => 'dashboard-create',
- );
-
- // Turn the links into a block
- foreach ($vars['links'] as $link) {
- $vars['blocks']['links']['content'] .= theme('panels_dashboard_link', array('link' => $link));
- }
-
- uasort($vars['blocks'], 'ctools_plugin_sort');
-
- $vars['left'] = '';
- $vars['right'] = '';
-
- // Render all the blocks
- foreach ($vars['blocks'] as $block) {
- $section = !empty($block['section']) ? $block['section'] : 'left';
- $vars[$section] .= theme('panels_dashboard_block', array('block' => $block));
- }
-}
-
-function panels_admin_settings_page() {
- $form = array();
- if (module_exists('page_manager')) {
- foreach (page_manager_get_tasks() as $task) {
- if ($function = ctools_plugin_get_function($task, 'admin settings')) {
- $function($form);
- }
- }
- }
-
- ctools_include('content');
- foreach (ctools_get_content_types() as $content) {
- if ($function = ctools_plugin_get_function($content, 'admin settings')) {
- $function($form);
- }
- }
-
- if (empty($form)) {
- return array('#value' => t('There are currently no settings to change, but additional plugins or modules may provide them in the future.'));
- }
-
- return system_settings_form($form);
-}
-
-/**
- * Settings for panel contexts created by the page manager.
- */
-function panels_admin_panel_context_page() {
- ctools_include('common', 'panels');
- return drupal_get_form('panels_common_settings', 'panels_page');
-}
-
diff --git a/includes/common.inc b/includes/common.inc
deleted file mode 100644
index bd90f66..0000000
--- a/includes/common.inc
+++ /dev/null
@@ -1,575 +0,0 @@
-<?php
-
-
-/**
- * @file
- * Functions used by more than one panels client module.
- */
-
-/**
- * Class definition for the allowed layouts governing structure.
- *
- * @ingroup mainapi
- *
- * This class is designed to handle panels allowed layouts data from start to finish, and sees
- * action at two times:\n
- * - When a client module wants to generate a form allowing an admin to create or edit a set
- * of allowed layouts. In this case, either a new panels_allowed_layouts object is created
- * or one is retrieved from storage and panels_allowed_layouts::set_allowed() is called to
- * generate the allowed layouts form. \n
- * - When a client module is calling panels_edit_layout(), a saved instantiation of this object
- * can be called up and passed in to the fourth parameter, and only the allowed layouts saved
- * in that object will be displayed on the form. \n
- * Because the panels API does not impose a data structure on the allowed_layouts data, client
- * modules can create as many of these objects as they want, and organize them around any concept:
- * node types, date published, author roles...anything.
- *
- * To call the settings form, instantiate this class - or, if your client module's needs are
- * heavy-duty, extend this class and instantiate your subclass - assign values to any relevant
- * desired members, and call panels_allowed_layouts::set_allowed(). See the documentation on
- * that method for a sample implementation.
- *
- * Note that when unserializing saved tokens of this class, you must
- * run panels_load_include('common') before unserializing in order to ensure
- * that the object is properly loaded.
- *
- * Client modules extending this class should implement a save() method and use it for
- * their custom data storage routine. You'll need to rewrite other class methods if
- * you choose to go another route.
- *
- * @see panels_edit_layout()
- * @see _panels_edit_layout()
- *
- */
-class panels_allowed_layouts {
-
- /**
- * Specifies whether newly-added layouts (as in, new .inc files) should be automatically
- * allowed (TRUE) or disallowed (FALSE) for $this. Defaults to TRUE, which is more
- * permissive but less of an administrative hassle if/when you add new layouts. Note
- * that this parameter will be derived from $allowed_layouts if a value is passed in.
- */
- var $allow_new = TRUE;
-
- /**
- * Optional member. If provided, the Panels API will generate a drupal variable using
- * variable_set($module_name . 'allowed_layouts', serialize($this)), thereby handling the
- * storage of this object entirely within the Panels API. This object will be
- * called and rebuilt by panels_edit_layout() if the same $module_name string is passed in
- * for the $allowed_types parameter. \n
- * This is primarily intended for convenience - client modules doing heavy-duty implementations
- * of the Panels API will probably want to create their own storage method.
- * @see panels_edit_layout()
- */
- var $module_name = NULL;
-
- /**
- * An associative array of all available layouts, keyed by layout name (as defined
- * in the corresponding layout plugin definition), with value = 1 if the layout is
- * allowed, and value = 0 if the layout is not allowed.
- * Calling array_filter(panels_allowed_layouts::$allowed_layout_settings) will return an associative array
- * containing only the allowed layouts, and wrapping that in array_keys() will
- * return an indexed version of that array.
- */
- var $allowed_layout_settings = array();
-
- /**
- * Hack-imitation of D6's $form_state. Used by the panels_common_set_allowed_types()
- * form to indicate whether the returned value is in its 'render', 'failed-validate',
- * or 'submit' stage.
- */
- var $form_state;
-
- /**
- * Constructor function; loads the $allowed_layout_settings array with initial values according
- * to $start_allowed
- *
- * @param bool $start_allowed
- * $start_allowed determines whether all available layouts will be marked
- * as allowed or not allowed on the initial call to panels_allowed_layouts::set_allowed()
- *
- */
- function panels_allowed_layouts($start_allowed = TRUE) {
- // TODO would be nice if there was a way to just fetch the names easily
- foreach ($this->list_layouts() as $layout_name) {
- $this->allowed_layout_settings[$layout_name] = $start_allowed ? 1 : 0;
- }
- }
-
- /**
- * Manage panels_common_set_allowed_layouts(), the FAPI code for selecting allowed layouts.
- *
- * MAKE SURE to set panels_allowed_layouts::allow_new before calling this method. If you want the panels API
- * to handle saving these allowed layout settings, panels_allowed_layouts::module_name must also be set.
- *
- * Below is a sample implementation; refer to the rest of the class documentation to understand all the
- * specific pieces. Values that are intended to be replaced are wrapped with <>.
- *
- * \n @code
- * function docdemo_allowed_layouts() {
- * ctools_include('common', 'panels');
- * if (!is_a($allowed_layouts = unserialize(variable_get('panels_common_allowed_layouts', serialize(''))), 'panels_allowed_layouts')) {
- * $allowed_layouts = new panels_allowed_layouts();
- * $allowed_layouts->allow_new = TRUE;
- * $allowed_layouts->module_name = '<client_module_name>';
- * }
- * $result = $allowed_layouts->set_allowed('<Desired client module form title>');
- * if (in_array($allowed_layouts->form_state, array('failed-validate', 'render'))) {
- * return $result;
- * }
- * elseif ($allowed_layouts->form_state == 'submit') {
- * drupal_goto('</path/to/desired/redirect>');
- * }
- * }
- * @endcode \n
- *
- * If $allowed_layouts->form_state == 'failed-validate' || 'render', then you'll need to return
- * $result as it contains the structured form HTML generated by drupal_render_form() and is ready
- * to be passed through index.php's call to theme('page', ...).
- *
- * However, if $allowed_layouts->form_state == 'submit', then the form has been submitted and we should
- * react. It's really up to your client module how you handle the rest; panels_allowed_layouts::save() (or
- * panels_allowed_layouts::api_save(), if that's the route you're going) will have already been called,
- * so if those methods handle your save routine, then all there is left to do is handle redirects, if you
- * want. The current implementation of the allowed layouts form currently never redirects, so it's up to
- * you to control where the user ends up next.
- *
- * @param string $title
- * Used to set the title of the allowed layouts form. If no value is given, defaults to
- * 'Panels: Allowed Layouts'.
- *
- * @return mixed $result
- * - On the first passthrough when the form is being rendered, $result is the form's structured
- * HTML, ready to be pushed to the screen with a call to theme('page', ...).
- * - A successful second passthrough indicates a successful submit, and
- * $result === panels_allowed_layouts::allowed_layout_settings. Returning it is simply for convenience.
- */
- function set_allowed($title = 'Panels: Allowed Layouts') {
- $this->sync_with_available();
- $form_id = 'panels_common_set_allowed_layouts';
- // TODO switch to drupal_build_form(); need to pass by ref
- $form = drupal_retrieve_form($form_id, $this, $title);
-
- if ($result = drupal_process_form($form_id, $form)) {
- // successful submit
- $this->form_state = 'submit';
- return $result;
- }
- $this->form_state = isset($_POST['op']) ? 'failed-validate' : 'render';
- $result = drupal_render_form($form_id, $form);
- return $result;
- }
-
- /**
- * Checks for newly-added layouts and deleted layouts. If any are found, updates panels_allowed_layouts::allowed_layout_settings;
- * new additions are made according to panels_allowed_layouts::allow_new, while deletions are unset().
- *
- * Note that any changes made by this function are not saved in any permanent location.
- */
- function sync_with_available() {
- $layouts = $this->list_layouts();
- foreach (array_diff($layouts, array_keys($this->allowed_layout_settings)) as $new_layout) {
- $this->allowed_layout_settings[$new_layout] = $this->allow_new ? 1 : 0;
- }
- foreach (array_diff(array_keys($this->allowed_layout_settings), $layouts) as $deleted_layout) {
- unset($this->allowed_layout_settings[$deleted_layout]);
- }
- }
-
- /**
- * Use panels_allowed_layouts::module_name to generate a variable for variable_set(), in which
- * a serialized version of $this will be stored.
- *
- * Does nothing if panels_allowed_layouts::module_name is not set.
- *
- * IMPORTANT NOTE: if you use variable_get() in a custom client module save() method, you MUST
- * wrap $this in serialize(), then unserialize() what you get from variable_get(). Failure to
- * do so will result in an incomplete object. The following code will work:
- * @code
- * $allowed_layouts = unserialize(variable_get('your_variable_name', serialize(''));
- * @endcode
- *
- * If you don't serialize the second parameter of variable_get() and the variable name you provide
- * can't be found, an E_STRICT warning will be generated for trying to unserialize an entity
- * that has not been serialized.
- *
- */
- function save() {
- if (!is_null($this->module_name)) {
- variable_set($this->module_name . "_allowed_layouts", serialize($this));
- }
- }
-
- /**
- * Snag a list of the current layouts for internal use.
- *
- * Data is not saved in a class member in order to ensure that it's
- * fresh.
- *
- * @return array $layouts
- * An indexed array of the system names for all currently available layouts.
- */
- function list_layouts() {
- static $layouts = array();
- if (empty($layouts)) {
- ctools_include('plugins', 'panels');
- $layouts = array_keys(panels_get_layouts());
- }
- return $layouts;
- }
-}
-
-/**
- * A common settings page for Panels modules, because this code is relevant to
- * any modules that don't already have special requirements.
- */
-function panels_common_settings($form, &$form_state, $module_name = 'panels_common') {
- ctools_include('plugins', 'panels');
- ctools_include('content');
- $content_types = ctools_get_content_types();
- $skip = FALSE;
-
- $default_types = variable_get($module_name . '_default', NULL);
- if (!isset($default_types)) {
- $default_types = array('other' => TRUE);
- $skip = TRUE;
- }
-
- foreach ($content_types as $id => $info) {
- if (empty($info['single'])) {
- $default_options[$id] = t('New @s', array('@s' => $info['title']));
- if ($skip) {
- $default_types[$id] = TRUE;
- }
- }
- }
-
- $default_options['other'] = t('New content of other types');
- $form['panels_common_default'] = array(
- '#type' => 'checkboxes',
- '#title' => t('New content behavior'),
- '#description' => t('Select the default behavior of new content added to the system. If checked, new content will automatically be immediately available to be added to Panels pages. If not checked, new content will not be available until specifically allowed here.'),
- '#options' => $default_options,
- '#default_value' => array_keys(array_filter($default_types)),
- );
-
- $form_state['skip'] = $skip;
- if ($skip) {
- $form['markup'] = array('#value' => t('<p>Click Submit to be presented with a complete list of available content types set to the defaults you selected.</p>'));
- }
- else {
- // Rebuild the entire list, setting appropriately from defaults. Give
- // each type its own checkboxes set unless it's 'single' in which
- // case it can go into our fake other set.
- $available_content_types = ctools_content_get_all_types();
- $allowed_content_types = variable_get($module_name . '_allowed_types', array());
-
- foreach ($available_content_types as $id => $types) {
- foreach ($types as $type => $info) {
- $key = $id . '-' . $type;
- $checkboxes = empty($content_types[$id]['single']) ? $id : 'other';
- $options[$checkboxes][$key] = $info['title'];
- if (!isset($allowed_content_types[$key])) {
- $allowed[$checkboxes][$key] = isset($default_types[$id]) ? $default_types[$id] : $default_types['other'];
- }
- else {
- $allowed[$checkboxes][$key] = $allowed_content_types[$key];
- }
- }
- }
-
- $form['content_types'] = array(
- '#tree' => TRUE,
- '#prefix' => '<div class="clearfix">',
- '#suffix' => '</div>',
- );
- // cheat a bit
- $content_types['other'] = array('title' => t('Other'), 'weight' => 10);
- foreach ($content_types as $id => $info) {
- if (isset($allowed[$id])) {
- $form['content_types'][$id] = array(
- '#prefix' => '<div class="panels-page-type-container">',
- '#suffix' => '</div>',
- '#type' => 'checkboxes',
- '#title' => t('Allowed @s content', array('@s' => $info['title'])),
- '#options' => $options[$id],
- '#default_value' => array_keys(array_filter($allowed[$id])),
- '#checkall' => TRUE,
- );
- }
- }
- }
-
- panels_common_allowed_layouts_form($form, $form_state, $module_name);
-
- $form['module_name'] = array(
- '#type' => 'value',
- '#value' => $module_name,
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- ctools_add_css('panels_page', 'panels');
- return $form;
-}
-
-/**
- * Submit hook for panels_common_settings
- */
-function panels_common_settings_validate($form, &$form_state) {
- panels_common_allowed_layouts_form_validate($form, $form_state);
-}
-
-/**
- * Submit hook for panels_common_settings
- */
-function panels_common_settings_submit($form, &$form_state) {
- panels_common_allowed_layouts_form_submit($form, $form_state);
- $module_name = $form_state['values']['module_name'];
- variable_set($module_name . '_default', $form_state['values']['panels_common_default']);
- if (!$form_state['skip']) {
- // merge the broken apart array neatly back together
- variable_set($module_name . '_allowed_types', call_user_func_array('array_merge', $form_state['values']['content_types']));
- }
- drupal_set_message(t('Your changes have been saved.'));
-}
-
-/**
- * Based upon the settings, get the allowed types for this node.
- */
-function panels_common_get_allowed_types($module, $contexts = array(), $has_content = FALSE, $default_defaults = array(), $default_allowed_types = array()) {
- // Get a list of all types that are available
-
- $default_types = variable_get($module . '_default', $default_defaults);
- $allowed_types = variable_get($module . '_allowed_types', $default_allowed_types);
-
- // By default, if they haven't gone and done the initial setup here,
- // let all 'other' types (which will be all types) be available.
- if (!isset($default_types['other'])) {
- $default_types['other'] = TRUE;
- }
-
- ctools_include('content');
- $content_types = ctools_content_get_available_types($contexts, $has_content, $allowed_types, $default_types);
-
- return $content_types;
-}
-
-/**
- * The FAPI code for generating an 'allowed layouts' selection form.
- *
- * NOTE: Because the Panels API does not guarantee a particular method of storing the data on allowed layouts,
- * it is not_possible for the Panels API to implement any checks that determine whether reductions in
- * the set of allowed layouts conflict with pre-existing layout selections. $displays in that category
- * will continue to function with their current layout as normal until the user/owner/admin attempts
- * to change layouts on that display, at which point they will have to select from the new set of
- * allowed layouts. If this is not the desired behavior for your client module, it's up to you to
- * write a validation routine that determines what should be done with conflicting layouts.
- *
- * Remember that changing layouts where panes have already been created can result in data loss;
- * consult panels_change_layout() to see how the Panels API handles that process. Running
- * drupal_execute('panels_change_layout', ...) is one possible starting point.
- *
- * @ingroup forms
- *
- * @param array $allowed_layouts
- * The set of allowed layouts that should be used as the default values
- * for this form. If none is provided, then by default no layouts will be restricted.
- */
-function panels_common_allowed_layouts_form(&$form, &$form_state, $module_name) {
- // Fetch our allowed layouts from variables.
- $allowed_layouts = panels_common_get_allowed_layout_object($module_name);
-
- $layouts = panels_get_layouts();
- foreach ($layouts as $id => $layout) {
- $options[$id] = panels_print_layout_icon($id, $layout, check_plain($layout['title']));
- }
-
- $form_state['allowed_layouts'] = &$allowed_layouts;
-
- ctools_add_js('layout', 'panels');
- $form['layouts'] = array(
- '#type' => 'checkboxes',
- '#title' => t('Select allowed layouts'),
- '#options' => $options,
- '#description' => t('Check the boxes for all layouts you want to allow users choose from when picking a layout. You must allow at least one layout.'),
- '#default_value' => array_keys(array_filter($allowed_layouts->allowed_layout_settings)),
- '#prefix' => '<div class="clearfix panels-layouts-checkboxes">',
- '#suffix' => '</div>',
- '#checkall' => TRUE,
- );
-
- return $form;
-}
-
-function panels_common_allowed_layouts_form_validate($form, &$form_state) {
- $selected = array_filter($form_state['values']['layouts']);
- if (empty($selected)) {
- form_set_error('layouts', 'You must choose at least one layout to allow.');
- }
-}
-
-function panels_common_allowed_layouts_form_submit($form, &$form_state) {
- foreach ($form_state['values']['layouts'] as $layout => $setting) {
- $form_state['allowed_layouts']->allowed_layout_settings[$layout] = (bool) $setting;
- }
- $form_state['allowed_layouts']->save();
-}
-
-/**
- * Get the allowed layout object for the given module.
- */
-function panels_common_get_allowed_layout_object($module_name) {
- $allowed_layouts = unserialize(variable_get($module_name . "_allowed_layouts", serialize('')));
-
- // if no parameter was provided, or the variable_get failed
- if (!$allowed_layouts) {
- // still no dice. simply creates a dummy version where all layouts
- // are allowed.
- $allowed_layouts = new panels_allowed_layouts();
- $allowed_layouts->allow_new = TRUE;
- $allowed_layouts->module_name = $module_name;
- }
-
- // sanitize allowed layout listing; this is redundant if the
- // $allowed_layouts param was null, but the data is cached anyway
- $allowed_layouts->sync_with_available();
-
- return $allowed_layouts;
-}
-
-/**
- * Get the allowed layouts for the given module.
- */
-function panels_common_get_allowed_layouts($module_name) {
- $available_layouts = panels_get_layouts();
- if (empty($module_name)) {
- return $available_layouts;
- }
- else if (is_object($module_name)) {
- $allowed_layouts = $module_name;
- }
- else {
- $allowed_layouts = panels_common_get_allowed_layout_object($module_name);
- }
-
- $allowed = array_filter($allowed_layouts->allowed_layout_settings);
- $order = array();
- foreach ($available_layouts as $name => $plugin) {
- if (!empty($allowed[$name])) {
- $order[$name] = $plugin['category'] . ':' . $plugin['title'];
- }
- }
-
- // Sort
- $layouts = array();
-
- asort($order);
- foreach ($order as $name => $junk) {
- $layouts[$name] = $available_layouts[$name];
- }
-
- return $layouts;
-}
-
-/**
- * Create a visible list of content in a display.
- * Note that the contexts must be pre-loaded.
- */
-function theme_panels_common_content_list($vars) {
- $display = $vars['display'];
-
- $layout = panels_get_layout($display->layout);
- $content = '<dl class="content-list">';
- foreach (panels_get_regions($layout, $display) as $panel_id => $title) {
- $content .= "<dt>$title</dt><dd>";
- if (!empty($display->panels[$panel_id])) {
- $content .= '<ol>';
- foreach ($display->panels[$panel_id] as $pid) {
- $content .= '<li>' . panels_get_pane_title($display->content[$pid], $display->context) . '</li>';
- }
- $content .= '</ol>';
- }
- else {
- $content .= t('Empty');
- }
- $content .= '</dd>';
- }
- $content .= '</dl>';
- return $content;
-}
-
-/**
- * Print a selector of layouts, each linked to the next step.
- *
- * Most operations use radio buttons for selecting layouts, but some will
- * give each layout as a link that goes to the next step. This function
- * makes it easy to simply provide a list of allowed layouts and the base
- * path.
- *
- * One limitation is that it will only append the layout name to the end, so
- * if the actual layout name is needed in the middle, that can't happen.
- *
- * @return
- * The rendered output.
- */
-function panels_common_print_layout_links($layouts, $base_path, $link_options = array()) {
- $output = '';
-
- $categories = array();
- ctools_include('cleanstring');
- foreach ($layouts as $id => $layout) {
- $category = ctools_cleanstring($layout['category']);
-
- $categories[$category] = $layout['category'];
- $options[$category][$id] = panels_print_layout_link($id, $layout, $base_path . '/' . $id, $link_options);
- }
-
- $form = array();
- $form['categories'] = array(
- '#title' => t('Category'),
- '#type' => 'select',
- '#options' => $categories,
- '#name' => 'categories',
- '#id' => 'edit-categories',
- '#value' => '',
- '#parents' => array('categories'),
- );
-
- $output .= drupal_render($form);
-
- $output .= '<div class="panels-choose-layout panels-layouts-checkboxes clearfix">';
-
- // We're doing these dependencies completely manualy, which is unusual, but
- // the process code only supports doing them in a form.
- // @todo modify dependent.inc to make this easier.
-
- $dependencies = array();
- foreach ($options as $category => $links) {
- $dependencies['panels-layout-category-' . $category] = array(
- 'values' => array('edit-categories' => array($category)),
- 'num' => 1,
- 'type' => 'hide',
- );
-
- $output .= '<div id="panels-layout-category-' . $category . '-wrapper">';
- $output .= '<div id="panels-layout-category-' . $category . '" class="form-checkboxes clearfix">';
- $output .= '<div class="panels-layouts-category">' . $categories[$category] . '</div>';
-
- foreach ($links as $key => $link) {
- $output .= $link;
- }
- $output .= '</div></div>';
- }
-
- $output .= '</div>';
-
- ctools_add_js('dependent');
- $js['CTools']['dependent'] = $dependencies;
- drupal_add_js($js, 'setting');
-
- return $output;
-}
diff --git a/includes/display-edit.inc b/includes/display-edit.inc
deleted file mode 100644
index be9f500..0000000
--- a/includes/display-edit.inc
+++ /dev/null
@@ -1,311 +0,0 @@
-<?php
-
-/*
- * @file
- * Core Panels API include file containing various display-editing functions.
- * This includes all the basic editing forms (content, layout, layout settings)
- * as well as the ajax modal forms associated with them.
- */
-
-/**
- * Handle calling and processing of the form for editing display content.
- *
- * Helper function for panels_edit().
- *
- * @see panels_edit() for details on the various behaviors of this function.
- */
-function _panels_edit($display, $destination, $content_types, $title = FALSE) {
- $did = $display->did;
- if (!$did) {
- $display->did = $did = 'new';
- }
-
- // Load the display being edited from cache, if possible.
- if (!empty($_POST) && is_object($cache = panels_edit_cache_get($did))) {
- $display = $cache->display;
- }
- else {
- $cache = panels_edit_cache_get_default($display, $content_types, $title);
- }
-
- // Get a renderer.
- $renderer = panels_get_renderer_handler('editor', $display);
- $renderer->cache = $cache;
-
- $output = $renderer->edit();
- if (is_object($output) && $destination) {
- return panels_goto($destination);
- }
- return $output;
-}
-
-/**
- * Form definition for the panels display editor
- *
- * No validation function is necessary, as all 'validation' is handled
- * either in the lead-up to form rendering (through the selection of
- * specified content types) or by the validation functions specific to
- * the ajax modals & content types.
- *
- * @ingroup forms
- * @see panels_edit_display_submit()
- */
-function panels_edit_display_form($form, &$form_state) {
- $display = &$form_state['display'];
- $renderer = &$form_state['renderer'];
-
- // Make sure there is a valid cache key.
- $cache_key = isset($display->cache_key) ? $display->cache_key : $display->did;
- $display->cache_key = $cache_key;
-
- // Annoyingly, theme doesn't have access to form_state so we have to do this.
- $form['#display'] = $display;
-
- // The flexible layout maker wants to be able to edit a display without
- // actually editing a display, so we provide this 'setting' to allow
- // that to go away.
- if (empty($form_state['no display settings'])) {
- $links = $renderer->get_display_links();
- }
- else {
- $links = '';
- }
- $form['hide']['display-settings'] = array(
- '#value' => $links,
- );
-
- $form += panels_edit_display_settings_form($form, $form_state);
-
- $form['panel'] = array('#tree' => TRUE);
- $form['panel']['pane'] = array('#tree' => TRUE);
-
- $form['display'] = array(
- '#markup' => $renderer->render(),
- );
-
- foreach ($renderer->plugins['layout']['regions'] as $region_id => $title) {
- // Make sure we at least have an empty array for all possible locations.
- if (!isset($display->panels[$region_id])) {
- $display->panels[$region_id] = array();
- }
-
- $form['panel']['pane'][$region_id] = array(
- // Use 'hidden' instead of 'value' so the js can access it.
- '#type' => 'hidden',
- '#default_value' => implode(',', (array) $display->panels[$region_id]),
- );
- }
-
- if (empty($form_state['no buttons'])) {
- $form['buttons']['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- '#id' => 'panels-dnd-save',
- '#submit' => array('panels_edit_display_form_submit'),
- '#save-display' => TRUE,
- );
- $form['buttons']['cancel'] = array(
- '#type' => 'submit',
- '#value' => t('Cancel'),
- );
- }
-
- // Build up the preview portion of the form, if necessary.
- if (empty($form_state['no preview'])) {
- $form['preview'] = array(
- '#tree' => TRUE,
- '#prefix' => '<h2>' . t('Live preview') . '</h2>' . '<div id="panels-live-preview">',
- '#suffix' => '</div>',
- );
-
- ctools_context_replace_form($form['preview'], $display->context);
- $form['preview']['button'] = array(
- '#type' => 'submit',
- '#value' => t('Preview'),
- '#attributes' => array('class' => array('use-ajax-submit')),
- '#id' => 'panels-live-preview-button',
- '#submit' => array('panels_edit_display_form_submit', 'panels_edit_display_form_preview'),
- );
- }
-
- return $form;
-}
-
-/**
- * Handle form submission of the display content editor.
- *
- * This reads the location of the various panes from the form, which will
- * have been modified from the ajax, rearranges them and then saves
- * the display.
- */
-function panels_edit_display_form_submit($form, &$form_state) {
- $display = &$form_state['display'];
-
- $old_content = $display->content;
- $display->content = array();
-
- if (!empty($form_state['values']['panel']['pane'])) {
- foreach ($form_state['values']['panel']['pane'] as $panel_id => $panes) {
- $display->panels[$panel_id] = array();
- if ($panes) {
- $pids = explode(',', $panes);
- // need to filter the array, b/c passing it in a hidden field can generate trash
- foreach (array_filter($pids) as $pid) {
- if ($old_content[$pid]) {
- $display->panels[$panel_id][] = $pid;
- $old_content[$pid]->panel = $panel_id;
- $display->content[$pid] = $old_content[$pid];
- }
- }
- }
- }
- }
-
- panels_edit_display_settings_form_submit($form, $form_state);
-}
-
-/**
- * Submission of the preview button. Render the preview and put it into
- * the preview widget area.
- */
-function panels_edit_display_form_preview(&$form, &$form_state) {
- $display = &$form_state['display'];
- ctools_include('ajax');
-
- $display->context = ctools_context_replace_placeholders($display->context, $form_state['values']['preview']);
- $display->skip_cache = TRUE;
- $output = panels_render_display($display);
-
- // Add any extra CSS that some layouts may have added specifically for this.
- if (!empty($display->add_css)) {
- $output = "<style type=\"text/css\">\n$display->add_css</style>\n" . $output;
- }
-
- $commands = array();
- $commands[] = array(
- 'command' => 'panel_preview',
- 'output' => $output,
- );
-
- print ajax_render($commands);
- ajax_footer();
- exit;
-}
-
-
-/**
- * Form for display settings.
- */
-function panels_edit_display_settings_form($form, &$form_state) {
- $display = &$form_state['display'];
-
- $layout = panels_get_layout($display->layout);
- $form_state['layout'] = $layout;
-
- ctools_include('dependent');
-
- if ($form_state['display_title']) {
- $form['display_title'] = array (
- '#tree' => TRUE,
- );
-
- $form['display_title']['hide_title'] = array(
- '#type' => 'select',
- '#title' => t('Title type'),
- '#default_value' => (int) $display->hide_title,
- '#options' => array(
- PANELS_TITLE_NONE => t('No title'),
- PANELS_TITLE_FIXED => t('Manually set'),
- PANELS_TITLE_PANE => t('From pane'),
- ),
- );
-
- $form['display_title']['title'] = array(
- '#type' => 'textfield',
- '#default_value' => $display->title,
- '#title' => t('Title'),
- '#description' => t('The title of this panel. If left blank, a default title may be used. Set to No Title if you want the title to actually be blank.'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-display-title-hide-title' => array(PANELS_TITLE_FIXED)),
- );
-
- if (!empty($display->context)) {
- $form['display_title']['title']['#description'] .= ' ' . t('You may use substitutions in this title.');
-
- // We have to create a manual fieldset because fieldsets do not support IDs.
- // Use 'hidden' instead of 'markup' so that the process will run.
- // Add js for collapsible fieldsets manually
-// drupal_add_js('misc/form.js');
-// drupal_add_js('misc/collapse.js');
-// $form['display_title']['contexts_prefix'] = array(
-// '#type' => 'hidden',
-// '#id' => 'edit-display-substitutions',
-// '#prefix' => '<div><fieldset id="edit-display-substitutions" class="collapsed collapsible"><legend>' . t('Substitutions') . '</legend><div class="fieldset-wrapper">',
-// '#process' => array('ctools_dependent_process'),
-// '#dependency' => array('edit-display-title-hide-title' => array(PANELS_TITLE_FIXED)),
-// );
-
- $rows = array();
- foreach ($display->context as $context) {
- foreach (ctools_context_get_converters('%' . check_plain($context->keyword) . ':', $context) as $keyword => $title) {
- $rows[] = array(
- check_plain($keyword),
- t('@identifier: @title', array('@title' => $title, '@identifier' => $context->identifier)),
- );
- }
- }
-
- $header = array(t('Keyword'), t('Value'));
- $form['display_title']['contexts'] = array(
- '#type' => 'fieldset',
- '#title' => t('Substitutions'),
- '#collapsible' => TRUE,
- '#collapsed' => TRUE,
- '#value' => theme('table', array('header' => $header, 'rows' => $rows)),
-// '#process' => array('form_process_fieldset', 'ctools_dependent_process'),
-// '#id' => 'edit-display-title-context',
-// '#dependency' => array('edit-display-title-hide-title' => array(PANELS_TITLE_FIXED)),
- );
-// $form['display_title']['contexts_suffix'] = array(
-// '#value' => '</div></fieldset></div>',
-// );
- }
- }
-
- // TODO doc the ability to do this as part of the API
- if (!empty($layout['settings form']) && function_exists($layout['settings form'])) {
- $form['layout_settings'] = $layout['settings form']($display, $layout, $display->layout_settings);
- }
- $form['layout_settings']['#tree'] = TRUE;
-
- return $form;
-}
-
-/**
- * Validate the layout settings form.
- */
-function panels_edit_display_settings_form_validate($form, &$form_state) {
- if ($function = panels_plugin_get_function('layout', $form_state['layout'], 'settings validate')) {
- $function($form_state['values']['layout_settings'], $form['layout_settings'], $form_state['display'], $form_state['layout'], $form_state['display']->layout_settings);
- }
-}
-
-/**
- * Store changes from the layout settings form.
- */
-function panels_edit_display_settings_form_submit($form, &$form_state) {
- $display = &$form_state['display'];
- if ($function = panels_plugin_get_function('layout', $form_state['layout'], 'settings submit')) {
- $function($form_state['values']['layout_settings'], $display, $form_state['layout'], $display->layout_settings);
- }
-
- // Since not all layouts have layout settings, check here in case of notices.
- if (isset($form_state['values']['layout_settings'])) {
- $display->layout_settings = $form_state['values']['layout_settings'];
- }
-
- if (isset($form_state['values']['display_title']['title'])) {
- $display->title = $form_state['values']['display_title']['title'];
- $display->hide_title = $form_state['values']['display_title']['hide_title'];
- }
-}
diff --git a/includes/display-layout.inc b/includes/display-layout.inc
deleted file mode 100644
index fb02798..0000000
--- a/includes/display-layout.inc
+++ /dev/null
@@ -1,282 +0,0 @@
-<?php
-
-/**
- * @file
- *
- * Handle the forms for changing a display's layout.
- */
-
-/**
- * Handle calling and processing of the form for editing display layouts.
- *
- * Helper function for panels_edit_layout().
- *
- * @see panels_edit_layout() for details on the various behaviors of this function.
- */
-function _panels_edit_layout($display, $finish, $destination, $allowed_layouts) {
- ctools_include('common', 'panels');
-
- $form_state = array(
- 'display' => &$display,
- 'finish' => $finish,
- 'destination' => $destination,
- 'allowed_layouts' => $allowed_layouts,
- 're_render' => FALSE,
- 'no_redirect' => TRUE,
- );
-
- $change_form_state = $form_state;
-
- $change_form = FALSE;
-
- // Examine $_POST to see which form they're currently using.
- if (empty($_POST) || empty($_POST['form_id']) || $_POST['form_id'] != 'panels_change_layout') {
- $output = drupal_build_form('panels_choose_layout', $form_state);
- if (!empty($form_state['executed'])) {
- // upon submission go to next form.
- $change_form_state['layout'] = $_SESSION['layout'][$display->did] = $form_state['layout'];
- $change_form = TRUE;
- }
- }
- else {
- $change_form_state['layout'] = $_SESSION['layout'][$display->did];
- $change_form = TRUE;
- }
-
- if ($change_form) {
- $output = drupal_build_form('panels_change_layout', $change_form_state);
- if (!empty($change_form_state['executed'])) {
- if (isset($change_form_state['back'])) {
- unset($_POST);
- return _panels_edit_layout($display, $finish, $destination, $allowed_layouts);
- }
-
- if (!empty($change_form_state['clicked_button']['#save-display'])) {
- drupal_set_message(t('Panel layout has been updated.'));
- panels_save_display($display);
- }
-
- if ($destination) {
- return panels_goto($destination);
- }
- return $change_form_state['display'];
- }
- }
- return $output;
-}
-
-/**
- * Form definition for the display layout editor.
- *
- * @ingroup forms
- */
-function panels_choose_layout($form, &$form_state) {
- $display = &$form_state['display'];
- ctools_include('common', 'panels');
- ctools_include('cleanstring');
-
- $layouts = panels_common_get_allowed_layouts($form_state['allowed_layouts']);
- $categories = array();
- $current = '';
- foreach ($layouts as $id => $layout) {
- $category = ctools_cleanstring($layout['category']);
- // Default category to first in case layout doesn't exist or there isn't one.
- if (empty($current)) {
- $current = $category;
- }
-
- $categories[$category] = $layout['category'];
- $options[$category][$id] = panels_print_layout_icon($id, $layout, check_plain($layout['title']));
-
- // Set current category to what is chosen.
- if ($id == $display->layout) {
- $current = $category;
- }
- }
-
- ctools_add_js('layout', 'panels');
-
- $form['categories'] = array(
- '#title' => t('Category'),
- '#type' => 'select',
- '#options' => $categories,
- '#default_value' => $current,
- );
-
- $form['layout'] = array(
- '#prefix' => '<div class="panels-choose-layout panels-layouts-checkboxes clearfix">',
- '#suffix' => '</div>',
- );
-
- // We set up the dependencies manually because these aren't really form
- // items. It's possible there's a simpler way to do this, but I could not
- // think of one at the time.
- $dependencies = array();
- foreach ($options as $category => $radios) {
- $dependencies['panels-layout-category-' . $category] = array(
- 'values' => array('edit-categories' => array($category)),
- 'num' => 1,
- 'type' => 'hide',
- );
-
- $form['layout'][$category] = array(
- '#prefix' => '<div id="panels-layout-category-' . $category . '-wrapper"><div id="panels-layout-category-' . $category . '" class="form-checkboxes clearfix"><div class="panels-layouts-category">' . $categories[$category] . '</div>',
- '#suffix' => '</div></div>',
- );
-
- foreach ($radios as $key => $choice) {
- // Generate the parents as the autogenerator does, so we will have a
- // unique id for each radio button.
- $form['layout'][$category][$key] = array(
- '#type' => 'radio',
- '#title' => $choice,
- '#parents' => array('layout'),
- '#id' => drupal_clean_css_identifier('edit-layout-' . $key),
- '#return_value' => check_plain($key),
- '#default_value' => in_array($display->layout, array_keys($layouts)) ? $display->layout : NULL,
- );
- }
- }
-
- ctools_add_js('dependent');
- $js['CTools']['dependent'] = $dependencies;
- drupal_add_js($js, 'setting');
-
-
- if (empty($form_state['no buttons'])) {
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Next'),
- );
- }
-
- return $form;
-}
-
-/**
- * Handle form submission of the display layout editor.
- */
-function panels_choose_layout_submit($form, &$form_state) {
- $form_state['layout'] = $form_state['values']['layout'];
-}
-
-/**
- * Form definition for the display layout converter.
- *
- * This form is only triggered if the user attempts to change the layout
- * for a display that has already had content assigned to it. It allows
- * the user to select where the panes located in to-be-deleted panels should
- * be relocated to.
- *
- * @ingroup forms
- *
- * @param array $form
- * A structured FAPI $form array.
- * @param &$form_state
- * The Drupal $form_state
- */
-function panels_change_layout($form, &$form_state) {
- $display = &$form_state['display'];
-
- $new_layout = panels_get_layout($form_state['layout']);
- $new_layout_panels = panels_get_regions($new_layout, $display);
-
- $options = $new_layout_panels;
- $keys = array_keys($options);
- $default = current($options);
-
- $old_layout = panels_get_layout($display->layout);
-
- $form['container'] = array(
- '#prefix' => '<div class="change-layout-display clearfix">',
- '#suffix' => '</div>',
- );
-
- $form['container']['old_layout'] = array(
- '#markup' => panels_print_layout_icon($display->layout, $old_layout, check_plain($old_layout['title'])),
- );
-
- $form['container']['right_arrow'] = array(
- '#markup' => theme('image', array('path' => drupal_get_path('module', 'panels') . '/images/go-right.png')),
- );
- $form['container']['new_layout'] = array(
- '#markup' => panels_print_layout_icon($form_state['layout'], $new_layout, check_plain($new_layout['title'])),
- );
-
- $form['old'] = array(
- '#tree' => true,
- '#prefix' => '<div class="panels-layout-list">',
- '#suffix' => '</div>',
- );
-
- $old_layout_panels = panels_get_regions($old_layout, $display);
- if (empty($display->panels)) {
- $form['old'] = array(
- '#prefix' => '<div>',
- '#markup' => t('There is no content in the panel display. If there were content, you would be given an opportunity to select where in the new layout the old content would be placed. Select "Save" or "Continue" to proceed. This change will not be processed if you do not continue.'),
- '#suffix' => '</div>',
- );
- }
-
- foreach ($display->panels as $id => $content) {
- $form['old'][$id] = array(
- '#type' => 'select',
- '#title' => t('Move content in @layout to', array('@layout' => $old_layout_panels[$id])),
- '#options' => $options,
- '#default_value' => array_key_exists($id, $options) ? $id : $default,
- );
- }
-
- if (empty($form_state['no buttons'])) {
- $form['back'] = array(
- '#type' => 'submit',
- '#value' => t('Back'),
- '#submit' => array('panels_choose_layout_back'),
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => $form_state['finish'],
- '#submit' => array('panels_change_layout_submit'),
- '#save-display' => TRUE,
- );
- }
- return $form;
-}
-
-/**
- * Handle submission of the change layout form.
- *
- * This submit handler will move panes around and save the display.
- */
-function panels_change_layout_submit($form, &$form_state) {
- $display = &$form_state['display'];
-
- if (!empty($form_state['values']['old'])) {
- foreach ($form_state['values']['old'] as $id => $new_id) {
- if (isset($display->panels[$id])) {
- if (!isset($content[$new_id])) {
- $content[$new_id] = array();
- }
- $content[$new_id] = array_merge($content[$new_id], $display->panels[$id]);
- }
- foreach ($content[$new_id] as $pid) {
- $display->content[$pid]->panel = $new_id;
- }
- }
-
- $display->panels = $content;
- }
-
- $display->layout = $form_state['layout'];
-}
-
-/**
- * Handle submission of the change layout form.
- *
- * This submit handler sets a flag on the form state, which is then used
- * by the calling wrapper to restart the process.
- */
-function panels_choose_layout_back($form, &$form_state) {
- $form_state['back'] = TRUE;
-}
diff --git a/includes/legacy.inc b/includes/legacy.inc
deleted file mode 100644
index c65f781..0000000
--- a/includes/legacy.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/**
- * Legacy state manager for Panels.
- *
- * Checks all possible ways (using discovery of patterned method names) in which
- * Panels may need to operate in legacy mode,
- * sets variables as appropriate, and returns an informational
- *
- */
-class PanelsLegacyState {
- var $legacy = NULL;
-
- function t() {
- $func = get_t();
- $args = func_get_args();
- return call_user_func_array($func, $args);
- }
-
- function getStatus() {
- if (!isset($this->legacy)) {
- $this->determineStatus();
- }
- return $this->legacy;
- }
-
- /**
- * Run all compatibility checks.
- */
- function determineStatus() {
- $this->legacy = array();
- foreach(get_class_methods($this) as $method) {
- if (strtolower(substr($method, 0, 5)) == 'check') {
- $this->legacy[$method] = $this->$method();
- }
- }
- $this->legacy = array_filter($this->legacy);
- }
-
- // At this time there are no legacy checks.
-}
diff --git a/includes/page-wizard.inc b/includes/page-wizard.inc
deleted file mode 100644
index 8e087dd..0000000
--- a/includes/page-wizard.inc
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains helper functions for the Panels page wizards.
- */
-
-/**
- * Add layout form helper for panels page wizards.
- *
- * This is not a proper form, it is meant to be called by a form to add
- * elements to it.
- */
-function panels_page_wizard_add_layout(&$form, &$form_state) {
- $form_state['allowed_layouts'] = 'panels_page';
- $form_state['display'] = $form_state['wizard cache']->display;
-
- // Tell the Panels form not to display buttons.
- $form_state['no buttons'] = TRUE;
-
- // Change the #id of the form so the CSS applies properly.
- $form['#id'] = 'panels-choose-layout';
-
- $form['layout_prefix'] = array(
- '#value' => '<fieldset><legend>' . t('Layout') . '</legend>',
- );
-
- ctools_include('common', 'panels');
- ctools_include('display-layout', 'panels');
- ctools_include('plugins', 'panels');
-
- $form = panels_choose_layout($form, $form_state);
-
- $form['layout_suffix'] = array(
- '#value' => '</fieldset>',
- );
-
-// $form_state['cache'] = FALSE;
-}
-
-/**
- * Add content editor form helper for panels page wizards.
- *
- * This is not a proper form, it is meant to be called by a form to add
- * elements to it.
- */
-function panels_page_wizard_add_content(&$form, &$form_state) {
- ctools_include('ajax');
- ctools_include('plugins', 'panels');
- ctools_include('common', 'panels');
- ctools_include('display-edit', 'panels');
-
- // Panels provides this caching mechanism to make it easy to use the
- // wizard to cache the display.
-
- $cache = panels_edit_cache_get('panels_page_wizard:' . $form_state['plugin']['name']);
-
- $form_state['renderer'] = panels_get_renderer_handler('editor', $cache->display);
- $form_state['renderer']->cache = &$cache;
-
- $form_state['display'] = &$cache->display;
- $form_state['content_types'] = $cache->content_types;
- // Tell the Panels form not to display buttons.
- $form_state['no buttons'] = TRUE;
- $form_state['display_title'] = !empty($cache->display_title);
-
- $form = panels_edit_display_form($form, $form_state);
- // Make sure the theme will work since our form id is different.
- $form['#theme'] = 'panels_edit_display_form';
-}
-
-/**
- * Add content form submit handler
- *
- * This is not a proper submit handler, it is meant to be called by a form's
- * submit handler to handle submission.
- */
-function panels_page_wizard_add_content_submit(&$form, &$form_state) {
- // Call the normal panels edit form submit to make sure values are stored
- // on the display
- panels_edit_display_form_submit($form, $form_state);
- $cache = &$form_state['wizard cache'];
-
- // Copy the "being edited" cached display to the "actual" cached display.
- $cache->display = &$form_state['display'];
- unset($cache->display_cache);
-}
-
diff --git a/includes/panels.pipelines.inc b/includes/panels.pipelines.inc
deleted file mode 100644
index d2c20c5..0000000
--- a/includes/panels.pipelines.inc
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
- * @file
- * Bulk export of panels_layouts objects generated by Bulk export module.
- */
-
-/**
- * Implementation of hook_default_panels_layout()
- */
-function panels_default_panels_renderer_pipeline() {
- $pipelines = array();
-
- $pipeline = new stdClass;
- $pipeline->disabled = FALSE; /* Edit this to true to make a default pipeline disabled initially */
- $pipeline->api_version = 1;
- $pipeline->name = 'standard';
- $pipeline->admin_title = t('Standard');
- $pipeline->admin_description = t('Renders a panel normally. This is the most common option.');
- $pipeline->weight = -100;
- $pipeline->settings = array(
- 'renderers' => array(
- 0 => array(
- 'access' => array(),
- 'renderer' => 'standard',
- 'options' => array(),
- ),
- ),
- );
- $pipelines[$pipeline->name] = $pipeline;
-
- return $pipelines;
-}
diff --git a/includes/plugins.inc b/includes/plugins.inc
deleted file mode 100644
index 771a9d7..0000000
--- a/includes/plugins.inc
+++ /dev/null
@@ -1,495 +0,0 @@
-<?php
-
-/**
- * @file
- *
- * Contains helper code for plugins and contexts.
- */
-
-/**
- * Determine if a pane is visible.
- *
- * @param $pane
- * The pane object to test for access.
- * @param $display
- * The display object containing the pane object to be tested.
- */
-function panels_pane_access($pane, $display) {
- ctools_include('context');
- return ctools_access($pane->access, $display->context);
-}
-
-/**
- * Get a list of panels available in the layout.
- */
-function panels_get_regions($layout, $display) {
- if ($function = ctools_plugin_get_function($layout, 'regions function')) {
- return $function($display, $display->layout_settings, $layout);
- }
-
- if (!empty($layout['regions'])) {
- return $layout['regions'];
- }
-
- return array();
-}
-
-/**
- * Get cached content for a given display and possibly pane.
- *
- * @return
- * The cached content, or FALSE to indicate no cached content exists.
- */
-function panels_get_cached_content($display, $args, $context, $pane = NULL) {
- // Never use cache on a POST
- if (!empty($_POST)) {
- return FALSE;
- }
-
- $method = $pane ? $pane->cache['method'] : $display->cache['method'];
- $function = panels_plugin_get_function('cache', $method, 'cache get');
-
- if (!$function) {
- return FALSE;
- }
-
- $conf = $pane ? $pane->cache['settings'] : $display->cache['settings'];
- $cache = $function($conf, $display, $args, $context, $pane);
- if (empty($cache)) {
- return FALSE;
- }
-
- // restore it.
- $cache->restore();
- return $cache;
-}
-
-/**
- * Store cached content for a given display and possibly pane.
- */
-function panels_set_cached_content($cache, $display, $args, $context, $pane = NULL) {
- // Never use cache on a POST
- if (!empty($_POST)) {
- return FALSE;
- }
-
- $method = $pane ? $pane->cache['method'] : $display->cache['method'];
- $function = panels_plugin_get_function('cache', $method, 'cache set');
-
- if (!$function) {
- return FALSE;
- }
-
- $conf = $pane ? $pane->cache['settings'] : $display->cache['settings'];
-
- // snapshot it.
- $cache->cache();
- return $function($conf, $cache, $display, $args, $context, $pane);
-}
-
-/**
- * Clear all cached content for a display.
- */
-function panels_clear_cached_content($display) {
- // Figure out every method we might be using to cache content in this display:
- $methods = array();
- if (!empty($display->cache['method'])) {
- $methods[$display->cache['method']] = TRUE;
- }
-
- foreach ($display->content as $pane) {
- if (!empty($pane->cache['method'])) {
- $methods[$pane->cache['method']] = TRUE;
- }
- }
-
- foreach (array_keys($methods) as $method) {
- $function = panels_plugin_get_function('cache', $method, 'cache clear');
- if ($function) {
- $function($display);
- }
- }
-}
-
-/**
- * An object to hold caching information while it is happening.
- */
-class panels_cache_object {
- var $content = '';
- var $head = NULL;
- var $css = NULL;
- var $js = NULL;
- var $tokens = NULL;
- var $ready = FALSE;
-
- /**
- * When constructed, take a snapshot of our existing out of band data.
- */
- function panels_cache_object() {
- $this->head = drupal_add_html_head();
- $this->css = drupal_add_css();
- $this->tokens = ctools_set_page_token();
-
- foreach (array('header', 'footer') as $scope) {
- $this->js[$scope] = drupal_add_js(NULL, NULL, $scope);
- }
- }
-
- /**
- * Add content to the cache. This assumes a pure stream;
- * use set_content() if it's something else.
- */
- function add_content($content) {
- $this->content .= $content;
- }
-
- function set_content($content) {
- $this->content = $content;
- }
-
- /**
- * Set the object for storing. This overwrites.
- */
- function cache() {
- if ($this->ready) {
- return;
- }
-
- $this->ready = TRUE;
-
- // Simple replacement for head
- $this->head = str_replace($this->head, '', drupal_add_html_head());
-
- // Slightly less simple for CSS:
- $css = drupal_add_css();
- $start = $this->css;
- $this->css = array();
-
- foreach ($css as $name => $data) {
- if (!isset($start[$name])) {
- $this->css[$name] = array($data['data'], $data['type'], $data['media'], $data['preprocess']);
- }
- }
-
- $js = array();
- // A little less simple for js
- foreach (array('header', 'footer') as $scope) {
- $js[$scope] = drupal_add_js(NULL, NULL, $scope);
- }
-
- $start = $this->js;
- $this->js = array();
-
- foreach ($js as $scope => $scopes) {
- foreach ($scopes as $type => $types) {
- foreach ($types as $id => $info) {
- if (!isset($start[$scope][$type][$id])) {
- switch ($type) {
- case 'setting':
- $this->js[] = array($info, $type, $scope);
- break;
-
- case 'inline':
- $this->js[] = array($info['code'], $type, $scope, $info['defer']);
- break;
-
- default:
- $this->js[] = array($id, $type, $scope, $info['defer'], $info['cache']);
- }
- }
- }
- }
- }
-
- // And for tokens:
- $tokens = ctools_set_page_token();
- foreach ($this->tokens as $token => $argument) {
- if (isset($tokens[$token])) {
- unset($tokens);
- }
- }
-
- $this->tokens = $tokens;
- }
-
- /**
- * Restore out of band data saved to cache.
- */
- function restore() {
- if (!empty($this->head)) {
- drupal_add_html_head($this->head);
- }
- if (!empty($this->css)) {
- foreach ($this->css as $args) {
- call_user_func_array('drupal_add_css', $args);
- }
- }
- if (!empty($this->js)) {
- foreach ($this->js as $args) {
- call_user_func_array('drupal_add_js', $args);
- }
- }
-
- if (!empty($this->tokens)) {
- foreach ($this->tokens as $token => $key) {
- list($type, $argument) = $key;
- ctools_set_page_token($token, $type, $argument);
- }
- }
- }
-}
-
-/**
- * Get the title of a pane.
- *
- * @deprecated @todo this function should be removed.
- *
- * @param $pane
- * The $pane object.
- */
-function panels_get_pane_title(&$pane, $context = array(), $incoming_content = NULL) {
- ctools_include('content');
- return ctools_content_admin_title($pane->type, $pane->subtype, $pane->configuration, $context);
-}
-
-/**
- * Fetch metadata on a specific layout plugin.
- *
- * @param $layout
- * Name of a panel layout. If the layout name contains a ':' this
- * indicates that we need to separate the sublayout out and
- * load it individually.
- *
- * @return
- * An array with information about the requested panel layout.
- */
-function panels_get_layout($layout) {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'layouts', $layout);
-}
-
-/**
- * Fetch metadata for all layout plugins.
- *
- * @return
- * An array of arrays with information about all available panel layouts.
- */
-function panels_get_layouts() {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'layouts');
-}
-
-/**
- * Fetch metadata for all layout plugins that provide builders.
- *
- * The layout builders allow reusable layouts be stored in the database and
- * exported. Since there are different methods, we are not limiting this
- * to just one plugin.
- *
- * @return
- * An array of arrays with information about panel layouts with builders.
- */
-function panels_get_layout_builders() {
- ctools_include('plugins');
- $plugins = ctools_get_plugins('panels', 'layouts');
- $builders = array();
- foreach ($plugins as $name => $plugin) {
- if (!empty($plugin['builder'])) {
- $builders[$name] = $plugin;
- }
- }
-
- return $builders;
-}
-
-/**
- * Fetch metadata on a specific style plugin.
- *
- * @param $style
- * Name of a panel style.
- *
- * @return
- * An array with information about the requested panel style.
- */
-function panels_get_style($style) {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'styles', $style);
-}
-
-/**
- * Fetch metadata for all style plugins.
- *
- * @return
- * An array of arrays with information about all available panel styles.
- */
-function panels_get_styles() {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'styles');
-}
-
-/**
- * Fetch metadata on a specific caching plugin.
- *
- * @param $cache
- * Name of a panel cache.
- *
- * @return
- * An array with information about the requested panel cache.
- */
-function panels_get_cache($cache) {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'cache', $cache);
-}
-
-/**
- * Fetch metadata for all context plugins.
- *
- * @return
- * An array of arrays with information about all available panel caches.
- */
-function panels_get_caches() {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'cache');
-}
-
-/**
- * Fetch metadata on a specific display renderer plugin.
- *
- * @return
- * An array of arrays with information about the requested panels display
- * renderer.
- */
-function panels_get_display_renderer($renderer) {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'display_renderers', $renderer);
-}
-
-/**
- * Fetch metadata for all display renderer plugins.
- *
- * @return
- * An array of arrays with information about all available panels display
- * renderer.
- */
-function panels_get_display_renderers() {
- ctools_include('plugins');
- return ctools_get_plugins('panels', 'display_renderers');
-}
-
-/**
- * Get and initialize the class to handle rendering a display.
- *
- * @return
- * Either the instantiated renderer or FALSE if one could not be found.
- */
-function panels_get_renderer_handler($plugin, &$display) {
- if (is_string($plugin)) {
- $plugin = panels_get_display_renderer($plugin);
- }
-
- $class = ctools_plugin_get_class($plugin, 'renderer');
- if ($class) {
- $renderer = new $class();
- $renderer->init($plugin, $display);
- return $renderer;
- }
-
- return FALSE;
-}
-
-/**
- * Choose a renderer for a display based on a render pipeline setting.
- */
-function panels_get_renderer($pipeline_name, &$display) {
- // Load the pipeline
- ctools_include('export');
- $pipeline = ctools_export_crud_load('panels_renderer_pipeline', $pipeline_name);
-
- // If we can't, or it has no renderers, default.
- if (!$pipeline || empty($pipeline->settings['renderers'])) {
- return panels_get_renderer_handler('standard', $display);
- }
-
- // Get contexts set on the pipeline:
- $contexts = array();
- if (!empty($pipeline->settings['contexts'])) {
- $contexts = ctools_context_load_contexts($pipeline->settings['context']);
- }
-
- // Cycle through our renderers and see.
- foreach ($pipeline->settings['renderers'] as $candidate) {
- // See if this passes selection criteria.
- if (!ctools_access($candidate['access'], $contexts)) {
- continue;
- }
-
- $renderer = panels_get_renderer_handler($candidate['renderer'], $display);
-
- if (!empty($candidate['options'])) {
- $renderer->set_options($candidate['options']);
- }
-
- return $renderer;
- }
-
- // Fall through. If no renderer is selected, use the standard renderer
- return panels_get_renderer_handler('standard', $display);
-}
-
-/**
- * Sort callback for sorting renderer pipelines.
- *
- * Sort first by weight, then by title.
- */
-function _panels_renderer_pipeline_sort($a, $b) {
- if ($a->weight == $b->weight) {
- if ($a->admin_title == $b->admin_title) {
- return 0;
- }
- return ($a->admin_title < $b->admin_title) ? -1 : 1;
- }
- return ($a->weight < $b->weight) ? -1 : 1;
-}
-
-/**
- * Get a list of available renderer pipelines.
- *
- * This can be used to form a select or radios widget by enabling
- * sorting. Descriptions are left in.
- */
-function panels_get_renderer_pipelines($sort = TRUE) {
- ctools_include('export');
- $pipelines = ctools_export_crud_load_all('panels_renderer_pipeline');
- if ($sort) {
- uasort($pipelines, '_panels_renderer_pipeline_sort');
- }
-
- return $pipelines;
-}
-
-/**
- * Get a function from a plugin, if it exists.
- *
- * @param $plugin
- * The type of plugin
- * @param $which
- * Either the loaded plugin object (or the same data in array form)
- * or a string with the name of the desired the specific plugin.
- * @param $function_name
- * The identifier of the function. For example, 'settings form'.
- *
- * @return
- * The actual name of the function to call, or NULL if the function
- * does not exist.
- *
- * @deprecated All calls to this function should be removed.
- */
-function panels_plugin_get_function($plugin, $which, $function_name) {
- ctools_include('plugins');
- if (is_object($which) || is_array($which)) {
- return ctools_plugin_get_function($which, $function_name);
- }
- else {
- return ctools_plugin_load_function('panels', $plugin, $which, $function_name);
- }
-}
diff --git a/js/display_editor.js b/js/display_editor.js
deleted file mode 100644
index e9554e8..0000000
--- a/js/display_editor.js
+++ /dev/null
@@ -1,523 +0,0 @@
-/**
- * @file display_editor.js
- *
- * Contains the javascript for the Panels display editor.
- */
-
-(function ($) {
-
-/** Delete pane button **/
-Drupal.Panels.bindClickDelete = function(context) {
- $('a.pane-delete:not(.pane-delete-processed)', context)
- .addClass('pane-delete-processed')
- .click(function() {
- if (confirm('Remove this pane?')) {
- var id = '#' + $(this).attr('id').replace('pane-delete-', '');
- $(id).remove();
- Drupal.Panels.Draggable.savePositions();
- }
- return false;
- });
-};
-
-Drupal.Panels.bindPortlet = function() {
- var handle = $(this).find('.panel-pane-collapsible > div.pane-title');
- var content = $(this).find('.panel-pane-collapsible > div.pane-content');
- if (content.length) {
- var toggle = $('<span class="toggle toggle-collapsed"></span>');
- handle.before(toggle);
- toggle.click(function() {
- content.slideToggle(20);
- toggle.toggleClass('toggle-collapsed');
- });
- handle.click(function() {
- content.slideToggle(20);
- toggle.toggleClass('toggle-collapsed');
- });
- content.hide();
- }
-};
-
-Drupal.Panels.Draggable = {
- // The draggable object
- object: null,
-
- // Where objects can be dropped
- dropzones: [],
- current_dropzone: null,
-
- // positions within dropzones where an object can be plazed
- landing_pads: [],
- current_pad: null,
-
- // Where the object is
- mouseOffset: { x: 0, y: 0 },
- windowOffset: { x: 0, y: 0 },
- offsetDivHeight: 0,
-
- // original settings to be restored
- original: {},
- // a placeholder so that if the object is let go but not over a drop zone,
- // it can be put back where it belongs
- placeholder: {},
-
- hoverclass: 'hoverclass',
- helperclass: 'helperclass',
- accept: 'div.panels-display',
- handle: 'div.grabber',
- draggable: 'div.panel-portlet',
- main: 'div#panels-dnd-main',
-
- // part of the id to remove to get just the number
- draggableId: 'panel-pane-',
- // What to add to the front of a the id to get the form id for a panel
- formId: 'input#edit-',
-
- maxWidth: 250,
-
- unsetDropZone: function() {
- $(this.current_dropzone.obj).removeClass(this.hoverclass);
- this.current_dropzone = null;
- for (var i in this.landing_pads) {
- $(this.landing_pads[i].obj).remove();
- }
- this.landing_pads = [];
- this.current_pad = null;
- },
-
- createLandingPad: function(where, append) {
- var obj = $('<div class="' + this.helperclass +'" id="' +
- $(where).attr('id') + '-dropzone">&nbsp;</div>');
- if (append) {
- $(where).append(obj);
- }
- else {
- $(where).before(obj);
- }
- var offset = $(obj).offset();
-
- $(obj).css({
- display: 'none'
- });
- this.landing_pads.push({
- centerX: offset.left + ($(obj).innerWidth() / 2),
- centerY: offset.top + ($(obj).innerHeight() / 2),
- obj: obj
- });
- return obj;
- },
-
- calculateDropZones: function(event, dropzone) {
- var dropzones = [];
- $(this.accept).each(function() {
- var offset = $(this).offset();
- offset.obj = this;
- offset.width = $(this).outerWidth();
- offset.height = $(this).outerHeight();
- dropzones.push(offset);
- });
- this.dropzones = dropzones;
- },
-
- reCalculateDropZones: function() {
- for (var i in this.dropzones) {
- offset = $(this.dropzones[i].obj).offset({padding:true});
- offset.width = $(this.dropzones[i].obj).outerWidth();
- offset.height = $(this.dropzones[i].obj).outerHeight();
- $.extend(this.dropzones[i], offset);
- }
- },
-
- changeDropZone: function(new_dropzone) {
- // Unset our old dropzone.
- if (this.current_dropzone) {
- this.unsetDropZone();
- }
-
- // Set up our new dropzone.
- this.current_dropzone = new_dropzone;
- $(this.current_dropzone.obj).addClass(this.hoverclass);
- // add a landing pad
- this.createLandingPad(this.current_dropzone.obj, true);
-
- var that = this;
- // Create a landing pad before each existing portlet.
- $(this.current_dropzone.obj).find(this.draggable).each(function() {
- if (that.object.id != this.id) {
- that.createLandingPad(this, false);
- }
- });
- },
-
- findLandingPad: function(x, y) {
- var shortest_distance = null;
- var nearest_pad = null;
- // find the nearest pad.
- for (var i in this.landing_pads) {
- // This isn't the real distance, this is the square of the
- // distance -- no point in spending processing time on
- // sqrt.
- var dstx = Math.abs(x - this.landing_pads[i].centerX);
- var dsty = Math.abs(y - this.landing_pads[i].centerY);
- var distance = (dstx * dstx) + (dsty * dsty);
- if (shortest_distance == null || distance < shortest_distance) {
- shortest_distance = distance;
- nearest_pad = this.landing_pads[i];
- }
- }
- if (nearest_pad != this.current_pad) {
- if (this.current_pad) {
- $(this.current_pad.obj).hide();
- }
- this.current_pad = nearest_pad;
- $(nearest_pad.obj).show();
- }
- },
-
- findDropZone: function(x, y) {
- // Go through our dropzones and see if we're over one.
- var new_dropzone = null;
- for (var i in this.dropzones) {
-// console.log('x:' + x + ' left:' + this.dropzones[i].left + ' right: ' + this.dropzones[i].left + this.dropzones[i].width);
- if (this.dropzones[i].left < x &&
- x < this.dropzones[i].left + this.dropzones[i].width &&
- this.dropzones[i].top < y &&
- y < this.dropzones[i].top + this.dropzones[i].height) {
- new_dropzone = this.dropzones[i];
- break;
- }
- }
- // If we're over one, see if it's different.
- if (new_dropzone) {
- var changed = false;
- if (!this.current_dropzone || new_dropzone.obj.id != this.current_dropzone.obj.id) {
- this.changeDropZone(new_dropzone);
- changed = true;
- }
- this.findLandingPad(x, y);
- if (changed) {
- // recalculate the size of our drop zones due to the fact that we're drawing landing pads.
- this.reCalculateDropZones();
- }
- }
- // If we're not over one, be sure to unhilite one if we were just
- // over it.
- else if (this.current_dropzone) {
- this.unsetDropZone();
- }
- },
-
- /** save button clicked, or pane deleted **/
- savePositions: function() {
- var draggable = Drupal.Panels.Draggable;
- $(draggable.accept).each(function() {
- var val = '';
- $(this).find(draggable.draggable).each(function() {
- if (val) {
- val += ',';
- }
-
- val += this.id.replace(draggable.draggableId, '');
- });
- var region = this.id.replace('panel-pane-', '');
- $('input[name="panel[pane][' + region + ']"]').val(val);
- });
- return false;
- }
-};
-
-Drupal.Panels.DraggableHandler = function() {
- $(this).addClass('panel-draggable');
- var draggable = Drupal.Panels.Draggable;
- var scrollBuffer = 10;
- var scrollDistance = 10;
- var scrollTimer = 30;
-
- getMouseOffset = function(docPos, mousePos, windowPos) {
- return { x: mousePos.x - docPos.x + windowPos.x, y: mousePos.y - docPos.y + windowPos.y};
- };
-
- getMousePos = function(ev) {
- ev = ev || window.event;
-
- if (ev.pageX || ev.pageY) {
- return { x:ev.pageX, y:ev.pageY };
- }
- return {
- x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
- y:ev.clientY + document.body.scrollTop - document.body.clientTop
- };
- };
-
- getPosition = function(e) {
- /*
- if (document.defaultView && document.defaultView.getComputedStyle) {
- var css = document.defaultView.getComputedStyle(e, null);
- return {
- x: parseInt(css.getPropertyValue('left')),
- y: parseInt(css.getPropertyValue('top'))
- };
- }
- */
- var left = 0;
- var top = 0;
-
- while (e.offsetParent) {
- left += e.offsetLeft;
- top += e.offsetTop;
- e = e.offsetParent;
- }
-
- left += e.offsetLeft;
- top += e.offsetTop;
-
- return { x:left, y:top };
- };
-
- mouseUp = function(e) {
- clearTimeout(draggable.timeoutId);
- draggable.dropzones = [];
-
- if (draggable.current_pad) {
- // Drop the object where we're hovering
- $(draggable.object).insertAfter($(draggable.current_pad.obj));
- Drupal.Panels.changed($(draggable.object));
- }
- else {
- // or put it back where it came from
- $(draggable.object).insertAfter(draggable.placeholder);
- }
- // remove the placeholder
- draggable.placeholder.remove();
-
- // restore original settings.
- $(draggable.object).css(draggable.original);
- if (draggable.current_dropzone) {
- draggable.unsetDropZone();
- }
-
- $(document).unbind('mouseup').unbind('mousemove');
- draggable.savePositions();
- };
-
- mouseMove = function(e) {
- draggable.mousePos = getMousePos(e);
-
- draggable.findDropZone(draggable.mousePos.x, draggable.mousePos.y);
-
- var windowMoved = parseInt(draggable.offsetDivHeight - $(draggable.main).innerHeight());
-
- draggable.object.style.top = draggable.mousePos.y - draggable.mouseOffset.y + windowMoved + 'px';
- draggable.object.style.left = draggable.mousePos.x - draggable.mouseOffset.x + 'px';
- $(draggable.object).toggleClass('moving');
- };
-
- mouseDown = function(e) {
- // If we mouse-downed over something clickable, don't drag!
- if (e.target.nodeName == 'A' || e.target.nodeName == 'INPUT' || e.target.parentNode.nodeName == 'A' || e.target.nodeName.nodeName == 'INPUT') {
- return;
- }
-
- draggable.object = $(this).parent(draggable.draggable).get(0);
-
- // create a placeholder so we can put this object back if dropped in an invalid location.
- draggable.placeholder = $('<div class="draggable-placeholder-object" style="display:none"></div>"');
- $(draggable.object).after(draggable.placeholder);
-
- // Store original CSS so we can put it back.
- draggable.original = {
- position: $(draggable.object).css('position'),
- width: 'auto',
- left: $(draggable.object).css('left'),
- top: $(draggable.object).css('top'),
- 'z-index': $(draggable.object).css('z-index'),
- 'margin-bottom': $(draggable.object).css('margin-bottom'),
- 'margin-top': $(draggable.object).css('margin-top'),
- 'margin-left': $(draggable.object).css('margin-left'),
- 'margin-right': $(draggable.object).css('margin-right'),
- 'padding-bottom': $(draggable.object).css('padding-bottom'),
- 'padding-top': $(draggable.object).css('padding-top'),
- 'padding-left': $(draggable.object).css('padding-left'),
- 'padding-right': $(draggable.object).css('padding-right')
- };
-
- draggable.mousePos = getMousePos(e);
- var originalPos = $(draggable.object).offset();
- var width = Math.min($(draggable.object).innerWidth(), draggable.maxWidth);
-
- draggable.offsetDivHeight = $(draggable.main).innerHeight();
- draggable.findDropZone(draggable.mousePos.x, draggable.mousePos.y);
-
- // Make copies of these because in FF3, they actually change when we
- // move the item, whereas they did not in FF2.
-
- if (e.layerX || e.layerY) {
- var layerX = e.layerX;
- var layerY = e.layerY;
- }
- else if (e.originalEvent && e.originalEvent.layerX) {
- var layerX = e.originalEvent.layerX;
- var layerY = e.originalEvent.layerY;
- }
-
- // Make the draggable relative, get it out of the way and make it
- // invisible.
- $(draggable.object).css({
- position: 'relative',
- 'z-index': 100,
- width: width + 'px',
- 'margin-bottom': (-1 * parseInt($(draggable.object).outerHeight())) + 'px',
- 'margin-top': 0,
- 'margin-left': 0,
- 'margin-right': (-1 * parseInt($(draggable.object).outerWidth())) + 'px',
- 'padding-bottom': 0,
- 'padding-top': 0,
- 'padding-left': 0,
- 'padding-right': 0,
- 'left': 0,
- 'top': 0
- })
- .insertAfter($(draggable.main));
- var newPos = $(draggable.object).offset();
-
- var windowOffset = { left: originalPos.left - newPos.left, top: originalPos.top - newPos.top }
-
- // if they grabbed outside the area where we make the draggable smaller, move it
- // closer to the cursor.
- if (layerX != 'undefined' && layerX > width) {
- windowOffset.left += layerX - 10;
- }
- else if (layerX != 'undefined' && e.offsetX > width) {
- windowOffset.left += e.offsetX - 10;
- }
-
- // This is stored so we can move with it.
- draggable.mouseOffset = { x: draggable.mousePos.x - windowOffset.left, y: draggable.mousePos.y - windowOffset.top};
- draggable.offsetDivHeight = $(draggable.main).innerHeight();
-
- draggable.object.style.top = windowOffset.top + 'px';
- draggable.object.style.left = windowOffset.left + 'px';
- $(document).unbind('mouseup').unbind('mousemove').mouseup(mouseUp).mousemove(mouseMove);
-
- draggable.calculateDropZones(draggable.mousePos, e);
- draggable.timeoutId = setTimeout('timer()', scrollTimer);
- return false;
- };
-
- timer = function() {
- if (!draggable.timeCount) {
- draggable.timeCount = 0;
- }
- draggable.timeCount = draggable.timeCount + 1;
- var left = $(window).scrollLeft();
- var right = left + $(window).width();
- var top = $(window).scrollTop();
- var bottom = top + $(window).height();
-
- if (draggable.mousePos.x < left + scrollBuffer && left > 0) {
- window.scrollTo(left - scrollDistance, top);
- draggable.mousePos.x -= scrollDistance;
- draggable.object.style.top = draggable.mousePos.y - draggable.mouseOffset.y + 'px';
- }
- else if (draggable.mousePos.x > right - scrollBuffer) {
- window.scrollTo(left + scrollDistance, top);
- draggable.mousePos.x += scrollDistance;
- draggable.object.style.top = draggable.mousePos.y - draggable.mouseOffset.y + 'px';
- }
- else if (draggable.mousePos.y < top + scrollBuffer && top > 0) {
- window.scrollTo(left, top - scrollDistance);
- draggable.mousePos.y -= scrollDistance;
- draggable.object.style.top = draggable.mousePos.y - draggable.mouseOffset.y + 'px';
- }
- else if (draggable.mousePos.y > bottom - scrollBuffer) {
- window.scrollTo(left, top + scrollDistance);
- draggable.mousePos.y += scrollDistance;
- draggable.object.style.top = draggable.mousePos.y - draggable.mouseOffset.y + 'px';
- }
-
- draggable.timeoutId = setTimeout('timer()', scrollTimer);
- }
-
- $(this).mousedown(mouseDown);
-};
-
-$.fn.extend({
- panelsDraggable: Drupal.Panels.DraggableHandler
-});
-
-/**
- * Implement Drupal behavior for autoattach
- */
-Drupal.behaviors.PanelsDisplayEditor = {
- attach: function(context) {
- // Show javascript only items.
- $('span#panels-js-only').css('display', 'inline');
-
- $('#panels-dnd-main div.panel-pane:not(.panel-portlet)')
- .addClass('panel-portlet')
- .each(Drupal.Panels.bindPortlet);
-
- // The above doesn't work if context IS the pane, so do this to catch that.
- if ($(context).hasClass('panel-pane') && !$(context).hasClass('panel-portlet')) {
- $(context)
- .addClass('panel-portlet')
- .each(Drupal.Panels.bindPortlet);
- }
-
- // Make draggables and make sure their positions are saved.
- $(context).find('div.grabber:not(.panel-draggable)').panelsDraggable();
- Drupal.Panels.Draggable.savePositions();
-
- // Bind buttons.
- $('input#panels-hide-all', context).click(Drupal.Panels.clickHideAll);
- $('input#panels-show-all', context).click(Drupal.Panels.clickShowAll);
-
- Drupal.Panels.bindClickDelete(context);
-
- $('#panels-live-preview-button:not(.panels-preview-processed)')
- .addClass('panels-preview-processed')
- .click(function () {
- if (!$('#panels-preview').size()) {
- $('#panels-dnd-main').parents('form').after('<div id="panels-preview" class="clearfix"></div>');
- }
- var html = '';
- html += ' <div id="modal-throbber">';
- html += ' <div class="modal-throbber-wrapper">';
- html += Drupal.settings.CToolsModal.throbber;
- html += ' </div>';
- html += ' </div>';
-
- $('#panels-preview').html(html);
- });
-
- var setTitleClass = function () {
- if ($('#edit-display-title-hide-title').val() == 2) {
- $('#panels-dnd-main').removeClass('panels-set-title-hide');
- }
- else {
- $('#panels-dnd-main').addClass('panels-set-title-hide');
- }
- }
-
- // The panes have an option to set the display title, but only if
- // a select is set to the proper value. This sets a class on the
- // main edit div so that the option to set the display title
- // is hidden if that is not selected, and visible if it is.
- $('#edit-display-title-hide-title:not(.panels-title-processed)')
- .addClass('panels-title-processed')
- .change(setTitleClass);
-
- setTitleClass();
- }
-}
-
-$(function() {
- /**
- * AJAX responder command to render the preview.
- */
- Drupal.ajax.prototype.commands.panel_preview = function(ajax, command, status) {
- $('#panels-preview').html(command.output);
- }
-});
-
-})(jQuery);
diff --git a/js/layout.js b/js/layout.js
deleted file mode 100644
index e54fd02..0000000
--- a/js/layout.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * @file layout.js
- *
- * Contains javascript to make layout modification a little nicer.
- */
-
-(function ($) {
- Drupal.Panels.Layout = {};
- Drupal.Panels.Layout.autoAttach = function() {
- $('div.form-item div.layout-icon').click(function() {
- $widget = $('input', $(this).parent());
- // Toggle if a checkbox, turn on if a radio.
- $widget.attr('checked', !$widget.attr('checked') || $widget.is('input[type=radio]'));
- });
- };
-
- $(Drupal.Panels.Layout.autoAttach);
-})(jQuery);
diff --git a/js/panels-base.js b/js/panels-base.js
deleted file mode 100644
index 7b0b922..0000000
--- a/js/panels-base.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * @file
- * Implement basic methods required by all of panels.
- */
-
-(function ($) {
- Drupal.Panels = {}
-
- Drupal.Panels.changed = function(item) {
- if (!item.is('.changed')) {
- item.addClass('changed');
- item.find('div.grabber span.text').append(' <span class="star">*</span> ');
- }
- };
-
- Drupal.Panels.restripeTable = function(table) {
- // :even and :odd are reversed because jquery counts from 0 and
- // we count from 1, so we're out of sync.
- $('tbody tr:not(:hidden)', $(table))
- .removeClass('even')
- .removeClass('odd')
- .filter(':even')
- .addClass('odd')
- .end()
- .filter(':odd')
- .addClass('even');
- };
-})(jQuery);
diff --git a/js/panels.js b/js/panels.js
deleted file mode 100644
index 70e8544..0000000
--- a/js/panels.js
+++ /dev/null
@@ -1,28 +0,0 @@
-
-(function ($) {
- Drupal.Panels = {};
-
- Drupal.Panels.autoAttach = function() {
- if ($.browser.msie) {
- // If IE, attach a hover event so we can see our admin links.
- $("div.panel-pane").hover(
- function() {
- $('div.panel-hide', this).addClass("panel-hide-hover"); return true;
- },
- function() {
- $('div.panel-hide', this).removeClass("panel-hide-hover"); return true;
- }
- );
- $("div.admin-links").hover(
- function() {
- $(this).addClass("admin-links-hover"); return true;
- },
- function(){
- $(this).removeClass("admin-links-hover"); return true;
- }
- );
- }
- };
-
- $(Drupal.Panels.autoAttach);
-})(jQuery);
diff --git a/panels.info b/panels.info
deleted file mode 100644
index 70b961d..0000000
--- a/panels.info
+++ /dev/null
@@ -1,11 +0,0 @@
-name = Panels
-description = Core Panels display functions; provides no external UI, at least one other Panels module should be enabled.
-core = 7.x
-package = "Panels"
-configure = admin/structure/panels
-dependencies[] = ctools
-files[] = panels.module
-files[] = includes/common.inc
-files[] = includes/legacy.inc
-files[] = includes/plugins.inc
-files[] = plugins/views/panels_views_plugin_row_fields.inc
diff --git a/panels.install b/panels.install
deleted file mode 100644
index adec403..0000000
--- a/panels.install
+++ /dev/null
@@ -1,322 +0,0 @@
-<?php
-
-/**
- * Test requirements for installation and running.
- */
-function panels_requirements($phase) {
- $function = "panels_requirements_$phase";
- return function_exists($function) ? $function() : array();
-}
-
-/**
- * Check install-time requirements.
- */
-function panels_requirements_install() {
- $requirements = array();
- $t = get_t();
- // Assume that if the user is running an installation profile that both
- // Panels and CTools are the same release.
- if (!(defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install')) {
- // apparently the install process doesn't include .module files,
- // so we need to force the issue in order for our versioning
- // check to work.
- if (!defined('PANELS_REQUIRED_CTOOLS_API')) {
- include_once drupal_get_path('module', 'panels') . '/panels.module';
- }
-
- // In theory we should check module_exists, but Drupal's gating should
- // actually prevent us from getting here otherwise.
- if (!defined('CTOOLS_API_VERSION')) {
- include_once drupal_get_path('module', 'ctools') . '/ctools.module';
- }
- if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- $requirements['panels_ctools'] = array(
- 'title' => $t('CTools API Version'),
- 'value' => CTOOLS_API_VERSION,
- 'severity' => REQUIREMENT_ERROR,
- 'description' => t('The CTools API version is too old for Panels. Panels needs at least %version.', array('%version' => PANELS_REQUIRED_CTOOLS_API))
- );
- }
- }
- return $requirements;
-}
-
-/**
- * Implementation of hook_schema().
- */
-function panels_schema() {
- // This should always point to our 'current' schema. This makes it relatively easy
- // to keep a record of schema as we make changes to it.
- return panels_schema_3();
-}
-
-/**
- * Schema from the D6 version.
- */
-function panels_schema_3() {
- // Schema 3 is now locked. If you need to make changes, please create
- // schema 4 and add them.
- $schema = array();
-
- $schema['panels_display'] = array(
- 'export' => array(
- 'object' => 'panels_display',
- 'bulk export' => FALSE,
- 'export callback' => 'panels_export_display',
- 'can disable' => FALSE,
- 'identifier' => 'display',
- ),
- 'fields' => array(
- 'did' => array(
- 'type' => 'serial',
- 'not null' => TRUE,
- 'no export' => TRUE,
- ),
- 'layout' => array(
- 'type' => 'varchar',
- 'length' => '32',
- 'default' => '',
- ),
- 'layout_settings' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'panel_settings' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'cache' => array(
- 'type' => 'text',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'title' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'default' => '',
- ),
- 'hide_title' => array(
- 'type' => 'int',
- 'size' => 'tiny',
- 'default' => 0,
- 'no export' => TRUE,
- ),
- 'title_pane' => array(
- 'type' => 'int',
- 'default' => 0,
- 'no export' => TRUE,
- ),
- ),
- 'primary key' => array('did'),
- );
-
- $schema['panels_pane'] = array(
- 'export' => array(
- 'can disable' => FALSE,
- 'identifier' => 'pane',
- 'bulk export' => FALSE,
- ),
- 'fields' => array(
- 'pid' => array(
- 'type' => 'serial',
- 'not null' => TRUE,
- ),
- 'did' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- 'no export' => TRUE,
- ),
- 'panel' => array(
- 'type' => 'varchar',
- 'length' => '32',
- 'default' => '',
- ),
- 'type' => array(
- 'type' => 'varchar',
- 'length' => '32',
- 'default' => '',
- ),
- 'subtype' => array(
- 'type' => 'varchar',
- 'length' => '64',
- 'default' => '',
- ),
- 'shown' => array(
- 'type' => 'int',
- 'size' => 'tiny',
- 'default' => 1,
- ),
- 'access' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'configuration' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'cache' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'style' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'css' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'extras' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'initial ' => array(),
- ),
- 'position' => array(
- 'type' => 'int',
- 'size' => 'small',
- 'default' => 0,
- ),
- ),
- 'primary key' => array('pid'),
- 'indexes' => array(
- 'did_idx' => array('did')
- ),
- );
-
- $schema['panels_renderer_pipeline'] = array(
- 'description' => 'Contains renderer pipelines for Panels. Each pipeline contains one or more renderers and access rules to select which renderer gets used.',
- 'export' => array(
- 'identifier' => 'pipeline',
- 'bulk export' => TRUE,
- 'primary key' => 'rpid',
- 'api' => array(
- 'owner' => 'panels',
- 'api' => 'pipelines',
- 'minimum_version' => 1,
- 'current_version' => 1,
- ),
- ),
- 'fields' => array(
- 'rpid' => array(
- 'type' => 'serial',
- 'description' => 'A database primary key to ensure uniqueness.',
- 'not null' => TRUE,
- 'no export' => TRUE,
- ),
- 'name' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'Unique ID for this content. Used to identify it programmatically.',
- ),
- 'admin_title' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'Administrative title for this pipeline.',
- ),
- 'admin_description' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'description' => 'Administrative description for this pipeline.',
- 'object default' => '',
- ),
- 'weight' => array(
- 'type' => 'int',
- 'size' => 'small',
- 'default' => 0,
- ),
- 'settings' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'description' => 'Serialized settings for the actual pipeline. The contents of this field are up to the plugin that uses it.',
- 'serialize' => TRUE,
- 'object default' => array(),
- ),
- ),
- 'primary key' => array('rpid'),
- );
-
- $schema['panels_layout'] = array(
- 'description' => 'Contains exportable customized layouts for this site.',
- 'export' => array(
- 'identifier' => 'layout',
- 'bulk export' => TRUE,
- 'primary key' => 'lid',
- 'api' => array(
- 'owner' => 'panels',
- 'api' => 'layouts',
- 'minimum_version' => 1,
- 'current_version' => 1,
- ),
- ),
- 'fields' => array(
- 'lid' => array(
- 'type' => 'serial',
- 'description' => 'A database primary key to ensure uniqueness.',
- 'not null' => TRUE,
- 'no export' => TRUE,
- ),
- 'name' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'Unique ID for this content. Used to identify it programmatically.',
- ),
- 'admin_title' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'Administrative title for this layout.',
- ),
- 'admin_description' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'description' => 'Administrative description for this layout.',
- 'object default' => '',
- ),
- 'category' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'Administrative category for this layout.',
- ),
- 'plugin' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'The layout plugin that owns this layout.',
- ),
- 'settings' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'description' => 'Serialized settings for the actual layout. The contents of this field are up to the plugin that uses it.',
- 'serialize' => TRUE,
- 'object default' => array(),
- ),
- ),
- 'primary key' => array('lid'),
- );
-
- return $schema;
-}
-
diff --git a/panels.module b/panels.module
deleted file mode 100644
index f5f4cce..0000000
--- a/panels.module
+++ /dev/null
@@ -1,1660 +0,0 @@
-<?php
-
-/**
- * @file panels.module
- *
- * Core functionality for the Panels engine.
- */
-
-define('PANELS_REQUIRED_CTOOLS_API', '2.0-alpha');
-
-define('PANELS_TITLE_FIXED', 0); // Hide title use to be true/false. So false remains old behavior.
-define('PANELS_TITLE_NONE', 1); // And true meant no title.
-define('PANELS_TITLE_PANE', 2); // And this is the new behavior, where the title field will pick from a pane.
-
-/**
- * Returns the API version of Panels. This didn't exist in 1.
- *
- * @todo -- this should work more like the CTools API version.
- *
- * @return An array with the major and minor versions
- */
-function panels_api_version() {
- return array(3, 1);
-}
-
-// --------------------------------------------------------------------------
-// Core Drupal hook implementations
-
-/**
- * Implementation of hook_theme()
- */
-function panels_theme() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return array();
- }
-
- $theme = array();
- $theme['panels_layout_link'] = array(
- 'variables' => array('title' => NULL, 'id' => NULL, 'image' => NULL, 'link' => NULL),
- );
- $theme['panels_layout_icon'] = array(
- 'variables' => array('id' => NULL, 'image' => NULL, 'title' => NULL),
- );
- $theme['panels_pane'] = array(
- 'variables' => array('output' => array(), 'pane' => array(), 'display' => array()),
- 'path' => drupal_get_path('module', 'panels') . '/templates',
- 'template' => 'panels-pane',
- );
- $theme['panels_common_content_list'] = array(
- 'variables' => array('display' => NULL),
- 'file' => 'includes/common.inc',
- );
- $theme['panels_render_display_form'] = array(
- 'variables' => array('form' => NULL),
- );
-
- $theme['panels_dashboard'] = array(
- 'variables' => array(),
- 'path' => drupal_get_path('module', 'panels') . '/templates',
- 'file' => '../includes/callbacks.inc',
- 'template' => 'panels-dashboard',
- );
-
- $theme['panels_dashboard_link'] = array(
- 'variables' => array('link' => array()),
- 'path' => drupal_get_path('module', 'panels') . '/templates',
- 'file' => '../includes/callbacks.inc',
- 'template' => 'panels-dashboard-link',
- );
-
- $theme['panels_dashboard_block'] = array(
- 'variables' => array('block' => array()),
- 'path' => drupal_get_path('module', 'panels') . '/templates',
- 'file' => '../includes/callbacks.inc',
- 'template' => 'panels-dashboard-block',
- );
-
- // We don't need layout and style themes in maintenance mode.
- if (defined('MAINTENANCE_MODE')) {
- return $theme;
- }
-
- // Register layout and style themes on behalf of all of these items.
- ctools_include('plugins', 'panels');
-
- // No need to worry about files; the plugin has to already be loaded for us
- // to even know what the theme function is, so files will be auto included.
- $layouts = panels_get_layouts();
- foreach ($layouts as $name => $data) {
- foreach (array('theme', 'admin theme') as $callback) {
- if (!empty($data[$callback])) {
- $theme[$data[$callback]] = array(
- 'variables' => array('css_id' => NULL, 'content' => NULL, 'settings' => NULL, 'display' => NULL, 'layout' => NULL, 'renderer' => NULL),
- 'path' => $data['path'],
- 'file' => $data['file'],
- );
-
- // if no theme function exists, assume template.
- if (!function_exists("theme_$data[theme]")) {
- $theme[$data[$callback]]['template'] = str_replace('_', '-', $data[$callback]);
- $theme[$data[$callback]]['file'] = $data['file']; // for preprocess.
- }
- }
- }
- }
-
- $styles = panels_get_styles();
- foreach ($styles as $name => $data) {
- if (!empty($data['render pane'])) {
- $theme[$data['render pane']] = array(
- 'variables' => array('content' => NULL, 'pane' => NULL, 'display' => NULL, 'style' => NULL, 'settings' => NULL),
- 'path' => $data['path'],
- 'file' => $data['file'],
- );
- }
- if (!empty($data['render region'])) {
- $theme[$data['render region']] = array(
- 'variables' => array('display' => NULL, 'owner_id' => NULL, 'panes' => NULL, 'settings' => NULL, 'region_id' => NULL, 'style' => NULL),
- 'path' => $data['path'],
- 'file' => $data['file'],
- );
- }
-
- if (!empty($data['hook theme'])) {
- if (is_array($data['hook theme'])) {
- $theme += $data['hook theme'];
- }
- else if (function_exists($data['hook theme'])) {
- $data['hook theme']($theme, $data);
- }
- }
- }
-
- return $theme;
-}
-
-/**
- * Implementation of hook_menu
- */
-function panels_menu() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return array();
- }
- $items = array();
-
- // Base AJAX router callback.
- $items['panels/ajax'] = array(
- 'access arguments' => array('access content'),
- 'page callback' => 'panels_ajax_router',
- 'type' => MENU_CALLBACK,
- );
-
- $admin_base = array(
- 'file' => 'includes/callbacks.inc',
- 'access arguments' => array('use panels dashboard'),
- );
- // Provide a nice location for a panels admin panel.
- $items['admin/structure/panels'] = array(
- 'title' => 'Panels',
- 'page callback' => 'panels_admin_page',
- 'description' => 'Get a bird\'s eye view of items related to Panels.',
- ) + $admin_base;
-
- $items['admin/structure/panels/dashboard'] = array(
- 'title' => 'Dashboard',
- 'page callback' => 'panels_admin_page',
- 'type' => MENU_DEFAULT_LOCAL_TASK,
- 'weight' => -10,
- ) + $admin_base;
-
- $items['admin/structure/panels/settings'] = array(
- 'title' => 'Settings',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('panels_admin_settings_page'),
- 'type' => MENU_LOCAL_TASK,
- ) + $admin_base;
-
- $items['admin/structure/panels/settings/general'] = array(
- 'title' => 'General',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('panels_admin_settings_page'),
- 'access arguments' => array('administer page manager'),
- 'type' => MENU_DEFAULT_LOCAL_TASK,
- 'weight' => -10,
- ) + $admin_base;
-
- if (module_exists('page_manager')) {
- $items['admin/structure/panels/settings/panel-page'] = array(
- 'title' => 'Panel pages',
- 'page callback' => 'panels_admin_panel_context_page',
- 'type' => MENU_LOCAL_TASK,
- 'weight' => -10,
- ) + $admin_base;
- }
-
- ctools_include('plugins', 'panels');
- $layouts = panels_get_layouts();
- foreach ($layouts as $name => $data) {
- if (!empty($data['hook menu'])) {
- if (is_array($data['hook menu'])) {
- $items += $data['hook menu'];
- }
- else if (function_exists($data['hook menu'])) {
- $data['hook menu']($items, $data);
- }
- }
- }
-
-
- return $items;
-}
-
-/**
- * Menu loader function to load a cache item for Panels AJAX.
- *
- * This load all of the includes needed to perform AJAX, and loads the
- * cache object and makes sure it is valid.
- */
-function panels_edit_cache_load($cache_key) {
- ctools_include('display-edit', 'panels');
- ctools_include('plugins', 'panels');
- ctools_include('ajax');
- ctools_include('modal');
- ctools_include('context');
-
- return panels_edit_cache_get($cache_key);
-}
-
-/**
- * Implementation of hook_init()
- */
-function panels_init() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- if (user_access('administer site configuration')) {
- drupal_set_message(t('Panels is enabled but CTools is out of date. All Panels modules are disabled until CTools is updated. See the status page for more information.'), 'error');
- }
- return;
- }
-
- ctools_add_css('panels', 'panels');
- ctools_add_js('panels', 'panels');
-}
-
-/**
- * Implementation of hook_permission().
- *
- * @todo Almost all of these need to be moved into pipelines.
- */
-function panels_permission() {
- return array(
- 'use panels dashboard' => array(
- 'title' => t("Use Panels Dashboard"),
- 'description' => t("Allows a user to access the !link.", array('!link' => l('Panels Dashboard', 'admin/structure/panels'))),
- ),
- 'view pane admin links' => array( // @todo
- 'title' => t("View administrative links on Panel panes"),
- 'description' => t(""),
- ),
- 'administer pane access' => array( // @todo should we really have a global perm for this, or should it be moved into a pipeline question?
- 'title' => t("Configure access settings on Panel panes"),
- 'description' => t("Access rules (often also called visibility rules) can be configured on a per-pane basis. This permission allows users to configure those settings."),
- ),
- 'use panels in place editing' => array(
- 'title' => t("Use the Panels In-Place Editor"),
- 'description' => t("Allows a user to utilize Panels' In-Place Editor."),
- ),
- 'administer advanced pane settings' => array(
- 'title' => t("Configure advanced settings on Panel panes"),
- 'description' => t(""),
- ),
- 'administer panels layouts' => array(
- 'title' => t("Administer Panels layouts"),
- 'description' => t("Allows a user to administer exported Panels layout plugins & instances."),
- ),
- 'use panels caching features' => array(
- 'title' => t("Configure caching settings on Panels"),
- 'description' => t("Allows a user to configure caching on Panels displays and panes."),
- ),
- );
-}
-
-/**
- * Implementation of hook_flush_caches().
- *
- * We implement this so that we can be sure our legacy rendering state setting
- * in $conf is updated whenever caches are cleared.
- */
-//function panels_flush_caches() {
-// $legacy = panels_get_legacy_state();
-// $legacy->determineStatus();
-//}
-
-// ---------------------------------------------------------------------------
-// CTools hook implementations
-//
-// These aren't core Drupal hooks but they are just as important.
-
-/**
- * Implementation of hook_ctools_plugin_directory() to let the system know
- * we implement task and task_handler plugins.
- */
-function panels_ctools_plugin_directory($module, $plugin) {
- // Safety: go away if CTools is not at an appropriate version.
- if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return;
- }
- if ($module == 'page_manager' || $module == 'panels' || $module == 'ctools' || $module == 'stylizer') {
- return 'plugins/' . $plugin;
- }
-}
-
-/**
- * Implements hook_ctools_plugin_type().
- *
- * Register layout, style, cache, and display_renderer plugin types, declaring
- * relevant plugin type information as necessary.
- */
-function panels_ctools_plugin_type() {
- return array(
- 'layouts' => array(
- 'load themes' => TRUE, // Can define layouts in themes
- 'process' => 'panels_layout_process',
- 'child plugins' => TRUE,
- ),
- 'styles' => array(
- 'load themes' => TRUE,
- 'process' => 'panels_plugin_styles_process',
- 'child plugins' => TRUE,
- ),
- 'cache' => array(),
- 'display_renderers' => array(
- 'classes' => array('renderer'),
- ),
- );
-}
-
-/**
- * Ensure a layout has a minimal set of data.
- */
-function panels_layout_process(&$plugin) {
- $plugin += array(
- 'category' => t('Miscellaneous'),
- 'description' => '',
- );
-}
-
-/**
- * Implementation of hook_ctools_plugin_api().
- *
- * Inform CTools about version information for various plugins implemented by
- * Panels.
- *
- * @param string $owner
- * The system name of the module owning the API about which information is
- * being requested.
- * @param string $api
- * The name of the API about which information is being requested.
- */
-function panels_ctools_plugin_api($owner, $api) {
- if ($owner == 'panels' && $api == 'styles') {
- // As of 6.x-3.6, Panels has a slightly new system for style plugins.
- return array('version' => 2.0);
- }
-
- if ($owner == 'panels' && $api == 'pipelines') {
- return array(
- 'version' => 1,
- 'path' => drupal_get_path('module', 'panels') . '/includes',
- );
- }
-}
-
-/**
- * Implementation of hook_views_api().
- */
-function panels_views_api() {
- return array(
- 'api' => 2,
- 'path' => drupal_get_path('module', 'panels') . '/plugins/views',
- );
-}
-
-/**
- * Perform additional processing on a style plugin.
- *
- * Currently this is only being used to apply versioning information to style
- * plugins in order to ensure the legacy renderer passes the right type of
- * parameters to a style plugin in a hybrid environment of both new and old
- * plugins.
- *
- * @see _ctools_process_data()
- *
- * @param array $plugin
- * The style plugin that is being processed.
- * @param array $info
- * The style plugin type info array.
- */
-function panels_plugin_styles_process(&$plugin, $info) {
- $plugin += array(
- 'weight' => 0,
- );
-
- $compliant_modules = ctools_plugin_api_info('panels', 'styles', 2.0, 2.0);
- $plugin['version'] = empty($compliant_modules[$plugin['module']]) ? 1.0 : $compliant_modules[$plugin['module']]['version'];
-}
-
-/**
- * Declare what style types Panels uses.
- */
-function panels_ctools_style_base_types() {
- return array(
- 'region' => array(
- 'title' => t('Panel region'),
- 'preview' => 'panels_stylizer_region_preview',
- 'theme variables' => array('settings' => NULL, 'class' => NULL, 'content' => NULL),
- ),
- 'pane' => array(
- 'title' => t('Panel pane'),
- 'preview' => 'panels_stylizer_pane_preview',
- 'theme variables' => array('settings' => NULL, 'content' => NULL, 'pane' => NULL, 'display' => NULL),
- ),
- );
-}
-
-function panels_stylizer_lipsum() {
- return "
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at velit dolor. Donec egestas tellus sit amet urna rhoncus adipiscing. Proin nec porttitor sem. Maecenas aliquam, purus nec tempus dignissim, nulla arcu aliquam diam, non tincidunt massa ante vel dolor. Aliquam sapien sapien, tincidunt id tristique at, pretium sagittis libero.</p>
-
- <p>Nulla facilisi. Curabitur lacinia, tellus sed tristique consequat, diam lorem scelerisque felis, at dictum purus augue facilisis lorem. Duis pharetra dignissim rutrum. Curabitur ac elit id dui dapibus tincidunt. Nulla eget sem quam, non eleifend eros. Cras porttitor tempus lectus ac scelerisque. Curabitur vehicula bibendum lorem, vitae ornare ligula venenatis ut.</p>
- ";
-}
-
-/**
- * Generate a preview given the current settings.
- */
-function panels_stylizer_region_preview($plugin, $settings) {
- ctools_stylizer_add_css($plugin, $settings);
- return theme($plugin['theme'], array('settings' => $settings, 'class' => ctools_stylizer_get_css_class($plugin, $settings), 'content' => panels_stylizer_lipsum()));
-}
-
-/**
- * Generate a preview given the current settings.
- */
-function panels_stylizer_pane_preview($plugin, $settings) {
- ctools_stylizer_add_css($plugin, $settings);
- $pane = new stdClass();
-
- $content = new stdClass;
- $content->title = t('Lorem ipsum');
- $content->content = panels_stylizer_lipsum();
- $content->type = 'dummy';
- $content->subtype = 'dummy';
-
- $content->css_class = ctools_stylizer_get_css_class($plugin, $settings);
-
- $display = new panels_display();
-
- if (!empty($plugin['theme'])) {
- return theme($plugin['theme'], array('settings' => $settings, 'content' => $content, 'pane' => $pane, 'display' => $display));
- }
- else {
- return theme('panels_pane', array('output' => $content, 'pane' => $pane, 'display' => $display));
- }
-}
-
-// ---------------------------------------------------------------------------
-// Panels display editing
-
-/**
- * @defgroup mainapi Functions comprising the main panels API
- * @{
- */
-
-/**
- * Main API entry point to edit a panel display.
- *
- * Sample implementations utiltizing the the complex $destination behavior can be found
- * in panels_page_edit_content() and, in a separate contrib module, OG Blueprints
- * (http://drupal.org/project/og_blueprints), og_blueprints_blueprint_edit().
- *
- * @ingroup mainapi
- *
- * @param object $display instanceof panels_display \n
- * A fully loaded panels $display object, as returned from panels_load_display().
- * Merely passing a did is NOT sufficient. \n
- * Note that 'fully loaded' means the $display must already be loaded with any contexts
- * the caller wishes to have set for the display.
- * @param mixed $destination \n
- * The redirect destination that the user should be taken to on form submission or
- * cancellation. With panels_edit, $destination has complex effects on the return
- * values of panels_edit() once the form has been submitted. See the explanation of
- * the return value below to understand the different types of values returned by panels_edit()
- * at different stages of FAPI. Under most circumstances, simply passing in
- * drupal_get_destination() is all that's necessary.
- * @param array $content_types \n
- * An associative array of allowed content types, typically as returned from
- * panels_common_get_allowed_types(). Note that context partially governs available content types,
- * so you will want to create any relevant contexts using panels_create_context() or
- * panels_create_context_empty() to make sure all the appropriate content types are available.
- *
- * @return
- * Because the functions called by panels_edit() invoke the form API, this function
- * returns different values depending on the stage of form submission we're at. In Drupal 5,
- * the phase of form submission is indicated by the contents of $_POST['op']. Here's what you'll
- * get at different stages:
- * -# If !$_POST['op']: then we're on on the initial passthrough and the form is being
- * rendered, so it's the $form itself that's being returned. Because negative margins,
- * a common CSS technique, bork the display editor's ajax drag-and-drop, it's important
- * that the $output be printed, not returned. Use this syntax in the caller function: \n
- * print theme('page', panels_edit($display, $destination, $content_types), FALSE); \n
- * -# If $_POST['op'] == t('Cancel'): form submission has been cancelled. If empty($destination) == FALSE,
- * then there is no return value and the panels API takes care of redirecting to $destination.
- * If empty($destination) == TRUE, then there's still no return value, but the caller function
- * has to take care of form redirection.
- * -# If $_POST['op'] == ('Save'): the form has been submitted successfully and has run through
- * panels_edit_display_submit(). $output depends on the value of $destination:
- * - If empty($destination) == TRUE: $output contains the modified $display
- * object, and no redirection will occur. This option is useful if the caller
- * needs to perform additional operations on or with the modified $display before
- * the page request is complete. Using hook_form_alter() to add an additional submit
- * handler is typically the preferred method for something like this, but there
- * are certain use cases where that is infeasible and $destination = NULL should
- * be used instead. If this method is employed, the caller will need to handle form
- * redirection. Note that having $_REQUEST['destination'] set, whether via
- * drupal_get_destination() or some other method, will NOT interfere with this
- * functionality; consequently, you can use drupal_get_destination() to safely store
- * your desired redirect in the caller function, then simply use drupal_goto() once
- * panels_edit() has done its business.
- * - If empty($destination) == FALSE: the form will redirect to the URL string
- * given in $destination and NO value will be returned.
- */
-function panels_edit($display, $destination = NULL, $content_types = NULL, $title = FALSE) {
- ctools_include('display-edit', 'panels');
- ctools_include('ajax');
- ctools_include('plugins', 'panels');
- return _panels_edit($display, $destination, $content_types, $title);
-}
-
-/**
- * API entry point for selecting a layout for a given display.
- *
- * Layout selection is nothing more than a list of radio items encompassing the available
- * layouts for this display, as defined by .inc files in the panels/layouts subdirectory.
- * The only real complexity occurs when a user attempts to change the layout of a display
- * that has some content in it.
- *
- * @param object $display instanceof panels_display \n
- * A fully loaded panels $display object, as returned from panels_load_display().
- * Merely passing a did is NOT sufficient.
- * @param string $finish
- * A string that will be used for the text of the form submission button. If no value is provided,
- * then the form submission button will default to t('Save').
- * @param mixed $destination
- * Basic usage is a string containing the URL that the form should redirect to upon submission.
- * For a discussion of advanced usages, see panels_edit().
- * @param mixed $allowed_layouts
- * Allowed layouts has three different behaviors that depend on which of three value types
- * are passed in by the caller:
- * #- if $allowed_layouts instanceof panels_allowed_layouts (includes subclasses): the most
- * complex use of the API. The caller is passing in a loaded panels_allowed_layouts object
- * that the client module previously created and stored somewhere using a custom storage
- * mechanism.
- * #- if is_string($allowed_layouts): the string will be used in a call to variable_get() which
- * will call the $allowed_layouts . '_allowed_layouts' var. If the data was stored properly
- * in the system var, the $allowed_layouts object will be unserialized and recreated.
- * @see panels_common_set_allowed_layouts()
- * #- if is_null($allowed_layouts): the default behavior, which also provides backwards
- * compatibility for implementations of the Panels2 API written before beta4. In this case,
- * a dummy panels_allowed_layouts object is created which does not restrict any layouts.
- * Subsequent behavior is indistinguishable from pre-beta4 behavior.
- *
- * @return
- * Can return nothing, or a modified $display object, or a redirection string; return values for the
- * panels_edit* family of functions are quite complex. See panels_edit() for detailed discussion.
- * @see panels_edit()
- */
-function panels_edit_layout($display, $finish, $destination = NULL, $allowed_layouts = NULL) {
- ctools_include('display-layout', 'panels');
- ctools_include('plugins', 'panels');
- return _panels_edit_layout($display, $finish, $destination, $allowed_layouts);
-}
-
-// ---------------------------------------------------------------------------
-// Panels database functions
-
-/**
- * Forms the basis of a panel display
- *
- */
-class panels_display {
- var $args = array();
- var $content = array();
- var $panels = array();
- var $incoming_content = NULL;
- var $css_id = NULL;
- var $context = array();
- var $did = 'new';
- var $renderer = 'standard';
-
- function add_pane(&$pane, $location = NULL) {
- // If no location specified, use what's set in the pane.
- if (empty($location)) {
- $location = $pane->panel;
- }
- else {
- $pane->panel = $location;
- }
-
- // Get a temporary pid for this pane.
- $pane->pid = "new-" . $this->next_new_pid();
-
- // Add the pane to the approprate spots.
- $this->content[$pane->pid] = &$pane;
- $this->panels[$location][] = $pane->pid;
- }
-
- function duplicate_pane($pid, $location = FALSE) {
- $pane = $this->clone_pane($pid);
- $this->add_pane($pane, $location);
- }
-
- function clone_pane($pid) {
- $pane = drupal_clone($this->content[$pid]);
- return $pane;
- }
-
- function next_new_pid() {
- // We don't use static vars to record the next new pid because
- // temporary pids can last for years in exports and in caching
- // during editing.
- $id = array(0);
- foreach (array_keys($this->content) as $pid) {
- if (!is_numeric($pid)) {
- $id[] = substr($pid, 4);
- }
- }
- $next_id = max($id);
- return ++$next_id;
- }
-
- /**
- * Get the title from a display.
- *
- * The display must have already been rendered, or the setting to set the
- * display's title from a pane's title will not have worked.
- *
- * @return
- * The title to use. If NULL, this means to let any default title that may be in use
- * pass through. i.e, do not actually set the title.
- */
- function get_title() {
- switch ($this->hide_title) {
- case PANELS_TITLE_NONE:
- return '';
-
- case PANELS_TITLE_PANE:
- return isset($this->stored_pane_title) ? $this->stored_pane_title : '';
-
- case PANELS_TITLE_FIXED:
- case FALSE; // For old exported panels that are not in the database.
- if (!empty($this->title)) {
- return filter_xss_admin(ctools_context_keyword_substitute($this->title, array(), $this->context));
- }
- return NULL;
- }
- }
-
- /**
- * Render this panels display.
- *
- * After checking to ensure the designated layout plugin is valid, a
- * display renderer object is spawned and runs its rendering logic.
- *
- * @param mixed $renderer
- * An instantiated display renderer object, or the name of a display
- * renderer plugin+class to be fetched. Defaults to NULL. When NULL, the
- * predesignated display renderer will be used.
- */
- function render($renderer = NULL) {
- $layout = panels_get_layout($this->layout);
- if (!$layout) {
- return NULL;
- }
-
- // If we were not given a renderer object, load it.
- if (!is_object($renderer)) {
- // If the renderer was not specified, default to $this->renderer
- // which is either standard or was already set for us.
- $renderer = panels_get_renderer_handler(!empty($renderer) ? $renderer : $this->renderer, $this);
- if (!$renderer) {
- return NULL;
- }
- }
-
- $output = '';
- // Let modules act just prior to render.
- foreach (module_implements('panels_pre_render') as $module) {
- $function = $module . '_panels_pre_render';
- $output .= $function($this, $renderer);
- }
-
- $output .= $renderer->render();
-
- // Let modules act just after render.
- foreach (module_implements('panels_post_render') as $module) {
- $function = $module . '_panels_post_render';
- $output .= $function($this, $renderer);
- }
- return $output;
- }
-}
-
-/**
- * }@ End of 'defgroup mainapi', although other functions are specifically added later
- */
-
-/**
- * Creates a new display, setting the ID to our magic new id.
- */
-function panels_new_display() {
- ctools_include('export');
- $display = ctools_export_new_object('panels_display', FALSE);
- $display->did = 'new';
- return $display;
-}
-
-/**
- * Create a new pane.
- *
- * @todo -- use schema API for some of this?
- */
-function panels_new_pane($type, $subtype, $set_defaults = FALSE) {
- ctools_include('export');
- $pane = ctools_export_new_object('panels_pane', FALSE);
- $pane->pid = 'new';
- $pane->type = $type;
- $pane->subtype = $subtype;
- if ($set_defaults) {
- $content_type = ctools_get_content_type($type);
- $content_subtype = ctools_content_get_subtype($content_type, $subtype);
- $pane->configuration = ctools_content_get_defaults($content_type, $content_subtype);
- }
-
- return $pane;
-}
-
-/**
- * Load and fill the requested $display object(s).
- *
- * Helper function primarily for for panels_load_display().
- *
- * @param array $dids
- * An indexed array of dids to be loaded from the database.
- *
- * @return $displays
- * An array of displays, keyed by their display dids.
- *
- * @todo schema API can drasticly simplify this code.
- */
-function panels_load_displays($dids) {
- $displays = array();
- if (empty($dids) || !is_array($dids)) {
- return $displays;
- }
-
- $result = db_query("SELECT * FROM {panels_display} WHERE did IN (:dids)", array(':dids' => $dids));
-
- ctools_include('export');
- foreach ($result as $obj) {
- $displays[$obj->did] = ctools_export_unpack_object('panels_display', $obj);
- // Modify the hide_title field to go from a bool to an int if necessary.
- }
-
- $result = db_query("SELECT * FROM {panels_pane} WHERE did IN (:dids) ORDER BY did, panel, position", array(':dids' => $dids));
- foreach ($result as $obj) {
- $pane = ctools_export_unpack_object('panels_pane', $obj);
-
- $displays[$pane->did]->panels[$pane->panel][] = $pane->pid;
- $displays[$pane->did]->content[$pane->pid] = $pane;
- }
-
- return $displays;
-}
-
-/**
- * Load a single display.
- *
- * @ingroup mainapi
- *
- * @param int $did
- * The display id (did) of the display to be loaded.
- *
- * @return object $display instanceof panels_display \n
- * Returns a partially-loaded panels_display object. $display objects returned from
- * from this function have only the following data:
- * - $display->did (the display id)
- * - $display->name (the 'name' of the display, where applicable - it often isn't)
- * - $display->layout (a string with the system name of the display's layout)
- * - $display->panel_settings (custom layout style settings contained in an associative array; NULL if none)
- * - $display->layout_settings (panel size and configuration settings for Flexible layouts; NULL if none)
- * - $display->css_id (the special css_id that has been assigned to this display, if any; NULL if none)
- * - $display->content (an array of pane objects, keyed by pane id (pid))
- * - $display->panels (an associative array of panel regions, each an indexed array of pids in the order they appear in that region)
- * - $display->cache (any relevant data from panels_simple_cache)
- * - $display->args
- * - $display->incoming_content
- *
- * While all of these members are defined, $display->context is NEVER defined in the returned $display;
- * it must be set using one of the ctools_context_create() functions.
- */
-function panels_load_display($did) {
- $displays = panels_load_displays(array($did));
- if (!empty($displays)) {
- return array_shift($displays);
- }
-}
-
-/**
- * Save a display object.
- *
- * @ingroup mainapi
- *
- * Note a new $display only receives a real did once it is run through this function.
- * Until then, it uses a string placeholder, 'new', in place of a real did. The same
- * applies to all new panes (whether on a new $display or not); in addition,
- * panes have sequential numbers appended, of the form 'new-1', 'new-2', etc.
- *
- * @param object $display instanceof panels_display \n
- * The display object to be saved. Passed by reference so the caller need not use
- * the return value for any reason except convenience.
- *
- * @return object $display instanceof panels_display \n
- */
-function panels_save_display(&$display) {
- $update = (isset($display->did) && is_numeric($display->did)) ? array('did') : array();
- drupal_write_record('panels_display', $display, $update);
-
- $pids = array();
- if ($update) {
- // Get a list of all panes currently in the database for this display so we can know if there
- // are panes that need to be deleted. (i.e, aren't currently in our list of panes).
- $result = db_query("SELECT pid FROM {panels_pane} WHERE did = :did", array(':did' => $display->did));
- foreach ($result as $pane) {
- $pids[$pane->pid] = $pane->pid;
- }
- }
-
- // update all the panes
- ctools_include('plugins', 'panels');
- ctools_include('content');
-
- foreach ($display->panels as $id => $panes) {
- $position = 0;
- $new_panes = array();
- foreach ((array) $panes as $pid) {
- if (!isset($display->content[$pid])) {
- continue;
- }
- $pane = $display->content[$pid];
- $type = ctools_get_content_type($pane->type);
-
- $pane->position = $position++;
- $pane->did = $display->did;
-
- $old_pid = $pane->pid;
- drupal_write_record('panels_pane', $pane, is_numeric($pid) ? array('pid') : array());
-
- if ($pane->pid != $old_pid) {
- // and put it back so our pids and positions can be used
- unset($display->content[$id]);
- $display->content[$pane->pid] = $pane;
-
- // If the title pane was one of our panes that just got its ID changed,
- // we need to change it in the database, too.
- if (isset($display->title_pane) && $display->title_pane == $old_pid) {
- $display->title_pane = $pane->pid;
- // Do a simple update query to write it so we don't have to rewrite
- // the whole record. We can't just save writing the whole record here
- // because it was needed to get the did. Chicken, egg, more chicken.
- db_update('panels_display')
- ->fields(array(
- 'title_pane' => $pane->pid
- ))
- ->condition('did', $display->did)
- ->execute();
- }
- }
-
- // re-add this to the list of content for this panel.
- $new_panes[] = $pane->pid;
-
- // Remove this from the list of panes scheduled for deletion.
- if (isset($pids[$pane->pid])) {
- unset($pids[$pane->pid]);
- }
- }
-
- $display->panels[$id] = $new_panes;
- }
- if (!empty($pids)) {
- db_delete('panels_pane')->condition('pid', $pids)->execute();
- }
-
- // Clear any cached content for this display.
- panels_clear_cached_content($display);
-
- // Allow other modules to take action when a display is saved.
- module_invoke_all('panels_display_save', $display);
-
- // Log the change to watchdog, using the same style as node.module
- $watchdog_args = array('%did' => $display->did);
- if (!empty($display->title)) {
- $watchdog_args['%title'] = $display->title;
- watchdog('content', 'Panels: saved display "%title" with display id %did', $watchdog_args, WATCHDOG_NOTICE);
- }
- else {
- watchdog('content', 'Panels: saved display with id %did', $watchdog_args, WATCHDOG_NOTICE);
- }
-
- // to be nice, even tho we have a reference.
- return $display;
-}
-
-/**
- * Delete a display.
- */
-function panels_delete_display($display) {
- if (is_object($display)) {
- $did = $display->did;
- }
- else {
- $did = $display;
- }
- db_delete('panels_display')->condition('did', $did)->execute();
- db_delete('panels_pane')->condition('did', $did)->execute();
-}
-
-/**
- * Exports the provided display into portable code.
- *
- * This function is primarily intended as a mechanism for cloning displays.
- * It generates an exact replica (in code) of the provided $display, with
- * the exception that it replaces all ids (dids and pids) with 'new-*' values.
- * Only once panels_save_display() is called on the code version of $display will
- * the exported display written to the database and permanently saved.
- *
- * @see panels_page_export() or _panels_page_fetch_display() for sample implementations.
- *
- * @ingroup mainapi
- *
- * @param object $display instanceof panels_display \n
- * This export function does no loading of additional data about the provided
- * display. Consequently, the caller should make sure that all the desired data
- * has been loaded into the $display before calling this function.
- * @param string $prefix
- * A string prefix that is prepended to each line of exported code. This is primarily
- * used for prepending a double space when exporting so that the code indents and lines up nicely.
- *
- * @return string $output
- * The passed-in $display expressed as code, ready to be imported. Import by running
- * eval($output) in the caller function; doing so will create a new $display variable
- * with all the exported values. Note that if you have already defined a $display variable in
- * the same scope as where you eval(), your existing $display variable WILL be overwritten.
- */
-function panels_export_display($display, $prefix = '') {
- ctools_include('export');
- $output = ctools_export_object('panels_display', $display, $prefix);
-
- // Initialize empty properties.
- $output .= $prefix . '$display->content = array()' . ";\n";
- $output .= $prefix . '$display->panels = array()' . ";\n";
- $panels = array();
-
- $title_pid = 0;
- if (!empty($display->content)) {
- $pid_counter = 0;
- $region_counters = array();
- foreach ($display->content as $pane) {
- $pid = 'new-' . ++$pid_counter;
- if ($pane->pid == $display->title_pane) {
- $title_pid = $pid;
- }
- $pane->pid = $pid;
- $output .= ctools_export_object('panels_pane', $pane, $prefix . ' ');
- $output .= "$prefix " . '$display->content[\'' . $pane->pid . '\'] = $pane' . ";\n";
- if (!isset($region_counters[$pane->panel])) {
- $region_counters[$pane->panel] = 0;
- }
- $output .= "$prefix " . '$display->panels[\'' . $pane->panel . '\'][' . $region_counters[$pane->panel]++ .'] = \'' . $pane->pid . "';\n";
- }
- }
- $output .= $prefix . '$display->hide_title = ';
- switch ($display->hide_title) {
- case PANELS_TITLE_FIXED:
- $output .= 'PANELS_TITLE_FIXED';
- break;
- case PANELS_TITLE_NONE:
- $output .= 'PANELS_TITLE_NONE';
- break;
- case PANELS_TITLE_PANE:
- $output .= 'PANELS_TITLE_PANE';
- break;
- }
- $output .= ";\n";
-
- $output .= $prefix . '$display->title_pane =' . " '$title_pid';\n";
- return $output;
-}
-
-/**
- * Render a display by loading the content into an appropriate
- * array and then passing through to panels_render_layout.
- *
- * if $incoming_content is NULL, default content will be applied. Use
- * an empty string to indicate no content.
- * @ingroup hook_invocations
- */
-function panels_render_display(&$display, $renderer = NULL) {
- ctools_include('plugins', 'panels');
- ctools_include('context');
-
- if (!empty($display->context)) {
- if ($form_context = ctools_context_get_form($display->context)) {
- $form_context->form['#theme'] = 'panels_render_display_form';
- $form_context->form['#display'] = &$display;
- $form_context->form['#form_context_id'] = $form_context->id;
- return drupal_render_form($form_context->form_id, $form_context->form);
- }
- }
- return $display->render($renderer);
-}
-
-/**
- * Theme function to render our panel as a form.
- *
- * When rendering a display as a form, the entire display needs to be
- * inside the <form> tag so that the form can be spread across the
- * panes. This sets up the form system to be the main caller and we
- * then operate as a theme function of the form.
- */
-function theme_panels_render_display_form($vars) {
- // @todo this is probably broken in D7
- $vars['form']['#children'] = $vars['form']['#display']->render();
- render($vars['form']);
- return theme('form', $vars);
-}
-
-// @layout
-function panels_print_layout_icon($id, $layout, $title = NULL) {
- ctools_add_css('panels_admin', 'panels');
- $file = $layout['path'] . '/' . $layout['icon'];
- return theme('panels_layout_icon', array('id' => $id, 'image' => theme('image', array('path' => $file, 'alt' => strip_tags($layout['title']), 'title' => strip_tags($layout['description']))), 'title' => $title));
-}
-
-/**
- * Theme the layout icon image
- * @layout
- * @todo move to theme.inc
- */
-function theme_panels_layout_icon($vars) {
- $id = $vars['id'];
- $image = $vars['image'];
- $title = $vars['title'];
-
- $output = '<div class="layout-icon">';
- $output .= $image;
- if ($title) {
- $output .= '<div class="caption">' . $title . '</div>';
- }
- $output .= '</div>';
- return $output;
-}
-
-/**
- * Theme the layout link image
- * @layout
- *
- * @todo Why isn't this a template at this point?
- * @todo Why does this take 4 arguments but only makes use of two?
- */
-function theme_panels_layout_link($vars) {
- $title = $vars['title'];
- $image = $vars['image'];
-
- $output = '<div class="layout-link">';
- $output .= $vars['image'];
- $output .= '<div>' . $vars['title'] . '</div>';
- $output .= '</div>';
- return $output;
-}
-
-/**
- * Print the layout link. Sends out to a theme function.
- * @layout
- */
-function panels_print_layout_link($id, $layout, $link, $options = array()) {
- if (isset($options['query']['q'])) {
- unset($options['query']['q']);
- }
-
- ctools_add_css('panels_admin', 'panels');
- $file = $layout['path'] . '/' . $layout['icon'];
- $image = l(theme('image', array('path' => $file)), $link, array('html' => true) + $options);
- $title = l($layout['title'], $link, $options);
- return theme('panels_layout_link', array('title' => $title, 'image' => $image));
-}
-
-
-/**
- * Gateway to the PanelsLegacyState class/object, which does all legacy state
- * checks and provides information about the cause of legacy states as needed.
- *
- * @return PanelsLegacyState $legacy
- */
-function panels_get_legacy_state() {
- static $legacy = NULL;
- if (!isset($legacy)) {
- ctools_include('legacy', 'panels');
- $legacy = new PanelsLegacyState();
- }
- return $legacy;
-}
-
-/**
- * Get the display that is currently being rendered as a page.
- *
- * Unlike in previous versions of this, this only returns the display,
- * not the page itself, because there are a number of different ways
- * to get to this point. It is hoped that the page data isn't needed
- * at this point. If it turns out there is, we will do something else to
- * get that functionality.
- */
-function panels_get_current_page_display($change = NULL) {
- static $display = NULL;
- if ($change) {
- $display = $change;
- }
-
- return $display;
-}
-
-/**
- * Clean up the panel pane variables for the template.
- */
-function template_preprocess_panels_pane(&$vars) {
- $content = &$vars['content'];
-
- $vars['contextual_links'] = array();
- $vars['classes_array'] = array();
- $vars['admin_links'] = '';
-
- if (user_access('access contextual links')) {
- $links = array();
- // These are specified by the content.
- if (!empty($content->admin_links)) {
- $links += $content->admin_links;
- }
-
- // Take any that may have been in the render array we were given and
- // move them up so they appear outside the pane properly.
- if (is_array($content->content) && isset($content->content['#contextual_links'])) {
- $element = array(
- '#type' => 'contextual_links',
- '#contextual_links' => $content->content['#contextual_links'],
- );
- unset($content->content['#contextual_links']);
-
- $element = contextual_pre_render_links($element);
- $links += $element['#links'];
- }
-
- if ($links) {
- $build = array(
- '#prefix' => '<div class="contextual-links-wrapper">',
- '#suffix' => '</div>',
- '#theme' => 'links__contextual',
- '#links' => $links,
- '#attributes' => array('class' => array('contextual-links')),
- '#attached' => array(
- 'library' => array(array('contextual', 'contextual-links')),
- ),
- );
- $vars['classes_array'][] = 'contextual-links-region';
- $vars['admin_links'] = drupal_render($build);
- }
- }
-
- // basic classes
- $vars['classes_array'][] = 'panel-pane';
- $vars['id'] = '';
-
- // Add some usable classes based on type/subtype
- ctools_include('cleanstring');
- $type_class = $content->type ? 'pane-'. ctools_cleanstring($content->type, array('lower case' => TRUE)) : '';
- $subtype_class = $content->subtype ? 'pane-'. ctools_cleanstring($content->subtype, array('lower case' => TRUE)) : '';
-
- // Sometimes type and subtype are the same. Avoid redundant classes.
- $vars['classes_array'][] = $type_class;
- if ($type_class != $subtype_class) {
- $vars['classes_array'][] = $subtype_class;
- }
-
- // Add id and custom class if sent in.
- if (!empty($content->content)) {
- if (!empty($content->css_id)) {
- $vars['id'] = ' id="' . $content->css_id . '"';
- }
- if (!empty($content->css_class)) {
- $vars['classes_array'][] = $content->css_class;
- }
- }
-
- $vars['title'] = !empty($content->title) ? $content->title : '';
-
- $vars['feeds'] = !empty($content->feeds) ? implode(' ', $content->feeds) : '';
-
- $vars['links'] = !empty($content->links) ? theme('links', array('links' => $content->links)) : '';
- $vars['more'] = '';
- if (!empty($content->more)) {
- if (empty($content->more['title'])) {
- $content->more['title'] = t('more');
- }
- $vars['more'] = l($content->more['title'], $content->more['href'], $content->more);
- }
-
- $vars['content'] = !empty($content->content) ? $content->content : '';
-
-}
-
-/**
- * Route Panels' AJAX calls to the correct object.
- *
- * Panels' AJAX is controlled mostly by renderer objects. This menu callback
- * accepts the incoming request, figures out which object should handle the
- * request, and attempts to route it. If no object can be found, the default
- * Panels editor object is used.
- *
- * Calls are routed via the ajax_* method space. For example, if visiting
- * panels/ajax/add-pane then $renderer::ajax_add_pane() will be called.
- * This means commands can be added without having to create new callbacks.
- *
- * The first argument *must always* be the cache key so that a cache object
- * can be passed through. Other arguments will be passed through untouched
- * so that the method can do whatever it needs to do.
- */
-function panels_ajax_router() {
- $args = func_get_args();
- if (count($args) < 3) {
- return MENU_NOT_FOUND;
- }
-
- ctools_include('display-edit', 'panels');
- ctools_include('plugins', 'panels');
- ctools_include('ajax');
- ctools_include('modal');
- ctools_include('context');
- ctools_include('content');
-
- $plugin_name = array_shift($args);
- $method = array_shift($args);
- $cache_key = array_shift($args);
-
- $plugin = panels_get_display_renderer($plugin_name);
- if (!$plugin) {
- // This is the default renderer for handling AJAX commands.
- $plugin = panels_get_display_renderer('editor');
- }
-
- $cache = panels_edit_cache_get($cache_key);
- if (empty($cache)) {
- return MENU_ACCESS_DENIED;
- }
-
- $renderer = panels_get_renderer_handler($plugin, $cache->display);
- if (!$renderer) {
- return MENU_ACCESS_DENIED;
- }
-
- $method = 'ajax_' . str_replace('-', '_', $method);
- if (!method_exists($renderer, $method)) {
- return MENU_NOT_FOUND;
- }
-
- $renderer->cache = &$cache;
- ctools_include('cleanstring');
- $renderer->clean_key = ctools_cleanstring($cache_key);
-
- $output = call_user_func_array(array($renderer, $method), $args);
-
- if (empty($output) && !empty($renderer->commands)) {
- print ajax_render($renderer->commands);
- ajax_footer();
- }
- return $output;
-}
-
-// --------------------------------------------------------------------------
-// Panels caching functions and callbacks
-//
-// When editing displays and the like, Panels has a caching system that relies
-// on a callback to determine where to get the actual cache.
-
-// @todo This system needs to be better documented so that it can be
-// better used.
-
-/**
- * Get an object from cache.
- */
-function panels_cache_get($obj, $did, $skip_cache = FALSE) {
- ctools_include('object-cache');
- // we often store contexts in cache, so let's just make sure we can load
- // them.
- ctools_include('context');
- return ctools_object_cache_get($obj, 'panels_display:' . $did, $skip_cache);
-}
-
-/**
- * Save the edited object into the cache.
- */
-function panels_cache_set($obj, $did, $cache) {
- ctools_include('object-cache');
- return ctools_object_cache_set($obj, 'panels_display:' . $did, $cache);
-}
-
-/**
- * Clear a object from the cache; used if the editing is aborted.
- */
-function panels_cache_clear($obj, $did) {
- ctools_include('object-cache');
- return ctools_object_cache_clear($obj, 'panels_display:' . $did);
-}
-
-/**
- * Create the default cache for editing panel displays.
- *
- * If an application is using the Panels display editor without having
- * specified a cache key, this method can be used to create the default
- * cache.
- */
-function panels_edit_cache_get_default(&$display, $content_types = NULL, $title = FALSE) {
- if (empty($content_types)) {
- $content_types = ctools_content_get_available_types();
- }
-
- $display->cache_key = $display->did;
- panels_cache_clear('display', $display->did);
-
- $cache = new stdClass();
- $cache->display = &$display;
- $cache->content_types = $content_types;
- $cache->display_title = $title;
-
- panels_edit_cache_set($cache);
- return $cache;
-}
-
-/**
- * Method to allow modules to provide their own caching mechanism for the
- * display editor.
- */
-function panels_edit_cache_get($cache_key) {
- if (strpos($cache_key, ':') !== FALSE) {
- list($module, $argument) = explode(':', $cache_key, 2);
- return module_invoke($module, 'panels_cache_get', $argument);
- }
-
- // Fall back to our normal method:
- return panels_cache_get('display', $cache_key);
-}
-
-/**
- * Method to allow modules to provide their own caching mechanism for the
- * display editor.
- */
-function panels_edit_cache_set($cache) {
- $cache_key = $cache->display->cache_key;
- if (strpos($cache_key, ':') !== FALSE) {
- list($module, $argument) = explode(':', $cache_key, 2);
- return module_invoke($module, 'panels_cache_set', $argument, $cache);
- }
-
- // Fall back to our normal method:
- return panels_cache_set('display', $cache_key, $cache);
-}
-
-/**
- * Method to allow modules to provide their own mechanism to write the
- * cache used in the display editor.
- */
-function panels_edit_cache_save($cache) {
- $cache_key = $cache->display->cache_key;
- if (strpos($cache_key, ':') !== FALSE) {
- list($module, $argument) = explode(':', $cache_key, 2);
- if (function_exists($module . '_panels_cache_save')) {
- return module_invoke($module, 'panels_cache_save', $argument, $cache);
- }
- }
-
- // Fall back to our normal method:
- return panels_save_display($cache->display);
-}
-
-/**
- * Method to allow modules to provide their own mechanism to clear the
- * cache used in the display editor.
- */
-function panels_edit_cache_clear($cache) {
- $cache_key = $cache->display->cache_key;
- if (strpos($cache_key, ':') !== FALSE) {
- list($module, $argument) = explode(':', $cache_key, 2);
- if (function_exists($module . '_panels_cache_clear')) {
- return module_invoke($module, 'panels_cache_clear', $argument, $cache);
- }
- }
-
- // Fall back to our normal method:
- return panels_cache_clear('display', $cache_key);
-}
-
-/**
- * Method to allow modules to provide a mechanism to break locks.
- */
-function panels_edit_cache_break_lock($cache) {
- if (empty($cache->locked)) {
- return;
- }
-
- $cache_key = $cache->display->cache_key;
- if (strpos($cache_key, ':') !== FALSE) {
- list($module, $argument) = explode(':', $cache_key, 2);
- if (function_exists($module . '_panels_cache_break_lock')) {
- return module_invoke($module, 'panels_cache_break_lock', $argument, $cache);
- }
- }
-
- // Normal panel display editing has no locks, so we do nothing if there is
- // no fallback.
- return;
-}
-
-// --------------------------------------------------------------------------
-// Callbacks on behalf of the panel_context plugin.
-//
-// The panel_context plugin lets Panels be used in page manager. These
-// callbacks allow the display editing system to use the page manager
-// cache rather than the default display cache. They are routed by the cache
-// key via panels_edit_cache_* functions.
-
-/**
- * Get display edit cache on behalf of panel context.
- *
- * The key is the second half of the key in this form:
- * panel_context:TASK_NAME:HANDLER_NAME;
- */
-function panel_context_panels_cache_get($key) {
- ctools_include('common', 'panels');
- ctools_include('context');
- ctools_include('context-task-handler');
- // this loads the panel context inc even if we don't use the plugin.
- $plugin = page_manager_get_task_handler('panel_context');
-
- list($task_name, $handler_name) = explode(':', $key, 2);
- $page = page_manager_get_page_cache($task_name);
- if (isset($page->display_cache[$handler_name])) {
- return $page->display_cache[$handler_name];
- }
-
- if ($handler_name) {
- $handler = &$page->handlers[$handler_name];
- }
- else {
- $handler = &$page->new_handler;
- }
- $cache = new stdClass();
-
- $cache->display = &panels_panel_context_get_display($handler);
- $cache->display->context = ctools_context_handler_get_all_contexts($page->task, $page->subtask, $handler);
- $cache->display->cache_key = 'panel_context:' . $key;
- $cache->content_types = panels_common_get_allowed_types('panels_page', $cache->display->context);
- $cache->display_title = TRUE;
- $cache->locked = $page->locked;
-
- return $cache;
-}
-
-/**
- * Get the Page Manager cache for the panel_context plugin.
- */
-function _panel_context_panels_cache_get_page_cache($key, $cache) {
- list($task_name, $handler_name) = explode(':', $key, 2);
- $page = page_manager_get_page_cache($task_name);
- $page->display_cache[$handler_name] = $cache;
- if ($handler_name) {
- $page->handlers[$handler_name]->conf['display'] = $cache->display;
- $page->handler_info[$handler_name]['changed'] |= PAGE_MANAGER_CHANGED_CACHED;
- }
- else {
- $page->new_handler->conf['display'] = $cache->display;
- }
-
- return $page;
-}
-
-/**
- * Store a display edit in progress in the page cache.
- */
-function panel_context_panels_cache_set($key, $cache) {
- $page = _panel_context_panels_cache_get_page_cache($key, $cache);
- page_manager_set_page_cache($page);
-}
-
-/**
- * Save all changes made to a display using the Page Manager page cache.
- */
-function panel_context_panels_cache_clear($key, $cache) {
- $page = _panel_context_panels_cache_get_page_cache($key, $cache);
- page_manager_clear_page_cache($page->task_name);
-}
-
-/**
- * Save all changes made to a display using the Page Manager page cache.
- */
-function panel_context_panels_cache_save($key, $cache) {
- $page = _panel_context_panels_cache_get_page_cache($key, $cache);
- page_manager_save_page_cache($page);
-}
-
-/**
- * Break the lock on a page manager page.
- */
-function panel_context_panels_cache_break_lock($key, $cache) {
- $page = _panel_context_panels_cache_get_page_cache($key, $cache);
- ctools_object_cache_clear_all('page_manager_page', $page->task_name);
-}
-
-// --------------------------------------------------------------------------
-// Callbacks on behalf of the panels page wizards
-//
-// The page wizards are a pluggable set of 'wizards' to make it easy to create
-// specific types of pages based upon whatever someone felt like putting
-// together. Since they will very often have content editing, we provide
-// a generic mechanism to allow them to store their editing cache in the
-// wizard cache.
-//
-// For them to use this mechanism, they just need to use:
-// $cache = panels_edit_cache_get('panels_page_wizard:' . $plugin['name']);
-
-/**
- * Get display edit cache for the panels mini export UI
- *
- * The key is the second half of the key in this form:
- * panels_page_wizard:TASK_NAME:HANDLER_NAME;
- */
-function panels_page_wizard_panels_cache_get($key) {
- ctools_include('page-wizard');
- ctools_include('context');
- $wizard_cache = page_manager_get_wizard_cache($key);
- if (isset($wizard_cache->display_cache)) {
- return $wizard_cache->display_cache;
- }
-
- ctools_include('common', 'panels');
- $cache = new stdClass();
- $cache->display = $wizard_cache->display;
- $cache->display->context = !empty($wizard_cache->context) ? $wizard_cache->context : array();
- $cache->display->cache_key = 'panels_page_wizard:' . $key;
- $cache->content_types = panels_common_get_allowed_types('panels_page', $cache->display->context);
- $cache->display_title = TRUE;
-
- return $cache;
-}
-
-/**
- * Store a display edit in progress in the page cache.
- */
-function panels_page_wizard_panels_cache_set($key, $cache) {
- ctools_include('page-wizard');
- $wizard_cache = page_manager_get_wizard_cache($key);
- $wizard_cache->display_cache = $cache;
- page_manager_set_wizard_cache($wizard_cache);
-}
-
-// --------------------------------------------------------------------------
-// General utility functions
-
-/**
- * Perform a drupal_goto on a destination that may be an array like url().
- */
-function panels_goto($destination) {
- if (!is_array($destination)) {
- return drupal_goto($destination);
- }
- else {
- // Prevent notices by adding defaults
- $destination += array(
- 'query' => NULL,
- 'fragment' => NULL,
- 'http_response_code' => NULL,
- );
-
- return drupal_goto($destination['path'], $destination['query'], $destination['fragment'], $destination['http_response_code']);
- }
-}
-
-
-/**
- * For external use: Given a layout ID and a $content array, return the
- * panel display.
- *
- * The content array is filled in based upon the content available in the
- * layout. If it's a two column with a content array defined like
- * @code
- * array(
- * 'left' => t('Left side'),
- * 'right' => t('Right side')
- * ),
- * @endcode
- *
- * Then the $content array should be
- * @code
- * array(
- * 'left' => $output_left,
- * 'right' => $output_right,
- * )
- * @endcode
- *
- * The output within each panel region can be either a single rendered
- * HTML string or an array of rendered HTML strings as though they were
- * panes. They will simply be concatenated together without separators.
- */
-function panels_print_layout($layout, $content, $meta = 'standard') {
- ctools_include('plugins', 'panels');
-
- // Create a temporary display for this.
- $display = panels_new_display();
- $display->layout = is_array($layout) ? $layout['name'] : $layout;
- $display->content = $content;
-
- // Get our simple renderer
- $renderer = panels_get_renderer_handler('simple', $display);
- $renderer->meta_location = $meta;
-
- return $renderer->render();
-}
-
-// --------------------------------------------------------------------------
-// Deprecated functions
-//
-// Everything below this line will eventually go away.
-
-/**
- * panels path helper function
- */
-function panels_get_path($file, $base_path = FALSE, $module = 'panels') {
- $output = $base_path ? base_path() : '';
- return $output . drupal_get_path('module', $module) . '/' . $file;
-}
diff --git a/panels_ipe/css/panels_ipe.css b/panels_ipe/css/panels_ipe.css
deleted file mode 100644
index 60f0938..0000000
--- a/panels_ipe/css/panels_ipe.css
+++ /dev/null
@@ -1,209 +0,0 @@
-div.panels-ipe-handlebar-wrapper {
- border-bottom: #898AAB solid 2px;
-}
-
-.panels-ipe-editing div.panels-ipe-portlet-wrapper {
- margin-top: 1em;
- border: #898AAB solid 2px;
- -moz-border-radius-bottomleft:8px;
- -moz-border-radius-bottomright:8px;
- -moz-border-radius-topleft:2px;
- -moz-border-radius-topright:2px;
-
- -webkit-border-radius-bottomleft:8px;
- -webkit-border-radius-bottomright:8px;
- -webkit-border-radius-topleft:2px;
- -webkit-border-radius-topright:2px;
-}
-
-/* Hide empty panes when not editing them. */
-.panels-ipe-empty-pane {
- display: none;
-}
-
-.panels-ipe-editing .panels-ipe-empty-pane {
- display: block;
-}
-
-
-.panels-ipe-editing div.panels-ipe-portlet-wrapper:hover {
- border: #FF000A solid 2px;
-}
-
-.panels-ipe-editing .panels-ipe-sort-container .ui-sortable-helper {
- background: white;
-}
-
-.panels-ipe-editing div.panel-pane div.admin-links {
- display: none !important;
-}
-
-.panels-ipe-editing .panels-ipe-sort-container .ui-sortable-placeholder {
- -moz-border-radius: 0;
- -webkit-border-radius: 0;
- border: 1px dotted red;
- background-color: white;
-}
-
-div.panels-ipe-handlebar-wrapper ul {
- float: left;
- margin: 0;
- padding: 0;
- text-align: right;
-}
-
-div.panels-ipe-handlebar-wrapper li {
- background: none repeat scroll 0 0 transparent;
- list-style: none outside none;
- margin: 0;
- padding: 0;
- float: left;
- font: 12px/170% Verdana,sans-serif !important;
-}
-
-div.panels-ipe-handlebar-wrapper li {
- border-top: 1px solid #CCC;
- border-right: 1px solid #CCC;
-}
-
-div.panels-ipe-handlebar-wrapper li.first {
- border-left: 1px solid #CCC;
-}
-
-div.panels-ipe-draghandle {
- background: #898AAB url(../images/dragger.png) top right no-repeat;
- cursor: move;
- height: 24px;
-}
-
-div.panels-ipe-placeholder {
- border: 1px solid black;
- padding: .5em;
- margin-top: .5em;
- background-color: #f6f6f6;
- color: black;
- background-color: white;
- font: 12px/170% Verdana,sans-serif !important;
- text-transform: none;
- letter-spacing: 0;
- text-align: left;
- word-spacing: 0;
-}
-
-div.panels-ipe-placeholder h3 {
- font-weight: bold;
-}
-
-/* Hide editor-state-on elements initially */
-.panels-ipe-on {
- display: none;
-}
-
-.panels-ipe-editing .panels-ipe-on {
- display: block;
-}
-
-/* Show editor-state-off elements initially */
-.panels-ipe-off {
- display: block;
-}
-
-div.panels-ipe-handlebar-wrapper li a,
-div.panels-ipe-draghandle span,
-div.panels-ipe-newblock a {
- background-color: #f6f6f6;
- color: blue;
- display: block;
- padding: 0.1em 0.5em;
- font: 12px/170% Verdana,sans-serif !important;
- text-transform: none;
- letter-spacing: 0;
-}
-
-div.panels-ipe-newblock a {
- display: inline;
- border: 1px solid #CCC;
- color: blue;
-}
-
-.panels-ipe-editing .panels-ipe-portlet-content {
- margin-bottom: 10px;
- border: transparent dotted 1px;
- overflow: hidden;
-}
-
-.panels-ipe-editing .panels-ipe-region {
- border: transparent dotted 1px;
- float: left;
- width: 100%;
- margin-bottom: 5px;
-}
-
-div.panels-ipe-draghandle {
- border: none;
-}
-
-.ui-sortable-placeholder {
- margin: 1em;
- border: 1px dotted black;
- visibility: visible !important;
- height: 50px !important;
-}
-.ui-sortable-placeholder * {
- visibility: hidden;
-}
-
-/* counteract panels_dnd.css - temporary */
-div.panels-ipe-display-container .panel-pane .pane-title {
- padding: 0;
-}
-
-/** ============================================================================
- * Controller form markup
- */
-
-div#panels-ipe-control-container {
- z-index: 100;
- position: fixed;
- margin: auto;
- bottom: 0;
- left: 50%;
- display: block;
- background-color: #000;
- padding: 0.5em 1em;
- min-width: 9.5em;
- max-width: 14.5em;
- min-height: 2em;
- max-height: 2.5em;
- -moz-border-radius-topleft:5px;
- -moz-border-radius-topright:5px;
- -moz-box-shadow: #333 0px 1px 0px;
- -webkit-border-radius-topleft:5px;
- -webkit-border-radius-topright:5px;
- -webkit-box-shadow: #333 0px 1px 0px;
-}
-
-div.panels-ipe-pseudobutton {
- cursor: pointer;
- background-color: #333;
- font:normal 11px/15px "Lucida Grande",Tahoma,Verdana,sans-serif;
- color: #FFF;
- -moz-border-radius:5px;
- -moz-box-shadow: #333 0px 1px 0px;
- -webkit-border-radius:5px;
- -webkit-box-shadow: #333 0px 1px 0px;
- padding: 0.3em 0.8em;
- float: left;
-}
-
-div.panels-ipe-control .form-submit {
- float: left;
- margin: 0.3em 0.5em;
-}
-
-div.panels-ipe-form-container {
- min-width: 12.5em;
- min-height: 2em;
- margin-left: auto;
- margin-right: auto;
-}
diff --git a/panels_ipe/images/dragger.png b/panels_ipe/images/dragger.png
deleted file mode 100644
index bb3b57b..0000000
--- a/panels_ipe/images/dragger.png
+++ /dev/null
Binary files differ
diff --git a/panels_ipe/includes/panels_ipe.pipelines.inc b/panels_ipe/includes/panels_ipe.pipelines.inc
deleted file mode 100644
index ce84464..0000000
--- a/panels_ipe/includes/panels_ipe.pipelines.inc
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-/**
- * @file
- * Bulk export of panels_layouts objects generated by Bulk export module.
- */
-
-/**
- * Implementation of hook_default_panels_layout()
- */
-function panels_ipe_default_panels_renderer_pipeline() {
- $pipelines = array();
-
- $pipeline = new stdClass;
- $pipeline->disabled = FALSE; /* Edit this to true to make a default pipeline disabled initially */
- $pipeline->api_version = 1;
- $pipeline->name = 'ipe';
- $pipeline->admin_title = t('In-Place Editor');
- $pipeline->admin_description = t('Allows privileged users to update and rearrange the content while viewing this panel.');
- $pipeline->weight = 0;
- $pipeline->settings = array(
- 'renderers' => array(
- 0 => array(
- 'access' => array(
- 'plugins' => array(
- 0 => array(
- 'name' => 'perm',
- 'settings' => array(
- 'perm' => 'use panels in place editing',
- ),
- 'context' => 'logged-in-user',
- ),
- ),
- 'logic' => 'and',
- ),
- 'renderer' => 'ipe',
- 'options' => array(),
- ),
- ),
- );
- $pipelines[$pipeline->name] = $pipeline;
-
- return $pipelines;
-}
diff --git a/panels_ipe/js/panels_ipe.js b/panels_ipe/js/panels_ipe.js
deleted file mode 100644
index e83ddf2..0000000
--- a/panels_ipe/js/panels_ipe.js
+++ /dev/null
@@ -1,256 +0,0 @@
-
-// Ensure the $ alias is owned by jQuery.
-(function($) {
-
-Drupal.PanelsIPE = {
- editors: {},
- bindClickDelete: function(context) {
- $('a.pane-delete:not(.pane-delete-processed)', context)
- .addClass('pane-delete-processed')
- .click(function() {
- if (confirm('Remove this pane?')) {
- $(this).parents('div.panels-ipe-portlet-wrapper').fadeOut('medium', function() {
- $(this).empty().remove();
- });
- $(this).parents('div.panels-ipe-display-container').addClass('changed');
- }
- return false;
- });
- }
-}
-
-// A ready function should be sufficient for this, at least for now
-$(function() {
- $.each(Drupal.settings.PanelsIPECacheKeys, function() {
- Drupal.PanelsIPE.editors[this] = new DrupalPanelsIPE(this, Drupal.settings.PanelsIPESettings[this]);
- });
-});
-
-Drupal.behaviors.PanelsIPE = {
- attach: function(context) {
- Drupal.PanelsIPE.bindClickDelete(context);
- }
-};
-
-/**
- * Base object (class) definition for the Panels In-Place Editor.
- *
- * A new instance of this object is instanciated for every unique IPE on a given
- * page.
- *
- * Note that this form is provisional, and we hope to replace it with a more
- * flexible, loosely-coupled model that utilizes separate controllers for the
- * discrete IPE elements. This will result in greater IPE flexibility.
- */
-function DrupalPanelsIPE(cache_key, cfg) {
- var ipe = this;
- this.key = cache_key;
- this.state = {};
- this.control = $('div#panels-ipe-control-' + cache_key);
- this.initButton = $('div.panels-ipe-startedit', this.control);
- this.cfg = cfg;
- this.changed = false;
- this.sortableOptions = $.extend({
- revert: 200,
- dropOnEmpty: true, // default
- opacity: 0.75, // opacity of sortable while sorting
- // placeholder: 'draggable-placeholder',
- // forcePlaceholderSize: true,
- items: 'div.panels-ipe-portlet-wrapper',
- handle: 'div.panels-ipe-draghandle',
- tolerance: 'pointer',
- cursorAt: 'top',
- update: this.setChanged,
- scroll: true
- // containment: ipe.topParent,
- }, cfg.sortableOptions || {});
-
- this.initEditing = function(formdata) {
- ipe.topParent = $('div#panels-ipe-display-' + cache_key);
- ipe.backup = this.topParent.clone();
-
- // See http://jqueryui.com/demos/sortable/ for details on the configuration
- // parameters used here.
- ipe.changed = false;
-
- $('div.panels-ipe-sort-container', ipe.topParent).sortable(ipe.sortable_options);
-
- // Since the connectWith option only does a one-way hookup, iterate over
- // all sortable regions to connect them with one another.
- $('div.panels-ipe-sort-container', ipe.topParent)
- .sortable('option', 'connectWith', ['div.panels-ipe-sort-container']);
-
- $('div.panels-ipe-sort-container', ipe.topParent).bind('sortupdate', function() {
- ipe.changed = true;
- });
-
- $('.panels-ipe-form-container', ipe.control).append(formdata);
-
- $('input:submit:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() {
- var element_settings = {};
-
- element_settings.url = $(this.form).attr('action');
- element_settings.setClick = true;
- element_settings.event = 'click';
- element_settings.progress = { 'type': 'throbber' };
-
- var base = $(this).attr('id');
- Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
- if ($(this).attr('id') == 'panels-ipe-save') {
- Drupal.ajax[base].options.beforeSerialize = function (element_settings, options) {
- ipe.saveEditing();
- return Drupal.ajax[base].beforeSerialize(element_settings, options);
- };
- }
- if ($(this).attr('id') == 'panels-ipe-cancel') {
- Drupal.ajax[base].options.beforeSend = function () {
- return ipe.cancelEditing();
- };
- }
- });
-
- // Perform visual effects in a particular sequence.
- ipe.initButton.css('position', 'absolute');
- ipe.initButton.fadeOut('normal');
- $('.panels-ipe-on').show('normal');
-// $('.panels-ipe-on').fadeIn('normal');
- ipe.topParent.addClass('panels-ipe-editing');
- }
-
- this.endEditing = function(data) {
- $('.panels-ipe-form-container', ipe.control).empty();
- // Re-show all the IPE non-editing meta-elements
- $('div.panels-ipe-off').show('fast');
-
- // Re-hide all the IPE meta-elements
- $('div.panels-ipe-on').hide('fast');
- ipe.initButton.css('position', 'static');
- ipe.topParent.removeClass('panels-ipe-editing');
- $('div.panels-ipe-sort-container', ipe.topParent).sortable("destroy");
- };
-
- this.saveEditing = function() {
- $('div.panels-ipe-region', ipe.topParent).each(function() {
- var val = '';
- var region = $(this).attr('id').split('panels-ipe-regionid-')[1];
- $(this).find('div.panels-ipe-portlet-wrapper').each(function() {
- var id = $(this).attr('id').split('panels-ipe-paneid-')[1];
- if (id) {
- if (val) {
- val += ',';
- }
- val += id;
- }
- });
- $('input[name="panel[pane][' + region + ']"]', ipe.control).val(val);
- });
- }
-
- this.cancelEditing = function() {
- if (ipe.topParent.hasClass('changed')) {
- ipe.changed = true;
- }
-
- if (!ipe.changed || confirm(Drupal.t('This will discard all unsaved changes. Are you sure?'))) {
- ipe.topParent.fadeOut('medium', function() {
- ipe.topParent.replaceWith(ipe.backup.clone());
- ipe.topParent = $('div#panels-ipe-display-' + ipe.key);
-
- // Processing of these things got lost in the cloning, but the classes remained behind.
- // @todo this isn't ideal but I can't seem to figure out how to keep an unprocessed backup
- // that will later get processed.
- $('.ctools-use-modal-processed', ipe.topParent).removeClass('ctools-use-modal-processed');
- $('.pane-delete-processed', ipe.topParent).removeClass('pane-delete-processed');
- ipe.topParent.fadeIn('medium');
- Drupal.attachBehaviors();
- });
- }
- else {
- // Cancel the submission.
- return false;
- }
- };
-
- this.createSortContainers = function() {
- $('div.panels-ipe-region', this.topParent).each(function() {
- $('div.panels-ipe-portlet-marker', this).parent()
- .wrapInner('<div class="panels-ipe-sort-container" />');
-
- // Move our gadgets outside of the sort container so that sortables
- // cannot be placed after them.
- $('div.panels-ipe-portlet-static', this).each(function() {
- $(this).appendTo($(this).parent().parent());
- });
-
- // Add a marker so we can drag things to empty containers.
- $('div.panels-ipe-sort-container', this).append('<div>&nbsp;</div>');
- });
- }
-
- this.createSortContainers();
-
- var element_settings = {
- url: ipe.cfg.formPath,
- event: 'click',
- keypress: false,
- // No throbber at all.
- progress: { 'type': 'none' }
- };
-
- Drupal.ajax['ipe-ajax'] = new Drupal.ajax('ipe-ajax', $('div.panels-ipe-startedit', this.control).get(0), element_settings);
-
-/*
- var ajaxOptions = {
- type: "POST",
- url: ,
- data: { 'js': 1 },
- global: true,
- success: Drupal.CTools.AJAX.respond,
- error: function(xhr) {
- Drupal.CTools.AJAX.handleErrors(xhr, ipe.cfg.formPath);
- },
- dataType: 'json'
- };
-
- $('div.panels-ipe-startedit', this.control).click(function() {
- var $this = $(this);
- $.ajax(ajaxOptions);
- });
- */
-};
-
-$(function() {
- Drupal.ajax.prototype.commands.initIPE = function(ajax, data, status) {
- if (Drupal.PanelsIPE.editors[data.key]) {
- Drupal.PanelsIPE.editors[data.key].initEditing(data.data);
- }
- };
-
- Drupal.ajax.prototype.commands.unlockIPE = function(ajax, data, status) {
- if (confirm(data.message)) {
- var ajaxOptions = {
- type: "POST",
- url: data.break_path,
- data: { 'js': 1 },
- global: true,
- success: Drupal.CTools.AJAX.respond,
- error: function(xhr) {
- Drupal.CTools.AJAX.handleErrors(xhr, ipe.cfg.formPath);
- },
- dataType: 'json'
- };
-
- $.ajax(ajaxOptions);
- };
- };
-
- Drupal.ajax.prototype.commands.endIPE = function(ajax, data, status) {
- if (Drupal.PanelsIPE.editors[data.key]) {
- Drupal.PanelsIPE.editors[data.key].endEditing(data);
- }
- };
-
-
-});
-
-})(jQuery);
diff --git a/panels_ipe/panels_ipe.info b/panels_ipe/panels_ipe.info
deleted file mode 100644
index b0172a7..0000000
--- a/panels_ipe/panels_ipe.info
+++ /dev/null
@@ -1,7 +0,0 @@
-name = Panels In-Place Editor
-description = Provide a UI for managing some Panels directly on the frontend, instead of having to use the backend.
-package = "Panels"
-dependencies[] = panels
-core = 7.x
-configure = admin/structure/panels
-files[] = panels_ipe.module
diff --git a/panels_ipe/panels_ipe.module b/panels_ipe/panels_ipe.module
deleted file mode 100644
index a034307..0000000
--- a/panels_ipe/panels_ipe.module
+++ /dev/null
@@ -1,162 +0,0 @@
-<?php
-
-/**
- * Implementation of hook_ctools_plugin_directory().
- */
-function panels_ipe_ctools_plugin_directory($module, $plugin) {
- if ($module == 'panels' && $plugin == 'display_renderers') {
- return 'plugins/' . $plugin;
- }
-}
-
-/**
- * Implementation of hook_ctools_plugin_api().
- *
- * Inform CTools about version information for various plugins implemented by
- * Panels.
- *
- * @param string $owner
- * The system name of the module owning the API about which information is
- * being requested.
- * @param string $api
- * The name of the API about which information is being requested.
- */
-function panels_ipe_ctools_plugin_api($owner, $api) {
- if ($owner == 'panels' && $api == 'pipelines') {
- return array(
- 'version' => 1,
- 'path' => drupal_get_path('module', 'panels_ipe') . '/includes',
- );
- }
-}
-
-/**
- * Implementation of hook_theme().
- */
-function panels_ipe_theme() {
- return array(
- 'panels_ipe_pane_wrapper' => array(
- 'variables' => array('output' => NULL, 'pane' => NULL, 'display' => NULL, 'renderer' => NULL),
- ),
- 'panels_ipe_region_wrapper' => array(
- 'variables' => array('output' => NULL, 'region_id' => NULL, 'display' => NULL, 'renderer' => NULL),
- ),
- 'panels_ipe_add_pane_button' => array(
- 'variables' => array('region_id' => NULL, 'display' => NULL, 'renderer' => NULL),
- ),
- 'panels_ipe_placeholder_pane' => array(
- 'variables' => array('region_id' => NULL, 'region_title' => NULL),
- ),
- 'panels_ipe_dnd_form_container' => array(
- 'variables' => array('link' => NULL, 'cache_key' => NULL, 'display' => NULL),
- ),
- );
-}
-
-/**
- * Theme the 'placeholder' pane, which is shown on an active IPE when no panes
- * live in that region.
- *
- * @param string $region_id
- * @param string $region_title
- */
-function theme_panels_ipe_placeholder_pane($vars) {
- $region_id = $vars['region_id'];
- $region_title = $vars['region_title'];
-
- $output = '<div class="panels-ipe-placeholder-content">';
- $output .= "<h3>$region_title</h3>";
- $output .= '</div>';
- return $output;
-}
-
-function theme_panels_ipe_pane_wrapper($vars) {
- $output = $vars['output'];
- $pane = $vars['pane'];
- $display = $vars['display'];
- $renderer = $vars['renderer'];
-
- $content_type = ctools_get_content_type($pane->type);
- $subtype = ctools_content_get_subtype($content_type, $pane->subtype);
- $links = array();
-
- if (ctools_content_editable($content_type, $subtype, $pane->configuration)) {
- $links['edit'] = array(
- 'title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'),
- 'href' => $renderer->get_url('edit-pane', $pane->pid),
- 'attributes' => array(
- 'class' => 'ctools-use-modal',
- // 'id' => "pane-edit-panel-pane-$pane->pid",
- ),
- );
- }
-
- // Deleting is managed entirely in the js; this is just an attachment point
- // for it
- $links['delete'] = array(
- 'title' => t('Delete'),
- 'href' => '#',
- 'attributes' => array(
- 'class' => 'pane-delete',
- 'id' => "pane-delete-panel-pane-$pane->pid",
- ),
- );
-
- $attributes = array(
- 'class' => 'panels-ipe-linkbar',
- );
-
- $links = theme('links', array('links' => $links, 'attributes' => $attributes));
- $links .= '<div class="panels-ipe-draghandle">&nbsp;</div>';
- $handlebar = '<div class="panels-ipe-handlebar-wrapper panels-ipe-on clearfix">' . $links . '</div>';
- return $handlebar . $output;
-}
-
-function theme_panels_ipe_region_wrapper($vars) {
- return $vars['output'];
-}
-
-function theme_panels_ipe_add_pane_button($vars) {
- $region_id = $vars['region_id'];
- $display = $vars['display'];
- $renderer = $vars['renderer'];
-
- $attributes = array('class' => 'ctools-use-modal');
- $link = l(t('Add new pane'), $renderer->get_url('select-content', $region_id), array('attributes' => $attributes));
- return '<div class="panels-ipe-newblock panels-ipe-on panels-ipe-portlet-static">' . $link . '</div>';
-}
-
-function panels_ipe_get_cache_key($key = NULL) {
- static $cache;
- if (isset($key)) {
- $cache = $key;
- }
- return $cache;
-}
-
-/**
- * Implementation of hook_footer()
- *
- * Adds the IPE control container.
- *
- * @param unknown_type $main
- */
-function panels_ipe_page_alter(&$page) {
- $key = panels_ipe_get_cache_key();
- if (!isset($key)) {
- return;
- }
-
- // TODO should be moved into the IPE plugin - WAAAY too hardcoded right now
- $output = "<div id='panels-ipe-control-container' class='clearfix'>";
- $output .= "<div id='panels-ipe-control-$key' class='panels-ipe-control'>";
- $output .= "<div class='panels-ipe-startedit panels-ipe-pseudobutton panels-ipe-off'>";
- $output .= "<span>" . t('Customize this page') . "</span>";
- $output .= "</div>";
- $output .= "<div class='panels-ipe-form-container panels-ipe-on clearfix'</div>";
- $output .= "</div></div>";
-
- $page['page_bottom']['panels_ipe'] = array(
- '#markup' => $output,
- );
-}
diff --git a/panels_ipe/plugins/display_renderers/ipe.inc b/panels_ipe/plugins/display_renderers/ipe.inc
deleted file mode 100644
index ab63f9e..0000000
--- a/panels_ipe/plugins/display_renderers/ipe.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
-$plugin = array(
- 'renderer' => 'panels_renderer_ipe',
-);
diff --git a/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php b/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php
deleted file mode 100644
index b3bcaba..0000000
--- a/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php
+++ /dev/null
@@ -1,258 +0,0 @@
-<?php
-
-/**
- * Renderer class for all In-Place Editor (IPE) behavior.
- */
-class panels_renderer_ipe extends panels_renderer_editor {
- // The IPE operates in normal render mode, not admin mode.
- var $admin = FALSE;
-
- function render() {
- $output = parent::render();
- return "<div id='panels-ipe-display-{$this->clean_key}' class='panels-ipe-display-container'>$output</div>";
- }
-
- function add_meta() {
- ctools_include('display-edit', 'panels');
- ctools_include('content');
-
- if (empty($this->display->cache_key)) {
- $this->cache = panels_edit_cache_get_default($this->display);
- }
- // @todo we may need an else to load the cache, but I am not sure we
- // actually need to load it if we already have our cache key, and doing
- // so is a waste of resources.
-
- ctools_include('cleanstring');
- $this->clean_key = ctools_cleanstring($this->display->cache_key);
- panels_ipe_get_cache_key($this->clean_key);
-
- ctools_include('ajax');
- ctools_include('modal');
- ctools_modal_add_js();
-
- ctools_add_css('panels_dnd', 'panels');
- ctools_add_css('panels_admin', 'panels');
- ctools_add_js('panels_ipe', 'panels_ipe');
- ctools_add_css('panels_ipe', 'panels_ipe');
-
- $settings = array(
- 'formPath' => url($this->get_url('save-form')),
- );
- drupal_add_js(array('PanelsIPECacheKeys' => array($this->clean_key)), 'setting');
- drupal_add_js(array('PanelsIPESettings' => array($this->clean_key => $settings)), 'setting');
-
- drupal_add_library('system', 'ui.draggable');
- drupal_add_library('system', 'ui.droppable');
- drupal_add_library('system', 'ui.sortable');
-// drupal_add_js('misc/ui/jquery.ui.draggable.min.js');
-// drupal_add_js('misc/ui/jquery.ui.droppable.min.js');
-// drupal_add_js('misc/ui/jquery.ui.sortable.min.js');
-// jquery_ui_add(array('ui.draggable', 'ui.droppable', 'ui.sortable'));
- parent::add_meta();
- }
-
- /**
- * Override & call the parent, then pass output through to the dnd wrapper
- * theme function.
- *
- * @param $pane
- */
- function render_pane(&$pane) {
- $output = parent::render_pane($pane);
- if (empty($output)) {
- return;
- }
-
- if (empty($pane->IPE_empty)) {
- // Add an inner layer wrapper to the pane content before placing it into
- // draggable portlet
- $output = "<div class=\"panels-ipe-portlet-content\">$output</div>";
- }
- else {
- $output = "<div class=\"panels-ipe-portlet-content panels-ipe-empty-pane\">$output</div>";
- }
- // Hand it off to the plugin/theme for placing draggers/buttons
- $output = theme('panels_ipe_pane_wrapper', array('output' => $output, 'pane' => $pane, 'display' => $this->display, 'renderer' => $this));
- return "<div id=\"panels-ipe-paneid-{$pane->pid}\" class=\"panels-ipe-portlet-wrapper panels-ipe-portlet-marker\">" . $output . "</div>";
- }
-
- function render_pane_content(&$pane) {
- $content = parent::render_pane_content($pane);
- // Ensure that empty panes have some content.
- if (empty($content->content)) {
- // Get the administrative title.
- $content_type = ctools_get_content_type($pane->type);
- $title = ctools_content_admin_title($content_type, $pane->subtype, $pane->configuration, $this->display->context);
-
- $content->content = t('Placeholder for empty "@title"', array('@title' => $title));
- $pane->IPE_empty = TRUE;
- }
-
- return $content;
- }
-
- /**
- * Add an 'empty' pane placeholder above all the normal panes.
- *
- * @param $region_id
- * @param $panes
- */
- function render_region($region_id, $panes) {
- // Generate this region's 'empty' placeholder pane from the IPE plugin.
- $empty_ph = theme('panels_ipe_placeholder_pane', array('region_id' => $region_id, 'region_title' => $this->plugins['layout']['regions'][$region_id]));
-
- // Wrap the placeholder in some guaranteed markup.
- $panes['empty_placeholder'] = '<div class="panels-ipe-placeholder panels-ipe-on panels-ipe-portlet-marker panels-ipe-portlet-static">' . $empty_ph . "</div>";
-
- // Generate this region's add new pane button. FIXME waaaaay too hardcoded
- $panes['add_button'] = theme('panels_ipe_add_pane_button', array('region_id' => $region_id, 'display' => $this->display, 'renderer' => $this));
-
- $output = parent::render_region($region_id, $panes);
- $output = theme('panels_ipe_region_wrapper', array('output' => $output, 'region_id' => $region_id, 'display' => $this->display, 'renderer' => $this));
- $classes = 'panels-ipe-region';
-
- ctools_include('cleanstring');
- $region_id = ctools_cleanstring($region_id);
- return "<div id='panels-ipe-regionid-$region_id' class='panels-ipe-region'>$output</div>";
- }
-
- /**
- * AJAX entry point to create the controller form for an IPE.
- */
- function ajax_save_form($break = NULL) {
- if (!empty($this->cache->locked)) {
- if ($break != 'break') {
- $account = user_load($this->cache->locked->uid);
- $name = theme('username', array('account' => $account));
- $lock_age = format_interval(time() - $this->cache->locked->updated);
-
- $message = t("This panel is being edited by user !user, and is therefore locked from editing by others. This lock is !age old.\n\nClick OK to break this lock and discard any changes made by !user.", array('!user' => $name, '!age' => $lock_age));
-
- $this->commands[] = array(
- 'command' => 'unlockIPE',
- 'message' => $message,
- 'break_path' => url($this->get_url('save-form', 'break'))
- );
- return;
- }
-
- // Break the lock.
- panels_edit_cache_break_lock($this->cache);
- }
-
- $form_state = array(
- 'display' => &$this->display,
- 'content_types' => $this->cache->content_types,
- 'rerender' => FALSE,
- 'no_redirect' => TRUE,
- // Panels needs this to make sure that the layout gets callbacks
- 'layout' => $this->plugins['layout'],
- );
-
- $output = drupal_build_form('panels_ipe_edit_control_form', $form_state);
- if (empty($form_state['executed'])) {
- // At this point, we want to save the cache to ensure that we have a lock.
- panels_edit_cache_set($this->cache);
- $this->commands[] = array(
- 'command' => 'initIPE',
- 'key' => $this->clean_key,
- 'data' => drupal_render($output),
- );
- return;
- }
-
- // Otherwise it was submitted.
- if (!empty($form_state['clicked_button']['#save-display'])) {
- // Saved. Save the cache.
- panels_edit_cache_save($this->cache);
- }
- else {
- // Cancelled. Clear the cache.
- panels_edit_cache_clear($this->cache);
- }
-
- $this->commands[] = array(
- 'command' => 'endIPE',
- 'key' => $this->clean_key,
- 'data' => $output,
- );
- }
-
- /**
- * Create a command array to redraw a pane.
- */
- function command_update_pane($pid) {
- if (is_object($pid)) {
- $pane = $pid;
- }
- else {
- $pane = $this->display->content[$pid];
- }
-
- $this->commands[] = ajax_command_replace("#panels-ipe-paneid-$pane->pid", $this->render_pane($pane));
- $this->commands[] = ajax_command_changed("#panels-ipe-display-{$this->clean_key}");
- }
-
- /**
- * Create a command array to add a new pane.
- */
- function command_add_pane($pid) {
- if (is_object($pid)) {
- $pane = $pid;
- }
- else {
- $pane = $this->display->content[$pid];
- }
-
- ctools_include('cleanstring');
- $region_id = ctools_cleanstring($pane->panel);
- $this->commands[] = ajax_command_append("#panels-ipe-regionid-$region_id div.panels-ipe-sort-container", $this->render_pane($pane));
- $this->commands[] = ajax_command_changed("#panels-ipe-display-{$this->clean_key}");
- }
-}
-
-/**
- * FAPI callback to create the Save/Cancel form for the IPE.
- */
-function panels_ipe_edit_control_form($form, &$form_state) {
- $display = &$form_state['display'];
- // @todo -- this should be unnecessary as we ensure cache_key is set in add_meta()
-// $display->cache_key = isset($display->cache_key) ? $display->cache_key : $display->did;
-
- // Annoyingly, theme doesn't have access to form_state so we have to do this.
- $form['#display'] = $display;
-
- $layout = panels_get_layout($display->layout);
- $layout_panels = panels_get_regions($layout, $display);
-
- $form['panel'] = array('#tree' => TRUE);
- $form['panel']['pane'] = array('#tree' => TRUE);
-
- foreach ($layout_panels as $panel_id => $title) {
- // Make sure we at least have an empty array for all possible locations.
- if (!isset($display->panels[$panel_id])) {
- $display->panels[$panel_id] = array();
- }
-
- $form['panel']['pane'][$panel_id] = array(
- // Use 'hidden' instead of 'value' so the js can access it.
- '#type' => 'hidden',
- '#default_value' => implode(',', (array) $display->panels[$panel_id]),
- );
- }
-
- $form['buttons']['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- '#id' => 'panels-ipe-save',
- '#submit' => array('panels_edit_display_form_submit'),
- '#save-display' => TRUE,
- );
- $form['buttons']['cancel'] = array(
- '#type' => 'submit',
- '#id' => 'panels-ipe-cancel',
- '#value' => t('Cancel'),
- );
- return $form;
-}
diff --git a/panels_mini/panels_mini.info b/panels_mini/panels_mini.info
deleted file mode 100644
index 0eae9f5..0000000
--- a/panels_mini/panels_mini.info
+++ /dev/null
@@ -1,6 +0,0 @@
-name = Mini panels
-description = Create mini panels that can be used as blocks by Drupal and panes by other panel modules.
-package = "Panels"
-dependencies[] = panels
-core = 7.x
-files[] = plugins/export_ui/panels_mini_ui.class.php \ No newline at end of file
diff --git a/panels_mini/panels_mini.install b/panels_mini/panels_mini.install
deleted file mode 100644
index 7313d4b..0000000
--- a/panels_mini/panels_mini.install
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-
-/**
- * Implementation of hook_schema().
- */
-function panels_mini_schema() {
- // This should always point to our 'current' schema. This makes it relatively easy
- // to keep a record of schema as we make changes to it.
- return panels_mini_schema_1();
-}
-
-/**
- * Schema version 1 for Panels in D6.
- */
-function panels_mini_schema_1() {
- $schema = array();
-
- $schema['panels_mini'] = array(
- 'export' => array(
- 'identifier' => 'mini',
- 'load callback' => 'panels_mini_load',
- 'load all callback' => 'panels_mini_load_all',
- 'save callback' => 'panels_mini_save',
- 'delete callback' => 'panels_mini_delete',
- 'export callback' => 'panels_mini_export',
- 'api' => array(
- 'owner' => 'panels_mini',
- 'api' => 'panels_default',
- 'minimum_version' => 1,
- 'current_version' => 1,
- ),
- ),
- 'fields' => array(
- 'pid' => array(
- 'type' => 'serial',
- 'not null' => TRUE,
- 'no export' => TRUE,
- 'description' => 'The primary key for uniqueness.',
- ),
- 'name' => array(
- 'type' => 'varchar',
- 'length' => '255',
- 'description' => 'The unique name of the mini panel.',
- ),
- 'category' => array(
- 'type' => 'varchar',
- 'length' => '64',
- 'description' => 'The category this mini panel appears in on the add content pane.',
- ),
- 'did' => array(
- 'type' => 'int',
- 'no export' => TRUE,
- 'description' => 'The display ID of the panel.',
- ),
- 'admin_title' => array(
- 'type' => 'varchar',
- 'length' => '128',
- 'description' => 'The administrative title of the mini panel.',
- ),
- 'admin_description' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'description' => 'Administrative title of this mini panel.',
- 'object default' => '',
- ),
- 'requiredcontexts' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'description' => 'An array of required contexts.',
- ),
- 'contexts' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'description' => 'An array of contexts embedded into the panel.',
- ),
- 'relationships' => array(
- 'type' => 'text',
- 'size' => 'big',
- 'serialize' => TRUE,
- 'object default' => array(),
- 'description' => 'An array of relationships embedded into the panel.',
- ),
- ),
- 'primary key' => array('pid'),
- 'unique keys' => array(
- 'name' => array('name'),
- ),
- );
-
- return $schema;
-}
-
-/**
- * Implementation of hook_uninstall().
- */
-function panels_mini_uninstall() {
- $panels_exists = db_table_exists('panels_display');
-
- $result = db_query("SELECT * FROM {panels_mini}");
- $deltas = array();
- foreach ($result as $panel_mini) {
- // Delete all associated displays.
- if (!function_exists('panels_delete_display')) {
- require_once drupal_get_path('module', 'panels') .'/panels.module';
- }
- if ($panels_exists) {
- panels_delete_display($panel_mini->did);
- }
-
- $deltas[] = $panel_mini->pid;
- }
-
- if ($deltas) {
- // Delete all configured blocks.
- db_delete('block')
- ->condition('module', 'panels_mini')
- ->condition('delta', $deltas)
- ->execute();
- }
-}
diff --git a/panels_mini/panels_mini.module b/panels_mini/panels_mini.module
deleted file mode 100644
index 9f327b9..0000000
--- a/panels_mini/panels_mini.module
+++ /dev/null
@@ -1,429 +0,0 @@
-<?php
-
-/**
- * @file panels_mini.module
- *
- * This module provides mini panels which are basically panels that can be
- * used within blocks or other panels.
- */
-
-/**
- * Implementation of hook_permission().
- */
-function panels_mini_permission() {
- return array(
- 'create mini panels' => array(
- 'title' => t('Create mini panels'),
- 'description' => t('Create new mini panels'),
- ),
- 'administer mini panels' => array(
- 'title' => t('Administer mini panels'),
- 'description' => t('Edit and delete mini panels'),
- ),
- );
-}
-
-/**
- * Implementation of hook_menu().
- */
-function panels_mini_menu() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!defined('PANELS_REQUIRED_CTOOLS_API') || !module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return array();
- }
-
- $items['admin/structure/mini-panels/settings'] = array(
- 'title' => 'Settings',
- 'page callback' => 'panels_mini_settings',
- 'access arguments' => array('create mini panels'),
- 'type' => MENU_LOCAL_TASK,
- );
-
- // Also provide settings on the main panel UI
- $items['admin/structure/panels/settings/panels-mini'] = array(
- 'title' => 'Mini panels',
- 'page callback' => 'panels_mini_settings',
- 'access arguments' => array('create mini panels'),
- 'type' => MENU_LOCAL_TASK,
- );
-
- return $items;
-}
-
-/**
- * Settings for mini panels.
- */
-function panels_mini_settings() {
- ctools_include('common', 'panels');
- return drupal_get_form('panels_common_settings', 'panels_mini');
-}
-
-// ---------------------------------------------------------------------------
-// Allow the rest of the system access to mini panels
-
-/**
- * Implementation of hook_block_list().
- */
-function panels_mini_block_info() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!defined('PANELS_REQUIRED_CTOOLS_API') || !module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return array();
- }
-
- $blocks = array();
-
- $minis = panels_mini_load_all();
- foreach ($minis as $panel_mini) {
- if (empty($mini->disabled) && empty($mini->requiredcontext)) {
- $blocks[$panel_mini->name] = array(
- 'info' => t('Mini panel: "@title"', array('@title' => $panel_mini->admin_title)),
- 'cache' => DRUPAL_NO_CACHE,
- );
- }
- }
-
- return $blocks;
-}
-
-/**
- * Implementation of hook_block_view().
- */
-function panels_mini_block_view($delta = 0) {
- // static recursion protection.
- static $viewing = array();
- if (!empty($viewing[$delta])) {
- return;
- }
- $viewing[$delta] = TRUE;
-
- $panel_mini = panels_mini_load($delta);
- if (empty($panel_mini)) {
- // Bail out early if the specified mini panel doesn't exist.
- return;
- }
-
- ctools_include('context');
- $panel_mini->context = $panel_mini->display->context = ctools_context_load_contexts($panel_mini);
- $panel_mini->display->css_id = panels_mini_get_id($panel_mini->name);
-
- $block = array();
-
- $block['content'] = panels_render_display($panel_mini->display);
- $block['subject'] = $panel_mini->display->get_title();
-
- unset($viewing[$delta]);
- return $block;
-}
-
-/**
- * Implementation of hook_block_configure().
- */
-function panels_mini_block_configure($delta = 0) {
- return array(
- 'admin-shortcut' => array(
- '#value' => l(t('Manage this mini-panel'), 'admin/structure/mini-panels/' . $delta . '/edit')
- ),
- );
-}
-
-/**
- * Statically store all used IDs to ensure all mini panels get a unique id.
- */
-function panels_mini_get_id($name) {
- $id_cache = &drupal_static(__FUNCTION__, array());
-
- $id = 'mini-panel-' . $name;
- if (!empty($id_cache[$name])) {
- $id .= "-" . $id_cache[$name]++;
- }
- else {
- $id_cache[$name] = 1;
- }
-
- return $id;
-}
-
-// ---------------------------------------------------------------------------
-// Database functions.
-
-/**
- * Create a new page with defaults appropriately set from schema.
- */
-function panels_mini_new($set_defaults = TRUE) {
- ctools_include('export');
- return ctools_export_new_object('panels_mini', $set_defaults);
-}
-
-/**
- * Load a single mini panel.
- */
-function panels_mini_load($name) {
- $cache = &drupal_static('panels_mini_load_all', array());
-
- // We use array_key_exists because failed loads will be NULL and
- // isset() will try to load it again.
- if (!array_key_exists($name, $cache)) {
- ctools_include('export');
- $result = ctools_export_load_object('panels_mini', 'names', array($name));
- if (isset($result[$name])) {
- if (empty($result[$name]->display)) {
- $result[$name]->display = panels_load_display($result[$name]->did);
- if (!empty($result[$name]->title) && empty($result[$name]->display->title)) {
- $result[$name]->display->title = $result[$name]->title;
- }
- }
- $cache[$name] = $result[$name];
- if (!empty($result[$name]->title) && empty($result[$name]->admin_title)) {
- $cache[$name]->admin_title = $result[$name]->title;
- }
- }
- else {
- $cache[$name] = NULL;
- }
- }
-
- if (isset($cache[$name])) {
- return $cache[$name];
- }
-}
-
-/**
- * Load all mini panels.
- */
-function panels_mini_load_all($reset = FALSE) {
- $cache = &drupal_static('panels_mini_load_all', array());
- static $all_loaded = FALSE;
-
- // We check our own private static because individual minis could have
- // been loaded prior to load all and we need to know that.
- if (!$all_loaded || $reset) {
- $all_loaded = TRUE;
- if ($reset) {
- $cache = array();
- }
-
- ctools_include('export');
- $minis = ctools_export_load_object('panels_mini');
- $dids = array();
- foreach ($minis as $mini) {
- if (empty($cache[$mini->name])) {
- if (!empty($mini->did)) {
- $dids[$mini->did] = $mini->name;
- }
- else {
- // Translate old style titles into new titles.
- if (!empty($mini->title) && empty($mini->display->title)) {
- $mini->display->title = $mini->title;
- }
- }
- // Translate old style titles into new titles.
- if (isset($mini->title) && empty($mini->admin_title)) {
- $mini->admin_title = $mini->title;
- }
- $cache[$mini->name] = $mini;
- }
- }
-
- $displays = panels_load_displays(array_keys($dids));
- foreach ($displays as $did => $display) {
- if (!empty($cache[$dids[$did]]->title) && empty($display->title)) {
- $display->title = $cache[$dids[$did]]->title;
- }
- $cache[$dids[$did]]->display = $display;
- }
- }
-
- return $cache;
-}
-
-/**
- * Write a mini panel to the database.
- */
-function panels_mini_save(&$mini) {
- if (!empty($mini->display)) {
- $display = panels_save_display($mini->display);
- $mini->did = $display->did;
- }
-
- $update = (isset($mini->pid) && $mini->pid != 'new') ? array('pid') : array();
- drupal_write_record('panels_mini', $mini, $update);
-
- return $mini;
-}
-
-/**
- * Remove a mini panel.
- */
-function panels_mini_delete($mini) {
- db_delete('panels_mini')
- ->condition('name', $mini->name)
- ->execute();
-
- if ($mini->type != t('Overridden')) {
- // Also remove from block table as long as there isn't a default that may appear.
- db_delete('block')
- ->condition('delta', $mini->name)
- ->condition('module', 'panels_mini')
- ->execute();
- }
- return panels_delete_display($mini->did);
-}
-
-/**
- * Export a mini panel.
- */
-function panels_mini_export($mini, $indent = '') {
- ctools_include('export');
- $output = ctools_export_object('panels_mini', $mini, $indent);
- // Export the primary display
- $display = !empty($mini->display) ? $mini->display : panels_load_display($mini->did);
- $output .= panels_export_display($display, $indent);
- $output .= $indent . '$mini->display = $display' . ";\n";
- return $output;
-}
-
-/**
- * Remove the block version of mini panels from being available content types.
- */
-function panels_mini_ctools_block_info($module, $delta, &$info) {
- $info = NULL;
-}
-
-/**
- * Implementation of hook_ctools_plugin_directory() to let the system know
- * we implement task and task_handler plugins.
- */
-function panels_mini_ctools_plugin_directory($module, $plugin) {
- if ($module == 'ctools' && ($plugin == 'content_types' || $plugin == 'export_ui')) {
- return 'plugins/' . $plugin;
- }
-}
-
-/**
- * Get the display cache for the panels_mini plugin.
- */
-function _panels_mini_panels_cache_get($key) {
- ctools_include('export-ui');
- $plugin = ctools_get_export_ui('panels_mini');
- $handler = ctools_export_ui_get_handler($plugin);
- if (!$handler) {
- return;
- }
-
- $item = $handler->edit_cache_get($key);
- if (!$item) {
- $item = ctools_export_crud_load($handler->plugin['schema'], $key);
- }
-
- return array($handler, $item);
-}
-
-/**
- * Get display edit cache for the panels mini export UI
- *
- * The key is the second half of the key in this form:
- * panels_mini:TASK_NAME:HANDLER_NAME;
- */
-function panels_mini_panels_cache_get($key) {
- ctools_include('common', 'panels');
- list($handler, $item) = _panels_mini_panels_cache_get($key);
- if (isset($item->mini_panels_display_cache)) {
- return $item->mini_panels_display_cache;
- }
-
- $cache = new stdClass();
- $cache->display = $item->display;
- $cache->display->context = ctools_context_load_contexts($item);
- $cache->display->cache_key = 'panels_mini:' . $key;
- $cache->content_types = panels_common_get_allowed_types('panels_mini', $cache->display->context);
- $cache->display_title = TRUE;
-
- // @TODO support locking
- $cache->locked = FALSE;
-
- return $cache;
-}
-
-/**
- * Store a display edit in progress in the page cache.
- */
-function panels_mini_panels_cache_set($key, $cache) {
- list($handler, $item) = _panels_mini_panels_cache_get($key);
- $item->mini_panels_display_cache = $cache;
- $handler->edit_cache_set_key($item, $key);
-}
-
-/**
- * Save all changes made to a display using the panels mini UI cache.
- */
-function panels_mini_panels_cache_clear($key, $cache) {
- list($handler, $item) = _panels_mini_panels_cache_get($key);
- $handler->edit_cache_clear($item);
-}
-
-/**
- * Save all changes made to a display using the panels mini UI cache.
- */
-function panels_mini_panels_cache_save($key, $cache) {
- list($handler, $item) = _panels_mini_panels_cache_get($key);
- $item->display = $cache->display;
- panels_mini_save($item);
-
- $handler->edit_cache_clear($item);
-}
-
-/**
- * Break the lock on a panels mini page.
- */
-function panels_mini_panels_cache_break_lock($key, $cache) {
-}
-
-/**
- * Implementation of hook_panels_dashboard_blocks().
- *
- * Adds mini panels information to the Panels dashboard.
- */
-function panels_mini_panels_dashboard_blocks(&$vars) {
- $vars['links']['panels_mini'] = array(
- 'title' => l(t('Mini panel'), 'admin/structure/mini-panels/add'),
- 'description' => t('Mini panels are small content areas exposed as blocks, for when you need to have complex block layouts or layouts within layouts.'),
- 'weight' => -1,
- );
-
- // Load all mini panels and their displays.
- $panel_minis = panels_mini_load_all();
- $count = 0;
- $rows = array();
-
- foreach ($panel_minis as $panel_mini) {
- $rows[] = array(
- check_plain($panel_mini->admin_title),
- array(
- 'data' => l(t('Edit'), "admin/structure/mini-panels/list/$panel_mini->name/edit"),
- 'class' => 'links',
- ),
- );
-
- // Only show 10.
- if (++$count >= 10) {
- break;
- }
- }
-
- if ($rows) {
- $content = theme('table', array('rows' => $rows, 'attributes' => array('class' => 'panels-manage')));
- }
- else {
- $content = '<p>' . t('There are no mini panels.') . '</p>';
- }
-
- $vars['blocks']['panels_mini'] = array(
- 'weight' => -100,
- 'title' => t('Manage mini panels'),
- 'link' => l(t('Go to list'), 'admin/structure/mini-panels'),
- 'content' => $content,
- 'class' => 'dashboard-mini-panels',
- 'section' => 'left',
- );
-
-}
diff --git a/panels_mini/plugins/content_types/icon_panels_mini.png b/panels_mini/plugins/content_types/icon_panels_mini.png
deleted file mode 100644
index 6d0891b..0000000
--- a/panels_mini/plugins/content_types/icon_panels_mini.png
+++ /dev/null
Binary files differ
diff --git a/panels_mini/plugins/content_types/panels_mini.inc b/panels_mini/plugins/content_types/panels_mini.inc
deleted file mode 100644
index b6050f3..0000000
--- a/panels_mini/plugins/content_types/panels_mini.inc
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains the content type plugin for a mini panel. While this does not
- * need to be broken out into a .inc file, it's convenient that we do so
- * that we don't load code unneccessarily. Plus it demonstrates plugins
- * in modules other than Panels itself.
- *
- */
-
-/**
- * Specially named hook. for .inc file. This looks a little silly due to the
- * redundancy, but that's really just because the content type shares a
- * name with the module.
- */
-function panels_mini_panels_mini_ctools_content_types() {
- return array(
- 'title' => t('Mini panels'),
- 'content type' => 'panels_mini_panels_mini_content_type_content_type',
- );
-}
-
-/**
- * Return each available mini panel available as a subtype.
- */
-function panels_mini_panels_mini_content_type_content_type($subtype_id, $plugin) {
- $mini = panels_mini_load($subtype_id);
- return _panels_mini_panels_mini_content_type_content_type($mini);
-}
-
-/**
- * Return each available mini panel available as a subtype.
- */
-function panels_mini_panels_mini_content_type_content_types($plugin) {
- $types = array();
- foreach (panels_mini_load_all() as $mini) {
- $type = _panels_mini_panels_mini_content_type_content_type($mini);
- if ($type) {
- $types[$mini->name] = $type;
- }
- }
- return $types;
-}
-
-/**
- * Return an info array describing a single mini panel.
- */
-function _panels_mini_panels_mini_content_type_content_type($mini) {
- if (!empty($mini->disabled)) {
- return;
- }
-
- $title = filter_xss_admin($mini->admin_title);
- $type = array(
- 'title' => $title,
- // For now mini panels will just use the contrib block icon.
- 'icon' => 'icon_mini_panel.png',
- 'description' => $title,
- 'category' => !empty($mini->category) ? $mini->category : t('Mini panel'),
- );
- if (!empty($mini->requiredcontexts)) {
- $type['required context'] = array();
- foreach ($mini->requiredcontexts as $context) {
- $info = ctools_get_context($context['name']);
- // TODO: allow an optional setting
- $type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']);
- }
- }
- return $type;
-}
-
-/**
- * Render a mini panel called from a panels display.
- */
-function panels_mini_panels_mini_content_type_render($subtype, $conf, $panel_args, &$contexts) {
- static $viewing = array();
- $mini = panels_mini_load($subtype);
- if (!$mini) {
- return FALSE;
- }
- if (!empty($viewing[$mini->name])) {
- return FALSE;
- }
-
- // Load up any contexts we might be using.
- $context = ctools_context_match_required_contexts($mini->requiredcontexts, $contexts);
- $mini->context = $mini->display->context = ctools_context_load_contexts($mini, FALSE, $context);
-
- if (empty($mini) || !empty($mini->disabled)) {
- return;
- }
- $viewing[$mini->name] = TRUE;
-
- $mini->display->args = $panel_args;
- $mini->display->css_id = panels_mini_get_id($subtype);
- $mini->display->owner = $mini;
- // unique ID of this mini.
- $mini->display->owner->id = $mini->name;
-
- $block = new stdClass();
- $block->module = 'panels_mini';
- $block->delta = $subtype;
- $block->content = panels_render_display($mini->display);
- $block->title = $mini->display->get_title();
-
- unset($viewing[$mini->name]);
- return $block;
-}
-
-/**
- * Edit form for the mini panel content type.
- */
-function panels_mini_panels_mini_content_type_edit_form($form, &$form_state) {
- // Empty form to ensure we have the override title + context gadgets.
- return $form;
-}
-
-/**
- * Provide the administrative title of a mini panel.
- */
-function panels_mini_panels_mini_content_type_admin_title($subtype, $conf) {
- $mini = panels_mini_load($subtype);
- if (!$mini) {
- return t('Deleted/missing mini panel @name', array('@name' => $subtype));
- }
-
- $title = filter_xss_admin($mini->admin_title);
- if (empty($title)) {
- $title = t('Untitled mini panel');
- }
- return $title;
-}
-
diff --git a/panels_mini/plugins/export_ui/panels_mini.inc b/panels_mini/plugins/export_ui/panels_mini.inc
deleted file mode 100644
index 46cb894..0000000
--- a/panels_mini/plugins/export_ui/panels_mini.inc
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-$plugin = array(
- 'schema' => 'panels_mini',
- 'access' => 'administer mini panels',
- 'create access' => 'create mini panels',
-
- 'menu' => array(
- 'menu item' => 'mini-panels',
- 'menu title' => 'Mini panels',
- 'menu description' => 'Add, edit or delete mini panels, which can be used as blocks or content panes in other panels.',
- ),
-
- 'title singular' => t('mini panel'),
- 'title singular proper' => t('Mini panel'),
- 'title plural' => t('mini panels'),
- 'title plural proper' => t('Mini panels'),
-
- 'handler' => array(
- 'class' => 'panels_mini_ui',
- 'parent' => 'ctools_export_ui',
- ),
-
- 'use wizard' => TRUE,
- 'form info' => array(
- 'order' => array(
- 'basic' => t('Settings'),
- 'context' => t('Context'),
- 'layout' => t('Layout'),
- 'content' => t('Content'),
- ),
- // We have to add this form specially because it's invisible.
- 'forms' => array(
- 'move' => array(
- 'form id' => 'ctools_export_ui_edit_item_wizard_form',
- ),
- ),
- ),
-
-);
-
diff --git a/panels_mini/plugins/export_ui/panels_mini_ui.class.php b/panels_mini/plugins/export_ui/panels_mini_ui.class.php
deleted file mode 100644
index 2a760c1..0000000
--- a/panels_mini/plugins/export_ui/panels_mini_ui.class.php
+++ /dev/null
@@ -1,291 +0,0 @@
-<?php
-
-class panels_mini_ui extends ctools_export_ui {
- function init($plugin) {
- parent::init($plugin);
- ctools_include('context');
- }
-
- function list_form(&$form, &$form_state) {
- ctools_include('plugins', 'panels');
- $this->layouts = panels_get_layouts();
-
- parent::list_form($form, $form_state);
-
- $categories = $layouts = array('all' => t('- All -'));
- foreach ($this->items as $item) {
- $categories[$item->category] = $item->category ? $item->category : t('Mini panels');
- }
-
- $form['top row']['category'] = array(
- '#type' => 'select',
- '#title' => t('Category'),
- '#options' => $categories,
- '#default_value' => 'all',
- '#weight' => -10,
- );
-
- foreach ($this->layouts as $name => $plugin) {
- $layouts[$name] = $plugin['title'];
- }
-
- $form['top row']['layout'] = array(
- '#type' => 'select',
- '#title' => t('Layout'),
- '#options' => $layouts,
- '#default_value' => 'all',
- '#weight' => -9,
- );
- }
-
- function list_filter($form_state, $item) {
- if ($form_state['values']['category'] != 'all' && $form_state['values']['category'] != $item->category) {
- return TRUE;
- }
-
- if ($form_state['values']['layout'] != 'all' && $form_state['values']['layout'] != $item->display->layout) {
- return TRUE;
- }
-
- return parent::list_filter($form_state, $item);
- }
-
- function list_sort_options() {
- return array(
- 'disabled' => t('Enabled, title'),
- 'title' => t('Title'),
- 'name' => t('Name'),
- 'category' => t('Category'),
- 'storage' => t('Storage'),
- 'layout' => t('Layout'),
- );
- }
-
- function list_build_row($item, &$form_state, $operations) {
- // Set up sorting
- switch ($form_state['values']['order']) {
- case 'disabled':
- $this->sorts[$item->name] = empty($item->disabled) . $item->admin_title;
- break;
- case 'title':
- $this->sorts[$item->name] = $item->admin_title;
- break;
- case 'name':
- $this->sorts[$item->name] = $item->name;
- break;
- case 'category':
- $this->sorts[$item->name] = ($item->category ? $item->category : t('Mini panels')) . $item->admin_title;
- break;
- case 'layout':
- $this->sorts[$item->name] = $item->display->layout . $item->admin_title;
- break;
- case 'storage':
- $this->sorts[$item->name] = $item->type . $item->admin_title;
- break;
- }
-
- $layout = !empty($this->layouts[$item->display->layout]) ? $this->layouts[$item->display->layout]['title'] : t('Missing layout');
- $category = $item->category ? check_plain($item->category) : t('Mini panels');
-
- $this->rows[$item->name] = array(
- 'data' => array(
- array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')),
- array('data' => check_plain($item->name), 'class' => array('ctools-export-ui-name')),
- array('data' => $category, 'class' => array('ctools-export-ui-category')),
- array('data' => $layout, 'class' => array('ctools-export-ui-layout')),
- array('data' => $item->type, 'class' => array('ctools-export-ui-storage')),
- array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')),
- ),
- 'title' => !empty($item->admin_description) ? check_plain($item->admin_description) : '',
- 'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'),
- );
- }
-
- function list_table_header() {
- return array(
- array('data' => t('Title'), 'class' => array('ctools-export-ui-title')),
- array('data' => t('Name'), 'class' => array('ctools-export-ui-name')),
- array('data' => t('Category'), 'class' => array('ctools-export-ui-category')),
- array('data' => t('Layout'), 'class' => array('ctools-export-ui-layout')),
- array('data' => t('Storage'), 'class' => array('ctools-export-ui-storage')),
- array('data' => t('Operations'), 'class' => array('ctools-export-ui-operations')),
- );
- }
-
- function edit_form(&$form, &$form_state) {
- // Get the basic edit form
- parent::edit_form($form, $form_state);
-
- $form['category'] = array(
- '#type' => 'textfield',
- '#size' => 24,
- '#default_value' => $form_state['item']->category,
- '#title' => t('Category'),
- '#description' => t("The category that this mini-panel will be grouped into on the Add Content form. Only upper and lower-case alphanumeric characters are allowed. If left blank, defaults to 'Mini panels'."),
- );
-
- $form['title']['#title'] = t('Title');
- $form['title']['#description'] = t('The title for this mini panel. It can be overridden in the block configuration.');
- }
-
- /**
- * Validate submission of the mini panel edit form.
- */
- function edit_form_basic_validate($form, &$form_state) {
- parent::edit_form_validate($form, $form_state);
- if (preg_match("/[^A-Za-z0-9 ]/", $form_state['values']['category'])) {
- form_error($form['category'], t('Categories may contain only alphanumerics or spaces.'));
- }
- }
-
- function edit_form_submit(&$form, &$form_state) {
- parent::edit_form_submit($form, $form_state);
- $form_state['item']->category = $form_state['values']['category'];
- }
-
- function edit_form_context(&$form, &$form_state) {
- ctools_include('context-admin');
- ctools_context_admin_includes();
- ctools_add_css('ruleset');
-
- $form['right'] = array(
- '#prefix' => '<div class="ctools-right-container">',
- '#suffix' => '</div>',
- );
-
- $form['left'] = array(
- '#prefix' => '<div class="ctools-left-container clearfix">',
- '#suffix' => '</div>',
- );
-
- // Set this up and we can use CTools' Export UI's built in wizard caching,
- // which already has callbacks for the context cache under this name.
- $module = 'export_ui::' . $this->plugin['name'];
- $name = $this->edit_cache_get_key($form_state['item'], $form_state['form type']);
-
- ctools_context_add_context_form($module, $form, $form_state, $form['right']['contexts_table'], $form_state['item'], $name);
- ctools_context_add_required_context_form($module, $form, $form_state, $form['left']['required_contexts_table'], $form_state['item'], $name);
- ctools_context_add_relationship_form($module, $form, $form_state, $form['right']['relationships_table'], $form_state['item'], $name);
- }
-
- function edit_form_context_submit(&$form, &$form_state) {
- // Prevent this from going to edit_form_submit();
- }
-
- function edit_form_layout(&$form, &$form_state) {
- ctools_include('common', 'panels');
- ctools_include('display-layout', 'panels');
- ctools_include('plugins', 'panels');
-
- // @todo -- figure out where/how to deal with this.
- $form_state['allowed_layouts'] = 'panels_mini';
-
- if ($form_state['op'] == 'add' && empty($form_state['item']->display)) {
- $form_state['item']->display = panels_new_display();
- }
-
- $form_state['display'] = &$form_state['item']->display;
-
- // Tell the Panels form not to display buttons.
- $form_state['no buttons'] = TRUE;
-
- // Change the #id of the form so the CSS applies properly.
- $form['#id'] = 'panels-choose-layout';
- $form = panels_choose_layout($form, $form_state);
-
- if ($form_state['op'] == 'edit') {
- $form['buttons']['next']['#value'] = t('Change');
- }
- }
-
- /**
- * Validate that a layout was chosen.
- */
- function edit_form_layout_validate(&$form, &$form_state) {
- $display = &$form_state['display'];
- if (empty($form_state['values']['layout'])) {
- form_error($form['layout'], t('You must select a layout.'));
- }
- if ($form_state['op'] == 'edit') {
- if ($form_state['values']['layout'] == $display->layout) {
- form_error($form['layout'], t('You must select a different layout if you wish to change layouts.'));
- }
- }
- }
-
- /**
- * A layout has been selected, set it up.
- */
- function edit_form_layout_submit(&$form, &$form_state) {
- $display = &$form_state['display'];
- if ($form_state['op'] == 'edit') {
- if ($form_state['values']['layout'] != $display->layout) {
- $form_state['item']->temp_layout = $form_state['values']['layout'];
- $form_state['clicked_button']['#next'] = 'move';
- }
- }
- else {
- $form_state['item']->display->layout = $form_state['values']['layout'];
- }
- }
-
- /**
- * When a layout is changed, the user is given the opportunity to move content.
- */
- function edit_form_move(&$form, &$form_state) {
- $form_state['display'] = &$form_state['item']->display;
- $form_state['layout'] = $form_state['item']->temp_layout;
-
- ctools_include('common', 'panels');
- ctools_include('display-layout', 'panels');
- ctools_include('plugins', 'panels');
-
- // Tell the Panels form not to display buttons.
- $form_state['no buttons'] = TRUE;
-
- // Change the #id of the form so the CSS applies properly.
- $form = panels_change_layout($form, $form_state);
-
- // This form is outside the normal wizard list, so we need to specify the
- // previous/next forms.
- $form['buttons']['previous']['#next'] = 'layout';
- $form['buttons']['next']['#next'] = 'content';
- }
-
- function edit_form_move_submit(&$form, &$form_state) {
- panels_change_layout_submit($form, $form_state);
- }
-
- function edit_form_content(&$form, &$form_state) {
- ctools_include('ajax');
- ctools_include('plugins', 'panels');
- ctools_include('display-edit', 'panels');
- ctools_include('context');
-
- // If we are cloning an item, we MUST have this cached for this to work,
- // so make sure:
- if ($form_state['form type'] == 'clone' && empty($form_state['item']->export_ui_item_is_cached)) {
- $this->edit_cache_set($form_state['item'], 'clone');
- }
-
- $cache = panels_edit_cache_get('panels_mini:' . $this->edit_cache_get_key($form_state['item'], $form_state['form type']));
-
- $form_state['renderer'] = panels_get_renderer_handler('editor', $cache->display);
- $form_state['renderer']->cache = &$cache;
-
- $form_state['display'] = &$cache->display;
- $form_state['content_types'] = $cache->content_types;
- // Tell the Panels form not to display buttons.
- $form_state['no buttons'] = TRUE;
- $form_state['display_title'] = !empty($cache->display_title);
-
- $form = panels_edit_display_form($form, $form_state);
- // Make sure the theme will work since our form id is different.
- $form['#theme'] = 'panels_edit_display_form';
- }
-
- function edit_form_content_submit(&$form, &$form_state) {
- panels_edit_display_form_submit($form, $form_state);
- $form_state['item']->display = $form_state['display'];
- }
-}
diff --git a/panels_node/panels_node.info b/panels_node/panels_node.info
deleted file mode 100644
index 95ad2df..0000000
--- a/panels_node/panels_node.info
+++ /dev/null
@@ -1,7 +0,0 @@
-name = Panel nodes
-description = Create nodes that are divided into areas with selectable content.
-package = "Panels"
-dependencies[] = panels
-configure = admin/structure/panels
-core = 7.x
-files[] = panels_node.module
diff --git a/panels_node/panels_node.install b/panels_node/panels_node.install
deleted file mode 100644
index 4a34eff..0000000
--- a/panels_node/panels_node.install
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-
-/**
- * Implementation of hook_schema().
- */
-function panels_node_schema() {
- // This should always point to our 'current' schema. This makes it relatively easy
- // to keep a record of schema as we make changes to it.
- return panels_node_schema_1();
-}
-
-/**
- * Schema version 1 for Panels in D6.
- */
-function panels_node_schema_1() {
- $schema = array();
-
- $schema['panels_node'] = array(
- 'fields' => array(
- 'nid' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ),
- 'css_id' => array(
- 'type' => 'varchar',
- 'length' => '255',
- ),
- 'did' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- ),
- 'pipeline' => array(
- 'type' => 'varchar',
- 'length' => '255',
- ),
- ),
- 'primary key' => array('did'),
- );
-
- return $schema;
-}
-
-/**
- * Implementation of hook_install().
- */
-function panels_node_install() {
- db_query("UPDATE {system} SET weight = 11 WHERE name = 'panels_node'");
-}
-
-/**
- * Implementation of hook_uninstall().
- */
-function panels_node_uninstall() {
- db_query("DELETE FROM {node} WHERE type = 'panel'");
- drupal_uninstall_schema('panels_node');
-}
-
-/**
- * Implementation of hook_update to handle adding a pipeline
- */
-function panels_node_update_6001() {
- $ret = array();
- $field = array(
- 'type' => 'varchar',
- 'length' => '255',
- );
-
- db_add_field($ret, 'panels_node', 'pipeline', $field);
- return $ret;
-}
diff --git a/panels_node/panels_node.module b/panels_node/panels_node.module
deleted file mode 100644
index 4044c5a..0000000
--- a/panels_node/panels_node.module
+++ /dev/null
@@ -1,431 +0,0 @@
-<?php
-
-
-/**
- * @file panels_node.module
- *
- * This module provides the "panel" node type.
- * Panel nodes are useful to add additional content to the content area
- * on a per-node base.
- */
-
-// ---------------------------------------------------------------------------
-// General Drupal hooks
-
-/**
- * Implementation of hook_permission().
- */
-function panels_node_permission() {
- return array(
- 'create panel-nodes' => array(
- 'title' => t('Create panel nodes'),
- 'description' => t('Create new panel nodes.'),
- ),
- 'edit any panel-nodes' => array(
- 'title' => t('Edit any panel-nodes'),
- 'description' => t('Edit all pre-existing panel nodes regardless of ownership.'),
- ),
- 'edit own panel-nodes' => array(
- 'title' => t('Edit own panel nodes'),
- 'description' => t('Edit panel nodes owned by this user.'),
- ),
- 'administer panel-nodes' => array(
- 'title' => t('Administer panel nodes'),
- 'description' => t('Full administrative access to panel nodes including create, update and delete all'),
- ),
- 'delete any panel-nodes' => array(
- 'title' => t('Delete any panel nodes'),
- 'description' => t('Delete any panel node regardless of ownership'),
- ),
- 'delete own panel-nodes' => array(
- 'title' => t('Delete own panel nodes'),
- 'description' => t('Delete any panel node owned by this user.'),
- ),
- );
-}
-
-/**
- * Implementation of hook_menu().
- */
-function panels_node_menu() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!defined('PANELS_REQUIRED_CTOOLS_API') || !module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return array();
- }
-
- $items['admin/structure/panels/settings/panel-node'] = array(
- 'title' => 'Panel nodes',
- 'description' => 'Configure which content is available to add to panel node displays.',
- 'access arguments' => array('administer panel-nodes'),
- 'page callback' => 'panels_node_settings',
- 'type' => MENU_LOCAL_TASK,
- );
-
- // Avoid some repetition on these:
- $base = array(
- 'access callback' => 'panels_node_edit_node',
- 'access arguments' => array(1),
- 'page arguments' => array(1),
- 'type' => MENU_LOCAL_TASK,
- );
-
- $items['node/%node/panel_layout'] = array(
- 'title' => 'Panel layout',
- 'page callback' => 'panels_node_edit_layout',
- 'weight' => 2,
- ) + $base;
-
- $items['node/%node/panel_content'] = array(
- 'title' => 'Panel content',
- 'page callback' => 'panels_node_edit_content',
- 'weight' => 3,
- ) + $base;
-
- $items['node/add/panel/choose-layout'] = array(
- 'title' => 'Choose layout',
- 'access arguments' => array('create panel-nodes'),
- 'page callback' => 'panels_node_add',
- 'type' => MENU_CALLBACK,
- );
-
- return $items;
-}
-
-/**
- * Access callback to determine if a user has edit access
- */
-function panels_node_edit_node($node) {
- if (!isset($node->panels_node)) {
- return FALSE;
- }
-
- return node_access('update', $node);
-}
-
-/**
- * Override of node add page to force layout selection prior
- * to actually editing a node.
- */
-function panels_node_add() {
- $output = '';
-
- ctools_include('plugins', 'panels');
- ctools_include('common', 'panels');
-
- $layouts = panels_common_get_allowed_layouts('panels_node');
- return panels_common_print_layout_links($layouts, 'node/add/panel', array('query' => $_GET));
-}
-
-// ---------------------------------------------------------------------------
-// Node hooks
-
-/**
- * Implementation of hook_node_info().
- */
-function panels_node_node_info() {
- // Safety: go away if CTools is not at an appropriate version.
- if (!defined('PANELS_REQUIRED_CTOOLS_API') || !module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
- return array();
- }
-
- return array(
- 'panel' => array(
- 'name' => t('Panel'),
- // We use panels_node_hook so that panels_node private
- // callbacks do not get confused with panels versions of
- // nodeapi callbacks.
- 'base' => 'panels_node_hook',
- 'body_label' => t('Teaser'),
- 'description' => t("A panel layout broken up into rows and columns."),
- ),
- );
-}
-
-/**
- * Implementation of hook_access().
- */
-function panels_node_node_access($node, $op, $account) {
- if ($op == 'create' && $node != 'panel') {
- return NODE_ACCESS_IGNORE;
- }
-
- if (is_object($node) && $node->type != 'panel') {
- return NODE_ACCESS_IGNORE;
- }
-
- if (user_access('administer panel-nodes', $account)) {
- return NODE_ACCESS_ALLOW;
- }
-
- if ($op == 'create' && user_access('create panel-nodes', $account)) {
- return NODE_ACCESS_ALLOW;
- }
-
- if ($op == 'update' && (user_access('edit any panel-nodes', $account) || $node->uid == $account->uid && user_access('edit own panel-nodes', $account))) {
- return NODE_ACCESS_ALLOW;
- }
-
-
- if ($op == 'delete' && (user_access('delete any panel-nodes') || $node->uid == $account->uid && user_access('delete own panel-nodes'))) {
- return NODE_ACCESS_ALLOW;
- }
-}
-
-/**
- * Implementation of hook_form().
- */
-function panels_node_hook_form(&$node, &$form_state) {
- ctools_include('plugins', 'panels');
-
- $form['panels_node']['#tree'] = TRUE;
- if (empty($node->nid) && arg(0) == 'node' && arg(1) == 'add') {
- // Grab our selected layout from the $node, If it doesn't exist, try arg(3)
- // and if that doesn't work present them with a list to pick from.
- $panel_layout = isset($node->panel_layout) ? $node->panel_layout : arg(3);
- if (empty($panel_layout)) {
- $opts = $_GET;
- unset($opts['q']);
- return drupal_goto('node/add/panel/choose-layout', $opts);
- }
-
- $layout = panels_get_layout($panel_layout);
- if (empty($layout)) {
- return drupal_not_found();
- }
- $form['panels_node']['layout'] = array(
- '#type' => 'value',
- '#value' => $panel_layout,
- );
- }
-
- $type = node_type_get_type($node);
-
- $form['title'] = array(
- '#type' => 'textfield',
- '#title' => check_plain($type->title_label),
- '#required' => TRUE,
- '#default_value' => $node->title,
- );
-
- $css_id = '';
- if (!empty($node->panels_node['css_id'])) {
- $css_id = $node->panels_node['css_id'];
- }
-
- $form['panels_node']['css_id'] = array(
- '#type' => 'textfield',
- '#title' => t('CSS ID'),
- '#size' => 30,
- '#description' => t('An ID that can be used by CSS to style the panel.'),
- '#default_value' => $css_id,
- );
-
- // Support for different rendering pipelines
- // Mostly borrowed from panel_context.inc
- $pipelines = panels_get_renderer_pipelines();
-
- $options = array();
- foreach ($pipelines as $name => $pipeline) {
- $options[$name] = check_plain($pipeline->admin_title) . '<div class="description">' . check_plain($pipeline->admin_description) . '</div>';
- }
-
- $form['panels_node']['pipeline'] = array(
- '#type' => 'radios',
- '#options' => $options,
- '#title' => t('Renderer'),
- '#default_value' => isset($node->panels_node['pipeline']) ? $node->panels_node['pipeline'] : 'standard',
- );
-
- return $form;
-}
-
-/**
- * Implementation of hook_validate().
- */
-function panels_node_hook_validate($node, $form, &$form_state) {
- if (!$node->nid && empty($node->panels_node['layout'])) {
- form_error($form['panels_node']['layout'], t('Please select a layout.'));
- }
-}
-
-/**
- * Implementation of hook_load().
- *
- * Panels does not use revisions for nodes because that would open us up
- * to have completely separate displays, and we'd have to copy them,
- * and that's going to be a LOT of data.
- */
-function panels_node_hook_load($nodes) {
- // We shortcut this because only in some really drastic corruption circumstance will this
- // not work.
- $result = db_query("SELECT * FROM {panels_node} WHERE nid IN (:nids)", array(':nids' => array_keys($nodes)));
- foreach ($result as $record) {
- $nodes[$record->nid]->panels_node = (array) $record;
- }
-}
-
-/**
- * Implementation of hook_insert().
- */
-function panels_node_hook_insert(&$node) {
- // Create a new display and record that.
- $display = panels_new_display();
- $display->layout = $node->panels_node['layout'];
-
- // Special handling for nodes being imported from an export.module data dump.
- if (!empty($node->export_display)) {
- // This works by overriding the $display set above
- eval($node->export_display);
- unset($node->export_display);
- }
-
- panels_save_display($display);
- $node->panels_node['did'] = $display->did;
-
- db_insert('panels_node')
- ->fields(array(
- 'nid' => $node->nid,
- 'did' => $display->did,
- 'css_id' => $node->panels_node['css_id'],
- 'pipeline' => $node->panels_node['pipeline'],
- ))
- ->execute();
-}
-
-/**
- * Implementation of hook_delete().
- */
-function panels_node_hook_delete(&$node) {
- db_delete('panels_node')->condition('nid', $node->nid)->execute();
- if (!empty($node->panels_node['did'])) {
- panels_delete_display($node->panels_node['did']);
- }
-}
-
-/**
- * Implementation of hook_update().
- */
-function panels_node_hook_update($node) {
- db_update('panels_node')
- ->condition('nid', $node->nid)
- ->fields(array(
- 'css_id' => $node->panels_node['css_id'],
- 'pipeline' => $node->panels_node['pipeline'],
- ))
- ->execute();
-}
-
-/**
- * Implementation of hook_view().
- */
-function panels_node_hook_view($node, $view_mode) {
- static $rendering = array();
-
- // Prevent loops if someone foolishly puts the node inside itself:
- if (!empty($rendering[$node->nid])) {
- return $node;
- }
-
- $rendering[$node->nid] = TRUE;
- ctools_include('plugins', 'panels');
- if ($view_mode == 'teaser') {
- // Because our teasier is never the same as our content, *always* provide
- // the read more flag.
- $node->readmore = TRUE;
- }
- else {
- if (!empty($node->panels_node['did'])) {
- $display = panels_load_display($node->panels_node['did']);
- $display->css_id = $node->panels_node['css_id'];
- // TODO: Find a way to make sure this can't node_view.
- $display->context = panels_node_get_context($node);
- $renderer = panels_get_renderer($node->panels_node['pipeline'], $display);
- $node->content['body'] = array(
- '#markup' => panels_render_display($display, $renderer),
- '#weight' => 0,
- );
- }
- }
-
- unset($rendering[$node->nid]);
- return $node;
-}
-
-// ---------------------------------------------------------------------------
-// Administrative pages
-
-/**
- * Settings for panel nodes.
- */
-function panels_node_settings() {
- ctools_include('common', 'panels');
- return drupal_get_form('panels_common_settings', 'panels_node');
-}
-
-// ---------------------------------------------------------------------------
-// Meat of the Panels API; almost completely passing through to panels.module
-
-/**
- * Pass through to the panels layout editor.
- */
-function panels_node_edit_layout($node) {
-// ctools_include('plugins', 'panels');
- ctools_include('context');
- $display = panels_load_display($node->panels_node['did']);
- $display->context = panels_node_get_context($node);
- return panels_edit_layout($display, t('Save'), "node/$node->nid/panel_layout", 'panels_node');
-}
-
-/**
- * Pass through to the panels content editor.
- */
-function panels_node_edit_content($node) {
- ctools_include('context');
- $display = panels_load_display($node->panels_node['did']);
- $display->context = panels_node_get_context($node);
- ctools_include('common', 'panels');
- $content_types = panels_common_get_allowed_types('panels_node', $display->context);
-
- return panels_edit($display, "node/$node->nid/panel_content", $content_types);
-}
-
-/**
- * Build the context to use for a panel node.
- */
-function panels_node_get_context(&$node) {
- ctools_include('context');
- $context = ctools_context_create('node', $node);
- $context->identifier = t('This node');
- $context->keyword = 'node';
- return array('panel-node' => $context);
-}
-
-/**
- * Implementation of hook_export_node_alter()
- *
- * Integrate with export.module for saving panel_nodes into code.
- */
-function panels_node_export_node_alter(&$node, $original_node, $method) {
- if ($method == 'export') {
- $node_export_omitted = variable_get('node_export_omitted', array());
- if (variable_get('node_export_method', '') != 'save-edit' && (array_key_exists('panel', $node_export_omitted) && !$node_export_omitted['panel'])) {
- drupal_set_message(t("NOTE: in order to import panel_nodes you must first set the export.module settings to \"Save as a new node then edit\", otherwise it won't work."));
- }
- $display = panels_load_display($node->panels_node['did']);
- $export = panels_export_display($display);
- $node->export_display = $export;
- }
-}
-
-/**
- * Implementation of hook_panels_dashboard_blocks().
- *
- * Adds panel nodes information to the Panels dashboard.
- */
-function panels_node_panels_dashboard_blocks(&$vars) {
- $vars['links']['panels_node'] = array(
- 'title' => l(t('Panel node'), 'node/add/panel'),
- 'description' => t('Panel nodes are node content and appear in your searches, but are more limited than panel pages.'),
- 'weight' => -1,
- );
-}
diff --git a/plugins/cache/simple.inc b/plugins/cache/simple.inc
deleted file mode 100644
index 916df42..0000000
--- a/plugins/cache/simple.inc
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides a simple time-based caching option for panel panes.
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t("Simple cache"),
- 'description' => t('Simple caching is a time-based cache. This is a hard limit, and once cached it will remain that way until the time limit expires.'),
- 'cache get' => 'panels_simple_cache_get_cache',
- 'cache set' => 'panels_simple_cache_set_cache',
- 'cache clear' => 'panels_simple_cache_clear_cache',
- 'settings form' => 'panels_simple_cache_settings_form',
- 'settings form submit' => 'panels_simple_cache_settings_form_submit',
- 'defaults' => array(
- 'lifetime' => 15,
- 'granularity' => 'none',
- ),
-);
-
-/**
- * Get cached content.
- */
-function panels_simple_cache_get_cache($conf, $display, $args, $contexts, $pane = NULL) {
- $cid = panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane);
- $cache = cache_get($cid, 'cache');
- if (!$cache) {
- return FALSE;
- }
-
- if ((time() - $cache->created) > $conf['lifetime']) {
- return FALSE;
- }
-
- return $cache->data;
-}
-
-/**
- * Set cached content.
- */
-function panels_simple_cache_set_cache($conf, $content, $display, $args, $contexts, $pane = NULL) {
- $cid = panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane);
- cache_set($cid, $content);
-}
-
-/**
- * Clear cached content.
- *
- * Cache clears are always for an entire display, regardless of arguments.
- */
-function panels_simple_cache_clear_cache($display) {
- $cid = 'panels_simple_cache';
-
- // This is used in case this is an in-code display, which means did will be something like 'new-1'.
- if (isset($display->owner) && isset($display->owner->id)) {
- $cid .= ':' . $display->owner->id;
- }
- $cid .= ':' . $display->did;
-
- cache_clear_all($cid, 'cache', TRUE);
-}
-
-/**
- * Figure out an id for our cache based upon input and settings.
- */
-function panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane) {
- $id = 'panels_simple_cache';
-
- // This is used in case this is an in-code display, which means did will be something like 'new-1'.
- if (isset($display->owner) && isset($display->owner->id)) {
- $id .= ':' . $display->owner->id;
- }
- $id .= ':' . $display->did;
-
- if ($pane) {
- $id .= ':' . $pane->pid;
- }
-
- if (user_access('view pane admin links')) {
- $id .= ':admin';
- }
-
- switch ($conf['granularity']) {
- case 'args':
- foreach ($args as $arg) {
- $id .= ':' . $arg;
- }
- break;
-
- case 'context':
- if (!is_array($contexts)) {
- $contexts = array($contexts);
- }
- foreach ($contexts as $context) {
- if (isset($context->argument)) {
- $id .= ':' . $context->argument;
- }
- }
- }
- if (module_exists('locale')) {
- global $language;
- $id .= ':' . $language->language;
- }
-
- if($pane->configuration['use_pager'] == 1) {
- $id .= ':p' . check_plain($_GET['page']);
- }
-
- return $id;
-}
-
-function panels_simple_cache_settings_form($conf, $display, $pid) {
- $options = drupal_map_assoc(array(15, 30, 60, 120, 180, 240, 300, 600, 900, 1200, 1800, 3600, 7200, 14400, 28800, 43200, 86400, 172800, 259200, 345600, 604800), 'format_interval');
- $form['lifetime'] = array(
- '#title' => t('Lifetime'),
- '#type' => 'select',
- '#options' => $options,
- '#default_value' => $conf['lifetime'],
- );
-
- $form['granularity'] = array(
- '#title' => t('Granularity'),
- '#type' => 'select',
- '#options' => array(
- 'args' => t('Arguments'),
- 'context' => t('Context'),
- 'none' => t('None'),
- ),
- '#description' => t('If "arguments" are selected, this content will be cached per individual argument to the entire display; if "contexts" are selected, this content will be cached per unique context in the pane or display; if "neither" there will be only one cache for this pane.'),
- '#default_value' => $conf['granularity'],
- );
-
- return $form;
-}
-
diff --git a/plugins/display_renderers/editor.inc b/plugins/display_renderers/editor.inc
deleted file mode 100644
index 6bfdf84..0000000
--- a/plugins/display_renderers/editor.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
-$plugin = array(
- 'renderer' => 'panels_renderer_editor',
-);
diff --git a/plugins/display_renderers/panels_renderer_editor.class.php b/plugins/display_renderers/panels_renderer_editor.class.php
deleted file mode 100644
index 66513db..0000000
--- a/plugins/display_renderers/panels_renderer_editor.class.php
+++ /dev/null
@@ -1,1889 +0,0 @@
-<?php
-
-/**
- * @file
- * Class file to control the main Panels editor.
- */
-
-class panels_renderer_editor extends panels_renderer_standard {
-
- /**
- * An array of AJAX commands to return. If populated it will automatically
- * be used by the AJAX router.
- */
- var $commands = array();
- var $admin = TRUE;
- // -------------------------------------------------------------------------
- // Display edit rendering.
-
- function edit() {
- $form_state = array(
- 'display' => &$this->display,
- 'renderer' => &$this,
- 'content_types' => $this->cache->content_types,
- 'no_redirect' => TRUE,
- 'display_title' => !empty($this->cache->display_title),
- 'cache key' => $this->display->cache_key,
- );
-
- $output = drupal_build_form('panels_edit_display_form', $form_state);
- if (empty($form_state['executed']) || !empty($form_state['clicked_button']['preview'])) {
- return $output;
- }
-
- if (!empty($form_state['clicked_button']['#save-display'])) {
- drupal_set_message(t('Panel content has been updated.'));
- panels_save_display($this->display);
- }
- else {
- drupal_set_message(t('Your changes have been discarded.'));
- }
-
- panels_cache_clear('display', $this->display->did);
- return $this->display;
- }
-
- function add_meta() {
- parent::add_meta();
- if ($this->admin) {
- ctools_include('ajax');
- ctools_include('modal');
- ctools_modal_add_js();
-
- ctools_add_js('panels-base', 'panels');
- ctools_add_js('display_editor', 'panels');
- ctools_add_css('panels_dnd', 'panels');
- ctools_add_css('panels_admin', 'panels');
- }
- }
-
- function render() {
- // Pass through to normal rendering if not in admin mode.
- if (!$this->admin) {
- return parent::render();
- }
-
- $this->add_meta();
-
- $output = '<div class="panels-dnd" id="panels-dnd-main">';
- $output .= $this->render_layout();
- $output .= '</div>';
-
- return $output;
- }
-
- function render_region($region_id, $panes) {
- // Pass through to normal rendering if not in admin mode.
- if (!$this->admin) {
- return parent::render_region($region_id, $panes);
- }
-
- $content = implode('', $panes);
-
- $panel_buttons = $this->get_region_links($region_id);
-
- // @todo this should be panel-region not panels-display -- but CSS and .js has to be updated.
- $output = "<div class='panels-display' id='panel-pane-$region_id'>";
- $output .= $panel_buttons;
- $output .= "<h2 class='label'>" . $this->plugins['layout']['regions'][$region_id] . "</h2>";
- $output .= $content;
- $output .= "</div>";
-
- return $output;
- }
-
- function render_pane(&$pane) {
- // Pass through to normal rendering if not in admin mode.
- if (!$this->admin) {
- return parent::render_pane($pane);
- }
-
- ctools_include('content');
- $content_type = ctools_get_content_type($pane->type);
-
- // This is just used for the title bar of the pane, not the content itself.
- // If we know the content type, use the appropriate title for that type,
- // otherwise, set the title using the content itself.
- $title = ctools_content_admin_title($content_type, $pane->subtype, $pane->configuration, $this->display->context);
- if (!$title) {
- $title = t('Deleted/missing content type @type', array('@type' => $pane->type));
- }
-
- $buttons = $this->get_pane_links($pane, $content_type);
-
- // Render administrative buttons for the pane.
-
- $block = new stdClass();
- if (empty($content_type)) {
- $block->title = '<em>' . t('Missing content type') . '</em>';
- $block->content = t('This pane\'s content type is either missing or has been deleted. This pane will not render.');
- }
- else {
- $block = ctools_content_admin_info($content_type, $pane->subtype, $pane->configuration, $this->display->context);
- }
-
- $output = '';
- $class = 'panel-pane';
-
- if (empty($pane->shown)) {
- $class .= ' hidden-pane';
- }
-
- if (isset($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
- $class .= ' panel-pane-is-title';
- }
-
- $output = '<div class="' . $class . '" id="panel-pane-' . $pane->pid . '">';
-
- if (!$block->title) {
- $block->title = t('No title');
- }
-
- $output .= '<div class="grabber">';
- if ($buttons) {
- $output .= '<span class="buttons">' . $buttons . '</span>';
- }
- $output .= '<span class="text">' . $title . '</span>';
- $output .= '</div>'; // grabber
-
- $output .= '<div class="panel-pane-collapsible">';
- $output .= '<div class="pane-title">' . $block->title . '</div>';
- $output .= '<div class="pane-content">' . filter_xss_admin(render($block->content)) . '</div>';
- $output .= '</div>'; // panel-pane-collapsible
-
- $output .= '</div>'; // panel-pane
-
- return $output;
- }
-
- /**
- * Get the style links.
- *
- * This is abstracted out since we have styles on both panes and regions.
- */
- function get_style_links($type, $id = NULL) {
- $info = $this->get_style($type, $id);
- $style = $info[0];
- $conf = $info[1];
-
- $style_title = isset($style['title']) ? $style['title'] : t('Default');
-
- $style_links[] = array(
- 'title' => $style_title,
- 'attributes' => array('class' => array('panels-text')),
- );
-
- $style_links[] = array(
- 'title' => t('Change'),
- 'href' => $this->get_url('style-type', $type, $id),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
-
- $function = $type != 'pane' ? 'settings form' : 'pane settings form';
- if (panels_plugin_get_function('styles', $style, $function)) {
- $style_links[] = array(
- 'title' => t('Settings'),
- 'href' => $this->get_url('style-settings', $type, $id),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
-
- return $style_links;
- }
-
- /**
- * Get the links for a panel display.
- *
- * This is abstracted out for easy ajax replacement.
- */
- function get_display_links() {
- $links = array();
- $style_links = $this->get_style_links('display');
- $links[] = array(
- 'title' => '<span class="dropdown-header">' . t('Style') . '</span>' . theme_links(array('links' => $style_links, 'attributes' => array(), 'heading' => array())),
- 'html' => TRUE,
- 'attributes' => array('class' => array('panels-sub-menu')),
- );
-
- if (user_access('use panels caching features')) {
- $links[] = array(
- 'title' => '<hr />',
- 'html' => TRUE,
- );
-
- $method = isset($this->display->cache['method']) ? $this->display->cache['method'] : 0;
- $info = panels_get_cache($method);
- $cache_method = isset($info['title']) ? $info['title'] : t('No caching');
-
- $cache_links[] = array(
- 'title' => $cache_method,
- 'attributes' => array('class' => array('panels-text')),
- );
- $cache_links[] = array(
- 'title' => t('Change'),
- 'href' => $this->get_url('cache-method', 'display'),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- if (panels_plugin_get_function('cache', $info, 'settings form')) {
- $cache_links[] = array(
- 'title' => t('Settings'),
- 'href' => $this->get_url('cache-settings', 'display'),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
-
- $links[] = array(
- 'title' => '<span class="dropdown-header">' . t('Caching') . '</span>' . theme_links(array('links' => $cache_links, 'attributes' => array(), 'heading' => array())),
- 'html' => TRUE,
- 'attributes' => array('class' => array('panels-sub-menu')),
- );
- }
-
- return theme('ctools_dropdown', array('title' => t('Display settings'), 'link' => $links, 'class' => 'panels-display-links'));
- }
-
- /**
- * Render the links to display when editing a region.
- */
- function get_region_links($region_id) {
- $links = array();
- $links[] = array(
- 'title' => t('Add content'),
- 'href' => $this->get_url('select-content', $region_id),
- 'attributes' => array(
- 'class' => array('ctools-use-modal'),
- ),
- );
-
- $links[] = array(
- 'title' => '<hr />',
- 'html' => TRUE,
- );
-
- $style_links = $this->get_style_links('region', $region_id);
-
- $links[] = array(
- 'title' => '<span class="dropdown-header">' . t('Style') . '</span>' . theme_links(array('links' => $style_links, 'attributes' => array(), 'heading' => array())),
- 'html' => TRUE,
- 'attributes' => array('class' => array('panels-sub-menu')),
- );
-
- return theme('ctools_dropdown', array('title' => theme('image', array('path' => ctools_image_path('icon-addcontent.png', 'panels'))), 'links' => $links, 'image' => TRUE, 'class' => 'pane-add-link panels-region-links-' . $region_id));
- }
-
- /**
- * Render the links to display when editing a pane.
- */
- function get_pane_links($pane, $content_type) {
- $links = array();
-
- if (!empty($pane->shown)) {
- $links[] = array(
- 'title' => t('Disable this pane'),
- 'href' => $this->get_url('hide', $pane->pid),
- 'attributes' => array('class' => array('use-ajax')),
- );
- }
- else {
- $links[] = array(
- 'title' => t('Enable this pane'),
- 'href' => $this->get_url('show', $pane->pid),
- 'attributes' => array('class' => array('use-ajax')),
- );
- }
-
- if (isset($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
- $links['panels-set-title'] = array(
- 'title' => t('&#x2713;Panel title'),
- 'html' => TRUE,
- );
- }
- else {
- $links['panels-set-title'] = array(
- 'title' => t('Panel title'),
- 'href' => $this->get_url('panel-title', $pane->pid),
- 'attributes' => array('class' => array('use-ajax')),
- );
- }
-
- $subtype = ctools_content_get_subtype($content_type, $pane->subtype);
-
- if (ctools_content_editable($content_type, $subtype, $pane->configuration)) {
- $links[] = array(
- 'title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'),
- 'href' => $this->get_url('edit-pane', $pane->pid),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
-
- if (user_access('administer advanced pane settings')) {
- $links[] = array(
- 'title' => t('CSS properties'),
- 'href' => $this->get_url('pane-css', $pane->pid),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
-
- $links[] = array(
- 'title' => '<hr />',
- 'html' => TRUE,
- );
-
- $style_links = $this->get_style_links('pane', $pane->pid);
-
- $links[] = array(
- 'title' => '<span class="dropdown-header">' . t('Style') . '</span>' . theme_links(array('links' => $style_links, 'attributes' => array(), 'heading' => array())),
- 'html' => TRUE,
- 'attributes' => array('class' => array('panels-sub-menu')),
- );
-
- if (user_access('administer pane access')) {
- $links[] = array(
- 'title' => '<hr />',
- 'html' => TRUE,
- );
-
- $contexts = $this->display->context;
- // Make sure we have the logged in user context
- if (!isset($contexts['logged-in-user'])) {
- $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
- }
-
- $visibility_links = array();
-
- if (!empty($pane->access['plugins'])) {
- foreach ($pane->access['plugins'] as $id => $test) {
- $plugin = ctools_get_access_plugin($test['name']);
- $access_title = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%plugin' => $test['name']));
- $access_description = ctools_access_summary($plugin, $contexts, $test);
-
- $visibility_links[] = array(
- 'title' => $access_description,
- 'href' => $this->get_url('access-configure-test', $pane->pid, $id),
- 'attributes' => array('class' => array('ctools-use-modal', 'panels-italic')),
- );
- }
- }
- if (empty($visibility_links)) {
- $visibility_links[] = array(
- 'title' => t('No rules'),
- 'attributes' => array('class' => array('panels-text')),
- );
- }
-
- $visibility_links[] = array(
- 'title' => t('Add new rule'),
- 'href' => $this->get_url('access-add-test', $pane->pid),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
-
- $visibility_links[] = array(
- 'title' => t('Settings'),
- 'href' => $this->get_url('access-settings', $pane->pid),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
-
- $links[] = array(
- 'title' => '<span class="dropdown-header">' . t('Visibility rules') . '</span>' . theme_links(array('links' => $visibility_links, 'attributes' => array(), 'heading' => array())),
- 'html' => TRUE,
- 'attributes' => array('class' => array('panels-sub-menu')),
- );
- }
-
- if (panels_get_caches() && user_access('use panels caching features')) {
- $links[] = array(
- 'title' => '<hr />',
- 'html' => TRUE,
- );
-
- $method = isset($pane->cache['method']) ? $pane->cache['method'] : 0;
- $info = panels_get_cache($method);
- $cache_method = isset($info['title']) ? $info['title'] : t('No caching');
- $cache_links[] = array(
- 'title' => $cache_method,
- 'attributes' => array('class' => array('panels-text')),
- );
- $cache_links[] = array(
- 'title' => t('Change'),
- 'href' => $this->get_url('cache-method', $pane->pid),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- if (panels_plugin_get_function('cache', $info, 'settings form')) {
- $cache_links[] = array(
- 'title' => t('Settings'),
- 'href' => $this->get_url('cache-settings', $pane->pid),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
-
- $links[] = array(
- 'title' => '<span class="dropdown-header">' . t('Caching') . '</span>' . theme_links(array('links' => $cache_links, 'attributes' => array(), 'heading' => array())),
- 'html' => TRUE,
- 'attributes' => array('class' => array('panels-sub-menu')),
- );
- }
-
- $links[] = array(
- 'title' => '<hr />',
- 'html' => TRUE,
- );
-
- $links[] = array(
- 'title' => t('Remove'),
- 'href' => '#',
- 'attributes' => array(
- 'class' => array('pane-delete'),
- 'id' => "pane-delete-panel-pane-$pane->pid",
- ),
- );
-
- return theme('ctools_dropdown', array('title' => theme('image', array('path' => ctools_image_path('icon-configure.png', 'panels'))), 'links' => $links, 'image' => TRUE));
- }
-
- // -----------------------------------------------------------------------
- // Display edit AJAX callbacks and helpers.
-
- /**
- * Generate a URL path for the AJAX editor.
- */
- function get_url() {
- $args = func_get_args();
- $command = array_shift($args);
- $url = 'panels/ajax/' . $this->plugin['name'] . '/' . $command . '/' . $this->display->cache_key;
- if ($args) {
- $url .= '/' . implode('/', $args);
- }
-
- return $url;
- }
-
- /**
- * AJAX command to show a pane.
- */
- function ajax_show($pid = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_ajax_render_error(t('Invalid pane id.'));
- }
-
- $this->display->content[$pid]->shown = TRUE;
- panels_edit_cache_set($this->cache);
-
- $this->command_update_pane($pid);
- }
-
- /**
- * AJAX command to show a pane.
- */
- function ajax_hide($pid = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_ajax_render_error(t('Invalid pane id.'));
- }
-
- $this->display->content[$pid]->shown = FALSE;
- panels_edit_cache_set($this->cache);
-
- $this->command_update_pane($pid);
- }
-
- /**
- * AJAX command to present a dialog with a list of available content.
- */
- function ajax_select_content($region = NULL, $category = NULL) {
- if (!array_key_exists($region, $this->plugins['layout']['regions'])) {
- ctools_modal_render(t('Error'), t('Invalid input'));
- }
-
- $title = t('Add content to !s', array('!s' => $this->plugins['layout']['regions'][$region]));
-
- $categories = $this->get_categories($this->cache->content_types);
-
- if (empty($categories)) {
- $output = t('There are no content types you may add to this display.');
- }
- else {
- $output = '<div class="panels-add-content-modal">';
- $selector = $this->render_category_selector($categories, $category, $region);
-
- $content = !empty($categories[$category]['content']) ? $categories[$category]['content'] : array();
- $center = $this->render_category($content, $category, $region);
-
- $output .= '<div class="panels-section-column panels-section-column-categories">'
- . '<div class="inside">' . $selector . '</div></div>';
- $output .= $center;
- $output .= '</div>'; // panels-add-content-modal
- }
-
- $this->commands[] = ctools_modal_command_display($title, $output);
- }
-
- /**
- * Return the category name and the category key of a given content
- * type.
- *
- * @todo -- this should be in CTools.
- */
- function get_category($content_type) {
- if (isset($content_type['top level'])) {
- $category = 'root';
- }
- else if (isset($content_type['category'])) {
- if (is_array($content_type['category'])) {
- list($category, $weight) = $content_type['category'];
- }
- else {
- $category = $content_type['category'];
- }
- }
- else {
- $category = t('Uncategorized');
- }
-
- return array(preg_replace('/[^a-z0-9]/', '-', strtolower($category)), $category);
- }
-
-
- /**
- * Create a list of categories from all of the content type.
- *
- * @return array
- * An array of categories. Each entry in the array will also be an array
- * with 'title' as the printable title of the category, and 'content'
- * being an array of all content in the category. Each item in the 'content'
- * array contain the array plugin definition so that it can be later
- * found in the content array. They will be keyed by the title so that they
- * can be sorted.
- */
- function get_categories($content_types) {
- $categories = array();
- $category_names = array();
-
- foreach ($content_types as $type_name => $subtypes) {
- foreach ($subtypes as $subtype_name => $content_type) {
- list($category_key, $category) = $this->get_category($content_type);
-
- if (empty($categories[$category_key])) {
- $categories[$category_key] = array(
- 'title' => $category,
- 'content' => array(),
- );
- $category_names[$category_key] = $category;
- }
-
- $content_title = filter_xss_admin($content_type['title']);
-
- // Ensure content with the same title doesn't overwrite each other.
- while (isset($categories[$category_key]['content'][$content_title])) {
- $content_title .= '-';
- }
-
- $categories[$category_key]['content'][$content_title] = $content_type;
- $categories[$category_key]['content'][$content_title]['type_name'] = $type_name;
- $categories[$category_key]['content'][$content_title]['subtype_name'] = $subtype_name;
- }
- }
-
- // Now sort
- natcasesort($category_names);
- foreach ($category_names as $category => $name) {
- $output[$category] = $categories[$category];
- }
-
- return $output;
- }
-
- /**
- * Render a single link to add a content type.
- */
- function render_add_content_link($region, $content_type) {
- $title = filter_xss_admin($content_type['title']);
- $description = isset($content_type['description']) ? $content_type['description'] : $title;
- $icon = ctools_content_admin_icon($content_type);
- $url = $this->get_url('add-pane', $region, $content_type['type_name'], $content_type['subtype_name']);
-
- $output = '<div class="content-type-button clearfix">';
- $output .= ctools_ajax_image_button($icon, $url, $description, 'panels-modal-add-config');
- $output .= '<div>' . ctools_ajax_text_button($title, $url, $description, 'panels-modal-add-config') . '</div>';
- $output .= '</div>';
-
- return $output;
- }
-
- /**
- * Render the selector widget in the add content modal to select categories.
- */
- function render_category_selector($categories, $category, $region) {
- $output = '<div class="panels-categories-box">';
-
- // Render our list of categories in column 0.
- foreach ($categories as $key => $category_info) {
- if ($key == 'root') {
- continue;
- }
-
- $class = 'panels-modal-add-category';
- if ($key == $category) {
- $class .= ' active';
- }
-
- $url = $this->get_url('select-content', $region, $key);
- $output .= ctools_ajax_text_button($category_info['title'], $url, '', $class);
- }
-
- $output .= '</div>'; // panels-categories-box
-
- if (!empty($categories['root'])) {
- foreach ($categories['root']['content'] as $content_type) {
- $output .= $this->render_add_content_link($region, $content_type);
- }
- }
-
- return $output;
- }
-
- /**
- * Render all of the content links in a category.
- */
- function render_category($content, $category, $region) {
- if (empty($category) || empty($content) || $category == 'root') {
- $output = '<div class="panels-categories-description">';
- $output .= t('Content options are divided by category. Please select a category from the left to proceed.');
- $output .= '</div>';
- }
- else {
- $titles = array_keys($content);
- natcasesort($titles);
-
- // Fill out the info for our current category.
- $columns = 2;
- $col[1] = '';
- $col[2] = '';
-
- $col_size = count($titles) / $columns;
- $count = 0;
- foreach ($titles as $title) {
- $which = floor($count++ / $col_size) + 1; // we leave 0 for the categories.
- $col[$which] .= $this->render_add_content_link($region, $content[$title]);
- }
-
- $output = '<div class="panels-section-columns">';
- foreach ($col as $id => $column) {
- $output .= '<div class="panels-section-column panels-section-column-' . $id . '">'
- . '<div class="inside">' . $column . '</div></div>';
- }
- $output .= '</div>'; // columns
- }
-
- if ($messages = theme('status_messages')) {
- $output = '<div class="messages">' . $messages . '</div>' . $output;
- }
- return $output;
- }
-
- /**
- * AJAX entry point to add a new pane.
- */
- function ajax_add_pane($region = NULL, $type_name = NULL, $subtype_name = NULL, $step = NULL) {
- $content_type = ctools_get_content_type($type_name);
- $subtype = ctools_content_get_subtype($content_type, $subtype_name);
-
- if (!isset($step) || !isset($this->cache->new_pane)) {
- $pane = panels_new_pane($type_name, $subtype_name, TRUE);
- $this->cache->new_pane = &$pane;
- }
- else {
- $pane = &$this->cache->new_pane;
- }
-
- $form_state = array(
- 'display' => &$this->cache->display,
- 'contexts' => $this->cache->display->context,
- 'pane' => &$pane,
- 'cache_key' => $this->display->cache_key,
- 'display cache' => &$this->cache,
- 'ajax' => TRUE,
- 'modal' => TRUE,
- // This will force the system to not automatically render.
- 'modal return' => TRUE,
- 'commands' => array(),
- );
-
- $form_info = array(
- 'path' => $this->get_url('add-pane', $region, $type_name, $subtype_name, '%step'),
- 'show cancel' => TRUE,
- 'next callback' => 'panels_ajax_edit_pane_next',
- 'finish callback' => 'panels_ajax_edit_pane_finish',
- 'cancel callback' => 'panels_ajax_edit_pane_cancel',
- );
-
- $output = ctools_content_form('add', $form_info, $form_state, $content_type, $pane->subtype, $subtype, $pane->configuration, $step);
-
- // If $rc is FALSE, there was no actual form.
- if ($output === FALSE || !empty($form_state['complete'])) {
- $pane = $this->cache->new_pane;
- unset($this->cache->new_pane);
-
- // Add the pane to the display
- $this->display->add_pane($pane, $region);
- panels_edit_cache_set($this->cache);
-
- // Tell the client to draw the pane
- $this->command_add_pane($pane);
-
- // Dismiss the modal.
- $this->commands[] = ctools_modal_command_dismiss();
- }
- else if (!empty($form_state['cancel'])) {
- // If cancelling, return to the activity.
- list($category_key, $category) = $this->get_category($subtype);
- $this->ajax_select_content($region, $category_key);
- }
- else {
- // This overwrites any previous commands.
- $this->commands = ctools_modal_form_render($form_state, $output);
- }
- }
-
- /**
- * AJAX entry point to edit a pane.
- */
- function ajax_edit_pane($pid = NULL, $step = NULL) {
- if (empty($this->cache->display->content[$pid])) {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- $pane = &$this->cache->display->content[$pid];
-
- $content_type = ctools_get_content_type($pane->type);
- $subtype = ctools_content_get_subtype($content_type, $pane->subtype);
-
- $form_state = array(
- 'display' => &$this->cache->display,
- 'contexts' => $this->cache->display->context,
- 'pane' => &$pane,
- 'display cache' => &$this->cache,
- 'ajax' => TRUE,
- 'modal' => TRUE,
- 'modal return' => TRUE,
- 'commands' => array(),
- );
-
- $form_info = array(
- 'path' => $this->get_url('edit-pane', $pid, '%step'),
- 'show cancel' => TRUE,
- 'next callback' => 'panels_ajax_edit_pane_next',
- 'finish callback' => 'panels_ajax_edit_pane_finish',
- 'cancel callback' => 'panels_ajax_edit_pane_cancel',
- );
-
- $output = ctools_content_form('edit', $form_info, $form_state, $content_type, $pane->subtype, $subtype, $pane->configuration, $step);
-
- // If $rc is FALSE, there was no actual form.
- if ($output === FALSE || !empty($form_state['cancel'])) {
- // Dismiss the modal.
- $this->commands[] = ctools_modal_command_dismiss();
- }
- else if (!empty($form_state['complete'])) {
- panels_edit_cache_set($this->cache);
- $this->command_update_pane($pid);
- $this->commands[] = ctools_modal_command_dismiss();
- }
- else {
- // This overwrites any previous commands.
- $this->commands = ctools_modal_form_render($form_state, $output);
- }
- }
-
- /**
- * AJAX entry point to select which pane is currently the title.
- *
- * @param string $pid
- * The pane id for the pane object whose title state we're setting.
- */
- function ajax_panel_title($pid = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_ajax_render_error(t('Invalid pane id.'));
- }
-
- $pane = &$this->display->content[$pid];
-
- $old_title = !empty($this->display->title_pane) ? $this->display->title_pane : NULL;
- $this->display->title_pane = $pid;
-
- panels_edit_cache_set($this->cache);
-
- $this->command_update_pane($pane);
-
- if ($old_title && !empty($this->cache->display->content[$old_title])) {
- $this->command_update_pane($this->cache->display->content[$old_title]);
- }
- }
-
- /**
- * AJAX entry point to configure the cache method for a pane or the display.
- *
- * @param string $pid
- * Either a pane id for a pane in the display, or 'display' to edit the
- * display cache settings.
- */
- function ajax_cache_method($pid = NULL) {
- ctools_include('content');
- // This lets us choose whether we're doing the display's cache or
- // a pane's.
- if ($pid == 'display') {
- $conf = &$this->display->cache;
- $title = t('Cache method for this display');
- }
- else if (!empty($this->display->content[$pid])) {
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
- $conf = &$pane->cache;
- $title = t('Cache method for !subtype_title', array('!subtype_title' => $subtype['title']));
- }
- else {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- $form_state = array(
- 'display' => &$this->display,
- 'conf' => &$conf,
- 'title' => $title,
- 'ajax' => TRUE,
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_cache_method_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- // Preserve this; this way we don't actually change the method until they
- // have saved the form.
- $info = panels_get_cache($form_state['method']);
- $function = panels_plugin_get_function('cache', $info, 'settings form');
- if (!$function) {
- $conf['method'] = $form_state['method'];
- $conf['settings'] = array();
- panels_edit_cache_set($this->cache);
-
- $this->commands[] = ctools_modal_command_dismiss();
-
- if ($pid != 'display') {
- $this->command_update_pane($pane);
- }
- else {
- $this->command_update_display_links();
- }
- }
- else {
- $this->cache->method = $form_state['method'];
- panels_edit_cache_set($this->cache);
- // send them to next form.
- return $this->ajax_cache_settings($pid);
- }
- }
-
- /**
- * AJAX entry point to configure the cache settings for a pane or the display.
- *
- * @param string $pid
- * Either a pane id for a pane in the display, or 'display' to edit the
- * display cache settings.
- */
- function ajax_cache_settings($pid = 0) {
- ctools_include('content');
-
- // This lets us choose whether we're doing the display's cache or
- // a pane's.
- if ($pid == 'display') {
- $conf = &$this->display->cache;
- $title = t('Cache settings for this display');
- }
- else if (!empty($this->display->content[$pid])) {
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
-
- $conf = &$pane->cache;
- $title = t('Cache settings for !subtype_title', array('!subtype_title' => $subtype['title']));
- }
- else {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- if (isset($this->cache->method) && (empty($conf['method']) || $conf['method'] != $this->cache->method)) {
- $conf['method'] = $this->cache->method;
- $info = panels_get_cache($conf['method']);
- $conf['settings'] = isset($info['defaults']) ? $info['defaults'] : array();
- }
-
- $form_state = array(
- 'display' => &$this->display,
- 'pid' => $pid,
- 'conf' => &$conf,
- 'ajax' => TRUE,
- 'title' => $title,
- 'url' => url($this->get_url('cache-settings', $pid), array('absolute' => TRUE)),
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_cache_settings_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- panels_edit_cache_set($this->cache);
-
- $this->commands[] = ctools_modal_command_dismiss();
-
- if ($pid != 'display') {
- $this->command_update_pane($pane);
- }
- else {
- $this->command_update_display_links();
- }
- }
-
- /**
- * AJAX entry point to select the style for a display, region or pane.
- *
- * @param string $type
- * Either display, region or pane
- * @param $pid
- * The pane id, if a pane. The region id, if a region.
- */
- function ajax_style_type($type, $pid = NULL) {
- // This lets us choose whether we're doing the display's cache or
- // a pane's.
- switch ($type) {
- case 'display':
- $style = isset($this->display->panel_settings['style']) ? $this->display->panel_settings['style'] : 'default';
- $title = t('Default style for this display');
- break;
-
- case 'region':
- $style = isset($this->display->panel_settings[$pid]['style']) ? $this->display->panel_settings[$pid]['style'] : '-1'; // -1 signifies to use the default setting.
- $title = t('Panel style for region "!region"', array('!region' => $this->plugins['layout']['regions'][$pid]));
- break;
-
- case 'pane':
- ctools_include('content');
- $pane = &$this->display->content[$pid];
- $style = isset($pane->style['style']) ? $pane->style['style'] : 'default';
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
- $title = t('Pane style for "!pane"', array('!pane' => $subtype['title']));
- break;
-
- default:
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
- $info = $this->get_style($type, $pid);
- $style_plugin = $info[0];
- $style_settings = $info[1];
-
- // Backward compatibility: Translate old-style stylizer to new style
- // stylizer.
- if ($style == 'stylizer' && !empty($style_settings['style']) && $style_settings['style'] != '$') {
- $style = 'stylizer:' . $style_settings['style'];
- }
-
- $form_state = array(
- 'display' => &$this->display,
- 'style' => $style,
- 'title' => $title,
- 'ajax' => TRUE,
- 'type' => $type,
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_style_type_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- // Preserve this; this way we don't actually change the method until they
- // have saved the form.
- $style = panels_get_style($form_state['style']);
- $function = panels_plugin_get_function('styles', $style, ($type == 'pane') ? 'pane settings form' : 'settings form');
- if (!$function) {
- if (isset($this->cache->style)) {
- unset($this->cache->style);
- }
-
- // If there's no settings form, just change the style and exit.
- switch($type) {
- case 'display':
- $this->display->panel_settings['style'] = $form_state['style'];
- if (isset($this->display->panel_settings['style_settings']['default'])) {
- unset($this->display->panel_settings['style_settings']['default']);
- }
- break;
-
- case 'region':
- $this->display->panel_settings[$pid]['style'] = $form_state['style'];
- if (isset($this->display->panel_settings['style_settings'][$pid])) {
- unset($this->display->panel_settings['style_settings'][$pid]);
- }
- break;
-
- case 'pane':
- $pane->style['style'] = $form_state['style'];
- if (isset($pane->style['settings'])) {
- unset($pane->style['settings']);
- }
-
- break;
- }
- panels_edit_cache_set($this->cache);
-
- $this->commands[] = ctools_modal_command_dismiss();
-
- if ($type == 'pane') {
- $this->command_update_pane($pane);
- }
- else if ($type == 'region') {
- $this->command_update_region_links($pid);
- }
- else {
- $this->command_update_display_links();
- }
- }
- else {
- if ($form_state['style'] != $form_state['old_style']) {
- $this->cache->style = $form_state['style'];
- panels_edit_cache_set($this->cache);
- }
-
- // send them to next form.
- return $this->ajax_style_settings($type, $pid);
- }
- }
-
- /**
- * Get the appropriate style from the panel in the cache.
- *
- * Since we have styles for regions, panes and the display itself, and
- * they are stored differently, we use this method to simplify getting
- * style information into a way that's easy to cope with.
- */
- function get_style($type, $pid = '') {
- if (isset($this->cache->style)) {
- $style = panels_get_style($this->cache->style);
- $defaults = isset($style['defaults']) ? $style['defaults'] : array();
- // Get the &$conf variable based upon whose style we're editing.
- switch ($type) {
- case 'display':
- $this->display->panel_settings['style'] = $this->cache->style;
- $this->display->panel_settings['style_settings']['default'] = $defaults;
- break;
-
- case 'region':
- $this->display->panel_settings[$pid]['style'] = $this->cache->style;
- $this->display->panel_settings['style_settings'][$pid] = $defaults;
- break;
-
- case 'pane':
- $pane = &$this->display->content[$pid];
- $pane->style['style'] = $this->cache->style;
- $pane->style['settings'] = $defaults;
- $conf = &$pane->style['settings'];
- break;
- }
- }
- else {
- switch ($type) {
- case 'display':
- $style = panels_get_style((!empty($this->display->panel_settings['style'])) ? $this->display->panel_settings['style'] : 'default');
- break;
-
- case 'region':
- $style = panels_get_style((!empty($this->display->panel_settings[$pid]['style'])) ? $this->display->panel_settings[$pid]['style'] : '-1');
- break;
-
- case 'pane':
- $pane = &$this->display->content[$pid];
- $style = panels_get_style(!empty($pane->style['style']) ? $pane->style['style'] : 'default');
- break;
- }
- }
-
- // Set up our $conf reference.
- switch ($type) {
- case 'display':
- $conf = &$this->display->panel_settings['style_settings']['default'];
- break;
-
- case 'region':
- $conf = &$this->display->panel_settings['style_settings'][$pid];
- break;
-
- case 'pane':
- ctools_include('content');
- $pane = &$this->display->content[$pid];
- $conf = &$pane->style['settings'];
- break;
- }
-
- // Backward compatibility: Translate old-style stylizer to new style
- // stylizer.
- if ($style['name'] == 'stylizer' && !empty($conf['style']) && $conf['style'] != '$') {
- $style = panels_get_style('stylizer:' . $conf['style']);
- }
-
- return array($style, &$conf);
- }
-
- /**
- * AJAX entry point to configure the style for a display, region or pane.
- *
- * @param string $type
- * Either display, region or pane
- * @param $pid
- * The pane id, if a pane. The region id, if a region.
- */
- function ajax_style_settings($type, $pid = '') {
- $info = $this->get_style($type, $pid);
- $style = $info[0];
- $conf = &$info[1];
-
- switch ($type) {
- case 'display':
- $title = t('Style settings for @style (display)', array('@style' => $style['title']));
- break;
-
- case 'region':
- $title = t('Style settings for style @style (Region "!region")', array('@style' => $style['title'], '!region' => $this->plugins['layout']['regions'][$pid]));
- break;
-
- case 'pane':
- ctools_include('content');
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
- $title = t('Style settings for style @style (Pane "!pane")', array('@style' => $style['title'], '!pane' => $subtype['title']));
- break;
- }
-
- $form_state = array(
- 'display' => &$this->display,
- 'type' => $type,
- 'pid' => $pid,
- 'conf' => &$conf,
- 'style' => $style,
- 'ajax' => TRUE,
- 'title' => $title,
- 'url' => url($this->get_url('style-settings', $type, $pid), array('absolute' => TRUE)),
- 'renderer' => &$this,
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_style_settings_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- if (isset($this->cache->style)) {
- unset($this->cache->style);
- }
-
- // $conf was a reference so it should just modify.
- panels_edit_cache_set($this->cache);
-
- $this->commands[] = ctools_modal_command_dismiss();
-
- if ($type == 'pane') {
- $this->command_update_pane($pane);
- }
- else if ($type == 'region') {
- $this->command_update_region_links($pid);
- }
- else {
- $this->command_update_display_links();
- }
- }
-
- /**
- * AJAX entry point to configure CSS for a pane.
- *
- * @param $pid
- * The pane id to edit.
- */
- function ajax_pane_css($pid = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
-
- $form_state = array(
- 'display' => &$this->display,
- 'pane' => &$pane,
- 'ajax' => TRUE,
- 'title' => t('Configure CSS on !subtype_title', array('!subtype_title' => $subtype['title'])),
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_configure_pane_css_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- panels_edit_cache_set($this->cache);
- $this->command_update_pane($pid);
- $this->commands[] = ctools_modal_command_dismiss();
- }
-
- /**
- * AJAX entry point to configure access settings for a pane.
- *
- * @param $pid
- * The pane id to edit.
- */
- function ajax_access_settings($pid = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
-
- $form_state = array(
- 'display' => &$this->display,
- 'pane' => &$pane,
- 'ajax' => TRUE,
- 'title' => t('Access settings on !subtype_title', array('!subtype_title' => $subtype['title'])),
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_configure_access_settings_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- panels_edit_cache_set($this->cache);
- $this->command_update_pane($pid);
- $this->commands[] = ctools_modal_command_dismiss();
- }
-
- /**
- * AJAX entry point for to add a visibility rule.
- */
- function ajax_access_add_test($pid = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
-
- $form_state = array(
- 'display' => &$this->display,
- 'pane' => &$pane,
- 'ajax' => TRUE,
- 'title' => t('Add visibility rule for !subtype_title', array('!subtype_title' => $subtype['title'])),
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_add_access_test_form', $form_state);
- if (!empty($form_state['executed'])) {
- // Set up the plugin in cache
- $plugin = ctools_get_access_plugin($form_state['values']['type']);
- $this->cache->new_plugin = ctools_access_new_test($plugin);
- panels_edit_cache_set($this->cache);
-
- // go to the next step.
- return $this->ajax_access_configure_test($pid, 'add');
- }
-
- $this->commands = $output;
- }
-
- /**
- * AJAX entry point for to configure vsibility rule.
- */
- function ajax_access_configure_test($pid = NULL, $id = NULL) {
- if (empty($this->display->content[$pid])) {
- ctools_modal_render(t('Error'), t('Invalid pane id.'));
- }
-
- $pane = &$this->display->content[$pid];
- $subtype = ctools_content_get_subtype($pane->type, $pane->subtype);
-
- // Set this up here because $id gets changed later.
- $url = $this->get_url('access-configure-test', $pid, $id);
-
- // If we're adding a new one, get the stored data from cache and
- // add it. It's stored as a cache so that if this is closed
- // we don't accidentally add an unconfigured plugin.
- if ($id == 'add') {
- $pane->access['plugins'][] = $this->cache->new_plugin;
- $id = max(array_keys($pane->access['plugins']));
- }
- else if (empty($pane->access['plugins'][$id])) {
- ctools_modal_render(t('Error'), t('Invalid test id.'));
- }
-
- $form_state = array(
- 'display' => &$this->display,
- 'pane' => &$pane,
- 'ajax' => TRUE,
- 'title' => t('Configure visibility rule for !subtype_title', array('!subtype_title' => $subtype['title'])),
- 'test' => &$pane->access['plugins'][$id],
- 'plugin' => ctools_get_access_plugin($pane->access['plugins'][$id]['name']),
- 'url' => url($url, array('absolute' => TRUE)),
- );
-
- $output = ctools_modal_form_wrapper('panels_edit_configure_access_test_form', $form_state);
- if (empty($form_state['executed'])) {
- $this->commands = $output;
- return;
- }
-
- // Unset the new plugin
- if (isset($this->cache->new_plugin)) {
- unset($this->cache->new_plugin);
- }
-
- if (!empty($form_state['remove'])) {
- unset($pane->access['plugins'][$id]);
- }
-
- panels_edit_cache_set($this->cache);
- $this->command_update_pane($pid);
- $this->commands[] = ctools_modal_command_dismiss();
- }
-
- /**
- * AJAX Router function for layout owned AJAX calls.
- *
- * Layouts like the flexible layout builder need callbacks of their own.
- * This allows those layouts to simply declare their callbacks and use
- * them with $this->get_url('layout', $command).
- */
- function ajax_layout() {
- $args = func_get_args();
- if (empty($args)) {
- return MENU_NOT_FOUND;
- }
-
- $command = array_shift($args);
- if (empty($this->plugins['layout']['ajax'][$command]) || !function_exists($this->plugins['layout']['ajax'][$command])) {
- return MENU_NOT_FOUND;
- }
-
- // Make sure the this is always available to the called functions.
- array_unshift($args, $this);
- return call_user_func_array($this->plugins['layout']['ajax'][$command], $args);
- }
-
- /**
- * AJAX Router function for style owned AJAX calls.
- *
- * Styles like the stylizer need AJAX callbacks of their own. This
- * allows the system to figure out which style is being referenced,
- * load it, and execute the callback.
- *
- * This allows those layouts to simply declare their callbacks and use
- * them using $this->get_url('style', $command, $type, $pid).
- */
- function ajax_style() {
- $args = func_get_args();
- if (count($args) < 3) {
- return MENU_NOT_FOUND;
- }
-
- $command = array_shift($args);
- $type = array_shift($args);
- $pid = array_shift($args);
-
- $info = $this->get_style($type, $pid);
-
- $style = $info[0];
- $conf = &$info[1];
-
- if (empty($style['ajax'][$command]) || !function_exists($style['ajax'][$command])) {
- return MENU_NOT_FOUND;
- }
-
- // Make sure the this is always available to the called functions.
- $args = array_merge(array(&$this, $style, &$conf, $type, $pid), $args);
- return call_user_func_array($style['ajax'][$command], $args);
- }
-
- // ------------------------------------------------------------------------
- // AJAX command generators
- //
- // These are used to make sure that child implementations can control their
- // own AJAX commands as needed.
-
- /**
- * Create a command array to redraw a pane.
- */
- function command_update_pane($pid) {
- if (is_object($pid)) {
- $pane = $pid;
- }
- else {
- $pane = $this->display->content[$pid];
- }
-
- $this->commands[] = ajax_command_replace("#panel-pane-$pane->pid", $this->render_pane($pane));
- $this->commands[] = ajax_command_changed("#panel-pane-$pane->pid", "div.grabber span.text");
- }
-
- /**
- * Create a command array to add a new pane.
- */
- function command_add_pane($pid) {
- if (is_object($pid)) {
- $pane = $pid;
- }
- else {
- $pane = $this->display->content[$pid];
- }
-
- $this->commands[] = ajax_command_append("#panel-pane-$pane->panel", $this->render_pane($pane));
- $this->commands[] = ajax_command_changed("#panel-pane-$pane->pid", "div.grabber span.text");
- }
-
- /**
- * Create a command to update the links on a display after a change was made.
- */
- function command_update_display_links() {
- $this->commands[] = ajax_command_replace('.panels-display-links', $this->get_display_links());
- }
-
- /**
- * Create a command to update the links on a region after a change was made.
- */
- function command_update_region_links($id) {
- $this->commands[] = ajax_command_replace('.panels-region-links-' . $id, $this->get_region_links($id));
- }
-}
-
-/**
- * Handle the 'next' click on the add/edit pane form wizard.
- *
- * All we need to do is store the updated pane in the cache.
- */
-function panels_ajax_edit_pane_next(&$form_state) {
- $form_state['display cache']->new_pane = $form_state['pane'];
- panels_edit_cache_set($form_state['display cache']);
-}
-
-/**
- * Handle the 'finish' click on teh add/edit pane form wizard.
- *
- * All we need to do is set a flag so the return can handle adding
- * the pane.
- */
-function panels_ajax_edit_pane_finish(&$form_state) {
- $form_state['complete'] = TRUE;
- return;
-}
-
-/**
- * Handle the 'cancel' click on the add/edit pane form wizard.
- */
-function panels_ajax_edit_pane_cancel(&$form_state) {
- $form_state['cancel'] = TRUE;
- return;
-}
-
-// --------------------------------------------------------------------------
-// Forms for the editor object
-
-/**
- * Choose cache method form
- */
-function panels_edit_cache_method_form($form, &$form_state) {
- $display = &$form_state['display'];
- $conf = &$form_state['conf'];
-
- // Set to 0 to ensure we get a selected radio.
- if (!isset($conf['method'])) {
- $conf['method'] = 0;
- }
-
- $caches = panels_get_caches();
- if (empty($caches)) {
- $form['markup'] = array('#value' => t('No caching options are available at this time. Please enable a panels caching module in order to use caching options.'));
- return $form;
- }
-
- $options[0] = t('No caching');
- foreach ($caches as $cache => $info) {
- $options[$cache] = check_plain($info['title']);
- }
-
- $form['method'] = array(
- '#prefix' => '<div class="no-float">',
- '#suffix' => '</div>',
- '#type' => 'radios',
- '#title' => t('Method'),
- '#options' => $options,
- '#default_value' => $conf['method'],
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Next'),
- );
- return $form;
-}
-
-/**
- * Submit callback for panels_edit_cache_method_form.
- *
- * All this needs to do is return the method.
- */
-function panels_edit_cache_method_form_submit($form, &$form_state) {
- $form_state['method'] = $form_state['values']['method'];
-}
-
-/**
- * Cache settings form
- */
-function panels_edit_cache_settings_form($form, &$form_state) {
- $display = &$form_state['display'];
- $conf = &$form_state['conf'];
- $pid = $form_state['pid'];
- $info = panels_get_cache($conf['method']);
-
- $form['#action'] = $form_state['url'];
-
- $form['description'] = array(
- '#prefix' => '<div class="description">',
- '#suffix' => '</div>',
- '#value' => check_plain($info['description']),
- );
-
- $function = panels_plugin_get_function('cache', $conf['method'], 'settings form');
-
- $form['settings'] = $function($conf['settings'], $display, $pid);
- $form['settings']['#tree'] = TRUE;
-
- $form['display'] = array(
- '#type' => 'value',
- '#value' => $display,
- );
-
- $form['pid'] = array(
- '#type' => 'value',
- '#value' => $pid,
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-/**
- * Validate cache settings.
- */
-function panels_edit_cache_settings_form_validate($form, &$form_state) {
- if ($function = panels_plugin_get_function('cache', $form_state['conf']['method'], 'settings form validate')) {
- $function($form, $form_state['values']['settings']);
- }
-}
-
-/**
- * Allows panel styles to validate their style settings.
- */
-function panels_edit_cache_settings_form_submit($form, &$form_state) {
- if ($function = panels_plugin_get_function('cache', $form_state['conf']['method'], 'settings form submit')) {
- $function($form_state['values']['settings']);
- }
-
- $form_state['conf']['settings'] = $form_state['values']['settings'];
-}
-
-/**
- * Choose style form
- */
-function panels_edit_style_type_form($form, &$form_state) {
- $display = &$form_state['display'];
- $style = $form_state['style'];
- $type = $form_state['type'];
-
- $styles = panels_get_styles();
-
- $function = ($type == 'pane' ? 'render pane' : 'render region');
- $options = array();
- if ($type == 'region') {
- $options[-1] = t('Use display default style');
- }
-
- uasort($styles, 'ctools_plugin_sort');
-
- foreach ($styles as $id => $info) {
- if (empty($info['hidden']) && (!empty($info[$function]) || $id == 'default')) {
- $options[$id] = check_plain($info['title']);
- }
- }
-
- $form['style'] = array(
- '#prefix' => '<div class="no-float">',
- '#suffix' => '</div>',
- '#type' => 'radios',
- '#title' => t('Style'),
- '#options' => $options,
- '#default_value' => $style,
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Next'),
- );
- return $form;
-}
-
-/**
- * Submit callback for panels_edit_style_type_form.
- *
- * All this needs to do is return the method.
- */
-function panels_edit_style_type_form_submit($form, &$form_state) {
- $form_state['old_style'] = $form_state['style'];
- $form_state['style'] = $form_state['values']['style'];
-}
-
-/**
- * Style settings form
- */
-function panels_edit_style_settings_form($form, &$form_state) {
- $display = &$form_state['display'];
- $conf = &$form_state['conf'];
- $pid = $form_state['pid'];
- $style = $form_state['style'];
- $type = $form_state['type'];
-
- $form['#action'] = $form_state['url'];
-
- $form['description'] = array(
- '#prefix' => '<div class="description">',
- '#suffix' => '</div>',
- '#value' => check_plain($style['description']),
- );
-
- $function = panels_plugin_get_function('styles', $style, ($type == 'pane') ? 'pane settings form' : 'settings form');
-
- $form['settings'] = $function($conf, $display, $pid, $type, $form_state);
- $form['settings']['#tree'] = TRUE;
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-/**
- * Validate style settings.
- */
-function panels_edit_style_settings_form_validate($form, &$form_state) {
- $name = $form_state['type'] == 'pane' ? 'pane settings form validate' : 'settings form validate';
- if ($function = panels_plugin_get_function('styles', $form_state['style'], $name)) {
- $function($form, $form_state['values']['settings'], $form_state);
- }
-}
-
-/**
- * Allows panel styles to validate their style settings.
- */
-function panels_edit_style_settings_form_submit($form, &$form_state) {
- $name = $form_state['type'] == 'pane' ? 'pane settings form submit' : 'settings form submit';
- if ($function = panels_plugin_get_function('styles', $form_state['style'], $name)) {
- $function($form, $form_state['values']['settings'], $form_state);
- }
-
- $form_state['conf'] = $form_state['values']['settings'];
-}
-
-
-/**
- * Configure CSS on a pane form.
- */
-function panels_edit_configure_pane_css_form($form, &$form_state) {
- $display = &$form_state['display'];
- $pane = &$form_state['pane'];
-
- $form['css_id'] = array(
- '#type' => 'textfield',
- '#default_value' => isset($pane->css['css_id']) ? $pane->css['css_id'] : '',
- '#title' => t('CSS ID'),
- '#description' => t('CSS ID to apply to this pane. This may be blank.'),
- );
- $form['css_class'] = array(
- '#type' => 'textfield',
- '#default_value' => isset($pane->css['css_class']) ? $pane->css['css_class'] : '',
- '#title' => t('CSS class'),
- '#description' => t('CSS class to apply to this pane. This may be blank.'),
- );
-
- $form['next'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-/**
- * FAPI submission function for the CSS configure form.
- *
- * All this does is set up $pane properly. The caller is responsible for
- * actually storing this somewhere.
- */
-function panels_edit_configure_pane_css_form_submit($form, &$form_state) {
- $pane = &$form_state['pane'];
- $display = $form_state['display'];
-
- $pane->css['css_id'] = $form_state['values']['css_id'];
- $pane->css['css_class'] = $form_state['values']['css_class'];
-}
-
-/**
- * Form to control basic visibility settings.
- */
-function panels_edit_configure_access_settings_form(&$form_state) {
- $display = &$form_state['display'];
- $pane = &$form_state['pane'];
-
- $form['logic'] = array(
- '#type' => 'radios',
- '#options' => array(
- 'and' => t('All criteria must pass.'),
- 'or' => t('Only one criterion must pass.'),
- ),
- '#default_value' => isset($pane->access['logic']) ? $pane->access['logic'] : 'and',
- );
-
- $form['next'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-/**
- * FAPI submission function for the edit access settings form.
- *
- * All this does is set up $pane properly. The caller is responsible for
- * actually storing this somewhere.
- */
-function panels_edit_configure_access_settings_form_submit($form, &$form_state) {
- $pane = &$form_state['pane'];
- $display = $form_state['display'];
-
- $pane->access['logic'] = $form_state['values']['logic'];
-}
-
-/**
- * Form to add a visibility rule.
- */
-function panels_edit_add_access_test_form($form, &$form_state) {
- $display = &$form_state['display'];
- $pane = &$form_state['pane'];
-
- $plugins = ctools_get_relevant_access_plugins($display->context);
- $options = array();
- foreach ($plugins as $id => $plugin) {
- $options[$id] = $plugin['title'];
- }
-
- asort($options);
-
- $form['type'] = array(
- // This ensures that the form item is added to the URL.
- '#type' => 'radios',
- '#options' => $options,
- );
-
- $form['next'] = array(
- '#type' => 'submit',
- '#value' => t('Next'),
- );
-
- return $form;
-}
-
-/**
- * Form to configure a visibility rule.
- */
-function panels_edit_configure_access_test_form($form, &$form_state) {
- $display = &$form_state['display'];
- $test = &$form_state['test'];
- $plugin = &$form_state['plugin'];
-
- $form['#action'] = $form_state['url'];
-
- $contexts = $display->context;
- if (!isset($contexts['logged-in-user'])) {
- $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
- }
-
- if (isset($plugin['required context'])) {
- $form['context'] = ctools_context_selector($contexts, $plugin['required context'], $test['context']);
- }
-
- $form['settings'] = array('#tree' => TRUE);
- if ($function = ctools_plugin_get_function($plugin, 'settings form')) {
- $form = $function($form, $form_state, $test['settings']);
- }
-
- $form['not'] = array(
- '#type' => 'checkbox',
- '#title' => t('Reverse (NOT)'),
- '#default_value' => !empty($test['not']),
- );
-
- $form['save'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- $form['remove'] = array(
- '#type' => 'submit',
- '#value' => t('Remove'),
- '#remove' => TRUE,
- );
-
- return $form;
-}
-
-/**
- * Validate handler for visibility rule settings
- */
-function panels_edit_configure_access_test_form_validate(&$form, &$form_state) {
- if (!empty($form_state['clicked_button']['#remove'])) {
- return;
- }
-
- if ($function = ctools_plugin_get_function($form_state['plugin'], 'settings form validate')) {
- $function($form, $form_state);
- }
-}
-
-/**
- * Submit handler for visibility rule settings
- */
-function panels_edit_configure_access_test_form_submit(&$form, &$form_state) {
- if (!empty($form_state['clicked_button']['#remove'])) {
- $form_state['remove'] = TRUE;
- return;
- }
-
- if ($function = ctools_plugin_get_function($form_state['plugin'], 'settings form submit')) {
- $function($form, $form_state);
- }
-
- $form_state['test']['settings'] = $form_state['values']['settings'];
- if (isset($form_state['values']['context'])) {
- $form_state['test']['context'] = $form_state['values']['context'];
- }
- $form_state['test']['not'] = !empty($form_state['values']['not']);
-}
-
diff --git a/plugins/display_renderers/panels_renderer_simple.class.php b/plugins/display_renderers/panels_renderer_simple.class.php
deleted file mode 100644
index 9a813ac..0000000
--- a/plugins/display_renderers/panels_renderer_simple.class.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-/**
- * @file
- * Contains the simple display renderer.
- */
-
-/**
- * The simple display renderer renders a display normally, except each pane
- * is already rendered content, rather than a pane containing CTools content
- * to be rendered. Styles are not supported.
- */
-class panels_renderer_simple extends panels_renderer_standard {
- function render_regions() {
- $this->rendered['regions'] = array();
- foreach ($this->display->content as $region_id => $content) {
- if (is_array($content)) {
- $content = implode('', $content);
- }
-
- $this->rendered['regions'][$region_id] = $content;
- }
- return $this->rendered['regions'];
- }
-
- function render_panes() {
- // NOP
- }
-
- function prepare() {
- $this->prep_run = TRUE;
- }
-}
diff --git a/plugins/display_renderers/panels_renderer_standard.class.php b/plugins/display_renderers/panels_renderer_standard.class.php
deleted file mode 100644
index a37abe2..0000000
--- a/plugins/display_renderers/panels_renderer_standard.class.php
+++ /dev/null
@@ -1,616 +0,0 @@
-<?php
-
-/**
- * The standard render pipeline for a Panels display object.
- *
- * Given a fully-loaded panels_display object, this class will turn its
- * combination of layout, panes, and styles into HTML, invoking caching
- * appropriately along the way. Interacting with the renderer externally is
- * very simple - just pass it the display object and call the render() method:
- *
- * @code
- * // given that $display is a fully loaded Panels display object
- * $renderer = panels_get_renderer_handler('standard', $display)
- * $html_output = $renderer->render();
- * @endcode
- *
- * Internally, the render pipeline is divided into two phases, prepare and
- * render:
- * - The prepare phase transforms the skeletal data on the provided
- * display object into a structure that is expected by the render phase.
- * It is divided into a series of discrete sub-methods and operates
- * primarily by passing parameters, all with the intention of making
- * subclassing easier.
- * - The render phase relies primarily on data stored in the renderer object's
- * properties, presumably set in the prepare phase. It iterates through the
- * rendering of each pane, pane styling, placement in panel regions, region
- * styling, and finally the arrangement of rendered regions in the layout.
- * Caching, if in use, is triggered per pane, or on the entire display.
- *
- * In short: prepare builds conf, render renders conf. Subclasses should respect
- * this separation of responsibilities by adhering to these loose guidelines,
- * given a loaded display object:
- * - If your renderer needs to modify the datastructure representing what is
- * to be rendered (panes and their conf, styles, caching, etc.), it should
- * use the prepare phase.
- * - If your renderer needs to modify the manner in which that renderable
- * datastructure data is rendered, it should use the render phase.
- *
- * In the vast majority of use cases, this standard renderer will be sufficient
- * and need not be switched out/subclassed; style and/or layout plugins can
- * accommodate nearly every use case. If you think you might need a custom
- * renderer, consider the following criteria/examples:
- * - Some additional markup needs to be added to EVERY SINGLE panel.
- * - Given a full display object, just render one pane.
- * - Show a Panels admin interface.
- *
- * The system is almost functionally identical to the old procedural approach,
- * with some exceptions (@see panels_renderer_legacy for details). The approach
- * here differs primarily in its friendliness to tweaking in subclasses.
- */
-class panels_renderer_standard {
- /**
- * The fully-loaded Panels display object that is to be rendered. "Fully
- * loaded" is defined as:
- * 1. Having been produced by panels_load_displays(), whether or this page
- * request or at some time in the past and the object was exported.
- * 2. Having had some external code attach context data ($display->context),
- * in the exact form expected by panes. Context matching is delicate,
- * typically relying on exact string matches, so special attention must
- * be taken.
- *
- * @var panels_display
- */
- var $display;
-
- /**
- * An associative array of loaded plugins. Used primarily as a central
- * location for storing plugins that require additional loading beyond
- * reading the plugin definition, which is already statically cached by
- * ctools_get_plugins(). An example is layout plugins, which can optionally
- * have a callback that determines the set of panel regions available at
- * runtime.
- *
- * @var array
- */
- var $plugins = array();
-
- /**
- * A multilevel array of rendered data. The first level of the array
- * indicates the type of rendered data, typically with up to three keys:
- * 'layout', 'regions', and 'panes'. The relevant rendered data is stored as
- * the value for each of these keys as it is generated:
- * - 'panes' are an associative array of rendered output, keyed on pane id.
- * - 'regions' are an associative array of rendered output, keyed on region
- * name.
- * - 'layout' is the whole of the rendered output.
- *
- * @var array
- */
- var $rendered = array();
-
- /**
- * A multilevel array of data prepared for rendering. The first level of the
- * array indicates the type of prepared data. The standard renderer populates
- * and uses two top-level keys, 'panes' and 'regions':
- * - 'panes' are an associative array of pane objects to be rendered, keyed
- * on pane id and sorted into proper rendering order.
- * - 'regions' are an associative array of regions, keyed on region name,
- * each of which is itself an indexed array of pane ids in the order in
- * which those panes appear in that region.
- *
- * @var array
- */
- var $prepared = array();
-
- /**
- * Boolean state variable, indicating whether or not the prepare() method has
- * been run.
- *
- * This state is checked in panels_renderer_standard::render_layout() to
- * determine whether the prepare method should be automatically triggered.
- *
- * @var bool
- */
- var $prep_run = FALSE;
-
- /**
- * The plugin that defines this handler.
- */
- var $plugin = FALSE;
-
- /**
- * TRUE if this renderer is rendering in administrative mode
- * which will allow layouts to have extra functionality.
- *
- * @var bool
- */
- var $admin = FALSE;
-
- /**
- * Where to add standard meta information. There are three possibilities:
- * - standard: Put the meta information in the normal location. Default.
- * - inline: Put the meta information directly inline. This will
- * not work for javascript.
- *
- * @var string
- */
- var $meta_location = 'standard';
-
- /**
- * Include rendered HTML prior to the layout.
- *
- * @var string
- */
- var $prefix = '';
-
- /**
- * Include rendered HTML after the layout.
- *
- * @var string
- */
- var $suffix = '';
-
- /**
- * Receive and store the display object to be rendered.
- *
- * This is a psuedo-constructor that should typically be called immediately
- * after object construction.
- *
- * @param array $plugin
- * The definition of the renderer plugin.
- * @param panels_display $display
- * The panels display object to be rendered.
- */
- function init($plugin, &$display) {
- $this->plugin = $plugin;
- $layout = panels_get_layout($display->layout);
- $this->display = &$display;
- $this->plugins['layout'] = $layout;
- if (!isset($layout['panels'])) {
- $this->plugins['layout']['regions'] = panels_get_regions($layout, $display);
- }
-
- if (empty($this->plugins['layout'])) {
- watchdog('panels', "Layout: @layout couldn't been found, maybe the theme is disabled.", array('@layout' => $display->layout));
- }
- }
-
- /**
- * Prepare the attached display for rendering.
- *
- * This is the outermost prepare method. It calls several sub-methods as part
- * of the overall preparation process. This compartmentalization is intended
- * to ease the task of modifying renderer behavior in child classes.
- *
- * If you override this method, it is important that you either call this
- * method via parent::prepare(), or manually set $this->prep_run = TRUE.
- *
- * @param mixed $external_settings
- * An optional parameter allowing external code to pass in additional
- * settings for use in the preparation process. Not used in the default
- * renderer, but included for interface consistency.
- */
- function prepare($external_settings = NULL) {
- $this->prepare_panes($this->display->content);
- $this->prepare_regions($this->display->panels, $this->display->panel_settings);
- $this->prep_run = TRUE;
- }
-
- /**
- * Prepare the list of panes to be rendered, accounting for visibility/access
- * settings and rendering order.
- *
- * This method represents the standard approach for determining the list of
- * panes to be rendered that is compatible with all parts of the Panels
- * architecture. It first applies visibility & access checks, then sorts panes
- * into their proper rendering order, and returns the result as an array.
- *
- * Inheriting classes should override this method if that renderer needs to
- * regularly make additions to the set of panes that will be rendered.
- *
- * @param array $panes
- * An associative array of pane data (stdClass objects), keyed on pane id.
- * @return array
- * An associative array of panes to be rendered, keyed on pane id and sorted
- * into proper rendering order.
- */
- function prepare_panes($panes) {
- ctools_include('content');
- // Use local variables as writing to them is very slightly faster
- $first = $normal = $last = array();
-
- // Prepare the list of panes to be rendered
- foreach ($panes as $pid => $pane) {
- if (empty($this->admin)) {
- // TODO remove in 7.x and ensure the upgrade path weeds out any stragglers; it's been long enough
- $pane->shown = !empty($pane->shown); // guarantee this field exists.
- // If this pane is not visible to the user, skip out and do the next one
- if (!$pane->shown || !panels_pane_access($pane, $this->display)) {
- continue;
- }
- }
-
- $content_type = ctools_get_content_type($pane->type);
-
- // If this pane wants to render last, add it to the $last array. We allow
- // this because some panes need to be rendered after other panes,
- // primarily so they can do things like the leftovers of forms.
- if (!empty($content_type['render last'])) {
- $last[$pid] = $pane;
- }
- // If it wants to render first, add it to the $first array. This is used
- // by panes that need to do some processing before other panes are
- // rendered.
- else if (!empty($content_type['render first'])) {
- $first[$pid] = $pane;
- }
- // Otherwise, render it in the normal order.
- else {
- $normal[$pid] = $pane;
- }
- }
- $this->prepared['panes'] = $first + $normal + $last;
- return $this->prepared['panes'];
- }
-
- /**
- * Prepare the list of regions to be rendered.
- *
- * This method is primarily about properly initializing the style plugin that
- * will be used to render the region. This is crucial as regions cannot be
- * rendered without a style plugin (in keeping with Panels' philosophy of
- * hardcoding none of its output), but for most regions no style has been
- * explicitly set. The logic here is what accommodates that situation:
- * - If a region has had its style explicitly set, then we fetch that plugin
- * and continue.
- * - If the region has no explicit style, but a style was set at the display
- * level, then inherit the style from the display.
- * - If neither the region nor the dispay have explicitly set styles, then
- * fall back to the hardcoded 'default' style, a very minimal style.
- *
- * The other important task accomplished by this method is ensuring that even
- * regions without any panes are still properly prepared for the rendering
- * process. This is essential because the way Panels loads display objects
- * (@see panels_load_displays) results only in a list of regions that
- * contain panes - not necessarily all the regions defined by the layout
- * plugin, which can only be determined by asking the plugin at runtime. This
- * method consults that retrieved list of regions and prepares all of those,
- * ensuring none are inadvertently skipped.
- *
- * @param array $region_pane_list
- * An associative array of pane ids, keyed on the region to which those pids
- * are assigned. In the default case, this is $display->panels.
- * @param array $settings
- * All known region style settings, including both the top-level display's
- * settings (if any) and all region-specific settings (if any).
- * @return array
- * An array of regions prepared for rendering.
- */
- function prepare_regions($region_pane_list, $settings) {
- // Initialize defaults to be used for regions without their own explicit
- // settings. Use display settings if they exist, else hardcoded defaults.
- $default = array(
- 'style' => panels_get_style(!empty($settings['style']) ? $settings['style'] : 'default'),
- 'style settings' => isset($settings['style_settings']['default']) ? $settings['style_settings']['default'] : array(),
- );
-
- $regions = array();
- if (empty($settings)) {
- // No display/panel region settings exist, init all with the defaults.
- foreach ($this->plugins['layout']['regions'] as $region_id => $title) {
- // Ensure this region has at least an empty panes array.
- $panes = !empty($region_pane_list[$region_id]) ? $region_pane_list[$region_id] : array();
-
- $regions[$region_id] = $default;
- $regions[$region_id]['pids'] = $panes;
- }
- }
- else {
- // Some settings exist; iterate through each region and set individually.
- foreach ($this->plugins['layout']['regions'] as $region_id => $title) {
- // Ensure this region has at least an empty panes array.
- $panes = !empty($region_pane_list[$region_id]) ? $region_pane_list[$region_id] : array();
-
- if (empty($settings[$region_id]['style']) || $settings[$region_id]['style'] == -1) {
- $regions[$region_id] = $default;
- }
- else {
- $regions[$region_id]['style'] = panels_get_style($settings[$region_id]['style']);
- $regions[$region_id]['style settings'] = isset($settings['style_settings'][$region_id]) ? $settings['style_settings'][$region_id] : array();
- }
- $regions[$region_id]['pids'] = $panes;
- }
- }
-
- $this->prepared['regions'] = $regions;
- return $this->prepared['regions'];
- }
-
- /**
- * Build inner content, then hand off to layout-specified theme function for
- * final render step.
- *
- * This is the outermost method in the Panels render pipeline. It calls the
- * inner methods, which return a content array, which is in turn passed to the
- * theme function specified in the layout plugin.
- *
- * @return string
- * Themed & rendered HTML output.
- */
- function render() {
- // Attach out-of-band data first.
- $this->add_meta();
-
- if (empty($this->display->cache['method']) || !empty($this->display->skip_cache)) {
- return $this->render_layout();
- }
- else {
- $cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context);
- if ($cache === FALSE) {
- $cache = new panels_cache_object();
- $cache->set_content($this->render_layout());
- panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context);
- }
- return $cache->content;
- }
- }
-
- /**
- * Perform display/layout-level render operations.
- *
- * This method triggers all the inner pane/region rendering processes, passes
- * that to the layout plugin's theme callback, and returns the rendered HTML.
- *
- * If display-level caching is enabled and that cache is warm, this method
- * will not be called.
- *
- * @return string
- * The HTML string representing the entire rendered, themed panel.
- */
- function render_layout() {
- if (empty($this->prep_run)) {
- $this->prepare();
- }
- $this->render_panes();
- $this->render_regions();
-
- if ($this->admin && !empty($this->plugins['layout']['admin theme'])) {
- $theme = $this->plugins['layout']['admin theme'];
- }
- else {
- $theme = $this->plugins['layout']['theme'];
- }
-
- $this->rendered['layout'] = theme($theme, array('css_id' => check_plain($this->display->css_id), 'content' => $this->rendered['regions'], 'settings' => $this->display->layout_settings, 'display' => $this->display, 'layout' => $this->plugins['layout'], 'renderer' => $this));
- return $this->prefix . $this->rendered['layout'] . $this->suffix;
- }
-
- /**
- * Attach out-of-band page metadata (e.g., CSS and JS).
- *
- * This must be done before render, because panels-within-panels must have
- * their CSS added in the right order: inner content before outer content.
- */
- function add_meta() {
- if (!empty($this->plugins['layout']['css'])) {
- if (file_exists(path_to_theme() . '/' . $this->plugins['layout']['css'])) {
- $this->add_css(path_to_theme() . '/' . $this->plugins['layout']['css']);
- }
- else {
- $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['css']);
- }
- }
-
- if ($this->admin && isset($this->plugins['layout']['admin css'])) {
- $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['admin css']);
- }
- }
-
- /**
- * Add CSS information to the renderer.
- *
- * To facilitate previews over Views, CSS can now be added in a manner
- * that does not necessarily mean just using drupal_add_css. Therefore,
- * during the panel rendering process, this method can be used to add
- * css and make certain that ti gets to the proper location.
- *
- * The arguments should exactly match drupal_add_css().
- *
- * @see drupal_add_css
- */
- function add_css($filename) {
-// $path = file_create_path($filename);
- switch ($this->meta_location) {
- case 'standard':
- drupal_add_css($filename);
- break;
- case 'inline':
-// if ($path) {
-// $url = file_create_url($filename);
-// }
-// else {
- $url = base_path() . $filename;
-// }
-
- $this->prefix .= '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . $url . '" />'."\n";
- break;
- }
- }
-
- /**
- * Render all prepared panes, first by dispatching to their plugin's render
- * callback, then handing that output off to the pane's style plugin.
- *
- * @return array
- * The array of rendered panes, keyed on pane pid.
- */
- function render_panes() {
- ctools_include('content');
-
- // First, render all the panes into little boxes.
- $this->rendered['panes'] = array();
- foreach ($this->prepared['panes'] as $pid => $pane) {
- $content = $this->render_pane($pane);
- if ($content) {
- $this->rendered['panes'][$pid] = $content;
- }
- }
- return $this->rendered['panes'];
- }
-
- /**
- * Render a pane using its designated style.
- *
- * This method also manages 'title pane' functionality, where the title from
- * an individual pane can be bubbled up to take over the title for the entire
- * display.
- *
- * @param stdClass $pane
- * A Panels pane object, as loaded from the database.
- */
- function render_pane(&$pane) {
- $content = $this->render_pane_content($pane);
- if ($this->display->hide_title == PANELS_TITLE_PANE && !empty($this->display->title_pane) && $this->display->title_pane == $pane->pid) {
-
- // If the user selected to override the title with nothing, and selected
- // this as the title pane, assume the user actually wanted the original
- // title to bubble up to the top but not actually be used on the pane.
- if (empty($content->title) && !empty($content->original_title)) {
- $this->display->stored_pane_title = $content->original_title;
- }
- else {
- $this->display->stored_pane_title = !empty($content->title) ? $content->title : '';
- }
- }
-
- if (!empty($content->content)) {
- if (!empty($pane->style['style'])) {
- $style = panels_get_style($pane->style['style']);
-
- if (isset($style) && isset($style['render pane'])) {
- $output = theme($style['render pane'], array('content' => $content, 'pane' => $pane, 'display' => $this->display, 'style' => $style, 'settings' => $pane->style['settings']));
-
- // This could be null if no theme function existed.
- if (isset($output)) {
- return $output;
- }
- }
- }
-
- // fallback
- return theme('panels_pane', array('content' => $content, 'pane' => $pane, 'display' => $this->display));
- }
- }
-
- /**
- * Render the interior contents of a single pane.
- *
- * This method retrieves pane content and produces a ready-to-render content
- * object. It also manages pane-specific caching.
- *
- * @param stdClass $pane
- * A Panels pane object, as loaded from the database.
- * @return stdClass $content
- * A renderable object, containing a subject, content, etc. Based on the
- * renderable objects used by the block system.
- */
- function render_pane_content(&$pane) {
- ctools_include('context');
- // TODO finally safe to remove this check?
- if (!is_array($this->display->context)) {
- watchdog('panels', 'renderer::render_pane_content() hit with a non-array for the context', $this->display, WATCHDOG_DEBUG);
- $this->display->context = array();
- }
-
- $content = FALSE;
- $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache);
- if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) {
- $content = $cache->content;
- }
- else {
- $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context);
-
- foreach (module_implements('panels_pane_content_alter') as $module) {
- $function = $module . '_panels_pane_content_alter';
- $function($content, $pane, $this->display->args, $this->display->context);
- }
- if ($caching) {
- $cache = new panels_cache_object();
- $cache->set_content($content);
- panels_set_cached_content($cache, $this->display, $this->display->args, $this->display->context, $pane);
- $content = $cache->content;
- }
- }
-
- // Pass long the css_id that is usually available.
- if (!empty($pane->css['css_id'])) {
- $content->css_id = check_plain($pane->css['css_id']);
- }
-
- // Pass long the css_class that is usually available.
- if (!empty($pane->css['css_class'])) {
- $content->css_class = check_plain($pane->css['css_class']);
- }
-
- return $content;
- }
-
- /**
- * Render all prepared regions, placing already-rendered panes into their
- * appropriate positions therein.
- *
- * @return array
- * An array of rendered panel regions, keyed on the region name.
- */
- function render_regions() {
- $this->rendered['regions'] = array();
-
- // Loop through all panel regions, put all panes that belong to the current
- // region in an array, then render the region. Primarily this ensures that
- // the panes are arranged in the proper order.
- $content = array();
- foreach ($this->prepared['regions'] as $region_id => $conf) {
- $region_panes = array();
- foreach ($conf['pids'] as $pid) {
- // Only include panes for region rendering if they had some output.
- if (!empty($this->rendered['panes'][$pid])) {
- $region_panes[$pid] = $this->rendered['panes'][$pid];
- }
- }
- $this->rendered['regions'][$region_id] = $this->render_region($region_id, $region_panes);
- }
-
- return $this->rendered['regions'];
- }
-
- /**
- * Render a single panel region.
- *
- * Primarily just a passthrough to the panel region rendering callback
- * specified by the style plugin that is attached to the current panel region.
- *
- * @param $region_id
- * The ID of the panel region being rendered
- * @param $panes
- * An array of panes that are assigned to the panel that's being rendered.
- *
- * @return string
- * The rendered, HTML string output of the passed-in panel region.
- */
- function render_region($region_id, $panes) {
- $style = $this->prepared['regions'][$region_id]['style'];
- $style_settings = $this->prepared['regions'][$region_id]['style settings'];
-
- // Retrieve the pid (can be a panel page id, a mini panel id, etc.), this
- // might be used (or even necessary) for some panel display styles.
- // TODO: Got to fix this to use panel page name instead of pid, since pid is
- // no longer guaranteed. This needs an API to be able to set the final id.
- $owner_id = 0;
- if (isset($this->display->owner) && is_object($this->display->owner) && isset($this->display->owner->id)) {
- $owner_id = $this->display->owner->id;
- }
-
- return theme($style['render region'], array('display' => $this->display, 'owner_id' => $owner_id, 'panes' => $panes, 'settings' => $style_settings, 'region_id' => $region_id, 'style' => $style));
- }
-}
diff --git a/plugins/display_renderers/simple.inc b/plugins/display_renderers/simple.inc
deleted file mode 100644
index a370216..0000000
--- a/plugins/display_renderers/simple.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-/**
- * Create a simple renderer plugin that renders a layout but the content is
- * already rendered, not in panes.
- */
-$plugin = array(
- 'renderer' => 'panels_renderer_simple',
-);
diff --git a/plugins/display_renderers/standard.inc b/plugins/display_renderers/standard.inc
deleted file mode 100644
index 2e86b31..0000000
--- a/plugins/display_renderers/standard.inc
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
-$plugin = array(
- 'renderer' => 'panels_renderer_standard',
-);
diff --git a/plugins/export_ui/panels_layouts.inc b/plugins/export_ui/panels_layouts.inc
deleted file mode 100644
index 20bf44d..0000000
--- a/plugins/export_ui/panels_layouts.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-$plugin = array(
- 'schema' => 'panels_layout',
- 'access' => 'administer panels layouts',
-
- 'menu' => array(
- 'menu prefix' => 'admin/structure/panels',
- 'menu item' => 'layouts',
- 'menu title' => 'Layouts',
- 'menu description' => 'Add, edit or delete custom content layouts.',
- ),
-
- 'title singular' => t('layout'),
- 'title singular proper' => t('Layout'),
- 'title plural' => t('layouts'),
- 'title plural proper' => t('Layouts'),
-
- 'handler' => array(
- 'class' => 'panels_layouts_ui',
- ),
-);
-
diff --git a/plugins/export_ui/panels_layouts_ui.class.php b/plugins/export_ui/panels_layouts_ui.class.php
deleted file mode 100644
index 97b61c1..0000000
--- a/plugins/export_ui/panels_layouts_ui.class.php
+++ /dev/null
@@ -1,230 +0,0 @@
-<?php
-
-class panels_layouts_ui extends ctools_export_ui {
- var $lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam egestas congue nibh, vel dictum ante posuere vitae. Cras gravida massa tempor metus eleifend sed elementum tortor scelerisque. Vivamus egestas, tortor quis luctus tristique, sem velit adipiscing risus, et tempus enim felis in massa. Morbi viverra, nisl quis rhoncus imperdiet, turpis massa vestibulum turpis, egestas faucibus nibh metus vel nunc. In hac habitasse platea dictumst. Nunc sit amet nisi quis ipsum tincidunt semper. Donec ac urna enim, et placerat arcu. Morbi eu laoreet justo. Nullam nec velit eu neque mattis pulvinar sed non libero. Sed sed vulputate erat. Fusce sit amet dui nibh.";
-
- function hook_menu(&$items) {
- // During updates, this can run before our schema is set up, so our
- // plugin can be empty.
- if (empty($this->plugin['menu']['items']['add'])) {
- return;
- }
-
- // Change the item to a tab on the Panels page.
- $this->plugin['menu']['items']['list callback']['type'] = MENU_LOCAL_TASK;
-
- // Establish a base for adding plugins
- $base = $this->plugin['menu']['items']['add'];
- // Remove the default 'add' menu item.
- unset($this->plugin['menu']['items']['add']);
-
- ctools_include('plugins', 'panels');
- $this->builders = panels_get_layout_builders();
- asort($this->builders);
- foreach ($this->builders as $name => $builder) {
- // Create a new menu item for the builder
- $item = $base;
- $item['title'] = !empty($builder['builder tab title']) ? $builder['builder tab title'] : 'Add ' . $builder['title'];
- $item['page arguments'][] = $name;
- $item['path'] = 'add-' . $name;
- $this->plugin['menu']['items']['add ' . $name] = $item;
- }
-
- parent::hook_menu($items);
- }
-
- function edit_form(&$form, &$form_state) {
- ctools_include('plugins', 'panels');
- // If the plugin is not set, then it should be provided as an argument:
- if (!isset($form_state['item']->plugin)) {
- $form_state['item']->plugin = $form_state['function args'][2];
- }
-
- parent::edit_form($form, $form_state);
-
- $form['category'] = array(
- '#type' => 'textfield',
- '#title' => t('Category'),
- '#description' => t('What category this layout should appear in. If left blank the category will be "Miscellaneous".'),
- '#default_value' => $form_state['item']->category,
- );
-
- ctools_include('context');
- ctools_include('display-edit', 'panels');
- ctools_include('content');
-
- // Provide actual layout admin UI here.
- // Create a display for editing:
- $cache_key = 'builder-' . $form_state['item']->name;
-
- // Load the display being edited from cache, if possible.
- if (!empty($_POST) && is_object($cache = panels_edit_cache_get($cache_key))) {
- $display = &$cache->display;
- }
- else {
- $content_types = ctools_content_get_available_types();
-
- $display->cache_key = $cache_key;
- panels_cache_clear('display', $cache_key);
- $cache = new stdClass();
-
- $display = panels_new_display();
- $display->did = $form_state['item']->name;
- $display->layout = $form_state['item']->plugin;
- $display->layout_settings = $form_state['item']->settings;
- $display->cache_key = $cache_key;
- $display->editing_layout = TRUE;
-
- $cache->display = $display;
- $cache->content_types = $content_types;
- $cache->display_title = FALSE;
- panels_edit_cache_set($cache);
- }
-
- // Set up lipsum content in all of the existing panel regions:
- $display->content = array();
- $display->panels = array();
- $custom = ctools_get_content_type('custom');
- $layout = panels_get_layout($display->layout);
-
- $regions = panels_get_regions($layout, $display);
- foreach ($regions as $id => $title) {
- $pane = panels_new_pane('custom', 'custom');
- $pane->pid = $id;
- $pane->panel = $id;
- $pane->configuration = ctools_content_get_defaults($custom, 'custom');
- $pane->configuration['title'] = 'Lorem Ipsum';
- $pane->configuration['body'] = $this->lipsum;
- $display->content[$id] = $pane;
- $display->panels[$id] = array($id);
- }
-
- $form_state['display'] = &$display;
- // Tell the Panels form not to display buttons.
- $form_state['no buttons'] = TRUE;
- $form_state['no display settings'] = TRUE;
-
- $form_state['cache_key'] = $cache_key;
- $form_state['content_types'] = $cache->content_types;
- $form_state['display_title'] = FALSE;
-
- $form_state['renderer'] = panels_get_renderer_handler('editor', $cache->display);
- $form_state['renderer']->cache = &$cache;
-
- $form = panels_edit_display_form($form, $form_state);
- // Make sure the theme will work since our form id is different.
- $form['#theme'] = 'panels_edit_display_form';
-
- // If we leave the standard submit handler, it'll try to reconcile
- // content from the input, but we've not exposed that to the user. This
- // makes previews work with the content we forced in.
- $form['preview']['button']['#submit'] = array('panels_edit_display_form_preview');
- }
-
- function edit_form_submit(&$form, &$form_state) {
- parent::edit_form_submit($form, $form_state);
- $form_state['item']->settings = $form_state['display']->layout_settings;
- }
-
- function list_form(&$form, &$form_state) {
- ctools_include('plugins', 'panels');
- $this->builders = panels_get_layout_builders();
- parent::list_form($form, $form_state);
-
- $categories = $plugins = array('all' => t('- All -'));
- foreach ($this->items as $item) {
- $categories[$item->category] = $item->category ? $item->category : t('Miscellaneous');
- }
-
- $form['top row']['category'] = array(
- '#type' => 'select',
- '#title' => t('Category'),
- '#options' => $categories,
- '#default_value' => 'all',
- '#weight' => -10,
- );
-
- foreach ($this->builders as $name => $plugin) {
- $plugins[$name] = $plugin['title'];
- }
-
- $form['top row']['plugin'] = array(
- '#type' => 'select',
- '#title' => t('Type'),
- '#options' => $plugins,
- '#default_value' => 'all',
- '#weight' => -9,
- );
- }
-
- function list_filter($form_state, $item) {
- if ($form_state['values']['category'] != 'all' && $form_state['values']['category'] != $item->category) {
- return TRUE;
- }
-
- if ($form_state['values']['plugin'] != 'all' && $form_state['values']['plugin'] != $item->plugin) {
- return TRUE;
- }
-
- return parent::list_filter($form_state, $item);
- }
-
- function list_sort_options() {
- return array(
- 'disabled' => t('Enabled, title'),
- 'title' => t('Title'),
- 'name' => t('Name'),
- 'category' => t('Category'),
- 'storage' => t('Storage'),
- 'plugin' => t('Type'),
- );
- }
-
- function list_build_row($item, &$form_state, $operations) {
- // Set up sorting
- switch ($form_state['values']['order']) {
- case 'disabled':
- $this->sorts[$item->name] = empty($item->disabled) . $item->admin_title;
- break;
- case 'title':
- $this->sorts[$item->name] = $item->admin_title;
- break;
- case 'name':
- $this->sorts[$item->name] = $item->name;
- break;
- case 'category':
- $this->sorts[$item->name] = ($item->category ? $item->category : t('Miscellaneous')) . $item->admin_title;
- break;
- case 'plugin':
- $this->sorts[$item->name] = $item->plugin;
- break;
- case 'storage':
- $this->sorts[$item->name] = $item->type . $item->admin_title;
- break;
- }
-
- $type = !empty($this->builders[$item->plugin]) ? $this->builders[$item->plugin]['title'] : t('Broken/missing plugin');
- $category = $item->category ? check_plain($item->category) : t('Miscellaneous');
- $this->rows[$item->name] = array(
- 'data' => array(
- array('data' => check_plain($type), 'class' => array('ctools-export-ui-type')),
- array('data' => check_plain($item->name), 'class' => array('ctools-export-ui-name')),
- array('data' => check_plain($item->admin_title), 'class' => array('ctools-export-ui-title')),
- array('data' => $category, 'class' => array('ctools-export-ui-category')),
- array('data' => theme('links', array('links' => $operations)), 'class' => array('ctools-export-ui-operations')),
- ),
- 'title' => check_plain($item->admin_description),
- 'class' => array(!empty($item->disabled) ? 'ctools-export-ui-disabled' : 'ctools-export-ui-enabled'),
- );
- }
-
- function list_table_header() {
- return array(
- array('data' => t('Type'), 'class' => array('ctools-export-ui-type')),
- array('data' => t('Name'), 'class' => array('ctools-export-ui-name')),
- array('data' => t('Title'), 'class' => array('ctools-export-ui-title')),
- array('data' => t('Category'), 'class' => array('ctools-export-ui-category')),
- array('data' => t('Operations'), 'class' => array('ctools-export-ui-operations')),
- );
- }
-}
diff --git a/plugins/layouts/flexible/flexible-admin.css b/plugins/layouts/flexible/flexible-admin.css
deleted file mode 100644
index 744e46e..0000000
--- a/plugins/layouts/flexible/flexible-admin.css
+++ /dev/null
@@ -1,87 +0,0 @@
-
-#panels-dnd-main .panel-flexible-edit-layout div.panels-display .pane-add-link,
-.panel-flexible-edit-layout .panel-pane {
- display: none;
-}
-
-.panel-flexible-edit-layout div.panels-display h2.label {
- padding-right: 0;
-}
-
-.panel-flexible-edit-layout .panels-flexible-column-inside {
-/* margin: 5px; */
- border: 1px dotted green;
-}
-
-.panels-flexible-column-inside {
-/* overflow: hidden; */
-}
-
-.panel-flexible-edit-layout .panels-flexible-column > .flexible-title {
- color: green;
-}
-
-.panel-flexible-edit-layout .panels-flexible-row-inside {
- margin: 5px;
- border: 1px dotted blue;
-}
-
-.panel-flexible-edit-layout .panels-flexible-row > .flexible-title {
- color: blue;
-}
-
-.panel-flexible-no-edit-layout .flexible-layout-only {
- display: none;
-}
-
-.panel-flexible-edit-layout .flexible-title {
- text-align: center;
- width: 5em;
- margin-left: auto;
- margin-right: auto;
-}
-
-.panel-flexible-no-edit-layout .panels-flexible-splitter {
- display: none;
-}
-
-.panels-flexible-splitter span {
- display: none;
-}
-
-.panels-flexible-splitter {
- width: 11px;
- float: left;
- margin-left: -7px;
- margin-right: -6px;
- cursor: e-resize; /* in case col-resize isn't supported */
- cursor: col-resize;
- height: 30px;
- position: relative;
- z-index: 1;
- background: url(grippie-vertical.png) center center no-repeat #eee;
- border: 1px solid #ccc;
-}
-
-.flexible-splitting {
- border: 2px dotted yellow !important;
- margin: -2px !important;
-}
-
-.flexible-splitter-hover-box {
- position: absolute;
- z-index: 1000;
- background: white;
- color: black;
- border: 1px solid black;
- width: 60px;
- height: 2em;
- text-align: center;
- line-height: 2em;
-}
-
-#panels-edit-display .panel-pane,
-#panels-edit-display .helperclass {
- margin: .5em;
-}
-
diff --git a/plugins/layouts/flexible/flexible-admin.js b/plugins/layouts/flexible/flexible-admin.js
deleted file mode 100644
index 8dd3117..0000000
--- a/plugins/layouts/flexible/flexible-admin.js
+++ /dev/null
@@ -1,413 +0,0 @@
-(function ($) {
-
-Drupal.flexible = Drupal.flexible || {};
-
-Drupal.flexible.splitters = [];
-
-/**
- * Fix the height of all splitters to be the same as the items they are
- * splitting.
- */
-Drupal.flexible.fixHeight = function() {
- for (i in Drupal.flexible.splitters) {
- Drupal.flexible.splitters[i].fixHeight();
- }
-}
-
-Drupal.behaviors.flexibleAdmin = {
- attach: function(context) {
- // Show/hide layout manager button
- $('input#panels-flexible-toggle-layout:not(.panels-flexible-processed)', context)
- .addClass('panels-flexible-processed')
- .click(function() {
- $('.panel-flexible-admin')
- .toggleClass('panel-flexible-no-edit-layout')
- .toggleClass('panel-flexible-edit-layout');
-
- if ($('.panel-flexible-admin').hasClass('panel-flexible-edit-layout')) {
- $(this).val(Drupal.t('Hide layout designer'));
- Drupal.flexible.fixHeight();
- }
- else {
- $(this).val(Drupal.t('Show layout designer'));
- }
- return false;
- });
-
- // Window splitter behavior.
- $('div.panels-flexible-splitter:not(.panels-splitter-processed)')
- .addClass('panels-splitter-processed')
- .each(function() {
- Drupal.flexible.splitters.push(new Drupal.flexible.splitter($(this)));
- });
-
- Drupal.flexible.fixHeight();
- }
-};
-
-Drupal.flexible.splitter = function($splitter) {
- var splitter = this;
-
- this.fixHeight = function() {
- // Set the splitter height to the shorter of the two:
- $splitter.height(Math.max(this.left.outerHeight(), this.right.outerHeight()));
- }
-
- function splitterStart(event) {
- // Bind motion events.
- $(document)
- .bind("mousemove", splitterMove)
- .bind("mouseup", splitterEnd);
-
- // Calculate some data about our split regions:
- splitter.getSizes();
-
- // The X coordinate where we clicked.
- splitter.startX = event.pageX;
-
- // The current sizes of the left/right panes.
- splitter.currentLeft = parseFloat(splitter.left_width) * parseFloat(splitter.left_scale);
- splitter.currentRight = parseFloat(splitter.right_width) * parseFloat(splitter.right_scale);
-
- // The starting sizes of the left right panes.
- splitter.startLeft = splitter.currentLeft;
- splitter.startRight = splitter.currentRight;
-
- if (splitter.left_width_type == splitter.right_width_type) {
- // If they're the same type, add the two together so we know how
- // much space we have for splitting.
- splitter.max = splitter.startLeft + splitter.startRight;
-
- // calculate unit size and min/max width.
- if (splitter.left_width_type == '%') {
- splitter.left_total = splitter.left.width() / (splitter.left_width / 100);
- // One pixel is equivalent to what percentage of the total?
- splitter.left_unit = (1 / splitter.left_total) * 100;
- splitter.left_min = 5; // minimum % we'll use.
- }
- else {
- splitter.left_unit = 1;
- splitter.left_min = 25; // minimum pixels we'll use.
- }
- if (splitter.right_width_type == '%') {
- splitter.right_total = splitter.right.width() / (splitter.right_width / 100);
- // One pixel is equivalent to what percentage of the total?
- splitter.right_unit = (1 / splitter.right_total) * 100;
- splitter.right_min = 5; // minimum % we'll use.
- }
- else {
- splitter.right_unit = 1;
- splitter.right_min = 25; // minimum pixels we'll use.
- }
- }
- else {
- // Figure out the parent blob's width and set the max to that
- splitter.parent = $splitter.parent().parent();
-
- if (splitter.left_width_type != 'px') {
- // Only the 'px' side can resize.
- splitter.left_unit = 0;
- splitter.right_unit = 1;
- splitter.right_min = 25;
- splitter.right_padding = parseInt(splitter.parent.css('padding-right'));
- splitter.right_parent = parseInt(splitter.right.parent().css('margin-right'));
- splitter.max = splitter.right.width() + splitter.left.parent().width() -
- (splitter.left.siblings(':not(.panels-flexible-splitter)').length * 25) - 25;
- }
- else {
- splitter.right_unit = 0;
- splitter.left_unit = 1;
- splitter.left_min = 25;
- splitter.left_padding = parseInt(splitter.parent.css('padding-left'));
- splitter.left_parent = parseInt(splitter.left.parent().css('margin-left'));
- if (splitter.right_id) {
- splitter.max = splitter.left.width() + splitter.right.parent().width() -
- (splitter.right.siblings(':not(.panels-flexible-splitter)').length * 25) - 25;
- }
- else {
- var subtract = 0;
- splitter.left.siblings(':not(.panels-flexible-splitter)').each(function() { subtract += $(this).width()});
- splitter.max = splitter.left.parent().width() - subtract;
- }
- }
- }
-
- var offset = $(splitter.splitter).offset();
-
- // Create boxes to display widths left and right of the mouse pointer.
- // Create left box only if left box is mobile.
- if (splitter.left_unit) {
- splitter.left_box = $('<div class="flexible-splitter-hover-box">&nbsp;</div>');
- $('body').append(splitter.left_box);
- splitter.left_box.css('top', offset.top);
- splitter.left_box.css('left', event.pageX - 65);
-
- if (splitter.left_width_type == '%') {
- var left = splitter.currentLeft / splitter.left_scale;
- splitter.left_box.html(left.toFixed(2) + splitter.left_width_type);
- }
- else {
- // make sure pixel values are always whole integers.
- splitter.currentLeft = parseInt(splitter.currentLeft);
- splitter.left_box.html(splitter.currentLeft + splitter.left_width_type);
- }
- }
-
- // Create the right box if the right side is mobile.
- if (splitter.right_unit) {
- splitter.right_box = $('<div class="flexible-splitter-hover-box"></div>');
- $('body').append(splitter.right_box);
- splitter.right_box.css('top', offset.top);
- splitter.right_box.css('left', event.pageX + 5);
- if (splitter.right_width_type == '%') {
- var right = splitter.currentRight / splitter.right_scale;
- splitter.right_box.html(right.toFixed(2) + splitter.right_width_type);
- }
- else {
- // make sure pixel values are always whole integers.
- splitter.currentRight = parseInt(splitter.currentRight);
- splitter.right_box.html(splitter.currentRight + splitter.right_width_type);
- }
- }
-
- return false;
- };
-
- function splitterMove(event) {
- var diff = splitter.startX - event.pageX;
- var moved = 0;
- // Bah, javascript has no logical xor operator
- if ((splitter.left_unit && !splitter.right_unit) ||
- (!splitter.left_unit && splitter.right_unit)) {
- // This happens when one side is fixed and the other side is fluid. The
- // fixed side actually adjusts while the fluid side does not. However,
- // in order to move the fluid side we have to adjust the padding
- // on our parent object.
- if (splitter.left_unit) {
- // Only the left box is allowed to move.
- splitter.currentLeft = splitter.startLeft - diff;
-
- if (splitter.currentLeft < splitter.left_min) {
- splitter.currentLeft = splitter.left_min;
- }
- if (splitter.currentLeft > splitter.max) {
- splitter.currentLeft = splitter.max;
- }
-
- // If the shift key is pressed, go with 1% or 10px boundaries.
- if (event.shiftKey) {
- splitter.currentLeft = parseInt(splitter.currentLeft / 10) * 10;
- }
- moved = (splitter.startLeft - splitter.currentLeft);
- }
- else {
- // Only the left box is allowed to move.
- splitter.currentRight = splitter.startRight + diff;
-
- if (splitter.currentRight < splitter.right_min) {
- splitter.currentRight = splitter.right_min;
- }
- if (splitter.currentRight > splitter.max) {
- splitter.currentRight = splitter.max;
- }
-
- // If the shift key is pressed, go with 1% or 10px boundaries.
- if (event.shiftKey) {
- splitter.currentRight = parseInt(splitter.currentRight / 10) * 10;
- }
- moved = (splitter.currentRight - splitter.startRight);
- }
- }
- else {
- // If they are both the same type, do this..
- // Adjust the left side by the amount we moved.
- var left = -1 * diff * splitter.left_unit;
-
- splitter.currentLeft = splitter.startLeft + left;
-
- if (splitter.currentLeft < splitter.left_min) {
- splitter.currentLeft = splitter.left_min;
- }
- if (splitter.currentLeft > splitter.max - splitter.right_min) {
- splitter.currentLeft = splitter.max - splitter.right_min;
- }
-
- // If the shift key is pressed, go with 1% or 10px boundaries.
- if (event.shiftKey) {
- if (splitter.left_width_type == '%') {
- splitter.currentLeft = parseInt(splitter.currentLeft / splitter.left_scale) * splitter.left_scale;
- }
- else {
- splitter.currentLeft = parseInt(splitter.currentLeft / 10) * 10;
- }
- }
-
- // Now automatically make the right side to be the other half.
- splitter.currentRight = splitter.max - splitter.currentLeft;
-
- // recalculate how far we've moved into pixels so we can adjust our visible
- // boxes.
- moved = (splitter.startLeft - splitter.currentLeft) / splitter.left_unit;
- }
-
- if (splitter.left_unit) {
- splitter.left_box.css('left', splitter.startX - 65 - moved);
- if (splitter.left_width_type == '%') {
- var left = splitter.currentLeft / splitter.left_scale;
- splitter.left_box.html(left.toFixed(2) + splitter.left_width_type);
- }
- else {
- splitter.left_box.html(parseInt(splitter.currentLeft) + splitter.left_width_type);
- }
-
- // Finally actually move the left side
- splitter.left.css('width', splitter.currentLeft + splitter.left_width_type);
- }
- else {
- // if not moving the left side, adjust the parent padding instead.
- splitter.parent.css('padding-right', (splitter.right_padding + moved) + 'px');
- splitter.right.parent().css('margin-right', (splitter.right_parent - moved) + 'px');
- }
-
- if (splitter.right_unit) {
- splitter.right_box.css('left', splitter.startX + 5 - moved);
- if (splitter.right_width_type == '%') {
- var right = splitter.currentRight / splitter.right_scale;
- splitter.right_box.html(right.toFixed(2) + splitter.right_width_type);
- }
- else {
- splitter.right_box.html(parseInt(splitter.currentRight) + splitter.right_width_type);
- }
-
- // Finally actually move the right side
- splitter.right.css('width', splitter.currentRight + splitter.right_width_type);
- }
- else {
- // if not moving the right side, adjust the parent padding instead.
- splitter.parent.css('padding-left', (splitter.left_padding - moved) + 'px');
- splitter.left.parent().css('margin-left', (splitter.left_parent + moved) + 'px');
- if (jQuery.browser.msie) {
- splitter.left.parent().css('left', splitter.currentLeft);
- }
- }
- return false;
- };
-
- function splitterEnd(event) {
- if (splitter.left_unit) {
- splitter.left_box.remove();
- }
-
- if (splitter.right_unit) {
- splitter.right_box.remove();
- }
-
-
- splitter.left.css("-webkit-user-select", "text"); // let Safari select text again
- splitter.right.css("-webkit-user-select", "text"); // let Safari select text again
-
- if (splitter.left_unit) {
- splitter.left_width = splitter.currentLeft / parseFloat(splitter.left_scale);
- }
-
- if (splitter.right_unit) {
- splitter.right_width = splitter.currentRight / parseFloat(splitter.right_scale);
- }
-
- splitter.putSizes();
- Drupal.flexible.fixHeight();
-
- $(document)
- .unbind("mousemove", splitterMove)
- .unbind("mouseup", splitterEnd);
-
- // Store the data on the server.
- Drupal.ajax['flexible-splitter-ajax'].options.data = {
- 'left': splitter.left_id,
- 'left_width': splitter.left_width,
- 'right': splitter.right_id,
- 'right_width': splitter.right_width
- };
-
- $('.panel-flexible-edit-layout').trigger('UpdateFlexibleSplitter');
- };
-
- this.getSizes = function() {
- splitter.left_width = $splitter.children('.panels-flexible-splitter-left-width').html();
- splitter.left_scale = $splitter.children('.panels-flexible-splitter-left-scale').html();
- splitter.left_width_type = $splitter.children('.panels-flexible-splitter-left-width-type').html();
- splitter.right_width = $splitter.children('.panels-flexible-splitter-right-width').html();
- splitter.right_scale = $splitter.children('.panels-flexible-splitter-right-scale').html();
- splitter.right_width_type = $splitter.children('.panels-flexible-splitter-right-width-type').html();
- };
-
- this.putSizes = function() {
- $(splitter.left_class + '-width').html(splitter.left_width);
- if (splitter.left_class != splitter.right_class) {
- $(splitter.right_class + '-width').html(splitter.right_width);
- }
- }
-
- splitter.splitter = $splitter;
- splitter.left_class = $splitter.children('.panels-flexible-splitter-left').html();
- splitter.left_id = $splitter.children('.panels-flexible-splitter-left-id').html();
- splitter.left = $(splitter.left_class);
- splitter.right_class = $splitter.children('.panels-flexible-splitter-right').html();
- splitter.right_id = $splitter.children('.panels-flexible-splitter-right-id').html();
- splitter.right = $(splitter.right_class);
-
- $splitter
- .bind("mousedown", splitterStart);
-
-};
-
-$(function() {
- /**
- * Provide an AJAX response command to allow the server to request
- * height fixing.
- */
- Drupal.ajax.prototype.commands.flexible_fix_height = function(ajax, command, status) {
- Drupal.flexible.fixHeight();
- };
-
- /**
- * Provide an AJAX response command to allow the server to change width on existing splitters.
- */
- Drupal.ajax.prototype.commands.flexible_set_width = function(ajax, command, status) {
- $(command.selector).html(command.width);
- };
-
- /**
- * Provide an AJAX response command to fix the first/last bits of a
- * group.
- */
- Drupal.ajax.prototype.commands.flexible_fix_firstlast = function(ajax, data, status) {
- $(data.selector + ' > div > .' + data.base)
- .removeClass(data.base + '-first')
- .removeClass(data.base + '-last');
-
- $(data.selector + ' > div > .' + data.base + ':first')
- .addClass(data.base + '-first');
- $(data.selector + ' > div > .' + data.base + ':last')
- .addClass(data.base + '-last');
- };
-
- // Create a generic ajax callback for use with the splitters which
- // background AJAX to store their data.
- var element_settings = {
- url: Drupal.settings.flexible.resize,
- event: 'UpdateFlexibleSplitter',
- keypress: false,
- // No throbber at all.
- progress: { 'type': 'none' }
- };
-
- Drupal.ajax['flexible-splitter-ajax'] = new Drupal.ajax('flexible-splitter-ajax', $('.panel-flexible-admin').get(0), element_settings);
-
- // Prevent ajax goo from doing odd things to our layout.
- Drupal.ajax['flexible-splitter-ajax'].beforeSend = function() { };
- Drupal.ajax['flexible-splitter-ajax'].beforeSerialize = function() { };
-
-});
-
-})(jQuery);
diff --git a/plugins/layouts/flexible/flexible.css b/plugins/layouts/flexible/flexible.css
deleted file mode 100644
index 0d1fbe6..0000000
--- a/plugins/layouts/flexible/flexible.css
+++ /dev/null
@@ -1,4 +0,0 @@
-
-.panel-flexible .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/flexible/flexible.inc b/plugins/layouts/flexible/flexible.inc
deleted file mode 100644
index a5806aa..0000000
--- a/plugins/layouts/flexible/flexible.inc
+++ /dev/null
@@ -1,1781 +0,0 @@
-<?php
-
-/**
- * Implementation of hook_panels_layouts()
- */
-// Plugin definition
-$plugin = array(
- 'title' => t('Flexible'),
- 'category' => t('Builders'),
- 'icon' => 'flexible.png',
- 'theme' => 'panels_flexible',
- 'admin theme' => 'panels_flexible_admin',
- 'css' => 'flexible.css',
- 'admin css' => 'flexible-admin.css',
- 'settings form' => 'panels_flexible_settings_form',
- 'settings submit' => 'panels_flexible_settings_submit',
- 'settings validate' => 'panels_flexible_settings_validate',
- 'regions function' => 'panels_flexible_panels',
- 'hook menu' => 'panels_flexible_menu',
-
- // Reuisable layout Builder specific directives
- 'builder' => TRUE,
- 'builder tab title' => 'Add flexible layout', // menu so translated elsewhere
-
- 'get child' => 'panels_flexible_get_sublayout',
- 'get children' => 'panels_flexible_get_sublayouts',
-
- // Define ajax callbacks
- 'ajax' => array(
- 'settings' => 'panels_ajax_flexible_edit_settings',
- 'add' => 'panels_ajax_flexible_edit_add',
- 'remove' => 'panels_ajax_flexible_edit_remove',
- 'resize' => 'panels_ajax_flexible_edit_resize',
- 'reuse' => 'panels_ajax_flexible_edit_reuse',
- ),
-);
-
-/**
- * Merge the main flexible plugin with a layout to create a sub plugin.
- *
- * This is used for both panels_flexible_get_sublayout and
- * panels_flexible_get_sublayouts.
- */
-function panels_flexible_merge_plugin($plugin, $layout) {
- $plugin['name'] = 'flexible:' . $layout->name;
- $plugin['category'] = !empty($layout->category) ? check_plain($layout->category) : t('Miscellaneous');
- $plugin['title'] = check_plain($layout->admin_title);
- $plugin['description'] = check_plain($layout->admin_description);
- $plugin['layout'] = $layout;
- $plugin['builder'] = FALSE;
- $plugin['builder tab title'] = NULL;
- return $plugin;
-}
-
-/**
- * Callback to provide a single stored flexible layout.
- */
-function panels_flexible_get_sublayout($plugin, $layout_name, $sublayout_name) {
- // Do not worry about caching; Panels is handling that for us.
- ctools_include('export');
- $item = ctools_export_crud_load('panels_layout', $sublayout_name);
- if ($item) {
- return panels_flexible_merge_plugin($plugin, $item);
- }
-}
-
-/**
- * Callback to provide all stored flexible layouts.
- */
-function panels_flexible_get_sublayouts($plugin, $layout_name) {
- $layouts[$layout_name] = $plugin;
- ctools_include('export');
- $items = ctools_export_load_object('panels_layout', 'conditions', array('plugin' => 'flexible'));
- foreach ($items as $name => $item) {
- $layouts['flexible:' . $name] = panels_flexible_merge_plugin($plugin, $item);
- }
-
- return $layouts;
-}
-
-/**
- * Convert settings from old style to new, or provide defaults for
- * empty settings.
- * @param <type> $settings
- */
-function panels_flexible_convert_settings(&$settings, &$layout) {
- // This indicates that this is a layout that they used the checkbox
- // on. The layout is still 'flexible' but it's actually pointing
- // to another stored one and we have to load it.
- if (!empty($settings['layout'])) {
- $layout = panels_get_layout('flexible:' . $settings['layout']);
- }
-
- if (!empty($layout['layout'])) {
- $settings = $layout['layout']->settings;
- return $settings;
- }
-
- if (empty($settings)) {
- // set up a default
- $settings = array(
- 'items' => array(
- // The 'canvas' is a special row that does not get rendered
- // normally, but is used to contain the columns.
- 'canvas' => array(
- 'type' => 'row',
- 'contains' => 'column',
- 'children' => array('main'),
- 'parent' => NULL,
- ),
- 'main' => array(
- 'type' => 'column',
- 'width' => 100,
- 'width_type' => '%',
- 'children' => array('main-row'),
- 'parent' => 'canvas',
- ),
- 'main-row' => array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array('center'),
- 'parent' => 'main',
- ),
- 'center' => array(
- 'type' => 'region',
- 'title' => t('Center'),
- 'width' => 100,
- 'width_type' => '%',
- 'parent' => 'main-row',
- ),
- ),
- );
- }
- else if (!isset($settings['items'])) {
- // Convert an old style flexible to a new style flexible.
- $old = $settings;
- $settings = array();
- $settings['items']['canvas'] = array(
- 'type' => 'row',
- 'contains' => 'column',
- 'children' => array(),
- 'parent' => NULL,
- );
- // add the left sidebar column, row and region if it exists.
- if (!empty($old['sidebars']['left'])) {
- $settings['items']['canvas']['children'][] = 'sidebar-left';
- $settings['items']['sidebar-left'] = array(
- 'type' => 'column',
- 'width' => $old['sidebars']['left_width'],
- 'width_type' => $old['sidebars']['width_type'],
- 'children' => array('sidebar-left-row'),
- 'parent' => 'canvas',
- );
- $settings['items']['sidebar-left-row'] = array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array('sidebar_left'),
- 'parent' => 'sidebar-left',
- );
- $settings['items']['sidebar_left'] = array(
- 'type' => 'region',
- 'title' => t('Left sidebar'),
- 'width' => 100,
- 'width_type' => '%',
- 'parent' => 'sidebar-left-row',
- );
- }
-
- $settings['items']['canvas']['children'][] = 'main';
-
- if (!empty($old['sidebars']['right'])) {
- $settings['items']['canvas']['children'][] = 'sidebar-right';
- $settings['items']['sidebar-right'] = array(
- 'type' => 'column',
- 'width' => $old['sidebars']['right_width'],
- 'width_type' => $old['sidebars']['width_type'],
- 'children' => array('sidebar-right-row'),
- 'parent' => 'canvas',
- );
- $settings['items']['sidebar-right-row'] = array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array('sidebar_right'),
- 'parent' => 'sidebar-right',
- );
- $settings['items']['sidebar_right'] = array(
- 'type' => 'region',
- 'title' => t('Right sidebar'),
- 'width' => 100,
- 'width_type' => '%',
- 'parent' => 'sidebar-right-row',
- );
- }
-
- // Add the main column.
- $settings['items']['main'] = array(
- 'type' => 'column',
- 'width' => 100,
- 'width_type' => '%',
- 'children' => array(),
- 'parent' => 'canvas',
- );
-
- // Add rows and regions.
- for ($row = 1; $row <= intval($old['rows']); $row++) {
- // Create entry for the row
- $settings['items']["row_$row"] = array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array(),
- 'parent' => 'main',
- );
- // Add the row to the parent's children
- $settings['items']['main']['children'][] = "row_$row";
-
- for ($col = 1; $col <= intval($old["row_$row"]['columns']); $col++) {
- // Create entry for the region
- $settings['items']["row_${row}_$col"] = array(
- 'type' => 'region',
- 'width' => $old["row_$row"]["width_$col"],
- 'width_type' => '%',
- 'parent' => "row_$row",
- );
- // Add entry for the region to the row's children
- $settings['items']["row_$row"]['children'][] = "row_${row}_$col";
-
- // Apply the proper title to the region
- if (!empty($old["row_$row"]['names'][$col - 1])) {
- $settings['items']["row_${row}_$col"]['title'] = $old["row_$row"]['names'][$col - 1];
- }
- else {
- $settings['items']["row_${row}_$col"]['title'] = t("Row @row, Column @col", array('@row' => $row, '@col' => $col));
- }
- }
- }
- }
- else if (isset($settings['canvas'])) {
- // Convert the old 'canvas' to the new canvas row.
- $settings['items']['canvas'] = array(
- 'type' => 'row',
- 'contains' => 'column',
- 'children' => $settings['canvas'],
- 'parent' => NULL,
- );
- unset($settings['canvas']);
- }
-}
-
-/**
- * Define the actual list of columns and rows for this flexible panel.
- */
-function panels_flexible_panels($display, $settings, $layout) {
- $items = array();
- panels_flexible_convert_settings($settings, $layout);
- foreach ($settings['items'] as $id => $item) {
- if ($item['type'] == 'region') {
- $items[$id] = $item['title'];
- }
- }
-
- return $items;
-}
-
-/**
- * Create a renderer object.
- *
- * The renderer object contains data that is passed around from function
- * to function allowing us to render our CSS and HTML easily.
- *
- * @todo Convert the functions to methods and make this properly OO.
- */
-function panels_flexible_create_renderer($admin, $css_id, $content, $settings, &$display, $layout, $handler) {
- $renderer = new stdClass;
- $renderer->settings = $settings;
- $renderer->content = $content;
- $renderer->css_id = $css_id;
- $renderer->did = &$display->did;
- if ($admin) {
- // always scale in admin mode.
- $renderer->scale_base = 99.0;
- }
- else {
- $renderer->scale_base = !empty($settings['items']['canvas']['no_scale']) ? 100.0 : 99.0;
- }
- $renderer->id_str = $css_id ? 'id="' . $css_id . '"' : '';
- $renderer->admin = $admin;
- $renderer->handler = $handler;
-
- // Set up basic classes for all of our components.
- $renderer->name = !empty($layout['layout']) ? $layout['layout']->name : $display->did;
- $renderer->base_class = $renderer->name;
- $renderer->item_class['column'] = 'panels-flexible-column';
- $renderer->item_class['row'] = 'panels-flexible-row';
- $renderer->item_class['region'] = 'panels-flexible-region';
- $renderer->base['canvas'] = 'panels-flexible-' . $renderer->base_class;
-
- // Override these if selected from the UI and not in admin mode.
- if (!$admin) {
- if (!empty($settings['items']['canvas']['class'])) {
- $renderer->base_class = $settings['items']['canvas']['class'];
- $renderer->base['canvas'] = $renderer->base_class;
- }
- if (!empty($settings['items']['canvas']['column_class'])) {
- $renderer->item_class['column'] = $settings['items']['canvas']['column_class'];
- }
- if (!empty($settings['items']['canvas']['row_class'])) {
- $renderer->item_class['row'] = $settings['items']['canvas']['row_class'];
- }
- if (!empty($settings['items']['canvas']['region_class'])) {
- $renderer->item_class['region'] = $settings['items']['canvas']['region_class'];
- }
- }
-
- // Get the separation values out of the canvas settings.
- $renderer->column_separation = !empty($settings['items']['canvas']['column_separation']) ? $settings['items']['canvas']['column_separation'] : '0.5em';
-
- $renderer->region_separation = !empty($settings['items']['canvas']['region_separation']) ? $settings['items']['canvas']['region_separation'] : '0.5em';
-
- $renderer->row_separation = !empty($settings['items']['canvas']['row_separation']) ? $settings['items']['canvas']['row_separation'] : '0.5em';
-
- // Make some appended classes so it's easier to reference them.
-
- $renderer->base['column'] = $renderer->item_class['column'] . '-' . $renderer->base_class;
- $renderer->base['row'] = $renderer->item_class['row'] . '-' . $renderer->base_class;
- $renderer->base['region'] = $renderer->item_class['region'] . '-' . $renderer->base_class;
-
- if ($renderer->name != 'new') {
- // Use v2 to guarantee all CSS gets regenerated to account for changes in
- // how some divs will be rendered.
- $renderer->css_cache_name = 'flexiblev2:' . $renderer->name;
- if ($admin) {
- ctools_include('css');
- ctools_css_clear($renderer->css_cache_name);
- }
- }
- return $renderer;
-}
-
-/**
- * Draw the flexible layout.
- */
-function theme_panels_flexible($vars) {
- $css_id = $vars['css_id'];
- $content = $vars['content'];
- $settings = $vars['settings'];
- $display = $vars['display'];
- $layout = $vars['layout'];
- $handler = $vars['renderer'];
-
- panels_flexible_convert_settings($settings, $layout);
-
- $renderer = panels_flexible_create_renderer(FALSE, $css_id, $content, $settings, $display, $layout, $handler);
-
- // CSS must be generated because it reports back left/middle/right
- // positions.
- $css = panels_flexible_render_css($renderer);
-
- if (!empty($renderer->css_cache_name) && empty($display->editing_layout)) {
- ctools_include('css');
- // Generate an id based upon rows + columns:
- $filename = ctools_css_retrieve($renderer->css_cache_name);
- if (!$filename) {
- $filename = ctools_css_store($renderer->css_cache_name, $css, FALSE);
- }
-
- // Give the CSS to the renderer to put where it wants.
- if ($handler) {
- $handler->add_css($filename, 'module', 'all', FALSE);
- }
- else {
- drupal_add_css($filename);
- }
- }
- else {
- // If the id is 'new' we can't reliably cache the CSS in the filesystem
- // because the display does not truly exist, so we'll stick it in the
- // head tag. We also do this if we've been told we're in the layout
- // editor so that it always gets fresh CSS.
- drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE));
- }
-
- // Also store the CSS on the display in case the live preview or something
- // needs it
- $display->add_css = $css;
-
- $output = "<div class=\"panel-flexible " . $renderer->base['canvas'] . " clearfix\" $renderer->id_str>\n";
- $output .= "<div class=\"panel-flexible-inside " . $renderer->base['canvas'] . "-inside\">\n";
-
- $output .= panels_flexible_render_items($renderer, $settings['items']['canvas']['children'], $renderer->base['canvas']);
-
- // Wrap the whole thing up nice and snug
- $output .= "</div>\n</div>\n";
-
- return $output;
-}
-
-/**
- * Draw the flexible layout.
- */
-function theme_panels_flexible_admin($vars) {
- $css_id = $vars['css_id'];
- $content = $vars['content'];
- $settings = $vars['settings'];
- $display = $vars['display'];
- $layout = $vars['layout'];
- $handler = $vars['renderer'];
-
- // We never draw stored flexible layouts in admin mode; they must be edited
- // from the stored layout UI at that point.
- if (!empty($layout['layout'])) {
- return theme_panels_flexible(array('css_id' => $css_id, 'content' => $content, 'settings' => $settings, 'display' => $display, 'layout' => $layout, 'renderer' => $handler));
- }
-
- panels_flexible_convert_settings($settings, $layout);
- $renderer = panels_flexible_create_renderer(TRUE, $css_id, $content, $settings, $display, $layout, $handler);
-
- $css = panels_flexible_render_css($renderer);
-
- // For the administrative view, add CSS directly to head.
- drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE));
-
- if (empty($display->editing_layout)) {
- $output = '<input type="submit" id="panels-flexible-toggle-layout" class="form-submit" value ="' .
- t('Show layout designer') . '">';
- if (user_access('administer panels layouts')) {
- $output .= '<input type="hidden" class="panels-flexible-reuse-layout-url" value="' . url($handler->get_url('layout', 'reuse'), array('absolute' => TRUE)) . '">';
- $output .= '<input type="submit" id="panels-flexible-reuse-layout" class="form-submit ctools-use-modal" value ="' .
- t('Reuse layout') . '">';
- }
- $output .= "<div class=\"panel-flexible " . $renderer->base['canvas'] . " clearfix panel-flexible-admin panel-flexible-no-edit-layout\" $renderer->id_str>\n";
- }
- else {
- $output = "<div class=\"panel-flexible " . $renderer->base['canvas'] . " clearfix panel-flexible-admin panel-flexible-edit-layout\" $renderer->id_str>\n";
- }
- $output .= "<div class=\"panel-flexible-inside " . $renderer->base['canvas'] . "-inside \">\n";
-
- $content = panels_flexible_render_items($renderer, $settings['items']['canvas']['children'], $renderer->base['row'] . '-canvas');
- $output .= panels_flexible_render_item($renderer, $settings['items']['canvas'], $content, 'canvas', 0, 0, TRUE);
-
- // Wrap the whole thing up nice and snug
- $output .= "</div>\n</div>\n";
-
- drupal_add_js($layout['path'] . '/flexible-admin.js');
- drupal_add_js(array('flexible' => array('resize' => url($handler->get_url('layout', 'resize'), array('absolute' => TRUE)))), 'setting');
- return $output;
-}
-
-/**
- * Render a piece of a flexible layout.
- */
-function panels_flexible_render_items($renderer, $list, $owner_id) {
- $output = '';
- $groups = array('left' => '', 'middle' => '', 'right' => '');
- $max = count($list) - 1;
- $prev = NULL;
-
- foreach ($list as $position => $id) {
- $item = $renderer->settings['items'][$id];
- $location = isset($renderer->positions[$id]) ? $renderer->positions[$id] : 'middle';
-
- if ($renderer->admin && $item['type'] != 'row' && $prev ) {
- $groups[$location] .= panels_flexible_render_splitter($renderer, $prev, $id);
- }
-
- switch ($item['type']) {
- case 'column':
- $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['column'] . '-' . $id);
- $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max);
- break;
- case 'row':
- $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['row'] . '-' . $id);
- $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, TRUE);
- break;
- case 'region':
- $content = isset($renderer->content[$id]) ? $renderer->content[$id] : "&nbsp;";
- $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max);
- break;
- }
-
- // If all items are fixed then we have a special splitter on the right to
- // control the overall width.
- if (!empty($renderer->admin) && $max == $position && $location == 'left') {
- $groups[$location] .= panels_flexible_render_splitter($renderer, $id, NULL);
- }
- $prev = $id;
- }
-
- $group_count = count(array_filter($groups));
-
- // Render each group. We only render the group div if we're in admin mode
- // or if there are multiple groups.
- foreach ($groups as $position => $content) {
- if (!empty($content) || $renderer->admin) {
- if ($group_count > 1 || $renderer->admin) {
- $output .= '<div class="' . $owner_id . '-' . $position . '">' . $content . '</div>';
- }
- else {
- $output .= $content;
- }
- }
- }
-
- return $output;
-}
-
-/**
- * Render a column in the flexible layout.
- */
-function panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, $clear = FALSE) {
-
- // If we are rendering a row and there is just one row, we don't need to
- // render the row unless there is fixed_width content inside it.
- if (empty($renderer->admin) && $item['type'] == 'row' && $max == 0) {
- $fixed = FALSE;
- foreach ($item['children'] as $id) {
- if ($renderer->settings['items'][$id]['width_type'] != '%') {
- $fixed = TRUE;
- break;
- }
- }
-
- if (!$fixed) {
- return $content;
- }
- }
-
- // If we are rendering a column and there is just one column, we don't
- // need to render the column unless it has a fixed_width.
- if (empty($renderer->admin) && $item['type'] == 'column' && $max == 0 && $item['width_type'] == '%') {
- return $content;
- }
-
- $base = $renderer->item_class[$item['type']];
- $output = '<div class="' . $base . ' ' . $renderer->base[$item['type']] . '-' . $id;
- if ($position == 0) {
- $output .= ' ' . $base . '-first';
- }
- if ($position == $max) {
- $output .= ' ' . $base . '-last';
- }
- if ($clear) {
- $output .= ' clearfix';
- }
-
- if (isset($item['class'])) {
- $output .= ' ' . check_plain($item['class']);
- }
-
- $output .= '">' . "\n";
-
- if (!empty($renderer->admin)) {
- $output .= panels_flexible_render_item_links($renderer, $id, $item);
- }
-
- $output .= ' <div class="inside ' . $base . '-inside ' . $base . '-' . $renderer->base_class . '-' . $id . '-inside';
- if ($position == 0) {
- $output .= ' ' . $base . '-inside-first';
- }
- if ($position == $max) {
- $output .= ' ' . $base . '-inside-last';
- }
- if ($clear) {
- $output .= ' clearfix';
- }
-
- $output .= "\">\n";
- $output .= $content;
- $output .= ' </div>' . "\n";
- $output .= '</div>' . "\n";
-
- return $output;
-}
-/**
- * Render a splitter div to place between the $left and $right items.
- *
- * If the right ID is NULL that means there isn't actually a box to the
- * right, but we need a splitter anyway. We'll mostly use info about the
- * left, but pretend it's 'fluid' so that the javascript won't actually
- * modify the right item.
- */
-function panels_flexible_render_splitter($renderer, $left_id, $right_id) {
- $left = $renderer->settings['items'][$left_id];
-
- $left_class = $renderer->base[$left['type']] . '-' . $left_id;
- if ($right_id) {
- $right = $renderer->settings['items'][$right_id];
- $right_class = $renderer->base[$left['type']] . '-' . $right_id;
- }
- else {
- $right = $left;
- $right_class = $left_class;
- }
-
- $output = '<div class="panels-flexible-splitter flexible-splitter-for-' . $left_class . '">';
-
- // Name the left object
- $output .= '<span class="panels-flexible-splitter-left">';
- $output .= '.' . $left_class;
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-left-id">';
- $output .= $left_id;
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-left-width ' . $left_class . '-width">';
- $output .= $left['width'];
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-left-scale">';
- $output .= isset($renderer->scale[$left_id]) ? $renderer->scale[$left_id] : 1;
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-left-width-type">';
- $output .= $left['width_type'];
- $output .= '</span>';
-
- // Name the right object
- $output .= '<span class="panels-flexible-splitter-right">';
- $output .= '.' . $right_class;
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-right-id">';
- $output .= $right_id;
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-right-width ' . $right_class . '-width">';
- $output .= $right['width'];
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-right-scale">';
- $output .= isset($renderer->scale[$right_id]) ? $renderer->scale[$right_id] : 1;
- $output .= '</span>';
-
- $output .= '<span class="panels-flexible-splitter-right-width-type">';
- // If there is no right, make it fluid.
- $output .= $right_id ? $right['width_type'] : '%';
- $output .= '</span>';
-
- $output .= '</div>';
- return $output;
-}
-
-/**
- * Render the dropdown links for an item.
- */
-function panels_flexible_render_item_links($renderer, $id, $item) {
- $links = array();
- $remove = '';
- $add = '';
- if ($item['type'] == 'column') {
- $title = t('Column');
- $settings = t('Column settings');
- if (empty($item['children'])) {
- $remove = t('Remove column');
- $add = t('Add row');
- }
- else {
- $add = t('Add row to top');
- $add2 = t('Add row to bottom');
- }
- }
- else if ($item['type'] == 'row') {
- if ($id == 'canvas') {
- $title = t('Canvas');
- $settings = t('Canvas settings');
- }
- else {
- $title = t('Row');
- $settings = t('Row settings');
- }
- if (empty($item['children'])) {
- if ($id != 'canvas') {
- $remove = t('Remove row');
- }
- $add = $item['contains'] == 'region' ? t('Add region') : t('Add column');
- }
- else {
- $add = $item['contains'] == 'region' ? t('Add region to left') : t('Add column to left');
- $add2 = $item['contains'] == 'region' ? t('Add region to right') : t('Add column to right');
- }
- }
- else if ($item['type'] == 'region') {
- $title = t('Region');
- $settings = t('Region settings');
- $remove = t('Remove region');
- }
-
- if (!empty($settings)) {
- $links[] = array(
- 'title' => $settings,
- 'href' => $renderer->handler->get_url('layout', 'settings', $id),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
- if ($add) {
- $links[] = array(
- 'title' => $add,
- 'href' => $renderer->handler->get_url('layout', 'add', $id),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
- if (isset($add2)) {
- $links[] = array(
- 'title' => $add2,
- 'href' => $renderer->handler->get_url('layout', 'add', $id, 'right'),
- 'attributes' => array('class' => array('ctools-use-modal')),
- );
- }
- if ($remove) {
- $links[] = array(
- 'title' => $remove,
- 'href' => $renderer->handler->get_url('layout', 'remove', $id),
- 'attributes' => array('class' => array('use-ajax')),
- );
- }
-
- return theme('ctools_dropdown', array('title' => $title, 'links' => $links, 'class' => 'flexible-layout-only flexible-links flexible-title flexible-links-' . $id));
-}
-/**
- * Provide CSS for a flexible layout.
- */
-function panels_flexible_render_css($renderer) {
- if ($renderer->admin) {
- $parent_class = '.' . $renderer->base['row'] . '-canvas';
- }
- else {
- $parent_class = '.' . $renderer->base['canvas'];
- }
- return panels_flexible_render_css_group($renderer, $renderer->settings['items']['canvas']['children'], $parent_class, 'column', 'canvas');
-}
-
-/**
- * Render the CSS for a group of items to be displayed together.
- *
- * Columns and regions, when displayed as a group, need to cooperate in
- * order to share margins and make sure that percent widths add up
- * to the right total.
- */
-function panels_flexible_render_css_group($renderer, $list, $owner_id, $type, $id) {
- $css = array();
-
- // Start off with some generic CSS to properly pad regions
- $css['.' . $renderer->item_class['region']] = array(
- 'padding' => '0',
- );
-
- $css['.' . $renderer->item_class['region'] . '-inside'] = array(
- 'padding-right' => $renderer->region_separation,
- 'padding-left' => $renderer->region_separation,
- );
-
- $css['.' . $renderer->item_class['region'] . '-inside-first'] = array(
- 'padding-left' => '0',
- );
-
- $css['.' . $renderer->item_class['region'] . '-inside-last'] = array(
- 'padding-right' => '0',
- );
-
- $css['.' . $renderer->item_class['column']] = array(
- 'padding' => '0',
- );
-
- $css['.' . $renderer->item_class['column'] . '-inside'] = array(
- 'padding-right' => $renderer->column_separation,
- 'padding-left' => $renderer->column_separation,
- );
-
- $css['.' . $renderer->item_class['column'] . '-inside-first'] = array(
- 'padding-left' => '0',
- );
-
- $css['.' . $renderer->item_class['column'] . '-inside-last'] = array(
- 'padding-right' => '0',
- );
-
- // And properly pad rows too
- $css['.' . $renderer->item_class['row']] = array(
- 'padding' => '0 0 ' . $renderer->row_separation . ' 0',
- 'margin' => '0',
- );
-
- $css['.' . $renderer->item_class['row'] . '-last'] = array(
- 'padding-bottom' => '0',
- );
-
- panels_flexible_get_css_group($css, $renderer, $list, $owner_id, $type, $id);
-
- ctools_include('css');
- return ctools_css_assemble($css);
-}
-
-/**
- * Construct an array with all of the CSS properties for a group.
- *
- * This will parse down into children and produce all of the CSS needed if you
- * start from the top.
- */
-function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type, $item_id) {
- if ($type != 'row') {
- // Go through our items and break up into right/center/right groups so we
- // can figure out our offsets.
-
- // right == any items on the right that are 'fixed'.
- // middle == all fluid items.
- // right == any items on the right that are 'fixed'.
- $left = $middle = $right = array();
- $left_total = $right_total = $middle_total = 0;
- $current = 'left';
- foreach ($list as $id) {
- if ($renderer->settings['items'][$id]['width_type'] == 'px') {
- // fixed
- if ($current == 'left') {
- $left[] = $id;
- $renderer->positions[$id] = 'left';
- $left_total += $renderer->settings['items'][$id]['width'];
- }
- else {
- $current = 'right';
- $right[] = $id;
- $renderer->positions[$id] = 'right';
- $right_total += $renderer->settings['items'][$id]['width'];
- }
- }
- else {
- // fluid
- if ($current != 'right') {
- $current = 'middle';
- $middle[] = $id;
- $renderer->positions[$id] = 'middle';
- $middle_total += $renderer->settings['items'][$id]['width'];
- }
- // fall through: if current is 'right' and we ran into a 'fluid' then
- // it gets *dropped* because that is invalid.
- }
- }
-
- // Go through our right sides and create CSS.
- foreach ($left as $id) {
- $class = "." . $renderer->base[$type] . "-$id";
- $css[$class] = array(
- 'position' => 'relative',
- 'float' => 'left',
- 'background-color' => 'transparent',
- 'width' => $renderer->settings['items'][$id]['width'] . "px",
- );
- }
-
- // Do the same for right.
- $right_pixels = 0;
-
- foreach ($right as $id) {
- $class = "." . $renderer->base[$type] . "-$id";
- $css[$class] = array(
- 'float' => 'left',
- 'width' => $renderer->settings['items'][$id]['width'] . "px",
- );
- }
-
- $max = count($middle) - 1;
-
- if ($middle_total) {
- // Because we love IE so much, auto scale everything to 99%. This
- // means adding up the actual widths and then providing a multiplier
- // to each so that the total is 99%.
- $scale = $renderer->scale_base / $middle_total;
- foreach ($middle as $position => $id) {
- $class = "." . $renderer->base[$type] . "-$id";
- $css[$class] = array(
- 'float' => 'left',
- 'width' => number_format($renderer->settings['items'][$id]['width'] * $scale, 4, '.', '') . "%",
- );
-
- // Store this so we can use it later.
- // @todo: Store the scale, not the new width, so .js can adjust
- // bi-directionally.
- $renderer->scale[$id] = $scale;
- }
- }
-
- // If there is any total remaining, we need to offset the splitter
- // by this much too.
- if ($left_total) {
- // Add this even if it's 0 so we can handle removals.
- $css["$owner_id-inside"]['padding-left'] = '0px';
- if ($renderer->admin || count($middle)) {
- $css["$owner_id-middle"]['margin-left'] = $left_total . 'px';
- // IE hack
- $css["* html $owner_id-left"]['left'] = $left_total . "px";
- // Make this one very specific to the admin CSS so that preview
- // does not stomp it.
- $css[".panel-flexible-admin $owner_id-inside"]['padding-left'] = '0px';
- }
- else {
- $css["$owner_id-inside"]['margin-left'] = '-' . $left_total . 'px';
- $css["$owner_id-inside"]['padding-left'] = $left_total . 'px';
- // IE hack
- $css["* html $owner_id-inside"]['left'] = $left_total . "px";
- }
- }
- if ($right_total) {
- $css["$owner_id-middle"]['margin-right'] = $right_total . 'px';
- }
- $css["$owner_id-inside"]['padding-right'] = '0px';
- }
-
- // If the canvas has a fixed width set, and this is the canvas, fix the
- // width.
- if ($item_id == 'canvas') {
- $item = $renderer->settings['items'][$item_id];
-
- if (!empty($item['fixed_width']) && intval($item['fixed_width'])) {
- $css['.' . $renderer->base['canvas']]['width'] = intval($item['fixed_width']) . 'px';
- }
- else {
- $css['.' . $renderer->base['canvas']]['width'] = 'auto';
- }
- }
-
- // Go through each item and process children.
- foreach ($list as $id) {
- $item = $renderer->settings['items'][$id];
- if (empty($item['children'])) {
- continue;
- }
-
- if ($type == 'column') {
- // Columns can only contain rows.
- $child_type = 'row';
- }
- else {
- $child_type = isset($item['contains']) ? $item['contains'] : 'region';
- }
-
- $class = "." . $renderer->base[$type] . "-$id";
- panels_flexible_get_css_group($css, $renderer, $item['children'], $class, $child_type, $id);
- }
-}
-
-/**
- * AJAX responder to edit flexible settings for an item.
- *
- * $handler object
- * The display renderer handler object.
- */
-function panels_ajax_flexible_edit_settings($handler, $id) {
- $settings = &$handler->display->layout_settings;
- panels_flexible_convert_settings($settings, $handler->plugins['layout']);
-
- if (empty($settings['items'][$id])) {
- ctools_modal_render(t('Error'), t('Invalid item id.'));
- }
-
- $item = &$settings['items'][$id];
- $siblings = array();
-
- if ($id != 'canvas') {
- $siblings = $settings['items'][$item['parent']]['children'];
- }
-
-
- switch ($item['type']) {
- case 'column':
- $title = t('Configure column');
- break;
- case 'row':
- if ($id == 'canvas') {
- $title = t('Configure canvas');
- }
- else {
- $title = t('Configure row');
- }
- break;
- case 'region':
- $title = t('Configure region');
- break;
- }
-
- $form_state = array(
- 'display' => &$handler->display,
- 'item' => &$item,
- 'id' => $id,
- 'siblings' => $siblings,
- 'settings' => &$settings,
- 'ajax' => TRUE,
- 'title' => $title,
- 'op' => 'edit',
- );
-
- $output = ctools_modal_form_wrapper('panels_flexible_config_item_form', $form_state);
- if (!empty($form_state['executed'])) {
- // If the width type changed then other nearby items will have
- // to have their widths adjusted.
- panels_edit_cache_set($handler->cache);
-
- $css_id = isset($handler->display->css_id) ? $handler->display->css_id : '';
- $renderer = panels_flexible_create_renderer(TRUE, $css_id, array(), $settings, $handler->display, $handler->plugins['layout'], $handler);
-
- $output = array();
- // If the item is a region, replace the title.
- $class = $renderer->base[$item['type']] . '-' . $id;
- if ($item['type'] == 'region') {
- $output[] = ajax_command_replace(".$class h2.label",
- '<h2 class="label">' . check_plain($item['title']) . '</h2>');
- }
-
- // Rerender our links in case something changed.
- $output[] = ajax_command_replace('.flexible-links-' . $id,
- panels_flexible_render_item_links($renderer, $id, $item));
-
- // If editing the canvas, reset the CSS width
- if ($id == 'canvas') {
- // update canvas CSS.
- $css = array(
- '.' . $renderer->item_class['column'] . '-inside' => array(
- 'padding-left' => $renderer->column_separation,
- 'padding-right' => $renderer->column_separation,
- ),
- '.' . $renderer->item_class['region'] . '-inside' => array(
- 'padding-left' => $renderer->region_separation,
- 'padding-right' => $renderer->region_separation,
- ),
- '.' . $renderer->item_class['row'] => array(
- 'padding-bottom' => $renderer->row_separation,
- ),
- );
- if (!empty($item['fixed_width']) && intval($item['fixed_width'])) {
- $css['.' . $renderer->base['canvas']] = array('width' => intval($item['fixed_width']) . 'px');
- }
- else {
- $css['.' . $renderer->base['canvas']] = array('width' => 'auto');
- }
- foreach ($css as $selector => $data) {
- $output[] = ajax_command_css($selector, $data);
- }
- }
-
- $output[] = ctools_modal_command_dismiss();
- }
-
- $handler->commands = $output;
-}
-
-/**
- * Configure a row, column or region on the flexible page.
- *
- * @param <type> $form_state
- * @return <type>
- */
-function panels_flexible_config_item_form($form, &$form_state) {
- $display = &$form_state['display'];
- $item = &$form_state['item'];
- $siblings = &$form_state['siblings'];
- $settings = &$form_state['settings'];
- $id = &$form_state['id'];
-
- if ($item['type'] == 'region') {
- $form['title'] = array(
- '#title' => t('Region title'),
- '#type' => 'textfield',
- '#default_value' => $item['title'],
- '#required' => TRUE,
- );
- }
-
- if ($id == 'canvas') {
- $form['class'] = array(
- '#title' => t('Canvas class'),
- '#type' => 'textfield',
- '#default_value' => isset($item['class']) ? $item['class'] : '',
- '#description' => t('This class will the primary class for this layout. It will also be appended to all column, row and region_classes to ensure that layouts within layouts will not inherit CSS from each other. If left blank, the name of the layout or ID of the display will be used.'),
- );
-
- $form['column_class'] = array(
- '#title' => t('Column class'),
- '#type' => 'textfield',
- '#default_value' => isset($item['column_class']) ? $item['column_class'] : '',
- '#description' => t('This class will be applied to all columns of the layout. If left blank this will be panels-flexible-column.'),
- );
-
- $form['row_class'] = array(
- '#title' => t('Row class'),
- '#type' => 'textfield',
- '#default_value' => isset($item['row_class']) ? $item['row_class'] : '',
- '#description' => t('This class will be applied to all rows of the layout. If left blank this will be panels-flexible-row.'),
- );
-
- $form['region_class'] = array(
- '#title' => t('Region class'),
- '#type' => 'textfield',
- '#default_value' => isset($item['region_class']) ? $item['region_class'] : '',
- '#description' => t('This class will be applied to all regions of the layout. If left blank this will be panels-flexible-region.'),
- );
-
- $form['no_scale'] = array(
- '#type' => 'checkbox',
- '#title' => t('Scale fluid widths for IE6'),
- '#description' => t('IE6 does not do well with 100% widths. If checked, width will be scaled to 99% to compensate.'),
- '#default_value' => empty($item['no_scale']),
- );
-
- $form['fixed_width'] = array(
- '#type' => 'textfield',
- '#title' => t('Fixed width'),
- '#description' => t('If a value is entered, the layout canvas will be fixed to the given pixel width.'),
- '#default_value' => isset($item['fixed_width']) ? $item['fixed_width'] : '',
- );
-
- $form['column_separation'] = array(
- '#type' => 'textfield',
- '#title' => t('Column separation'),
- '#description' => t('How much padding to put on columns that are that are next to other columns. Note that this is put on both columns so the real amount is doubled.'),
- '#default_value' => isset($item['column_separation']) ? $item['column_separation'] : '0.5em',
- );
-
- $form['region_separation'] = array(
- '#type' => 'textfield',
- '#title' => t('Region separation'),
- '#description' => t('How much padding to put on regions that are that are next to other regions. Note that this is put on both regions so the real amount is doubled.'),
- '#default_value' => isset($item['region_separation']) ? $item['region_separation'] : '0.5em',
- );
-
- $form['row_separation'] = array(
- '#type' => 'textfield',
- '#title' => t('Row separation'),
- '#description' => t('How much padding to put on beneath rows to separate them from each other. Because this is placed only on the bottom, not hte top, this is NOT doubled like column/region separation.'),
- '#default_value' => isset($item['row_separation']) ? $item['row_separation'] : '0.5em',
- );
- }
- else {
- $form['class'] = array(
- '#title' => t('CSS class'),
- '#type' => 'textfield',
- '#default_value' => isset($item['class']) ? $item['class'] : '',
- '#description' => t('Enter a CSS class that will be used. This can be used to apply automatic styling from your theme, for example.'),
- );
-
- if ($item['type'] != 'row') {
- // Test to see if there are fluid items to the left or the right. If there
- // are fluid items on both sides, this item cannot be set to fixed.
- $left = $right = FALSE;
- $current = 'left';
- foreach ($siblings as $sibling) {
- if ($sibling == $id) {
- $current = 'right';
- }
- else if ($settings['items'][$sibling]['width_type'] == '%') {
- $$current = TRUE; // Indirection.
- }
- }
-
- $form['width_type'] = array(
- '#type' => 'select',
- '#title' => t('Width'),
- '#default_value' => $item['width_type'],
- '#options' => array(
- '%' => t('Fluid'),
- 'px' => t('Fixed'),
- ),
- '#disabled' => TRUE,
- );
- }
- else {
- $form['contains'] = array(
- '#type' => 'select',
- '#title' => t('Contains'),
- '#default_value' => $item['contains'],
- '#options' => array(
- 'region' => t('Regions'),
- 'column' => t('Columns'),
- ),
- );
-
- if (!empty($item['children'])) {
- $form['contains']['#disabled'] = TRUE;
- $form['contains']['#value'] = $item['contains'];
- $form['contains']['#description'] = t('You must remove contained items to change the row container type.');
- }
- }
- }
-
- $form['save'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-/**
- * Submit handler for editing a flexible item.
- */
-function panels_flexible_config_item_form_submit(&$form, &$form_state) {
- $item = &$form_state['item'];
- if ($item['type'] == 'region') {
- $item['title'] = $form_state['values']['title'];
- }
-
- $item['class'] = $form_state['values']['class'];
-
- if ($form_state['id'] == 'canvas') {
- $item['column_class'] = $form_state['values']['column_class'];
- $item['row_class'] = $form_state['values']['row_class'];
- $item['region_class'] = $form_state['values']['region_class'];
- // Reverse this as the checkbox is backward from how we actually store
- // it to make it simpler to default to scaling.
- $item['no_scale'] = !$form_state['values']['no_scale'];
- $item['fixed_width'] = $form_state['values']['fixed_width'];
- $item['column_separation'] = $form_state['values']['column_separation'];
- $item['region_separation'] = $form_state['values']['region_separation'];
- $item['row_separation'] = $form_state['values']['row_separation'];
- }
- else if ($item['type'] != 'row') {
- $item['width_type'] = $form_state['values']['width_type'];
- }
- else {
- $item['contains'] = $form_state['values']['contains'];
- }
-
-}
-
-/**
- * AJAX responder to add a new row, column or region to a flexible layout.
- */
-function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') {
- ctools_include('modal');
- ctools_include('ajax');
- $settings = &$handler->display->layout_settings;
- panels_flexible_convert_settings($settings, $handler->plugins['layout']);
-
- if (empty($settings['items'][$id])) {
- ctools_modal_render(t('Error'), t('Invalid item id.'));
- }
-
- $parent = &$settings['items'][$id];
-
- switch ($parent['type']) {
- case 'column':
- $title = t('Add row');
- // Create the new item with defaults.
- $item = array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array(),
- 'parent' => $id,
- );
- break;
- case 'row':
- switch ($parent['contains']) {
- case 'region':
- $title = $location == 'left' ? t('Add region to left') : t('Add region to right');
- $item = array(
- 'type' => 'region',
- 'title' => '',
- 'width' => 100,
- 'width_type' => '%',
- 'parent' => $id,
- );
- break;
- case 'column':
- $title = $location == 'left' ? t('Add column to left') : t('Add column to right');
- $item = array(
- 'type' => 'column',
- 'width' => 100,
- 'width_type' => '%',
- 'parent' => $id,
- 'children' => array(),
- );
- break;
- }
- // Create the new item with defaults.
- break;
- case 'region':
- // Cannot add items to regions.
- break;
- }
-
- $form_state = array(
- 'display' => &$handler->display,
- 'parent' => &$parent,
- 'item' => &$item,
- 'id' => $id,
- 'settings' => &$settings,
- 'ajax' => TRUE,
- 'title' => $title,
- 'location' => $location,
- );
-
- $output = ctools_modal_form_wrapper('panels_flexible_add_item_form', $form_state);
- if (!empty($form_state['executed'])) {
- // If the width type changed then other nearby items will have
- // to have their widths adjusted.
- panels_edit_cache_set($handler->cache);
- $output = array();
-
- $css_id = isset($handler->display->css_id) ? $handler->display->css_id : '';
- // Create a renderer object so we can render our new stuff.
- $renderer = panels_flexible_create_renderer(TRUE, $css_id, array(), $settings, $handler->display, $handler->plugins['layout'], $handler);
-
- $content = '';
- if ($item['type'] == 'region') {
- $handler->plugins['layout']['regions'][$form_state['key']] = $item['title'];
-
- $content = $handler->render_region($form_state['key'], array());
-
- // Manually add the hidden field that our region uses to store pane info.
- $content .= '<input type="hidden" name="panel[pane][' .
- $form_state['key'] . ']" value="" />';
-
- }
- else {
- // We need to make sure the left/middle/right divs exist inside this
- // so that more stuff can be added inside it as needed.
- foreach (array('left', 'middle', 'right') as $position) {
- if (!empty($content) || $renderer->admin) {
- $content .= '<div class="' . $renderer->base[$item['type']] . '-' . $form_state['key'] . '-' . $position . '"></div>';
- }
- }
-
- }
-
- // render the item
- $parent_class = $renderer->base[$parent['type']] . '-' . $id;
- $item_output = panels_flexible_render_item($renderer, $item, $content, $form_state['key'], 0, 0, $item['type'] == 'row');
-
- // Get all the CSS necessary for the entire row (as width adjustments may
- // have cascaded).
- $css = array();
- panels_flexible_get_css_group($css, $renderer, $parent['children'], '.' . $parent_class, $item['type'], $id);
-
- $position = isset($renderer->positions[$form_state['key']]) ? $renderer->positions[$form_state['key']] : 'middle';
- // If there's a nearby item, add the splitter and rewrite the width
- // of the nearby item as it probably got adjusted.
- // The blocks of code in this else look very similar but are not actually
- // duplicated because the order changes based on left or right.
- switch ($position) {
- case 'left':
- if ($location == 'left') {
- $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], $form_state['sibling']);
- $output[] = ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-left', $item_output);
- }
- else if ($location == 'right') {
- // If we are adding to the right side of the left box, there is
- // a splitter that we have to remove; then we add our box normally,
- // and then add a new splitter for just our guy.
- $output[] = ajax_command_remove('panels-flexible-splitter-for-' . $renderer->base[$item['type']] . '-' . $form_state['key']);
- $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output;
- $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], NULL);
- $output[] = ajax_command_append('#panels-dnd-main .' . $parent_class . '-left', $item_output);
- }
- break;
- case 'right':
- if (!empty($form_state['sibling'])) {
- $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output;
- }
- $output[] = ajax_command_append('#panels-dnd-main .' . $parent_class . '-right', $item_output);
- break;
- case 'middle':
- if ($location == 'left') {
- if (!empty($form_state['sibling'])) {
- $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], $form_state['sibling']);
- }
- $output[] = ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-middle', $item_output);
- }
- else {
- if (!empty($form_state['sibling'])) {
- $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output;
- }
- $output[] = ajax_command_append('#panels-dnd-main .' . $parent_class . '-middle', $item_output);
- }
- break;
-
- }
-
- // Send our fix height command.
- $output[] = array('command' => 'flexible_fix_height');
-
- if (!empty($form_state['sibling'])) {
- $sibling_width = '#panels-dnd-main .' . $renderer->base[$item['type']] . '-' . $form_state['sibling'] . '-width';
- $output[] = array(
- 'command' => 'flexible_set_width',
- 'selector' => $sibling_width,
- 'width' => $settings['items'][$form_state['sibling']]['width'],
- );
- }
- foreach ($css as $selector => $data) {
- $output[] = ajax_command_css($selector, $data);
- }
-
- // Rerender our parent item links:
- $output[] = ajax_command_replace('.flexible-links-' . $id,
- panels_flexible_render_item_links($renderer, $id, $parent));
-
- $output[] = array(
- 'command' => 'flexible_fix_firstlast',
- 'selector' => '.' . $parent_class . '-inside',
- 'base' => 'panels-flexible-' . $item['type'],
- );
-
- $output[] = ctools_modal_command_dismiss();
- }
-
- $handler->commands = $output;
-}
-/**
- * Form to add a row, column or region to a flexible layout.
- * @param <type> $form_state
- * @return <type>
- */
-function panels_flexible_add_item_form($form, &$form_state) {
- $display = &$form_state['display'];
- $item = &$form_state['item'];
- $parent = &$form_state['parent'];
- $settings = &$form_state['settings'];
- $location = &$form_state['location'];
- $id = &$form_state['id'];
-
- if ($item['type'] == 'region') {
- $form['title'] = array(
- '#title' => t('Region title'),
- '#type' => 'textfield',
- '#default_value' => $item['title'],
- '#required' => TRUE,
- );
- }
-
- $form['class'] = array(
- '#title' => t('CSS Class'),
- '#type' => 'textfield',
- '#default_value' => isset($item['class']) ? $item['class'] : '',
- '#description' => t('Enter a CSS class that will be used. This can be used to apply automatic styling from your theme, for example.'),
- );
-
- if ($item['type'] != 'row') {
- // If there is a 'fixed' type on the side we're adding to, then this
- // must also be fixed. Otherwise it can be either and should default to
- // fluid.
- $restrict = FALSE;
-
- if (!empty($parent['children'])) {
- if ($location == 'left') {
- $sibling = reset($parent['children']);
- }
- else {
- $sibling = end($parent['children']);
- }
- if ($settings['items'][$sibling]['width_type'] == 'px') {
- $restrict = TRUE;
- $item['width_type'] = 'px';
- }
- }
-
- $form['width_type'] = array(
- '#type' => 'select',
- '#title' => t('Width'),
- '#default_value' => $item['width_type'],
- '#options' => array(
- '%' => t('Fluid'),
- 'px' => t('Fixed'),
- ),
- '#disabled' => $restrict,
- );
- if ($restrict) {
- // This forces the value because disabled items don't always send
- // their data back.
- $form['width_type']['#value'] = $item['width_type'];
- $form['width_type']['#description'] = t('Items cannot be set to fluid if there are fixed items already on that side.');
- }
- }
- else {
- $form['contains'] = array(
- '#type' => 'select',
- '#title' => t('Contains'),
- '#default_value' => $item['contains'],
- '#options' => array(
- 'region' => t('Regions'),
- 'column' => t('Columns'),
- ),
- );
- }
-
- $form['save'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-/**
- * Submit handler for editing a flexible item.
- */
-function panels_flexible_add_item_form_submit(&$form, &$form_state) {
- $item = &$form_state['item'];
- $parent = &$form_state['parent'];
- $location = &$form_state['location'];
- $settings = &$form_state['settings'];
-
- $item['class'] = $form_state['values']['class'];
-
- if ($item['type'] == 'region') {
- $item['title'] = $form_state['values']['title'];
- }
-
- if ($item['type'] != 'row') {
- $item['width_type'] = $form_state['values']['width_type'];
- }
- else {
- $item['contains'] = $form_state['values']['contains'];
- }
-
- if ($item['type'] == 'region') {
- // derive the region key from the title
- $key = preg_replace("/[^a-z0-9]/", '_', drupal_strtolower($item['title']));
- while (isset($settings['items'][$key])) {
- $key .= '_';
- }
- $form_state['key'] = $key;
- }
- else {
- $form_state['key'] = $key = max(array_keys($settings['items'])) + 1;
- }
-
- $form_state['sibling'] = NULL;
- if ($item['type'] != 'row' && !empty($parent['children'])) {
- // Figure out what the width should be and adjust our sibling if
- // necessary.
- if ($location == 'left') {
- $form_state['sibling'] = reset($parent['children']);
- }
- else {
- $form_state['sibling'] = end($parent['children']);
-
- }
-
- // If there is no sibling, or the sibling is of a different type,
- // the default 100 will work for either fixed or fluid.
- if ($form_state['sibling'] && $settings['items'][$form_state['sibling']]['width_type'] == $item['width_type']) {
- // steal half of the sibling's space.
- $width = $settings['items'][$form_state['sibling']]['width'] / 2;
- $settings['items'][$form_state['sibling']]['width'] = $width;
- $item['width'] = $width;
- }
- }
-
- // Place the item.
- $settings['items'][$key] = $item;
- if ($location == 'left') {
- array_unshift($parent['children'], $key);
- }
- else {
- $parent['children'][] = $key;
- }
-}
-
-/**
- * AJAX responder to remove an existing row, column or region from a flexible
- * layout.
- */
-function panels_ajax_flexible_edit_remove($handler, $id) {
- $settings = &$handler->display->layout_settings;
- panels_flexible_convert_settings($settings, $handler->plugins['layout']);
-
- if (empty($settings['items'][$id])) {
- ajax_render_error(t('Invalid item id.'));
- }
-
- $item = &$settings['items'][$id];
- $css_id = isset($handler->display->css_id) ? $handler->display->css_id : '';
- // Create a renderer object so we can render our new stuff.
- $renderer = panels_flexible_create_renderer(TRUE, $css_id, array(), $settings, $handler->display, $handler->plugins['layout'], $handler);
-
-
- $siblings = &$settings['items'][$item['parent']]['children'];
- $parent_class = '.' . $renderer->base[$settings['items'][$item['parent']]['type']] . '-' . $item['parent'];
-
- // Find the offset of our array. This will also be the key because
- // this is a simple array.
- $offset = array_search($id, $siblings);
-
- // Only bother with this stuff if our item is fluid, since fixed is
- // as fixed does.
- if ($item['type'] != 'row') {
- if (isset($siblings[$offset + 1])) {
- $next = $siblings[$offset + 1];
- }
- if (isset($siblings[$offset - 1])) {
- $prev = $siblings[$offset - 1];
- }
-
- if ($item['width_type'] == '%') {
- // First, try next.
- if (isset($next) && $settings['items'][$next]['width_type'] == '%') {
- $settings['items'][$next]['width'] += $item['width'];
- }
- // If that failed, try the previous one.
- else if (isset($prev) && $settings['items'][$prev]['width_type'] == '%') {
- $settings['items'][$prev]['width'] += $item['width'];
- }
- }
- // Not sure what happens if they both failed. Maybe nothing.
- }
-
- // Remove the item.
- array_splice($siblings, $offset, 1);
-
- unset($settings['items'][$id]);
-
- // Save our new state.
- panels_edit_cache_set($handler->cache);
- $class = $renderer->base[$item['type']] . '-' . $id;
- $output = array();
-
- $output[] = ajax_command_remove('#panels-dnd-main .' . $class);
-
- // Regenerate the CSS for siblings.
- if (!empty($siblings)) {
- // Get all the CSS necessary for the entire row (as width adjustments may
- // have cascaded).
- $css = array();
- panels_flexible_get_css_group($css, $renderer, $siblings, $parent_class, $item['type'], $item['parent']);
- foreach ($css as $selector => $data) {
- $output[] = ajax_command_css($selector, $data);
- }
- }
-
- // There are potentially two splitters linked to this item to be removed.
- if (!empty($prev)) {
- $output[] = ajax_command_remove('.flexible-splitter-for-' . $renderer->base[$item['type']] . '-' . $prev);
- }
-
- // Try to remove the 'next' one even if there isn't a $next.
- $output[] = ajax_command_remove('.flexible-splitter-for-' . $renderer->base[$item['type']] . '-' . $id);
-
- if (!empty($prev) && !empty($next)) {
- // Add a new splitter that links $prev and $next:
- $splitter = panels_flexible_render_splitter($renderer, $prev, $next);
- $prev_class = '#panels-dnd-main .' . $renderer->base[$item['type']] . '-' . $prev;
- $output[] = ajax_command_after($prev_class, $splitter);
- // Send our fix height command.
- $output[] = array('command' => 'flexible_fix_height');
- }
- // Rerender our parent item links:
- $output[] = ajax_command_replace('.flexible-links-' . $item['parent'],
- panels_flexible_render_item_links($renderer, $item['parent'], $settings['items'][$item['parent']]));
-
- $output[] = array(
- 'command' => 'flexible_fix_firstlast',
- 'selector' => $parent_class . '-inside',
- 'base' => 'panels-flexible-' . $item['type'],
- );
-
- $handler->commands = $output;
-}
-
-/**
- * AJAX responder to store resize information when the user adjusts the
- * splitter.
- */
-function panels_ajax_flexible_edit_resize($handler) {
- ctools_include('ajax');
- $settings = &$handler->display->layout_settings;
- panels_flexible_convert_settings($settings, $handler->plugins['layout']);
-
- $settings['items'][$_POST['left']]['width'] = $_POST['left_width'];
- if (!empty($_POST['right']) && $_POST['right'] != $_POST['left']) {
- $settings['items'][$_POST['right']]['width'] = $_POST['right_width'];
- }
-
- // Save our new state.
- panels_edit_cache_set($handler->cache);
-
- $handler->commands = array('ok');
-}
-
-/**
- * AJAX form to bring up the "reuse" modal.
- */
-function panels_ajax_flexible_edit_reuse($handler) {
- $settings = &$handler->display->layout_settings;
- panels_flexible_convert_settings($settings, $handler->plugins['layout']);
-
- $form_state = array(
- 'display' => &$handler->display,
- 'settings' => &$settings,
- 'ajax' => TRUE,
- 'title' => t('Save this layout for reuse'),
- );
-
- $output = ctools_modal_form_wrapper('panels_flexible_reuse_form', $form_state);
- if (empty($output)) {
- // Create the new layout.
- ctools_include('export');
- $layout = ctools_export_crud_new('panels_layout');
- $layout->plugin = 'flexible';
- $layout->name = $form_state['values']['name'];
- $layout->admin_title = $form_state['values']['admin_title'];
- $layout->admin_description = $form_state['values']['admin_description'];
- $layout->category = $form_state['values']['category'];
- $layout->settings = $handler->display->layout_settings;
-
- // Save it.
- ctools_export_crud_save('panels_layout', $layout);
-
- if (empty($form_state['values']['keep'])) {
- // Set the actual layout_settings to now use the newly minted layout:
- $handler->display->layout = 'flexible:' . $layout->name;
- $handler->display->layout_settings = array();
-
- // Save our new state.
- panels_edit_cache_set($handler->cache);
- }
-
- // Dismiss the modal.
- $output[] = ctools_modal_command_dismiss();
- }
-
- $handler->commands = $output;
-}
-
-function panels_flexible_reuse_form($form, &$form_state) {
- $form['markup'] = array(
- '#prefix' => '<div class="description">',
- '#suffix' => '</div>',
- '#value' => t('If you save this layout for reuse it will appear in the list of reusable layouts at admin/structure/panels/layouts, and you will need to go there to edit it. This layout will then become an option for all future panels you make.'),
- );
-
- $form['admin_title'] = array(
- '#type' => 'textfield',
- '#title' => t('Administrative title'),
- '#description' => t('This will appear in the administrative interface to easily identify it.'),
- );
-
- $form['name'] = array(
- '#type' => 'textfield',
- '#title' => t('Machine name'),
- '#description' => t('The machine readable name of this layout. It must be unique, and it must contain only alphanumeric characters and underscores. Once created, you will not be able to change this value!'),
- );
-
- $form['category'] = array(
- '#type' => 'textfield',
- '#title' => t('Category'),
- '#description' => t('What category this layout should appear in. If left blank the category will be "Miscellaneous".'),
- );
-
- $form['admin_description'] = array(
- '#type' => 'textarea',
- '#title' => t('Administrative description'),
- '#description' => t('A description of what this layout is, does or is for, for administrative use.'),
- );
-
- $form['keep'] = array(
- '#type' => 'checkbox',
- '#title' => t('Keep current panel layout flexible'),
- '#description' => t('If checked, this panel will continue to use a generic flexible layout and will not use the saved layout. Use this option if you wish to clone this layout.'),
- );
-
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Save'),
- );
-
- return $form;
-}
-
-function panels_flexible_reuse_form_validate(&$form, &$form_state) {
- if (empty($form_state['values']['name'])) {
- form_error($form['name'], t('You must choose a machine name.'));
- }
-
- ctools_include('export');
- $test = ctools_export_crud_load('panels_layout', $form_state['values']['name']);
- if ($test) {
- form_error($form['name'], t('That name is used by another layout: @layout', array('@layout' => $test->admin_title)));
- }
-
- // Ensure name fits the rules:
- if (preg_match('/[^a-zA-Z0-9_]/', $form_state['values']['name'])) {
- form_error($form['name'], t('Name must be alphanumeric or underscores only.'));
- }
-}
diff --git a/plugins/layouts/flexible/flexible.png b/plugins/layouts/flexible/flexible.png
deleted file mode 100644
index 14b4779..0000000
--- a/plugins/layouts/flexible/flexible.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/flexible/grippie-vertical.png b/plugins/layouts/flexible/grippie-vertical.png
deleted file mode 100644
index 7d5b7ea..0000000
--- a/plugins/layouts/flexible/grippie-vertical.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/onecol/onecol.css b/plugins/layouts/onecol/onecol.css
deleted file mode 100644
index fe5edfb..0000000
--- a/plugins/layouts/onecol/onecol.css
+++ /dev/null
@@ -1,21 +0,0 @@
-
-.panel-1col {
-/* overflow: hidden; */
-}
-
-.panel-2col .panel-col-first .inside {
- margin: 0;
-}
-
-
-.panel-1col .panel-col {
-}
-
-#panels-edit-display .panel-pane,
-#panels-edit-display .helperclass {
- margin: .5em;
-}
-
-.panel-2col .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/onecol/onecol.inc b/plugins/layouts/onecol/onecol.inc
deleted file mode 100644
index 4043566..0000000
--- a/plugins/layouts/onecol/onecol.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-/**
- * implementation of hook_panels_layouts()
- */
-// Plugin definition
-$plugin = array(
- 'title' => t('Single column'),
- 'category' => t('Columns: 1'),
- 'icon' => 'onecol.png',
- 'theme' => 'panels_onecol',
- 'css' => 'onecol.css',
- 'regions' => array('middle' => t('Middle column')),
-);
diff --git a/plugins/layouts/onecol/onecol.png b/plugins/layouts/onecol/onecol.png
deleted file mode 100644
index 176ed69..0000000
--- a/plugins/layouts/onecol/onecol.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/onecol/panels-onecol.tpl.php b/plugins/layouts/onecol/panels-onecol.tpl.php
deleted file mode 100644
index 73ad5b8..0000000
--- a/plugins/layouts/onecol/panels-onecol.tpl.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 3 column panel layout.
- *
- * This template provides a very simple "one column" panel display layout.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * $content['middle']: The only panel in the layout.
- */
-?>
-<div class="panel-display panel-1col clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <div class="panel-panel panel-col">
- <div><?php print $content['middle']; ?></div>
- </div>
-</div>
diff --git a/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php b/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php
deleted file mode 100644
index 588e593..0000000
--- a/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-/**
- * @file
- * Template for the 1 column panel layout.
- *
- * This template provides a three column 25%-50%-25% panel display layout.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['left']: Content in the left column.
- * - $content['middle']: Content in the middle column.
- * - $content['right']: Content in the right column.
- */
-?>
-<div class="panel-display panel-3col clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left']; ?></div>
- </div>
-
- <div class="panel-panel panel-col">
- <div class="inside"><?php print $content['middle']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right']; ?></div>
- </div>
-</div>
diff --git a/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css b/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css
deleted file mode 100644
index 2bffe57..0000000
--- a/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css
+++ /dev/null
@@ -1,35 +0,0 @@
-
-.panel-3col {
-/* overflow: hidden; */
-}
-
-.panel-3col .panel-col-first {
- float: left;
- width: 25%;
-}
-
-.panel-3col .panel-col-first .inside {
- margin: 0 .5em 1em 0;
-}
-
-.panel-3col .panel-col {
- float: left;
- width: 50%;
-}
-
-.panel-3col .panel-col .inside {
- margin: 0 .5em 1em .5em;
-}
-
-.panel-3col .panel-col-last {
- float: left;
- width: 25%;
-}
-
-.panel-3col .panel-col-last .inside {
- margin: 0 0 1em .5em;
-}
-
-.panel-3col .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc b/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc
deleted file mode 100644
index 78ab682..0000000
--- a/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-/**
- * implementation of hook_panels_layouts
- */
-// Plugin definition
-$plugin = array(
- 'title' => t('Three column 25/50/25'),
- 'category' => t('Columns: 3'),
- 'icon' => 'threecol_25_50_25.png',
- 'theme' => 'panels_threecol_25_50_25',
- 'theme arguments' => array('id', 'content'),
- 'css' => 'threecol_25_50_25.css',
- 'regions' => array(
- 'left' => t('Left side'),
- 'middle' => t('Middle column'),
- 'right' => t('Right side')
- ),
-);
-
diff --git a/plugins/layouts/threecol_25_50_25/threecol_25_50_25.png b/plugins/layouts/threecol_25_50_25/threecol_25_50_25.png
deleted file mode 100644
index ad6832a..0000000
--- a/plugins/layouts/threecol_25_50_25/threecol_25_50_25.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php b/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php
deleted file mode 100644
index 48aa523..0000000
--- a/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 3 column panel layout.
- *
- * This template provides a three column 25%-50%-25% panel display layout, with
- * additional areas for the top and the bottom.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['top']: Content in the top row.
- * - $content['left']: Content in the left column.
- * - $content['middle']: Content in the middle column.
- * - $content['right']: Content in the right column.
- * - $content['bottom']: Content in the bottom row.
- */
-?>
-<div class="panel-display panel-3col-stacked clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <?php if ($content['top']): ?>
- <div class="panel-panel panel-col-top">
- <div class="inside"><?php print $content['top']; ?></div>
- </div>
- <?php endif ?>
-
- <div class="center-wrapper">
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left']; ?></div>
- </div>
-
- <div class="panel-panel panel-col">
- <div class="inside"><?php print $content['middle']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right']; ?></div>
- </div>
- </div>
-
- <?php if ($content['bottom']): ?>
- <div class="panel-panel panel-col-bottom">
- <div class="inside"><?php print $content['bottom']; ?></div>
- </div>
- <?php endif ?>
-</div>
diff --git a/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css b/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css
deleted file mode 100644
index 1aa00da..0000000
--- a/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css
+++ /dev/null
@@ -1,45 +0,0 @@
-
-.panel-3col-stacked {
-/* overflow: hidden; */
-}
-
-.panel-3col-stacked .panel-col-top,
-.panel-3col-stacked .panel-col-bottom {
- width: 100%;
- clear: both;
-}
-
-.panel-3col-stacked .panel-col-top .inside {
- margin-bottom: .5em;
-}
-
-.panel-3col-stacked .panel-col-first {
- float: left;
- width: 25%;
-}
-
-.panel-3col-stacked .panel-col .inside {
- margin: 0 .5em 1em .5em;
-}
-
-.panel-3col-stacked .panel-col {
- float: left;
- width: 50%;
-}
-
-.panel-3col-stacked .panel-col .inside {
- margin: 0 .5em 1em .5em;
-}
-
-.panel-3col-stacked .panel-col-last {
- float: left;
- width: 25%;
-}
-
-.panel-3col-stacked .panel-col-last .inside {
- margin: 0 0 1em .5em;
-}
-
-.panel-3col-stacked .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc b/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc
deleted file mode 100644
index a5a450d..0000000
--- a/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-// Plugin definition
-$plugin = array(
- 'title' => t('Three column 25/50/25 stacked'),
- 'category' => t('Columns: 3'),
- 'icon' => 'threecol_25_50_25_stacked.png',
- 'theme' => 'panels_threecol_25_50_25_stacked',
- 'css' => 'threecol_25_50_25_stacked.css',
- 'regions' => array(
- 'top' => t('Top'),
- 'left' => t('Left side'),
- 'middle' => t('Middle column'),
- 'right' => t('Right side'),
- 'bottom' => t('Bottom'),
- ),
-);
diff --git a/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.png b/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.png
deleted file mode 100644
index 14b4779..0000000
--- a/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php b/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php
deleted file mode 100644
index 73a7437..0000000
--- a/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 3 column panel layout.
- *
- * This template provides a three column panel display layout, with
- * each column roughly equal in width.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['left']: Content in the left column.
- * - $content['middle']: Content in the middle column.
- * - $content['right']: Content in the right column.
- */
-?>
-
-<div class="panel-display panel-3col-33 clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left']; ?></div>
- </div>
-
- <div class="panel-panel panel-col">
- <div class="inside"><?php print $content['middle']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right']; ?></div>
- </div>
-</div>
diff --git a/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css b/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css
deleted file mode 100644
index da2d931..0000000
--- a/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css
+++ /dev/null
@@ -1,35 +0,0 @@
-
-.panel-3col-33 {
-/* overflow: hidden; */
-}
-
-.panel-3col-33 .panel-col-first {
- float: left;
- width: 33%;
-}
-
-.panel-3col-33 .panel-col-first .inside {
- margin: 0 .5em 1em 0;
-}
-
-.panel-3col-33 .panel-col {
- float: left;
- width: 33%;
-}
-
-.panel-3col-33 .panel-col .inside {
- margin: 0 .5em 1em .5em;
-}
-
-.panel-3col-33 .panel-col-last {
- float: left;
- width: 33%;
-}
-
-.panel-3col-33 .panel-col-last .inside {
- margin: 0 0 1em .5em;
-}
-
-.panel-3col-33 .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc b/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc
deleted file mode 100644
index ea4809a..0000000
--- a/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-// Plugin definition
-$plugin = array(
- 'title' => t('Three column 33/34/33'),
- 'category' => t('Columns: 3'),
- 'icon' => 'threecol_33_34_33.png',
- 'theme' => 'panels_threecol_33_34_33',
- 'css' => 'threecol_33_34_33.css',
- 'regions' => array(
- 'left' => t('Left side'),
- 'middle' => t('Middle column'),
- 'right' => t('Right side')
- ),
-);
diff --git a/plugins/layouts/threecol_33_34_33/threecol_33_34_33.png b/plugins/layouts/threecol_33_34_33/threecol_33_34_33.png
deleted file mode 100644
index 468f8bb..0000000
--- a/plugins/layouts/threecol_33_34_33/threecol_33_34_33.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php b/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php
deleted file mode 100644
index 276e2bf..0000000
--- a/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 3 column panel layout.
- *
- * This template provides a three column 25%-50%-25% panel display layout, with
- * additional areas for the top and the bottom.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['top']: Content in the top row.
- * - $content['left']: Content in the left column.
- * - $content['middle']: Content in the middle column.
- * - $content['right']: Content in the right column.
- * - $content['bottom']: Content in the bottom row.
- */
-?>
-<div class="panel-display panel-3col-33-stacked clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <?php if ($content['top']): ?>
- <div class="panel-panel panel-col-top">
- <div class="inside"><?php print $content['top']; ?></div>
- </div>
- <?php endif ?>
-
- <div class="center-wrapper">
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left']; ?></div>
- </div>
-
- <div class="panel-panel panel-col">
- <div class="inside"><?php print $content['middle']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right']; ?></div>
- </div>
- </div>
-
- <?php if ($content['bottom']): ?>
- <div class="panel-panel panel-col-bottom">
- <div class="inside"><?php print $content['bottom']; ?></div>
- </div>
- <?php endif ?>
-</div>
diff --git a/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css b/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css
deleted file mode 100644
index 57b87ee..0000000
--- a/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css
+++ /dev/null
@@ -1,45 +0,0 @@
-
-.panel-3col-33-stacked {
-/* overflow: hidden; */
-}
-
-.panel-3col-33-stacked .panel-col-top,
-.panel-3col-33-stacked .panel-col-bottom {
- width: 100%;
- clear: both;
-}
-
-.panel-3col-33-stacked .panel-col-top .inside {
- margin-bottom: 1em;
-}
-
-.panel-3col-33-stacked .panel-col-first {
- float: left;
- width: 33%;
-}
-
-.panel-3col-33-stacked .panel-col-first .inside {
- margin: 0 .5em 1em 0;
-}
-
-.panel-3col-33-stacked .panel-col {
- float: left;
- width: 33%;
-}
-
-.panel-3col-33-stacked .panel-col .inside {
- margin: 0 .5em 1em .5em;
-}
-
-.panel-3col-33-stacked .panel-col-last {
- float: left;
- width: 33%;
-}
-
-.panel-3col-33-stacked .panel-col-last .inside {
- margin: 0 0 1em .5em;
-}
-
-.panel-3col-33-stacked .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc b/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc
deleted file mode 100644
index 087ac3f..0000000
--- a/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-
-/**
- * Implementation of hook_panels_layouts().
- */
-function panels_threecol_33_34_33_stacked_panels_layouts() {
- $items['threecol_33_34_33_stacked'] = array(
- 'title' => t('Three column 33/34/33 stacked'),
- 'icon' => 'threecol_33_34_33_stacked.png',
- 'theme' => 'panels_threecol_33_34_33_stacked',
- 'css' => 'threecol_33_34_33_stacked.css',
- 'regions' => array(
- 'top' => t('Top'),
- 'left' => t('Left side'),
- 'middle' => t('Middle column'),
- 'right' => t('Right side'),
- 'bottom' => t('Bottom')
- ),
- );
-
- return $items;
-}
diff --git a/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.png b/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.png
deleted file mode 100644
index ffd1351..0000000
--- a/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/twocol/panels-twocol.tpl.php b/plugins/layouts/twocol/panels-twocol.tpl.php
deleted file mode 100644
index 2cda08e..0000000
--- a/plugins/layouts/twocol/panels-twocol.tpl.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 2 column panel layout.
- *
- * This template provides a two column panel display layout, with
- * each column roughly equal in width.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['left']: Content in the left column.
- * - $content['right']: Content in the right column.
- */
-?>
-<div class="panel-display panel-2col clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right']; ?></div>
- </div>
-</div>
diff --git a/plugins/layouts/twocol/twocol.css b/plugins/layouts/twocol/twocol.css
deleted file mode 100644
index 6e53eca..0000000
--- a/plugins/layouts/twocol/twocol.css
+++ /dev/null
@@ -1,37 +0,0 @@
-
-.panel-2col {
-/* overflow: hidden; */
-}
-
-.panel-2col .panel-col-first {
- float: left;
- width: 50%;
-}
-* html .panel-2col .panel-col-first {
- width: 49.9%;
-}
-
-.panel-2col .panel-col-first .inside {
- margin: 0 .5em 1em 0;
-}
-
-.panel-2col .panel-col-last {
- float: left;
- width: 50%;
-}
-* html .panel-2col .panel-col-last {
- width: 49.9%;
-}
-
-.panel-2col .panel-col-last .inside {
- margin: 0 0 1em .5em;
-}
-
-#panels-edit-display .panel-pane,
-#panels-edit-display .helperclass {
- margin: .5em;
-}
-
-.panel-2col .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/twocol/twocol.inc b/plugins/layouts/twocol/twocol.inc
deleted file mode 100644
index 1faedca..0000000
--- a/plugins/layouts/twocol/twocol.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-// Plugin definition
-$plugin = array(
- 'title' => t('Two column'),
- 'category' => t('Columns: 2'),
- 'icon' => 'twocol.png',
- 'theme' => 'panels_twocol',
- 'css' => 'twocol.css',
- 'regions' => array(
- 'left' => t('Left side'),
- 'right' => t('Right side')
- ),
-);
diff --git a/plugins/layouts/twocol/twocol.png b/plugins/layouts/twocol/twocol.png
deleted file mode 100644
index 9d2965e..0000000
--- a/plugins/layouts/twocol/twocol.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php b/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php
deleted file mode 100644
index e626844..0000000
--- a/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 2 column panel layout.
- *
- * This template provides a two column panel display layout, with
- * each column roughly equal in width. It is 5 rows high; the top
- * middle and bottom rows contain 1 column, while the second
- * and fourth rows contain 2 columns.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['top']: Content in the top row.
- * - $content['left_above']: Content in the left column in row 2.
- * - $content['right_above']: Content in the right column in row 2.
- * - $content['middle']: Content in the middle row.
- * - $content['left_below']: Content in the left column in row 4.
- * - $content['right_below']: Content in the right column in row 4.
- * - $content['right']: Content in the right column.
- * - $content['bottom']: Content in the bottom row.
- */
-?>
-<div class="panel-display panel-2col-bricks clearfix" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <div class="panel-panel panel-col-top">
- <div class="inside"><?php print $content['top']; ?></div>
- </div>
- <div class="center-wrapper">
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left_above']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right_above']; ?></div>
- </div>
- </div>
- <div class="panel-panel panel-col-middle">
- <div class="inside"><?php print $content['middle']; ?></div>
- </div>
- <div class="center-wrapper">
- <div class="panel-panel panel-col-first">
- <div class="inside"><?php print $content['left_below']; ?></div>
- </div>
-
- <div class="panel-panel panel-col-last">
- <div class="inside"><?php print $content['right_below']; ?></div>
- </div>
- </div>
- <div class="panel-panel panel-col-bottom">
- <div class="inside"><?php print $content['bottom']; ?></div>
- </div>
-</div>
diff --git a/plugins/layouts/twocol_bricks/twocol_bricks.css b/plugins/layouts/twocol_bricks/twocol_bricks.css
deleted file mode 100644
index 4997ce6..0000000
--- a/plugins/layouts/twocol_bricks/twocol_bricks.css
+++ /dev/null
@@ -1,46 +0,0 @@
-
-.panel-2col-bricks {
-/* overflow: hidden; */
- margin-top: 0;
- padding-top: 0;
-}
-
-.panel-2col-bricks .panel-col-top,
-.panel-2col-bricks .panel-col-middle,
-.panel-2col-bricks .panel-col-bottom {
- width: 99.9%;
- clear: both;
-}
-
-.panel-2col-bricks .panel-col-top .inside,
-.panel-2col-bricks .panel-col-middle .inside {
- margin-bottom: .5em;
-}
-
-.panel-2col-bricks .panel-col-first {
- float: left;
- width: 50%;
-}
-* html .panel-2col-bricks .panel-col-first {
- width: 49.9%;
-}
-
-.panel-2col-bricks .panel-col-first .inside {
- margin: 0 .5em .5em 0;
-}
-
-.panel-2col-bricks .panel-col-last {
- float: left;
- width: 50%;
-}
-* html .panel-2col-bricks .panel-col-last {
- width: 49.9%;
-}
-
-.panel-2col-bricks .panel-col-last .inside {
- margin: 0 0 .5em .5em;
-}
-
-.panel-2col-bricks .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/twocol_bricks/twocol_bricks.inc b/plugins/layouts/twocol_bricks/twocol_bricks.inc
deleted file mode 100644
index 0cb6f1a..0000000
--- a/plugins/layouts/twocol_bricks/twocol_bricks.inc
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-/**
- * @file
- * Implementation for the two column bricked layout
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t('Two column bricks'),
- 'category' => t('Columns: 2'),
- 'icon' => 'twocol_bricks.png',
- 'theme' => 'panels_twocol_bricks',
- 'css' => 'twocol_bricks.css',
- 'regions' => array(
- 'top' => t('Top'),
- 'left_above' => t('Left above'),
- 'right_above' => t('Right above'),
- 'middle' => t('Middle'),
- 'left_below' => t('Left below'),
- 'right_below' => t('Right below'),
- 'bottom' => t('Bottom'),
- ),
-);
-
diff --git a/plugins/layouts/twocol_bricks/twocol_bricks.png b/plugins/layouts/twocol_bricks/twocol_bricks.png
deleted file mode 100644
index 450395c..0000000
--- a/plugins/layouts/twocol_bricks/twocol_bricks.png
+++ /dev/null
Binary files differ
diff --git a/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php b/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php
deleted file mode 100644
index 901d27c..0000000
--- a/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * @file
- * Template for a 2 column panel layout.
- *
- * This template provides a two column panel display layout, with
- * additional areas for the top and the bottom.
- *
- * Variables:
- * - $id: An optional CSS id to use for the layout.
- * - $content: An array of content, each item in the array is keyed to one
- * panel of the layout. This layout supports the following sections:
- * - $content['top']: Content in the top row.
- * - $content['left']: Content in the left column.
- * - $content['right']: Content in the right column.
- * - $content['bottom']: Content in the bottom row.
- */
-?>
-<div class="panel-2col-stacked clearfix panel-display" <?php if (!empty($css_id)) { print "id=\"$css_id\""; } ?>>
- <?php if ($content['top']): ?>
- <div class="panel-col-top panel-panel">
- <div class="inside"><?php print $content['top']; ?></div>
- </div>
- <?php endif; ?>
-
- <div class="center-wrapper">
- <div class="panel-col-first panel-panel">
- <div class="inside"><?php print $content['left']; ?></div>
- </div>
- <div class="panel-col-last panel-panel">
- <div class="inside"><?php print $content['right']; ?></div>
- </div>
- </div>
-
- <?php if ($content['bottom']): ?>
- <div class="panel-col-bottom panel-panel">
- <div class="inside"><?php print $content['bottom']; ?></div>
- </div>
- <?php endif; ?>
-</div>
diff --git a/plugins/layouts/twocol_stacked/twocol_stacked.css b/plugins/layouts/twocol_stacked/twocol_stacked.css
deleted file mode 100644
index 56eb3e3..0000000
--- a/plugins/layouts/twocol_stacked/twocol_stacked.css
+++ /dev/null
@@ -1,41 +0,0 @@
-
-.panel-2col-stacked {
-/* overflow: hidden; */
- margin-top: 0;
- padding-top: 0;
-}
-
-.panel-2col-stacked .panel-col-top,
-.panel-2col-stacked .panel-col-bottom {
- width: 99.9%;
- clear: both;
-}
-
-.panel-2col-stacked .panel-col-top .inside {
- margin-bottom: .5em;
-}
-
-.panel-2col-stacked .panel-col-first {
- float: left;
- width: 50%;
-}
-* html .panel-2col-stacked .panel-col-first {
- width: 49.9%;
-}
-
-.panel-2col-stacked .panel-col-first .inside {
- margin: 0 .5em 1em 0;
-}
-
-.panel-2col-stacked .panel-col-last {
- float: left;
- width: 49.9%;
-}
-
-.panel-2col-stacked .panel-col-last .inside {
- margin: 0 0 1em .5em;
-}
-
-.panel-2col-stacked .panel-separator {
- margin: 0 0 1em 0;
-}
diff --git a/plugins/layouts/twocol_stacked/twocol_stacked.inc b/plugins/layouts/twocol_stacked/twocol_stacked.inc
deleted file mode 100644
index 5916a15..0000000
--- a/plugins/layouts/twocol_stacked/twocol_stacked.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-// Plugin definition
-$plugin = array(
- 'title' => t('Two column stacked'),
- 'category' => t('Columns: 2'),
- 'icon' => 'twocol_stacked.png',
- 'theme' => 'panels_twocol_stacked',
- 'css' => 'twocol_stacked.css',
- 'regions' => array(
- 'top' => t('Top'),
- 'left' => t('Left side'),
- 'right' => t('Right side'),
- 'bottom' => t('Bottom')
- ),
-);
diff --git a/plugins/layouts/twocol_stacked/twocol_stacked.png b/plugins/layouts/twocol_stacked/twocol_stacked.png
deleted file mode 100644
index 30ab8b6..0000000
--- a/plugins/layouts/twocol_stacked/twocol_stacked.png
+++ /dev/null
Binary files differ
diff --git a/plugins/page_wizards/landing_page.inc b/plugins/page_wizards/landing_page.inc
deleted file mode 100644
index d9428da..0000000
--- a/plugins/page_wizards/landing_page.inc
+++ /dev/null
@@ -1,277 +0,0 @@
-<?php
-/**
- * @file
- * A page creation wizard to quickly create simple landing pages.
- *
- * This wizard strips out a lot of features that are not normally needed for
- * simple landing pages, such as access control, tabs, contexts, and the
- * selection of a variant. It will just assume you want a panel and let you
- * select the layout right away. This is 2 fewer forms than the standard
- * add page process and it will point you at the finished page rather than
- * sending you directly to the edit UI when finished.
- *
- * It also will auto-enable IPE if it can.
- */
-$plugin = array(
- 'title' => t('Landing page'),
- 'page title' => t('Landing page wizard'),
- 'description' => t('Landing pages are simple pages that have a path, possibly a visible menu entry, and a panel layout with simple content.'),
-
- 'type' => 'panels',
-
- 'form info' => array(
- 'order' => array(
- 'basic' => t('Basic settings'),
- 'content' => t('Content'),
- ),
-
- 'forms' => array(
- 'basic' => array(
- 'form id' => 'panels_landing_page_basic',
- ),
- 'content' => array(
- 'form id' => 'panels_landing_page_content',
- ),
- ),
- ),
-
- 'default cache' => 'panels_landing_page_new_page',
-
- 'finish' => 'panels_landing_page_finish',
-);
-
-/**
- * Provide defaults for a new cache.
- *
- * The cache will store all our temporary data; it isn't really a page
- * in itself, but it does contain everything we need to make one at the end.
- */
-function panels_landing_page_new_page(&$cache) {
- $cache->name = '';
- $cache->admin_title = '';
- $cache->admin_description = '';
- $cache->path = '';
- $cache->menu_entry = FALSE;
- $cache->menu = array(
- 'type' => 'none',
- 'title' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- 'parent' => array(
- 'type' => 'none',
- 'title' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ),
- );
- $cache->display = panels_new_display();
- $cache->display->layout = 'flexible';
-}
-
-/**
- * First page of our page creator wizard.
- */
-function panels_landing_page_basic($form, &$form_state) {
- $cache = &$form_state['wizard cache'];
- ctools_include('dependent');
-
- $form['admin_title'] = array(
- '#type' => 'textfield',
- '#title' => t('Administrative title'),
- '#description' => t('The name of this page. This will appear in the administrative interface to easily identify it.'),
- '#default_value' => $cache->admin_title,
- '#required' => TRUE,
- );
-
- $form['name'] = array(
- '#type' => 'machine_name',
- '#title' => t('Machine name'),
- '#machine_name' => array(
- 'exists' => 'page_manager_page_load',
- 'source' => array('admin_title'),
- ),
- '#description' => t('The machine readable name of this page. It must be unique, and it must contain only alphanumeric characters and underscores. Once created, you will not be able to change this value!'),
- '#default_value' => $cache->name,
- );
-
- $form['admin_description'] = array(
- '#type' => 'textarea',
- '#title' => t('Administrative description'),
- '#description' => t('A description of what this page is, does or is for, for administrative use.'),
- '#default_value' => $cache->admin_description,
- );
-
- // path
- $form['path'] = array(
- '#type' => 'textfield',
- '#title' => t('Path'),
- '#default_value' => $cache->path,
- '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='),
- '#required' => TRUE,
- );
-
- $form['menu_entry'] = array(
- '#type' => 'checkbox',
- '#default_value' => $cache->menu_entry,
- '#title' => t('Add a visible menu entry for this page'),
- );
-
- $form['menu']['#tree'] = TRUE;
-
- $form['menu']['title'] = array(
- '#title' => t('Menu title'),
- '#type' => 'textfield',
- '#default_value' => $cache->menu['title'],
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-menu-entry' => array(1)),
- );
-
- // Only display the menu selector if menu module is enabled.
- if (module_exists('menu')) {
- $form['menu']['name'] = array(
- '#title' => t('Menu'),
- '#type' => 'select',
- '#options' => menu_get_menus(),
- '#default_value' => $cache->menu['name'],
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-menu-entry' => array(1)),
- );
- }
- else {
- $form['menu']['name'] = array(
- '#type' => 'value',
- '#value' => $cache->menu['name'],
- );
- $form['menu']['markup'] = array(
- '#value' => t('Menu selection requires the activation of menu module.'),
- );
- }
- $form['menu']['weight'] = array(
- '#title' => t('Weight'),
- '#type' => 'textfield',
- '#default_value' => isset($cache->menu['weight']) ? $cache->menu['weight'] : 0,
- '#description' => t('The lower the weight the higher/further left it will appear.'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-menu-entry' => array(1)),
- );
-
- ctools_include('page-wizard', 'panels');
- panels_page_wizard_add_layout($form, $form_state);
-
- // Ensure all 'page' features are loaded.
- $page_task = page_manager_get_task('page');
- return $form;
-}
-
-/**
- * Submit function to store the form data in our cache.
- */
-function panels_landing_page_basic_validate(&$form, &$form_state) {
- // Validate that the name is ok.
- $test = page_manager_page_load($form_state['values']['name']);
- if ($test) {
- form_error($form['name'], t('That name is used by another page: @page', array('@page' => $test->admin_title)));
- }
-
- // Ensure name fits the rules:
- if (preg_match('/[^a-zA-Z0-9_]/', $form_state['values']['name'])) {
- form_error($form['name'], t('Page name must be alphanumeric or underscores only.'));
- }
-
- // Validate that the path is ok.
- if (preg_match('/[%!\?#&]/', $form_state['values']['path'])) {
- form_error($form['path'], t('%, !, ?, #, or & cannot appear in the path.'));
- }
-
- // Check to see if something is already using the path
- $result = db_query("SELECT * FROM {menu_router} WHERE path = :path", array(':path' => $form_state['values']['path']))->fetch();
- if ($result) {
- form_error($form['path'], t('That path is already in use. This system cannot override existing paths.'));
- return;
- }
-
- // Ensure the path is not already an alias to something else.
- $alias = db_query('SELECT alias, source FROM {url_alias} WHERE alias = :path', array(':path' => $form_state['values']['path']))->fetchObject();
- if ($alias) {
- form_error($form['path'], t('That path is currently assigned to be an alias for @alias. This system cannot override existing aliases.', array('@alias' => $alias->src)));
- }
-}
-
-/**
- * Submit function to store the form data in our cache.
- */
-function panels_landing_page_basic_submit(&$form, &$form_state) {
- $cache = &$form_state['wizard cache'];
- $cache->name = $form_state['values']['name'];
- $cache->admin_title = $form_state['values']['admin_title'];
- $cache->admin_description = $form_state['values']['admin_description'];
- $cache->path = $form_state['values']['path'];
- $cache->menu_entry = $form_state['values']['menu_entry'];
- $cache->menu['title'] = $form_state['values']['menu']['title'];
- $cache->menu['weight'] = $form_state['values']['menu']['weight'];
- $cache->menu['name'] = $form_state['values']['menu']['name'];
- $cache->menu['type'] = $cache->menu_entry ? 'normal' : 'none';
- $cache->display->layout = $form_state['values']['layout'];
- $cache->display->title = $form_state['values']['admin_title'];
-}
-
-/**
- * Second page of our wizard. This one provides a layout and lets the
- * user add content.
- */
-function panels_landing_page_content($form, &$form_state) {
- ctools_include('page-wizard', 'panels');
- panels_page_wizard_add_content($form, $form_state);
-
- return $form;
-}
-
-/**
- * Submit function to store the form data in our cache.
- */
-function panels_landing_page_submit(&$form, &$form_state) {
- panels_page_wizard_add_content_submit($form, $form_state);
-}
-
-/**
- * Finish callback for the wizard.
- *
- * When the wizard is finished, this callback will create the actual
- * page, save it, and redirect the user to view the new work.
- */
-function panels_landing_page_finish(&$form_state) {
- $cache = &$form_state['wizard cache'];
-
- // Ensure all 'page' features are loaded.
- $page_task = page_manager_get_task('page');
-
- // Assemble a new page subtask.
- $subtask = page_manager_page_new();
- $subtask->name = $cache->name;
- $subtask->path = $cache->path;
- $subtask->admin_title = $cache->admin_title;
- $subtask->admin_description = $cache->admin_description;
- $subtask->path = $cache->path;
- $subtask->menu = $cache->menu;
-
- // Create the the panel context variant configured with our display
- $plugin = page_manager_get_task_handler('panel_context');
-
- // Create a new handler.
- $handler = page_manager_new_task_handler($plugin);
- $handler->conf['title'] = t('Landing page');
- $handler->conf['display'] = $cache->display;
- $handler->conf['pipeline'] = 'ipe';
-
- // Assemble a new $page cache and assign it our page subtask and task
- // handler.
- $page = new stdClass();
- page_manager_page_new_page_cache($subtask, $page);
- page_manager_handler_add_to_page($page, $handler);
-
- // Save it
- page_manager_save_page_cache($page);
-
- // Send us to the new page immediately.
- $form_state['redirect'] = url($cache->path);
-}
diff --git a/plugins/page_wizards/node_override.inc b/plugins/page_wizards/node_override.inc
deleted file mode 100644
index 594b4b9..0000000
--- a/plugins/page_wizards/node_override.inc
+++ /dev/null
@@ -1,295 +0,0 @@
-<?php
-
-/**
- * @file
- * Page wizard that can create a variant on the node_view to take over a node
- * for a particular type.
- *
- * This wizard does a lot that's cut and pasted from exports. We can get away
- * with this because we know exports tend to remain relatively backward
- * compatible, and because we know that our context IDs are locked in the
- * node_view page.
- */
-$plugin = array(
- 'title' => t('Node template'),
- 'page title' => t('Node template wizard'),
- 'description' => t('The node page wizard can help you override the node page for a type of node.'),
-
- 'type' => 'panels',
-
- 'form info' => array(
- 'order' => array(
- 'type' => t('Select node type'),
- 'content' => t('Content'),
- ),
-
- 'forms' => array(
- 'type' => array(
- 'form id' => 'panels_node_override_basic',
- ),
- 'content' => array(
- 'form id' => 'panels_node_override_content',
- ),
- ),
- ),
-
- 'default cache' => 'panels_node_override_new_page',
-
- 'start' => 'panels_node_override_start',
- 'finish' => 'panels_node_override_finish',
-);
-
-/**
- * Provide defaults for a new cache.
- *
- * The cache will store all our temporary data; it isn't really a page
- * in itself, but it does contain everything we need to make one at the end.
- */
-function panels_node_override_new_page(&$cache) {
- $cache->type = '';
- $cache->display = panels_new_display();
- $cache->display->layout = 'flexible';
-}
-
-/**
- * Callback called prior to the wizard starting up on every page
- * load.
- */
-function panels_node_override_start($form_info, $step, &$form_state) {
- $form_state['page'] = page_manager_get_page_cache('node_view');
- if (!empty($form_state['page']->locked)) {
- $account = user_load($form_state['page']->locked->uid);
- $name = theme('username', array('account' => $account));
- $lock_age = format_interval(time() - $form_state['page']->locked->updated);
- $break = url(page_manager_edit_url($form_state['page']->task_name, array('actions', 'break-lock')));
-
- drupal_set_message(t('WARNING! The node_view is being edited by user !user, and is therefore locked from editing by others. This wizard cannot create a new node override while this page is locked. This lock is !age old. Click here to <a href="!break">break this lock</a>.', array('!user' => $name, '!age' => $lock_age, '!break' => $break)), 'warning');
- }
-}
-
-/**
- * First page of our page creator wizard.
- */
-function panels_node_override_basic($form, &$form_state) {
- $types = node_type_get_types();
- $form_state['types'] = $types;
-
- $already_done = array();
- // Figure out which types already have variants assigned to them.
- foreach ($form_state['page']->handlers as $name => $handler) {
- if ($handler->handler == 'panel_context' && !empty($handler->conf['access']['plugins'])) {
- foreach ($handler->conf['access']['plugins'] as $plugin) {
- if ($plugin['name'] == 'node_type') {
- foreach ($plugin['settings']['type'] as $type) {
- $already_done[$type] = $name;
- }
- }
- }
- }
- }
-
- if ($already_done) {
- $items = array();
- foreach ($already_done as $type => $handler_id) {
- $items[] = check_plain($types[$type]->name) . ' ' . l(t('[Edit]'), page_manager_edit_url($form_state['page']->task_name, array('handlers', $handler_id, 'content')));
- }
-
- $form['already_done'] = array(
- '#type' => 'item',
- '#title' => t('Existing node templates'),
- '#value' => theme('item_list', array('items' => $items)),
- );
- }
-
- $options = array();
- foreach ($types as $name => $type) {
- if (empty($already_done[$name])) {
- $options[$name] = $type->name;
- }
- }
-
- $form['type'] = array(
- '#type' => 'select',
- '#title' => t('Node type'),
- '#options' => $options,
- '#default_value' => $form_state['wizard cache']->type,
- );
-
- ctools_include('page-wizard', 'panels');
- panels_page_wizard_add_layout($form, $form_state);
-
- return $form;
-}
-
-/**
- * Submit function to store the form data in our cache.
- */
-function panels_node_override_basic_submit(&$form, &$form_state) {
- $cache = &$form_state['wizard cache'];
- $cache->display->layout = $form_state['values']['layout'];
- $cache->type = $form_state['values']['type'];
-
- // Create a new handler object and cache it; this way we can use the
- // handler object for retrieving contexts properly.
- // Create the the panel context variant configured with our display
- $plugin = page_manager_get_task_handler('panel_context');
-
- // Create a new handler.
- $cache->handler = page_manager_new_task_handler($plugin);
- $cache->handler->conf['title'] = $form_state['types'][$cache->type]->name;
- $cache->handler->conf['pipeline'] = 'ipe';
- $cache->handler->conf['access'] = array(
- 'plugins' => array(
- 0 => array(
- 'name' => 'node_type',
- 'settings' => array(
- 'type' => array(
- $cache->type => $cache->type,
- ),
- ),
- 'context' => 'argument_nid_1',
- 'not' => FALSE,
- ),
- ),
- 'logic' => 'and',
- );
-
- // Find a region by trying some basic main content region IDs.
- $layout = panels_get_layout($form_state['values']['layout']);
- $regions = panels_get_regions($layout, $cache->display);
- foreach (array('center', 'middle', 'content', 'main') as $candidate) {
- if (!empty($regions[$candidate])) {
- $region = $candidate;
- break;
- }
- }
-
- // If all of the above failed, use the first region.
- if (empty($region)) {
- $keys = array_keys($regions);
- $region = reset($keys);
- }
-
- // Populate the layout with content. This is from an export, with minor
- // changes to ensure defaults are correct and to add stuff to the proper region.
- $pane = new stdClass;
- $pane->pid = 'new-1';
- $pane->panel = $region;
- $pane->type = 'node_content';
- $pane->subtype = 'node_content';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array(
- 'links' => 1,
- 'page' => 1,
- 'no_extras' => 0,
- 'override_title' => 0,
- 'override_title_text' => '',
- 'identifier' => '',
- 'link' => 0,
- 'leave_node_title' => 0,
- 'context' => 'argument_nid_1',
- 'build_mode' => 'full',
- );
- $pane->cache = array();
- $pane->style = array(
- 'settings' => NULL,
- );
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 0;
- $cache->display->content['new-1'] = $pane;
- $cache->display->panels[$region][0] = 'new-1';
- $cache->display->title_pane = 'new-1';
- $cache->display->hide_title = PANELS_TITLE_PANE;
-
- $pane = new stdClass;
- $pane->pid = 'new-2';
- $pane->panel = $region;
- $pane->type = 'node_comments';
- $pane->subtype = 'node_comments';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array(
- 'mode' => variable_get('comment_default_mode', COMMENT_MODE_THREADED),
- 'comments_per_page' => variable_get('comment_default_per_page', '50'),
- 'context' => 'argument_nid_1',
- 'override_title' => 0,
- 'override_title_text' => '',
- );
- $pane->cache = array();
- $pane->style = array(
- 'settings' => NULL,
- );
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 1;
- $cache->display->content['new-2'] = $pane;
- $cache->display->panels[$region][1] = 'new-2';
- $pane = new stdClass;
- $pane->pid = 'new-3';
- $pane->panel = $region;
- $pane->type = 'node_comment_form';
- $pane->subtype = 'node_comment_form';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array(
- 'anon_links' => 1,
- 'context' => 'argument_nid_1',
- 'override_title' => 0,
- 'override_title_text' => '',
- );
- $pane->cache = array();
- $pane->style = array(
- 'settings' => NULL,
- );
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 2;
- $cache->display->content['new-3'] = $pane;
- $cache->display->panels[$region][2] = 'new-3';
-
- $task = page_manager_get_task('node_view');
- ctools_include('context');
- ctools_include('context-task-handler');
- $cache->context = ctools_context_handler_get_all_contexts($task, NULL, $cache->handler);
-
-}
-
-/**
- * Second page of our wizard. This one provides a layout and lets the
- * user add content.
- */
-function panels_node_override_content($form, &$form_state) {
- ctools_include('page-wizard', 'panels');
- panels_page_wizard_add_content($form, $form_state);
-
- return $form;
-}
-
-/**
- * Store changes to the display.
- */
-function panels_node_override_content_submit(&$form, &$form_state) {
- panels_page_wizard_add_content_submit($form, $form_state);
-}
-
-/**
- * Complete the wizard, create a new variant, and send them to the
- * edit screen of that variant.
- */
-function panels_node_override_finish(&$form_state) {
- $page = &$form_state['page'];
- $cache = &$form_state['wizard cache'];
-
- // Add the new handler to the page
- $cache->handler->conf['display'] = $cache->display;
- page_manager_handler_add_to_page($page, $cache->handler);
-
- // Save it
- page_manager_save_page_cache($page);
-
- // Send us to the page manager edit form for this.
- $form_state['redirect'] = url(page_manager_edit_url('node_view', array('handlers', $cache->handler->name, 'content')));
- drupal_set_message(t('Your node template has been created.'));
-}
diff --git a/plugins/style_bases/pane/pane_plain_box/icon.png b/plugins/style_bases/pane/pane_plain_box/icon.png
deleted file mode 100644
index 436355b..0000000
--- a/plugins/style_bases/pane/pane_plain_box/icon.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css b/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css
deleted file mode 100644
index 5a01336..0000000
--- a/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css
+++ /dev/null
@@ -1,11 +0,0 @@
-%style {
- margin-bottom: 10px;
- color: %text;
- background-color: %background;
-}
-
-%style h2 {
- color: %header-text;
- background-color: %header-background;
-}
-
diff --git a/plugins/style_bases/pane/pane_plain_box/pane-plain-box.tpl.php b/plugins/style_bases/pane/pane_plain_box/pane-plain-box.tpl.php
deleted file mode 100644
index 73e3cc9..0000000
--- a/plugins/style_bases/pane/pane_plain_box/pane-plain-box.tpl.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-/**
- * @file
- *
- * Display the box for rounded corners.
- *
- * - $pane: The pane being rendered
- * - $display: The display being rendered
- * - $content: An object containing the content and title
- * - $output: The result of theme('panels_pane')
- * - $classes: The classes that must be applied to the top divs.
- */
-?>
-<div class="<?php print $classes ?>">
- <?php print $output; ?>
-</div>
diff --git a/plugins/style_bases/pane/pane_plain_box/pane_plain_box.inc b/plugins/style_bases/pane/pane_plain_box/pane_plain_box.inc
deleted file mode 100644
index 4adc4ad..0000000
--- a/plugins/style_bases/pane/pane_plain_box/pane_plain_box.inc
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the style base for the rounded shadow box.
- *
- * This box is colorable, has rounded corners and a drop shadow.
- */
-
-$plugin = array(
- 'category' => t('Basic styles'),
- 'title' => t('Plain'),
- 'description' => t('A plain box with an optional border. You may set the color of the text and the border.'),
- 'module' => 'panels',
- 'type' => 'pane',
-
- 'css' => 'pane-plain-box.css',
- 'icon' => 'icon.png',
-
- 'defaults' => array('font' => array(), 'header_font' => array(), 'border' => array(), 'header_border' => array(), 'padding' => array()),
- 'palette' => array(
- 'background' => array(
- 'label' => t('Background'),
- 'default_value' => '#FFFFFF',
- ),
- 'text' => array(
- 'label' => t('Text'),
- 'default_value' => '#000000',
- ),
- 'border' => array(
- 'label' => t('Border'),
- 'default_value' => '#000000',
- ),
- 'header-background' => array(
- 'label' => t('Header background'),
- 'default_value' => '#FFFFFF',
- ),
- 'header-text' => array(
- 'label' => t('Header text'),
- 'default_value' => '#000000',
- ),
- 'header-border' => array(
- 'label' => t('Header border'),
- 'default_value' => '#000000',
- ),
- ),
-
- // This just uses theme_panels_pane because all we need is the class.
-// 'theme' => 'pane_plain_box',
-// 'preview' => 'panels_stylizer_pane_preview',
-
- 'settings form' => 'panels_pane_plain_box_style_settings',
- 'settings form submit' => 'panels_pane_plain_box_style_settings_submit',
- 'build' => 'panels_pane_plain_box_style_base_build',
-);
-
-function panels_pane_plain_box_style_settings(&$form, &$form_state) {
- $form['font'] = array();
- ctools_stylizer_font_selector_form($form['font'], $form_state, t('Font'), $form_state['settings']['font']);
-
- $form['border'] = array();
- ctools_stylizer_border_selector_form($form['border'], $form_state, t('Border'), $form_state['settings']['border']);
-
- $form['padding'] = array();
- ctools_stylizer_padding_selector_form($form['padding'], $form_state, t('Padding'), $form_state['settings']['padding']);
-
- $form['header_font'] = array();
- ctools_stylizer_font_selector_form($form['header_font'], $form_state, t('Header font'), $form_state['settings']['header_font']);
-
- $form['header_border'] = array();
- ctools_stylizer_border_selector_form($form['header_border'], $form_state, t('Header border'), $form_state['settings']['header_border']);
-
-}
-
-function panels_pane_plain_box_style_settings_submit(&$form, &$form_state) {
- ctools_stylizer_font_selector_form_submit($form['font'], $form_state, $form_state['values']['font'], $form_state['settings']['font']);
- ctools_stylizer_font_selector_form_submit($form['header_font'], $form_state, $form_state['values']['header_font'], $form_state['settings']['header_font']);
-
- ctools_stylizer_border_selector_form_submit($form['header_border'], $form_state, $form_state['values']['header_border'], $form_state['settings']['header_border']);
- ctools_stylizer_border_selector_form_submit($form['border'], $form_state, $form_state['values']['border'], $form_state['settings']['border']);
-
- ctools_stylizer_padding_selector_form_submit($form['padding'], $form_state, $form_state['values']['padding'], $form_state['settings']['padding']);
-}
-
-function panels_pane_plain_box_style_base_build($plugin, $settings, &$css, $replacements) {
- ctools_stylizer_font_apply_style($css, '%style', $settings['font']);
- ctools_stylizer_border_apply_style($css, '%style', $settings['border'], '%border');
-
- ctools_stylizer_font_apply_style($css, '%style .pane-title', $settings['header_font']);
- ctools_stylizer_border_apply_style($css, '%style .pane-title', $settings['header_border'], '%header-border', 'bottom');
-
- ctools_stylizer_padding_apply_style($css, '%style .pane-title, %style .pane-content', $settings['padding']);
-}
diff --git a/plugins/style_bases/pane/pane_rounded_shadow/box-color.png b/plugins/style_bases/pane/pane_rounded_shadow/box-color.png
deleted file mode 100644
index b67fd24..0000000
--- a/plugins/style_bases/pane/pane_rounded_shadow/box-color.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/pane/pane_rounded_shadow/box-shadow.png b/plugins/style_bases/pane/pane_rounded_shadow/box-shadow.png
deleted file mode 100644
index 01f385d..0000000
--- a/plugins/style_bases/pane/pane_rounded_shadow/box-shadow.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/pane/pane_rounded_shadow/icon.png b/plugins/style_bases/pane/pane_rounded_shadow/icon.png
deleted file mode 100644
index c3a4572..0000000
--- a/plugins/style_bases/pane/pane_rounded_shadow/icon.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css b/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css
deleted file mode 100644
index 86eea4a..0000000
--- a/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Show only to IE7 */
-*:first-child+html .rounded-shadow-background,
-/* Show only to IE6 */
-* html .rounded-shadow-background {
- margin: 0 -10px 0 0 !important;
- padding: 10px 0 5px 0 !important;
-}
-
-.rounded-shadow-top-edge, .rounded-shadow-bottom-edge, .rounded-shadow-left-edge, .rounded-shadow-right-edge, .rounded-shadow-wrap-corner {
- position: relative;
- /* hasLayout -1 ? For IE only */
- zoom: 1;
-}
-%style {
- padding-top: 10px;
- margin-bottom: 30px;
- color: %text;
-}
-
-%style h2 {
- color: %header-text;
-}
-
-%style .rounded-shadow-background {
- margin: 10px;
- background: %background url(rounded-shadow-background.png) repeat;
-}
-
-%style .rounded-shadow-wrap-corner {
- margin: -10px;
-}
-
-%style .rounded-shadow-top-edge {
- top: -10px;
- background: url(rounded-shadow-top-edge.png) repeat-x 0 top;
- font-size: 1px;
-}
-
-%style .rounded-shadow-bottom-edge {
- bottom: -10px;
- background: url(rounded-shadow-bottom-edge.png) repeat-x 0 bottom;
- font-size: 1px;
-}
-
-%style .rounded-shadow-left-edge {
- background: url(rounded-shadow-left-edge.png) repeat-y 0 0;
-}
-
-%style .rounded-shadow-right-edge {
- background: url(rounded-shadow-right-edge.png) repeat-y right 0;
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-top-edge,
-%style .rounded-shadow-wrap-corner .rounded-shadow-bottom-edge {
- height: 19px;
- margin: -10px 19px;
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-left,
-%style .rounded-shadow-wrap-corner .rounded-shadow-right {
- position: absolute;
- top: 0;
- height: 19px;
- width: 19px;
- margin: 0 -19px;
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-left {
- background-image: url(rounded-shadow-top-left-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-right {
- right: 0;
- background-image: url(rounded-shadow-top-right-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-bottom-edge .rounded-shadow-left {
- background-image: url(rounded-shadow-bottom-left-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-bottom-edge .rounded-shadow-right {
- right: 0;
- background-image: url(rounded-shadow-bottom-right-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-right-edge {
- padding: 3px 19px;
-}
-
-%style .panel-pane {
- position: relative; top: -6px;
-}
-
-/*
-%style div.admin-links {
- margin-top: -19px;
- margin-left: -12px;
-}
-
-%style .panel-separator {
- background: url(rounded-shadow-bottom-edge.png) repeat-x 0 center;
- font-size: 1px;
- height: 30px;
-}
-*/
diff --git a/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.tpl.php b/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.tpl.php
deleted file mode 100644
index 66ffcd6..0000000
--- a/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.tpl.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * @file
- *
- * Display the box for rounded corners.
- *
- * - $output: The content of the box.
- * - $classes: The classes that must be applied to the top divs.
- * - $pane: The pane being rendered
- * - $display: The display being rendered
- * - $content: The content being rendered (will be already in $output)
- */
-?>
-<div class="rounded-shadow <?php print $classes ?>">
- <div class="rounded-shadow-background">
- <div class="rounded-shadow-wrap-corner">
- <div class="rounded-shadow-top-edge">
- <div class="rounded-shadow-left"></div>
- <div class="rounded-shadow-right"></div>
- </div>
- <div class="rounded-shadow-left-edge">
- <div class="rounded-shadow-right-edge clearfix">
- <?php print $output; ?>
- </div>
- </div>
- <div class="rounded-shadow-bottom-edge">
- <div class="rounded-shadow-left"></div><div class="rounded-shadow-right"></div>
- </div>
- </div>
- </div>
-</div>
diff --git a/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc b/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc
deleted file mode 100644
index ff582ca..0000000
--- a/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc
+++ /dev/null
@@ -1,99 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the style base for the rounded shadow box.
- *
- * This box is colorable, has rounded corners and a drop shadow.
- */
-
-$plugin = array(
- 'category' => t('Basic styles'),
- 'title' => t('Rounded shadow box'),
- 'module' => 'panels',
- 'type' => 'pane',
- 'css' => 'pane-rounded-shadow.css',
- 'icon' => 'icon.png',
- 'defaults' => array('header_font' => array(), 'text_font' => array(), 'padding' => array(), 'header_border' => array()),
- 'palette' => array(
- 'background' => array(
- 'label' => t('Background'),
- 'default_value' => '#FFFFFF',
- ),
- 'text' => array(
- 'label' => t('Text'),
- 'default_value' => '#000000',
- ),
- 'header-text' => array(
- 'label' => t('Header text'),
- 'default_value' => '#000000',
- ),
- 'header-border' => array(
- 'label' => t('Header border'),
- 'default_value' => '#000000',
- ),
- ),
- 'actions' => array(
- array('load', 'box', 'box-color.png'),
- array('colorize', 'background'),
- array('load', 'shadow', 'box-shadow.png'),
- array('merge_from', 'box'),
- array('slice', 'rounded-shadow-top-left-corner.png', 17, 49, 19, 19),
- array('slice', 'rounded-shadow-top-right-corner.png', 473, 49, 19, 19),
- array('slice', 'rounded-shadow-bottom-left-corner.png', 17, 442, 19, 19),
- array('slice', 'rounded-shadow-bottom-right-corner.png', 473, 442, 19, 19),
- array('slice', 'rounded-shadow-left-edge.png', 17, 60, 10, 10),
- array('slice', 'rounded-shadow-right-edge.png', 474, 60, 18, 10),
- array('slice', 'rounded-shadow-top-edge.png', 28, 49, 10, 10),
- array('slice', 'rounded-shadow-bottom-edge.png', 28, 443, 10, 18),
- array('slice', 'rounded-shadow-background.png', 150, 150, 1, 1),
- ),
-
- 'theme' => 'pane_rounded_shadow',
- 'build' => 'panels_rounded_shadow_style_base_build',
-// 'preview' => 'panels_stylizer_pane_preview',
-
- 'settings form' => 'panels_pane_rounded_shadow_style_settings',
- 'settings form submit' => 'panels_pane_rounded_shadow_style_settings_submit',
- 'build' => 'panels_pane_rounded_shadow_style_base_build',
-);
-
-function template_preprocess_pane_rounded_shadow(&$vars) {
- $vars['classes_array'][] = $vars['content']->css_class;
- $vars['content']->css_class = '';
-
- $vars['output'] = theme('panels_pane', $vars);
-}
-
-function panels_pane_rounded_shadow_style_settings(&$form, &$form_state) {
- $form['header_font'] = array();
- ctools_stylizer_font_selector_form($form['header_font'], $form_state, t('Header font'), $form_state['settings']['header_font']);
-
- $form['header_border'] = array();
- ctools_stylizer_border_selector_form($form['header_border'], $form_state, t('Header border'), $form_state['settings']['header_border']);
-
- $form['text_font'] = array();
- ctools_stylizer_font_selector_form($form['text_font'], $form_state, t('Text font'), $form_state['settings']['text_font']);
-
- $form['padding'] = array();
- ctools_stylizer_padding_selector_form($form['padding'], $form_state, t('Padding'), $form_state['settings']['padding']);
-}
-
-function panels_pane_rounded_shadow_style_settings_submit(&$form, &$form_state) {
- ctools_stylizer_font_selector_form_submit($form['header_font'], $form_state, $form_state['values']['header_font'], $form_state['settings']['header_font']);
-
- ctools_stylizer_font_selector_form_submit($form['text_font'], $form_state, $form_state['values']['text_font'], $form_state['settings']['text_font']);
-
- ctools_stylizer_padding_selector_form_submit($form['padding'], $form_state, $form_state['values']['padding'], $form_state['settings']['padding']);
-
- ctools_stylizer_border_selector_form_submit($form['header_border'], $form_state, $form_state['values']['header_border'], $form_state['settings']['header_border']);
-
-}
-
-function panels_pane_rounded_shadow_style_base_build($plugin, $settings, &$css, $replacements) {
- ctools_stylizer_font_apply_style($css, '%style .pane-title', $settings['header_font']);
- ctools_stylizer_border_apply_style($css, '%style .pane-title', $settings['header_border'], '%header-border', 'bottom');
- ctools_stylizer_font_apply_style($css, '%style .pane-content', $settings['text_font']);
- ctools_stylizer_padding_apply_style($css, '%style', $settings['padding']);
-}
-
diff --git a/plugins/style_bases/region/region_plain_box/icon.png b/plugins/style_bases/region/region_plain_box/icon.png
deleted file mode 100644
index 436355b..0000000
--- a/plugins/style_bases/region/region_plain_box/icon.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/region/region_plain_box/region-plain-box.css b/plugins/style_bases/region/region_plain_box/region-plain-box.css
deleted file mode 100644
index e48b6d5..0000000
--- a/plugins/style_bases/region/region_plain_box/region-plain-box.css
+++ /dev/null
@@ -1,6 +0,0 @@
-%style {
- padding-top: 10px;
- margin-bottom: 10px;
- color: %text;
- background-color: %background;
-}
diff --git a/plugins/style_bases/region/region_plain_box/region-plain-box.tpl.php b/plugins/style_bases/region/region_plain_box/region-plain-box.tpl.php
deleted file mode 100644
index 840f50a..0000000
--- a/plugins/style_bases/region/region_plain_box/region-plain-box.tpl.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * @file
- *
- * Display the box for rounded corners.
- *
- * - $content: The content of the box.
- * - $classes: The classes that must be applied to the top divs.
- */
-?>
-<div class="rounded-shadow <?php print $class ?>">
- <div class="rounded-shadow-background">
- <div class="rounded-shadow-wrap-corner">
- <div class="rounded-shadow-top-edge">
- <div class="rounded-shadow-left"></div>
- <div class="rounded-shadow-right"></div>
- </div>
- <div class="rounded-shadow-left-edge">
- <div class="rounded-shadow-right-edge clearfix">
- <?php print $content; ?>
- </div>
- </div>
- <div class="rounded-shadow-bottom-edge">
- <div class="rounded-shadow-left"></div><div class="rounded-shadow-right"></div>
- </div>
- </div>
- </div>
-</div>
diff --git a/plugins/style_bases/region/region_plain_box/region_plain_box.inc b/plugins/style_bases/region/region_plain_box/region_plain_box.inc
deleted file mode 100644
index daaf7c8..0000000
--- a/plugins/style_bases/region/region_plain_box/region_plain_box.inc
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the style base for the rounded shadow box.
- *
- * This box is colorable, has rounded corners and a drop shadow.
- */
-
-$plugin = array(
- 'category' => t('Basic styles'),
- 'title' => t('Plain'),
- 'description' => t('A plain box with an optional border. You may set the color of the text and the border.'),
- 'module' => 'panels',
- 'type' => 'region',
-
- 'css' => 'region-plain-box.css',
- 'icon' => 'icon.png',
-
- 'defaults' => array('font' => array(), 'border' => array(), 'padding' => array()),
- 'palette' => array(
- 'background' => array(
- 'label' => t('Background'),
- 'default_value' => '#FFFFFF',
- ),
- 'text' => array(
- 'label' => t('Text'),
- 'default_value' => '#000000',
- ),
- 'border' => array(
- 'label' => t('Border'),
- 'default_value' => '#000000',
- ),
- ),
-
- 'theme' => 'region_plain_box',
-// 'preview' => 'panels_stylizer_region_preview',
-
- 'settings form' => 'panels_region_plain_box_style_settings',
- 'settings form submit' => 'panels_region_plain_box_style_settings_submit',
- 'build' => 'panels_region_plain_box_style_base_build',
-);
-
-function panels_region_plain_box_style_settings(&$form, &$form_state) {
- $form['font'] = array();
- ctools_stylizer_font_selector_form($form['font'], $form_state, t('Font'), $form_state['settings']['font']);
-
- $form['border'] = array();
- ctools_stylizer_border_selector_form($form['border'], $form_state, t('Border'), $form_state['settings']['border']);
-
- $form['padding'] = array();
- ctools_stylizer_padding_selector_form($form['padding'], $form_state, t('Padding'), $form_state['settings']['padding']);
-}
-
-function panels_region_plain_box_style_settings_submit(&$form, &$form_state) {
- ctools_stylizer_font_selector_form_submit($form['font'], $form_state, $form_state['values']['font'], $form_state['settings']['font']);
- ctools_stylizer_border_selector_form_submit($form['border'], $form_state, $form_state['values']['border'], $form_state['settings']['border']);
- ctools_stylizer_padding_selector_form_submit($form['padding'], $form_state, $form_state['values']['padding'], $form_state['settings']['padding']);
-}
-
-function panels_region_plain_box_style_base_build($plugin, $settings, &$css, $replacements) {
- ctools_stylizer_font_apply_style($css, '%style', $settings['font']);
- ctools_stylizer_border_apply_style($css, '%style', $settings['border'], '%border');
- ctools_stylizer_padding_apply_style($css, '%style', $settings['padding']);
-}
diff --git a/plugins/style_bases/region/region_rounded_shadow/box-color.png b/plugins/style_bases/region/region_rounded_shadow/box-color.png
deleted file mode 100644
index b67fd24..0000000
--- a/plugins/style_bases/region/region_rounded_shadow/box-color.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/region/region_rounded_shadow/box-shadow.png b/plugins/style_bases/region/region_rounded_shadow/box-shadow.png
deleted file mode 100644
index 01f385d..0000000
--- a/plugins/style_bases/region/region_rounded_shadow/box-shadow.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/region/region_rounded_shadow/icon.png b/plugins/style_bases/region/region_rounded_shadow/icon.png
deleted file mode 100644
index c3a4572..0000000
--- a/plugins/style_bases/region/region_rounded_shadow/icon.png
+++ /dev/null
Binary files differ
diff --git a/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css b/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css
deleted file mode 100644
index 924a6bf..0000000
--- a/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Show only to IE7 */
-*:first-child+html .rounded-shadow-background,
-/* Show only to IE6 */
-* html .rounded-shadow-background {
- margin: 0 -10px 0 0 !important;
- padding: 10px 0 5px 0 !important;
-}
-
-.rounded-shadow-top-edge, .rounded-shadow-bottom-edge, .rounded-shadow-left-edge, .rounded-shadow-right-edge, .rounded-shadow-wrap-corner {
- position: relative;
- /* hasLayout -1 ? For IE only */
- zoom: 1;
-}
-%style {
- padding-top: 10px;
- margin-bottom: 30px;
- color: %text;
-}
-
-%style .rounded-shadow-background {
- margin: 10px;
- background: %background url(rounded-shadow-background.png) repeat;
-}
-
-%style .rounded-shadow-wrap-corner {
- margin: -10px;
-}
-
-%style .rounded-shadow-top-edge {
- top: -10px;
- background: url(rounded-shadow-top-edge.png) repeat-x 0 top;
- font-size: 1px;
-}
-
-%style .rounded-shadow-bottom-edge {
- bottom: -10px;
- background: url(rounded-shadow-bottom-edge.png) repeat-x 0 bottom;
- font-size: 1px;
-}
-
-%style .rounded-shadow-left-edge {
- background: url(rounded-shadow-left-edge.png) repeat-y 0 0;
-}
-
-%style .rounded-shadow-right-edge {
- background: url(rounded-shadow-right-edge.png) repeat-y right 0;
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-top-edge,
-%style .rounded-shadow-wrap-corner .rounded-shadow-bottom-edge {
- height: 19px;
- margin: -10px 19px;
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-left,
-%style .rounded-shadow-wrap-corner .rounded-shadow-right {
- position: absolute;
- top: 0;
- height: 19px;
- width: 19px;
- margin: 0 -19px;
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-left {
- background-image: url(rounded-shadow-top-left-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-right {
- right: 0;
- background-image: url(rounded-shadow-top-right-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-bottom-edge .rounded-shadow-left {
- background-image: url(rounded-shadow-bottom-left-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-bottom-edge .rounded-shadow-right {
- right: 0;
- background-image: url(rounded-shadow-bottom-right-corner.png);
-}
-
-%style .rounded-shadow-wrap-corner .rounded-shadow-right-edge {
- padding: 3px 19px;
-}
-
-/*
-%style div.admin-links {
- margin-top: -19px;
- margin-left: -12px;
-}
-
-%style .panel-separator {
- background: url(rounded-shadow-bottom-edge.png) repeat-x 0 center;
- font-size: 1px;
- height: 30px;
-}
-*/
diff --git a/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.tpl.php b/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.tpl.php
deleted file mode 100644
index 840f50a..0000000
--- a/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.tpl.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * @file
- *
- * Display the box for rounded corners.
- *
- * - $content: The content of the box.
- * - $classes: The classes that must be applied to the top divs.
- */
-?>
-<div class="rounded-shadow <?php print $class ?>">
- <div class="rounded-shadow-background">
- <div class="rounded-shadow-wrap-corner">
- <div class="rounded-shadow-top-edge">
- <div class="rounded-shadow-left"></div>
- <div class="rounded-shadow-right"></div>
- </div>
- <div class="rounded-shadow-left-edge">
- <div class="rounded-shadow-right-edge clearfix">
- <?php print $content; ?>
- </div>
- </div>
- <div class="rounded-shadow-bottom-edge">
- <div class="rounded-shadow-left"></div><div class="rounded-shadow-right"></div>
- </div>
- </div>
- </div>
-</div>
diff --git a/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc b/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc
deleted file mode 100644
index b73da90..0000000
--- a/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the style base for the rounded shadow box.
- *
- * This box is colorable, has rounded corners and a drop shadow.
- */
-
-$plugin = array(
- 'category' => t('Basic styles'),
- 'title' => t('Rounded shadow box'),
- 'module' => 'panels',
- 'type' => 'region',
- 'css' => 'region-rounded-shadow.css',
- 'icon' => 'icon.png',
- 'defaults' => array('font' => array(), 'padding' => array()),
- 'palette' => array(
- 'background' => array(
- 'label' => t('Background'),
- 'default_value' => '#FFFFFF',
- ),
- 'text' => array(
- 'label' => t('Text color'),
- 'default_value' => '#000000',
- ),
- ),
- 'actions' => array(
- array('load', 'box', 'box-color.png'),
- array('colorize', 'background'),
- array('load', 'shadow', 'box-shadow.png'),
- array('merge_from', 'box'),
- array('slice', 'rounded-shadow-top-left-corner.png', 17, 49, 19, 19),
- array('slice', 'rounded-shadow-top-right-corner.png', 473, 49, 19, 19),
- array('slice', 'rounded-shadow-bottom-left-corner.png', 17, 442, 19, 19),
- array('slice', 'rounded-shadow-bottom-right-corner.png', 473, 442, 19, 19),
- array('slice', 'rounded-shadow-left-edge.png', 17, 60, 10, 10),
- array('slice', 'rounded-shadow-right-edge.png', 474, 60, 18, 10),
- array('slice', 'rounded-shadow-top-edge.png', 28, 49, 10, 10),
- array('slice', 'rounded-shadow-bottom-edge.png', 28, 443, 10, 18),
- array('slice', 'rounded-shadow-background.png', 150, 150, 1, 1),
- ),
-
- 'theme' => 'region_rounded_shadow',
-
- 'build' => 'panels_rounded_shadow_style_base_build',
-// 'preview' => 'panels_stylizer_region_preview',
-
- 'settings form' => 'panels_region_rounded_shadow_style_settings',
- 'settings form submit' => 'panels_region_rounded_shadow_style_settings_submit',
- 'build' => 'panels_region_rounded_shadow_style_base_build',
-);
-
-function panels_region_rounded_shadow_style_settings(&$form, &$form_state) {
- $form['font'] = array();
- ctools_stylizer_font_selector_form($form['font'], $form_state, t('Font'), $form_state['settings']['font']);
-
- $form['padding'] = array();
- ctools_stylizer_padding_selector_form($form['padding'], $form_state, t('Padding'), $form_state['settings']['padding']);
-}
-
-function panels_region_rounded_shadow_style_settings_submit(&$form, &$form_state) {
- ctools_stylizer_font_selector_form_submit($form['font'], $form_state, $form_state['values']['font'], $form_state['settings']['font']);
- ctools_stylizer_padding_selector_form_submit($form['padding'], $form_state, $form_state['values']['padding'], $form_state['settings']['padding']);
-}
-
-function panels_region_rounded_shadow_style_base_build($plugin, $settings, &$css, $replacements) {
- ctools_stylizer_font_apply_style($css, '%style', $settings['font']);
- ctools_stylizer_padding_apply_style($css, '%style', $settings['padding']);
-}
-
diff --git a/plugins/styles/block.inc b/plugins/styles/block.inc
deleted file mode 100644
index 4614ee4..0000000
--- a/plugins/styles/block.inc
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the 'block' panel style.
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t('System block'),
- 'description' => t('Display the pane as a system block; this is more restrictive than the default.'),
- 'render pane' => 'panels_block_style_render_pane',
- 'weight' => -10,
-);
-
-/**
- * Render callback.
- *
- * @ingroup themeable
- */
-function theme_panels_block_style_render_pane($vars) {
- $content = $vars['content'];
- $pane = $vars['pane'];
-
- if (empty($content->content)) {
- return;
- }
-
- $block = clone($content);
-
- if (!empty($block->title)) {
- $block->subject = $block->title;
- }
-
- $block->region = $pane->panel;
- if (!isset($block->module)) {
- $block->module = $block->type;
- }
- if (!isset($block->delta)) {
- $block->delta = $block->subtype;
- }
-
- $build = $block->content;
- if (is_string($build)) {
- $build = array('#markup' => $build);
- }
-
- $build['#block'] = $block;
- $build['#theme_wrappers'][] = 'block';
-
- // If using per pane classes, $block->css_class will need to be added in your
- // preprocess or template, along with any other Panels specific field you
- // might want to utilize.
- return drupal_render($build);
-}
-
diff --git a/plugins/styles/corners/corner-bits.png b/plugins/styles/corners/corner-bits.png
deleted file mode 100644
index 73480e6..0000000
--- a/plugins/styles/corners/corner-bits.png
+++ /dev/null
Binary files differ
diff --git a/plugins/styles/corners/panels-rounded-corners-box.tpl.php b/plugins/styles/corners/panels-rounded-corners-box.tpl.php
deleted file mode 100644
index ea59276..0000000
--- a/plugins/styles/corners/panels-rounded-corners-box.tpl.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * @file
- *
- * Display the box for rounded corners.
- *
- * - $content: The content of the box.
- */
-?>
-<div class="rounded-corner">
- <div class="wrap-corner">
- <div class="t-edge"><div class="l"></div><div class="r"></div></div>
- <div class="l-edge">
- <div class="r-edge clearfix">
- <?php print $content; ?>
- </div>
- </div>
- <div class="b-edge"><div class="l"></div><div class="r"></div></div>
- </div>
-</div>
diff --git a/plugins/styles/corners/rounded_corners.inc b/plugins/styles/corners/rounded_corners.inc
deleted file mode 100644
index dd51170..0000000
--- a/plugins/styles/corners/rounded_corners.inc
+++ /dev/null
@@ -1,205 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the 'rounded_corners' panel style.
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t('Rounded corners'),
- 'description' => t('Presents the panes or panels with a rounded corner box around them'),
- 'render region' => 'panels_rounded_corners_style_render_region',
- 'render pane' => 'panels_rounded_corners_style_render_pane',
- 'settings form' => 'panels_rounded_corners_style_settings_form',
- 'hook theme' => array(
- 'panels_rounded_corners_box' => array(
- 'variables' => array('content' => NULL),
- 'path' => panels_get_path('plugins/styles/corners'),
- 'template' => 'panels-rounded-corners-box',
- ),
- ),
-);
-
-/**
- * Render callback.
- *
- * @ingroup themeable
- */
-function theme_panels_rounded_corners_style_render_region($vars) {
- $display = $vars['display'];
- $region_id = $vars['region_id'];
- $panes = $vars['panes'];
- $settings = $vars['settings'];
-
- $output = '';
-
- // Determine where to put the box. If empty or 'pane' around each pane. If
- // 'panel' then just around the whole panel.
- $where = empty($settings['corner_location']) ? 'pane' : $settings['corner_location'];
-
- $print_separator = FALSE;
- foreach ($panes as $pane_id => $pane) {
- // Add the separator if we've already displayed a pane.
- if ($print_separator) {
- $output .= '<div class="panel-separator">&nbsp;</div>';
- }
-
- if ($where == 'pane') {
- $output .= theme('panels_rounded_corners_box', array('content' => $pane));
- }
- else {
- $output .= $pane;
- $print_separator = TRUE;
- }
- }
-
- if ($where == 'panel') {
- $output = theme('panels_rounded_corners_box', array('content' => $output));
- }
-
- panels_add_rounded_corners_css($display, $where);
-
- return $output;
-}
-
-function panels_add_rounded_corners_css($display, $where) {
- static $displays_used = array();
- if (empty($displays_used[$display->css_id])) {
- panels_rounded_corners_css($display, $where);
- $displays_used[$display->css_id] = TRUE;
- }
-}
-
-/**
- * Render callback for a single pane.
- */
-function theme_panels_rounded_corners_style_render_pane($vars) {
- $content = $vars['content'];
- $pane = $vars['pane'];
- $display = $vars['display'];
-
- if (empty($content->content)) {
- return;
- }
-
- $output = theme('panels_pane', array('content' => $content, 'pane' => $pane, 'display' => $display));
-
- // Just stick a box around the standard theme_panels_pane.
- $output = theme('panels_rounded_corners_box', array('content' => $output));
- panels_add_rounded_corners_css($display, 'pane');
- return $output;
-}
-
-/**
- * Settings form callback.
- */
-function panels_rounded_corners_style_settings_form($style_settings) {
- $form['corner_location'] = array(
- '#type' => 'select',
- '#title' => t('Box around'),
- '#options' => array(
- 'pane' => t('Each pane'),
- 'panel' => t('Each region'),
- ),
- '#default_value' => (isset($style_settings['corner_location'])) ? $style_settings['corner_location'] : 'ul',
- '#description' => t('Choose whether to include the box around each pane (piece of content) or region (each column or region)'),
- );
-
- return $form;
-}
-
-/**
- * Generates the dynamic CSS.
- *
- * @param $display
- * A Panels display object.
- */
-function panels_rounded_corners_css($display) {
- $idstr = empty($display->css_id) ? '.rounded-corner' : "#$display->css_id";
- $css_id = 'rounded-corner:' . $idstr;
-
- ctools_include('css');
- $filename = ctools_css_retrieve($css_id);
- if (!$filename) {
- $filename = ctools_css_store($css_id, _panels_rounded_corners_css($idstr), FALSE);
- }
-
- drupal_add_css($filename, 'module', 'all', FALSE);
-}
-
-/**
- * Generates the dynamic CSS.
- */
-function _panels_rounded_corners_css($idstr) {
- $url = panels_get_path('plugins/styles/corners', TRUE);
-
- $css = <<<EOF
-
-.t-edge, .b-edge, .l-edge, .r-edge, .wrap-corner {
- position: relative;
- /* hasLayout -1 ? For IE only */
- zoom: 1;
-}
-$idstr .t-edge {
- background: url($url/shadow-t.png) repeat-x 0 top;
- font-size: 1px;
-}
-$idstr .b-edge {
- background: url($url/shadow-b.png) repeat-x 0 bottom;
- font-size: 1px;
-}
-$idstr .l-edge {
- background: url($url/shadow-l.png) repeat-y 0 0;
-}
-$idstr .r-edge {
- background: url($url/shadow-r.png) repeat-y right 0;
-}
-$idstr .wrap-corner {
- background: #fff !important;
-}
-$idstr .wrap-corner .t-edge, $idstr .wrap-corner .b-edge {
- height: 11px;
-}
-$idstr .wrap-corner .l, $idstr .wrap-corner .r {
- position: absolute;
- top: 0;
- height: 11px;
- width: 11px;
- background-image: url($url/corner-bits.png);
-}
-$idstr .wrap-corner .l {
- left: 0;
-}
-$idstr .wrap-corner .r {
- right: 0;
- background-position: -11px 0;
-}
-$idstr .wrap-corner .b-edge .l {
- background-position: 0 -11px;
-}
-$idstr .wrap-corner .b-edge .r {
- background-position: -11px -11px;
-}
-$idstr .wrap-corner .r-edge {
- padding: 5px 24px;
-}
-$idstr div.admin-links {
- margin-top: -14px;
- margin-left: -12px;
-}
-
-$idstr .panel-separator {
- background: url($url/shadow-b.png) repeat-x 0 center;
- font-size: 1px;
- height: 30px;
-}
-
-$idstr .rounded-corner {
- margin-bottom: 1em;
-}
-
-EOF;
-
- return $css;
-}
diff --git a/plugins/styles/corners/shadow-b.png b/plugins/styles/corners/shadow-b.png
deleted file mode 100644
index 663676e..0000000
--- a/plugins/styles/corners/shadow-b.png
+++ /dev/null
Binary files differ
diff --git a/plugins/styles/corners/shadow-l.png b/plugins/styles/corners/shadow-l.png
deleted file mode 100644
index 43fd7e7..0000000
--- a/plugins/styles/corners/shadow-l.png
+++ /dev/null
Binary files differ
diff --git a/plugins/styles/corners/shadow-r.png b/plugins/styles/corners/shadow-r.png
deleted file mode 100644
index 5c972f2..0000000
--- a/plugins/styles/corners/shadow-r.png
+++ /dev/null
Binary files differ
diff --git a/plugins/styles/corners/shadow-t.png b/plugins/styles/corners/shadow-t.png
deleted file mode 100644
index 5947889..0000000
--- a/plugins/styles/corners/shadow-t.png
+++ /dev/null
Binary files differ
diff --git a/plugins/styles/default.inc b/plugins/styles/default.inc
deleted file mode 100644
index 9e89cbc..0000000
--- a/plugins/styles/default.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the 'default' panel style.
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t('No style'),
- 'description' => t('The default panel rendering style; displays each pane with a separator.'),
- 'render region' => 'panels_default_style_render_region',
-);
-
-/**
- * Render callback.
- *
- * @ingroup themeable
- */
-function theme_panels_default_style_render_region($vars) {
- $output = '';
-// $output .= '<div class="region region-' . $vars['region_id'] . '">';
- $output .= implode('<div class="panel-separator"></div>', $vars['panes']);
-// $output .= '</div>';
- return $output;
-}
-
diff --git a/plugins/styles/list.inc b/plugins/styles/list.inc
deleted file mode 100644
index c13c532..0000000
--- a/plugins/styles/list.inc
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-
-/**
- * @file
- * Definition of the 'list' panel style.
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t('List'),
- 'description' => t('Presents the panes in the form of an HTML list.'),
- 'render region' => 'panels_list_style_render_region',
- 'settings form' => 'panels_list_style_settings_form',
- 'settings validate' => 'panels_list_style_settings_validate',
-);
-
-/**
- * Render callback.
- *
- * @ingroup themeable
- */
-function theme_panels_list_style_render_region($vars) {
- $display = $vars['display'];
- $region_id = $vars['region_id'];
- $panes = $vars['panes'];
- $settings = $vars['settings'];
-
- $items = array();
-
- foreach ($panes as $pane_id => $item) {
- $items[] = $item;
- }
-
- if (empty($settings['list_type'])) {
- $settings['list_type'] = 'ul';
- }
-
- return theme('item_list', array('items' => $items, 'type' => $settings['list_type']));
-}
-
-/**
- * Settings form callback.
- */
-function panels_list_style_settings_form($style_settings) {
- $form['list_type'] = array(
- '#type' => 'select',
- '#title' => t('List type'),
- '#options' => array(
- 'ul' => t('Unordered'),
- 'ol' => t('Ordered'),
- ),
- '#default_value' => (isset($style_settings['list_type'])) ? $style_settings['list_type'] : 'ul',
- );
-
- return $form;
-}
-
diff --git a/plugins/styles/naked.inc b/plugins/styles/naked.inc
deleted file mode 100644
index dbe8446..0000000
--- a/plugins/styles/naked.inc
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the 'naked' panel style.
- */
-
-// Plugin definition
-$plugin = array(
- 'title' => t('No markup at all'),
- 'description' => t('Display the pane with no markup, not even a title.'),
- 'render pane' => 'panels_naked_style_render_pane',
- 'weight' => -5,
-);
-
-/**
- * Render callback.
- *
- * @ingroup themeable
- */
-function theme_panels_naked_style_render_pane($vars) {
- return render($vars['content']->content);
-}
-
diff --git a/plugins/styles/stylizer.inc b/plugins/styles/stylizer.inc
deleted file mode 100644
index 59a72ae..0000000
--- a/plugins/styles/stylizer.inc
+++ /dev/null
@@ -1,360 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of the 'stylizer' panel style.
- */
-
-if (module_exists('stylizer')) {
- // Plugin definition
- $plugin = array(
- 'title' => t('Custom style'),
- 'weight' => -10,
- 'description' => t('Allows choice of a stylizer style'),
-
- 'render pane' => 'panels_stylizer_stylizer_style_render_pane',
- 'pane settings form' => 'panels_stylizer_stylizer_style_settings_form',
-
- 'render region' => 'panels_stylizer_stylizer_style_render_region',
- 'settings form' => 'panels_stylizer_stylizer_style_settings_form',
-
- // We offer substyles so provide callbacks to do so.
- 'get child' => 'panels_stylizer_get_substyle',
- 'get children' => 'panels_stylizer_get_substyles',
-
- // Set up an AJAX callback for the style
- 'ajax' => array(
- 'custom' => 'panels_stylizer_pane_add_style',
- ),
- // 'settings validate' => 'panels_stylizer_stylizer_style_settings_validate',
- );
-}
-
-/**
- * Merge the main stylizer plugin with a style to create a sub plugin.
- *
- * This is used for both panels_stylizer_get_substyle and
- * panels_stylizer_get_substyles.
- */
-function panels_stylizer_merge_plugin($plugin, $style) {
- $plugin['name'] = 'stylizer:' . $style->name;
- $plugin['title'] = check_plain($style->admin_title);
- $plugin['description'] = check_plain($style->admin_description);
- $plugin['style'] = $style;
- $plugin['weight'] = 0;
-
- ctools_include('stylizer');
- $base = ctools_get_style_base($style->settings['style_base']);
- if ($base['type'] == 'pane') {
- unset($plugin['render region']);
- }
- else {
- unset($plugin['render pane']);
- }
-
- unset($plugin['settings form']);
- unset($plugin['pane settings form']);
- return $plugin;
-}
-
-/**
- * Callback to provide a single stored stylizer style.
- */
-function panels_stylizer_get_substyle($plugin, $style_name, $substyle_name) {
- // Do not worry about caching; Panels is handling that for us.
- ctools_include('export');
- $item = ctools_export_crud_load('stylizer', $substyle_name);
- if ($item) {
- return panels_stylizer_merge_plugin($plugin, $item);
- }
-}
-
-/**
- * Callback to provide all stored stylizer styles.
- */
-function panels_stylizer_get_substyles($plugin, $style_name) {
- $styles[$style_name] = $plugin;
- ctools_include('export');
- ctools_include('stylizer');
- $items = ctools_export_crud_load_all('stylizer');
- foreach ($items as $name => $item) {
- $base = ctools_get_style_base($item->settings['style_base']);
- if ($base && $base['module'] == 'panels') {
- $styles['stylizer:' . $name] = panels_stylizer_merge_plugin($plugin, $item);
- }
- }
-
- return $styles;
-}
-
-function _panels_stylizer_get_style($plugin, $style_settings) {
- if (!empty($plugin['style'])) {
- return $plugin['style']->settings;
- }
- else if ($style_settings['style'] == '$') {
- return $style_settings['settings'];
- }
- else {
- ctools_include('export');
- $style = ctools_export_crud_load('stylizer', $style_settings['style']);
- if ($style) {
- return $style->settings;
- }
- }
-}
-
-/**
- * Region render theme.
- */
-function theme_panels_stylizer_stylizer_style_render_region($vars) {
- $display = $vars['display'];
- $panes = $vars['panes'];
- $style_settings = $vars['settings'];
- $region_id = $vars['region_id'];
- $plugin = $vars['style'];
-
- $output = '';
-
- foreach ($panes as $pane_id => $pane_output) {
- $output .= $pane_output;
- }
-
- $settings = _panels_stylizer_get_style($plugin, $style_settings);
-
- if (!empty($settings)) {
- ctools_include('stylizer');
- $plugin = ctools_get_style_base($settings['style_base']);
- ctools_stylizer_add_css($plugin, $settings);
-
- return theme($plugin['theme'], array('settings' => $settings, 'class' => ctools_stylizer_get_css_class($plugin, $settings), 'content' => $output));
- }
- else {
- // if the style is gone, just display the output.
- return $output;
- }
-}
-
-/**
- * Pane render theme
- */
-function theme_panels_stylizer_stylizer_style_render_pane($vars) {
- $content = $vars['content'];
- $pane = $vars['pane'];
- $display = $vars['display'];
- $plugin = $vars['style'];
-
- $settings = _panels_stylizer_get_style($plugin, $vars['settings']);
-
- if ($settings) {
- ctools_include('stylizer');
- $plugin = ctools_get_style_base($settings['style_base']);
-
- if (empty($content->css_class)) {
- $content->css_class = ctools_stylizer_get_css_class($plugin, $settings);
- }
- else {
- $content->css_class .= ' ' . ctools_stylizer_get_css_class($plugin, $settings);
- }
-
- ctools_stylizer_add_css($plugin, $settings);
-
- if (isset($plugin['theme'])) {
- return theme($plugin['theme'], array('settings' => $settings, 'content' => $content, 'pane' => $pane, 'display' => $display));
- }
- }
-
- // if the style is gone or has no theme of its own, just display the output.
- return theme('panels_pane', array('content' => $content, 'pane' => $pane, 'display' => $display));
-}
-
-/**
- * Settings form callback.
- */
-function panels_stylizer_stylizer_style_settings_form($style_settings, $display, $pid, $type, $form_state) {
- // Just redirect this to the custom style settings ajax.
- panels_stylizer_pane_add_style($form_state['renderer'], array(), $style_settings, $type, $pid);
- print ajax_render($form_state['renderer']->commands);
- ajax_footer();
- exit;
-}
-
-
-/**
- * Allow on-the-fly creation of styles in panes.
- */
-function panels_stylizer_pane_add_style(&$renderer, $plugin, &$conf, $type, $pid, $step = NULL) {
- if (!user_access('administer panels styles')) {
- return;
- }
-
- ctools_include('stylizer');
- $js = FALSE;
-
- $path = $renderer->get_url('style', 'custom', $type, $pid, '%step');
-
- $info = array(
- 'module' => 'panels',
- 'type' => $type,
- 'path' => $path,
- 'modal' => t('Create custom style'),
- 'owner form' => 'panels_stylizer_edit_pane_style_form',
- 'owner form validate' => 'panels_stylizer_edit_pane_style_form_validate',
- 'owner form submit' => 'panels_stylizer_edit_pane_style_form_submit',
- 'owner settings' => array('preconfigured' => FALSE, 'name' => '', 'admin_title' => '', 'admin_description' => ''),
- 'cache' => &$renderer->cache,
- 'conf' => &$conf,
- 'pid' => $pid,
- );
-
- if (!empty($conf['settings'])) {
- $info['settings'] = $conf['settings'];
- }
-
- $output = ctools_stylizer_edit_style($info, TRUE, $step);
- if (!empty($info['complete'])) {
- if (!empty($info['owner settings']['preconfigured'])) {
- ctools_include('export');
- $style = ctools_export_crud_new('stylizer');
- $style->name = $info['settings']['name'];
- $style->admin_title = $info['owner settings']['admin_title'];
- $style->admin_description = $info['owner settings']['admin_description'];
- $style->settings = $info['settings'];
- ctools_export_crud_save('stylizer', $style);
- $conf['style'] = $info['settings']['name'];
- if (isset($conf['settings'])) {
- unset($conf['settings']);
- }
- }
- else {
- $conf['style'] = '$';
- $conf['settings'] = $info['settings'];
- }
-
- // Be sure to unset the temporary if the style was just changed.
- if (isset($renderer->cache->style)) {
- unset($renderer->cache->style);
- }
- // $conf was a reference so it should just modify.
- panels_edit_cache_set($renderer->cache);
-
- $renderer->commands[] = ctools_modal_command_dismiss();
-
- if ($type == 'pane') {
- $renderer->command_update_pane($pid);
- }
- else if ($type == 'region') {
- $renderer->command_update_region_links($pid);
- }
- else {
- $renderer->command_update_display_links();
- }
- }
- else {
- $renderer->commands = $output;
- }
-}
-
-
-/**
- * The form for determining if a pane should create a local style or a
- * preconfigured style.
- */
-function panels_stylizer_edit_pane_style_form(&$form, &$form_state) {
- if (!user_access('administer panels styles') || !module_exists('stylizer')) {
- return;
- }
- ctools_include('dependent');
-
- $settings = $form_state['owner info']['owner settings'];
- $form['panels']['admin_title'] = array(
- '#type' => 'textfield',
- '#title' => t('Administrative title'),
- '#description' => t('The name of this style. This will appear in the administrative interface to easily identify it.'),
- '#default_value' => $settings['admin_title'],
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-preconfigured' => array(1)),
- );
-
- $form['panels']['name'] = array(
- '#type' => 'textfield',
- '#title' => t('Machine name'),
- '#description' => t('The machine readable name of this page. It must be unique, and it must contain only alphanumeric characters and underscores. Once created, you will not be able to change this value!'),
- '#default_value' => $settings['name'],
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-preconfigured' => array(1)),
- );
-
- $form['panels']['admin_description'] = array(
- '#type' => 'textarea',
- '#title' => t('Administrative description'),
- '#description' => t('A description of what this style is, does or is for, for administrative use.'),
- '#default_value' => $settings['admin_description'],
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-preconfigured' => array(1)),
- );
-
- // Add the checkbox, set the weight early
- $form['panels']['preconfigured'] = array(
- '#type' => 'checkbox',
-