X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;ds=sidebyside;f=app%2Fcontrollers%2Fusers%2Fmorceaux.php;fp=app%2Fcontrollers%2Fusers%2Fmorceaux.php;h=fce394f212f11e407c667b033f49e686f816d54c;hb=f58d0d306acdf88245f47573bf78dc5497aa03d7;hp=eb1eeff105b4bfb937e620d776fb94f4ed36bedd;hpb=41ce174a389397f4c6f70dcf8ea502a434b2c2ef;p=mw_sourceml diff --git a/app/controllers/users/morceaux.php b/app/controllers/users/morceaux.php index eb1eeff..fce394f 100644 --- a/app/controllers/users/morceaux.php +++ b/app/controllers/users/morceaux.php @@ -145,7 +145,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)) + ){ + $morceau["derivations"][$origin_source_id] = $users_sources_mod->get_source_from_xml( + $env, + $origin_source_xml_url, + $origin_source_xml_content, + true + ); + } + } + elseif($_POST){ if(!($groupe = $data->groupe($_POST["id_groupe"]))){ $env->erreur("Impossible de lire les informations du groupe"); return;