<?php
//25.0.2.0 IHM/Champ/Liste/ListeMulti.php GF
//VersionVI: 01F250083h
//(c) 2005-2012 PC SOFT - Release
 if (!defined('__INC__IHM/Champ/Liste/Liste.php')) { define('__INC__IHM/Champ/Liste/Liste.php',true); include_once(WB_INCLUDE_PATH.'WD83a9f9fff5598133a55ffc6567590f9e.php'); } class CListeMulti extends CListe { var $TabSelect; function CListeMulti() { parent::CListe(); $this->TabSelect = array(); } function ListeDeplaceLigne($nIndexSource, $DestinationOuInc, $nType = null, $sFonctionOrigine = 'FCT_LISTEDEPLACELIGNE') { if ($nIndexSource == LIGNE_SELECTIONEE) { Fe81a7f9e('ERR_PARAMETRE_VALEUR_INCORRECT',$sFonctionOrigine); } return parent::ListeDeplaceLigne($nIndexSource,$DestinationOuInc,$nType,$sFonctionOrigine); } function ListeInsere( $ELEMENT, $Indice=-1 ) { parent::ListeInsere($ELEMENT, $Indice); if ($Indice != -1) { foreach ($this->TabSelect as $IndiceTableau => $Valeur ) { if (($Valeur > 0) && ($IndiceTableau >= $Indice)) { if ($this->TabSelect[$IndiceTableau] == 1) { unset($this->TabSelect[$IndiceTableau]); } else { $this->TabSelect[$IndiceTableau]--; } if (isset($this->TabSelect[$IndiceTableau + 1])) { $this->TabSelect[$IndiceTableau + 1]++; } else { $this->TabSelect[$IndiceTableau + 1] = 1; } } } } } function ListeSupprime( $Indice=-1 ) { if($this->F48dce54a()) { return false; } $nLigneSupprime = $Indice; if ($Indice == -1) $nLigneSupprime = $this->ListeSelect(); parent::ListeSupprime($Indice); foreach (array_keys($this->TabSelect) as $IndiceTableau) { if ($IndiceTableau == $nLigneSupprime) { unset($this->TabSelect[$IndiceTableau]); } else { if ($IndiceTableau > $nLigneSupprime) { unset($this->TabSelect[$IndiceTableau]); $this->TabSelect[$IndiceTableau - 1] = 1; } if ($this->Valeur == -1) { $this->Valeur = $IndiceTableau - 1; } } } } function ListeSupprimeTout() { parent::ListeSupprimeTout(); $this->TabSelect = array(); } function ListeSelectPlus() { $nNbLignes = func_num_args(); if ($nNbLignes == 0) { $this->Fd13d5087(); } else { $selection = func_get_args(); $this->F70e1a3ed($selection); if(Feef890d7()) { F694db118($this->m_sNomPHP); } } } function F70e1a3ed($selection) { if(isset($selection) && !empty($selection)) { if (parent::ListeSelect() == -1) { $this->Valeur = $selection[0]; } foreach ($selection as $valeur) { $this->TabSelect[$valeur] = 1; } } } function Fd13d5087() { $nNbLigne = count($this->TabLigne,COUNT_NORMAL); for ($i=1;$i<=$nNbLigne;$i++) { $this->TabSelect[$i] = 1; } if(Feef890d7()) { F694db118($this->m_sNomPHP); } } function ListeSelectMoins() { $deselection = func_get_args(); if (!isset($deselection) || empty($deselection) || $deselection[0] == -1) { foreach ($this->TabSelect as $Indice => $Valeur) $this->TabSelect[$Indice] = 0; $this->Valeur = -1; } else { foreach ($deselection as $valeur) { unset($this->TabSelect[$valeur]); } if(array_search($this->Valeur, $deselection) !== false) { if(!empty($this->TabSelect)) { foreach ($this->TabSelect as $Indice => $Valeur) { $this->Valeur = $Indice; break; } } else { $this->Valeur = -1; } } } if(Feef890d7()) { F694db118($this->m_sNomPHP); } } function selected($Indice) { return ( (isset($this->TabSelect[$Indice])) && ($this->TabSelect[$Indice]==1) ); } function Fc8e0ba0f() { return $this->TabSelect; } function ListeSelect ($IndiceSel=1) { $CountSel = 0; foreach ( $this->TabSelect as $Indice => $Valeur ) { if ($Valeur==1) { ++$CountSel; if ($CountSel == $IndiceSel) { return $Indice; } } } return -1; } function ListeSelectOccurrence() { if (!isset($this->TabSelect)) return 0; $nCount = 0; foreach ($this->TabSelect as $nEsTuSelectionne) { if ($nEsTuSelectionne==1) { ++$nCount; } } return $nCount; } function F7b5c0e7a() { $sResultat = ""; if(count($this->TabSelect) > 0) { foreach ($this->TabSelect as $nIndice => $nValeur) { if ($nIndice==-1) continue; if ($nValeur == 1) { $sResultat .= "<JS>.options[".($nIndice-1)."].selected=true</JS>"; } else { $sResultat .= "<JS>.options[".($nIndice-1)."].selected=false</JS>"; } } } return $sResultat; } function Fdc05d49f( $ValeurHTTP ) { $this->ListeSelectMoins(); if ( is_array($ValeurHTTP)) { $selection = array(); foreach ( $ValeurHTTP as $Valeur ) { $selection[] = $Valeur; } $this->F70e1a3ed($selection); } else { $selection = array($ValeurHTTP); $this->F70e1a3ed($selection); } } function F37bb1c9f($Valeur) { parent::F37bb1c9f($Valeur); $this->TabSelect = array($Valeur => 1); } } ?>