PluginProbe
Bookit — Booking & Appointment Calendar / 2.6.0.5
Bookit — Booking & Appointment Calendar v2.6.0.5
2.6.0.5 2.6.0.4 2.6.0.3 2.6.0.2 2.6.0.1 2.6.0 trunk 1.2 1.2.2 1.2.3 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 All 62 releases
bookit / includes / widgets / VisualComposerWidget.php

VisualComposerWidget.php in Bookit — Booking & Appointment Calendar 2.6.0.5, at includes/widgets/VisualComposerWidget.php

64 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Bookit\Widgets;
4
5 use Bookit\Classes\Database\Categories;
6 use Bookit\Classes\Database\Services;
7 use Bookit\Classes\Database\Staff;
8
9 class VisualComposerWidget {
10
11 /**
12 * Load
13 */
14 public function load() {
15 vc_lean_map( 'bookit', [$this, 'bookit_vc_element'] );
16 }
17
18 /**
19 * @return array
20 */
21 function bookit_vc_element() {
22
23 $categories = Categories::get_all();
24 $services = Services::get_all();
25 $staff = Staff::get_all_shorted();
26 $categories_list = bookit_data_to_list($categories, 'name', 'id');
27 $services_list = bookit_data_to_list($services, 'title', 'id');
28 $staff_list = bookit_data_to_list($staff, 'full_name', 'id');
29
30 return array(
31 'base' => "bookit",
32 'name' => esc_html__( 'Bookit Calendar', 'bookit' ),
33 'icon' => BOOKIT_URL . '/assets/images/icon-100x100.png' ,
34 'category' => esc_html__( 'Content', 'bookit' ),
35 'description' => esc_html__( 'Place Bookit Calendar', 'bookit' ),
36 'params' => array(
37 array(
38 'type' => 'dropdown',
39 'heading' => esc_html__( 'Select Category', 'bookit' ),
40 'param_name' => 'category',
41 'value' => $categories_list,
42 'save_always' => true,
43 'description' => '',
44 ),
45 array(
46 'type' => 'dropdown',
47 'heading' => esc_html__( 'Select Service', 'bookit' ),
48 'param_name' => 'service',
49 'value' => $services_list,
50 'save_always' => true,
51 'description' => '',
52 ),
53 array(
54 'type' => 'dropdown',
55 'heading' => esc_html__( 'Select Staff', 'bookit' ),
56 'param_name' => 'staff',
57 'value' => $staff_list,
58 'save_always' => true,
59 'description' => '',
60 )
61 )
62 );
63 }
64 }