You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
flux_rss/ControllerAdmin.php

62 lines
1.7 KiB

<?php
class controllerAdmin {
function __construct() {
global $dsn,$user,$pass;
session_start();
try
{
$action=$_REQUEST['action'];
switch($action) {
case "ajoutSource":
$this->ajoutSource($_REQUEST["linkSource"]);
break;
case "supprimerSource":
$this->supprimerSource($_REQUEST["idSource"]);
break;
case "setNbArticlesParPage":
$this->setNbArticlesParPage($_REQUEST["nbSourceParPage"]);
break;
default:
$gateway = new GatewayNews(new Connection($dsn,$user,$pass));
$listeNews = $gateway->getNews();
require('vues/listeNews.php');
break;
}
}
catch (PDOException $e)
{
// $dataVueEreur[] = "Erreur inattendue!!! ";
// require(__DIR__.'/../vues/erreur.php');
}
catch (Exception $e2)
{
// $dataVueEreur[] = "Erreur inattendue!!! ";
// require ($rep.$vues['erreur']);
}
}
function ajoutSource($linkSource) {
global $con;
$mdl = new GatewaySources($con);
$source = new Sources($linkSource);
$mdl->addSources($source);
//require('menuAdmin.php');
}
function supprimerSource($idSource) {
global $con;
$mdl = new GatewaySources($con);
$mdl->deleteSources($idSource);
//require('menuAdmin.php');
}
function setNbArticlesParPage(){
//require('menuAdmin.php');
}
}
?>