Subversion Repositories eFlore/Archives.eflore-consultation-v2

Compare Revisions

Ignore whitespace Rev 144 → Rev 145

/trunk/serveur/bibliotheque/classes/eribo_macro_element.class.php
7,6 → 7,7
protected $connexion;
protected $contexteRef;
protected $contexteRefTmp;
protected $contexteChemin;
protected $contexteSQL;
protected $blockdedonneesParent;
protected $collectionblockdedonnees;
17,40 → 18,44
$this->connexion = $une_connexion;
$this->blockdedonneesParent = $un_block_donnees_parent;
$tab_etape_chemin = array_reverse(explode('>', $chemin_macro_element));
$identifiant = $tab_etape_chemin[0];
$this->identifiantblockdedonnees = $identifiant;
$this->identifiantblockdedonnees = $tab_etape_chemin[0];
$this->identifiant_parent = NULL;//$this->blockdedonneesParent->recupererIdentifiant();
$this->contexteRef = $this->blockdedonneesParent->recupererDonnees();
$this->contexteMultiple = FALSE;
if (count($tab_etape_chemin) > 1) {
$this->contexteMultiple = TRUE;
$this->identifiant_parent = $tab_etape_chemin[1];
$this->contexteRef = $this->attribuerContexteRef($this->blockdedonneesParent);
} else {
$this->identifiant_parent = NULL;
$this->contexteRef = $this->blockdedonneesParent->recupererDonnees();
}
}
function attribuerContexteRef($un_block_donnees)
function attribuerContexteRef($un_block_donnees, $id)
{
$collection_block_fils = $un_block_donnees->recupererCollectionBlockFils();
for($i = 0; $i < count($collection_block_fils); $i++) {
$collection = $collection_block_fils[$i];
if ($collection->recupererIdentifiant() == $this->identifiant_parent) {
if ($collection->recupererIdentifiant() == $id) {
return $collection->recupererBlocksDeDonnees();
} else if (is_object($un_block_donnees->recupererCollectionBlockFils())) {
$this->attribuerContexteRef($un_block_donnees->recupererCollectionBlockFils());
$this->attribuerContexteRef($un_block_donnees->recupererCollectionBlockFils(), $id);
}
}
}
function attribuerCollectionBlockFils($un_block_donnees, $id)
function attribuerCollectionBlockFils($un_block_donnees, $id, $num = null, $num_courant = null)
{
if ($un_block_donnees->recupererIdentifiant() == $id ) {
if ($un_block_donnees->recupererIdentifiant() == $id AND is_null($num)) {
return $un_block_donnees->ajouterCollectionBlockFils($this->collectionblockdedonnees);
} else if ($un_block_donnees->recupererIdentifiant() == $id AND !is_null($num) AND $num == $num_courant) {
//echo '<pre>'.print_r($this->contexteRefTmp, true).'</pre>';
//echo $un_block_donnees->recupererIdentifiant().'----'.$num.'-'.$num_courant.'<br />';
return $un_block_donnees->ajouterCollectionBlockFils($this->collectionblockdedonnees);
} else if (is_array($un_block_donnees->recupererCollectionBlockFils()) AND count($un_block_donnees->recupererCollectionBlockFils()) > 0) {
$collection_block_fils = $un_block_donnees->recupererCollectionBlockFils();
for($i = 0; $i < count($collection_block_fils); $i++) {
$blocks_de_donnees = $collection_block_fils[$i]->recupererBlocksDeDonnees();
for ($i = 0; $i < count($blocks_de_donnees); $i++) {
$this->attribuerCollectionBlockFils($blocks_de_donnees[$i], $id);
for ($j = 0; $j < count($blocks_de_donnees); $j++) {
//echo $blocks_de_donnees[$j]->recupererIdentifiant().'-'.$id.'----'.$num.'-'.$j.'<br />';
$this->attribuerCollectionBlockFils($blocks_de_donnees[$j], $id, $num, $j);
}
}
}
78,11 → 83,25
function construire()
{
$sql = $this->getSQL();
if (!is_null($sql)) {
$this->openCursor($sql);
while ($this->fetch());
$this->closeCursor();
if ($this->contexteMultiple == FALSE) {
$sql = $this->getSQL();
if (!is_null($sql)) {
$this->openCursor($sql);
while ($this->fetch());
$this->closeCursor();
}
} else {
$this->contexteRefTmp = $this->attribuerContexteRef($this->blockdedonneesParent, $this->identifiant_parent);
//echo '<pre>'.print_r($this->contexteRefTmp, true).'</pre>';
for($i = 0; $i < count($this->contexteRefTmp); $i++) {
$this->contexteRef = $this->contexteRefTmp[$i]->recupererDonnees();
$sql = $this->getSQL();
if (!is_null($sql)) {
$this->openCursor($sql);
while ($this->fetch());
$this->closeCursor($this->identifiant_parent, $i);
}
}
}
}
104,7 → 123,6
}
$sql = $this->getSQL();
//echo '<pre>'.print_r($sql, true).'</pre>';
if (!is_null($sql)) {
$this->openCursor($sql, $id);
for ($i = 0; $this->fetch($id.'-'.$i); $i++);
157,7 → 175,7
return $resultat;
}
function closeCursor($id = null)
function closeCursor($id = null, $num = null)
{
mysql_free_result($this->idRes);
// Nous ajoutons les données de la requêtes seulement si elle a ramenée des données
165,7 → 183,7
if (is_null($id)) {
$this->blockdedonneesParent->ajouterCollectionBlockFils($this->collectionblockdedonnees);
} else {
$this->attribuerCollectionBlockFils($this->blockdedonneesParent, $id);
$this->attribuerCollectionBlockFils($this->blockdedonneesParent, $id, $num);
}
}
}
/trunk/serveur/bibliotheque/classes/eribo_groupe_macro_element.class.php
25,7 → 25,8
function macroElementFactory($chemin_macro_element, $block_donnees_parent)
{
$etape_chemin = array_reverse(explode('>', $chemin_macro_element));
$macro_element_nom = $etape_chemin[0];
$macro_element_nom = $etape_chemin[0];
echo $macro_element_nom;
require_once EFSE_CHEMIN_MV_MACRO.$macro_element_nom.'.php';
$un_macro_element = new $macro_element_nom($this->connexion, $block_donnees_parent, $chemin_macro_element);
return $un_macro_element;