Exemplo n.º 1
0
/**
 * Prints the label string for a config key.
 * @param string $config_key
 * @param string $area
 */
function w3_e_config_label($config_key, $area = 'settings')
{
    echo w3_config_label($config_key, $area);
}
Exemplo n.º 2
0
 /**
  * Prints admin notices
  */
 public function admin_notices()
 {
     w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/ui.php');
     /**
      * @var W3_ConfigCompatibility $config_comp
      */
     $config_comp = w3_instance('W3_ConfigCompatibility');
     $settings = $config_comp->get_new_settings();
     if (!$settings) {
         return;
     }
     $message = '<p>The following setting pages contain new options or configuration changes. Please take note of the following:</p>';
     $message .= '<p style="padding:0;margin:0;height:30px;text-align:right;">' . ' <input style="width:120px;" type="button" class="button" value="' . __('Apply all changes', 'w3-total-cache') . '" onclick="w3tc_change_setting(\'all\', \'dynamic\')" />' . '</p>';
     $message .= '<ul style="margin-top:0px;padding-top:0px;">';
     foreach ($settings as $module) {
         $page = $module['page'];
         $name = $module['name'];
         $message .= '<li>';
         if ($page) {
             $message .= '<a href="' . w3_admin_url('admin.php?page=' . $page) . '">' . $name . '</a>';
         } else {
             $message .= $name;
         }
         $message .= '<ul>';
         foreach ($module['data'] as $setting) {
             $meta = $setting['meta'];
             $text = 'new' == $meta['state'] ? __('Append') : ('changed' == $meta['state'] ? __('Replace') : __('Remove'));
             $message .= '<li style="line-height:24px;" class="setting_changes ' . str_replace('.', '_', $setting['key']) . '">' . trim(w3_config_label($setting['key'], ''), ':') . '<div style="float:right;">' . ' <input style="width:70px;margin-right:10px" type="button" class="button" value="' . $text . '" onclick="w3tc_change_setting(\'' . $setting['key'] . '\', \'' . $meta['state'] . '\', \'' . is_network_admin() . '\')" />' . ' <a href="#" style="margin-right:13px" onclick="w3tc_change_setting(\'' . $setting['key'] . '\', \'skip\', \'' . is_network_admin() . '\')">Skip</a>' . '</div>' . '</li>';
         }
         $message .= '</ul>';
         $message .= '</li>';
     }
     $message .= '</ul>';
     $message .= '<p style="padding:0;margin:0;margin-top:20px;height:30px;text-align:right;">' . ' <input style="width:120px;" type="button" class="button" value="' . __('Apply all changes', 'w3-total-cache') . '" onclick="w3tc_change_setting(\'all\', \'dynamic\', \'' . is_network_admin() . '\')" />' . '</p><p></p>';
     w3_e_notification_box($message, 'w3tc_new_settings');
 }