/trunk/serveur/bibliotheque/classes/eflore_macro_element.class.php |
---|
New file |
0,0 → 1,80 |
<? |
class macroElement implements iMacroElement{ |
protected $identifiantblockdedonnees; |
protected $connexion; |
protected $contexteRef; |
protected $blockdedonneesParent; |
protected $collectionblockdedonnees; |
protected $idRes; |
function __construct($aConn,$aParentDataBlock,$identifiant) |
{ |
$this->connexion = $aConn; |
$this->blockdedonneesParent = $aParentDataBlock; |
$this->identifiantblockdedonnees = $identifiant; |
$this->contexteRef = $this->blockdedonneesParent->recupererDonnees(); |
} |
function construire() |
{ |
$sql=$this->getSQL(); |
if(!is_NULL($sql)) |
{ |
$this->openCursor($sql); |
while ($this->fetch()); |
$this->closeCursor(); |
} |
} |
function contruireparrecursiviteplate() |
{ |
construire(); |
$this->$contexteRef = $this->blockdedonnees; |
construire(); |
} |
function contruireparrecursivite() |
{ |
} |
function openCursor($sql) |
{ |
$res = mysql_query($sql,$this->connexion); |
if (!$res) echo mysql_errno() . ": " . mysql_error() . "\n"; |
$this->idRes= $res; |
$this->collectionblockdedonnees = new collectionblockdedonnees($this->identifiantblockdedonnees); |
$this->blockdedonneesParent->ajouterCollectionBlockFils($this->collectionblockdedonnees); |
} |
function fetch() |
{ |
$res=mysql_fetch_assoc($this->idRes); |
if (!$res) |
{} |
else |
{ |
//$this->blockdedonnees = new blockdedonnees($this->identifiantblockdedonnees); |
//$this->blockdedonnees->affecterDonnees($res); |
$this->collectionblockdedonnees->ajouterDonnees($res); |
} |
return $res; |
} |
function closeCursor() |
{ |
mysql_free_result($this->idRes); |
} |
} |
?> |
/trunk/serveur/bibliotheque/classes/eflore_groupe_macro_element.class.php |
---|
New file |
0,0 → 1,40 |
<? |
require_once 'eflore_macro_element.class.php'; |
abstract class groupeMacroElement implements iModel{ |
protected $connexion; |
protected $contexte; |
protected $newContexte; |
protected $dblock; |
function __construct($aConn) |
{ |
$this->connexion = $aConn; |
} |
function contruire() |
{ |
} |
function recupererBlockDeDonnees() |
{ |
return $this->dblock; |
} |
function macroElementFactory($macroElementName,$parentDataBlock) |
{ |
require_once EFSE_CHEMIN_MV_MACRO.$macroElementName.'.php'; |
$aMacroElement = new $macroElementName($this->connexion,$parentDataBlock,$macroElementName); |
return $aMacroElement; |
} |
} |
?> |
/trunk/serveur/bibliotheque/classes/eflore_block_de_donnees.class.php |
---|
New file |
0,0 → 1,100 |
<? |
class blockdedonnees{ |
protected $identifiant; |
protected $donnees; |
protected $collectionBlocksfils; |
protected $erreur; |
function __construct($identifiant) |
{ |
$this->identifiant = $identifiant; |
$this->donnees = array(); |
$this->collectionBlocksfils = array(); |
} |
function affecterIdentifiant($identifiant) |
{ |
$this->identifiant = $identifiant; |
} |
function affecterDonnees($donnees) |
{ |
$this->donnees = $donnees; |
} |
function recupererDonnees() |
{ |
return $this->donnees; |
} |
function ajouterDonnee($clef,$valeur) |
{ |
$this->donnees["$clef"] = $valeur; |
} |
function recupererDonnee($clef) |
{ |
return $this->donnees["$clef"]; |
} |
function recupererErreur() |
{ |
return $this->erreur; |
} |
function recupererBlockFils() |
{ |
return $this->blocksfils; |
} |
function ajouterCollectionBlockFils($collectionBlock) |
{ |
array_push($this->collectionBlocksfils,$collectionBlock); |
} |
function afficherPattern($chemin,$fonction) |
{ |
if($chemin==$this->identifiant) |
{ |
} |
else |
{ |
$etape_chemin = explode('>',$chemin); |
if($chemin==$etape_chemin[0]) |
{ |
for($i=0;$i<count($this->collectionBlocksfils);$i++) |
{ |
$collection =$this->collectionBlocksfils[$i]; |
if ($collection->recupererIdentifiant()==$etape_chemin[1]) |
{ |
array_shift($etape_chemin); |
afficherPattern(implode('>',$etape_chemin),$fonction); |
} |
} |
} |
} |
} |
function afficher() |
{ |
echo "<OL>"; |
foreach($this->donnees as $key => $value) |
{ |
echo "<li>$key:$value "; |
} |
echo "</OL>"; |
for($i=0;$i<count($this->collectionBlocksfils);$i++) |
{ |
$collection =$this->collectionBlocksfils[$i]; |
echo "<OL>"; |
$collection->afficher(); |
echo "</OL>"; |
} |
} |
} |
?> |
/trunk/serveur/bibliotheque/classes/eflore_collection_block_de_donnees.class.php |
---|
New file |
0,0 → 1,62 |
<? |
class collectionblockdedonnees{ |
protected $identifiant; |
protected $collection; |
protected $erreur; |
function __construct($identifiant) |
{ |
$this->identifiant = $identifiant; |
$this->collection = array(); |
} |
function affecterIdentifiant($identifiant) |
{ |
$this->identifiant = $identifiant; |
} |
function ajouterDonnees($donnees) |
{ |
$block = new blockdedonnees($this->identifiant); |
$block->affecterDonnees($donnees); |
$this->affecterBlockDeDonnees($block); |
} |
function affecterBlockDeDonnees($blockdonnees) |
{ |
array_push($this->collection,$blockdonnees); |
} |
function recupererBlocksDeDonnees() |
{ |
return $this->collection; |
} |
function recupererIdentifiant() |
{ |
return $this->identifiant; |
} |
function recupererErreur() |
{ |
return $this->erreur; |
} |
function afficher() |
{ |
echo "<LI><B>$this->identifiant</B></LI>"; |
for($i=0;$i<count($this->collection);$i++) |
{ |
$uneCollection =$this->collection[$i]; |
$uneCollection->afficher(); |
} |
} |
} |
?> |