forked from extern/egroupware
Fix et2-select widgets in template did not validate
This commit is contained in:
parent
2571d90691
commit
5793b462ba
@ -420,13 +420,14 @@ class Widget
|
|||||||
|
|
||||||
if (!isset($class_name))
|
if (!isset($class_name))
|
||||||
{
|
{
|
||||||
list($basetype) = explode('-',$type);
|
$exploded = explode('-', $type);
|
||||||
if (//dont think this is used: !class_exists($class_name = 'etemplate_widget_'.str_replace('-','_',$type)) &&
|
$basetype = $exploded[0] == "et2" ? $exploded[1] : $exploded[0];
|
||||||
!class_exists($class_name = __CLASS__.'\\'.ucfirst($basetype)) &&
|
if(//dont think this is used: !class_exists($class_name = 'etemplate_widget_'.str_replace('-','_',$type)) &&
|
||||||
|
!class_exists($class_name = __CLASS__ . '\\' . ucfirst($basetype)) &&
|
||||||
// widgets supplied by application in class ${app}_widget_etemplate or ${app}_${subtype}_widget_etemplate
|
// widgets supplied by application in class ${app}_widget_etemplate or ${app}_${subtype}_widget_etemplate
|
||||||
!(isset($GLOBALS['egw_info']['apps'][$basetype]) &&
|
!(isset($GLOBALS['egw_info']['apps'][$basetype]) &&
|
||||||
(class_exists($class_name = str_replace('-','_',$type).'_etemplate_widget') ||
|
(class_exists($class_name = str_replace('-', '_', $type) . '_etemplate_widget') ||
|
||||||
class_exists($class_name = $basetype.'_etemplate_widget'))))
|
class_exists($class_name = $basetype . '_etemplate_widget'))))
|
||||||
{
|
{
|
||||||
// Try for base type, it's probably better than the root
|
// Try for base type, it's probably better than the root
|
||||||
if(isset(self::$widget_registry[$basetype]) && self::$widget_registry[$basetype] !== $class_name)
|
if(isset(self::$widget_registry[$basetype]) && self::$widget_registry[$basetype] !== $class_name)
|
||||||
|
@ -560,6 +560,10 @@ class Select extends Etemplate\Widget
|
|||||||
{
|
{
|
||||||
$widget = $widget_type;
|
$widget = $widget_type;
|
||||||
$widget_type = $widget->attrs['type'] ? $widget->attrs['type'] : $widget->type;
|
$widget_type = $widget->attrs['type'] ? $widget->attrs['type'] : $widget->type;
|
||||||
|
if(str_starts_with($widget_type, 'et2-'))
|
||||||
|
{
|
||||||
|
$widget_type = str_replace('et2-', '', $widget_type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Legacy / static support
|
// Legacy / static support
|
||||||
// Have to do this explicitly, since legacy options is not defined on class level
|
// Have to do this explicitly, since legacy options is not defined on class level
|
||||||
|
Loading…
Reference in New Issue
Block a user