plxPlugins->callHook('AdminIndexPrepend')); # Suppression des articles selectionnes if(isset($_POST['selection']) AND ((!empty($_POST['sel1']) AND $_POST['selection'][0] == 'delete') OR (!empty($_POST['sel2']) AND $_POST['selection'][1] == 'delete')) AND isset($_POST['idArt'])) { foreach ($_POST['idArt'] as $k => $v) $plxAdmin->delArticle($v); header('Location: index.php'); exit; } # Récuperation de l'id de l'utilisateur $userId = ($_SESSION['profil'] < PROFIL_WRITER ? '[0-9]{3}' : $_SESSION['user']); # Récuperation des paramètres if(!empty($_GET['sel']) AND in_array($_GET['sel'], array('all','published', 'draft','mod'))) { $_SESSION['sel_get']=plxUtils::nullbyteRemove($_GET['sel']); $_SESSION['sel_cat']=''; } else $_SESSION['sel_get']=(isset($_SESSION['sel_get']) AND !empty($_SESSION['sel_get']))?$_SESSION['sel_get']:'all'; if(!empty($_POST['sel_cat'])) if(isset($_SESSION['sel_cat']) AND $_SESSION['sel_cat']==$_POST['sel_cat']) # annulation du filtre $_SESSION['sel_cat']='all'; else # prise en compte du filtre $_SESSION['sel_cat']=$_POST['sel_cat']; else $_SESSION['sel_cat']=(isset($_SESSION['sel_cat']) AND !empty($_SESSION['sel_cat']))?$_SESSION['sel_cat']:'all'; # Recherche du motif de sélection des articles en fonction des paramètres $catIdSel = ''; $mod=''; switch ($_SESSION['sel_get']) { case 'published': $catIdSel = '[home|0-9,]*FILTER[home|0-9,]*'; $mod=''; break; case 'draft': $catIdSel = '[home|0-9,]*draft,FILTER[home|0-9,]*'; $mod='_?'; break; case 'all': $catIdSel = '[home|draft|0-9,]*FILTER[draft|home|0-9,]*'; $mod='_?'; break; case 'mod': $catIdSel = '[home|draft|0-9,]*FILTER[draft|home|0-9,]*'; $mod='_'; break; } switch ($_SESSION['sel_cat']) { case 'all' : $catIdSel = str_replace('FILTER', '', $catIdSel); break; case '000' : $catIdSel = str_replace('FILTER', '000', $catIdSel); break; case 'home': $catIdSel = str_replace('FILTER', 'home', $catIdSel); break; case preg_match('/^[0-9]{3}$/', $_SESSION['sel_cat'])==1: $catIdSel = str_replace('FILTER', $_SESSION['sel_cat'], $catIdSel); } # Nombre d'article sélectionnés $nbArtPagination = $plxAdmin->nbArticles($catIdSel, $userId); # Récuperation du texte à rechercher $_GET['artTitle'] = (!empty($_GET['artTitle']))?plxUtils::unSlash(trim(urldecode($_GET['artTitle']))):''; # On génère notre motif de recherche $motif = '/^'.$mod.'[0-9]{4}.'.$catIdSel.'.'.$userId.'.[0-9]{12}.(.*)'.plxUtils::title2filename($_GET['artTitle']).'(.*).xml$/'; # Calcul du nombre de page si on fait une recherche if($_GET['artTitle']!='') { if($arts = $plxAdmin->plxGlob_arts->query($motif)) $nbArtPagination = sizeof($arts); } # Traitement $plxAdmin->prechauffage($motif); $plxAdmin->getPage(); $arts = $plxAdmin->getArticles('all'); # Recuperation des articles # Génération de notre tableau des catégories $aFilterCat['all'] = L_ARTICLES_ALL_CATEGORIES; $aFilterCat['home'] = L_CATEGORY_HOME; $aFilterCat['000'] = L_UNCLASSIFIED; if($plxAdmin->aCats) { foreach($plxAdmin->aCats as $k=>$v) { $aCat[$k] = plxUtils::strCheck($v['name']); $aFilterCat[$k] = plxUtils::strCheck($v['name']); } $aAllCat[L_CATEGORIES_TABLE] = $aCat; } $aAllCat[L_SPECIFIC_CATEGORIES_TABLE]['home'] = L_CATEGORY_HOME_PAGE; $aAllCat[L_SPECIFIC_CATEGORIES_TABLE]['draft'] = L_DRAFT; $aAllCat[L_SPECIFIC_CATEGORIES_TABLE][''] = L_ALL_ARTICLES_CATEGORIES_TABLE; # On inclut le header include(dirname(__FILE__).'/top.php'); ?> plxPlugins->callHook('AdminIndexTop')) # Hook Plugins ?>
plxPlugins->callHook('AdminIndexPagination')); # Affichage de la pagination if($arts) { # Si on a des articles (hors page) # Calcul des pages $last_page = ceil($nbArtPagination/$plxAdmin->bypage); if($plxAdmin->page > $last_page) $plxAdmin->page = $last_page; $prev_page = $plxAdmin->page - 1; $next_page = $plxAdmin->page + 1; # Generation des URLs $artTitle = (!empty($_GET['artTitle'])?'&artTitle='.urlencode($_GET['artTitle']):''); $p_url = 'index.php?page='.$prev_page.$artTitle; # Page precedente $n_url = 'index.php?page='.$next_page.$artTitle; # Page suivante $l_url = 'index.php?page='.$last_page.$artTitle; # Derniere page $f_url = 'index.php?page=1'.$artTitle; # Premiere page # On effectue l'affichage if($plxAdmin->page > 2) # Si la page active > 2 on affiche un lien 1ere page echo ''.L_PAGINATION_FIRST.''; if($plxAdmin->page > 1) # Si la page active > 1 on affiche un lien page precedente echo ''.L_PAGINATION_PREVIOUS.''; # Affichage de la page courante printf(''.L_PAGINATION.'',$plxAdmin->page,$last_page); if($plxAdmin->page < $last_page) # Si la page active < derniere page on affiche un lien page suivante echo ''.L_PAGINATION_NEXT.''; if(($plxAdmin->page + 1) < $last_page) # Si la page active++ < derniere page on affiche un lien derniere page echo ''.L_PAGINATION_LAST.''; } ?>
plxPlugins->callHook('AdminIndexFoot')); # On inclut le footer include(dirname(__FILE__).'/foot.php'); ?>