function oa_comment_ctools_render_alter in OA Comment 7.2
Implements hook_ctools_render_alter().
File
- ./
oa_comment.module, line 67
Code
function oa_comment_ctools_render_alter(&$info, &$page, &$context) {
// Ensures ctools modal js is added for panelized nodes since hook_node_view()
// isn't guaranteed to be called (based on if panes that trigger node_view()
// are added.
// If the page handler is the node_view handler.
if ($context['handler']->name == 'node_view_panelizer') {
// If we have the node object.
if (isset($context['contexts']['argument_entity_id:node_1']->data)) {
if (!empty($context['contexts']['argument_entity_id:node_1']->data->comment_count)) {
ctools_include('modal');
ctools_modal_add_js();
}
}
}
}