From 1f2da69662cb70f0437d38611a0b218c4233f335 Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 14 Jan 2008 15:01:40 +0000 Subject: [PATCH] Updated git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8330 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/class_divListRepositories.inc | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 gosa-core/plugins/admin/systems/services/class_divListRepositories.inc diff --git a/gosa-core/plugins/admin/systems/services/class_divListRepositories.inc b/gosa-core/plugins/admin/systems/services/class_divListRepositories.inc new file mode 100644 index 000000000..6e43dc18c --- /dev/null +++ b/gosa-core/plugins/admin/systems/services/class_divListRepositories.inc @@ -0,0 +1,84 @@ +AddCheckBox */ + var $parent ; + var $ui ; + + var $regex ="*"; + + function divListRepository ($config,$parent) + { + MultiSelectWindow::MultiSelectWindow($config,"Repository", "server"); + + $this->parent = $parent; + $this->ui = get_userinfo(); + + $this->SetTitle("repositories"); + $this->SetSummary(_("List of configured repositories.")); + $this->SetInformation(_("This menu allows you to create, delete and edit repository settings.")); + $this->EnableCloseButton(FALSE); + $this->EnableSaveButton(FALSE); + $this->AddHeader(array("string"=>_("Release"),"attach"=>"style='width:80px;'")); + $this->AddHeader(array("string"=>_("Sections"))); + $this->AddHeader(array("string"=>_("Options"),"attach"=>"style='border-right:0px;width:55px;'")); + $this->AddRegex("regex",_("Regular expression for matching object names"),"*",TRUE); + $this->EnableAplhabet(TRUE); + } + + function GenHeader() + { + if($this->parent->acl_is_createable()){ + $this->SetListHeader(""); + } + } + + function execute() + { + $this->ClearElementsList(); + $this->GenHeader(); + } + + function setEntries($list) + { + $link = "%s"; + $edit = " "; + + /* Hide delete icon, if delete is not allowed */ + if($this->parent->acl_is_removeable()){ + $delete = ""; + }else{ + $delete = " "; + } + + foreach($list as $name => $reps){ + + $str = " "; + if(preg_match("/".str_replace("*",".*",$this->regex)."/",$reps['Release'])){ + foreach($reps['Sections'] as $sec){ + $str.=$sec." "; + } + $this->AddElement(array( + array("string"=>sprintf($link,base64_encode($name),$name),"attach"=>"style='width:80px;'"), + array("string"=>sprintf($link,base64_encode($name),_("Sections")." :".$str)), + array("string"=>preg_replace("/%s/",base64_encode($name),$edit.$delete),"attach"=>"style='border-right:0px;width:55px;text- align:right;'") + )); + } + } + + } + + function Save() + { + MultiSelectWindow :: Save(); + } + + function save_object() + { + /* Save automatic created POSTs like regex, checkboxes */ + MultiSelectWindow :: save_object(); + } +} +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> -- 2.30.2