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 / models / block / parameters / form / parameters.php

parameters.php in CSS & JavaScript Toolbox 11, at models/block/parameters/form/parameters.php

69 lines 1.7 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 CJT_Models_Block_Parameters_Form_Parameters
10 extends CJT_Models_Block_Parameters_Base_Parameters {
11
12 /**
13 * put your comment there...
14 *
15 * @param mixed $blockId
16 * @return CJT_Models_Block_Parameters_Form_Parameters
17 */
18 public function __construct($blockId) {
19 // Parent procedure!
20 parent::__construct($blockId);
21 // Read all values.
22 $this->assignValues();
23 }
24
25 /**
26 * put your comment there...
27 *
28 */
29 protected function assignValues() {
30 // Initialize.
31 $driver = cssJSToolbox::getInstance()->getDBDriver();
32 // For every parameter assign the values.
33 foreach ($this->getParams() as $param) {
34 // Query all values.
35 $recset = $driver->select("SELECT *
36 FROM #__cjtoolbox_parameter_typedef
37 WHERE parameterId = {$param->getId()}", ARRAY_A);
38 foreach ($recset as $valueRow) {
39 $param->addValue(new CJT_Models_Block_Parameters_Form_Value($valueRow));
40 }
41 }
42 return $this;
43 }
44
45 /**
46 * put your comment there...
47 *
48 * @param mixed $row
49 */
50 public function createModelObject($row) {
51 return new CJT_Models_Block_Parameters_Form_Parameter($row);
52 }
53
54 /**
55 * put your comment there...
56 *
57 */
58 protected function getQuery() {
59 $query = "SELECT p.*, pe.renderer, pe.description, pe.helpText, g.id groupId, g.name groupName, g.description groupDescription
60 FROM #__cjtoolbox_parameters p LEFT JOIN #__cjtoolbox_blocks b ON p.blockId = b.id
61 LEFT JOIN #__cjtoolbox_form_group_parameters pe ON pe.parameterId = p.id
62 LEFT JOIN #__cjtoolbox_form_groups g ON pe.groupId = g.id
63 WHERE b.id = {$this->blockId}
64 ORDER by id ASC;";
65 return $query;
66 }
67
68 } // End class.
69