1st preview

This commit is contained in:
Paolo
2017-05-09 18:14:18 +02:00
parent a5aea17fa6
commit e143aa8815
9 changed files with 178 additions and 145 deletions
+34 -7
View File
@@ -218,10 +218,14 @@ class WidgetLib
*/
public function UDFWidget($args, $htmlArgs = array())
{
if (!empty($args[UDFWidgetTpl::SCHEMA_ARG_NAME])
&& !empty($args[UDFWidgetTpl::TABLE_ARG_NAME])
&& !empty($args[UDFWidgetTpl::FIELD_ARG_NAME]))
if (!empty($args[UDFWidgetTpl::SCHEMA_ARG_NAME]) && !empty($args[UDFWidgetTpl::TABLE_ARG_NAME]))
{
//
if (empty($args[UDFWidgetTpl::FIELD_ARG_NAME]) && !isset($htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK]))
{
$htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK] = true;
}
return $this->widget(
UDFWidgetTpl::WIDGET_NAME,
$args,
@@ -238,10 +242,6 @@ class WidgetLib
{
show_error(UDFWidgetTpl::TABLE_ARG_NAME.' parameter is missing!');
}
if (empty($args[UDFWidgetTpl::FIELD_ARG_NAME]))
{
show_error(UDFWidgetTpl::FIELD_ARG_NAME.' parameter is missing!');
}
}
}
@@ -646,6 +646,8 @@ class Widget extends Partial
const HTML_NAME = 'name'; // HTML name attribute
const HTML_ID = 'id'; // HTML id attribute
const EXTERNAL_BLOCK = 'externalBlock'; //
/**
* It gets also the htmlArgs array as parameter, it will be used to set the HTML properties
*/
@@ -736,6 +738,30 @@ class Widget extends Partial
}
}
}
/**
*
*/
public static function printStartBlock($htmlArgs)
{
if (isset($htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK])
&& $htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK] === true)
{
echo '<div>';
}
}
/**
*
*/
public static function printEndBlock($htmlArgs)
{
if (isset($htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK])
&& $htmlArgs[Widget::HTML_ARG_NAME][Widget::EXTERNAL_BLOCK] === true)
{
echo '</div>';
}
}
}
/**
@@ -1159,6 +1185,7 @@ abstract class UDFWidgetTpl extends Widget
const SCHEMA_ARG_NAME = 'schema';
const TABLE_ARG_NAME = 'table';
const FIELD_ARG_NAME = 'field';
const UDFS_ARG_NAME = 'udfs';
const TITLE = 'description';
const LABEL = 'title';