class-content-box-large.php
1 year ago
class-enhancement-settings-component.php
1 year ago
class-input-checkbox.php
1 year ago
class-link-box.php
1 year ago
class-modal-editor-previews.php
1 year ago
class-modal-feedback.php
1 year ago
class-modal.php
1 year ago
class-navigation.php
1 year ago
class-newsletter-form.php
1 year ago
class-outdated-browser-warning.php
1 year ago
class-premium-box-large.php
1 year ago
class-premium-box.php
1 year ago
class-premium-feature-list.php
1 year ago
class-review-box.php
1 year ago
class-support-box.php
1 year ago
class-support-link-boxes.php
1 year ago
class-link-box.php
55 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SuperbAddons\Components\Admin; |
| 4 | |
| 5 | defined('ABSPATH') || exit(); |
| 6 | |
| 7 | class LinkBox |
| 8 | { |
| 9 | private $id = false; |
| 10 | private $title = false; |
| 11 | private $description = false; |
| 12 | private $link = false; |
| 13 | private $cta = false; |
| 14 | private $icon = false; |
| 15 | private $pro = false; |
| 16 | private $classes = false; |
| 17 | private $same_window = false; |
| 18 | |
| 19 | public function __construct($options) |
| 20 | { |
| 21 | $this->id = $options['id'] ?? false; |
| 22 | $this->title = $options['title'] ?? false; |
| 23 | $this->description = $options['description'] ?? false; |
| 24 | $this->link = $options['link'] ?? false; |
| 25 | $this->cta = $options['cta'] ?? false; |
| 26 | $this->icon = $options['icon'] ?? false; |
| 27 | $this->pro = $options['pro'] ?? false; |
| 28 | $this->classes = $options['classes'] ?? false; |
| 29 | $this->same_window = $options['same_window'] ?? false; |
| 30 | |
| 31 | $this->Render(); |
| 32 | } |
| 33 | |
| 34 | private function Render() |
| 35 | { |
| 36 | ?> |
| 37 | <div class="superbaddons-admindashboard-content-box <?= $this->classes ? esc_attr($this->classes) : ''; ?>" <?php if ($this->id) : ?>id="<?= esc_attr($this->id); ?>" <?php endif; ?>> |
| 38 | <div class="superbaddons-admindashboard-link-box-inner"> |
| 39 | <?php if ($this->pro) : ?> |
| 40 | <span class="superbaddons-element-pro-badge"><?= esc_html__("Premium", "superb-blocks"); ?></span> |
| 41 | <?php endif; ?> |
| 42 | <img class="superbaddons-admindashboard-content-icon superbaddons-element-mb1" src="<?= esc_url(SUPERBADDONS_ASSETS_PATH . '/img/' . $this->icon); ?>" /> |
| 43 | <h4 class="superbaddons-element-text-md superbaddons-element-text-800 superbaddons-element-text-dark superbaddons-element-m0"><?= esc_html($this->title); ?> </h4> |
| 44 | <p class="superbaddons-element-text-xxs superbaddons-element-text-gray"> |
| 45 | <?= esc_html($this->description); ?> |
| 46 | </p> |
| 47 | <?php if ($this->cta && $this->link) : ?> |
| 48 | <a <?= !$this->same_window ? 'target="_blank"' : ''; ?> class="<?= $this->pro ? 'superbaddons-element-button-pro' : 'superbaddons-element-colorlink'; ?> superbaddons-element-text-xs" href="<?= esc_url($this->link); ?>"><?= esc_html($this->cta); ?></a> |
| 49 | <?php endif; ?> |
| 50 | </div> |
| 51 | </div> |
| 52 | <?php |
| 53 | } |
| 54 | } |
| 55 |