Code

Updated msgPool usage in fai.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Mar 2008 15:01:58 +0000 (15:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Mar 2008 15:01:58 +0000 (15:01 +0000)
-Scripts
-Tamplates
-Hooks
- The rest is missing

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9719 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc
gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc

index 668e12cf7407ec7ee446f340971abb479021cf9e..679e740b61cedf3581dd62014edc10c72fe2916a 100644 (file)
@@ -149,15 +149,15 @@ class faiHookEntry extends plugin
     $message= plugin::check();
 
     if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
-      $message[] =_("Name is already in use!");
+      $message[]= msgPool::duplicated(_("Name"));
     }
 
     if(empty($this->FAIscript)) {
-      $message[]=_("Please enter a script!");
+      $message[]= msgPool::required(_("Script"));
     }
 
     if(empty($this->cn)){
-      $message[] = _("Name is empty!");
+      $message[]= msgPool::required(_("Name"));
     }
 
     return ($message);
index 143d6f506b79cd87588ba77187ff6bc9023e37f1..0202baecbb9d5e685d65f265660450391587b163 100644 (file)
@@ -138,15 +138,15 @@ class faiScriptEntry extends plugin
     $message= plugin::check();
   
     if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
-      $message[] =_("Name is already in use!");
+      $message[] = msgPool::duplicated(_("Name"));
     }
 
     if(empty($this->cn)){
-      $message[] = _("Name is empty!");
+      $message[] = msgPool::required(_("Name"));
     }
 
     if(empty($this->FAIscript)){
-      $message[]=_("Please enter a script!");
+      $message[]= msgPool::required("Script"));
     }
 
     return ($message);
index d7066e18137bb4dbfeb9a19e14697ab3c7adfc12..62752d01d6d5872099e373bbbf9df564591cfa9c 100644 (file)
@@ -193,38 +193,34 @@ class faiTemplateEntry extends plugin
     $message= plugin::check();
 
     if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
-      $message[] =_("There is already a template with the given name.");
+      $message[] = msgPool::duplicated(_("Name"));
     }
 
     if(empty($this->FAItemplateFile)){
-      $message[]=_("Please specify a value for attribute 'file'.");
+      $message[]= msgPool::required(_("File"));
     } 
 
     if(!preg_match('/^\//', $this->FAItemplatePath)){
-      $message[]=_("Please specify a valid value for attribute 'Destination path'.");
+      $message[]= msgPool::invalid(_("Destination path"),$this->FAItemplatePath,'/^\//');
     } 
-  
-    if(empty($this->cn)){
-      $message[] = _("Please enter a file name.");
+    $b = basename($this->FAItemplatePath); 
+    if(empty($b)){
+      $message[] = msgPool::required(_("File name"));
     }
 
-#    echo $this->cn;
-#    if(preg_match('/\//', $this->cn)){
-#      $message[] = _("The file name should not contain / characters.");
-# #   }
-
     if(empty($this->user)){
-      $message[] = _("Please enter a user.");
+      $message[] = msgPool::required(_("User"));
     }
     elseif(preg_match("/[^0-9a-z]/i",$this->user)){
-      $message[] = _("Please enter a valid user. Only a-z/0-9 are allowed.");
+      $message[] = msgPool::invalid(_("User"),$this->user,"/[0-9a-z]/");
     }
 
     if(empty($this->group)){
-      $message[] = _("Please enter a group.");
+      $message[] = msgPool::required(_("Group"));
     }
     elseif(preg_match("/[^0-9a-z]/i",$this->group)){
-      $message[] = _("Please enter a valid group. Only a-z/0-9 are allowed.");
+      $message[] = msgPool::invalid(_("Group"),$this->group,"/[0-9a-z]/");
     }
 
     return ($message);