X-Git-Url: http://git.dj3c1t.com/index.cgi?a=blobdiff_plain;f=app%2Fcontrollers%2Fusers%2Fpistes.php;h=30b0d0481b1c3e7dc1df241f9ecaa9e4e114ac12;hb=c95fd67beff56f1c071ee59305df00b72bb95ac3;hp=0b2d177af68c5cd6f2674ee9b6c4f6345a9fe1c1;hpb=b2437852f60b76e437950c0458149d92686ee38b;p=mw_sourceml diff --git a/app/controllers/users/pistes.php b/app/controllers/users/pistes.php index 0b2d177..30b0d04 100644 --- a/app/controllers/users/pistes.php +++ b/app/controllers/users/pistes.php @@ -150,7 +150,21 @@ $upload_dir = $env->path("content")."uploads/".$this->user["id"]; $_SESSION["upload_dir"] = $web_path.($web_path ? "" : "/").$env->path("content")."uploads/".$this->user["id"]; $users_sources_mod = $env->get_controller("users/sources"); - if($_POST){ + if(isset($_POST["button_derive"])){ + if( + ($origin_source_id = $_POST["button_derive"]) + && ($origin_source_xml_url = $data->source_xml_url($origin_source_id)) + && ($origin_source_xml_content = $data->get_source_xml($origin_source_id)) + ){ + $piste["derivations"][$origin_source_id] = $users_sources_mod->get_source_from_xml( + $env, + $origin_source_xml_url, + $origin_source_xml_content, + false + ); + } + } + elseif($_POST){ if(!($groupe = $data->groupe($_POST["id_groupe"]))){ $env->erreur("Impossible de lire les informations du groupe"); return; @@ -452,6 +466,7 @@ } function maj_xml(){ + $env = $this->env(); $data = $env->data(); if(!($piste = $data->source($_GET[$env->param("id")], true))){ $env->erreur("Impossible de lire les informations de la piste"); @@ -462,10 +477,11 @@ $env->erreur("vous n'avez pas la permission d'editer cette piste"); return; } + if - ( isset($_GET[$env->param("id")]) - && isset($_GET[$env->param("xml")]) - && ($_GET[$env->param("xml")] == "derviation" ? isset($_GET[$env->param("derivation")]) : true) + ( !isset($_GET[$env->param("id")]) + || !isset($_GET[$env->param("xml")]) + || ($_GET[$env->param("xml")] == "derviation" && !isset($_GET[$env->param("derivation")])) ){ $env->erreur("parametre de fichier xml manquant"); return;