3 class mw_admin_sourceml extends mw_controller
14 if(($this->status = $data->source_status()) === false)
15 { return "Impossible de lire la liste des status de source";
17 foreach($this->status as $id_source_status => $source_status)
18 { if($source_status["nom"] == "album") $this->album_status_id = $id_source_status;
19 if(isset($this->album_status_id) && isset($this->morceau_status_id)) break;
21 if(!isset($this->album_status_id)) return "Type de source inconnu: album";
22 if(($this->groupes = $data->groupes()) === false)
23 { return "Impossible de lire la liste des groupes";
25 $select = array("status" => $this->album_status_id);
26 if(($this->albums = $data->sources($select)) === false) return "impossible de lire la liste des albums";
33 if(!($groupes = $this->groupes)){
34 $env->erreur("Impossible de lire la liste des groupes");
37 if(!($albums = $this->albums)){
38 $env->erreur("Impossible de lire la liste des albums");
41 if(($CONFIG = $env->get_CONFIG()) === false){
42 $env->erreur("Impossible de lire la configuration");
46 if($_POST["start_action"] == "sources/groupe"){
47 if(!$data->set_config("start_action", "sources/groupe")){
48 $env->erreur("impossible d'enregistrer la configuration");
52 elseif($_POST["start_action"] == "sources/groupe/view"){
53 $params = array("id" => $_POST["groupe_param"]);
55 !$data->set_config("start_action", "sources/groupe/view")
56 || !$data->set_config("start_action_params", @serialize($params))
58 $env->erreur("impossible d'enregistrer la configuration");
62 elseif($_POST["start_action"] == "sources/album/view"){
63 $params = array("album" => $_POST["album_param"]);
65 !$data->set_config("start_action", "sources/album/view")
66 || !$data->set_config("start_action_params", @serialize($params))
68 $env->erreur("impossible d'enregistrer la configuration");
73 isset($CONFIG["start_action"])
75 ($CONFIG["start_action"] == "sources/groupe")
76 || ($CONFIG["start_action"] == "sources/groupe/view")
77 || ($CONFIG["start_action"] == "sources/album/view")
80 if(!$data->set_config("start_action", "")){
81 $env->erreur("impossible d'enregistrer la configuration");
86 $env->url("admin/sourceml"),
87 "la configuration a été enregistrée"
90 $env->set_out("groupes", $this->groupes);
91 $env->set_out("albums", $this->albums);
92 $env->set_out("config", $CONFIG);