PluginProbe
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites / 1.2.0
BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites v1.2.0
4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 2.6.1 All 38 releases
blockspare / src / admin / index.php

index.php in BlockSpare – Gutenberg Blocks for News, Magazine, Blog & Business Websites 1.2.0, at src/admin/index.php

267 lines 14.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Welcome screen.
4 */
5
6 // Exit if accessed directly.
7 if (!defined('ABSPATH')) {
8 exit;
9 }
10
11 if (!class_exists('Blockspare_Admin_Dashboard')) {
12 class Blockspare_Admin_Dashboard
13 {
14 function __construct()
15 {
16 add_action('admin_menu', array($this, 'add_dashboard_page'));
17
18 add_action('admin_enqueue_scripts', array($this, 'enqueue_dashboard_script'));
19
20 add_action('admin_init', array($this, 'redirect_to_blockspare_page'));
21 }
22
23 public function add_dashboard_page()
24 {
25
26 // @see images/blockspare-icon.svg
27 $svg = <<< SVG
28 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
29 viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
30 <g>
31 <g>
32 <path class="st0" d="M1.6,9.2v21.4l18.3-9.2L20.2,0L1.6,9.2z M16.9,19.8L4.9,26V10.9l12-6.1V19.8z"/>
33 <polygon id="XMLID_3_" class="st1" points="19.9,21.4 16.9,23 26,27.7 13.8,33.8 4.9,29 1.6,30.7 13.9,36.9 32.4,27.7 "/>
34 </g>
35 <g>
36 <polygon id="XMLID_2_" class="st0" points="23,1.5 23,19.8 32.4,24.6 32.4,9.4 35.3,10.9 35.3,29 38.4,30.7 38.4,9.2 29.4,4.8
37 29.2,19.7 26,18.4 26,3.1 "/>
38 <polygon id="XMLID_1_" class="st1" points="17,38.4 19.9,40 38.4,30.7 35.3,29 "/>
39 </g>
40 </g>
41 </svg>
42 SVG;
43
44 add_menu_page(
45 __('Blockspare', 'blockspare'), // Page Title.
46 __('Blockspare', 'blockspare'), // Menu Title.
47 'edit_posts', // Capability.
48 'blockspare', // Menu slug.
49 array($this, 'blockspare_admin_dashboard'), // Action.
50 'data:image/svg+xml;base64,' . base64_encode($svg) // Blockspare icon.
51 );
52 }
53
54 public function enqueue_dashboard_script($hook)
55 {
56 }
57
58 public function blockspare_admin_dashboard()
59 {
60 ?>
61 <div class="wrap blockspare-wrap">
62 <header class="blockspare-header">
63 <img src="<?php echo esc_url(plugins_url('assets/blockspare-logo.png', __FILE__)) ?>"
64 alt="<?php esc_attr_e('Blockspare', 'blockspare') ?>" />
65 <h1>
66 <?php _e('Blockspare', 'blockspare') ?>
67 </h1>
68 <h2><?php _e('Beautiful Page Building Blocks for WordPress', 'blockspare') ?></h2>
69
70 <div class="blockspare-separator">
71 <svg class="blockspare-separator-double-wave" preserveAspectRatio="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1946 175">
72 <path class="st0" d="M-.5 27.7v146.8h1946V10.7s-170.6 20.4-265 57.2c0 0-374.1 116.7-794.2 24.7 0 0-414.1-100.9-673.1-92-.1 0-102.9 5.2-213.7 27.1z"></path>
73 <path class="st1" d="M1945.5 69.9s-425.5-100-888 20.5c0 0-342.6 63.3-611.4 43.8 0 0-224.9-40.3-446.6-84.4V174h1946V69.9z"></path>
74 <path d="M-.5 88s425.5-100 888 20.5c0 0 342.6 63.3 611.4 43.8 0 0 224.9-20.2 446.6-64.3v87H-.5V88z"></path>
75 </svg>
76 </div>
77 </header>
78 <section class="blockspare-main-container">
79 <article class="blockspare-intro blockspare-section">
80
81 <div class="blockspare-intro-col blockspare-intro-desc">
82 <div class="blockspare-common-header-wrapper">
83 <span class="blockspare-subtitle"><?php _e('Amazing Blocks', 'blockspare') ?></span>
84 <h2><?php _e('Envision Amazing Layouts with Blockspare', 'blockspare') ?></h2>
85 </div>
86
87 <p><?php _e('Now you have Blockspare for your WordPress editor', 'blockspare') ?></p>
88 <ol>
89 <li>
90 <?php _e('Create a new page', 'blockspare') ?>
91 </li>
92 <li>
93 <?php _e('Click on the <span class="plus-btn-svg"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="#222"><path d="M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z"></path></svg></span> button to add a block', 'blockspare') ?>
94 </li>
95 <li>
96 <?php _e('Expand Blockspare panel!', 'blockspare') ?>
97 </li>
98 <li>
99 <?php _e('Select to add and customize a block!', 'blockspare') ?>
100 </li>
101 </ol>
102
103 <a href="<?php echo esc_url(admin_url('post-new.php?post_type=page&blockspare_show_intro=true')) ?>"
104 class="blockspare-button"
105 title="<?php esc_attr_e('Try it on New Page', 'blockspare') ?>"><?php _e('Try it on New Page', 'blockspare') ?></a>
106 </p>
107 </div>
108 <div class="blockspare-intro-col blockspare-intro-img">
109 <p><img src="<?php echo esc_url(plugins_url('assets/blockspare-adding-blocks.gif', __FILE__)) ?>"
110 alt="<?php esc_attr_e('Adding Blockspare', 'blockspare') ?>" class="blockspare-gif"/></p>
111 <p>
112 </div>
113 </article>
114 </section>
115 <section class="blockspare-body-container">
116 <div class="blockspare-body">
117
118 <article class="blockspare-section blockspare-block-intro">
119
120 <div class="blockspare-common-header-wrapper">
121 <span class="blockspare-subtitle"><?php _e('Enhanced set of Blocks', 'blockspare') ?></span>
122 <h3><?php _e('Start Creating Page using Enhanced set of Blocks in Minutes!', 'blockspare') ?></h3>
123 </div>
124
125 <p><?php _e('We design an elegant series of WordPress blocks to help you create the website you always wanted with ease.', 'blockspare') ?>
126 </p>
127 <!-- We put all the block controls here. -->
128 <div class="blockspare-available-blocks-wrapper">
129 <?php
130 $blockspare_blocks = blockspare_blocks_list();
131 if (isset($blockspare_blocks) && !empty($blockspare_blocks)):
132 foreach ($blockspare_blocks as $block):
133 $blocks_name = $block['name'];
134 $icon_url = plugins_url("assets/" .$block['slug'] . "-image.png", __FILE__);
135 $demo_url = 'https://blockspare.com/block/'.$block['slug'];
136
137 ?>
138 <a class="blockspare-explore-btn" href="<?php echo esc_url($demo_url) ?>" target="_blank">
139 <div class="blockspare-available-blocks">
140
141 <img src="<?php echo esc_attr($icon_url); ?>" alt="<?php echo esc_attr($blocks_name) ?>">
142 <h4>
143 <?php echo esc_attr($blocks_name) ?>
144 </h4>
145
146
147
148 </div>
149 </a>
150 <?php
151 endforeach;
152 endif;
153
154 ?>
155 </div>
156 <div class="blocksparea-all-blocks-button"><a href="https://blockspare.com/" class="blockspare-button"
157 target="_blank"
158 title="<?php esc_attr_e('Explore All Blocks', 'blockspare') ?>"><?php _e('Explore All Blocks', 'blockspare') ?></a>
159 </div>
160 </article>
161 <aside class="blockspare-backward-compatibility-control-wrapper"></aside>
162 <?php if (BLOCKSPARE_SHOW_PRO_NOTICES): ?>
163 <aside class="blockspare-pro-control-wrapper"></aside>
164 <?php endif; ?>
165 </div>
166 <div class="blockspare-side">
167
168 <div class="blockspare-side-sticky">
169 <?php
170 $blockspare_pro = false;
171 if ($blockspare_pro == false ) : ?>
172 <aside class="blockspare-section blockspare-premium-section">
173 <h3><?php _e('Blockspare Pro', 'blockspare') ?></h3>
174 <p><?php _e('Want to use Blockspare Pro to build an awesome site with more options and controls?', 'blockspare') ?></p>
175 <ul class="blockspare-premium-features">
176 <li><?php _e('30+ Custom WordPress Blocks', 'blockspare') ?></li>
177 <li><?php _e('110+ Pre-designed Blocks Layouts', 'blockspare') ?></li>
178 <li><?php _e('Gradients Color Effects', 'blockspare') ?></li>
179 <li><?php _e('Additional Block Options', 'blockspare') ?></li>
180 <li><?php _e('Rearrangeable Inner Blocks', 'blockspare') ?></li>
181 <li><?php _e('Image Masking Colors Effects and Filters ', 'blockspare') ?></li>
182 <li><?php _e('All Premium Effects', 'blockspare') ?></li>
183 <li><?php _e('Customer Email Support', 'blockspare') ?></li>
184 <li><?php _e('Regular Updates & Premium Support', 'blockspare') ?></li>
185 </ul>
186 </p>
187 <p>
188 <a href="https://blockspare.com/" class="blockspare-button"
189 title="<?php esc_attr_e('Get Blockspare Pro', 'blockspare') ?>"><?php esc_attr_e('Get Blockspare Pro', 'blockspare') ?></a>
190 </p>
191
192 </aside>
193 <?php endif; ?>
194
195 <aside class="blockspare-section">
196 <h3><?php _e('Knowledge Base', 'blockspare') ?></h3>
197 <ul class="blockspare-list blockspare-knowledge-base">
198 <li>
199 <h4 class="blockspare-sub-headings">
200 <a href="https://blockspare.com/docs/"><?php esc_html_e('Documentations', 'blockspare') ?> </a>
201 </h4>
202 <p><?php esc_html_e('Do you have any difficulties regarding plugin setup and uses? Please visit Documentations page.', 'blockspare') ?></p>
203 </li>
204 <li>
205 <h4 class="blockspare-sub-headings">
206 <a href="https://blockspare.com/block/"><?php esc_html_e('Demos', 'blockspare') ?> </a>
207 </h4>
208 <p><?php esc_html_e('We have also designed and displayed multiple type of layouts with Blockspare. For more details please visit our site.', 'blockspare') ?></p>
209 </li>
210 <li>
211 <h4 class="blockspare-sub-headings">
212 <a href="https://blockspare.com/support/"><?php esc_html_e('Support', 'blockspare') ?> </a>
213 </h4>
214 <p><?php esc_html_e('You directly come upon to our support guys with your valuable queries.', 'blockspare') ?></p>
215 </li>
216 <li>
217 <h4 class="blockspare-sub-headings">
218 <a href="https://wordpress.org/support/plugin/blockspare/"><?php esc_html_e('WordPress Support Forum', 'blockspare') ?> </a>
219 </h4>
220 <p><?php esc_html_e('You can also go to our .org forum for any kind of support enquiries.', 'blockspare') ?></p>
221 </li>
222 <li>
223 <h4 class="blockspare-sub-headings">
224 <a href="https://blockspare.com/blog/"><?php esc_html_e('Latest Blog', 'blockspare') ?> </a>
225 </h4>
226 <p><?php esc_html_e('Get latest articles about WordPress.', 'blockspare') ?></p>
227 </li>
228 </ul>
229
230 </p>
231 </aside>
232 </div>
233
234 </div>
235 </section>
236 </div>
237 <?php
238 }
239
240 /**
241 * Adds a marker to remember to redirect after activation.
242 * Redirecting right away will not work.
243 */
244 public static function start_redirect_to_blockspare_page()
245 {
246 update_option('blockspare_redirect_to_welcome', '1');
247 }
248
249 /**
250 * Redirect to the welcome screen if our marker exists.
251 */
252 public function redirect_to_blockspare_page()
253 {
254 if (get_option('blockspare_redirect_to_welcome')) {
255 delete_option('blockspare_redirect_to_welcome');
256 wp_redirect(esc_url(admin_url('admin.php?page=blockspare')));
257 die();
258 }
259 }
260 }
261
262 new Blockspare_Admin_Dashboard();
263 }
264
265 // Redirect to the welcome screen.
266 register_activation_hook(BLOCKSPARE_BASE_FILE, array('Blockspare_Admin_Dashboard', 'start_redirect_to_blockspare_page'));
267