Same name and namespace in other branches
  1. 5.0.x advagg.module \advagg_form_system_performance_settings_alter() 1 commentaire
  2. 7.x-1.x advagg.module \advagg_form_system_performance_settings_alter() 1 commentaire
  3. 7.x-2.x advagg.module \advagg_form_system_performance_settings_alter() 1 commentaire
  4. 8.x-2.x advagg.module \advagg_form_system_performance_settings_alter() 1 commentaire
  5. 8.x-3.x advagg.module \advagg_form_system_performance_settings_alter() 1 commentaire
  6. 8.x-4.x advagg.module \advagg_form_system_performance_settings_alter() 1 commentaire

Implements hook_form_FORM_ID_alter().

Give advice on how to temporarily disable css/js aggregation.

Fichier

./advagg.module, line 122

Code

function advagg_form_system_performance_settings_alter(&$form) {
    $msg = t('NOTE: If you wish to bypass AdvAgg optimizations for a set amount of time, you can go to the <a href="@operations">AdvAgg operations</a> page and press the <em>"optimization bypass cookie"</em> button.', [
        '@operations' => Url::fromRoute('advagg.operations')->toString(),
    ]);
    if (\Drupal::currentUser()->hasPermission('bypass advanced aggregation')) {
        $msg .= ' ' . t('You can also selectively bypass AdvAgg optimization by adding <code>@code</code> to the URL of any page.', [
            '@code' => '?advagg=0',
        ]);
    }
    else {
        $msg .= ' ' . t('You do not have the <a href="@permission">bypass advanced aggregation permission</a> so adding <code>@code</code> to the URL will not work at this time for you; either grant this permission to your user role or use the bypass cookie if you wish to selectively bypass AdvAgg optimizations.', [
            '@permission' => Url::fromRoute('user.admin_permissions')->toString(),
            '@code' => '?advagg=0',
        ]);
    }
    $form['bandwidth_optimization']['advagg_note'] = [
        '#markup' => $msg,
    ];
}