function ctools_access_ruleset_panels_dashboard_blocks in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 ctools_access_ruleset/ctools_access_ruleset.module \ctools_access_ruleset_panels_dashboard_blocks()
Implementation of hook_panels_dashboard_blocks().
Adds page information to the Panels dashboard.
File
- ctools_access_ruleset/
ctools_access_ruleset.module, line 41 - ctools_access_ruleset module
Code
function ctools_access_ruleset_panels_dashboard_blocks(&$vars) {
$vars['links']['ctools_access_ruleset'] = array(
'title' => l(t('Custom ruleset'), 'admin/build/ctools-rulesets/add'),
'description' => t('Custom rulesets are combinations of access plugins you can use for access control, selection criteria and pane visibility.'),
);
// Load all mini panels and their displays.
ctools_include('export');
$items = ctools_export_crud_load_all('ctools_access_ruleset');
$count = 0;
$rows = array();
foreach ($items as $item) {
$rows[] = array(
check_plain($item->admin_title),
array(
'data' => l(t('Edit'), "admin/build/ctools-rulesets/list/{$item->name}/edit"),
'class' => 'links',
),
);
// Only show 10.
if (++$count >= 10) {
break;
}
}
if ($rows) {
$content = theme('table', array(), $rows, array(
'class' => 'panels-manage',
));
}
else {
$content = '<p>' . t('There are no custom rulesets.') . '</p>';
}
$vars['blocks']['ctools_access_ruleset'] = array(
'title' => t('Manage custom rulesets'),
'link' => l(t('Go to list'), 'admin/build/ctools-rulesets'),
'content' => $content,
'class' => 'dashboard-ruleset',
'section' => 'right',
);
}