PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 9.4
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v9.4
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / framework / types / attributes.class.php

attributes.class.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 9.4, 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