caching.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /**
  3. * Advanced site settings, caching section.
  4. */
  5. // simple cache
  6. $is_simple_cache_on = (bool)elgg_get_config('simplecache_enabled');
  7. $simple_cache_disabled_class = $is_simple_cache_on ? '' : 'elgg-state-disabled';
  8. $params = array(
  9. 'label' => elgg_echo('installation:simplecache:label'),
  10. 'name' => 'simplecache_enabled',
  11. 'checked' => $is_simple_cache_on,
  12. );
  13. if (elgg_get_config('simplecache_enabled_in_settings')) {
  14. $params['class'] = 'elgg-state-disabled';
  15. $params['label_class'] = 'elgg-state-disabled';
  16. }
  17. $simple_cache_input .= elgg_view("input/checkbox", $params);
  18. $simple_cache_warning = '';
  19. if (elgg_get_config('simplecache_enabled_in_settings')) {
  20. $warning = elgg_echo('admin:settings:in_settings_file');
  21. $simple_cache_warning .= "<span class=\"elgg-text-help\">$warning</span>";
  22. }
  23. // minify
  24. $minify_js_input = elgg_view("input/checkbox", array(
  25. 'label' => elgg_echo('installation:minify_js:label'),
  26. 'name' => 'simplecache_minify_js',
  27. 'checked' => (bool)elgg_get_config('simplecache_minify_js'),
  28. 'label_class' => $simple_cache_disabled_class,
  29. ));
  30. $minify_css_input = elgg_view("input/checkbox", array(
  31. 'label' => elgg_echo('installation:minify_css:label'),
  32. 'name' => 'simplecache_minify_css',
  33. 'checked' => (bool)elgg_get_config('simplecache_minify_css'),
  34. 'label_class' => $simple_cache_disabled_class,
  35. ));
  36. $system_cache_input = elgg_view("input/checkbox", array(
  37. 'label' => elgg_echo('installation:systemcache:label'),
  38. 'name' => 'system_cache_enabled',
  39. 'checked' => (bool)elgg_get_config('system_cache_enabled'),
  40. ))
  41. ?>
  42. <fieldset class="elgg-fieldset" id="elgg-settings-advanced-caching">
  43. <legend><?php echo elgg_echo('admin:legend:caching'); ?></legend>
  44. <div>
  45. <?php echo $simple_cache_input; ?>
  46. <p class="elgg-text-help"><?php echo elgg_echo('installation:simplecache:description'); ?></p>
  47. <?php echo $simple_cache_warning; ?>
  48. </div>
  49. <div>
  50. <p><?php echo elgg_echo('installation:minify:description'); ?></p>
  51. <?php echo $minify_js_input; ?><br />
  52. <?php echo $minify_css_input; ?>
  53. </div>
  54. <div>
  55. <?php echo $system_cache_input; ?>
  56. <p class="elgg-text-help"><?php echo elgg_echo('installation:systemcache:description'); ?></p>
  57. </div>
  58. </fieldset>