From: hickert Date: Tue, 4 May 2010 10:33:38 +0000 (+0000) Subject: Updated config viewer X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d1d908baa0c4cd2b1a8c02da29f963699edf9f46;p=gosa.git Updated config viewer git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18034 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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))); } } ?>