| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin Welcome page. |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace Extendify\Library; |
| 7 |
|
| 8 |
use Extendify\Config; |
| 9 |
|
| 10 |
/** |
| 11 |
* This class handles the Welcome page on the admin panel. |
| 12 |
*/ |
| 13 |
class AdminPage |
| 14 |
{ |
| 15 |
|
| 16 |
/** |
| 17 |
* The admin page slug |
| 18 |
* |
| 19 |
* @var $string |
| 20 |
*/ |
| 21 |
public $slug = 'extendify-welcome'; |
| 22 |
|
| 23 |
/** |
| 24 |
* Adds various actions to set up the page |
| 25 |
* |
| 26 |
* @return void |
| 27 |
*/ |
| 28 |
public function __construct() |
| 29 |
{ |
| 30 |
\add_action( |
| 31 |
'in_admin_header', |
| 32 |
function () { |
| 33 |
// phpcs:ignore WordPress.Security.NonceVerification |
| 34 |
if (isset($_GET['page']) && $_GET['page'] === $this->slug) { |
| 35 |
\remove_all_actions('admin_notices'); |
| 36 |
\remove_all_actions('all_admin_notices'); |
| 37 |
} |
| 38 |
}, |
| 39 |
1000 |
| 40 |
); |
| 41 |
|
| 42 |
\add_action( |
| 43 |
'admin_enqueue_scripts', |
| 44 |
function () { |
| 45 |
// phpcs:ignore WordPress.Security.NonceVerification |
| 46 |
if (isset($_GET['page']) && $_GET['page'] === $this->slug) { |
| 47 |
\wp_enqueue_style( |
| 48 |
'extendify-welcome', |
| 49 |
EXTENDIFY_URL . 'public/admin-page/welcome.css', |
| 50 |
[], |
| 51 |
Config::$environment === 'PRODUCTION' ? Config::$version : uniqid() |
| 52 |
); |
| 53 |
} |
| 54 |
} |
| 55 |
); |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* Settings page output |
| 60 |
* |
| 61 |
* @since 1.0.0 |
| 62 |
* |
| 63 |
* @return void |
| 64 |
*/ |
| 65 |
public function pageContent() |
| 66 |
{ |
| 67 |
?> |
| 68 |
<div class="extendify-outer-container"> |
| 69 |
<div class="wrap welcome-container"> |
| 70 |
<?php if (Config::$showAssist) : ?> |
| 71 |
<ul class="extendify-welcome-tabs"> |
| 72 |
<li><a href="<?php echo \esc_url(\admin_url('admin.php?page=extendify-assist')); ?>">Assist</a></li> |
| 73 |
<li class="active"><a href="<?php echo \esc_url(\admin_url('admin.php?page=extendify-welcome')); ?>">Library</a></li> |
| 74 |
<li class="cta-button"><a href="<?php echo \esc_url_raw(\get_home_url()); ?>" target="_blank"><?php echo \esc_html(__('View Site', 'extendify')); ?></a></li> |
| 75 |
</ul> |
| 76 |
<?php endif; ?> |
| 77 |
<div class="welcome-header"> |
| 78 |
<img alt="<?php \esc_html_e('Extendify Banner', 'extendify'); ?>" src="<?php echo \esc_url(EXTENDIFY_URL . 'public/assets/welcome-banner.jpg'); ?>"> |
| 79 |
</div> |
| 80 |
<hr class="is-small"/> |
| 81 |
<div class="welcome-section"> |
| 82 |
<h2 class="aligncenter"> |
| 83 |
<?php \esc_html_e('Welcome to Extendify', 'extendify'); ?> |
| 84 |
</h2> |
| 85 |
<p class="aligncenter is-subheading"> |
| 86 |
<?php \esc_html_e('Extendify is a massive library of drop-in black patterns easily customized to your liking. Each pattern is meticulously designed to work with your existing WordPress theme.', 'extendify'); ?> |
| 87 |
</p> |
| 88 |
</div> |
| 89 |
<hr/> |
| 90 |
<div class="welcome-section has-2-columns has-gutters is-wider-right"> |
| 91 |
<div class="column is-edge-to-edge"> |
| 92 |
<h3> |
| 93 |
<?php |
| 94 |
echo sprintf( |
| 95 |
/* translators: %s: Extendify Library term */ |
| 96 |
\esc_html__('1. Open the %s', 'extendify'), |
| 97 |
'Extendify Library' |
| 98 |
); |
| 99 |
?> |
| 100 |
</h3> |
| 101 |
<p> |
| 102 |
<?php \esc_html_e("When editing a page or post within the block editor, you'll see the Extendify library button within the editor's header", 'extendify'); ?> |
| 103 |
</p> |
| 104 |
<p> |
| 105 |
<?php |
| 106 |
// translators: %1$s = URL. |
| 107 |
echo \wp_sprintf(\esc_html__('You may also add a new page with the library opened for you by %1$s.', 'extendify'), '<a href="' . \esc_url(\admin_url('post-new.php?post_type=page&ext-open')) . '">' . \esc_html__('clicking here', 'extendify') . '</a>'); ?> |
| 108 |
</p> |
| 109 |
</div> |
| 110 |
<div class="column welcome-image is-vertically-aligned-center is-edge-to-edge"> |
| 111 |
<img src="<?php echo \esc_url(EXTENDIFY_URL . 'public/assets/welcome-block-1.jpg'); ?>" alt=""/> |
| 112 |
</div> |
| 113 |
</div> |
| 114 |
<div class="welcome-section has-2-columns has-gutters is-wider-left"> |
| 115 |
<div class="column welcome-image is-vertically-aligned-center is-edge-to-edge"> |
| 116 |
<img src="<?php echo \esc_url(EXTENDIFY_URL . 'public/assets/welcome-block-2.jpg'); ?>" alt=""/> |
| 117 |
</div> |
| 118 |
<div class="column is-edge-to-edge"> |
| 119 |
<h3> |
| 120 |
<?php \esc_html_e('2. Choose a site industry', 'extendify'); ?> |
| 121 |
</h3> |
| 122 |
<p> |
| 123 |
<?php \esc_html_e('With the library open, you can set your site industry - or type - which will surface the perfect industry-specific patterns and full page layouts to drop onto your website.', 'extendify'); ?> |
| 124 |
</p> |
| 125 |
<p> |
| 126 |
<?php \esc_html_e('Extendify supports over sixty types with new industries added regularly.', 'extendify'); ?> |
| 127 |
</p> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
<div class="welcome-section has-2-columns has-gutters is-wider-right"> |
| 131 |
<div class="column is-edge-to-edge"> |
| 132 |
<h3> |
| 133 |
<?php \esc_html_e('3. Browse Patterns & Layouts.', 'extendify'); ?> |
| 134 |
</h3> |
| 135 |
<p> |
| 136 |
<?php \esc_html_e('Search by industry, contents, and design attributes. Extendify has thousands of best-in-class block patterns. Find what you love and add it to the page - done!', 'extendify'); ?> |
| 137 |
</p> |
| 138 |
<p> |
| 139 |
<?php \esc_html_e("You'll find beautiful high fidelity Gutenberg content to add to your pages in no time!", 'extendify'); ?> |
| 140 |
</p> |
| 141 |
</div> |
| 142 |
<div class="column welcome-image is-vertically-aligned-center is-edge-to-edge"> |
| 143 |
<img src="<?php echo \esc_url(EXTENDIFY_URL . 'public/assets/welcome-block-3.jpg'); ?>" alt=""/> |
| 144 |
</div> |
| 145 |
</div> |
| 146 |
<hr class="is-small"/> |
| 147 |
<?php if (!defined('EXTENDIFY_SITE_LICENSE')) : ?> |
| 148 |
<div class="welcome-section"> |
| 149 |
<h2 class="aligncenter"> |
| 150 |
<?php \esc_html_e('Upgrade to Extendify Pro', 'extendify'); ?> |
| 151 |
</h2> |
| 152 |
<p class="aligncenter is-subheading"> |
| 153 |
<?php \esc_html_e('Do you want more patterns and layouts - without limits? Choose one of our plans and receive unlimited access to our complete library.', 'extendify'); ?> |
| 154 |
</p> |
| 155 |
</div> |
| 156 |
<a href="https://extendify.com/pricing/?utm_source=welcome&utm_medium=settings&utm_campaign=get_started&utm_campaign=get_started" class="button button-primary components-button"> |
| 157 |
<?php echo \esc_html__('View Pricing', 'extendify'); ?></a> |
| 158 |
<hr/> |
| 159 |
<?php endif; ?> |
| 160 |
</div> |
| 161 |
</div> |
| 162 |
<?php |
| 163 |
} |
| 164 |
} |
| 165 |
|