Browse Source

Ajout du passage liste -> reserve

remotes/svn/ModulesALaMano
Chouchen 11 years ago
parent
commit
b5943a0668
  1. 18
      ajax/listToReserve.php
  2. 2
      ajax/loadReserve.php
  3. 4
      class/Links.php
  4. 2
      css/links.css
  5. BIN
      images/links/meebo.png
  6. 14
      js/jquery.links.js

18
ajax/listToReserve.php

@ -0,0 +1,18 @@
<?
$reserve = $_POST['reserve'];
$doc = new DOMDocument;
$doc->load('../db/links.xml');
$xpath = new DOMXpath($doc);
// Buffering and deleting moved element
foreach($xpath->query('label/link[title = "'.$reserve.'"]') as $node) {
$buffer = $node;
$node->parentNode->removeChild($node);
}
$searchLabel = $xpath->query('reserve');
$searchLabel->item(0)->appendChild($buffer);
$doc->save('../db/links.xml');

2
ajax/loadReserve.php

@ -5,7 +5,7 @@ if($links_xml = simplexml_load_file('../'.links::LINKS_FILE)){
foreach($links as $label){
echo '<ul id="reserveiconlist">';
foreach($label->link as $link){
echo '<li class="item" id="'.$link->title.'"><a href="'.$link->url.'" class="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
echo '<li class="item" id="'.$link->title.'"><img src="images/interface/delete.png" class="deleteLink" /><a href="'.$link->url.'" class="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
}
echo '</ul> ';
}

4
class/Links.php

@ -20,7 +20,7 @@ class links {
echo '<span class="label">'.$label['id'].'</span>
<ul class="iconlist" id="'.$label['id'].'">';
foreach($label->link as $link){
echo '<li class="item" id="'.$link->title.'"><a href="'.$link->url.'" class="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
echo '<li class="item" id="'.$link->title.'"><img src="images/interface/delete.png" class="deleteLink" /><a href="'.$link->url.'" class="'.$link->onclick.'"><img src="images/links/'.$link->img.'" /><br>'.$link->title.'</a></li>';
}
echo '</ul>
<hr>';
@ -28,7 +28,7 @@ class links {
}else{
echo 'Can\'t find '.self::LINKS_FILE;
}
echo '</div><div id="reserve"></div>';
echo '</div>';
}

2
css/links.css

@ -1,4 +1,5 @@
#reserve{display:none;background:#000;}
.deleteLink{display:none; position:absolute; top:-5px; right:-5px;width:16px !important; height:16px !important;}
.divider {
display:block;
@ -12,6 +13,7 @@
ul.iconlist li, ul#reserveiconlist li{
/*display:inline-block;*/
position:relative;
float:left;
margin:0 10px 10px 0;
text-align:center;

BIN
images/links/meebo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

14
js/jquery.links.js

@ -5,7 +5,7 @@ $(document).ready(function(){
// Apparition de la reserve de liens
$('#links-menu').live('click', function(){
$('#reserve').show();
//$('#reserve').show();
$.get('ajax/loadReserve.php', function(html){
$.fancybox(
html,
@ -24,13 +24,23 @@ $(document).ready(function(){
$('#reserveiconlist .item').live('click', function(e){
e.preventDefault();
$.post("ajax/reserveToList.php", {reserve: $(this).attr('id')});
$('#Entertainment').append($(this).parent().html());
$('.iconlist').last().append($(this).parent().html());
$.fancybox.close();
});
//Passage Liste => Reserve
$('.item').mouseover(function(){
$(this).children('.deleteLink').show();
});
$('.item').mouseout(function(){
$(this).children('.deleteLink').hide();
});
$('.deleteLink').click(function(){
$.post("ajax/listToReserve.php", {reserve: $(this).parent().attr('id')});
$(this).parent().fadeOut();
});
// ??
// Mouvement des liens avec enregistrement

Loading…
Cancel
Save