summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5aefa1)
raw | patch | inline | side by side (parent: d5aefa1)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 28 Sep 2010 07:00:36 +0000 (07:00 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 28 Sep 2010 07:00:36 +0000 (07:00 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19822 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig.tpl | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig.tpl b/gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig.tpl
index 97893508f75a22a9f54a941dc2d6d2f1456cfb37..0bb627e8cac208877fc05eeabcfef6680a0fd3e8 100644 (file)
<h3>{t}Device Config{/t}</h3>
-
-{t}Add a new sub-module to the current{/t}
-<select name='subModule'>
- {html_options output=$subModule values=$subModule}
-</select>
+{$navigationList}
<button name='addSubModule'>{msgPool type='addButton'}</button>
-{$navigator}
-
<hr>
-<h3>{$containerName}</h3>
-{$containerDescription}
+<b>{$containerName}</b> <i>({$containerDescription})</i>
+<p>
{$template}
+</p>
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 dccca989dc43051d97c53266e65b1f7265cd0ad8..5105f4f44d7760f189930220b6427dd138b43ad9 100644 (file)
private $currentItemValues = array();
private $currentItem = array();
+ private $navigationList = NULL;
+
/*! \brief Constructs the device configuration plugin
* @param Config The GOsa configuration object.
$this->TemplateEngine->setTemplate('puppet.tpl');
$this->config = $config;
+ $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 = '{
return($str);
}
+ function getItemList($array=NULL,&$res = NULL, $depth = 0)
+ {
+ // Prepare values.
+ $array = ($array == NULL)? $this->currentItemValues['root']: $array;
+ if(!$res){
+ $res = array('data' => array(), 'lData' => array());
+ }
+
+ // Prepare the entry name
+ $str = $array['name'];
+ if($this->currentItemName == $array['name']){
+ $str = "<b>".$array['name']."</b>";
+ }
+ $add = ' ';
+ $str = str_pad('', ($depth*strlen($add)), $add, STR_PAD_LEFT).$str;
+
+ // Add the current entry
+ $res['data'][] = $array;
+ $res['lData'][] = array('data' => array($str, "<i>".$array['type']."</i>"));
+
+ // Add sub-entries
+ if(count($array['children'])){
+ $depth ++;
+ foreach($array['children'] as $subItem){
+ $this->getItemList($subItem, $res, $depth);
+ }
+ }
+
+ return($res);
+ }
+
/*! \brief Add a new child-item to the currently selected one.
*
{
$smarty = get_smarty();
+ // Generate item list
+ $list = $this->getItemList();
+ $this->navigationList->setListData($list['data'],$list['lData']);
+ $this->navigationList->update();
+ $smarty->assign('navigationList',$this->navigationList->render());
+
// Assign the navigation bar.
$smarty->assign('navigator', $this->renderNavigator());
}
}
- // Module switched
- if(isset($_GET['item'])){
- $name = $this->idToName[$_GET['item']];
- $this->setCurrentItem($name);
+ // 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']);
}
}
}