Code

Updated filterClass names
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 09:32:26 +0000 (09:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 09:32:26 +0000 (09:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16367 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/ihtml/themes/modern/filterEditor.tpl [deleted file]
gosa-core/ihtml/themes/modern/filterEditorEntry.tpl [deleted file]
gosa-core/ihtml/themes/modern/userFilter.tpl [new file with mode: 0644]
gosa-core/ihtml/themes/modern/userFilterEditor.tpl [new file with mode: 0644]
gosa-core/include/class_filterEditor.inc
gosa-core/include/class_filterEditorEntry.inc
gosa-core/include/class_management.inc

diff --git a/gosa-core/ihtml/themes/modern/filterEditor.tpl b/gosa-core/ihtml/themes/modern/filterEditor.tpl
deleted file mode 100644 (file)
index 66c6442..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<h3>{t}Filter editor{/t}</h3>
-
-<hr>
-
-{t}List of configured filters{/t}
-{$list}
-<button type='submit' name='addFilter'>{msgPool type='addButton'}</button>
-
-<hr>
-
-<div class="plugin-actions">
-  <button type='submit' name='saveFilter'>{msgPool type='saveButton'}</button>
-  <button type='submit' name='cancelFilter'>{msgPool type='cancelButton'}</button>
-</div>
diff --git a/gosa-core/ihtml/themes/modern/filterEditorEntry.tpl b/gosa-core/ihtml/themes/modern/filterEditorEntry.tpl
deleted file mode 100644 (file)
index 71f5e0f..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<h3>{t}Filter editor{/t}</h3>
-
-<hr>
-
-<table summary="{t}Filter editor{/t}" width="100%">
-  <tr>
-    <td style='vertical-align: top; width:40%;'>
-      <table summary='{t}Filter properties{/t}'>
-        <tr>
-          <td>
-            <label for='name'>{t}Name{/t}</label>
-          </td>
-          <td>
-            <input type='text' name='name' id='name' value='{$name}'>
-          </td>   
-        </tr>
-        <tr>
-          <td>
-            <label for='description'>{t}Description{/t}</label>
-          </td>
-          <td>
-            <input type='text' name='description' id='description' value='{$description}'>
-          </td>   
-        </tr>
-      </table>  
-    
-      <br>
-      
-      <input type='checkbox' name='shareFilter' value='1' {if $share} checked {/if}>
-       {t}Public visible{/t}              
-
-      <br>
-    
-      <input type='checkbox' name='enableFilter' value='1' {if $enable} checked {/if}>
-       {t}Enabled{/t}
-
-    </td>
-    <td style='vertical-align: top;'>
-      <label for='usedCategory'>{t}Affects the following categories{/t}</label><br>
-      <select id='usedCategory' name='usedCategory[]' size='4' multiple style='width:100%;'>
-        {html_options options=$selectedCategories}
-      </select>
-      <br>
-      <select id='availableCategory' name='availableCategory'
-        onChange="$('manualCategory').value=$('availableCategory').options[$('availableCategory').selectedIndex].value"> 
-        <option value=''>&nbsp;</option>
-        {html_options values=$availableCategories output=$availableCategories}
-      </select>
-      <input type='text' id='manualCategory' name='manualCategory' value=''>
-      <button type='submit' name='addCategory'>{msgPool type='addButton'}</button>
-      <button type='submit' name='delCategory'>{msgPool type='delButton'}</button>
-    </td>
-  </tr>
-</table>
-
-<hr>
-
-<textarea name='filter' id='filter' cols="0" style='width:100%; height: 100px;'>{$filter}</textarea>
-
-<hr>
-
-<input type='hidden' value='1' name='filterEditorEntry'>
-
-<div class="plugin-actions">
-  <button type='submit' name='saveFilterSettings'>{msgPool type='saveButton'}</button>
-  <button type='submit' name='cancelFilterSettings'>{msgPool type='cancelButton'}</button>
-</div>
diff --git a/gosa-core/ihtml/themes/modern/userFilter.tpl b/gosa-core/ihtml/themes/modern/userFilter.tpl
new file mode 100644 (file)
index 0000000..66c6442
--- /dev/null
@@ -0,0 +1,14 @@
+<h3>{t}Filter editor{/t}</h3>
+
+<hr>
+
+{t}List of configured filters{/t}
+{$list}
+<button type='submit' name='addFilter'>{msgPool type='addButton'}</button>
+
+<hr>
+
+<div class="plugin-actions">
+  <button type='submit' name='saveFilter'>{msgPool type='saveButton'}</button>
+  <button type='submit' name='cancelFilter'>{msgPool type='cancelButton'}</button>
+</div>
diff --git a/gosa-core/ihtml/themes/modern/userFilterEditor.tpl b/gosa-core/ihtml/themes/modern/userFilterEditor.tpl
new file mode 100644 (file)
index 0000000..2d94578
--- /dev/null
@@ -0,0 +1,67 @@
+<h3>{t}Filter editor{/t}</h3>
+
+<hr>
+
+<table summary="{t}Filter editor{/t}" width="100%">
+  <tr>
+    <td style='vertical-align: top; width:40%;'>
+      <table summary='{t}Filter properties{/t}'>
+        <tr>
+          <td>
+            <label for='name'>{t}Name{/t}</label>
+          </td>
+          <td>
+            <input type='text' name='name' id='name' value='{$name}'>
+          </td>   
+        </tr>
+        <tr>
+          <td>
+            <label for='description'>{t}Description{/t}</label>
+          </td>
+          <td>
+            <input type='text' name='description' id='description' value='{$description}'>
+          </td>   
+        </tr>
+      </table>  
+    
+      <br>
+      
+      <input type='checkbox' name='shareFilter' value='1' {if $share} checked {/if}>
+       {t}Public visible{/t}              
+
+      <br>
+    
+      <input type='checkbox' name='enableFilter' value='1' {if $enable} checked {/if}>
+       {t}Enabled{/t}
+
+    </td>
+    <td style='vertical-align: top;'>
+      <label for='usedCategory'>{t}Affects the following categories{/t}</label><br>
+      <select id='usedCategory' name='usedCategory[]' size='4' multiple style='width:100%;'>
+        {html_options options=$selectedCategories}
+      </select>
+      <br>
+      <select id='availableCategory' name='availableCategory'
+        onChange="$('manualCategory').value=$('availableCategory').options[$('availableCategory').selectedIndex].value"> 
+        <option value=''>&nbsp;</option>
+        {html_options values=$availableCategories output=$availableCategories}
+      </select>
+      <input type='text' id='manualCategory' name='manualCategory' value=''>
+      <button type='submit' name='addCategory'>{msgPool type='addButton'}</button>
+      <button type='submit' name='delCategory'>{msgPool type='delButton'}</button>
+    </td>
+  </tr>
+</table>
+
+<hr>
+
+<textarea name='filter' id='filter' cols="0" style='width:100%; height: 100px;'>{$filter}</textarea>
+
+<hr>
+
+<input type='hidden' value='1' name='userFilterEditor'>
+
+<div class="plugin-actions">
+  <button type='submit' name='saveFilterSettings'>{msgPool type='saveButton'}</button>
+  <button type='submit' name='cancelFilterSettings'>{msgPool type='cancelButton'}</button>
+</div>
index 9c779ef2498a2374ad722410b3ef6ad556c59014..91ae157ebf49301b3acb8f5f493aa2988764abd1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class filterEditor extends plugin 
+class userFilter extends plugin 
 {
   protected $fitlers = array();
   protected $availableCategories = array();
@@ -101,7 +101,7 @@ class filterEditor extends plugin
     }
 
     // Save modified filter entries (edit dialog)
-    if(isset($_POST['saveFilterSettings']) && $this->dialog instanceOf filterEditEntry){
+    if(isset($_POST['saveFilterSettings']) && $this->dialog instanceOf userFilterEditor){
       $this->dialog->save_object();
       $msgs = $this->dialog->check();
       if(count($msgs)){
@@ -136,13 +136,13 @@ class filterEditor extends plugin
     if($action['action'] == 'edit' && count($action['targets']) == 1){
       $key= $this->filterWidget->getKey($action['targets'][0]);
       if(isset($this->filters[$key])){
-        $this->dialog=new filterEditEntry($this->filters[$key], $this->availableCategories);
+        $this->dialog=new userFilterEditor($this->filters[$key], $this->availableCategories);
       }
     }
 
     // Act on new requests
     if(isset($_POST['addFilter'])){
-      $this->dialog=new filterEditEntry(array(), $this->availableCategories);
+      $this->dialog=new userFilterEditor(array(), $this->availableCategories);
     }
 
     // Act on remove requests 
@@ -156,14 +156,14 @@ class filterEditor extends plugin
     }
 
     // Display edit dialog
-    if($this->dialog instanceOf filterEditEntry){
+    if($this->dialog instanceOf userFilterEditor){
       $this->dialog->save_object();
       return($this->dialog->execute());
     }
 
     $smarty = get_smarty();
     $smarty->assign("list", $this->filterWidget->render());
-    return($smarty->fetch(get_template_path('filterEditor.tpl', FALSE)));
+    return($smarty->fetch(get_template_path('userFilter.tpl', FALSE)));
   }
 
 
index 7d347558b5b2c62282e48238e0f6308b87168699..5719106bb021058caeac5dcf09b843c73ed27668 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class filterEditEntry extends plugin 
+class userFilterEditor extends plugin 
 {
   // The original entry else array(), allows us to perform existence checks.
   public $entry = array();
@@ -71,7 +71,7 @@ class filterEditEntry extends plugin
     $smarty->assign('description', $this->description);
     $smarty->assign('selectedCategories', $this->selectedCategories);
     $smarty->assign('availableCategories', $this->availableCategories);
-    return($smarty->fetch(get_template_path('filterEditorEntry.tpl', FALSE)));
+    return($smarty->fetch(get_template_path('userFilterEditor.tpl', FALSE)));
   }
 
 
@@ -79,7 +79,7 @@ class filterEditEntry extends plugin
    */
   function save_object()
   {
-    if(isset($_POST['filterEditorEntry'])){
+    if(isset($_POST['userFilterEditor'])){
 
       // Get posted strings
       foreach(array('name','description','filter') as $attr){
@@ -132,7 +132,7 @@ class filterEditEntry extends plugin
 
 
   /*! \brief    Transforms the entered values into a filter object (array) which is useable
-   *             for the filterEditor overview dialog.
+   *             for the userFilter overview dialog.
    *  @return   Returns transformed filter data.
    */
   function save()
index aec1431f5efcb9cd5049287b743f9c22b8769bec..4604eecbe2bed502cf9de24c2976224f055e1bb4 100644 (file)
@@ -189,7 +189,7 @@ class management
   function editFilter()
   {
     $headpage = $this->getHeadpage();
-    $this->dialogObject = new filterEditor($this->config,$headpage->categories);
+    $this->dialogObject = new userFilter($this->config,$headpage->categories);
   }
  
   function renderList()