Code

Prepared item list to be drawn
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Sep 2010 12:49:20 +0000 (12:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Sep 2010 12:49:20 +0000 (12:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19833 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc
gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc
gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc

index 2f14d4e8bd693cb19090513d056afacb4127d63f..41b38e42de3b7e84e8f9c74d7ad1447ec9ec1d05 100644 (file)
@@ -18,6 +18,7 @@ class DeviceConfig extends management
 
     private $base ;
 
+
     /*! \brief  Constructs the device configuration plugin 
      *  @param  Config  The GOsa configuration object.
      */
@@ -34,15 +35,6 @@ class DeviceConfig extends management
         $this->itemContainerSelector = new releaseSelector(array('cn=root'=>''), 'cn=root', 'cn=root');
         $this->base = "cn=root";
 
-        $this->navigationList= new sortableListing();
-        $this->navigationList->setDeleteable(true);
-        $this->navigationList->setEditable(true);
-        $this->navigationList->setColspecs(array('*'));
-        $this->navigationList->setWidth("100%");
-        $this->navigationList->setHeight("140px");
-        $this->navigationList->setAcl("rwcdm");
-        $this->navigationList->sortingEnabled(FALSE);
-
         // CREATE Dummy entry 
         $str = file_get_contents('/home/hickert/json.txt');
         $items = json_decode($str, TRUE);
@@ -70,14 +62,14 @@ class DeviceConfig extends management
         $this->setCurrentItem('root');
         $this->addItem('PuppetModule','test1',
                 array(
-                    'dependency' => '',
+                    'dependency' => array('stulle','Wurst'),
                     'version' => '2.4-f',
                     'name'  => 'Thundebird',
                     'description' => 'Mozilla mail client')
                 );
         $this->addItem('PuppetModule','test2',
                 array(
-                    'dependency' => '',
+                    'dependency' => array('Leipnitz','Dose'),
                     'version' => 1,
                     'name'  => 'Firefox',
                     'description' => 'Test Module')
@@ -99,12 +91,19 @@ class DeviceConfig extends management
         $this->rebuildListing();
     }
 
+    
+    function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
+    {
+        $this->setCurrentItem($target[0]);
+    }
+
 
     /*! \brief   Overridden render method of class mangement.
      *            this allows us to add a release selection box.
      */
     function renderList()
     {
+        $tpl = $this->TemplateEngine->render();
         session::set('DEVICE_ITEMS', $this->currentItemValues);
         $this->rebuildListing();
         $filter = $this->getFilter();
@@ -114,7 +113,7 @@ class DeviceConfig extends management
         $smarty = get_smarty();
         $smarty->assign("RELEASE", $this->itemContainerSelector->render());
         $display = $headpage->render();
-        return($this->getHeader().$display);
+        return($tpl.$this->getHeader().$display);
     }
 
 
@@ -281,9 +280,6 @@ class DeviceConfig extends management
 
         // Generate item list
         $list = $this->getItemList();
-        $this->navigationList->setListData($list['data'],$list['lData']);
-        $this->navigationList->update();
-        $smarty->assign('navigationList',$this->navigationList->render());
 
         // Assign current item info
         $smarty->assign('containerName', $this->currentItemDescriptor['name']);
@@ -322,16 +318,11 @@ class DeviceConfig extends management
             }
         }
 
-        // Another item selected?
-        $this->navigationList->save_object();
-        $action = $this->navigationList->getAction();
-        if($action['action'] == 'edit'){
-            $item = $this->navigationList->getData($action['targets'][0]);
-            $this->setCurrentItem($item['name']);
-        }
-
+        // Get selected Items
         $this->itemContainerSelector->update();
         $this->base = $this->itemContainerSelector->getBase();
+        $list = preg_split("/[,]*cn=/", $this->base,0,PREG_SPLIT_NO_EMPTY);
+        $this->setCurrentItem($list[0]); 
     }
 
     /*! \brief    Forward plugin acls
index fac61cbdec24b1ab0f424fcace04cc2b29f01eb9..8ae4650a2d49999de66d77f50ee0b903d66cd611 100644 (file)
@@ -97,6 +97,11 @@ class TemplateEngine
         }
     }
 
+    
+    function execute(){
+        return($this->render());
+    }
+    
 
     /*! \brief  Creates the HTML content for the given list of widgets
      *  @return String  The HTML content.
index 44aded3a360ef520220cc054f4e7ebd264d65bcc..a27342365b540c909a73e8a3fcee5abccabab31e 100644 (file)
@@ -36,7 +36,7 @@ class filterDeviceItems {
             $entry[] = 'description';
             $entry['objectClass'] = array('FAKE_OC_DeviceItem','count' => 1);
             $entry[] = 'objectClass';
-            $entry['count'] = 4;
+            $entry['count'] = 3;
             $ret[] = $entry;
         }