function rules_entity_view in Rules 7.2
Same name and namespace in other branches
- 8.3 rules.module \rules_entity_view()
Implements hook_entity_view().
Related topics
File
- modules/
events.inc, line 42 - Invokes events on behalf core modules.
Code
function rules_entity_view($entity, $type, $view_mode, $langcode) {
switch ($type) {
case 'comment':
rules_invoke_event('comment_view--' . $entity->node_type, $entity, $view_mode);
rules_invoke_event('comment_view', $entity, $view_mode);
break;
case 'node':
rules_invoke_event('node_view--' . $entity->type, $entity, $view_mode);
rules_invoke_event('node_view', $entity, $view_mode);
break;
case 'user':
rules_invoke_event('user_view', $entity, $view_mode);
break;
}
}