Implements hook_views_pre_render().

Fichier

./advagg.module, line 454

Code

function advagg_views_pre_render(&$view) {
    // Do not run hook if AdvAgg is disabled.
    if (!advagg_enabled()) {
        return;
    }
    // Do not run hook if setting is disabled.
    if (!variable_get('advagg_scripts_scope_anywhere', ADVAGG_SCRIPTS_SCOPE_ANYWHERE)) {
        return;
    }
    $info = "{$view->name}:{$view->current_display}";
    $prefix = "<!-- AdvAgg view:prefix:{$info} tag -->";
    $suffix = "<!-- AdvAgg view:suffix:{$info} tag -->";
    if (!isset($view->attachment_before)) {
        $view->attachment_before = '';
    }
    $view->attachment_before .= $prefix;
    if (!isset($view->attachment_after)) {
        $view->attachment_after = '';
    }
    $view->attachment_after .= $suffix;
}