Code

Updated property editor
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 May 2010 16:02:26 +0000 (16:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 4 May 2010 16:02:26 +0000 (16:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18053 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/addons/configViewer/class_configViewer.inc
gosa-core/plugins/addons/configViewer/generic.tpl
gosa-core/plugins/addons/configViewer/property-list.tpl

index 687da8877719b1dfb7fca2ac5fa3b977b3356b68..343f038456e59c04fd3dca654410c0697ee07deb 100644 (file)
@@ -39,15 +39,20 @@ class configViewer extends management
      */
     function execute()
     {
-        foreach($_POST as $pName => $value){
-            if(preg_match("/:/", $pName)){
-                list($class,$name) = preg_split("/:/", $pName,2);
-                if($this->config->configRegistry->propertyExists($class,$name)){
-                    $prop = $this->config->configRegistry->getProperty($class,$name);
-                    $prop->setValue(get_post($pName));;
-                }
+        // Walk trough all properties and check if there posts for us.
+        $all = $this->config->configRegistry->getAllProperties();
+        $modified = FALSE;
+        foreach($all as $prop){
+            $post = "{$prop->getClass()}:{$prop->getName()}";
+            if(isset($_POST[$post])){
+                $prop->setValue(get_post($post));;
             }
+        
+            $modified |= in_array($prop->getStatus(),array('modified','removed'));
         }
+       
+        $smarty = get_smarty();
+        $smarty->assign('is_modified', $modified);
         return(management::execute());
     }
 
index 1893271ab806e4c38c31604119f2e532c187e788..d02577fb73e56fc78639cc7a5b60d0654cd0541b 100644 (file)
@@ -19,7 +19,9 @@
  </div>
 </div>
 
-
+{if !$is_modified}
+<input type="hidden" name="ignore">
+{/if}
 
 
 {$content}
index 082f5dea62d40943b9ebb55bc36f626d89d4605d..785129092f6a261c79e1b1112f1c86231385404e 100644 (file)
   {$LIST}
 </div>
 
+{if !$is_modified}
+<input type="hidden" name="ignore">
+{/if}
+
 <div class="plugin-actions">
     <button name='saveProperties'>{msgPool type='okButton'}</button>
     <button name='cancelProperties'>{msgPool type='cancelButton'}</button>