summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88d36e5)
raw | patch | inline | side by side (parent: 88d36e5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 15 Mar 2006 09:42:37 +0000 (09:42 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 15 Mar 2006 09:42:37 +0000 (09:42 +0000) |
"GOsa FAI install methods"
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2845 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2845 594d385d-05f5-0310-b6e9-bd551577e9d8
index d044c46f79124065eac9e2dc6a7315feca4ddd79..4d94d0e9407f10777580dc05e738c1a325b620ba 100644 (file)
{
var $package= "";
var $language= "";
- var $has_template= FALSE;
+ var $loaded_template= FALSE;
var $template_directory= "";
var $template= array();
function set_package($package)
{
$this->package= $package;
- return ($this->load());
}
function load()
{
- /* Reject requests, if parameters are not set */
- if ($this->package == "" || $this->template_directory == ""){
- return (FALSE);
- }
-
- /* Try to load package based template file */
- $filename= preg_replace("/\/+/", "/", $this->template_directory."/".$this->package.".templates");
- if (is_file($filename) && is_readable($filename)){
+ if( TRUE === $this->has_template() ) {
+
+ /* Try to load package based template file */
$this->template= array();
/* Read template array */
- $post_name = 0;
- $langcode = $this->language.".UTF-8";
- $in_description = FALSE;
- $got_local_description= FALSE;
+ $post_name = 0;
+ $langcode = $this->language.".UTF-8";
+ $in_description = FALSE;
+ $got_local_description = FALSE;
$fh= fopen($filename, 'r');
}
fclose($fh);
- $this->has_template= TRUE;
+ $this->loaded_template= TRUE;
$tmp= array();
foreach($this->template as $post_name => $template){
return (TRUE);
}
- $this->has_template= FALSE;
+ $this->loaded_template= FALSE;
return (FALSE);
}
function has_template()
{
- return ($this->has_template);
+ /* Reject requests, if parameters are not set */
+ if ($this->package == "" || $this->template_directory == ""){
+ return (FALSE);
+ }
+ $filename= preg_replace("/\/+/", "/", $this->template_directory."/".$this->package.".templates");
+ return (is_file($filename) && is_readable($filename));
}
/* This funtion sets the defualt value */
function SetDefault($var,$val)
{
- if($this->has_template){
+ if ($this->loaded_template) {
foreach($this->template as $key => $tmp){
if($tmp['Name'] == $var ){
$this->template[$key]['Default'] = $val;
/* Display all possible options in html*/
function get_dialog()
{
- if ($this->has_template){
+ if ($this->loaded_template) {
$result= "<table summary=''>";
foreach ($this->template as $post_name => $entry){
index bf9b32ba937d86391dad6d4a85cf2122a821f7a0..04f0a2b8a26127f4aa885331ebf0263ef16c56ed 100644 (file)
var $FAIstate = "";
+ var $FAIinstallMethods = array( "install", "ninstall", "remove",
+ "dselect-upgrade", "taskinst", "taskrm",
+ "hold", "clean", "aptitude", "aptitude-r",
+ "pending", "dpkgc" );
+
+
function faiPackage ($config, $dn= NULL)
{
/* Load Attributes */
}
$this->confDir = CONFIG_DIR."/fai/";
$this->FAIpackage = array();
+
+
+ $methods = array();
+ foreach($this->FAIinstallMethods as $method){
+ $methods[$method] = $method;
+ }
+ $this->FAIinstallMethods = $methods;
}
function execute()
$smarty= get_smarty();
$display= "";
+ $smarty->assign( "FAIinstallMethods", $this->FAIinstallMethods );
+
/* Check if we exist already - no need to ask for revisions, etc. then */
if ($this->dn != "new"){
$this->newDialogShown= true;
$this->attrs['FAIdebianSection'][] = $sec;
}
- $this->attrs["FAIinstallMethod"]= "aptitude";
+// $this->attrs["FAIinstallMethod"]= "aptitude";
$ldap->cat($this->dn);
if($ldap->count()!=0){
diff --git a/plugins/admin/fai/class_faiPackageConfiguration.inc b/plugins/admin/fai/class_faiPackageConfiguration.inc
index 55077c67b7ad9e4497b8f9c9874028cd455a8dc7..1717887d7c84ffa1669b6fe83a31c0dabae2c6b6 100644 (file)
$this->Debconf_handle->set_template_directory($path);
$this->Debconf_handle->set_package($this->obj);
$this->Debconf_handle->set_language(preg_replace('/_.*$/', '', get_browser_language()));
- $this->pkg_config = $pkg_config;
- foreach($this->pkg_config as $var){
- $this->Debconf_handle->SetDefault($var['Name'],$var['Value']);
+ if( $this->Debconf_handle->load() ) {
+ $this->pkg_config = $pkg_config;
+
+ foreach($this->pkg_config as $var){
+ $this->Debconf_handle->SetDefault($var['Name'],$var['Value']);
+ }
}
}
index a4d4371bdadaf9aef4ea1478e16bcfef9c85e91f..d88ff6443699bd7883b1db979d8ef7b89ac94eee 100644 (file)
{$section}
</td>
</tr>
+ <tr>
+ <td>
+ {t}Install method{/t} :
+ </td>
+ <td>
+ <select name="FAIinstallMethod" {$cnACL} >
+ {html_options options=$FAIinstallMethods output=$FAIinstallMethod selected=$FAIinstallMethod}
+ </select>
+ </td>
+ </tr>
</table>
</td>
</tr>