From: hickert Date: Mon, 14 Apr 2008 09:18:36 +0000 (+0000) Subject: Update FAI package stuff X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7026ac8f44abb7507f58411f387b89866ce19e4b;p=gosa.git Update FAI package stuff -Added some comments for the package classes -Fixed Package Select dialog. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10393 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc b/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc index 4e6ebf517..ab437c3bc 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackageConfiguration.inc @@ -12,6 +12,14 @@ class faiPackageConfiguration extends plugin var $obj; var $release; + + /*! \brief Configure a FAI package entry. + @param Object $config GOsa configuration object; + @param String The DN of the current package. + @param String The package name (e.g. apache) + @param String The release name (e.g. edge) + @param Array The current package configuration. + */ function faiPackageConfiguration (&$config, $dn= NULL,$obj,$release,$pkg_config) { plugin::plugin ($config, $dn); @@ -19,16 +27,23 @@ class faiPackageConfiguration extends plugin $this->release = $release; $this->pkg_config = $pkg_config; - /* Read pkg debconf info */ + /* Read pkg debconf info from gosaSupportDaemon + */ $q = new gosaSupportDaemon(); $ret = $q->FAI_get_packages($this->release,array("package","template"),array($this->obj)); if($q->is_error()){ msg_dialog::display(_("Service infrastructure"),msgPool::siError($q->get_error()),ERROR_DIALOG); } + + /* If we do not get a useable answer, use an empty template + */ $tpl = ""; if(isset($ret['ANSWER1']) && isset($ret['ANSWER1']['TEMPLATE'])){ $tpl = base64_decode($ret['ANSWER1']['TEMPLATE']); } + + /* Create package configuration mask + */ $this->Debconf_handle = new debconf(preg_replace('/_.*$/', '', get_browser_language())); $this->Debconf_handle->load_from_string($tpl); if($this->Debconf_handle->has_template()){ @@ -39,6 +54,10 @@ class faiPackageConfiguration extends plugin } + /*! \brief Returns a html interface, that allow to modify + the package attributes. + @return String HTML content/ui for this plugin + */ function execute() { /* Call parent execute */ @@ -52,6 +71,7 @@ class faiPackageConfiguration extends plugin return($smarty->fetch(get_template_path('faiPackageConfiguration.tpl', TRUE))); } + /* Save data to object */ function save_object() { @@ -65,6 +85,10 @@ class faiPackageConfiguration extends plugin return ($message); } + + /*! \brief Returns an array with all configured attributes + @return Array All configured attributes. + */ function save() { $this->Debconf_handle->PostCheck(); diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc index 7888d78bc..e9697009d 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc @@ -1,5 +1,8 @@ SetPluginMode(); $divlist->SetSummary(_("This list displays all assigned package names for this repository settings.")); $divlist->SetEntriesPerPage(0); - #$divlist->SetHeight("650px;"); $divlist->SetHeader(array(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"), array("string" => "Name", "attach" => "style='width:180px;'"), array("string" => "Version", "attach"=>"style='width:240px;'" ), @@ -105,9 +114,12 @@ class faiPackageEntry extends plugin $chkbox = " "; $divlist->AddEntry(array(array("string"=>$chkbox, "attach" => "style='text-align:center;width:20px;'"), - array("string"=>$pkg['PACKAGE'], "attach" => "style='width:180px;'"), - array("string"=>"
".htmlentities($pkg['VERSION']), "attach" => "style='width:240px'"), - array("string"=>htmlentities($pkg['DESCRIPTION']), "attach" => "style='border-right:0px;text-align:left;'"))); + array("string"=>"
".$pkg['PACKAGE']."
", + "attach" => "style='width:180px;' title='".$pkg['PACKAGE']." (".$pkg['VERSION'].")'"), + array("string"=>"
".htmlentities($pkg['VERSION'])."
", + "attach" => "style='width:240px' title='".$pkg['PACKAGE']." (".$pkg['VERSION'].")'"), + array("string"=>htmlentities($pkg['DESCRIPTION']), + "attach" => "style='border-right:0px;text-align:left;'"))); } $smarty->assign("Section_boxes" , $Section_boxes);