| 1 |
<?php |
| 2 |
defined('ABSPATH') || exit; |
| 3 |
|
| 4 |
/** |
| 5 |
* Module Name: Image |
| 6 |
* Description: Display Image content |
| 7 |
*/ |
| 8 |
class TB_Image_Module extends Themify_Builder_Component_Module { |
| 9 |
|
| 10 |
public static function get_module_name():string { |
| 11 |
return __('Image', 'themify'); |
| 12 |
} |
| 13 |
|
| 14 |
public static function get_js_css():array { |
| 15 |
return array( |
| 16 |
'css' => 1 |
| 17 |
); |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* Backward Compatibility methods |
| 22 |
*/ |
| 23 |
public function __construct() { |
| 24 |
parent::__construct('image'); |
| 25 |
} |
| 26 |
|
| 27 |
public function get_name() { |
| 28 |
return self::get_module_name(); |
| 29 |
} |
| 30 |
|
| 31 |
function get_assets() { |
| 32 |
return self::get_js_css(); |
| 33 |
} |
| 34 |
|
| 35 |
public static function get_styling_image_fields() : array { |
| 36 |
return [ |
| 37 |
'background_image' => '' |
| 38 |
]; |
| 39 |
} |
| 40 |
|
| 41 |
public static function get_translatable_text_fields( $module ) : array { |
| 42 |
return [ 'mod_title_image', 'title_image', 'alt_image' ]; |
| 43 |
} |
| 44 |
|
| 45 |
public static function get_translatable_textarea_fields( $module ) : array { |
| 46 |
return [ 'caption_image' ]; |
| 47 |
} |
| 48 |
|
| 49 |
public static function get_translatable_link_fields( $module ) : array { |
| 50 |
return [ 'url_image', 'link_image' ]; |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
new TB_Image_Module();//backward for builder-pro |
| 55 |
|