PluginProbe
ShiftController Employee Shift Scheduling / 4.9.85
ShiftController Employee Shift Scheduling v4.9.85
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.85, at hc3/ui/filter/buttons.php

146 lines 3.1 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 ;
63
64 if( (! defined('WPINC')) OR is_admin() ){
65 $element
66 ->addAttr('class', 'hc-theme-tab-link')
67 ;
68 if( in_array('current', $tags) ){
69 $element
70 ->addAttr('class', 'hc-theme-tab-link-active')
71 ;
72 }
73 }
74 }
75
76 if( in_array('nice-link', $tags) ){
77 $element
78 ->addAttr('class', 'hc-block')
79 ->addAttr('class', 'hc-nowrap')
80 ->addAttr('class', 'hc-theme-nice-link')
81 ;
82 if( (! defined('WPINC')) OR is_admin() ){
83 $element
84 ->addAttr('class', 'hc-theme-nice-link-color')
85 ;
86 }
87 }
88
89 if( in_array('unstyled-link', $tags) ){
90 $element
91 ->addAttr('class', 'hc-unstyled-link')
92 ;
93 }
94
95 if( in_array('secondary', $tags) ){
96 if( defined('WPINC') ){
97 if( is_admin() ){
98 $element
99 ->addAttr('class', 'page-title-action')
100 ->addAttr('style', 'top: auto;');
101 ;
102 }
103 }
104 else {
105 $element
106 ->addAttr('class', 'hc-xs-block')
107 ->addAttr('class', 'hc-theme-btn-submit')
108 ->addAttr('class', 'hc-theme-btn-secondary')
109 ;
110 }
111 }
112
113 if( in_array('danger', $tags) ){
114 $element
115 ->addAttr('class', 'hc-xs-block')
116 ->addAttr('class', 'hc-theme-btn-submit')
117 ->addAttr('class', 'hcj2-confirm')
118
119 ->addAttr('class', 'hc-white')
120 ->addAttr('class', 'hc-bg-darkred')
121 ;
122 }
123
124 if( in_array('danger-link', $tags) ){
125 $element
126 ->addAttr('class', 'hc-theme-nice-link')
127 ->addAttr('class', 'hc-nowrap')
128 ->addAttr('class', 'hc-darkred')
129 ;
130
131 if( (! defined('WPINC')) OR is_admin() ){
132 $element
133 ->addAttr('class', 'hc-theme-nice-link-color')
134 ;
135 }
136 }
137
138 if( in_array('confirm', $tags) ){
139 $element
140 ->addAttr('class', 'hcj2-confirm')
141 ;
142 }
143
144 return $element;
145 }
146 }