From: hickert Date: Tue, 13 Apr 2010 07:53:41 +0000 (+0000) Subject: Updated repository listings X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c51fe81f763d33c2cefe1f0e49f43a0ca35e8962;p=gosa.git Updated repository listings git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17599 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/systems/services/repository/class_servRepositorySetup.inc b/gosa-plugins/fai/admin/systems/services/repository/class_servRepositorySetup.inc index 15ef168ee..a72bd617d 100644 --- a/gosa-plugins/fai/admin/systems/services/repository/class_servRepositorySetup.inc +++ b/gosa-plugins/fai/admin/systems/services/repository/class_servRepositorySetup.inc @@ -4,7 +4,7 @@ class servRepositorySetup extends plugin { /* attribute list for save action */ var $ignore_account = TRUE; - var $attributes = array("Release","ParentServer","Url","cn"); + var $attributes = array("Release","ParentServer","Url"); var $objectclasses = array("whatever"); /* Attributes */ @@ -20,6 +20,11 @@ class servRepositorySetup extends plugin function servRepositorySetup (&$config, $dn= NULL,$data = false) { plugin::plugin ($config, $dn); + + if(isset($this->attrs['cn'][0])){ + $this->cn=$this->attrs['cn'][0]; + } + if($data != false){ foreach(array("Sections","Release","Url","ParentServer","initialy_was") as $atr){ if(isset($data[$atr])){ @@ -27,6 +32,18 @@ class servRepositorySetup extends plugin } } } + + // Prepare lists + $this->sectionList = new sortableListing(); + $this->sectionList->setDeleteable(true); + $this->sectionList->setInstantDelete(true); + $this->sectionList->setEditable(false); + $this->sectionList->setWidth("100%"); + $this->sectionList->setHeight("100px"); + $this->sectionList->setHeader(array(_("Name"))); + $this->sectionList->setColspecs(array('*','20px')); + $this->sectionList->setDefaultSortColumn(0); + } function GetName() @@ -80,36 +97,18 @@ class servRepositorySetup extends plugin } } - foreach($_POST as $name => $value){ - if(preg_match("/^delete_/",$name)){ - - $val = preg_replace("/^delete_/","",$name); - echo $val; - $val = postDecode($val); - - if(isset($this->Sections[$val])){ - unset($this->Sections[$val]); - } - } + $this->sectionList->save_object(); + $action = $this->sectionList->getAction(); + if($action['action'] == 'delete'){ + $this->Sections = $this->sectionList->getMaintainedData(); } } - $divlist = new divSelectBox("servRepositorySetup"); - $divlist->setHeight("220"); - $dellink = ""; - if(preg_match("/w/",$this->parent->getacl("Section"))){ - $dellink = image('images/lists/trash.png','delete_%s'); - } + $this->sectionList->setAcl($this->parent->getacl('Section')); + $this->sectionList->setListData($this->Sections) ; + $this->sectionList->update(); - foreach($this->Sections as $sec){ - $divlist->AddEntry(array( - array("string"=>$sec), - array("string"=>preg_replace("/%s/",postEncode($sec), $dellink), - "attach"=>"style='border-right:0px;width:20px;'") - )); - } - - $smarty->assign("Sections",$divlist->DrawList()); + $smarty->assign("Sections",$this->sectionList->render()); /* Get && assign acls */ $tmp = $this->parent->plInfo();