WC_Dynamic_Gallery_Icon_Styles_Settings

The WooCommerce Dynamic Gallery LITE WC Dynamic Gallery Icon Styles Settings class.

Defined (1)

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

/admin/settings/gallery-icon-styles-settings.php  
  1. class WC_Dynamic_Gallery_Icon_Styles_Settings extends WC_Dynamic_Gallery_Admin_UI 
  2.  
  3. /** 
  4. * @var string 
  5. */ 
  6. private $parent_tab = 'gallery-icon-styles'; 
  7.  
  8. /** 
  9. * @var array 
  10. */ 
  11. private $subtab_data; 
  12.  
  13. /** 
  14. * @var string 
  15. * You must change to correct option name that you are working 
  16. */ 
  17. public $option_name = ''; 
  18.  
  19. /** 
  20. * @var string 
  21. * You must change to correct form key that you are working 
  22. */ 
  23. public $form_key = 'wc_dgallery_icon_styles_settings'; 
  24.  
  25. /** 
  26. * @var string 
  27. * You can change the order show of this sub tab in list sub tabs 
  28. */ 
  29. private $position = 1; 
  30.  
  31. /** 
  32. * @var array 
  33. */ 
  34. public $form_fields = array(); 
  35.  
  36. /** 
  37. * @var array 
  38. */ 
  39. public $form_messages = array(); 
  40.  
  41. /**-----------------------------------------------------------------------------------*/ 
  42. /** __construct() */ 
  43. /** Settings Constructor */ 
  44. /**-----------------------------------------------------------------------------------*/ 
  45. public function __construct() { 
  46. $this->init_form_fields(); 
  47. $this->subtab_init(); 
  48.  
  49. $this->form_messages = array( 
  50. 'success_message' => __( 'Dynamic Gallery Icon Styles successfully saved.', 'woo_dgallery' ),  
  51. 'error_message' => __( 'Error: Dynamic Gallery Icon Styles can not save.', 'woo_dgallery' ),  
  52. 'reset_message' => __( 'Dynamic Gallery Icon Styles successfully reseted.', 'woo_dgallery' ),  
  53. ); 
  54.  
  55. add_action( $this->plugin_name . '-' . $this->form_key . '_settings_end', array( $this, 'include_script' ) ); 
  56.  
  57. add_action( $this->plugin_name . '_set_default_settings' , array( $this, 'set_default_settings' ) ); 
  58. //add_action( $this->plugin_name . '_get_all_settings' , array( $this, 'get_settings' ) ); 
  59.  
  60.  
  61. /**-----------------------------------------------------------------------------------*/ 
  62. /** subtab_init() */ 
  63. /** Sub Tab Init */ 
  64. /**-----------------------------------------------------------------------------------*/ 
  65. public function subtab_init() { 
  66.  
  67. add_filter( $this->plugin_name . '-' . $this->parent_tab . '_settings_subtabs_array', array( $this, 'add_subtab' ), $this->position ); 
  68.  
  69.  
  70. /**-----------------------------------------------------------------------------------*/ 
  71. /** set_default_settings() 
  72. /** Set default settings with function called from Admin Interface */ 
  73. /**-----------------------------------------------------------------------------------*/ 
  74. public function set_default_settings() { 
  75. global $wc_dgallery_admin_interface; 
  76.  
  77. $wc_dgallery_admin_interface->reset_settings( $this->form_fields, $this->option_name, false ); 
  78.  
  79. /**-----------------------------------------------------------------------------------*/ 
  80. /** get_settings() 
  81. /** Get settings with function called from Admin Interface */ 
  82. /**-----------------------------------------------------------------------------------*/ 
  83. public function get_settings() { 
  84. global $wc_dgallery_admin_interface; 
  85.  
  86. $wc_dgallery_admin_interface->get_settings( $this->form_fields, $this->option_name ); 
  87.  
  88. /** 
  89. * subtab_data() 
  90. * Get SubTab Data 
  91. * ============================================= 
  92. * array (  
  93. * 'name' => 'my_subtab_name' : (required) Enter your subtab name that you want to set for this subtab 
  94. * 'label' => 'My SubTab Name' : (required) Enter the subtab label 
  95. * 'callback_function' => 'my_callback_function' : (required) The callback function is called to show content of this subtab 
  96. * ) 
  97. */ 
  98. public function subtab_data() { 
  99.  
  100. $subtab_data = array(  
  101. 'name' => 'gallery-icon-styles',  
  102. 'label' => __( 'Icon Styles', 'woo_dgallery' ),  
  103. 'callback_function' => 'wc_dgallery_icon_styles_settings_form',  
  104. ); 
  105.  
  106. if ( $this->subtab_data ) return $this->subtab_data; 
  107. return $this->subtab_data = $subtab_data; 
  108.  
  109.  
  110. /**-----------------------------------------------------------------------------------*/ 
  111. /** add_subtab() */ 
  112. /** Add Subtab to Admin Init 
  113. /**-----------------------------------------------------------------------------------*/ 
  114. public function add_subtab( $subtabs_array ) { 
  115.  
  116. if ( ! is_array( $subtabs_array ) ) $subtabs_array = array(); 
  117. $subtabs_array[] = $this->subtab_data(); 
  118.  
  119. return $subtabs_array; 
  120.  
  121. /**-----------------------------------------------------------------------------------*/ 
  122. /** settings_form() */ 
  123. /** Call the form from Admin Interface 
  124. /**-----------------------------------------------------------------------------------*/ 
  125. public function settings_form() { 
  126. global $wc_dgallery_admin_interface; 
  127.  
  128. $output = ''; 
  129. $output .= $wc_dgallery_admin_interface->admin_forms( $this->form_fields, $this->form_key, $this->option_name, $this->form_messages ); 
  130.  
  131. return $output; 
  132.  
  133. /**-----------------------------------------------------------------------------------*/ 
  134. /** init_form_fields() */ 
  135. /** Init all fields of this form */ 
  136. /**-----------------------------------------------------------------------------------*/ 
  137. public function init_form_fields() { 
  138.  
  139. // Define settings  
  140. $this->form_fields = apply_filters( $this->option_name . '_settings_fields', array( 
  141.  
  142. array( 
  143. 'name' => __( "GALLERY ICONS STYLE SUPER POWERS", 'woo_dgallery' ),  
  144. 'type' => 'heading',  
  145. 'desc' => '<img class="rwd_image_maps" src="'.WOO_DYNAMIC_GALLERY_IMAGES_URL.'/icon_styles_tab.png" usemap="#productCardsMap" style="width: auto; max-width: 100%;" border="0" /> 
  146. <map name="productCardsMap" id="productCardsMap"> 
  147. <area shape="rect" coords="270, 225, 844, 163" href="'.$this->pro_plugin_page_url.'" target="_blank" /> 
  148. </map>',  
  149. 'alway_open'=> true,  
  150. 'id' => 'dgallery_icon_styles_premium_box',  
  151. 'is_box' => true,  
  152. ),  
  153.  
  154. ) ); 
  155.  
  156. public function include_script() { 
  157. ?> 
  158. <style type="text/css"> 
  159. .a3rev_panel_container p.submit { 
  160. display: none; 
  161. </style> 
  162. <?php 
  163. wp_enqueue_script( 'jquery-rwd-image-maps' );