public function index($params) { //FoxFWKernel::addVendor('foxFW/Page.php'); FoxFWKernel::addModel('Page'); //liste new article $page = new Page(); $liste = $page->liste(array('max' => 20, 'type' => 'Article')); //return $GLOBALS['Twig']->render( _BUNDLE.'foxfw/view/index.html.twig', array('liste'=>$liste)); return $GLOBALS['Twig']->render(FoxFWKernel::getView('index'), array('liste' => $liste)); }
public static function viewEdit($path_dir) { $path = Upload_files::getUrlBuffer(); //verifier si le repertoire existe sinon ont le creer if (!is_dir($path)) { mkdir($path, 0755, true); } //lister repertoire $files = Upload_files::getFilesDir($path); $dir = Upload_files::getFilesDir($path_dir); //affichage return $GLOBALS['Twig']->render(FoxFWKernel::getView('upload_files_view'), array('upload_buffer' => $files, 'path_dir' => $dir, 'max_upload_file' => FoxFWFile::convertFileSize($GLOBALS['Config']['Upload_files']['max_upload_file'], 'ko') . ' Ko')); }
public function viewMVC($params) { return $GLOBALS['Twig']->render(FoxFWKernel::getView('admin_viewMVC'), array('model' => $GLOBALS['Config']['Model'], 'view' => $GLOBALS['Config']['View'], 'controller' => $GLOBALS['Config']['Controller'])); }
public function view($params) { //si c'est un repertoire $rep = true; $document = array(); //si ont ce déplace dans le repertoire if (isset($_GET['dir'])) { //si on demande de revenir en arriére if ($_GET['dir'] == '..') { $this->path->retrograde(); } else { //si c'est un dossier if (is_dir($this->path->get() . $_GET['dir'])) { $this->path->addDir($_GET['dir']); } } } //si ont demande un fichier if (isset($_GET['file'])) { if (file_exists($_GET['file'])) { $file = $_GET['file']; //si modifier un fichier if (!isset($_GET['noEdit'])) { $_GET['noEdit'] = false; } //ce n'est pas un repertoir $rep = false; //extension fichier $extension = FoxFWFile::getExtension($file); //config document $document['fichier'] = $file; $document['url'] = FoxFWKernel::router('index') . $file; $document['type'] = $extension; $document['path'] = $file; $document['body'] = ''; $document['edit'] = !$_GET['noEdit']; //chargement du body switch ($extension) { case 'txt': case 'html': case 'js': case 'css': case 'json': case 'tpl': case 'php': $document['body'] = file_get_contents($document['path']); break; } } } //lister repertoire $files = array(); $dirs = array(); if ($dh = opendir($this->path->get())) { while (false !== ($filename = readdir($dh))) { if (is_dir($this->path->get() . $filename)) { array_push($dirs, $filename); } else { array_push($files, $filename); } } } else { die('Dossier inconu !'); } //render return $GLOBALS['Twig']->render(FoxFWKernel::getView('Document_view'), array('path' => $this->path->get(), 'file' => $files, 'dir' => $dirs, 'rep' => $rep, 'document' => $document)); }
public function panelUser() { return $GLOBALS['Twig']->render(FoxFWKernel::getView('user_panel')); }
public function adminViewListEvenement() { $event = Evenement::listeAll(0); return $GLOBALS['Twig']->render(FoxFWKernel::getView('calendrier_adminviewListe'), array('event' => $event, 'tagColor' => $GLOBALS['Config']['Calendrier']['tag'])); }
//twig extension function controller $GLOBALS['Twig']->addFunction(new Twig_SimpleFunction('controller', function ($method, $params = array()) { $error = FoxFWKernel::controller($method, $params); if ($error != 200) { die('Error Controller Twig Appel ! '); } }, array('is_safe' => array('html')))); //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------------- //renvoi la view $GLOBALS['Twig']->addFunction(new Twig_SimpleFunction('getView', function ($view) { return FoxFWKernel::getView($view); })); //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------------- //decodage des htmlspecialchars $GLOBALS['Twig']->addFunction(new Twig_SimpleFunction('htmlspecialchars_decode', function ($text) { return htmlspecialchars_decode($text); })); //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // //
public function search() { $groupe = ''; if (isset($_POST['groupe'])) { $groupe = 'AND groupe=\'' . $_POST['groupe'] . '\''; } $search = $_POST['search']; //préparation de la structure $list = FoxFWbdd::sql('SELECT * FROM contacts WHERE (( nom LIKE ?) OR ( prenom LIKE ?) OR ( telfixe LIKE ?) OR ( telportable LIKE ?) OR ( structure LIKE ?) OR ( email LIKE ?)) ' . $groupe, [$search . '%', $search . '%', $search . '%', $search . '%', $search . '%', $search . '%']); $list_groupe = FoxFWbdd::bdd('contacts', 'getListValTable', array('table' => 'groupe')); if (!isset($list_groupe['groupe'])) { $list_groupe['groupe'] = []; } return $GLOBALS['Twig']->render(FoxFWKernel::getView('contacts_liste'), array('list' => $list, 'groupe' => $list_groupe['groupe'])); }
public function e500() { return $GLOBALS['Twig']->render(FoxFWKernel::getView('error_error'), array('error' => '500', 'message' => 'Erreur interne du serveur !')); }
public function viewListeAdminPage($params) { if (isset($params['id'])) { $data = $this->page->liste(array('order_by' => 'titre', 'type' => $params['id'])); } else { $data = $this->page->liste(array('order_by' => 'titre')); } return $GLOBALS['Twig']->render(FoxFWKernel::getView('pages_listePage'), array('liste' => $data)); }
public function edit($params) { $path = Controller_carousel::getPathCarousel() . '/'; return $GLOBALS['Twig']->render(FoxFWKernel::getView('carousel_edit'), array('path' => $path)); }