ajout dans les playlist seulement si connecté
This commit is contained in:
@@ -2,17 +2,20 @@
|
||||
<?php
|
||||
foreach($songs as $song){
|
||||
echo "<div><article>";
|
||||
echo "<header class='short-text'>";
|
||||
echo "<form action='" . base_url("index.php/playlist/addSongToPlaylist") . "' method='post'>";
|
||||
echo "<header class='short-text'>";
|
||||
echo "{$song->name} ";
|
||||
echo "<select name='playlist'>";
|
||||
foreach ($playlists as $playlist) {
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type='hidden' name='song' value='{$song->name}' />";
|
||||
echo "<button type='submit' class='add-to-playlist'>+</button>";
|
||||
echo "</form>";
|
||||
|
||||
if ($this->session->userdata('logged')):
|
||||
echo "<form action='" . base_url("index.php/playlist/addSongToPlaylist") . "' method='post'>";
|
||||
echo "<select name='playlist'>";
|
||||
foreach ($playlists as $playlist) {
|
||||
echo "<option value='{$playlist->id}'>{$playlist->name}</option>";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type='hidden' name='song' value='{$song->name}' />";
|
||||
echo "<button type='submit' class='add-to-playlist'>+</button>";
|
||||
echo "</form>";
|
||||
endif;
|
||||
echo "<br>";
|
||||
echo "</header>";
|
||||
echo "</article></div>";
|
||||
|
||||
Reference in New Issue
Block a user