| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Promotions\AdminMenuItems; |
| 4 |
|
| 5 |
use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page; |
| 6 |
use Elementor\Settings; |
| 7 |
use Elementor\Utils; |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly |
| 11 |
} |
| 12 |
|
| 13 |
abstract class Base_Promotion_Template implements Admin_Menu_Item_With_Page { |
| 14 |
|
| 15 |
abstract protected function get_promotion_title(); |
| 16 |
|
| 17 |
abstract protected function get_cta_url(); |
| 18 |
|
| 19 |
abstract protected function set_list(); |
| 20 |
|
| 21 |
abstract protected function get_video_url(); |
| 22 |
|
| 23 |
public function is_visible() { |
| 24 |
return true; |
| 25 |
} |
| 26 |
|
| 27 |
public function get_parent_slug() { |
| 28 |
return Settings::PAGE_ID; |
| 29 |
} |
| 30 |
|
| 31 |
public function get_capability() { |
| 32 |
return 'manage_options'; |
| 33 |
} |
| 34 |
|
| 35 |
protected function get_cta_text() { |
| 36 |
return esc_html__( 'Upgrade Now', 'elementor' ); |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Should the promotion have a side note. |
| 41 |
* @return string |
| 42 |
*/ |
| 43 |
protected function get_side_note() { |
| 44 |
return ''; |
| 45 |
} |
| 46 |
|
| 47 |
protected function get_list() { |
| 48 |
ob_start(); |
| 49 |
if ( ! empty( $this->set_list() ) ) { |
| 50 |
?> |
| 51 |
<ul> |
| 52 |
<?php foreach ( $this->set_list() as $item ) { ?> |
| 53 |
<li><?php Utils::print_unescaped_internal_string( $item ); ?></li> |
| 54 |
<?php } ?> |
| 55 |
</ul> |
| 56 |
<?php |
| 57 |
} |
| 58 |
|
| 59 |
return ob_get_clean(); |
| 60 |
} |
| 61 |
|
| 62 |
public function render() { |
| 63 |
?> |
| 64 |
<div class="e-feature-promotion"> |
| 65 |
<div class="e-feature-promotion_data"> |
| 66 |
<h3><?php Utils::print_unescaped_internal_string( $this->get_promotion_title() ); ?></h3> |
| 67 |
|
| 68 |
<?php Utils::print_unescaped_internal_string( $this->get_list() ); ?> |
| 69 |
|
| 70 |
<a class="elementor-button go-pro" href="<?php echo esc_url( $this->get_cta_url() ); ?>" target="_blank"> |
| 71 |
<?php Utils::print_unescaped_internal_string( $this->get_cta_text() ); ?> |
| 72 |
</a> |
| 73 |
|
| 74 |
<?php if ( ! empty( $this->get_side_note() ) ) { ?> |
| 75 |
<div class="side-note"> |
| 76 |
<p><?php Utils::print_unescaped_internal_string( $this->get_side_note() ); ?></p> |
| 77 |
</div> |
| 78 |
<?php } ?> |
| 79 |
|
| 80 |
</div> |
| 81 |
|
| 82 |
<iframe class="e-feature-promotion_iframe" src="<?php Utils::print_unescaped_internal_string( $this->get_video_url() ); ?>" title="Elementor" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> |
| 83 |
</div> |
| 84 |
<?php |
| 85 |
} |
| 86 |
} |
| 87 |
|