summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2011-05-04 20:19:14 (GMT)
committer Earl Miles2011-05-04 20:19:14 (GMT)
commit3e8d0c4318e59adfb7f8c4e3b182ba7e824cb90c (patch)
treee7d8222e4f80b608bcbd90e4839ee296e788fbee
parentea3cce2143622c81da19407c8f3630a33202fd2d (diff)
Emptying master branch.master
-rw-r--r--CHANGELOG.txt25
-rw-r--r--README.txt210
-rw-r--r--panels_everywhere.admin.inc131
-rw-r--r--panels_everywhere.info6
-rw-r--r--panels_everywhere.module421
-rw-r--r--panels_everywhere.pages_default.inc206
-rw-r--r--plugins/access/managed_page.inc0
-rw-r--r--plugins/arguments/managed_page.inc31
-rw-r--r--plugins/arguments/page_content.inc48
-rw-r--r--plugins/content_types/page_content.inc49
-rw-r--r--plugins/content_types/pane_header.inc33
-rw-r--r--plugins/content_types/pane_messages.inc33
-rw-r--r--plugins/content_types/pane_navigation.inc28
-rw-r--r--plugins/contexts/managed_page.inc37
-rw-r--r--plugins/contexts/page_content.inc37
-rw-r--r--plugins/tasks/site_template.inc227
-rw-r--r--theme/page.tpl.php17
-rw-r--r--theme/pane-header.tpl.php46
-rw-r--r--theme/pane-messages.tpl.php22
-rw-r--r--theme/pane-navigation.tpl.php39
-rw-r--r--theme/theme.inc27
21 files changed, 1 insertions, 1672 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
deleted file mode 100644
index b52f152..0000000
--- a/CHANGELOG.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Changelog for Panels Everywhere
-Panels Everywhere -dev
- o Take advantage of changes in CTools to allow Panels Everywhere to get more context.
- o #885848: Better communication with the theme when a site template is in use. See README.txt.
- o #872260 by NigelCunningham: Allow Panels Everywhere page template takeover on a per theme basis.
-
-Panels Everywhere 1.1 (2010-Jul-26)
- o Don't use so many tokens when rendering page elements.
- o #784812: Don't override module page preprocesses so harshly.
- o #805180: Allow pages to select their template directly rather than going through variant rules. Works only with CTools 1.5.
- o Make sure the "Edit panel" tab says "Edit site template" for the site template. Works only with CTools 1.7.
-
-Panels Everywhere 1.0 (2010-Feb-01)
- o #680834: theme.inc include gets lost in theme registry due to Drupal bug. Include theme.inc automatically to compensate.
- o Add a checkbox to allow the admin theme to get Panels Everywhere applied separately.
-
-Panels Everywhere 1.0-beta1
- o Initial commit to CVS
- o #674222: README.txt missed "engine = phptemplate" line for the blank.info -- this is needed so the blank theme can have templates.
- o Make sure that page manager edit screens are NOT run through layouts in case of catastrophic configuration of the site_template.
- o #679206: Using the setting to hide Drupal blocks/regions would cause theme('page') to loop infinitely resulting in either bad HTML or whitescreens.
- o Add some descriptive info text to the content types we offer to help introduce people to what will be IN the content and how they can theme them.
- o Update the README to include instructions on setting the page title to set from the page content pane.
- o Breadcrumb did not display properly in pane navigation due to error in theme.inc
- o #679252: Create a sample variant and include it with Panels Everywhere, with an easy setting to make it go away after it is no longer needed. \ No newline at end of file
diff --git a/README.txt b/README.txt
index b0df589..6ea10b8 100644
--- a/README.txt
+++ b/README.txt
@@ -1,209 +1 @@
-
-Panels Everywhere is an advanced method to completely do away with Drupal's
-restrictive blocks system and instead use the much more freeing Panels Layout
-system to control how your pages look. Panels Everywhere modifies the page as
-it is being rendered to 'wrap' the content in a display and can even take
-over your page theme to do away with the need for a page.tpl.php.
-
-Doing this requires that you set up a few things properly, because Drupal is
-not really designed for this kind of behavior.
-
-Getting Started
-===============
-
-Be sure that you have a version of Chaos Tools Suite newer than 12-28-2009 --
-this is either the current -dev or CTools 1.3 if it is out. At the time of
-this writing, CTools 1.3 has not yet been released, so you will need to use
-a -dev version (or from CVS).
-
-Step 1
-------
-
-First, back up your site database, just in case. This will make it easy to
-completely revert if you decide that Panels Everywhere is not for you. It
-is also recommended that you first experiment with this on a small test site
-so that you can get a feel for the effects this will have. Sites are best
-built from the ground up on Panels Everywhere. Converting an existing site
-may be quite difficult.
-
-Step 2
-------
-Enable Panels Everywhere. If not using UID 1, be sure the user you're using
-has 'administer page manager' privileges.
-
-Navigate to Administer >> Site building >> Panels >> Settings >> Everywhere.
-
-Check the box to enable the site template.
-
-Check the box to enable the sample variant.
-
-You may check the box to override the page template, but only if you either
-enable the sample variant, or have already created a site template variant
-to handle page duties.
-
-Step 3
-------
-Navigate to Administer >> Site Building >> Pages and edit the site_template
-(Default site template) page.
-
-Edit your new variant. Customize it if you like. There are some very
-important parts of this sample variant:
-
- o The "Page content" pane is absolutely critical. That is the pane that
- will hold the actual content of the page you are looking at. If this
- pane does not exist, *no content will be rendered*, only the page
- template. Think of this as being the $content variable in your
- page.tpl.php -- you need that and cannot live without it.
-
- o The "Title type" is set to "From pane" and the Page content pane is
- selected as the title. (That is why that pane has a thicker border).
- This is how the title of the content gets to be the title of the
- page.
-
- o The Navigation, Header and Messages panes are conveniences that
- group common page navigation together. For customized sites it is
- highly likely that you will theme these or do away with them and
- use the individual pieces.
-
-
-Step 4
-------
-You might also consider creating a completely blank theme, because existing
-themes will have CSS that expects different markup. To create a blank theme:
-
-1) mkdir sites/all/themes/blank
-2) Create the following five lines in a file named blank.info:
-
-name = Blank
-description = Blank
-core = 6.x
-stylesheets[all][] = blank.css
-engine = phptemplate
-
-3) Visit Administer >> Site building >> Themes and change your theme to the
- blank theme.
-
-Step 5
-------
-
-You can add additional variants and easily section off your site by using
-the selection rules. In particular, there are two selection rules you should
-be interested in:
-
-o You can easily add a String: comparison selection rule and write regular
- expressions against the URL to use that.
-
-o You can use the Context exists selection rule using the "Managed page"
- context. By using this, you can force the site_template to not run on
- actual Page Manager pages and use the site_template only as a wrapper
- for non Page Manager content. If you do this, you need to make sure that
- your other pages contain all the navigation they need.
-
-Extras
-======
-
-For best results, customized layouts are the way to go. They can include as
-much or as little of the page template as you need, and are easily selectable.
-When you customize a layout, if it will be heavily styled, it is recommended
-that you provide a separate admin layout (in the layout.inc there are
-'admin theme' and 'admin css' settings) to provide a less styled layout for
-the purposes of editing. This will be critical to keep the editing UI from
-getting too messy.
-
-The navigation, header and messages blocks can be easily customized by copying
-the appropriate pane-*.tpl.php files from the themes directory to your theme,
-changing them, and clearing cache. If you need to add additional variables,
-look at the theme.inc file. You can create similar preprocess functions in
-your template.php. The token function can accept any variable that would
-normally appear in your page.tpl.php.
-
-You can easily add more variants and use the regular expressions in the
-String: comparison selection rules to change which display gets used based on
-the URL. You can also use the "Context: exists" selection rule to provide
-default panels only for content that is not already in a panel by checking to
-see if the "Managed page" context exists.
-
-If you have a lot of different site templates or pages that include their own
-navigation, you can also consider using Mini Panels to create common navigation
-sidebars for easier maintenance.
-
-Contexts
-========
-
-Your site template will now attempt to find contexts from the environment as
-best as it can. It handles all of the default Drupal locations, and if using
-a Page Manager page it can do some inheritance.
-
-Currently Panels Everywhere can find the following contexts:
- o url: The internal URL of the page.
-
- o alias: The alias of the page. Most of the time this is the URL actually
- visited, but beware that if the page has multiple aliases, it will
- be the *first* alias Drupal finds. i.e, if foo has aliases of 'bar'
- and 'baz', when visiting 'bar' or 'baz' the alias will always appear
- as 'bar' because it comes first in the list.
- o user: The logged in user.
-
- o node: The node being viewed. If visiting node/% or if visiting a page
- manager page that contains a node context, that node will be used.
- If the page manager page has multiple node contexts (due to
- relationships or multiple nid arguments) only the first node will
- appear in context.
-
- o account: A user context for the user being viewed. Will appear on profile
- pages and on any page manager page with a user context (not
- counting the logged in user.)
-
- o term: The taxonomy term being viewed if on a taxonomy term page. This
- won't work if viewing multiple terms (i.e, taxonomy/term/1,2) unless
- using a page manager page that derives a single term context.
-
-In addition, before this is actually utilized you can use
-hook_panels_everywhere_contexts(&$contexts, $placeholders).
-
-If you add contexts, use this function:
- panels_everywhere_site_template_add_context($contexts, $context, t('Human readable identifier'), 'keyword', 'internalid');
-
-If $placeholders is TRUE, create your context using
-ctools_context_create_empty('type'); if $placeholders is FALSE, create
-your context using ctools_context_create('type', $object). If no object
-exists, create it as an empty context. It is important that an empty context
-appears even if there is not an object to keep the UI consistent.
-
-Making Panels Everywhere aware themes
-=====================================
-
-To make a theme PE aware, all that really matters is to provide a default site
-template that matches what the theme's page.tpl.php should be. To do this,
-create a site template in your site. Export the handler via the bulk export
-mechanism. Edit your .info file to contain these lines:
-
-; We provide default page manager pages for our site template
-api[page_manager][pages_default][version] = 1
-api[page_manager][pages_default][path] = pages
-
-The bulk export will give you a .pages_default.inc file -- just place that in
-the 'pages' directory. Your new site template should be immediately available.
-
-It's a very good idea to add a 'selection criteria' so that this template will
-only activate when your theme is the active theme.
-
-You can also give your theme a hybrid mode where it will be smart and use its
-normal page.tpl.php if the site_template is not in use, and use a stripped
-down page.tpl.php if it is. Place the following code in your theme (chances
-are you already have a preprocess page).
-
- function MYTHEME_preprocess_page(&$vars) {
- if (!empty($vars['panels_everywhere_site_template'])) {
- $vars['template_file'] = 'page-panels-everywhere';
- }
- }
-
-Then copy panels_everywhere/theme/page.tpl.php to
-page-panels-everywhere.tpl.php in your theme. Once this is done, your theme
-will play nice with Panels Everywhere even if the option to take over the
-page template is not enabled.
-
-There is rather a lot of information available via this variable if you like.
-The actual template used will be in $vars['panels_everywhere_site_template']['handler']
-and the contexts will be in $vars['panels_everywhere_site_template']['contexts'].
+master branch is unused. Please see versioned branches instead.
diff --git a/panels_everywhere.admin.inc b/panels_everywhere.admin.inc
deleted file mode 100644
index e8d9a95..0000000
--- a/panels_everywhere.admin.inc
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains administrative pages for the Panels Everywhere module.
- */
-
-function panels_everywhere_settings_page() {
- $form = array();
-
- ctools_include('dependent');
- $form['panels_everywhere_site_template_enabled'] = array(
- '#title' => t('Enable Panels Everywhere site template'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_site_template_enabled', FALSE),
- '#description' => t('This will enable a page in the page manager pages list that allows you to "wrap" any page in a panels display. You may use variants on that page to check site data such as the URL and apply wrappers selectively.'),
- );
- $form['panels_everywhere_site_template_enabled_admin'] = array(
- '#title' => t('Enable Panels Everywhere site template for the admin theme'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_site_template_enabled_admin', FALSE),
- '#description' => t('This will also enable the site template for your admin theme. Note that if your admin theme is the same as your site theme, the site_template will be used regardless of this setting. If you do not wish to use the site_template with your admin theme, you must select a different admin theme at administer >> site configuration >> administration theme.'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-site-template-enabled' => array(1)),
- );
-/* @todo
- $form['panels_everywhere_override_blocks'] = array(
- '#title' => t('Override the blocks administration page'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_override_blocks', FALSE),
- '#description' => t('If checked, the standard Drupal block administration page will be replaced with the site template page manager page.'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-site-template-enabled' => array(1)),
- );
-*/
-
- $form['panels_everywhere_provide_sample'] = array(
- '#title' => t('Provide a sample variant for the site template'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_provide_sample', FALSE),
- '#description' => t('If checked, the site template in the page administration will come with a sample variant pre-created with the minimal options, to help get you started faster. It is recommended you use this on a new installation, and once you are comfortable with Panels Everywhere, you can turn this off again to get it out of the way.'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-site-template-enabled' => array(1)),
- );
-
- $form['panels_everywhere_override_page_tpl'] = array(
- '#title' => t('Override the page template'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_override_page_tpl', FALSE),
- '#description' => t('If checked, the page.tpl.php file and preprocess functions in your theme will not be used. Instead the simplified page.tpl.php provided by Panels Everywhere will be used. This is recommended once you have your site templates set up, unless you actually need to have more control over the final page template. <strong>Note that for safety reasons, editing the site_template page will always happen in the default page.tpl.php just in case your site template is not valid.</strong>'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-site-template-enabled' => array(1)),
- );
- $form['panels_everywhere_site_template_per_theme'] = array(
- '#title' => t('Enable Panels Everywhere site template on a per-theme basis'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_site_template_per_theme', FALSE),
- '#description' => t('This setting lets you choose which themes are overridden by Panels Everywhere.'),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-override-page-tpl' => array(1),
- 'edit-panels-everywhere-site-template-enabled' => array(1)),
- '#dependency_count' => 2,
- );
-
- $themes = system_theme_data();
- uasort($themes, 'panels_everywhere_sort_themes_by_info_name');
- foreach ($themes as $theme) {
- $form['panels_everywhere_override_theme_' . $theme->name] = array(
- '#type' => 'checkbox',
- '#title' => t($theme->info['name']),
- '#default_value' => variable_get('panels_everywhere_override_theme_' . $theme->name, FALSE),
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-override-page-tpl' => array(1),
- 'edit-panels-everywhere-site-template-enabled' => array(1),
- 'edit-panels-everywhere-site-template-per-theme' => array(1)),
- '#dependency_count' => 3
- );
- }
-
- $form['head_title'] = array(
- '#type' => 'fieldset',
- '#title' => t('Head title'),
- '#description' => t('The head title is the version of the site title that the browser places in the title bar.'),
- '#input' => TRUE,
- '#process' => array('ctools_dependent_process'),
- '#dependency' => array('edit-panels-everywhere-override-page-tpl' => array(1)),
- '#id' => 'edit-head-title',
- '#prefix' => '<div id="edit-head-title-wrapper">',
- '#suffix' => '</div>',
- );
-
- $form['head_title']['panels_everywhere_head_title_include_name'] = array(
- '#title' => t('Include the site name'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_head_title_include_name', TRUE),
- );
-
- $form['head_title']['panels_everywhere_head_title_include_slogan'] = array(
- '#title' => t('Use site slogan if there is no page title'),
- '#type' => 'checkbox',
- '#default_value' => variable_get('panels_everywhere_head_title_include_slogan', TRUE),
- );
-
- $form['head_title']['panels_everywhere_head_title_separator'] = array(
- '#title' => t('Separator'),
- '#type' => 'textfield',
- '#default_value' => variable_get('panels_everywhere_head_title_separator', ' | '),
- );
-
- $form['#submit'][] = 'panels_everywhere_settings_page_submit';
- return system_settings_form($form);
-}
-
-function panels_everywhere_settings_page_submit(&$form, &$form_state) {
- if (empty($form_state['values']['panels_everywhere_site_template_enabled'])) {
- // Automatically unset dependencies.
- $form_state['values']['panels_everywhere_override_blocks'] = FALSE;
- $form_state['values']['panels_everywhere_override_page_tpl'] = FALSE;
- }
- if (empty($form_state['values']['panels_everywhere_override_page_tpl'])) {
- $form_state['values']['panels_everywhere_site_template_per_theme'] = FALSE;
- }
-}
-
-/**
- * Array sorting callback; sorts modules or themes by their name.
- */
-function panels_everywhere_sort_themes_by_info_name($a, $b) {
- return strcasecmp($a->info['name'], $b->info['name']);
-}
-
diff --git a/panels_everywhere.info b/panels_everywhere.info
deleted file mode 100644
index 88fb090..0000000
--- a/panels_everywhere.info
+++ /dev/null
@@ -1,6 +0,0 @@
-name = Panels everywhere
-description = Allow your site to use Panels instead of Blocks to lay out your pages.
-package = "Panels"
-dependencies[] = panels
-dependencies[] = page_manager
-core = 6.x \ No newline at end of file
diff --git a/panels_everywhere.module b/panels_everywhere.module
deleted file mode 100644
index 8e3c3b6..0000000
--- a/panels_everywhere.module
+++ /dev/null
@@ -1,421 +0,0 @@
-<?php
-
-/**
- * @file panels_everywhere.module
- *
- * This module overrides the page theme to allow Panels to be used on all pages.
- */
-
-/**
- * Implementation of hook_menu().
- */
-function panels_everywhere_menu() {
- $items = array();
-
- $items['admin/build/panels/settings/everywhere'] = array(
- 'title' => 'Everywhere',
- 'file' => 'panels_everywhere.admin.inc',
- 'page callback' => 'drupal_get_form',
- 'access arguments' => array('administer page manager'),
- 'page arguments' => array('panels_everywhere_settings_page'),
- 'type' => MENU_LOCAL_TASK,
- );
- if (variable_get('panels_everywhere_site_template_enabled', FALSE)) {
- $items['admin/build/pages/site_template'] = array(
- 'title' => 'Edit site template',
- 'page callback' => 'panels_everywhere_edit_site_template',
- 'type' => MENU_LOCAL_TASK,
- 'access arguments' => array('use page manager'),
- );
- }
-
- return $items;
-}
-
-/**
- * Implementation of hook_theme()
- */
-function panels_everywhere_theme() {
- $theme = array();
- $path = drupal_get_path('module', 'panels_everywhere') . '/theme';
- $base = array(
- 'file' => 'theme.inc',
- 'path' => $path,
- );
- $theme['pane_header'] = array(
- 'arguments' => array(),
- 'template' => 'pane-header',
- ) + $base;
- $theme['pane_messages'] = array(
- 'arguments' => array(),
- 'template' => 'pane-messages',
- ) + $base;
- $theme['pane_navigation'] = array(
- 'arguments' => array(),
- 'template' => 'pane-navigation',
- ) + $base;
-
- return $theme;
-}
-
-/**
- * Implementation of hook_ctools_plugin_directory()
- */
-function panels_everywhere_ctools_plugin_directory($module, $plugin) {
- if ($module == 'page_manager' || $module == 'ctools') {
- return 'plugins/' . $plugin;
- }
-}
-
-function panels_everywhere_should_override_theme() {
- if (!variable_get('panels_everywhere_override_page_tpl', FALSE))
- return FALSE;
-
- if (!variable_get('panels_everywhere_site_template_per_theme', FALSE))
- return TRUE;
-
- global $theme;
- return variable_get('panels_everywhere_override_theme_' . $theme, FALSE);
-}
-
-/**
- * Implementation of hook_theme_registry_alter()
- *
- * This is the magic of this module, which allows us to completely override
- * how pages are output.
- */
-function panels_everywhere_theme_registry_alter($registry) {
- if (!panels_everywhere_should_override_theme())
- return;
-
- // Test to see if we should exclude the administrative theme.
- if (!variable_get('panels_everywhere_site_template_enabled_admin', FALSE)) {
- global $theme;
- $admin_theme = variable_get('admin_theme', '0');
- if ($admin_theme && $admin_theme == $theme) {
- return;
- }
- }
-
- $registry['original page'] = $registry['page'];
- // If we've been set to override the page template, we completely override it:
- $registry['page']['template'] = 'page';
- $registry['page']['type'] = 'module';
- $registry['page']['path'] = drupal_get_path('module', 'panels_everywhere') . '/theme';
- $registry['page']['theme path'] = $registry['page']['path'];
- $registry['page']['theme paths'] = array(
- drupal_get_path('module', 'system'),
- $registry['page']['path'],
- );
- $registry['page']['preprocess functions'] = array(
- 'panels_everywhere_page_preprocess',
- 'template_preprocess',
- 'panels_everywhere_page_preprocess_elements',
- );
-
- // Let modules continue to do their thing
- foreach (module_implements('preprocess') as $module) {
- $registry['page']['preprocess functions'][] = $module . '_preprocess';
- }
- foreach (module_implements('preprocess_page') as $module) {
- if ($module != 'ctools') {
- $registry['page']['preprocess functions'][] = $module . '_preprocess_page';
- }
- }
-
- // CTools wants to be last
- $registry['page']['preprocess functions'][] = 'ctools_preprocess_page';
-}
-
-/**
- * Page preprocess to run the page content into our site template task.
- *
- * This is NOT named by the normal rules because this is not picked up
- * automatically. It is controlled by an alter so that it can come first.
- */
-function panels_everywhere_page_preprocess(&$vars) {
- // For safety reasons, do not run this on the actual page configuration
- // pages and instead allow a more traditional output.
- if (strpos($_GET['q'], 'admin/build/pages/nojs/operation/site_template') === 0) {
- return panels_everywhere_fallback_page($vars);
- }
- if (strncmp($_GET['q'], 'admin/build/pages/site_template', 21) == 0) {
- return panels_everywhere_fallback_page($vars);
- }
-
- $task = page_manager_get_task('site_template');
-
- $content = new stdClass();
- $content->title = drupal_get_title();
- $content->content = $vars['content'];
-
- // Load the node into a context.
- ctools_include('context');
- ctools_include('context-task-handler');
-
- $page = page_manager_get_current_page();
- if (version_compare(CTOOLS_API_VERSION, 1.8, '<')) {
- $args = array($_GET['q'], $content, $page);
- }
- else {
- $args = array($content);
- }
-
- $contexts = ctools_context_handler_get_task_contexts($task, '', $args);
-
- // Test to see if a site template has been specifically assigned to the
- // current page. If so, render that variant just as though
- // it were rendered by the access checker.
- if ($handler_name = panels_everywhere_get_site_template()) {
- // This is the "no template" variant meaning we do absolutely nothing here.
- if ($handler_name == -1) {
- return;
- }
-
- $handler = page_manager_load_task_handler($task, '', $handler_name);
- if ($handler && ($function = page_manager_get_renderer($handler))) {
- // Render this with $test == FALSE to make it skip access checking.
- if ($info = $function($handler, $contexts, $args, FALSE)) {
- drupal_alter('ctools_render', $info, $page, $args, $contexts, $task, '', $handler);
- }
- }
- }
-
- // If there is no $info, meaning the above had no template or the template
- // chose not to render, go through the normal process for finding one.
- if (empty($info)) {
- // Since we're inside theme('page') we must call ctools_context_handler_render as though
- // we don't own the page, because crazy as it sounds, we don't.
- $info = ctools_context_handler_render($task, '', $contexts, $args, FALSE);
- }
-
- if ($info && !empty($info['content'])) {
- // Because we run so early, we have to use drupal_set_title() and not
- // just set $vars['title']. Otherwise it will get overwritten.
- if (isset($info['title'])) {
- drupal_set_title($info['title']);
- }
- $vars['content'] = $info['content'];
- if (!empty($info['no_blocks'])) {
- $vars['show_blocks'] = FALSE;
- }
-
- $vars['panels_everywhere_site_template'] = array(
- 'name' => 'site_template',
- 'task' => $task,
- 'subtask' => '',
- 'contexts' => $contexts,
- 'arguments' => $args,
- 'handler' => $info['handler'],
- );
- }
-}
-
-function panels_everywhere_fallback_page(&$vars) {
- if (!panels_everywhere_should_override_theme()) {
- print theme('original page', $vars['content'], $vars['show_blocks'], $vars['show_messages']);
- // There's no easy way to short circuit the rest of our processing, and
- // this is a pretty rare case anyway, so just do it.
- module_invoke_all('exit');
- exit;
- }
-}
-
-/**
- * Manually set the template to use.
- *
- * This can be used to force the page to use the specified template rather
- * than going through the access rules.
- *
- * @param $handler
- * The name of the task handler to use.
- */
-function panels_everywhere_set_site_template($handler) {
- $store = &ctools_static('panels_everywhere_site_template');
- $store = $handler;
-}
-
-/**
- * Get the site template to be used.
- *
- * If the site template has been manually set via
- * panels_everywhere_set_site_template(), this function will return what it
- * was set to.
- */
-function panels_everywhere_get_site_template() {
- return ctools_static('panels_everywhere_site_template');
-}
-
-/**
- * Preprocess variables on our stripped down page template.
- *
- * Since when we take over the page rendering mechanism, we cut core's
- * page preprocessing out of the loop, we need to replace it with our
- * own stripped down version to do just the minimum.
- */
-function panels_everywhere_page_preprocess_elements(&$variables) {
- // Add favicon
- if (theme_get_setting('toggle_favicon')) {
- drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
- }
-
- // @todo add a settings form to control the following parts of this:
- // separator
- // use site name in title
- // use slogan in title
- // Construct page title
-
- $head_title = array();
- $page_title = drupal_get_title();
- if ($page_title) {
- $head_title[] = strip_tags($page_title);
- }
-
- if (variable_get('panels_everywhere_head_title_include_name', TRUE)) {
- $head_title[] = strip_tags(variable_get('site_name', 'Drupal'));
- }
-
- if (!$page_title && variable_get('panels_everywhere_head_title_include_slogan', TRUE)) {
- $head_title[] = strip_tags(variable_get('site_slogan', ''));
- }
-
- $variables['head_title'] = implode(variable_get('panels_everywhere_head_title_separator', ' | '), $head_title);
- $variables['base_path'] = base_path();
- $variables['front_page'] = url();
- $variables['head'] = drupal_get_html_head();
- $variables['css'] = drupal_add_css();
- $variables['styles'] = drupal_get_css();
- $variables['scripts'] = drupal_get_js();
- $variables['language'] = $GLOBALS['language'];
- $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
-
- // Closure should be filled last.
- $variables['closure'] = theme('closure');
-}
-
-/**
- * Implementation of hook_ctools_plugin_api().
- */
-function panels_everywhere_ctools_plugin_api($module, $api) {
- if (variable_get('panels_everywhere_provide_sample', FALSE) && $module == 'page_manager' && $api == 'pages_default') {
- return array('version' => 1);
- }
-}
-
-/**
- * Drupal has a bug that causes theme file includes to get lost. However,
- * it is really convenient to have preprocess functions separated out
- * so that they 1) don't load code when unnecessary and 2) are easy to
- * find for non-developers.
- *
- * Until this bug http://drupal.org/node/591804 is fixed, we must have
- * this include.
- */
-function panels_everywhere_init() {
- ctools_include('theme', 'panels_everywhere', 'theme');
-}
-
-/**
- * Callback to edit our site template.
- *
- * This is just a pass-through that allows us to add a special tab to make
- * it easier to edit the site template.
- */
-function panels_everywhere_edit_site_template() {
- ctools_include('context');
- ctools_include('page_manager.admin', 'page_manager', '');
- return page_manager_edit_page(page_manager_get_page_cache('site_template'));
-}
-
-/**
- * Alter the panel context settings form
- */
-function panels_everywhere_page_manager_variant_operations_alter(&$operations, $handler) {
- // Do not add this to variants on the site template, as tempaltes
- // cannot select templates.
- if ($handler->task == 'site_template') {
- return;
- }
-
- // Use this obnoxious construct to safely insert our item.
- reset($operations['children']);
- $new = array();
- while (list($key, $value) = each($operations['children'])) {
- $new[$key] = $value;
- if ($key == 'summary') {
- $new['panels_everywhere'] = array(
- 'title' => t('Template'),
- 'description' => t('Choose which site template to use for this page.'),
- 'form' => 'panels_everywhere_variant_template',
- );
- }
- }
- $operations['children'] = $new;
-}
-
-/**
- * Get a list of variants on the site template that can be used to select.
- */
-function panels_everywhere_get_site_templates() {
- $task = page_manager_get_task('site_template');
- $handlers = page_manager_load_sorted_handlers($task, '');
-
- $templates = array();
- foreach ($handlers as $id => $handler) {
- $plugin = page_manager_get_task_handler($handler->handler);
- $templates[$id] = page_manager_get_handler_title($plugin, $handler, $task, '');
- }
-
- return $templates;
-}
-
-/**
- * Handle the form to add a template setting to any variant.
- */
-function panels_everywhere_variant_template(&$form, &$form_state) {
- $handler = $form_state['handler'];
- $templates = panels_everywhere_get_site_templates();
-
- $defaults = array(
- '' => t('- Let the system choose -'),
- '-1' => t('- No template -'),
- );
-
- // We can use simple array addition because the default values are not valid
- // so no worries about collisions.
-
- $options = $defaults + $templates;
- if (empty($handler->conf['panels_everywhere_site_template'])) {
- $handler->conf['panels_everywhere_site_template'] = '';
- }
-
- $form['panels_everywhere_site_template'] = array(
- '#type' => 'select',
- '#title' => t('Site template'),
- '#default_value' => $handler->conf['panels_everywhere_site_template'],
- '#options' => $options,
- );
-}
-
-/**
- * Store the template for this page, if we have one.
- */
-function panels_everywhere_variant_template_submit(&$form, &$form_state) {
- $form_state['handler']->conf['panels_everywhere_site_template'] = $form_state['values']['panels_everywhere_site_template'];
-}
-
-/**
- * When a Page Manager page is rendered, set the selected site template
- * if it has been chosen.
- */
-function panels_everywhere_ctools_render_alter($info, $page, $args, $contexts, $task, $subtask, $handler) {
- if ($task['name'] == 'site_template') {
- // Make sure the handler actually used is available later on.
- $info['handler'] = $handler;
- return;
- }
-
- if (!empty($handler->conf['panels_everywhere_site_template'])) {
- panels_everywhere_set_site_template($handler->conf['panels_everywhere_site_template']);
- }
-}
diff --git a/panels_everywhere.pages_default.inc b/panels_everywhere.pages_default.inc
deleted file mode 100644
index 62ae107..0000000
--- a/panels_everywhere.pages_default.inc
+++ /dev/null
@@ -1,206 +0,0 @@
-<?php
-
-/**
- * @file
- * Bulk export of pages_default objects generated by Bulk export module.
- */
-
-/**
- * Implementation of hook_default_page_manager_handlers()
- */
-function panels_everywhere_default_page_manager_handlers() {
- $handler = new stdClass;
- $handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
- $handler->api_version = 1;
- $handler->name = 'site_template_panel_context';
- $handler->task = 'site_template';
- $handler->subtask = '';
- $handler->handler = 'panel_context';
- $handler->weight = 0;
- $handler->conf = array(
- 'title' => 'Sample variant',
- 'no_blocks' => 1,
- 'css_id' => '',
- 'css' => '',
- 'contexts' => array(),
- 'relationships' => array(),
- 'access' => array(
- 'plugins' => array(),
- 'logic' => 'and',
- ),
- );
- $display = new panels_display;
- $display->layout = 'flexible';
- $display->layout_settings = array(
- 'items' => array(
- 'canvas' => array(
- 'type' => 'row',
- 'contains' => 'column',
- 'children' => array(
- '0' => 'main',
- ),
- 'parent' => NULL,
- ),
- 'main' => array(
- 'type' => 'column',
- 'width' => 100,
- 'width_type' => '%',
- 'children' => array(
- '0' => 1,
- '1' => 'main-row',
- ),
- 'parent' => 'canvas',
- ),
- 'main-row' => array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array(
- '0' => 'content',
- '1' => 'sidebar',
- ),
- 'parent' => 'main',
- ),
- 'content' => array(
- 'type' => 'region',
- 'title' => 'Content',
- 'width' => '100',
- 'width_type' => '%',
- 'parent' => 'main-row',
- 'class' => '',
- ),
- 'sidebar' => array(
- 'type' => 'region',
- 'title' => 'Sidebar',
- 'width' => '200',
- 'width_type' => 'px',
- 'parent' => 'main-row',
- ),
- '1' => array(
- 'type' => 'row',
- 'contains' => 'region',
- 'children' => array(
- '0' => 'header',
- ),
- 'parent' => 'main',
- ),
- 'header' => array(
- 'type' => 'region',
- 'title' => 'Header',
- 'width' => 100,
- 'width_type' => '%',
- 'parent' => '1',
- ),
- ),
- );
- $display->panel_settings = array();
- $display->cache = array();
- $display->title = '';
- $display->hide_title = PANELS_TITLE_PANE;
- $display->title_pane = 'new-2';
- $display->content = array();
- $display->panels = array();
- $pane = new stdClass;
- $pane->pid = 'new-1';
- $pane->panel = 'content';
- $pane->type = 'pane_messages';
- $pane->subtype = 'pane_messages';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array();
- $pane->cache = array();
- $pane->style = array();
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 0;
- $display->content['new-1'] = $pane;
- $display->panels['content'][0] = 'new-1';
- $pane = new stdClass;
- $pane->pid = 'new-2';
- $pane->panel = 'content';
- $pane->type = 'page_content';
- $pane->subtype = 'page_content';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array(
- 'context' => 'argument_page_content_1',
- 'override_title' => 1,
- 'override_title_text' => '',
- );
- $pane->cache = array();
- $pane->style = array();
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 1;
- $display->content['new-2'] = $pane;
- $display->panels['content'][1] = 'new-2';
- $pane = new stdClass;
- $pane->pid = 'new-3';
- $pane->panel = 'header';
- $pane->type = 'pane_header';
- $pane->subtype = 'pane_header';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array();
- $pane->cache = array();
- $pane->style = array();
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 0;
- $display->content['new-3'] = $pane;
- $display->panels['header'][0] = 'new-3';
- $pane = new stdClass;
- $pane->pid = 'new-4';
- $pane->panel = 'header';
- $pane->type = 'pane_navigation';
- $pane->subtype = 'pane_navigation';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array();
- $pane->cache = array();
- $pane->style = array();
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 1;
- $display->content['new-4'] = $pane;
- $display->panels['header'][1] = 'new-4';
- $pane = new stdClass;
- $pane->pid = 'new-5';
- $pane->panel = 'sidebar';
- $pane->type = 'block';
- $pane->subtype = 'user-0';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array(
- 'override_title' => 0,
- 'override_title_text' => '',
- );
- $pane->cache = array();
- $pane->style = array();
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 0;
- $display->content['new-5'] = $pane;
- $display->panels['sidebar'][0] = 'new-5';
- $pane = new stdClass;
- $pane->pid = 'new-6';
- $pane->panel = 'sidebar';
- $pane->type = 'block';
- $pane->subtype = 'user-1';
- $pane->shown = TRUE;
- $pane->access = array();
- $pane->configuration = array(
- 'override_title' => 0,
- 'override_title_text' => '',
- );
- $pane->cache = array();
- $pane->style = array();
- $pane->css = array();
- $pane->extras = array();
- $pane->position = 1;
- $display->content['new-6'] = $pane;
- $display->panels['sidebar'][1] = 'new-6';
- $handler->conf['display'] = $display;
- $handlers['site_template_panel_context'] = $handler;
-
- return $handlers;
-}
diff --git a/plugins/access/managed_page.inc b/plugins/access/managed_page.inc
deleted file mode 100644
index e69de29..0000000
--- a/plugins/access/managed_page.inc
+++ /dev/null
diff --git a/plugins/arguments/managed_page.inc b/plugins/arguments/managed_page.inc
deleted file mode 100644
index 30586ae..0000000
--- a/plugins/arguments/managed_page.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/**
- * @file
- *
- * Plugin to provide an argument handler for a raw managed_page
- */
-
-$plugin = array(
- 'title' => t("Managed page"),
- // keyword to use for %substitution
- 'keyword' => 'page',
- 'description' => t('A hidden argument that can be used to get the page content as a context.'),
- 'context' => 'panels_everywhere_managed_page_context',
- 'no ui' => TRUE,
-);
-
-/**
- * Discover if this argument gives us the term we crave.
- */
-function panels_everywhere_managed_page_context($arg = NULL, $conf = NULL, $empty = FALSE) {
- // If unset it wants a generic, unfilled context.
- if ($empty) {
- return ctools_context_create_empty('managed_page');
- }
-
- $context = ctools_context_create('managed_page', $arg);
- $context->original_argument = $arg;
-
- return $context;
-}
diff --git a/plugins/arguments/page_content.inc b/plugins/arguments/page_content.inc
deleted file mode 100644
index 74d70f8..0000000
--- a/plugins/arguments/page_content.inc
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-/**
- * @file
- *
- * Plugin to provide an argument handler for a raw page_content
- */
-
-$plugin = array(
- 'title' => t("Page content"),
- // keyword to use for %substitution
- 'keyword' => 'page_content',
- 'description' => t('A hidden argument that can be used to get the page content as a context.'),
- 'context' => 'panels_everywhere_page_content_context',
- 'placeholder form' => array(
- '#type' => 'fieldset',
- 'title' => array(
- '#title' => t('Page title'),
- '#type' => 'textfield',
- '#default_value' => t('Dummy page title'),
- ),
- 'content' => array(
- '#title' => t('Page content'),
- '#type' => 'textarea',
- '#default_value' => '<p>' . t('Dummy page content') . '</p>',
- ),
- ),
- 'no ui' => TRUE,
-);
-
-/**
- * Discover if this argument gives us the term we crave.
- */
-function panels_everywhere_page_content_context($arg = NULL, $conf = NULL, $empty = FALSE) {
- // If unset it wants a generic, unfilled context.
- if ($empty) {
- return ctools_context_create_empty('page_content');
- }
-
- if (is_array($arg)) {
- $arg = (object) $arg;
- }
-
- $context = ctools_context_create('page_content', $arg);
- $context->original_argument = $arg;
-
- return $context;
-}
diff --git a/plugins/content_types/page_content.inc b/plugins/content_types/page_content.inc
deleted file mode 100644
index e1a6476..0000000
--- a/plugins/content_types/page_content.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-/**
- * @file
- * Plugin to handle the 'page_content' content type which allows the
- * mission statement of the site to be embedded into a panel.
- */
-
-$plugin = array(
- 'title' => t('Page content'),
- 'single' => TRUE,
- 'icon' => 'icon_page.png',
- 'description' => t('Page content that is available if the panel is being used to wrap content with the Panels Everywhere module.'),
- 'category' => t('Page elements'),
- 'required context' => new ctools_context_required(t('Page content'), 'page_content'),
-);
-
-/**
- * Output function for the 'page_content' content type.
- *
- * Outputs the mission statement for the site.
- */
-function panels_everywhere_page_content_content_type_render($subtype, $conf, $panel_args, $context) {
- if (empty($context) || empty($context->data)) {
- return;
- }
-
- if (is_string($context->data)) {
- $block = new stdClass();
- $block->title = t('Dummy content');
- $block->content = $context->data;
- return $block;
- }
-
- return $context->data;
-}
-
-/**
- * Returns an edit form for custom type settings.
- */
-function panels_everywhere_page_content_content_type_edit_form(&$form, &$form_state) {
- // provide a blank form so we have a place to have context setting.
-}
-
-function panels_everywhere_page_content_content_type_admin_info($subtype, $conf, $context) {
- $block->title = t('Main page content');
- $block->content = t('This will contain the content of page being viewed. In order to get the page title to be used as a Panel title, it is recommended that you set the "Title type" to "From pane" and then check "Panel title" in the dropdown menu for this pane.');
- return $block;
-}
diff --git a/plugins/content_types/pane_header.inc b/plugins/content_types/pane_header.inc
deleted file mode 100644
index c8ba678..0000000
--- a/plugins/content_types/pane_header.inc
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
- * @file
- * Plugin to handle the 'page' content type which allows the standard page
- * template variables to be embedded into a panel.
- */
-
-$plugin = array(
- 'title' => t('Page header'),
- 'single' => TRUE,
- 'icon' => 'icon_page.png',
- 'description' => t('A general page header block that includes site name, logo and a search box. This can be easily modified by overriding pane-header.tpl.php in your theme.'),
- 'category' => t('Page elements'),
- 'render last' => TRUE,
-);
-
-/**
- * Output function for the 'pane_tabs' content type.
- *
- * Outputs the tabs (local tasks) of the current page.
- */
-function panels_everywhere_pane_header_content_type_render($subtype, $conf, $panel_args) {
- $block = new stdClass();
- $block->content = theme('pane_header');
- return $block;
-}
-
-function panels_everywhere_pane_header_content_type_admin_info($subtype, $conf) {
- $block->title = t('Page header elements');
- $block->content = t('By default, this pane will contain the site name, logo and search box. Its actual contents can be easily themed by editing pane-header.tpl.php in the site theme.');
- return $block;
-}
diff --git a/plugins/content_types/pane_messages.inc b/plugins/content_types/pane_messages.inc
deleted file mode 100644
index 813999c..0000000
--- a/plugins/content_types/pane_messages.inc
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
- * @file
- * Plugin to handle the 'page' content type which allows the standard page
- * template variables to be embedded into a panel.
- */
-
-$plugin = array(
- 'title' => t('Page messages'),
- 'single' => TRUE,
- 'icon' => 'icon_page.png',
- 'description' => t('A general page messages block that includes tabs, messages and help. It is normally placed in the same region as your content. This can be easily modified by overriding pane-messages.tpl.php in your theme.'),
- 'category' => t('Page elements'),
- 'render last' => TRUE,
-);
-
-/**
- * Output function for the 'pane_tabs' content type.
- *
- * Outputs the tabs (local tasks) of the current page.
- */
-function panels_everywhere_pane_messages_content_type_render($subtype, $conf, $panel_messagesrgs) {
- $block = new stdClass();
- $block->content = theme('pane_messages');
- return $block;
-}
-
-function panels_everywhere_pane_messages_content_type_admin_info($subtype, $conf) {
- $block->title = t('Page messages, tabs and help');
- $block->content = t('A general page messages block that includes tabs, messages and help. It is normally placed in the same region as your content. This can be easily modified by overriding pane-messages.tpl.php in your theme.');
- return $block;
-}
diff --git a/plugins/content_types/pane_navigation.inc b/plugins/content_types/pane_navigation.inc
deleted file mode 100644
index be96acc..0000000
--- a/plugins/content_types/pane_navigation.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
- * @file
- * Plugin to handle the 'page' content type which allows the standard page
- * template variables to be embedded into a panel.
- */
-
-$plugin = array(
- 'title' => t('Page navigation'),
- 'single' => TRUE,
- 'icon' => 'icon_page.png',
- 'description' => t('A general page navigation block that includes primary links, secondary links and breadcrumb. This can be easily modified by overriding pane-navigation.tpl.php in your theme.'),
- 'category' => t('Page elements'),
- 'render last' => TRUE,
-);
-
-function panels_everywhere_pane_navigation_content_type_render($subtype, $conf, $panel_args) {
- $block = new stdClass();
- $block->content = theme('pane_navigation');
- return $block;
-}
-
-function panels_everywhere_pane_navigation_content_type_admin_info($subtype, $conf) {
- $block->title = t('Page primary navigation and breadcrumb');
- $block->content = t('A general page navigation block that includes primary links, secondary links and breadcrumb. This can be easily modified by overriding pane-navigation.tpl.php in your theme.');
- return $block;
-}
diff --git a/plugins/contexts/managed_page.inc b/plugins/contexts/managed_page.inc
deleted file mode 100644
index 6c9d615..0000000
--- a/plugins/contexts/managed_page.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
- * @file
- *
- * Plugin to provide a managed_page context
- */
-
-$plugin = array(
- 'title' => t('Managed page'),
- 'description' => t('A page manager page.'),
- 'context' => 'panels_everywhere_context_create_managed_page',
- 'keyword' => 'managed_page',
- 'no ui' => TRUE,
- 'context name' => 'managed_page',
-);
-
-/**
- * It's important to remember that $conf is optional here, because contexts
- * are not always created from the UI.
- */
-function panels_everywhere_context_create_managed_page($empty, $data = NULL, $conf = FALSE) {
- // The input is expected to be an object containing 'title' and 'content'.
-
- $context = new ctools_context('managed_page');
- $context->plugin = 'managed_page';
-
- if ($empty) {
- return $context;
- }
-
- if ($data !== FALSE ) {
- $context->data = $data;
- $context->title = t('Managed page');
- return $context;
- }
-}
diff --git a/plugins/contexts/page_content.inc b/plugins/contexts/page_content.inc
deleted file mode 100644
index de35833..0000000
--- a/plugins/contexts/page_content.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
- * @file
- *
- * Plugin to provide a page_content context
- */
-
-$plugin = array(
- 'title' => t('Page content'),
- 'description' => t('The page content.'),
- 'context' => 'panels_everywhere_context_create_page_content',
- 'keyword' => 'page_content',
- 'no ui' => TRUE,
- 'context name' => 'page_content',
-);
-
-/**
- * It's important to remember that $conf is optional here, because contexts
- * are not always created from the UI.
- */
-function panels_everywhere_context_create_page_content($empty, $data = NULL, $conf = FALSE) {
- // The input is expected to be an object containing 'title' and 'content'.
-
- $context = new ctools_context('page_content');
- $context->plugin = 'page_content';
-
- if ($empty) {
- return $context;
- }
-
- if ($data !== FALSE ) {
- $context->data = $data;
- $context->title = t('Page content');
- return $context;
- }
-}
diff --git a/plugins/tasks/site_template.inc b/plugins/tasks/site_template.inc
deleted file mode 100644
index 5ca1259..0000000
--- a/plugins/tasks/site_template.inc
+++ /dev/null
@@ -1,227 +0,0 @@
-<?php
-
-/**
- * Define the task plugin.
- */
-$plugin = array(
- // This is a 'page' task and will fall under the page admin UI
- 'task type' => 'page',
-
- 'title' => t('Default site template'),
- 'admin title' => t('Default site template'),
- 'admin description' => t('When enabled, the site template allows templates to be selectively applied to all pages.'),
- 'admin path' => FALSE,
-
- // This is task uses 'context' handlers and must implement these to give the
- // handler data it needs.
- 'handler type' => 'context',
- 'get arguments' => 'panels_everywhere_site_template_get_arguments',
- 'get context placeholders' => 'panels_everywhere_site_template_get_contexts',
- 'get base contexts' => 'panels_everywhere_site_template_get_base_contexts',
-
- // Allow this to be enabled or disabled:
- 'disabled' => !variable_get('panels_everywhere_site_template_enabled', FALSE),
- 'enable callback' => 'panels_everywhere_site_template_enable',
- 'tab title' => t('Edit site template'),
-);
-
-/**
- * Callback to get arguments provided by this task handler.
- *
- * Since this is the node view and there is no UI on the arguments, we
- * create dummy arguments that contain the needed data.
- */
-function panels_everywhere_site_template_get_arguments($task, $subtask_id) {
- $arguments = array();
-
- // Prior to version 1.8 the URL is passed in as an
- // argument. In 1.8 or later it is derived from the base contexts.
- if (version_compare(CTOOLS_API_VERSION, 1.8, '<')) {
- $arguments[] = array(
- 'keyword' => 'url',
- 'identifier' => t('URL'),
- 'id' => 1,
- 'name' => 'string',
- 'settings' => array(),
- );
- }
-
- $arguments[] = array(
- 'keyword' => 'content',
- 'identifier' => t('Page content'),
- 'id' => 1,
- 'name' => 'page_content',
- 'settings' => array(),
- );
-
- // Prior to version 1.8 the "managed page" is passed in as an
- // argument. In 1.8 or later it is derived from the base contexts.
- if (version_compare(CTOOLS_API_VERSION, 1.8, '<')) {
- $arguments[] = array(
- 'keyword' => 'page',
- 'identifier' => t('Managed page'),
- 'id' => 1,
- 'name' => 'managed_page',
- 'settings' => array(),
- );
- }
-
- return $arguments;
-}
-
-/**
- * Figure out the base contexts in use for the page.
- *
- * This only works with CTools API v1.8 or greater; prior to that Page Manager
- * only supported arguments.
- */
-function panels_everywhere_site_template_get_base_contexts($task, $subtask, $placeholders) {
- $contexts = array();
-
- if ($placeholders) {
- $managed_page = ctools_context_create_empty('managed_page');
- $url = ctools_context_create_empty('string');
- $alias = ctools_context_create_empty('string');
- $node = ctools_context_create_empty('node');
- $account = ctools_context_create_empty('user');
- $term = ctools_context_create_empty('term');
- }
- else {
- $page = page_manager_get_current_page();
- $managed_page = ctools_context_create('managed_page', $page);
- $url = ctools_context_create('string', $_GET['q']);
- $alias = ctools_context_create('string', drupal_get_path_alias($_GET['q']));
-
- // If using a Page Manager Page, attempt to inherit our known contexts from this.
- if ($page) {
- $node = _panels_everywhere_find_context($page['contexts'], 'node');
- $account = _panels_everywhere_find_context($page['contexts'], 'user');
-
- // We're already including the logged in user. We don't want that to
- // accidentally show up as the user being viewed if we're doing
- // something unrelated and the logged in user was added as a context.
- if (isset($account->data->logged_in_user)) {
- $account = ctools_context_create_empty('user');
- }
-
- $term = _panels_everywhere_find_context($page['contexts'], 'term');
- }
- else {
- // Attempt to drive our basic contexts from the environemnt if we are
- // not using a panel page.
-
- // First, find a node. This is the same code used by Views.
- $raw_node = _panels_everywhere_find_node_context();
- $node = (!empty($raw_node)) ? ctools_context_create('node', $raw_node) : ctools_context_create_empty('node');
-
- // Now try to find a user.
- $raw_user = _panels_everywhere_find_user_context();
- $account = (!empty($raw_user)) ? ctools_context_create('user', $raw_user) : ctools_context_create_empty('user');
-
- // Now try to find a term.
- $raw_term = _panels_everywhere_find_term_context();
- $term = (!empty($raw_term)) ? ctools_context_create('term', $raw_term) : ctools_context_create_empty('term');
- }
- }
-
- $user = ctools_context_create('user', $GLOBALS['user']);
-
- // First, the managed page. The id is weird because this was formerly an object
- // so we want to retain that so pre-existing templates don't just break.
- panels_everywhere_site_template_add_context($contexts, $url, t('Internal URL'), 'url', 'argument_string_1');
- panels_everywhere_site_template_add_context($contexts, $alias, t('Aliased URL'), 'alias', 'alias');
- panels_everywhere_site_template_add_context($contexts, $managed_page, t('Managed page'), 'page', 'argument_managed_page_1');
- panels_everywhere_site_template_add_context($contexts, $user, t('Logged in user'), 'user', 'logged-in-user');
- panels_everywhere_site_template_add_context($contexts, $node, t('Node being viewed'), 'node', 'node');
- panels_everywhere_site_template_add_context($contexts, $account, t('User being viewed'), 'account', 'account');
- panels_everywhere_site_template_add_context($contexts, $term, t('Taxonomy term being viewed'), 'term', 'term');
-
- // Allow other modules to also add contexts to the site template.
- drupal_alter('page_manager_contexts', $contexts, $placeholders);
-
- return $contexts;
-}
-
-/**
- * Set up a context with the basic information needed.
- */
-function panels_everywhere_site_template_add_context(&$contexts, &$context, $identifier, $keyword, $id) {
- $context->page_title = '';
- $context->identifier = $identifier;
- $context->keyword = $keyword;
- $context->id = $id;
- $contexts[$id] = $context;
-}
-
-/**
- * Search for the first context that matches our requirements.
- *
- * If we can't find a context, produce an empty one instead.
- */
-function _panels_everywhere_find_context($contexts, $type) {
- $list = ctools_context_filter($contexts, new ctools_context_required('', $type));
- if ($list) {
- return drupal_clone(array_shift($list));
- }
-
- return ctools_context_create_empty($type);
-}
-
-/**
- * Attempt to extract a node from the environment to turn into a context.
- */
-function _panels_everywhere_find_node_context() {
- foreach (range(1, 3) as $i) {
- $node = menu_get_object('node', $i);
- if (!empty($node)) {
- return $node;
- }
- }
-
- if (arg(0) == 'node' && is_numeric(arg(1))) {
- return node_load(arg(1));
- }
-}
-
-/**
- * Attempt to extract a user from the environment to turn into a context.
- */
-function _panels_everywhere_find_user_context() {
- foreach (range(1, 3) as $i) {
- $user = menu_get_object('user', $i);
- if (!empty($user)) {
- return $user;
- }
- }
-
- foreach (range(1, 3) as $i) {
- $user = menu_get_object('user_uid_optional', $i);
- if (!empty($user)) {
- return $user;
- }
- }
-
- if (arg(0) == 'user' && is_numeric(arg(1))) {
- return user_load(arg(1));
- }
-}
-
-function _panels_everywhere_find_term_context() {
- if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
- return taxonomy_get_term(arg(2));
- }
-}
-
-/**
- * Callback to get context placeholders provided by this handler.
- */
-function panels_everywhere_site_template_get_contexts($task, $subtask_id) {
- return ctools_context_get_placeholders_from_argument(panels_everywhere_site_template_get_arguments($task, $subtask_id));
-}
-
-/**
- * Callback to enable/disable the page from the UI.
- */
-function panels_everywhere_site_template_enable($cache, $status) {
- variable_set('panels_everywhere_site_template_enabled', !$status);
-}
diff --git a/theme/page.tpl.php b/theme/page.tpl.php
deleted file mode 100644
index 8334134..0000000
--- a/theme/page.tpl.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php /* $Id$ */ ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>">
-
-<head>
- <?php print $head; ?>
- <title><?php print $head_title; ?></title>
- <?php print $styles; ?>
- <?php print $scripts; ?>
- <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyled Content in IE */ ?> </script>
-</head>
-<body>
- <?php print $content; ?>
- <?php print $closure; ?>
-</body>
-</html>
diff --git a/theme/pane-header.tpl.php b/theme/pane-header.tpl.php
deleted file mode 100644
index ddfe1bc..0000000
--- a/theme/pane-header.tpl.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * @file
- *
- * Theme implementation to display the header block on a Drupal page.
- *
- * This utilizes the following variables thata re normally found in
- * page.tpl.php:
- * - $logo
- * - $front_page
- * - $site_name
- * - $front_page
- * - $site_slogan
- * - $search_box
- *
- * Additional items can be added via theme_preprocess_pane_header(). See
- * template_preprocess_pane_header() for examples.
- */
- ?>
-<div id="header">
- <div id="logo-title">
-
- <?php if (!empty($logo)): ?>
- <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
- <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
- </a>
- <?php endif; ?>
-
- <div id="name-and-slogan">
- <?php if (!empty($site_name)): ?>
- <h1 id="site-name">
- <a href="<?php print $front_page ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
- </h1>
- <?php endif; ?>
-
- <?php if (!empty($site_slogan)): ?>
- <div id="site-slogan"><?php print $site_slogan; ?></div>
- <?php endif; ?>
- </div> <!-- /name-and-slogan -->
- </div> <!-- /logo-title -->
-
- <?php if (!empty($search_box)): ?>
- <div id="search-box"><?php print $search_box; ?></div>
- <?php endif; ?>
-
-</div> <!-- /header -->
diff --git a/theme/pane-messages.tpl.php b/theme/pane-messages.tpl.php
deleted file mode 100644
index 8406ee3..0000000
--- a/theme/pane-messages.tpl.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-/**
- * @file
- *
- * Theme implementation to display the messages area, which is normally
- * included roughly in the content area of a page.
- *
- * This utilizes the following variables thata re normally found in
- * page.tpl.php:
- * - $tabs
- * - $messages
- * - $help
- *
- * Additional items can be added via theme_preprocess_pane_messages(). See
- * template_preprocess_pane_messages() for examples.
- */
- ?>
-<?php if (!empty($tabs)): ?>
- <div class="tabs"><?php print $tabs; ?></div>
-<?php endif; ?>
-<?php if (!empty($messages)): print $messages; endif; ?>
-<?php if (!empty($help)): print $help; endif; ?>
diff --git a/theme/pane-navigation.tpl.php b/theme/pane-navigation.tpl.php
deleted file mode 100644
index a5f4491..0000000
--- a/theme/pane-navigation.tpl.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
- * @file
- *
- * Theme implementation to display the messages area, which is normally
- * included roughly in the content area of a page.
- *
- * This utilizes the following variables thata re normally found in
- * page.tpl.php:
- * - $primary_links
- * - $secondary_links
- * - $breadcrumb
- * - $mission
- *
- * Additional items can be added via theme_preprocess_pane_messages(). See
- * template_preprocess_pane_messages() for examples.
- */
- ?>
-<div id="navigation" class="menu <?php if (!empty($primary_links)) { print "withprimary"; } if (!empty($secondary_links)) { print " withsecondary"; } ?> ">
- <?php if (!empty($primary_links)): ?>
- <div id="primary" class="clear-block">
- <?php print theme('links', $primary_links, array('class' => 'links primary-links')); ?>
- </div>
- <?php endif; ?>
-
- <?php if (!empty($secondary_links)): ?>
- <div id="secondary" class="clear-block">
- <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')); ?>
- </div>
- <?php endif; ?>
-
- <?php if (!empty($breadcrumb)): ?>
- <div id="breadcrumb"><?php print $breadcrumb; ?></div>
- <?php endif; ?>
- <?php if (!empty($mission)): ?>
- <div id="mission"><?php print $mission; ?></div>
- <?php endif; ?>
-
-</div> <!-- /navigation -->
diff --git a/theme/theme.inc b/theme/theme.inc
deleted file mode 100644
index ae42923..0000000
--- a/theme/theme.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains preprocess functions for Panels Everywhere themes.
- */
-
-function template_preprocess_pane_header(&$vars) {
- $vars['site_name'] = (theme_get_setting('toggle_name') ? filter_xss_admin(variable_get('site_name', 'Drupal')) : '');
-
- $vars['site_slogan'] = (theme_get_setting('toggle_slogan') ? filter_xss_admin(variable_get('site_slogan', '')) : '');
- $vars['front_page'] = url();
- $vars['logo'] = theme_get_setting('logo');
- $vars['search_box'] = (theme_get_setting('toggle_search') ? drupal_get_form('search_theme_form') : '');
-}
-
-function template_preprocess_pane_messages(&$vars) {
- $vars['tabs'] = theme('menu_local_tasks');
- $vars['messages'] = theme('status_messages');
- $vars['help'] = theme('help');
-}
-
-function template_preprocess_pane_navigation(&$vars) {
- $vars['primary_links'] = menu_primary_links();
- $vars['secondary_links'] = menu_secondary_links();
- $vars['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb());
-}