Commit 3ac01fde authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4659 Added a way for plugin to say which attributes should not be asked in the template

parent 414f9432
......@@ -50,7 +50,7 @@ class template
$this->attributes[$class] = array();
$attrs = array_unique(array_merge($this->tabObject->by_object[$class]->getRequiredAttributes(), $this->needed));
foreach (array_keys($this->tabObject->by_object[$class]->attributesAccess) as $attr) {
if (isset($this->attrs[$attr])) {
if (!$plugin->showInTemplate($attr, $this->attrs)) {
continue;
}
if (in_array($attr, $attrs)) {
......
......@@ -988,6 +988,15 @@ class simplePlugin extends plugin
}
unset($attr);
}
/* Returns TRUE if this attribute should be asked in the creation by template dialog */
function showInTemplate($attr, $templateAttrs)
{
if (isset($templateAttrs[$attr])) {
return FALSE;
}
return TRUE;
}
}
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment