function entity_rules_list in Entity Rules 7
Page callback to list Rules that can invoked by Entity Types
1 string reference to 'entity_rules_list'
- entity_rules_menu in ./
entity_rules.module - Implements hook_menu().
File
- ./
entity_rules.admin.inc, line 45 - Admin functions.
Code
function entity_rules_list($rule_type) {
RulesPluginUI::$basePath = "admin/config/workflow/entity_rules/{$rule_type}";
$options = array(
'show plugin' => FALSE,
);
$content['enabled']['title']['#markup'] = '<h3>' . t("Enabled Entity {$rule_type} Rules") . '</h3>';
$conditions = array(
'plugin' => array(
'and',
'or',
'rule',
'rule set',
'action set',
),
'active' => TRUE,
'tags' => array(
"entity_rules_{$rule_type}",
),
);
$content['enabled']['rules'] = RulesPluginUI::overviewTable($conditions, $options);
$content['enabled']['rules']['#empty'] = t("There are no active Entity {$rule_type} rules.");
$content['disabled']['title']['#markup'] = '<h3>' . t("Disabled Entity {$rule_type} rules") . '</h3>';
$conditions['active'] = FALSE;
$content['disabled']['rules'] = RulesPluginUI::overviewTable($conditions, $options);
$content['disabled']['rules']['#empty'] = t("There are no disabled Entity {$rule_type} rules.");
return $content;
}