From d96048d10efe0616196d0f4e71bae534f0a2ddde Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 26 Jan 2010 06:55:18 +0000 Subject: [PATCH] Added section filter. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15293 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/repository/class_filterServRepository.inc | 5 +++++ .../services/repository/class_repositoryManagement.inc | 7 +++++++ .../systems/services/repository/class_servRepository.inc | 1 + .../admin/systems/services/repository/repository-list.xml | 4 ++-- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc b/gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc index fb2155a9c..eea87f104 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc @@ -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); diff --git a/gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc b/gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc index 21392ba52..37baa4de4 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc @@ -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: ?> diff --git a/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc b/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc index 3664f4998..6797e103e 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc @@ -249,6 +249,7 @@ class servrepository extends goService $delete = " "; } + session::set('RepositoryList', $this->repositories); $str = $this->divlist->execute(); $display.= $smarty->fetch(get_template_path('servRepository.tpl', TRUE,dirname(__FILE__))); return($str.$display); diff --git a/gosa-plugins/fai/admin/systems/services/repository/repository-list.xml b/gosa-plugins/fai/admin/systems/services/repository/repository-list.xml index d1d950b0a..2ada7abff 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/repository-list.xml +++ b/gosa-plugins/fai/admin/systems/services/repository/repository-list.xml @@ -14,7 +14,7 @@ FAKE_OC_FaiRepository server - Repository + servrepository images/lits/new.png @@ -35,7 +35,7 @@ Sections string - %{filter:link(row,dn,"%s",Sections)} + %{filter:filterSections(row,Sections)} true -- 2.30.2