$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;
$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,
+ true
+ );
+ }
+ }
+ elseif($_POST){
if(!($groupe = $data->groupe($_POST["id_groupe"]))){
$env->erreur("Impossible de lire les informations du groupe");
return;
);
}
else
- { $source[$key] = $value[0]["data"];
+ { if(isset($value[0]["data"])) $source[$key] = $value[0]["data"];
}
}
$source["auteur"] = "";
.loading span{
display: none;
}
+
+/* ----------------------------------- bouton de derivation --------- */
+
+form.button_derive{
+ text-align: right;
+}
+
+form.button_derive div{
+ display: inline;
+}
+form.button_derive div input[type=submit]{
+ background-color: transparent;
+ color: #333333;
+ border: solid 1px #c0c0c0;
+ padding: 1em;
+ border-radius: 5px;
+}
+form.button_derive div input[type=submit]:hover{
+ color: #c0c0c0;
+}
?>
</ul>
+<?php if($this->action_allowed("users/morceaux/add")) : ?>
+<form class="button_derive" action="<?php echo $this->url("users/morceaux/add"); ?>" method="post">
+ <input type="hidden" name="button_derive" value="<?php echo $morceau["id"];?>" />
+ <div>
+ <input type="submit" value="Publier une dérivation" />
+ </div>
+</form>
+<?php endif; ?>
+
<?php if(isset($morceau["description"]) && !$display_name) : ?>
<div class="description">
<?php echo $morceau["description"] ?>
?>
</ul>
+<?php if($this->action_allowed("users/pistes/add")) : ?>
+<form class="button_derive" action="<?php echo $this->url("users/pistes/add"); ?>" method="post">
+ <input type="hidden" name="button_derive" value="<?php echo $piste["id"];?>" />
+ <div>
+ <input type="submit" value="Publier une dérivation" />
+ </div>
+</form>
+<?php endif; ?>
+
<?php if(isset($piste["description"]) && !$display_name) : ?>
<div class="description">
<?php echo $piste["description"] ?>