View source
<?php
$plugin = array(
'single' => TRUE,
'title' => t('Admin - Panel Pages'),
'defaults' => array(),
'icon' => 'cog.png',
'description' => t('Provides links to manage panel pages.'),
'category' => t('Dashboard'),
'edit text' => t('Configure'),
);
function total_control_panel_pages_content_type_admin_title($subtype = NULL, $conf = NULL, $context = NULL) {
return t('Manage Panel pages');
}
function total_control_panel_pages_content_type_admin_info($subtype = NULL, $conf = NULL, $context = NULL) {
$block = new stdClass();
$block->title = t('Provides links to manage panel pages.');
return $block;
}
function total_control_panel_pages_content_type_render($subtype, $conf, $args, &$context) {
$items = array();
module_load_include('inc', 'page_manager', 'page_manager.admin');
$tasks = page_manager_get_tasks_by_type('page');
$pages = array(
'operations' => array(),
);
page_manager_get_pages($tasks, $pages);
$count = 0;
$header = array(
'page' => t('Page'),
'options' => t('Operations'),
);
$rows = array();
foreach ($pages['rows'] as $id => $info) {
if (array_key_exists('data', $info['data']['operations']) && stristr((string) $info['data']['operations']['data'], 'Enable') == FALSE) {
$rows[] = array(
'data' => array(
$info['data']['title'],
$info['data']['operations'],
),
'class' => $info['class'],
);
if (++$count >= 10) {
break;
}
}
}
$link = '';
if (user_access('use page manager')) {
$link = l(t('Page manager administration'), 'admin/structure/pages');
}
$block = new stdClass();
$block->title = t('Manage Panel pages');
$block->module = t('total_control');
$block->content = theme('total_control_admin_table', array(
'header' => $header,
'rows' => $rows,
'link' => $link,
));
return $block;
}
function total_control_panel_pages_content_type_edit_form($form, &$form_state) {
$conf = $form_state['conf'];
return $form;
}
function total_control_panel_pages_content_type_edit_form_submit($form, &$form_state) {
foreach (array_keys($form_state['plugin']['defaults']) as $key) {
$form_state['conf'][$key] = $form_state['values'][$key];
}
}