mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 20:49:08 +01:00
Try to handle partial template names - row as well as app.function.row
This commit is contained in:
parent
8f0abbe004
commit
66ea661e08
@ -55,6 +55,16 @@ class etemplate_widget_template extends etemplate_widget
|
|||||||
//error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') read from cache");
|
//error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') read from cache");
|
||||||
return self::$cache[$name];
|
return self::$cache[$name];
|
||||||
}
|
}
|
||||||
|
// Template not found, try again as if $name were a partial name
|
||||||
|
else if(!$path && strpos('.',$name) === false)
|
||||||
|
{
|
||||||
|
foreach(self::$cache as $c_name => $c_template)
|
||||||
|
{
|
||||||
|
list($c_app, $c_main, $c_sub) = explode('.',$c_name, 3);
|
||||||
|
if($name == $c_sub) return $c_template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') template NOT found!");
|
error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') template NOT found!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -77,6 +87,7 @@ class etemplate_widget_template extends etemplate_widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// template not found in file, should never happen
|
// template not found in file, should never happen
|
||||||
error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') template NOT found in file '$path'!");
|
error_log(__METHOD__."('$name', '$template_set', '$version', '$load_via') template NOT found in file '$path'!");
|
||||||
return false;
|
return false;
|
||||||
@ -137,4 +148,4 @@ if ($GLOBALS['egw_info']['flags']['debug'] == 'etemplate_widget_template')
|
|||||||
}
|
}
|
||||||
header('Content-Type: text/xml');
|
header('Content-Type: text/xml');
|
||||||
echo $template->toXml();
|
echo $template->toXml();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user