<?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 
<?php

namespace W3TC;

if (!defined('W3TC')) {
    die;
}
?>
<tr>
    <th colspan="2">
        <?php 
$key = 'stats.enabled';
$c = Dispatcher::config();
$value = $c->get($key);
$label = Util_Ui::config_label($key);
$name = Util_Ui::config_key_to_http_name($key);
Util_Ui::checkbox($key, $name, $value, $c->is_sealed('common.'), $label);
?>
    </th>
</tr>
<?php 
    </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) {
Exemplo n.º 4
0
 /**
  * Renders <tr> element with controls
  * id =>
  * label =>
  * label_class =>
  * <control> => details
  * style - default is label,controls view,
  *         alternative is one-column view
  */
 public static function table_tr($a)
 {
     $id = isset($a['id']) ? $a['id'] : '';
     $a = apply_filters('w3tc_ui_settings_item', $a);
     if (isset($a['style'])) {
         echo '<tr><th colspan="2"';
     } else {
         echo '<tr><th';
         if (isset($a['label_class'])) {
             echo ' class="' . $a['label_class'] . '"';
         }
         echo '>';
         if (isset($a['label'])) {
             Util_Ui::label($id, $a['label']);
         }
         echo "</th>\n<td>\n";
     }
     foreach ($a as $key => $e) {
         if ($key == 'checkbox') {
             Util_Ui::checkbox($id, isset($e['name']) ? $e['name'] : null, $e['value'], isset($e['disabled']) ? $e['disabled'] : false, isset($e['label']) ? $e['label'] : null);
         } elseif ($key == 'description') {
             echo '<br /><span class="description">' . $e . '</span>';
         } elseif ($key == 'hidden') {
             Util_Ui::hidden('', $e['name'], $e['value']);
         } elseif ($key == 'html') {
             echo $e;
         } elseif ($key == 'radiogroup') {
             Util_Ui::radiogroup($e['name'], $e['value'], $e['values']);
         } elseif ($key == 'selectbox') {
             Util_Ui::selectbox($id, $e['name'], $e['value'], $e['values'], isset($e['disabled']) ? $e['disabled'] : false, isset($e['optgroups']) ? $e['optgroups'] : null);
         } elseif ($key == 'textbox') {
             Util_Ui::textbox($id, $e['name'], $e['value'], isset($e['disabled']) ? $e['disabled'] : false, !empty($e['size']) ? $e['size'] : 20);
         } elseif ($key == 'textarea') {
             Util_Ui::textarea($id, $e['name'], $e['value'], isset($e['disabled']) ? $e['disabled'] : false);
         }
     }
     if (isset($a['style'])) {
         echo "</th>";
     } else {
         echo "</td>";
     }
     echo "</tr>\n";
 }