View source
<?php
$plugin = array(
'title' => t('Pages'),
'description' => t('This is a list of the pages that are available'),
'content_types' => array(
'landing_pages',
),
'category' => t('Admin'),
'required context' => new ctools_context_required(t('Panopoly Admin'), 'string'),
'single' => TRUE,
);
function panopoly_admin_landing_pages_content_type_render($subtype, $conf, $panel_args, $context) {
$pages = array();
module_load_include('inc', 'page_manager', 'page_manager.admin');
$tasks = page_manager_get_tasks_by_type('page');
$panels_pages = array(
'operations' => array(),
);
page_manager_get_pages($tasks, $panels_pages);
foreach ($panels_pages['rows'] as $id => $info) {
if (strpos($id, 'panopoly_admin')) {
}
elseif ($info['data']['type']['data'] == 'System') {
}
elseif ($panels_pages['disabled'][$id] == TRUE) {
}
elseif ($info['data']['type']['data'] == 'Existing') {
}
elseif ($id == 'page-panopoly_search') {
}
else {
$pages[] = array(
'data' => array(
$info['data']['title'],
'<em>Landing Page</em>',
$info['data']['path'],
),
);
}
}
$plugins = panelizer_get_entity_plugins();
foreach ($plugins as $entity_type => $plugin) {
if (in_array($entity_type, array(
'node',
'taxonomy_term',
'user',
))) {
$handler = panelizer_entity_plugin_get_handler($entity_type);
$entity_info = entity_get_info($entity_type);
foreach ($handler->plugin['bundles'] as $bundle_type => $bundle) {
if (!empty($bundle['view modes']['page_manager']) && $bundle['view modes']['page_manager']['status'] == 1 && $bundle['view modes']['page_manager']['default'] == 1) {
$pages[] = array(
'data' => array(
$entity_info['bundles'][$bundle_type]['label'],
'<em>' . $entity_info['label'] . ' template' . '</em>',
module_exists('pathauto') && pathauto_pattern_load_by_entity($entity_type, $bundle_type) ? l('/' . pathauto_pattern_load_by_entity($entity_type, $bundle_type), 'admin/config/content/panelizer/' . $entity_type . '/' . $bundle_type . '.page_manager/content') : l('/' . $handler->plugin['entity path'], 'admin/config/content/panelizer/' . $entity_type . '/' . $bundle_type . '.page_manager/content'),
),
);
}
}
}
}
$pane = new stdClass();
if (!empty($pages)) {
$pane->content = theme('table', array(
'header' => array(),
'rows' => $pages,
'attributes' => array(
'class' => 'panels-manage',
),
));
}
else {
$pane->content = t('No pages have yet been created!');
}
return $pane;
}