currency-switcher
2 weeks ago
multi-currency
2 weeks ago
setup
2 weeks ago
status
2 weeks ago
store-urls
2 weeks ago
class-wcml-currencies-dropdown-ui.php
5 years ago
class-wcml-custom-files-ui.php
2 weeks ago
class-wcml-languages-upgrade-notice.php
4 years ago
class-wcml-menus-wrap-base.php
2 weeks ago
class-wcml-menus-wrap.php
2 weeks ago
class-wcml-multilingual-ui.php
8 months ago
class-wcml-not-translatable-attributes.php
2 weeks ago
class-wcml-pointer-ui.php
1 year ago
class-wcml-removed-cart-items-ui.php
2 weeks ago
class-wcml-settings-ui.php
2 weeks ago
class-wcml-st-taxonomy-ui.php
10 months ago
class-wcml-sync-taxonomy.php
2 weeks ago
class-wcml-templates-factory.php
2 weeks ago
class-wcml-troubleshooting-ui.php
2 weeks ago
class-wcml-pointer-ui.php
56 lines
| 1 | <?php |
| 2 | |
| 3 | class WCML_Pointer_UI extends WCML_Templates_Factory { |
| 4 | |
| 5 | private $content; |
| 6 | private $documentationUrl; |
| 7 | private $selector; |
| 8 | private $method; |
| 9 | private $anchor; |
| 10 | |
| 11 | public function __construct( |
| 12 | $content, |
| 13 | $documentationUrl = false, |
| 14 | $selector = false, |
| 15 | $method = false, |
| 16 | $anchor = false |
| 17 | ) { |
| 18 | parent::__construct(); |
| 19 | |
| 20 | $this->anchor = $anchor ?: __( 'How to translate this?', 'woocommerce-multilingual' ); |
| 21 | $this->selector = $selector; |
| 22 | $this->method = $method; |
| 23 | $this->content = $content; |
| 24 | $this->documentationUrl = $documentationUrl; |
| 25 | } |
| 26 | |
| 27 | public function get_model(){ |
| 28 | |
| 29 | $model = [ |
| 30 | 'pointer' => md5( rand( 0, 100 ) ), |
| 31 | 'selector' => $this->selector, |
| 32 | 'insert_method' => $this->method, |
| 33 | 'description' => [ |
| 34 | 'content' => $this->content, |
| 35 | 'trnsl_title' => $this->anchor, |
| 36 | 'doc_link' => $this->documentationUrl, |
| 37 | 'doc_link_text' => __( 'Learn more', 'woocommerce-multilingual' ), |
| 38 | ], |
| 39 | ]; |
| 40 | |
| 41 | return $model; |
| 42 | |
| 43 | } |
| 44 | |
| 45 | protected function init_template_base_dir() { |
| 46 | $this->template_paths = [ |
| 47 | WCML_PLUGIN_PATH . '/templates/', |
| 48 | ]; |
| 49 | } |
| 50 | |
| 51 | public function get_template() { |
| 52 | return 'pointer-ui.twig'; |
| 53 | } |
| 54 | |
| 55 | |
| 56 | } |