WCML_Custom_Files_UI

Created by OnTheGo Systems.

Defined (1)

The class is defined in the following location(s).

/inc/template-classes/class-wcml-custom-files-ui.php  
  1. class WCML_Custom_Files_UI extends WPML_Templates_Factory { 
  2.  
  3. private $woocommerce_wpml; 
  4. private $product_id; 
  5. private $is_variation; 
  6.  
  7. /** 
  8. * WCML_Custom_Files_UI constructor. 
  9. * @param woocommerce_wpml $woocommerce_wpml 
  10. * @param int $product_id 
  11. * @param bool $is_variation 
  12. */ 
  13. function __construct( &$woocommerce_wpml, $product_id, $is_variation = false ) { 
  14. parent::__construct(); 
  15.  
  16. $this->woocommerce_wpml = &$woocommerce_wpml; 
  17. $this->product_id = $product_id; 
  18. $this->is_variation = $is_variation; 
  19.  
  20.  
  21. public function get_model() { 
  22.  
  23. $model = array( 
  24. 'product_id' => $this->product_id,  
  25. 'is_variation' => $this->is_variation,  
  26. 'nonce' => wp_nonce_field('wcml_save_files_option', 'wcml_save_files_option_nonce'),  
  27. 'sync_custom' => get_post_meta( $this->product_id, 'wcml_sync_files', true ),  
  28. 'strings' => array( 
  29. 'use_custom' => __( 'Use custom settings for translations download files', 'woocommerce-multilingual' ),  
  30. 'use_same' => __( 'Use the same files for translations', 'woocommerce-multilingual' ),  
  31. 'separate' => __( 'Add separate download files for translations when you translate this product', 'woocommerce-multilingual' ) 
  32. ); 
  33.  
  34. return $model; 
  35.  
  36. public function init_template_base_dir() { 
  37. $this->template_paths = array( 
  38. WCML_PLUGIN_PATH . '/templates/',  
  39. ); 
  40.  
  41. public function get_template() { 
  42. return 'custom-files.twig';