| 1 |
<?php |
| 2 |
/** |
| 3 |
* Salient Property Summary Description Widget. |
| 4 |
* |
| 5 |
* @since 1.0.0 |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 9 |
|
| 10 |
class Salient_Property_Summary_Description_Widget { |
| 11 |
|
| 12 |
public function __construct() |
| 13 |
{ |
| 14 |
add_action('admin_head', array( $this, 'custom_wpbakery_element_icon' ), 999 ); |
| 15 |
add_action('vc_before_init', array( $this, 'custom_wpbakery_element' ) ); |
| 16 |
} |
| 17 |
|
| 18 |
public function custom_wpbakery_element_icon() |
| 19 |
{ |
| 20 |
echo '<style type="text/css"> |
| 21 |
.wpb_salient_property_summary_description .vc_element-icon:before, |
| 22 |
a[data-tag="salient_property_summary_description"] .vc_element-icon:before { |
| 23 |
font-family: "Dashicons" !important; |
| 24 |
content: "\f179"; |
| 25 |
} |
| 26 |
</style>'; |
| 27 |
} |
| 28 |
|
| 29 |
public function custom_wpbakery_element() |
| 30 |
{ |
| 31 |
$class_name = get_class($this); |
| 32 |
|
| 33 |
$widget_dir = dirname(__FILE__); |
| 34 |
|
| 35 |
$html_template = $widget_dir . '/' . str_replace("_", "-", str_replace(array( "salient_", "_widget" ), "", sanitize_title($class_name))) . '-html.php'; |
| 36 |
|
| 37 |
vc_map( array( |
| 38 |
"name" => __( 'Summary Description', 'propertyhive' ), |
| 39 |
"base" => "salient_property_summary_description", |
| 40 |
"class" => "", |
| 41 |
"category" => __( "Property Hive", "propertyhive"), |
| 42 |
"html_template" => $html_template, |
| 43 |
"params" => array( |
| 44 |
array( |
| 45 |
"type" => "checkbox", |
| 46 |
"class" => "", |
| 47 |
"heading" => __( 'Show Title', 'propertyhive' ), |
| 48 |
"param_name" => "show_title", |
| 49 |
"value" => array( 'Yes' => 'yes', 'No' => 'no' ), |
| 50 |
'std' => 'yes', // default unchecked |
| 51 |
), |
| 52 |
array( |
| 53 |
'type' => 'font_container', |
| 54 |
'param_name' => 'font_container', |
| 55 |
'value' => 'text_align:left', |
| 56 |
'settings' => array( |
| 57 |
'fields' => array( |
| 58 |
'text_align', |
| 59 |
'font_size', |
| 60 |
'line_height', |
| 61 |
'color', |
| 62 |
'tag_description' => esc_html__( 'Select element tag.', 'js_composer' ), |
| 63 |
'text_align_description' => esc_html__( 'Select text alignment.', 'js_composer' ), |
| 64 |
'font_size_description' => esc_html__( 'Enter font size.', 'js_composer' ), |
| 65 |
'line_height_description' => esc_html__( 'Enter line height.', 'js_composer' ), |
| 66 |
'color_description' => esc_html__( 'Select heading color.', 'js_composer' ), |
| 67 |
), |
| 68 |
), |
| 69 |
), |
| 70 |
array( |
| 71 |
'type' => 'css_editor', |
| 72 |
'heading' => __( 'CSS box', 'js_composer' ), |
| 73 |
'param_name' => 'css', |
| 74 |
'group' => __( 'Design Options', 'js_composer' ), |
| 75 |
), |
| 76 |
) |
| 77 |
)); |
| 78 |
} |
| 79 |
|
| 80 |
} |
| 81 |
|
| 82 |
new Salient_Property_Summary_Description_Widget(); |