27 protected $management;
29 protected $template = NULL;
31 protected $target = NULL;
32 protected $closed = FALSE;
36 protected $post_finish =
'template_continue';
37 protected $post_cancel =
'template_cancel';
39 function __construct ($management, $type, $dn = NULL, $target = NULL)
43 $this->templates = objects::getTemplates($this->type);
45 if (isset($this->templates[$dn])) {
46 $this->
template =
new template($this->type, $dn);
48 trigger_error(
'Unknown template "' . $dn .
'"');
51 $this->target = $target;
56 if (isset($_POST[$this->post_cancel])) {
57 $this->handleCancel();
61 if (($this->target === NULL) &&
62 is_object($this->
template) &&
63 (isset($_POST[$this->post_finish]) || isset($_GET[$this->post_finish]))
65 $this->
template->readPost();
66 $this->
template->update();
72 isset($_POST[
'template']) &&
73 isset($this->templates[$_POST[
'template']])
75 if (is_object($this->
template)) {
76 trigger_error(
'redefining template object');
78 $this->
template =
new template($this->type, $_POST[
'template']);
80 unset($_POST[
'template']);
82 if (is_object($this->
template)) {
83 $this->
template->readPost();
84 $this->
template->update();
85 if ($this->target !== NULL) {
90 if (empty($this->
template->getNeeded())) {
100 return !$this->closed;
103 function setNextTarget ($target)
105 $this->target = $target;
106 $this->
template->reset();
112 if (is_object($this->
template)) {
113 $templateOutput = $this->
template->render();
114 if ($this->
template->dialogOpened()) {
115 return $templateOutput;
117 $smarty->assign(
'template_dialog', $templateOutput);
120 $smarty->assign(
'templates', $this->templates);
134 $tab = $this->
template->apply();
135 $errors = $tab->save();
137 if (!empty($errors)) {
139 msg_dialog::displayChecks($errors);
144 protected function handleCancel ()
147 $this->closed = TRUE;
Class for applying a template.
get_template_path($filename='', $plugin=FALSE, $path='')
Return themed path for specified base file.
This interface should be implemented by all dialog classes in FusionDirectory.
& get_smarty()
Get global smarty object.
update()
Update state and return FALSE if the dialog was closed.
readPost()
Interpret POST content.
removeLocks()
Removes ldap object locks created by this class. Whenever an object is edited, we create locks to avo...
Template dialog handling.
closeDialogs()
This method closes dialogs and cleans up the cached object info and the ui.
render()
Render the dialog and returns the HTML code.