Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
3ac01fde
Commit
3ac01fde
authored
Apr 01, 2016
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/class_template.inc
View file @
3ac01fde
...
...
@@ -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
))
{
...
...
include/simpleplugin/class_simplePlugin.inc
View file @
3ac01fde
...
...
@@ -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
;
}
}
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment