laipower/wp-content/upgrade-temp-backup/plugins/w3-total-cache/FeatureShowcase_Plugin_Admin_View.php

98 lines
2.3 KiB
PHP
Raw Normal View History

2023-10-22 22:21:44 +00:00
<?php
/**
* File: FeatureShowcase_Plugin_Admin_View.php
*
* @since 2.1.0
*
* @package W3TC
*
* @uses array $config W3TC configuration.
* @uses array $cards {
* Feature configuration.
*
* @type string $title Title.
* @type string $icon Dashicon icon class.
* @type string $text Description.
* @type string $button Button markup.
* @type string $link Link URL address.
* @type bool $is_premium Is it a premium feature.
* }
*
* @see Util_Environment::is_w3tc_pro()
* @see Util_Ui::pro_wrap_maybe_end2()
*
* phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*/
namespace W3TC;
$is_pro = Util_Environment::is_w3tc_pro( $config );
2023-12-08 23:23:36 +00:00
require W3TC_INC_DIR . '/options/common/header.php';
2023-10-22 22:21:44 +00:00
?>
<div class="w3tc-page-container">
<div class="w3tc-card-container">
<?php
foreach ( $cards as $feature_id => $card ) {
$card_classes = 'w3tc-card';
$title_classes = 'w3tc-card-title';
$is_premium = ! empty( $card['is_premium'] );
$is_new = ! empty( $card['is_new'] );
if ( $is_premium ) {
$card_classes .= ' w3tc-card-premium';
$title_classes .= ' w3tc-card-premium';
}
if ( $is_premium && ! $is_pro ) {
$card_classes .= ' w3tc-card-upgrade';
}
?>
<div class="<?php echo $card_classes; ?>" id="w3tc-feature-<?php echo esc_attr( $feature_id ); ?>">
<?php
if ( $is_new ) {
?>
<div class="w3tc-card-ribbon-new"><span>NEW</span></div>
<?php
}
?>
<div class="<?php echo $title_classes; ?>">
<p><?php echo $card['title']; ?></p>
<?php
if ( $is_premium ) {
?>
<p class="w3tc-card-pro"><?php echo __( 'PRO FEATURE', 'w3-total-cache' ); ?></p>
<?php
}
?>
</div>
<div class="w3tc-card-icon"><span class="dashicons <?php echo $card['icon']; ?>"></span></div>
<div class="w3tc-card-body"><p><?php echo $card['text']; ?></p></div>
<div class="w3tc-card-footer">
<div class="w3tc-card-button">
2023-12-08 23:23:36 +00:00
<?php
if ( $is_premium && ! $is_pro ) {
?>
<button class="button w3tc-gopro-button button-buy-plugin" data-src="feature_showcase">
<?php esc_html_e( 'Unlock Feature', 'w3-total-cache' ); ?>
</button>
<?php
} elseif ( ! empty( $card['button'] ) ) {
echo $card['button'];
}
?>
2023-10-22 22:21:44 +00:00
</div><div class="w3tc-card-links"><?php echo $card['link']; ?></div>
</div>
</div>
<?php
}
?>
</div>
</div>