PluginProbe
CSS & JavaScript Toolbox / 11
CSS & JavaScript Toolbox v11
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 / developer / interface / block / parameters / parameters.php

parameters.php in CSS & JavaScript Toolbox 11, at framework/developer/interface/block/parameters/parameters.php

105 lines 1.8 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 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 /**
10 *
11 */
12 abstract class CJT_Framework_Developer_Interface_Block_Parameters_Parameters {
13
14 /**
15 * put your comment there...
16 *
17 * @var mixed
18 */
19 protected $contentParameter = null;
20
21 /**
22 * put your comment there...
23 *
24 * @var mixed
25 */
26 protected $params = array();
27
28 /**
29 * put your comment there...
30 *
31 * @param mixed $parameters
32 * @param mixed $fatory
33 * @return CJT_Framework_Developer_Interface_Block_Parameters_Parameters
34 */
35 public function __construct($parameters) {
36 // Validate parameters.
37 foreach ($parameters as $parameter) {
38 // Create type object.
39 $parameterModel = $this->params[$parameter->getName(true)] = $this->getFactory()->create($parameter->getType(), $parameter);
40 // Hold reference to the CONTENT PARAMETER.
41 $parameter->getContentParameter() && ($this->contentParameter = $parameterModel);
42 }
43 }
44
45 /**
46 * put your comment there...
47 *
48 */
49 public function getContentParameter() {
50 return $this->contentParameter;
51 }
52
53 /**
54 * put your comment there...
55 *
56 */
57 protected abstract function getFactory();
58
59 /**
60 * put your comment there...
61 *
62 */
63 public function & getParams() {
64 return $this->params;
65 }
66
67 /**
68 * put your comment there...
69 *
70 */
71 public function getMessages() {
72
73 }
74
75 /**
76 * put your comment there...
77 *
78 */
79 public function hasParams() {
80 return !empty($this->params);
81 }
82
83 /**
84 * put your comment there...
85 *
86 * @param mixed $values
87 */
88 public function setValue($values) {
89 foreach ($this->getParams() as $name => $param) {
90 if (isset($values[$name])) {
91 $param->setValue($values[$name]);
92 }
93 }
94 return $this;
95 }
96
97 /**
98 * put your comment there...
99 *
100 */
101 public function validate() {
102 return true;
103 }
104
105 } // End class.