From: hickert Date: Tue, 4 May 2010 11:20:56 +0000 (+0000) Subject: Updated config viewer X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=316ddd190b408f27d7bcaf7c9de27c48e0eea8d5;p=gosa.git Updated config viewer git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18038 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 489b4f7af..51b7a2a03 100644 --- a/gosa-core/plugins/addons/configViewer/class_configViewer.inc +++ b/gosa-core/plugins/addons/configViewer/class_configViewer.inc @@ -35,15 +35,25 @@ class configViewer extends plugin $all = $this->configRegistry->getAllProperties(); $data = $lData = array(); foreach($all as $id => $p){ - $value = htmlentities($p->getValue(), ENT_COMPAT, 'UTF-8'); $data[$id] = $p; + + + $status = $p->getStatus(); + if($status == 'modified'){ + $status = ""; + $status.= ""; + } + if($status == 'ldap'){ + $status = ""; + } + $lData[$id] = array('data' => array( $p->getGroup(), $this->configRegistry->classToName[$p->getClass()], $p->getName(), "", - $p->getStatus() + $status )); } $this->propertyList->setListData($data,$lData); @@ -52,5 +62,18 @@ class configViewer extends plugin $smarty->assign('content', $this->propertyList->render()); return($smarty->fetch(get_template_path('generic.tpl', TRUE))); } + + function save_object() + { + $all = $this->configRegistry->getAllProperties(); + foreach($all as $id => $p){ + if(isset($_POST[$p->getClass().":".$p->getName()])){ + $val = get_post($p->getClass().":".$p->getName()); + if($val != $p->getValue()){ + $p->setValue($val); + } + } + } + } } ?> diff --git a/gosa-core/plugins/addons/configViewer/generic.tpl b/gosa-core/plugins/addons/configViewer/generic.tpl new file mode 100644 index 000000000..1893271ab --- /dev/null +++ b/gosa-core/plugins/addons/configViewer/generic.tpl @@ -0,0 +1,25 @@ + +
+
+

{t}Config viewer{/t}

+ +
+ + + + + +
{t}Search for{/t}: + + + +
+
+
+
+ + + + +{$content} diff --git a/gosa-core/plugins/addons/configViewer/main.inc b/gosa-core/plugins/addons/configViewer/main.inc index 529634db8..27444ad41 100644 --- a/gosa-core/plugins/addons/configViewer/main.inc +++ b/gosa-core/plugins/addons/configViewer/main.inc @@ -23,13 +23,19 @@ */ if ($remove_lock){ if(session::is_set('configViewer')){ - // Nothing to unlock here + $configViewer = session::get('configViewer'); + $configViewer->save_object(); } } + /* Remove this plugin from session */ if ( $cleanup ){ + if (session::is_set('configViewer')){ + $configViewer = session::get('configViewer'); + $configViewer->save_object(); + } session::un_set('configViewer'); }else{