From 5a9f2e4d5606a213119d6242697ccd70754accd6 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 28 Sep 2010 12:49:20 +0000 Subject: [PATCH] Prepared item list to be drawn git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19833 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/Config/class_DeviceConfig.inc | 37 +++++++------------ .../goto/Config/class_TemplateEngine.inc | 5 +++ .../goto/Config/class_filterDeviceItems.inc | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc index 2f14d4e8b..41b38e42d 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc @@ -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 diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc index fac61cbde..8ae4650a2 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc @@ -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. diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc index 44aded3a3..a27342365 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc @@ -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; } -- 2.30.2