diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 6c1b8b7205..ab6079fb36 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3548,6 +3548,11 @@ function ui_print_datatable(array $parameters) $output = $err_msg.$filter.$extra.$table.$js; ui_require_css_file('datatables.min', 'include/styles/js/'); + ui_require_css_file('tables'); + if (is_metaconsole()) { + ui_require_css_file('tables_meta', ENTERPRISE_DIR.'/include/styles/'); + } + ui_require_javascript_file('datatables.min'); ui_require_javascript_file('buttons.dataTables.min'); ui_require_javascript_file('dataTables.buttons.min'); diff --git a/pandora_console/include/lib/Entity.php b/pandora_console/include/lib/Entity.php index 92c204c50d..85901db309 100644 --- a/pandora_console/include/lib/Entity.php +++ b/pandora_console/include/lib/Entity.php @@ -58,6 +58,26 @@ abstract class Entity private $enterprise; + /** + * Instances a new object using array definition. + * + * @param string $class_str Class name. + * @param array $data Fields data. + * + * @return object With current definition. + */ + public static function build(string $class_str, array $data=[]) + { + $obj = new $class_str(); + // Set values. + foreach ($data as $k => $v) { + $obj->{$k}($v); + } + + return $obj; + } + + /** * Defines a generic constructor to extract information of the object. *