From 02ea60d4c370797c5c4143899f24a3c516e3665c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 26 Jan 2010 07:45:36 +0000 Subject: [PATCH] Added some comments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15294 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../repository/class_filterServRepository.inc | 4 +-- .../repository/class_repositoryManagement.inc | 18 ++++++++----- .../repository/class_servRepository.inc | 25 ++++++++++++------- 3 files changed, 29 insertions(+), 18 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 eea87f104..b68f39839 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_filterServRepository.inc @@ -6,6 +6,7 @@ class filterRepository { { $list = servrepository::getRepositoryList(); + // Convert plugin data into useable format for list. $data = array(); foreach($list as $key => $entry){ $entry['objectClass'] = array('FAKE_OC_FaiRepository'); @@ -15,15 +16,12 @@ class filterRepository { if(!count($entry['Sections'])){ $entry['Sections'][] = ''; } - foreach($entry as $name => $value){ $item[] = $name; if(!is_array($value)) $value=array($value); $value= array_values($value); $value['count'] = count($value); $item[$name] = $value; - - } $data[] = $item; } 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 37baa4de4..762389cde 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_repositoryManagement.inc @@ -2,7 +2,7 @@ class repositoryManagement extends management { - + protected $skipFooter = TRUE; protected $skipHeader = TRUE; protected $parent = NULL; @@ -16,12 +16,12 @@ class repositoryManagement extends management $this->storagePoints = array(); // Build filter -# if (session::global_is_set(get_class($this)."_filter")){ -# $filter= session::global_get(get_class($this)."_filter"); -# } else { + if (session::global_is_set(get_class($this)."_filter")){ + $filter= session::global_get(get_class($this)."_filter"); + } else { $filter = new filter(get_template_path("services/repository/repository-filter.xml", true)); $filter->setObjectStorage($this->storagePoints); - # } + } $this->setFilter($filter); // Build headpage @@ -35,6 +35,9 @@ class repositoryManagement extends management $this->registerAction('new', 'forwardToParent'); } + + /*! \brief Forwards list action to the parent management class + */ function forwardToParent($action, $target, $all) { if(!empty($action)){ @@ -43,9 +46,12 @@ class repositoryManagement extends management } } + + /*! \brief Makes section array printable for the overview list. + */ static function filterSections($a,$b) { - if(!$b) return(''); + if(!$b) return(' '); return(implode($b,', ')); } } 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 6797e103e..f06598c46 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc @@ -18,7 +18,7 @@ class servrepository extends goService var $view_logged = FALSE; var $fai_activated = FALSE; - var $divlist = NULL; + var $repositoryMangement = NULL; function servrepository (&$config, $dn= NULL, $parent= NULL) { @@ -26,9 +26,12 @@ class servrepository extends goService $this->DisplayName = _("Repository service"); + /* Create repositoryMangement */ + $this->repositoryMangement = new repositoryManagement($this->config,$this); + /* Skip this if fai is deactivated */ $tmp= $this->config->search("faiManagement", "CLASS",array('menu','tabs')); - if(!empty($tmp)){ + if(0 && !empty($tmp)){ $this->fai_activated = TRUE; }else{ return; @@ -75,12 +78,11 @@ class servrepository extends goService } } session::set('RepositoryList', $this->repositories); - - /* Create divlist */ - $this->divlist = new repositoryManagement($this->config,$this); } + /*! \brief Act on events frowarded by the repositoryManagement + */ function newEntry() { if(!$this->dialog){ @@ -90,6 +92,8 @@ class servrepository extends goService } + /*! \brief Act on events frowarded by the repositoryManagement + */ function removeEntry($action,$target,$all) { foreach($target as $value){ @@ -162,6 +166,8 @@ class servrepository extends goService } + /*! \brief Act on events frowarded by the repositoryManagement + */ function editEntry($action,$target,$all) { if(count($target) == 1 && !$this->dialog){ @@ -183,7 +189,8 @@ class servrepository extends goService /* Call parent execute */ plugin::execute(); - $this->divlist->handleActions($this->divlist->detectPostActions()); + $smarty= get_smarty(); + $this->repositoryMangement->handleActions($this->repositoryMangement->detectPostActions()); if($this->is_account && !$this->view_logged){ $this->view_logged = TRUE; @@ -192,11 +199,11 @@ class servrepository extends goService if(!$this->fai_activated){ $str = "

"._("You can't use this plugin until FAI is activated.")."

"; - return $str; + $display = $smarty->fetch(get_template_path('servRepository.tpl', TRUE,dirname(__FILE__))); + return($str.$display); } /* Fill templating stuff */ - $smarty= get_smarty(); $smarty->assign("is_createable",$this->acl_is_createable()); $display= ""; @@ -250,7 +257,7 @@ class servrepository extends goService } session::set('RepositoryList', $this->repositories); - $str = $this->divlist->execute(); + $str = $this->repositoryMangement->execute(); $display.= $smarty->fetch(get_template_path('servRepository.tpl', TRUE,dirname(__FILE__))); return($str.$display); } -- 2.30.2