Code

Added section filter.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 26 Jan 2010 06:55:18 +0000 (06:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 26 Jan 2010 06:55:18 +0000 (06:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15293 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc
gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc
gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc
gosa-plugins/fai/admin/systems/services/repository/repository-list.xml

index fb2155a9ce81e7caa6661f05b8dfb6402d337325..eea87f104980d3f720ba8eb8a3efc842dc52bc66 100644 (file)
@@ -11,6 +11,11 @@ class filterRepository {
       $entry['objectClass'] = array('FAKE_OC_FaiRepository');
       $item = array('count' => count($entry));
       $item['dn'] = $key;
+
+      if(!count($entry['Sections'])){
+        $entry['Sections'][] = '';
+      }
+
       foreach($entry as $name => $value){   
         $item[] = $name;
         if(!is_array($value)) $value=array($value);
index 21392ba52023b469b464a656698e619fc779b57f..37baa4de4d96e514d0bd10c25e6b677571df388d 100644 (file)
@@ -26,6 +26,7 @@ class repositoryManagement extends management
 
     // Build headpage
     $headpage = new listing(get_template_path("services/repository/repository-list.xml", true));
+    $headpage->registerElementFilter("filterSections", "repositoryManagement::filterSections");
     $headpage->setFilter($filter);
 
     parent::__construct($config, $this->ui, "repositories", $headpage);
@@ -41,6 +42,12 @@ class repositoryManagement extends management
       $this->parent->$tmp($action,$target,$all);  
     }
   }
+
+  static function filterSections($a,$b)
+  {
+    if(!$b) return('');
+    return(implode($b,', '));
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>
index 3664f499865c34d013d45e2f90133f5aad97341e..6797e103e86eb677ae4c8724f39c787e0b148521 100644 (file)
@@ -249,6 +249,7 @@ class servrepository extends goService
       $delete = "<img src='images/empty.png' alt='&nbsp;'>";
     }
 
+    session::set('RepositoryList', $this->repositories);
     $str = $this->divlist->execute(); 
     $display.= $smarty->fetch(get_template_path('servRepository.tpl', TRUE,dirname(__FILE__)));
     return($str.$display);
index d1d950b0a6c9230835620252e015d7fc3cd185df..2ada7abff5fee31eccd41a2f9127b2c8959f9968 100644 (file)
@@ -14,7 +14,7 @@
       <label>Service</label>
       <objectClass>FAKE_OC_FaiRepository</objectClass>
       <category>server</category>
-      <class>Repository</class>
+      <class>servrepository</class>
       <image>images/lits/new.png</image>
     </objectType>
 
@@ -35,7 +35,7 @@
       <label>Sections</label>
       <sortAttribute>Sections</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:link(row,dn,"%s",Sections)}</value>
+      <value>%{filter:filterSections(row,Sections)}</value>
       <export>true</export>
     </column>