<?php

$format = <<< FORMAT
    <li class="#static_class #static_status" id="#static_id" >
        <a href="#static_url" title="#static_name">#static_name</a> (#static_group)
    </li>\n
FORMAT;

if(!empty($this->plxMotor->aStats)) {
    echo <<< LIST_START
<ul class="celkivabien" id="gennepa">\n
LIST_START;

    foreach($this->plxMotor->aStats as $statId=>$params) {
        if(!empty($params['active']) AND $params['menu'] != 'oui') { # La page  est bien active et dispo ds le menu
            if($params['url'][0]=='?') # url interne commençant par ?
                $url = $this->plxMotor->urlRewrite($params['url']);
            elseif(plxUtils::checkSite($params['url'],false)) # url externe en http ou autre
                 $url = $params['url'];
            else # url page statique
                $url = $this->plxMotor->urlRewrite('?static'.intval($statId).'/'.$params['url']);
            $replaces = array(
                '#static_id'        => 'static-'.intval($statId),
                '#static_class'     => 'static',
                '#static_url'       => $url,
                '#static_name'      => plxUtils::strCheck($params['name']),
                '#static_status'    => ($this->staticId()==intval($statId)) ? 'active' : 'noactive',
                '#static_group'		=> plxUtils::strCheck($params['group'])
            );
            echo str_replace(array_keys($replaces), array_values($replaces), $format);
        }
    }

    echo <<< LIST_END
</ul>
LIST_END;
} else {
?>
<p>
    Nous ne cachons aucune page statique
</p>
<?php
}
?>