Code

Updated faiPackage
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 30 Apr 2008 12:52:45 +0000 (12:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 30 Apr 2008 12:52:45 +0000 (12:52 +0000)
-Append the removal flag at the end of the package name, not infront.

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

gosa-plugins/fai/admin/fai/class_faiPackage.inc

index e2d801ac80fc4f9fac9d4540b2226b45a0d6b0e2..a5744f527fc86d7c2beea1b2cd5abf9ff6f9c729 100644 (file)
@@ -76,7 +76,7 @@ class faiPackage extends plugin
       if(isset($this->attrs['FAIpackage'])){
         unset($this->attrs['FAIpackage']['count']);
         foreach($this->attrs['FAIpackage'] as $pkg){
-          $name = preg_replace("/^\-/","",$pkg);
+          $name = preg_replace("/\-$/","",$pkg);
           $this->usedPackages[$name] = $pkg;
         }
         ksort($this->usedPackages);
@@ -221,10 +221,10 @@ class faiPackage extends plugin
         $id = @base64_decode(preg_replace("/^removal_package_(.*)_[xy]*$/","\\1",$name));
         if(isset($this->usedPackages[$id])){
           $pkg = $this->usedPackages[$id]; 
-          if (preg_match('/^-/', $pkg)){
-            $pkg= preg_replace('/^-/', '', $pkg);
+          if (preg_match('/\-$/', $pkg)){
+            $pkg= preg_replace('/\-$/', '', $pkg);
           } else {
-            $pkg= preg_replace('/^/', '-', $pkg);
+            $pkg= preg_replace('/$/', '-', $pkg);
           }
           $this->usedPackages[$id] = $pkg;
         }
@@ -335,7 +335,7 @@ class faiPackage extends plugin
 
         /* Adapt used name if we're marked for removal */
         $removal = "<img src='images/empty.png' alt=' '  class='center'>";
-        if (preg_match('/^-/', $name)){
+        if (preg_match('/\-$/', $name)){
           $removal = "<img src='images/negate.png' alt='"._("Package marked for removal")."'
                       title='"._("Package marked for removal")."' class='center'>";
         }