From 6b27987ea1a7256468f6910fc32f9d16d95bb07d Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 31 Mar 2010 09:59:23 +0000 Subject: [PATCH] Added base selector to mime generic git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17431 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/mimetypes/class_mimetypeGeneric.inc | 28 +++++++++++ gosa-plugins/goto/admin/mimetypes/generic.tpl | 50 +++++++------------ 2 files changed, 45 insertions(+), 33 deletions(-) diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc index 168488df7..966186251 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc @@ -53,6 +53,8 @@ class mimetype extends plugin var $orig_dn = ""; var $orig_base = ""; + var $baseSelector; + function mimetype(&$config,$dn= NULL) { plugin::plugin ($config, $dn); @@ -143,6 +145,13 @@ class mimetype extends plugin } session::set('binary',$this->iconData); session::set('binarytype',"image/jpeg"); + + /* Instanciate base selector */ + $this->baseSelector= new baseSelector($this->get_allowed_bases(), $this->base); + $this->baseSelector->setSubmitButton(false); + $this->baseSelector->setHeight(300); + $this->baseSelector->update(true); + $this->orig_base = $this->base; } @@ -152,6 +161,9 @@ class mimetype extends plugin plugin::execute(); $smarty = get_smarty(); + /* Assign base ACL */ + $smarty->assign("base", $this->baseSelector->render()); + if(!$this->view_logged){ $this->view_logged =TRUE; new log("view","mimetypes/".get_class($this),$this->dn); @@ -366,6 +378,17 @@ class mimetype extends plugin } + /* Refresh base */ + if ($this->acl_is_moveable($this->base)){ + if (!$this->baseSelector->update()) { + msg_dialog::display(_("Error"), msgPool::permMove(), ERROR_DIALOG); + } + if ($this->base != $this->baseSelector->getBase()) { + $this->base= $this->baseSelector->getBase(); + $this->is_modified= TRUE; + } + } + /* Save radio buttons */ if($this->acl_is_writeable("gotoMimeLeftClickAction")){ if(isset($_POST['gotoMimeLeftClickAction_IE'])){ @@ -504,6 +527,11 @@ class mimetype extends plugin $message[] = msgPool::required(_("File pattern")); } + // Check if a wrong base was supplied + if(!$this->baseSelector->checkLastBaseUpdate()){ + $message[]= msgPool::check_base();; + } + /* Check if there is already a mime type with this cn */ $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current["BASE"]); diff --git a/gosa-plugins/goto/admin/mimetypes/generic.tpl b/gosa-plugins/goto/admin/mimetypes/generic.tpl index 24a3be19c..488e4d7a4 100644 --- a/gosa-plugins/goto/admin/mimetypes/generic.tpl +++ b/gosa-plugins/goto/admin/mimetypes/generic.tpl @@ -1,18 +1,13 @@ +

{t}Generic{/t}

+ - - -
-

{t}Generic{/t} -

-
+ - + - + - + - + - {/if}
{t}Mime type{/t} - {$must} - {t}Mime type{/t}{$must} {render acl=$cnACL} @@ -20,8 +15,7 @@
{t}Mime group{/t} - {t}Mime group{/t} {render acl=$gotoMimeGroupACL}
{t}Description{/t} - {t}Description{/t} {render acl=$descriptionACL} @@ -42,29 +35,20 @@ {if !$isReleaseMimeType}
-
{$must}
- {render acl=$baseACL} - - {/render} - - {if !$isReleaseMimeType} - {render acl=$baseACL disable_picture='images/lists/folder_grey.png'} - {image path="images/lists/folder.png" action="chooseBase" title="{t}Select a base{/t}"} - {/render} - - {/if} +
+{render acl=$baseACL} + {$base} +{/render}
+
+
@@ -181,14 +165,14 @@ {/render} {render acl=$gotoMimeEmbeddedApplicationACL} - + {/render} {render acl=$gotoMimeEmbeddedApplicationACL} - title='{t}Add application{/t}'> + {/render}
- \ No newline at end of file + -- 2.30.2