Enable control of creating children in templates

This commit is contained in:
Deon George
2009-09-20 10:21:44 +10:00
parent d062308f32
commit f0a6d312ab
5 changed files with 19 additions and 7 deletions

View File

@@ -45,6 +45,8 @@ class Template extends xmlTemplate {
private $dn;
# Where this template will store its data
protected $container;
# Does this template prohibit children being created
private $noleaf = false;
# A regexp that determines if this template is valid in the container.
private $regexp;
# Template Title
@@ -54,6 +56,14 @@ class Template extends xmlTemplate {
# Template RDN attributes
private $rdn;
public function __construct($server_id,$name=null,$filename=null,$type=null,$id=null) {
parent::__construct($server_id,$name,$filename,$type,$id);
# If this is the default template, we might disable leafs by default.
if (is_null($filename))
$this->noleaf = $_SESSION[APPCONFIG]->getValue('appearance','disable_default_leaf');
}
public function __clone() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);
@@ -1501,5 +1511,9 @@ class Template extends xmlTemplate {
masort($attributes,'name');
return $attributes;
}
public function isNoLeaf() {
return $this->noleaf;
}
}
?>