5 * ctools_access_ruleset module
7 * This module allows styles to be created and managed on behalf of modules
8 * that implement styles.
10 * The ctools_access_ruleset tool allows recolorable styles to be created via a miniature
11 * scripting language. Panels utilizes this to allow administrators to add
12 * styles directly to any panel display.
16 * Implementation of hook_permission()
18 function ctools_access_ruleset_permission() {
20 'administer ctools access ruleset' => array(
21 'title' => t('Administer access rulesets'),
22 'description' => t('Add, delete and edit custom access rulesets.'),
28 * Implementation of hook_ctools_plugin_directory() to let the system know
29 * we implement task and task_handler plugins.
31 function ctools_access_ruleset_ctools_plugin_directory($module, $plugin) {
32 // Most of this module is implemented as an export ui plugin, and the
33 // rest is in ctools/includes/ctools_access_ruleset.inc
34 if ($module == 'ctools' && ($plugin == 'export_ui' || $plugin == 'access')) {
35 return 'plugins/' . $plugin;
40 * Implementation of hook_panels_dashboard_blocks().
42 * Adds page information to the Panels dashboard.
44 function ctools_access_ruleset_panels_dashboard_blocks(&$vars) {
45 $vars['links']['ctools_access_ruleset'] = array(
46 'title' => l(t('Custom ruleset'), 'admin/structure/ctools-rulesets/add'),
47 'description' => t('Custom rulesets are combinations of access plugins you can use for access control, selection criteria and pane visibility.'),
50 // Load all mini panels and their displays.
51 ctools_include('export');
52 $items = ctools_export_crud_load_all('ctools_access_ruleset');
56 foreach ($items as $item) {
58 check_plain($item->admin_title),
60 'data' => l(t('Edit'), "admin/structure/ctools-rulesets/list/$item->name/edit"),
72 $content = theme('table', array('rows' => $rows, 'attributes' => array('class' => 'panels-manage')));
75 $content = '<p>' . t('There are no custom rulesets.') . '</p>';
78 $vars['blocks']['ctools_access_ruleset'] = array(
79 'title' => t('Manage custom rulesets'),
80 'link' => l(t('Go to list'), 'admin/structure/ctools-rulesets'),
81 'content' => $content,
82 'class' => 'dashboard-ruleset',