From: hickert Date: Thu, 28 Jan 2010 14:07:58 +0000 (+0000) Subject: Updated package selection X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4577478e5e8a680cbb8bab55be9057a07aede257;p=gosa.git Updated package selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15420 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc deleted file mode 100644 index 794a8d344..000000000 --- a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc +++ /dev/null @@ -1,213 +0,0 @@ -FAIdebianRelease = $release; - $this->selected = $used_packages; - $this->initializeSections(); - - /* Get old search filter, if there is one*/ - $this->searchStrPKG = _("Please enter your search string here"); - if(session::is_set("searchStrPKG")){ - $this->searchStrPKG = session::get("searchStrPKG"); - } - } - - - /*! \brief Load all release seactions from GOsa support daemon - */ - function initializeSections() - { - $this->package_sections = array(); - $q = new gosaSupportDaemon(); - $ret = $q->FAI_get_package_sections($this->FAIdebianRelease); - if($q->is_error()){ - msg_dialog::display(_("Service infrastructure"),msgPool::siError($q->get_error()),ERROR_DIALOG); - }else{ - foreach($ret as $entry){ - $this->package_sections[array_pop($entry)] = TRUE; - } - } - } - - - /*! \brief Create HTML for this plugin. - @return String The html code for this plugin. - */ - function execute() - { - /* Call parent execute */ - plugin::execute(); - - /* Fill templating stuff */ - $smarty = get_smarty(); - $display = ""; - - - /* Create section checkboxes - */ - $Section_boxes = " -
- "; - $i = 0; - foreach($this->package_sections as $cat => $selected){ - if($i == 2){ - $Section_boxes .=""; - $i = 0; - } - if($selected){ - $Section_boxes .=""; - }else{ - $Section_boxes .=""; - } - $i ++ ; - } - $Section_boxes .= "
 ".$cat."  ".$cat." 
"; - - /* Create List && fill it with packages - */ - $cnt = 0; - $this->reload(); - $divlist = new divlist("PackageEntry"); - $divlist->SetPluginMode(); - $divlist->SetSummary(_("This list displays all assigned package names for this repository settings.")); - $divlist->SetEntriesPerPage(0); - $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;'" ), - array("string" => "Description", "attach" => "style='border-right:0px;text-align:left;'"))); - - foreach($this->pkgs as $pkg){ - if(in_array($pkg['PACKAGE'],$this->selected)){ - $check = " checked "; - }else{ - $check = ""; - } - - $desc = " "; - if(isset($pkg['DESCRIPTION'])){ - $desc = base64_decode($pkg['DESCRIPTION']); - } - - $chkbox = " - "; - $divlist->AddEntry(array(array("string"=>$chkbox, "attach" => "style='text-align:center;width:20px;'"), - 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($desc), - "attach" => "style='border-right:0px;text-align:left;'"))); - } - - $smarty->assign("max_entries", (count($this->pkgs) >=200)); - - $smarty->assign("Section_boxes" , $Section_boxes); - $smarty->assign("searchStrPKG" , $this->searchStrPKG); - $smarty->assign("faihead" , ""); - $smarty->assign("failist" , $divlist->DrawList()); - $smarty->assign("infoimage" , get_template_path('images/info.png')); - $smarty->assign("launchimage" , get_template_path('images/launch.png')); - $smarty->assign("alphabet" , generate_alphabet()); - $smarty->assign("apply" , apply_filter(TRUE)); - $smarty->assign("search_image" , get_template_path('images/lists/search.png')); - - $display.= $smarty->fetch(get_template_path('faiPackageEntry.tpl', TRUE)); - return($display); - } - - - /*! \brief Save HTML POST data to object - */ - function save_object() - { - /* Keep sections selected */ - foreach($_POST as $name => $value){ - if(preg_match("/^wasonpage_/i",$name)){ - $name = preg_replace("/^wasonpage_/","",$name); - $n =base64_decode($name); - if(isset($_POST['use_'.$name])){ - $this->selected[$n] = $n; - }else{ - if(isset($this->selected[$n])){ - unset($this->selected[$n]); - } - } - - } - } - - /* Get Posted search filter - */ - if(isset($_POST['searchStrPKG'])){ - $this->searchStrPKG = get_post("searchStrPKG"); - } - if(isset($_GET['search'])){ - $this->searchStrPKG= $_GET['search']."*"; - } - if(empty($this->searchStrPKG)){ - $this->searchStrPKG = "*"; - } - session::set('searchStrPKG',$this->searchStrPKG); - } - - - /*! \brief Reload list of displayed packages - */ - function reload() - { - $this->pkgs = array(); - $q = new gosaSupportDaemon(); - $filter = preg_replace("/\*/","%",array($this->searchStrPKG)); - $attrs = array("distribution", "package","version", "section", "description", "timestamp"); - $ret = $q->FAI_get_packages($this->FAIdebianRelease,$attrs,$filter,0,200); - if($q->is_error()){ - msg_dialog::display(_("Service infrastructure"),msgPool::siError($q->get_error()),ERROR_DIALOG); - }else{ - foreach($ret as $attr){ - $this->pkgs[$attr['PACKAGE']] = $attr; - } - } - } - - - /*! \brief Return all selected packages - @return Array All selected package names - */ - function save() - { - return($this->selected); - } -} -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/gosa-plugins/fai/admin/fai/faiPackageEntry.tpl b/gosa-plugins/fai/admin/fai/faiPackageEntry.tpl deleted file mode 100644 index f8958039a..000000000 --- a/gosa-plugins/fai/admin/fai/faiPackageEntry.tpl +++ /dev/null @@ -1,69 +0,0 @@ - - - - - -
-
-

- {t}List of available packages{/t} -

-
-
- {$faihead} -
-
-
- {if $max_entries} -
- - {t}The search returned too many results, only the first 200 entries are shown.{/t} -
- {/if} -
{$failist} -
-
-
-

- [i]{t}Information{/t} -

-
-
- {t}This menu allows you to select multiple packages to add them to the currently edited package list.{/t} -
-
-
-

- [F] - {t}Filters{/t} -

-
-
- {$Section_boxes} -
-
- - - - - -
- {t}Display objects matching{/t} - - -
- {$apply} -
-
-
- - -
- - -