@@ -19,41 +19,41 @@ |
||
| 19 | 19 | class DataElement extends Widget { |
| 20 | 20 | |
| 21 | 21 | public function __construct($identifier, $modelInstance=NULL) { |
| 22 | - parent::__construct($identifier, null,$modelInstance); |
|
| 23 | - $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0,2), false); |
|
| 22 | + parent::__construct($identifier, null, $modelInstance); |
|
| 23 | + $this->_init(new InstanceViewer($identifier), "table", new HtmlTable($identifier, 0, 2), false); |
|
| 24 | 24 | $this->content["table"]->setDefinition(); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function compile(JsUtils $js=NULL,&$view=NULL){ |
|
| 27 | + public function compile(JsUtils $js=NULL, &$view=NULL) { |
|
| 28 | 28 | $this->_instanceViewer->setInstance($this->_modelInstance); |
| 29 | 29 | |
| 30 | 30 | $table=$this->content["table"]; |
| 31 | 31 | $this->_generateContent($table); |
| 32 | 32 | |
| 33 | - if(isset($this->_toolbar)){ |
|
| 33 | + if (isset($this->_toolbar)) { |
|
| 34 | 34 | $this->_setToolbarPosition($table); |
| 35 | 35 | } |
| 36 | - $this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"table",PositionInTable::AFTERTABLE]); |
|
| 37 | - return parent::compile($js,$view); |
|
| 36 | + $this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE, "table", PositionInTable::AFTERTABLE]); |
|
| 37 | + return parent::compile($js, $view); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @param HtmlTable $table |
| 42 | 42 | */ |
| 43 | - protected function _generateContent($table){ |
|
| 43 | + protected function _generateContent($table) { |
|
| 44 | 44 | $captions=$this->_instanceViewer->getCaptions(); |
| 45 | - $values= $this->_instanceViewer->getValues(); |
|
| 45 | + $values=$this->_instanceViewer->getValues(); |
|
| 46 | 46 | $count=$this->_instanceViewer->count(); |
| 47 | - for($i=0;$i<$count;$i++){ |
|
| 48 | - $table->addRow([$captions[$i],$values[$i]]); |
|
| 47 | + for ($i=0; $i<$count; $i++) { |
|
| 48 | + $table->addRow([$captions[$i], $values[$i]]); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - protected function _getFieldName($index){ |
|
| 52 | + protected function _getFieldName($index) { |
|
| 53 | 53 | return $this->_instanceViewer->getFieldName($index); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - protected function _getFieldCaption($index){ |
|
| 56 | + protected function _getFieldCaption($index) { |
|
| 57 | 57 | return null; |
| 58 | 58 | } |
| 59 | 59 | |