← All changes
|
includes/extensions/Custom_Code_Manager/templates/admin-list.php
+83
-13
51.1.44
→
51.1.86
View file →
| @@ -17,17 +17,50 @@ | ||
| 17 | 17 | <div class="kng-cc-admin"> |
| 18 | 18 | <!-- Header --> |
| 19 | 19 | <header class="kng-cc-header"> |
| 20 | 20 | <div class="kng-cc-header-left"> |
| 21 | - <h1 class="kng-cc-title"> | |
| 22 | - <?php esc_html_e('Custom Code', 'king-addons'); ?> | |
| 23 | - <?php if (!$has_pro): ?> | |
| 24 | - <span class="kng-cc-limit-badge"><?php echo esc_html($snippet_count); ?>/<?php echo esc_html(Custom_Code_Manager::FREE_LIMIT); ?></span> | |
| 25 | - <?php endif; ?> | |
| 26 | - </h1> | |
| 27 | - <p class="kng-cc-subtitle"><?php echo esc_html($snippet_count); ?> <?php esc_html_e('snippets', 'king-addons'); ?></p> | |
| 21 | + <div class="kng-cc-header-icon"> | |
| 22 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="32" height="32"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg> | |
| 23 | + </div> | |
| 24 | + <div> | |
| 25 | + <h1 class="kng-cc-title"> | |
| 26 | + <?php esc_html_e('Custom Code', 'king-addons'); ?> | |
| 27 | + </h1> | |
| 28 | + <p class="kng-cc-subtitle"><?php esc_html_e('Add custom CSS, JavaScript, and HTML snippets anywhere on your site.', 'king-addons'); ?></p> | |
| 29 | + <p class="kng-cc-meta"> | |
| 30 | + <?php if (!$has_pro): ?> | |
| 31 | + <?php printf( | |
| 32 | + /* translators: %1$d: current count, %2$d: max limit */ | |
| 33 | + esc_html__('%1$d of %2$d snippets (Free)', 'king-addons'), | |
| 34 | + $snippet_count, | |
| 35 | + Custom_Code_Manager::FREE_LIMIT | |
| 36 | + ); ?> | |
| 37 | + <?php else: ?> | |
| 38 | + <?php printf( | |
| 39 | + /* translators: %d: total count */ | |
| 40 | + esc_html(_n('%d snippet', '%d snippets', $snippet_count, 'king-addons')), | |
| 41 | + $snippet_count | |
| 42 | + ); ?> | |
| 43 | + <?php endif; ?> | |
| 44 | + </p> | |
| 45 | + </div> | |
| 28 | 46 | </div> |
| 29 | 47 | <div class="kng-cc-header-right"> |
| 48 | + <div class="ka-v3-segmented" id="ka-v3-theme-segment" role="radiogroup" aria-label="<?php echo esc_attr(esc_html__('Theme', 'king-addons')); ?>" data-active="<?php echo esc_attr($theme_mode); ?>"> | |
| 49 | + <span class="ka-v3-segmented-indicator" aria-hidden="true"></span> | |
| 50 | + <button type="button" class="ka-v3-segmented-btn" data-theme="light" aria-pressed="<?php echo $theme_mode === 'light' ? 'true' : 'false'; ?>"> | |
| 51 | + <span class="ka-v3-segmented-icon" aria-hidden="true">☀︎</span> | |
| 52 | + <?php esc_html_e('Light', 'king-addons'); ?> | |
| 53 | + </button> | |
| 54 | + <button type="button" class="ka-v3-segmented-btn" data-theme="dark" aria-pressed="<?php echo $theme_mode === 'dark' ? 'true' : 'false'; ?>"> | |
| 55 | + <span class="ka-v3-segmented-icon" aria-hidden="true">☾</span> | |
| 56 | + <?php esc_html_e('Dark', 'king-addons'); ?> | |
| 57 | + </button> | |
| 58 | + <button type="button" class="ka-v3-segmented-btn" data-theme="auto" aria-pressed="<?php echo $theme_mode === 'auto' ? 'true' : 'false'; ?>"> | |
| 59 | + <span class="ka-v3-segmented-icon" aria-hidden="true">◐</span> | |
| 60 | + <?php esc_html_e('Auto', 'king-addons'); ?> | |
| 61 | + </button> | |
| 62 | + </div> | |
| 30 | 63 | <a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=import-export')); ?>" class="kng-v3-btn kng-v3-btn--ghost"> |
| 31 | 64 | <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 32 | 65 | <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/> |
| 33 | 66 | <polyline points="17 8 12 3 7 8"/> |
| @@ -42,9 +75,9 @@ | ||
| 42 | 75 | </svg> |
| 43 | 76 | <?php esc_html_e('Settings', 'king-addons'); ?> |
| 44 | 77 | </a> |
| 45 | 78 | <?php if ($at_limit): ?> |
| 46 | - <button type="button" class="kng-v3-btn kng-v3-btn--primary" disabled title="<?php esc_attr_e('Free version limit reached', 'king-addons'); ?>"> | |
| 79 | + <button type="button" class="kng-v3-btn kng-v3-btn--primary" id="kng-cc-add-new-limit"> | |
| 47 | 80 | <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"> |
| 48 | 81 | <line x1="12" y1="5" x2="12" y2="19"/> |
| 49 | 82 | <line x1="5" y1="12" x2="19" y2="12"/> |
| 50 | 83 | </svg> |
| @@ -75,9 +108,9 @@ | ||
| 75 | 108 | <option value="enable"><?php esc_html_e('Enable', 'king-addons'); ?></option> |
| 76 | 109 | <option value="disable"><?php esc_html_e('Disable', 'king-addons'); ?></option> |
| 77 | 110 | <option value="delete"><?php esc_html_e('Delete', 'king-addons'); ?></option> |
| 78 | 111 | </select> |
| 79 | - <button type="button" class="kng-v3-btn kng-v3-btn--ghost kng-v3-btn--sm" id="kng-cc-bulk-apply"> | |
| 112 | + <button type="button" class="kng-v3-btn kng-v3-btn--secondary kng-v3-btn--sm" id="kng-cc-bulk-apply"> | |
| 80 | 113 | <?php esc_html_e('Apply', 'king-addons'); ?> |
| 81 | 114 | </button> |
| 82 | 115 | </div> |
| 83 | 116 | </div> |
| @@ -120,9 +153,9 @@ | ||
| 120 | 153 | <div class="kng-cc-list"> |
| 121 | 154 | <?php if (empty($snippets)): ?> |
| 122 | 155 | <div class="kng-cc-empty"> |
| 123 | 156 | <div class="kng-cc-empty-icon"> |
| 124 | - <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="64" height="64"> | |
| 157 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="40" height="40"> | |
| 125 | 158 | <polyline points="16 18 22 12 16 6"/> |
| 126 | 159 | <polyline points="8 6 2 12 8 18"/> |
| 127 | 160 | </svg> |
| 128 | 161 | </div> |
| @@ -232,14 +265,15 @@ | ||
| 232 | 265 | </td> |
| 233 | 266 | <td class="kng-cc-col-actions"> |
| 234 | 267 | <div class="kng-cc-actions"> |
| 235 | 268 | <a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-custom-code&view=edit&id=' . $snippet['id'])); ?>" |
| 236 | - class="kng-cc-action-btn" | |
| 269 | + class="kng-cc-action-btn kng-cc-action-btn--edit" | |
| 237 | 270 | title="<?php esc_attr_e('Edit', 'king-addons'); ?>"> |
| 238 | - <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"> | |
| 271 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"> | |
| 239 | 272 | <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/> |
| 240 | 273 | <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/> |
| 241 | 274 | </svg> |
| 275 | + <?php esc_html_e('Edit', 'king-addons'); ?> | |
| 242 | 276 | </a> |
| 243 | 277 | <button type="button" |
| 244 | 278 | class="kng-cc-action-btn kng-cc-duplicate-btn" |
| 245 | 279 | data-id="<?php echo esc_attr($snippet['id']); ?>" |
| @@ -292,9 +326,9 @@ | ||
| 292 | 326 | <div class="kng-cc-pro-upsell-text"> |
| 293 | 327 | <h4><?php esc_html_e('Unlock Pro Features', 'king-addons'); ?></h4> |
| 294 | 328 | <p><?php esc_html_e('Get HTML snippets, unlimited code blocks, body open injection, custom hooks, advanced rules, and more.', 'king-addons'); ?></p> |
| 295 | 329 | </div> |
| 296 | - <a href="<?php echo esc_url(admin_url('admin.php?page=king-addons-upgrade')); ?>" class="kng-v3-btn kng-v3-btn--accent"> | |
| 330 | + <a href="https://kingaddons.com/pricing/?utm_source=kng-custom-code&utm_medium=wp-admin&utm_campaign=kng" target="_blank" rel="noopener" class="kng-v3-btn kng-v3-btn--accent"> | |
| 297 | 331 | <?php esc_html_e('Upgrade to Pro', 'king-addons'); ?> |
| 298 | 332 | </a> |
| 299 | 333 | </div> |
| 300 | 334 | </div> |
| @@ -299,4 +333,40 @@ | ||
| 299 | 333 | </div> |
| 300 | 334 | </div> |
| 301 | 335 | <?php endif; ?> |
| 302 | 336 | </div> |
| 337 | + | |
| 338 | +<?php if (!$has_pro): ?> | |
| 339 | +<!-- Pro Upgrade Popup --> | |
| 340 | +<div class="kng-cc-pro-popup-overlay" id="kng-cc-pro-popup" style="display:none;"> | |
| 341 | + <div class="kng-cc-pro-popup"> | |
| 342 | + <button type="button" class="kng-cc-pro-popup-close" id="kng-cc-pro-popup-close">×</button> | |
| 343 | + <div class="kng-cc-pro-popup-icon"> | |
| 344 | + <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="32" height="32"> | |
| 345 | + <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/> | |
| 346 | + </svg> | |
| 347 | + </div> | |
| 348 | + <h3><?php esc_html_e('Snippet Limit Reached', 'king-addons'); ?></h3> | |
| 349 | + <p><?php | |
| 350 | + printf( | |
| 351 | + /* translators: %d: free limit number */ | |
| 352 | + esc_html__('You\'ve reached the free limit of %d snippets. Upgrade to Pro for unlimited code snippets and advanced features.', 'king-addons'), | |
| 353 | + Custom_Code_Manager::FREE_LIMIT | |
| 354 | + ); | |
| 355 | + ?></p> | |
| 356 | + <div class="kng-cc-pro-popup-features"> | |
| 357 | + <span>✓ <?php esc_html_e('Unlimited snippets', 'king-addons'); ?></span> | |
| 358 | + <span>✓ <?php esc_html_e('HTML support', 'king-addons'); ?></span> | |
| 359 | + <span>✓ <?php esc_html_e('Advanced targeting', 'king-addons'); ?></span> | |
| 360 | + <span>✓ <?php esc_html_e('Custom hooks', 'king-addons'); ?></span> | |
| 361 | + </div> | |
| 362 | + <div class="kng-cc-pro-popup-actions"> | |
| 363 | + <a href="https://kingaddons.com/pricing/?utm_source=kng-custom-code&utm_medium=wp-admin&utm_campaign=kng" target="_blank" rel="noopener" class="kng-v3-btn kng-v3-btn--accent"> | |
| 364 | + <?php esc_html_e('Upgrade to Pro', 'king-addons'); ?> | |
| 365 | + </a> | |
| 366 | + <button type="button" class="kng-v3-btn kng-v3-btn--ghost kng-cc-pro-popup-dismiss"> | |
| 367 | + <?php esc_html_e('Maybe Later', 'king-addons'); ?> | |
| 368 | + </button> | |
| 369 | + </div> | |
| 370 | + </div> | |
| 371 | +</div> | |
| 372 | +<?php endif; ?> | |