if(($source["has_derivations"] = $this->source_derivations(array("derivation" => $source["id"]))) === false) return false;
if(($source["derivations"] = $this->source_derivations(array("id_source" => $source["id"]))) === false) return false;
if(($source["reference"] = $this->source_reference($source)) === false) return false;
+ if($user = $env->user()){
+ if(($source["permissions"] = $this->source_permissions($source, $user["id"])) === false) return false;
+ }
if(!$source["reference"])
{ if(($source["documents"] = $this->source_documents($source["id"])) === false) return false;
}
font-size: 0.9em;
}
-.source_arbo ul.menu_source
-{ margin: 5px 0px 0px 0px;
- padding: 0px;
- list-style-type: none;
-}
-
-.source_arbo ul.menu_source li
-{ margin: 0px;
- padding: 0px;
-}
/* ------------------------------- page album ----------- */
{ border: none;
}
-.source_arbo ul.menu_source
-{ float: right;
- margin: 0px 10px 1px 0px;
-}
-.source_arbo ul.menu_source li
-{ float: right;
- padding: 1px;
+
+
+ul.menu_source{
+ float: right;
+ margin: 0px;
+ padding: 0px;
+ list-style-type: none;
}
-.source_arbo ul.menu_source li a
-{ display: block;
- text-align: center;
- background-color: #151515;
- border-radius: 3px 3px 0px 0px;
- -moz-border-radius: 3px 3px 0px 0px;
- padding: 2px 5px 2px 5px;
+ul.menu_source li{
+ float: right;
+ padding: 0;
+ margin-left: 5px;
}
-.source_arbo ul.menu_source li a:hover
-{
+ul.menu_source li a{
+ display: block;
+ line-height: 1.5em;
+ padding: 0 0.5em;
+ background-color: #ffffff;
+ border: solid 1px #c0c0c0;
+ border-radius: 3px;
+ cursor: pointer;
+ font-size: 1em;
+ font-weight: normal;
+}
+ul.menu_source li a:hover{
+ color: #000066;
+ background-color: #f1f1f1;
}
-.source_arbo ul.menu_source li.icon a
-{ border: none;
- padding: 2px 2px 2px 2px;
+ul.menu_source li a:hover{
}
+
.pistes
{ border-left: none;
}
.loading span{
display: none;
}
-
-/* ----------------------------------- bouton de derivation --------- */
-
-ul.button_derive:after{
- content: "";
- display: table;
- clear: both;
-}
-
-ul.button_derive li{
- list-style-type: none;
- float: right;
- position: relative;
- padding: 2px 5px 0 1em;
-}
-
-ul.button_derive li input[type=submit]{
- display: block;
- white-space : nowrap;
- border: solid 1px #d5d5d5;
- background-color: #ffffff;
- background-image: url("../../icons/add.gif");
- background-repeat: no-repeat;
- background-position: 7px 10px;
- padding: 0.6em 1em 0.6em 25px;
- border-radius: 3px;
- color: #000066;
-}
-ul.button_derive li input[type=submit]:hover{
- color: #000066;
- background-color: #f5f5f5;
- cursor: pointer;
-}
init_show_xml_links();
init_players("*");
init_player_listener();
+ init_menu_source("body");
}
);
success: function(content){
$("#source_list_" + id_block + " .pistes").html(content);
init_players("#source_list_" + id_block + " .pistes");
+ init_menu_source("#source_list_" + id_block + " .pistes");
}
});
}
success: function(content){
$("#derivation_list_" + id_block + " .derivation").html(content);
init_players("#derivation_list_" + id_block + " .derivation");
+ init_menu_source("#derivation_list_" + id_block + " .derivation");
}
});
}
}
+
+// -----------------------------------------------------------------
+// menus sources
+//
+
+function init_menu_source(prefix){
+ $(prefix + " .menu_source a.submit").click(
+ function(){
+ $(this).parents("form").first().submit();
+ }
+ );
+}
?>
</ul>
-<?php if($this->action_allowed("users/morceaux/add")) : ?>
-<form action="<?php echo $this->url("users/morceaux/add"); ?>" method="post">
- <input type="hidden" name="button_derive" value="<?php echo $morceau["id"];?>" />
- <ul class="button_derive">
- <li><input type="submit" value="Publier une dérivation" /></li>
- </ul>
-</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 action="<?php echo $this->url("users/pistes/add"); ?>" method="post">
- <input type="hidden" name="button_derive" value="<?php echo $piste["id"];?>" />
- <ul class="button_derive">
- <li><input type="submit" value="Publier une dérivation" /></li>
- </ul>
-</form>
-<?php endif; ?>
-
<?php if(isset($piste["description"]) && !$display_name) : ?>
<div class="description">
<?php echo $piste["description"] ?>
<?php
-// require $this->out_file("views/sources/source/menu_source.php");
require $this->out_file("views/sources/source/header.php");
require $this->out_file("views/sources/source/metas.php");
require $this->out_file("views/sources/source/documents.php");
<?php
require $this->out_file("views/sources/source/arbo.php");
+ require $this->out_file("views/sources/source/menu_source.php");
?>
</article>
?>
-<?php if($this->status_ok("users/morceaux/del")) : ?>
-<?php if($source["id_user"] == $user["id"]) : ?>
- <li class="icon"><a href="<?php echo $this->url("users/morceaux/del", array("id" => $source["id"])) ?>"
- onclick="return confirm('Supprimer ce morceau ?')"><img src="<?php echo $this->out_url("icons/del.gif") ?>" /></a></li>
+<?php if($this->action_allowed("users/morceaux/edit")) : ?>
+<?php if($source["permissions"]["editeur"]) : ?>
+ <li><a href="<?php echo $this->url("users/morceaux/edit", array("id" => $source["id"])) ?>">Editer</a></li>
<?php endif; ?>
<?php endif; ?>
-<?php if($this->status_ok("users/morceaux/edit")) : ?>
-<?php if($source["id_user"] == $user["id"]) : ?>
- <li class="icon"><a href="<?php echo $this->url("users/morceaux/edit", array("id" => $source["id"])) ?>"><img src="<?php echo $this->out_url("icons/edit.gif") ?>" /></a></li>
-<?php endif; ?>
+<?php if($this->action_allowed("users/morceaux/add")) : ?>
+ <li>
+ <form action="<?php echo $this->url("users/morceaux/add"); ?>" method="post">
+ <input type="hidden" name="button_derive" value="<?php echo $source["id"];?>" />
+ <div>
+ <a href="#" class="submit">Dériver</a>
+ </div>
+ </form>
+ </li>
<?php endif; ?>
<?php endif; ?>
?>
-<?php if($this->status_ok("users/pistes/del")) : ?>
-<?php if($source["id_user"] == $user["id"]) : ?>
- <li class="icon"><a href="<?php echo $this->url("users/pistes/del", array("id" => $source["id"])) ?>"
- onclick="return confirm('Supprimer cette source ?')"><img src="<?php echo $this->out_url("icons/del.gif") ?>" /></a></li>
+<?php if($this->action_allowed("users/pistes/edit")) : ?>
+<?php if($source["permissions"]["editeur"]) : ?>
+ <li><a href="<?php echo $this->url("users/pistes/edit", array("id" => $source["id"])) ?>">Editer</a></li>
<?php endif; ?>
<?php endif; ?>
-<?php if($this->status_ok("users/pistes/edit")) : ?>
-<?php if($source["id_user"] == $user["id"]) : ?>
- <li class="icon"><a href="<?php echo $this->url("users/pistes/edit", array("id" => $source["id"])) ?>"><img src="<?php echo $this->out_url("icons/edit.gif") ?>" /></a></li>
-<?php endif; ?>
+<?php if($this->action_allowed("users/pistes/add")) : ?>
+ <li>
+ <form action="<?php echo $this->url("users/pistes/add"); ?>" method="post">
+ <input type="hidden" name="button_derive" value="<?php echo $source["id"];?>" />
+ <div>
+ <a href="#" class="submit">Dériver</a>
+ </div>
+ </form>
+ </li>
<?php endif; ?>
+
<?php endif; ?>