From d1d908baa0c4cd2b1a8c02da29f963699edf9f46 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 May 2010 10:33:38 +0000 Subject: [PATCH] Updated config viewer git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18034 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../configViewer/class_configViewer.inc | 48 +++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/gosa-core/plugins/addons/configViewer/class_configViewer.inc b/gosa-core/plugins/addons/configViewer/class_configViewer.inc index b8d9f1042..05ef6f50c 100644 --- a/gosa-core/plugins/addons/configViewer/class_configViewer.inc +++ b/gosa-core/plugins/addons/configViewer/class_configViewer.inc @@ -6,29 +6,49 @@ class configViewer extends plugin var $plDescription= "Allows to modify configuration values"; var $configRegistry = NULL; + var $viewType = 'byClass'; + var $viewTypes = array(); function __construct (&$config, $dn= NULL) { - $this->config = &$config; - $this->configRegistry = &$config->configRegistry; + $this->config = &$config; + $this->configRegistry = &$config->configRegistry; + $this->viewTypes = array( + 'byClass' => _("By class name"), + 'byName' => _("By property name"), + 'byStatus'=> _("By status"), + 'byGroup' => _('By group')); + + + $this->propertyList = new sortableListing(); + $this->propertyList->setDeleteable(false); + $this->propertyList->setEditable(false); + $this->propertyList->setWidth("100%"); + $this->propertyList->setHeight("600px"); + $this->propertyList->setHeader(array(_("Group"),_("Class"),_("Name"),_("Value"), _("Status"))); + $this->propertyList->setDefaultSortColumn(0); + $this->propertyList->setAcl('rwcdm'); } function execute() { $all = $this->configRegistry->getAllProperties(); - $str = ""; - foreach($all as $p){ - $str.=" - - {$p->getClass()} - {$p->getName()} - {$p->getDescription()} - - {$p->getStatus()} - "; + $data = $lData = array(); + foreach($all as $id => $p){ + $data[$id] = $p; + $lData[$id] = array('data' => array( + $p->getGroup(), + $p->getClass(), + $p->getName(), + $p->getValue(), + $p->getStatus() + )); } - - return("{$str}
"); + $this->propertyList->setListData($data,$lData); + $this->propertyList->update(); + $smarty = get_smarty(); + $smarty->assign('content', $this->propertyList->render()); + return($smarty->fetch(get_template_path('generic.tpl', TRUE))); } } ?> -- 2.30.2