Code

Application.
[gosa.git] / gosa-plugins / goto / admin / applications / class_applicationParameters.inc
index 9f11eb6b94a78f05aaeb9f6850a631bb73cfcc61..913107044b4d64bc8317448c1924fd3b3fe3f5e9 100644 (file)
@@ -1,11 +1,6 @@
 <?php
 class applicationParameters extends plugin
 {
-  /* CLI vars */
-  var $cli_summary= "Manage application class parameters";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   /* Parameters  */
   var $option_name= array();
   var $option_value= array();
@@ -51,11 +46,9 @@ class applicationParameters extends plugin
     $display= "";
     if ($this->parent !== NULL){
       if ($this->is_account){
-        $display= $this->show_disable_header(_("Remove options"),
-            _("This application has options. You can disable them by clicking below."));
+        $display= $this->show_disable_header(_("Remove options"),msgPool::featuresEnabled(_("parameter")));
       } else {
-        $display= $this->show_enable_header(_("Create options"),
-            _("This application has options disabled. You can enable them by clicking below."));
+        $display= $this->show_enable_header(_("Create options"), msgPool::featuresDisabled(_("parameter")));
         $this->parent->by_object['application']->generateTemplate();
         return ($display);
       }
@@ -156,7 +149,9 @@ class applicationParameters extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error(), sprintf(_("Removing of application parameters with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+    }
 
     /* Optionally execute a command after we're done */
     $this->handle_post_events('remove');
@@ -187,8 +182,7 @@ class applicationParameters extends plugin
     /* Check for valid option names */
     for ($i= 0; $i<count($this->option_name); $i++){
       if (!preg_match ("/^[a-z0-9_]+$/i", $this->option_name[$i])){
-        $message[]= sprintf(_("Value '%s' specified as option name is not valid."), 
-            $this->option_name[$i]);
+        $message[]= msgPool::invalid(_("Name"), $this->option_name[$i],"/^[a-z0-9_]+$/i");
       }
     }
 
@@ -218,7 +212,9 @@ class applicationParameters extends plugin
     $this->cleanup();
     $ldap->modify ($this->attrs); 
 
-    show_ldap_error($ldap->get_error(), sprintf(_("Saving of application parameters with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+    }
 
     /* Optionally execute a command after we're done */
     $this->handle_post_events('modify');