Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 72 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 72 Rev 80
Line 27... Line 27...
27
    function affecterDonnees($donnees)
27
    function affecterDonnees($donnees)
28
    {
28
    {
29
        $this->donnees = $donnees;
29
        $this->donnees = $donnees;
30
    }
30
    }
Line 31... Line 31...
31
    
31
    
32
    function recupererDonnees()
32
    function recupererDonnees($bool_descendance = FALSE)
-
 
33
    {
-
 
34
        if ($bool_descendance == TRUE) {
-
 
35
            $aso_donnees = array();
-
 
36
            $aso_donnees[$this->recupererIdentifiant()] = $this->donnees;
-
 
37
            $collections_blocks_fils = $this->recupererCollectionBlockFils();
-
 
38
            if (is_array($collections_blocks_fils)) {
-
 
39
                for($i = 0; $i < count($collections_blocks_fils); $i++) {
-
 
40
                    $collection = $collections_blocks_fils[$i];
-
 
41
                    $blocks_de_donnees = $collection->recupererBlocksDeDonnees();
-
 
42
                    for($j = 0; $j < count($blocks_de_donnees); $j++) {
-
 
43
                        $block = $blocks_de_donnees[$j];
-
 
44
                        $donnees = $block->recupererDonnees();
-
 
45
                        $aso_donnees[$this->recupererIdentifiant()][$block->recupererIdentifiant()] = $donnees;
-
 
46
                    }
-
 
47
                }
-
 
48
            }
-
 
49
            return $aso_donnees;
33
    {
50
        } else {
-
 
51
            return $this->donnees;
34
        return $this->donnees;
52
        }
Line 35... Line 53...
35
    }
53
    }
36
    
54
    
37
    function ajouterDonnee($clef, $valeur)
55
    function ajouterDonnee($clef, $valeur)
38
    {
56
    {
Line 39... Line 57...
39
        $this->donnees["$clef"] = $valeur;
57
        $this->donnees[$clef] = $valeur;
40
    }
58
    }
41
    
59
    
42
    function recupererDonnee($clef)
60
    function recupererDonnee($clef)
Line 43... Line 61...
43
    {
61
    {
44
        return $this->donnees["$clef"];
62
        return $this->donnees[$clef];
45
    }
63
    }
46
    
64
    
Line 47... Line -...
47
    function recupererErreur()
-
 
48
    {
-
 
49
        return $this->erreur;
-
 
50
    }
-
 
51
    
-
 
52
    function recupererBlockFils()
65
    function recupererErreur()
53
    {
66
    {
54
        return $this->blocksfils;
67
        return $this->erreur;
55
    }
68
    }
Line 56... Line 69...
56
    
69
    
57
    function ajouterCollectionBlockFils($collection_block)
70
    function ajouterCollectionBlockFils($collection_block)
58
    {
71
    {
59
        array_push($this->collectionBlocksfils, $collection_block);
72
        array_push($this->collectionBlocksfils, $collection_block);
Line 60... Line 73...
60
    }
73
    }
61
    
74
    
62
    function recupererCollectionBlockFils()
75
    function recupererCollectionBlockFils()
63
    {
76
    {
64
        return $this->collectionBlocksfils;
77
        return $this->collectionBlocksfils;
65
    }
78
    }
66
    
79
    
67
    function afficherPattern($chemin, $nom_fonction)
80
    function afficherPattern($chemin, $nom_fonction, $recuperer_descendance = FALSE, $aso_parametres = array())
68
    {
81
    {
69
        $retour = '';
82
        $retour = '';
70
        if($chemin == $this->recupererIdentifiant()) {
83
        if($chemin == $this->recupererIdentifiant()) {
71
            $retour .= call_user_func($nom_fonction, $this->recupererDonnees());
84
            $retour .= call_user_func($nom_fonction, $this->recupererDonnees($recuperer_descendance), $aso_parametres);
72
        } else {
85
        } else {
73
            $etape_chemin = explode('>', $chemin);
86
            $etape_chemin = explode('>', $chemin);
74
            if($this->identifiant == $etape_chemin[0]) {
87
            if($this->identifiant == $etape_chemin[0]) {
75
                $collection_block_fils = $this->recupererCollectionBlockFils();
88
                $collection_block_fils = $this->recupererCollectionBlockFils();
76
                for($i = 0; $i < count($collection_block_fils); $i++) {
89
                for($i = 0; $i < count($collection_block_fils); $i++) {
77
                    $collection = $collection_block_fils[$i];
90
                    $collection = $collection_block_fils[$i];
78
                    if ($collection->recupererIdentifiant() == $etape_chemin[1]) {
91
                    if ($collection->recupererIdentifiant() == $etape_chemin[1]) {