PluginProbe
Property Hive / 2.2.4
Property Hive v2.2.4
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / salient-widgets / property-actions.php

property-actions.php in Property Hive 2.2.4, at includes/salient-widgets/property-actions.php

107 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Salient Property Actions Widget.
4 *
5 * @since 1.0.0
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
10 class Salient_Property_Actions_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_actions .vc_element-icon:before,
22 a[data-tag="salient_property_actions"] .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" => __( 'Actions', 'propertyhive' ),
39 "base" => "salient_property_actions",
40 "class" => "",
41 "category" => __( "Property Hive", "propertyhive"),
42 "html_template" => $html_template,
43 "params" => array(
44 array(
45 "type" => "dropdown",
46 "class" => "",
47 "heading" => __( 'Display As', 'propertyhive' ),
48 "param_name" => "display",
49 "value" => array(
50 __( 'List', 'propertyhive' ) => 'list',
51 __( 'Buttons', 'propertyhive' ) => 'buttons',
52 ),
53 'std' => 'list',
54 ),
55 array(
56 'type' => 'font_container',
57 'param_name' => 'font_container',
58 'value' => 'text_align:left',
59 'settings' => array(
60 'fields' => array(
61 'text_align',
62 'font_size',
63 'line_height',
64 'color',
65 'tag_description' => esc_html__( 'Select element tag.', 'js_composer' ),
66 'text_align_description' => esc_html__( 'Select text alignment.', 'js_composer' ),
67 'font_size_description' => esc_html__( 'Enter font size.', 'js_composer' ),
68 'line_height_description' => esc_html__( 'Enter line height.', 'js_composer' ),
69 'color_description' => esc_html__( 'Select heading color.', 'js_composer' ),
70 ),
71 ),
72 ),
73 array(
74 "type" => "colorpicker",
75 "class" => "",
76 "heading" => __( 'Button Background Colour', 'propertyhive' ),
77 "param_name" => "button_background_color",
78 'dependency' => array(
79 "element" => "display",
80 "value" => "buttons"
81 ),
82 "value" => '#000'
83 ),
84 array(
85 "type" => "colorpicker",
86 "class" => "",
87 "heading" => __( 'Button Text Colour', 'propertyhive' ),
88 "param_name" => "button_text_color",
89 'dependency' => array(
90 "element" => "display",
91 "value" => "buttons"
92 ),
93 "value" => '#FFF'
94 ),
95 array(
96 'type' => 'css_editor',
97 'heading' => __( 'CSS box', 'js_composer' ),
98 'param_name' => 'css',
99 'group' => __( 'Design Options', 'js_composer' ),
100 ),
101 )
102 ));
103 }
104
105 }
106
107 new Salient_Property_Actions_Widget();