rfesarfwe
芝麻web文件管理
') {
$link = Utility::build_url(Core::ACTION_DISMISS, GUI::TYPE_DISMISS_PIN, false, null, array( 'msgid' => $k ));
$msg =
substr($msg, 0, -6) .
'' .
__('Dismiss', 'litespeed-cache') .
'' .
'
';
}
echo wp_kses_post($msg);
}
}
// if ( $messages != -1 ) {
// self::update_option( self::DB_MSG_PIN, -1 );
// }
// Show disable all warning
if (defined('LITESPEED_DISABLE_ALL') && LITESPEED_DISABLE_ALL) {
self::error(Error::msg('disabled_all'), true);
}
if (empty($_GET['page']) || strpos($_GET['page'], 'litespeed') !== 0) {
global $pagenow;
if ($pagenow != 'plugins.php') {
// && $pagenow != 'index.php'
return;
}
}
if (!$this->conf(self::O_NEWS)) {
return;
}
// Show promo from cloud
Cloud::cls()->show_promo();
/**
* Check promo msg first
*
* @since 2.9
*/
GUI::cls()->show_promo();
// Show version news
Cloud::cls()->news();
}
/**
* Dismiss pinned msg
*
* @since 3.5.2
* @access public
*/
public static function dismiss_pin() {
if (!isset($_GET['msgid'])) {
return;
}
$messages = self::get_option(self::DB_MSG_PIN, array());
if (!is_array($messages) || empty($messages[$_GET['msgid']])) {
return;
}
unset($messages[$_GET['msgid']]);
if (!$messages) {
$messages = -1;
}
self::update_option(self::DB_MSG_PIN, $messages);
}
/**
* Dismiss pinned msg by msg content
*
* @since 7.0
* @access public
*/
public static function dismiss_pin_by_content( $content, $color, $irremovable ) {
$content = self::build_notice($color, $content, $irremovable);
$messages = self::get_option(self::DB_MSG_PIN, array());
$hit = false;
if ($messages != -1) {
foreach ($messages as $k => $v) {
if ($v == $content) {
unset($messages[$k]);
$hit = true;
self::debug('✅ pinned msg content hit. Removed');
break;
}
}
}
if ($hit) {
if (!$messages) {
$messages = -1;
}
self::update_option(self::DB_MSG_PIN, $messages);
} else {
self::debug('❌ No pinned msg content hit');
}
}
/**
* Hooked to the in_widget_form action.
* Appends LiteSpeed Cache settings to the widget edit settings screen.
* This will append the esi on/off selector and ttl text.
*
* @since 1.1.0
* @access public
*/
public function show_widget_edit( $widget, $return, $instance ) {
require LSCWP_DIR . 'tpl/esi_widget_edit.php';
}
/**
* Displays the dashboard page.
*
* @since 3.0
* @access public
*/
public function show_menu_dash() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/dash/entry.tpl.php';
}
/**
* Displays the General page.
*
* @since 5.3
* @access public
*/
public function show_menu_presets() {
require_once LSCWP_DIR . 'tpl/presets/entry.tpl.php';
}
/**
* Displays the General page.
*
* @since 3.0
* @access public
*/
public function show_menu_general() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/general/entry.tpl.php';
}
/**
* Displays the CDN page.
*
* @since 3.0
* @access public
*/
public function show_menu_cdn() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/cdn/entry.tpl.php';
}
/**
* Outputs the LiteSpeed Cache settings page.
*
* @since 1.0.0
* @access public
*/
public function show_menu_cache() {
if ($this->_is_network_admin) {
require_once LSCWP_DIR . 'tpl/cache/entry_network.tpl.php';
} else {
require_once LSCWP_DIR . 'tpl/cache/entry.tpl.php';
}
}
/**
* Tools page
*
* @since 3.0
* @access public
*/
public function show_toolbox() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/toolbox/entry.tpl.php';
}
/**
* Outputs the crawler operation page.
*
* @since 1.1.0
* @access public
*/
public function show_crawler() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/crawler/entry.tpl.php';
}
/**
* Outputs the optimization operation page.
*
* @since 1.6
* @access public
*/
public function show_img_optm() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/img_optm/entry.tpl.php';
}
/**
* Page optm page.
*
* @since 3.0
* @access public
*/
public function show_page_optm() {
$this->cls('Cloud')->maybe_preview_banner();
require_once LSCWP_DIR . 'tpl/page_optm/entry.tpl.php';
}
/**
* DB optm page.
*
* @since 3.0
* @access public
*/
public function show_db_optm() {
require_once LSCWP_DIR . 'tpl/db_optm/entry.tpl.php';
}
/**
* Outputs a notice to the admin panel when the plugin is installed
* via the WHM plugin.
*
* @since 1.0.12
* @access public
*/
public function show_display_installed() {
require_once LSCWP_DIR . 'tpl/inc/show_display_installed.php';
}
/**
* Display error cookie msg.
*
* @since 1.0.12
* @access public
*/
public static function show_error_cookie() {
require_once LSCWP_DIR . 'tpl/inc/show_error_cookie.php';
}
/**
* Display warning if lscache is disabled
*
* @since 2.1
* @access public
*/
public function cache_disabled_warning() {
include LSCWP_DIR . 'tpl/inc/check_cache_disabled.php';
}
/**
* Display conf data upgrading banner
*
* @since 2.1
* @access private
*/
private function _in_upgrading() {
include LSCWP_DIR . 'tpl/inc/in_upgrading.php';
}
/**
* Output litespeed form info
*
* @since 3.0
* @access public
*/
public function form_action( $action = false, $type = false, $has_upload = false ) {
if (!$action) {
$action = Router::ACTION_SAVE_SETTINGS;
}
$has_upload = $has_upload ? 'enctype="multipart/form-data"' : '';
if (!defined('LITESPEED_CONF_LOADED')) {
echo '';
}
echo '
';
if ($type) {
echo '
';
}
wp_nonce_field($action, Router::NONCE);
}
/**
* Output litespeed form info END
*
* @since 3.0
* @access public
*/
public function form_end( $disable_reset = false ) {
echo "
";
if (!defined('LITESPEED_CONF_LOADED')) {
submit_button(__('Save Changes', 'litespeed-cache'), 'secondary litespeed-duplicate-float', 'litespeed-submit', true, array( 'disabled' => 'disabled' ));
echo '
';
} else {
submit_button(__('Save Changes', 'litespeed-cache'), 'primary litespeed-duplicate-float', 'litespeed-submit', true, array(
'id' => 'litespeed-submit-' . $this->_btn_i++,
));
echo '';
}
}
/**
* Register this setting to save
*
* @since 3.0
* @access public
*/
public function enroll( $id ) {
echo '';
}
/**
* Build a textarea
*
* @since 1.1.0
* @access public
*/
public function build_textarea( $id, $cols = false, $val = null ) {
if ($val === null) {
$val = $this->conf($id, true);
if (is_array($val)) {
$val = implode("\n", $val);
}
}
if (!$cols) {
$cols = 80;
}
$rows = 5;
$lines = substr_count($val, "\n") + 2;
if ($lines > $rows) {
$rows = $lines;
}
if ($rows > 40) {
$rows = 40;
}
$this->enroll($id);
echo "