Skip to content

Instantly share code, notes, and snippets.

@klaasvw
Created October 13, 2013 10:38
Show Gist options
  • Save klaasvw/6960734 to your computer and use it in GitHub Desktop.
Save klaasvw/6960734 to your computer and use it in GitHub Desktop.
Export custom variants for existing page manager pages. This allows you to for example export a custom version of the user_view page.
<?php
/**
* @file
* Default page manager content.
*/
/**
* Implements hook_default_page_manager_handlers().
*/
function your_module_default_page_manager_handlers() {
$export = array();
$handler = new stdClass();
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'user_view_panel_context';
$handler->task = 'user_view';
$handler->subtask = '';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Registered',
'no_blocks' => 0,
'pipeline' => 'standard',
'body_classes_to_remove' => '',
'body_classes_to_add' => '',
'css_id' => '',
'css' => '',
'contexts' => array(),
'relationships' => array(),
'access' => array(
'plugins' => array(
0 => array(
'name' => 'role',
'settings' => array(
'rids' => array(
0 => 2,
),
),
'context' => 'logged-in-user',
'not' => FALSE,
),
),
'logic' => 'and',
),
);
$display = new panels_display();
$display->layout = 'onecol';
$display->layout_settings = array();
$display->panel_settings = array(
'style_settings' => array(
'default' => NULL,
'middle' => NULL,
),
);
$display->cache = array();
$display->title = '';
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-1';
$pane->panel = 'middle';
$pane->type = 'block';
$pane->subtype = 'views-workbench_current_user-block_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$pane->locks = array();
$display->content['new-1'] = $pane;
$display->panels['middle'][0] = 'new-1';
$pane = new stdClass();
$pane->pid = 'new-2';
$pane->panel = 'middle';
$pane->type = 'block';
$pane->subtype = 'views-workbench_edited-block_1';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$pane->locks = array();
$display->content['new-2'] = $pane;
$display->panels['middle'][1] = 'new-2';
$pane = new stdClass();
$pane->pid = 'new-3';
$pane->panel = 'middle';
$pane->type = 'block';
$pane->subtype = 'views-9cf22433e0efbd8b206c8e4c2edb177c';
$pane->shown = TRUE;
$pane->access = array(
'plugins' => array(
0 => array(
'name' => 'perm',
'settings' => array(
'perm' => 'administer nodes',
),
'context' => 'logged-in-user',
'not' => FALSE,
),
),
);
$pane->configuration = array(
'override_title' => 0,
'override_title_text' => '',
);
$pane->cache = array();
$pane->style = array(
'settings' => NULL,
);
$pane->css = array();
$pane->extras = array();
$pane->position = 2;
$pane->locks = array();
$display->content['new-3'] = $pane;
$display->panels['middle'][2] = 'new-3';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = '0';
$handler->conf['display'] = $display;
$export['user_view_panel_context'] = $handler;
return $export;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment