'."\n". '.sort img.status {float: right; margin: 2px 0 0 4px; position: relative;}'."\n". ''."\n". ''. ''. ''; $blogroll = new blogroll($blog,DB_PREFIX); $action = !empty($_REQUEST['action']) ? $_REQUEST['action'] : NULL; $page = !empty($_REQUEST['page']) ? $_REQUEST['page'] : NULL; $err = ''; if ($page == 'edit_link' && !empty($_REQUEST['id'])) { include dirname(__FILE__).'/edit_link.php'; } elseif ($page == 'edit_cat' && !empty($_REQUEST['id'])) { include dirname(__FILE__).'/edit_cat.php'; } else { $l_label = $l_title = $l_href = $l_lang = ''; $c_title = ''; # Ajout d'un lien if ($action == 'add_link') { $l_label = trim($_POST['l_label']); $l_title = trim($_POST['l_title']); $l_href = trim($_POST['l_href']); $l_lang = trim($_POST['l_lang']); if (!$l_label || !$l_href) { $err = __('You must provide at least a label and an URL'); } else { if ($blogroll->addLink($l_label,$l_href,$l_title,$l_lang) == false) { $err = $blogroll->con->error(); } else { header('Location: '.$url); exit; } } } # Ajout d'un catégorie elseif ($action == 'add_cat') { $c_title = trim($_POST['c_title']); if ($c_title) { if ($blogroll->addCat($c_title) == false) { $err = $blogroll->con->error(); } else { header('Location: '.$url); exit; } } } # Suppression elseif ($action == 'delete' && !empty($_GET['id'])) { if ($blogroll->delEntry($_GET['id']) == false) { $err = $blogroll->con->error(); } else { header('Location: '.$url); exit; } } # Classic ord if (isset($_POST['linkOrd']) && is_array($_POST['linkOrd'])) { if ($blogroll->ordEntries($_POST['linkOrd']) === false) { $err = $blogroll->con->error(); } else { header('Location: '.$url); exit; } } # DragNdrop if (!empty($_POST['dndSort'])) { $linkOrd = array(); foreach (explode(';',$_POST['dndSort']) as $k => $v) { $linkOrd[substr($v,3)] = $k; } if ($blogroll->ordEntries($linkOrd) === false) { $err = $blogroll->con->error(); } else { header('Location: '.$url); exit; } } # Affichage --- buffer::str('
'.__('Error(s)').' :
'. ''.$err.'
'. ''.__('Drag items to change their positions.').'
'. '' ); buffer::str( '' ); buffer::str( '' ); buffer::str( ''.__('To replace your static blogroll by this one, just put the '. 'following code in your template:').'
'. '<?php dcBlogroll::linkList(); ?>' ); } ?>