class-wcml-status-config-warnings-ui.php
4 weeks ago
class-wcml-status-media-ui.php
4 weeks ago
class-wcml-status-multi-currencies-ui.php
4 weeks ago
class-wcml-status-products-ui.php
4 weeks ago
class-wcml-status-status-ui.php
4 weeks ago
class-wcml-status-store-pages-ui.php
4 weeks ago
class-wcml-status-taxonomies-ui.php
4 weeks ago
class-wcml-status-ui.php
4 weeks ago
class-wcml-status-ui.php
62 lines
| 1 | <?php |
| 2 | |
| 3 | use function WCML\functions\isStandAlone; |
| 4 | |
| 5 | class WCML_Status_UI extends WCML_Templates_Factory { |
| 6 | private $woocommerce_wpml; |
| 7 | private $sitepress; |
| 8 | private $sitepress_settings; |
| 9 | |
| 10 | |
| 11 | public function __construct( $woocommerce_wpml, $sitepress, $sitepress_settings ) { |
| 12 | parent::__construct(); |
| 13 | |
| 14 | $this->woocommerce_wpml = $woocommerce_wpml; |
| 15 | $this->sitepress = $sitepress; |
| 16 | $this->sitepress_settings = $sitepress_settings; |
| 17 | } |
| 18 | |
| 19 | public function get_model() { |
| 20 | |
| 21 | $WCML_Status_Status_UI = new WCML_Status_Status_UI( $this->sitepress ); |
| 22 | $WCML_Status_Config_Warnings_UI = new WCML_Status_Config_Warnings_UI( $this->sitepress, $this->woocommerce_wpml, $this->sitepress_settings ); |
| 23 | $WCML_Status_Store_Pages_UI = new WCML_Status_Store_Pages_UI( $this->sitepress, $this->woocommerce_wpml ); |
| 24 | $WCML_Status_Taxonomies_UI = new WCML_Status_Taxonomies_UI( $this->sitepress, $this->woocommerce_wpml ); |
| 25 | $WCML_Status_Multi_Currencies_UI = new WCML_Status_Multi_Currencies_UI( $this->woocommerce_wpml ); |
| 26 | $WCML_Status_Media_UI = new WCML_Status_Media_UI( $this->sitepress ); |
| 27 | |
| 28 | $model = [ |
| 29 | 'plugins_status' => $WCML_Status_Status_UI->get_view(), |
| 30 | 'conf_warnings' => $WCML_Status_Config_Warnings_UI->get_view(), |
| 31 | 'store_pages' => $WCML_Status_Store_Pages_UI->get_view(), |
| 32 | 'taxonomies' => $WCML_Status_Taxonomies_UI->get_view(), |
| 33 | 'multi_currency' => $WCML_Status_Multi_Currencies_UI->get_view(), |
| 34 | 'media' => $WCML_Status_Media_UI->get_view(), |
| 35 | 'troubl_url' => \WCML\Utilities\AdminUrl::getTroubleshootingTab(), |
| 36 | 'strings' => [ |
| 37 | 'troubl' => __( 'Troubleshooting', 'woocommerce-multilingual' ), |
| 38 | ], |
| 39 | ]; |
| 40 | |
| 41 | if ( |
| 42 | ! isStandAlone() |
| 43 | && ! $this->woocommerce_wpml->products->is_product_display_as_translated_post_type() |
| 44 | ) { |
| 45 | $WCML_Status_Products_UI = new WCML_Status_Products_UI( $this->woocommerce_wpml, $this->sitepress ); |
| 46 | $model['products'] = $WCML_Status_Products_UI->get_view(); |
| 47 | } |
| 48 | |
| 49 | return $model; |
| 50 | } |
| 51 | |
| 52 | public function init_template_base_dir() { |
| 53 | $this->template_paths = [ |
| 54 | WCML_PLUGIN_PATH . '/templates/status/', |
| 55 | ]; |
| 56 | } |
| 57 | |
| 58 | public function get_template() { |
| 59 | return 'status.twig'; |
| 60 | } |
| 61 | } |
| 62 |