| 1 |
<?php |
| 2 |
/** |
| 3 |
* Administrative CSS/JS for menu pages ( inner processing routines ). |
| 4 |
* |
| 5 |
* Copyright: © 2009-2011 |
| 6 |
* {@link http://www.websharks-inc.com/ WebSharks, Inc.} |
| 7 |
* ( coded in the USA ) |
| 8 |
* |
| 9 |
* Released under the terms of the GNU General Public License. |
| 10 |
* You should have received a copy of the GNU General Public License, |
| 11 |
* along with this software. In the main directory, see: /licensing/ |
| 12 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 13 |
* |
| 14 |
* @package s2Member\Admin_CSS_JS |
| 15 |
* @since 3.5 |
| 16 |
*/ |
| 17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"])) |
| 18 |
exit("Do not access this file directly."); |
| 19 |
/**/ |
| 20 |
if (!class_exists ("c_ws_plugin__s2member_admin_css_js_in")) |
| 21 |
{ |
| 22 |
/** |
| 23 |
* Administrative CSS/JS for menu pages ( inner processing routines ). |
| 24 |
* |
| 25 |
* @package s2Member\Admin_CSS_JS |
| 26 |
* @since 3.5 |
| 27 |
*/ |
| 28 |
class c_ws_plugin__s2member_admin_css_js_in |
| 29 |
{ |
| 30 |
/** |
| 31 |
* Outputs the CSS for administrative menu pages. |
| 32 |
* |
| 33 |
* @package s2Member\Admin_CSS_JS |
| 34 |
* @since 3.5 |
| 35 |
* |
| 36 |
* @attaches-to ``add_action("init");`` |
| 37 |
* |
| 38 |
* @return null Or exits script execution after loading CSS. |
| 39 |
*/ |
| 40 |
public static function menu_pages_css () |
| 41 |
{ |
| 42 |
do_action ("ws_plugin__s2member_before_menu_pages_css", get_defined_vars ()); |
| 43 |
/**/ |
| 44 |
if (!empty ($_GET["ws_plugin__s2member_menu_pages_css"]) && is_user_logged_in () && current_user_can ("create_users")) |
| 45 |
{ |
| 46 |
header("Content-Type: text/css; charset=utf-8"); |
| 47 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT"); |
| 48 |
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); |
| 49 |
header("Cache-Control: no-cache, must-revalidate, max-age=0"); |
| 50 |
header("Pragma: no-cache"); |
| 51 |
/**/ |
| 52 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]; |
| 53 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images"; |
| 54 |
/**/ |
| 55 |
ob_start("c_ws_plugin__s2member_utils_css::compress_css"); /* Compress. */ |
| 56 |
/**/ |
| 57 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages.css"; |
| 58 |
/**/ |
| 59 |
echo "\n"; /* Add a line break before inclusion of this file. */ |
| 60 |
/**/ |
| 61 |
@include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s.css"; |
| 62 |
/**/ |
| 63 |
do_action ("ws_plugin__s2member_during_menu_pages_css", get_defined_vars ()); |
| 64 |
/**/ |
| 65 |
exit (); /* Clean exit. */ |
| 66 |
} |
| 67 |
/**/ |
| 68 |
do_action ("ws_plugin__s2member_after_menu_pages_css", get_defined_vars ()); |
| 69 |
} |
| 70 |
/** |
| 71 |
* Outputs the JS for administrative menu pages. |
| 72 |
* |
| 73 |
* @package s2Member\Admin_CSS_JS |
| 74 |
* @since 3.5 |
| 75 |
* |
| 76 |
* @attaches-to ``add_action("init");`` |
| 77 |
* |
| 78 |
* @return null Or exits script execution after loading JS. |
| 79 |
*/ |
| 80 |
public static function menu_pages_js () |
| 81 |
{ |
| 82 |
do_action ("ws_plugin__s2member_before_menu_pages_js", get_defined_vars ()); |
| 83 |
/**/ |
| 84 |
if (!empty ($_GET["ws_plugin__s2member_menu_pages_js"]) && is_user_logged_in () && current_user_can ("create_users")) |
| 85 |
{ |
| 86 |
header("Content-Type: text/javascript; charset=utf-8"); |
| 87 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("-1 week")) . " GMT"); |
| 88 |
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); |
| 89 |
header("Cache-Control: no-cache, must-revalidate, max-age=0"); |
| 90 |
header("Pragma: no-cache"); |
| 91 |
/**/ |
| 92 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]; |
| 93 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images"; |
| 94 |
/**/ |
| 95 |
for ($n = 0, $labels = ""; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) |
| 96 |
$labels .= "labels['level" . $n . "'] = '" . ((!empty ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])) ? c_ws_plugin__s2member_utils_strings::esc_sq (preg_replace ('/"/', "", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"])) : "") . "';"; |
| 97 |
unset($n); |
| 98 |
/**/ |
| 99 |
include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-min.js"; |
| 100 |
/**/ |
| 101 |
echo "\n"; /* Add a line break before inclusion of this file. */ |
| 102 |
/**/ |
| 103 |
@include_once dirname (dirname (__FILE__)) . "/menu-pages/menu-pages-s-min.js"; |
| 104 |
/**/ |
| 105 |
do_action ("ws_plugin__s2member_during_menu_pages_js", get_defined_vars ()); |
| 106 |
/**/ |
| 107 |
exit (); /* Clean exit. */ |
| 108 |
} |
| 109 |
/**/ |
| 110 |
do_action ("ws_plugin__s2member_after_menu_pages_js", get_defined_vars ()); |
| 111 |
} |
| 112 |
} |
| 113 |
} |
| 114 |
?> |