PluginProbe
ShiftController Employee Shift Scheduling / 4.9.24
ShiftController Employee Shift Scheduling v4.9.24
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / hc3 / ui / filter / buttons.php

buttons.php in ShiftController Employee Shift Scheduling 4.9.24, at hc3/ui/filter/buttons.php

130 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 class HC3_Ui_Filter_Buttons
3 {
4 protected $htmlFactory = NULL;
5
6 public function __construct( HC3_Ui $htmlFactory )
7 {
8 $this->htmlFactory = $htmlFactory;
9 }
10
11 public function process( $element )
12 {
13 if( ! method_exists($element, 'getUiType') ){
14 return $element;
15 }
16
17 $uiType = $element->getUiType();
18 $tags = $element->getTags();
19
20 if( in_array('button', $tags) ){
21 if( defined('WPINC') ){
22 $element
23 ->addAttr('class', 'button')
24 // ->addAttr('class', 'button-primary')
25 // ->addAttr('class', 'button-large')
26 ;
27 }
28 else {
29 $element
30 ->addAttr('class', 'hc-theme-btn-submit')
31 // ->addAttr('class', 'hc-theme-btn-primary')
32 ;
33 }
34 // $element
35 // ->addAttr('class', 'hc-xs-block')
36 // ;
37 }
38
39 if( in_array('primary', $tags) ){
40 if( defined('WPINC') ){
41 $element
42 ->addAttr('class', 'button')
43 ->addAttr('class', 'button-primary')
44 ->addAttr('class', 'button-large')
45 ;
46 }
47 else {
48 $element
49 ->addAttr('class', 'hc-theme-btn-submit')
50 ->addAttr('class', 'hc-theme-btn-primary')
51 ;
52 }
53
54 $element
55 ->addAttr('class', 'hc-xs-block')
56 ;
57 }
58
59 if( in_array('tab-link', $tags) ){
60 $element
61 ->addAttr('class', 'hc-block')
62 ->addAttr('class', 'hc-theme-tab-link')
63 ;
64 if( in_array('current', $tags) ){
65 $element
66 ->addAttr('class', 'hc-theme-tab-link-active')
67 ;
68 }
69 }
70
71 if( in_array('nice-link', $tags) ){
72 $element
73 ->addAttr('class', 'hc-block')
74 ->addAttr('class', 'hc-theme-nice-link')
75 ->addAttr('class', 'hc-nowrap')
76 ;
77 }
78
79 if( in_array('unstyled-link', $tags) ){
80 $element
81 ->addAttr('class', 'hc-unstyled-link')
82 ;
83 }
84
85 if( in_array('secondary', $tags) ){
86 if( defined('WPINC') && is_admin() ){
87 $element
88 ->addAttr('class', 'page-title-action')
89 ->addAttr('style', 'top: auto;');
90 ;
91 }
92 else {
93 $element
94 ->addAttr('class', 'hc-xs-block')
95 ->addAttr('class', 'hc-theme-btn-submit')
96 ->addAttr('class', 'hc-theme-btn-secondary')
97 ;
98 }
99 }
100
101 if( in_array('danger', $tags) ){
102 $element
103 ->addAttr('class', 'hc-xs-block')
104 ->addAttr('class', 'hc-theme-btn-submit')
105 ->addAttr('class', 'hcj2-confirm')
106
107 ->addAttr('class', 'hc-white')
108 ->addAttr('class', 'hc-bg-darkred')
109 ;
110 }
111
112 if( in_array('danger-link', $tags) ){
113 $element
114 ->addAttr('class', 'hc-theme-nice-link')
115 ->addAttr('class', 'hc-nowrap')
116 ->addAttr('class', 'hc-darkred')
117 ;
118 }
119
120
121
122 if( in_array('confirm', $tags) ){
123 $element
124 ->addAttr('class', 'hcj2-confirm')
125 ;
126 }
127
128 return $element;
129 }
130 }