<?php namespace W3TC; if (!defined('W3TC')) { die; } ?> <tr> <th colspan="2"> <?php $c = Dispatcher::config(); $is_pro = Util_Environment::is_w3tc_pro($c); $key = 'stats.enabled'; $value = $c->get($key); if (!$is_pro) { $value = false; } $name = Util_Ui::config_key_to_http_name($key); Util_Ui::checkbox($key, $name, $value, $c->is_sealed('common.') || !$is_pro, __('Enable caching statistics (on dashboard)', 'w3-total-cache')); if (!$is_pro) { echo ' (Available after <a href="#" class="button-buy-plugin">upgrade</a>)'; } ?> </th> </tr> <?php
/** * Prints checkbox for debug option * * @param string $option_id */ protected function checkbox_debug($option_id) { if (is_array($option_id)) { $section = $option_id[0]; $section_enabled = $this->_config->is_extension_active_frontend($section); } else { $section = substr($option_id, 0, strrpos($option_id, '.')); $section_enabled = $this->_config->get_boolean($section . '.enabled'); } $disabled = $this->_config->is_sealed($option_id) || !$section_enabled; $name = Util_Ui::config_key_to_http_name($option_id); if (!$disabled) { echo '<input type="hidden" name="' . $name . '" value="0" />'; } echo '<label>'; echo '<input class="enabled" type="checkbox" name="' . $name . '" value="1" '; checked($this->_config->get_boolean($option_id), true); if ($disabled) { echo 'disabled="disabled" '; } echo ' />'; }
/** * On subblogs - shows button to enable/disable custom configuration * $a['key'] - config key *_overloaded which are managed */ public static function config_overloading_button($a) { $c = Dispatcher::config(); if ($c->is_master()) { return; } if ($c->get_boolean($a['key'])) { $name = 'w3tc_config_overloaded_disable~' . Util_Ui::config_key_to_http_name($a['key']); $value = __('Use common settings', 'w3-total-cache'); } else { $name = 'w3tc_config_overloaded_enable~' . Util_Ui::config_key_to_http_name($a['key']); $value = __('Use specific settings', 'w3-total-cache'); } echo '<div style="float: right">'; echo '<input type="submit" class="button" name="' . esc_attr($name) . '" value="' . esc_attr($value) . '" />'; echo '</div>'; }
</table> <?php Util_Ui::button_config_save('extension_newrelic_dashboard'); ?> <?php Util_Ui::postbox_footer(); ?> <?php Util_Ui::postbox_header(__('Behavior Settings', 'w3-total-cache'), '', 'behavior'); ?> <table class="form-table"> <tr> <th colspan="2"> <?php Util_Ui::checkbox('', Util_Ui::config_key_to_http_name(array('newrelic', 'accept.logged_roles')), $config->get_boolean(array('newrelic', 'accept.logged_roles')), $config->is_sealed('newrelic')); _e('Use <acronym title="Real User Monitoring">RUM</acronym> only for following user roles', 'w3-total-cache'); ?> </label><br /> <span class="description"><?php _e('Select user roles that <acronym title="Real User Monitoring">RUM</acronym> should be enabled for:', 'w3-total-cache'); ?> </span> <div id="newrelic_accept_roles"> <?php $saved_roles = $config->get_array(array('newrelic', 'accept.roles')); ?> <input type="hidden" name="newrelic___accept__roles" value="" /><br /> <?php foreach (get_editable_roles() as $role_name => $role_data) {
<span class="description"> <?php _e('Select hooks from the list that should not be cached if user belongs to any of the roles selected below.', 'w3-total-cache'); ?> </span> </td> </tr> <tr> <td><?php _e('Select roles:', 'w3-total-cache'); ?> </td> <td> <?php $saved_roles = $config->get_array(array('genesis.theme', 'reject_roles')); $name = Util_Ui::config_key_to_http_name(array('genesis.theme', 'reject_roles')); ?> <input type="hidden" name="<?php echo esc_attr($name); ?> " value="" /> <?php foreach (get_editable_roles() as $role_name => $role_data) { ?> <input <?php disabled($config->is_sealed('genesis.theme')); ?> type="checkbox" name="<?php echo esc_attr($name); ?>