PluginProbe
CSS & JavaScript Toolbox / 8.1
CSS & JavaScript Toolbox v8.1
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
css-javascript-toolbox / framework / types / attributes.class.php

attributes.class.php in CSS & JavaScript Toolbox 8.1, at framework/types/attributes.class.php

93 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 class CJTAttributes {
10
11 /**
12 * put your comment there...
13 *
14 * @var mixed
15 */
16 protected $flags;
17
18 /**
19 * put your comment there...
20 *
21 * @var mixed
22 */
23 protected $resetDefault;
24
25 /**
26 * put your comment there...
27 *
28 * @param mixed $init
29 */
30 public function __construct($initFlags = 0, $resetDefault = 0) {
31 $this->flags = $initFlags;
32 $this->resetDefault = $resetDefault;
33 }
34
35 /**
36 * put your comment there...
37 *
38 * @param mixed $flag
39 */
40 public function isOff($flag) {
41 return !$this->isOn($flag);
42 }
43
44 /**
45 * put your comment there...
46 *
47 * @param mixed $flag
48 */
49 public function isOn($flag) {
50 return $this->flags & $flag;
51 }
52
53 /**
54 * put your comment there...
55 *
56 * @param mixed $flag
57 */
58 public function off($flag) {
59 $this->flags &= (~$flag); // All other flags are ON except our!
60 return $this;
61 }
62
63 /**
64 * put your comment there...
65 *
66 * @param mixed $flag
67 */
68 public function on($flag) {
69 $this->flags &= $flag; // All other flag are OFF except our!
70 return $this;
71 }
72
73 /**
74 * put your comment there...
75 *
76 */
77 public function reset() {
78 $this->flags = $this->resetDefault;
79 return $this;
80 }
81
82 /**
83 * put your comment there...
84 *
85 * @param mixed $flag
86 */
87 public function revert($flag) {
88 $this->flags ^= $flag; // XOR
89 return $this;
90 }
91
92 } // End class.
93