2nd preview

This commit is contained in:
Paolo
2017-05-10 09:54:23 +02:00
parent e143aa8815
commit f092867602
4 changed files with 31 additions and 3 deletions
+3 -1
View File
@@ -20,7 +20,9 @@ class TestUDF extends VileSci_Controller
*/
public function index()
{
$person = $this->PersonModel->load(1);
$person_id = $this->input->get('person_id');
$person = $this->PersonModel->load($person_id);
$data = array(
'udfs' => $this->PersonModel->getUDFs()
+4 -2
View File
@@ -647,6 +647,8 @@ class Widget extends Partial
const HTML_ID = 'id'; // HTML id attribute
const EXTERNAL_BLOCK = 'externalBlock'; //
const EXTERNAL_START_BLOCK_HTML_TAG = '<div>'; //
const EXTERNAL_END_BLOCK_HTML_TAG = '</div>'; //
/**
* It gets also the htmlArgs array as parameter, it will be used to set the HTML properties
@@ -747,7 +749,7 @@ class Widget extends Partial
if (isset($htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK])
&& $htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK] === true)
{
echo '<div>';
echo Widget::EXTERNAL_START_BLOCK_HTML_TAG;
}
}
@@ -759,7 +761,7 @@ class Widget extends Partial
if (isset($htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK])
&& $htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK] === true)
{
echo '</div>';
echo Widget::EXTERNAL_END_BLOCK_HTML_TAG;
}
}
}
+13
View File
@@ -2,6 +2,19 @@
<body>
<div>
<?php
echo $this->widgetlib->UDFWidget(
array(
UDFWidgetTpl::SCHEMA_ARG_NAME => 'public',
UDFWidgetTpl::TABLE_ARG_NAME => 'tbl_person',
UDFWidgetTpl::FIELD_ARG_NAME => 'schuhgroesse',
DropdownWidget::SELECTED_ELEMENT => $udfs['schuhgroesse']
),
array('name' => 'schuhgroesseName', 'id' => 'schuhgroesseId')
);
?>
</div>
<br/>
<br/>
+11
View File
@@ -62,6 +62,8 @@ class UDFWidget extends UDFWidgetTpl
$this->_setValidationAttributes($jsonSchema);
$this->_setNameAndId($jsonSchema);
$this->_render($jsonSchema);
//
@@ -91,6 +93,15 @@ class UDFWidget extends UDFWidgetTpl
}
}
/**
*
*/
private function _setNameAndId($jsonSchema)
{
$this->_args[Widget::HTML_ARG_NAME][Widget::HTML_ID] = $jsonSchema->name;
$this->_args[Widget::HTML_ARG_NAME][Widget::HTML_NAME] = $jsonSchema->name;
}
/**
*
*/