PATH:
home
/
fengshp
/
www
/
wp-content
/
plugins
/
builder-button
/
modules
<?php if (!defined('ABSPATH')) exit; // Exit if accessed directly /** * Module Name: Button Pro */ class TB_Button_Module extends Themify_Builder_Component_Module { public static function get_js_css():array { $url=Builder_Button::$url . 'assets/'; $res=array( 'css' => $url.'style.min', 'ver' => Builder_Button::get_version() ); if(!Themify_Builder_Model::is_front_builder_activate()){ $res['js']=$url . 'scripts'; } return $res; } public static function get_json_file():array{ return ['f'=>Builder_Button::$url . 'json/style.json','v'=>Builder_Button::get_version()]; } public static function get_module_name():string { add_filter( 'themify_builder_active_vars', [ __CLASS__, 'builder_active_enqueue' ] ); return __('Button Pro', 'builder-button'); } public static function get_module_icon():string { return 'hand-point-up'; } public static function builder_active_enqueue(array $vars ):array { if(!isset($vars['addons'])){//backward themify_enque_script( 'tb_builder-button', Builder_Button::$url . 'assets/active.js', Builder_Button::get_version(), [ 'themify-builder-app-js' ] ); } else{ $vars['addons'][Builder_Button::$url . 'assets/active.js']=Builder_Button::get_version(); } $i18n = include dirname( __DIR__ ) . '/includes/i18n.php'; $vars['i18n']['label']+= $i18n; return $vars; } public function get_styling() {//deprecated $general = array( //bacground self::get_expand('bg', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_color('', 'background_color', 'bg_c', 'background-color') ) ), 'h' => array( 'options' => array( self::get_color('', 'bg_c', 'bg_c', 'background-color', 'h') ) ) )) )), // Font self::get_expand('f', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_font_family(''), self::get_color_type(''), self::get_font_size(), self::get_font_style('', 'f_fs_g', 'f_fw_g'), self::get_line_height(), self::get_text_align(), self::get_text_decoration(''), self::get_text_shadow(''), ) ), 'h' => array( 'options' => array( self::get_font_family('', 'f_f', 'h'), self::get_color_type('', '', 'f_c_g_h', 'f_c_h', 'f_g_c_h'), self::get_font_size('', 'f_s', '', 'h'), self::get_font_style('', 'f_fs_g', 'f_fw_g', 'h'), self::get_text_decoration('', 't_t_h'), self::get_text_shadow('', 't_sh', 'h'), ) ) )) )), // Padding self::get_expand('p', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_padding('') ) ), 'h' => array( 'options' => array( self::get_padding('', 'p', 'h') ) ) )) )), // Margin self::get_expand('m', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_margin('') ) ), 'h' => array( 'options' => array( self::get_margin('', 'm', 'h') ) ) )) )), // Border self::get_expand('b', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_border('') ) ), 'h' => array( 'options' => array( self::get_border('', 'b', 'h') ) ) )) )), // Width self::get_expand('w', array( self::get_width('', 'w') )), // Height & Min Height self::get_expand('ht', array( self::get_height(), self::get_min_height(''), self::get_max_height('') ) ), // Rounded Corners self::get_expand('r_c', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_border_radius() ) ), 'h' => array( 'options' => array( self::get_border_radius('', 'r_c', 'h') ) ) )) ) ), // Shadow self::get_expand('sh', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_box_shadow() ) ), 'h' => array( 'options' => array( self::get_box_shadow('', 'sh', 'h') ) ) )) ) ), // Display self::get_expand('disp', self::get_display()) ); $button_link = array( //bacground self::get_expand('bg', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_color('.module-button a', 'button_background_color', 'bg_c', 'background-color') ) ), 'h' => array( 'options' => array( self::get_color('.module-button a', 'bg_c', 'bg_c', 'background-color', 'h') ) ) )) )), // Link self::get_expand('l', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_color_type('.module-button a span', 'link_color'), self::get_text_decoration(array('.module-button a span')) ) ), 'h' => array( 'options' => array( self::get_color_type('.module-button a:hover span', 'hover_link_color'), self::get_text_decoration('.module-button a:hover span', 't_t_h'), ) ) )) )), // Padding self::get_expand('p', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_padding(' a', 'padding_link') ) ), 'h' => array( 'options' => array( self::get_padding(' a', 'p_l', 'h') ) ) )) )), // Margin self::get_expand('m', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_margin(' a', 'link_margin') ) ), 'h' => array( 'options' => array( self::get_margin(' a', 'l_m', 'h') ) ) )) )), // Border self::get_expand('b', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_border(' a', 'link_border') ) ), 'h' => array( 'options' => array( self::get_border(' a', 'l_b', 'h') ) ) )) )), // Rounded Corners self::get_expand('r_c', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_border_radius(' a', 'l_b_r_c') ) ), 'h' => array( 'options' => array( self::get_border_radius(' a', 'l_b_r_c', 'h') ) ) )) ) ), // Shadow self::get_expand('sh', array( self::get_tab(array( 'n' => array( 'options' => array( self::get_box_shadow('.module a', 'l_b_sh') ) ), 'h' => array( 'options' => array( self::get_box_shadow('.module a', 'l_b_sh', 'h') ) ) )) ) ) ); return array( 'type' => 'tabs', 'options' => array( 'g' => array( 'options' => $general ), 'b' => array( 'label' => __('Button Link', 'themify'), 'options' => $button_link ) ) ); } /** * Returns a unique ID to be used for the modal lightbox * Same module may be repeated on a page so $module_id alone is not reliable. * * @return string */ public static function modal_id($module_id) { static $id = 1; return 'modal-' . $module_id . '-' . $id++; } /** * Backward compatibility */ public function __construct() { if (method_exists('Themify_Builder_Model', 'add_module')) { parent::__construct('button'); } else {//backward parent::__construct(array( 'name' => $this->get_name(), 'slug' => 'button', 'category' => $this->get_group() )); } } public function get_name(){ return self::get_module_name(); } public function get_icon(){ return self::get_module_icon(); } function get_assets() { return self::get_js_css(); } } if(!method_exists( 'Themify_Builder_Component_Module', 'get_module_class' )){ if (method_exists('Themify_Builder_Model', 'add_module')) { new TB_Button_Module(); } else { Themify_Builder_Model::register_module('TB_Button_Module'); } }
[+]
..
[-] module-button.php
[edit]