categ_name) { $sources[$srce->categ_name][] = $srce; } else { $sources_no_category[] = $srce; } } if(count($sources_no_category)) { $sources[$msg["source_no_category"]] =$sources_no_category; } return $sources; } function do_sources() { global $charset,$source, $dbh, $msg; $r=""; if (!$source) $source=array(); if (count($source)) $_SESSION["checked_sources"]=$source; if (!isset($_SESSION["checked_sources"])) $_SESSION["checked_sources"] = ''; if ($_SESSION["checked_sources"]&&(!$source)) $source=$_SESSION["checked_sources"]; $count = 0; $paquets_de_sources = array(); //Recherche des sources $sources = get_sources(); foreach ($sources as $category_name=>$category) { if (isset($paquets_de_source) && $paquets_de_source) $paquets_de_sources[] = $paquets_de_source; $paquets_de_source = array(); $paquets_de_source["name"] = $category_name; $paquets_de_source["content"] = ''; // gen_plus_form("zsources".$count, $srce->categ_name ,"sdfsdfsdfsdf",true); $count++; foreach ($category as $srce) { $paquets_de_source["id"] = $srce->num_categ; $paquets_de_source["opac_expanded"] = $srce->opac_expanded ? true : false; if(!isset($_SESSION["source_".$srce->source_id."_cancel"])) $_SESSION["source_".$srce->source_id."_cancel"] = 0; $paquets_de_source["content"] .="
source_id."_cancel"]==2 ? 'DISABLED' : "")." name='source[]' value='".$srce->source_id."' id='source_".$srce->source_id."_".$count."' onclick='change_source_checkbox(source_".$srce->source_id."_".$count.", ".$srce->source_id.");'"; if (array_search($srce->source_id,$source)!==false) { $paquets_de_source["content"] .= " checked"; } else if (!count($source) && $srce->opac_selected) { $paquets_de_source["content"] .= " checked"; } $paquets_de_source["content"] .= "/>".($_SESSION["source_".$srce->source_id."_cancel"]==2 ? "" : "")." (".$msg["source_blocked"].")" : "")."
"; } } if (isset($paquets_de_source) && $paquets_de_source) $paquets_de_sources[] = $paquets_de_source; foreach($paquets_de_sources as $paquets_de_source) { $r .= gen_plus_form("zsources".$paquets_de_source["id"], $paquets_de_source["name"], $paquets_de_source["content"], $paquets_de_source["opac_expanded"])."\n\n"; } return $r; } function decale($var,$var1) { global ${$var}; global ${$var1}; ${$var1}=${$var}; }