obj = $obj; $this->release = $release; $this->pkg_config = $pkg_config; /* Read pkg debconf info */ $q = new gosaSupportDaemon(); $ret = $q->FAI_get_packages($this->release,array("*"),$this->obj); $tpl = ""; if(isset($ret['ANSWER1']) && isset($ret['ANSWER1']['TEMPLATE'])){ $tpl = base64_decode($ret['ANSWER1']['TEMPLATE']); } $this->Debconf_handle = new debconf(preg_replace('/_.*$/', '', get_browser_language())); $this->Debconf_handle->load_from_string($tpl); if($this->Debconf_handle->has_template()){ foreach($this->pkg_config as $var){ $this->Debconf_handle->SetDefault($var['Name'],$var['Value']); } } } function execute() { /* Call parent execute */ plugin::execute(); /* Fill templating stuff */ $smarty = get_smarty(); $smarty->assign("headline", sprintf(_("Debconf information for package '%s'"), $this->obj)); $this->Debconf_handle->PostCheck(); $smarty->assign("Config",$this->Debconf_handle->get_dialog()); return($smarty->fetch(get_template_path('faiPackageConfiguration.tpl', TRUE))); } /* Save data to object */ function save_object() { } /* Check supplied data */ function check() { /* Call common method to give check the hook */ $message= plugin::check(); return ($message); } function save() { $this->Debconf_handle->PostCheck(); $pkgs = $this->Debconf_handle->template; $tmp = array(); foreach($pkgs as $pkg){ $tmp[$this->obj][$pkg['Name']]['Value']= $pkg['Default']; $tmp[$this->obj][$pkg['Name']]['Name'] = $pkg['Name']; $tmp[$this->obj][$pkg['Name']]['Type'] = $pkg['Type']; } return($tmp); } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>