<commit_before><?php

/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonAccueil for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Backend\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Session\Container;

class PageTeamController extends AbstractActionController {

    public $_servTranslator = null;
    private $_oSessionUser = null;
    private $_contentPageTable;

    /**
     * Retourne le service de traduction en mode lazy.
     *
     * @return
     */
    public function _getServTranslator() {
        if (!$this->_servTranslator) {
            $this->_servTranslator = $this->getServiceLocator()->get('translator');
        }
        return $this->_servTranslator;
    }

    private function _getContentPageTable() {
        if (!$this->_contentPageTable) {
            $sm = $this->getServiceLocator();
            $this->_contentPageTable = $sm->get('Backend\Model\ContentPageTable');
        }
        return $this->_contentPageTable;
    }

    public function indexAction() {
        $oViewModel = new ViewModel();
        $oSession = $this->_getSessionUser();

        if (!$oSession->offsetExists('administrateur')) {
            $this->flashMessenger()->addErrorMessage($this->_getServTranslator()->translate("La page demandé n'est pas accessible."));
            return $this->redirect()->toRoute('home');
        }

        try {
            $aContentPage = $this->_getContentPageTable()->getContentByPageId(2)->toArray();
        } catch (Exception $ex) {
            $this->flashMessenger()->addErrorMessage($this->_getServTranslator()->translate("Problème(s) lors du chargement des informations."));
            return $this->redirect()->toRoute('backend');
        }
        
        $oViewModel->setVariable('content', $aContentPage[0]['content']);
        $oViewModel->setVariable('idPage', $aContentPage[0]['idPage']);
        $oViewModel->setTemplate('backend/team/team');

        return $oViewModel;
    }

    public function savepageAction() {
        die();
        $oRequest = $this->getRequest();
        if (!$oRequest->isPost()) {<commit_msg>backend team<commit_after><?php

/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonAccueil for the canonical source repository
 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Backend\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Zend\Session\Container;

class PageTeamController extends AbstractActionController {

    public $_servTranslator = null;
    private $_oSessionUser = null;
    private $_contentPageTable;

    /**
     * Retourne le service de traduction en mode lazy.
     *
     * @return
     */
    public function _getServTranslator() {
        if (!$this->_servTranslator) {
            $this->_servTranslator = $this->getServiceLocator()->get('translator');
        }
        return $this->_servTranslator;
    }

    private function _getContentPageTable() {
        if (!$this->_contentPageTable) {
            $sm = $this->getServiceLocator();
            $this->_contentPageTable = $sm->get('Backend\Model\ContentPageTable');
        }
        return $this->_contentPageTable;
    }

    public function indexAction() {
        $oViewModel = new ViewModel();
        $oSession = $this->_getSessionUser();

        if (!$oSession->offsetExists('administrateur')) {
            $this->flashMessenger()->addErrorMessage($this->_getServTranslator()->translate("La page demandé n'est pas accessible."));
            return $this->redirect()->toRoute('home');
        }

        try {
            $aContentPage = $this->_getContentPageTable()->getContentByPageId(2)->toArray();
        } catch (Exception $ex) {
            $this->flashMessenger()->addErrorMessage($this->_getServTranslator()->translate("Problème(s) lors du chargement des informations."));
            return $this->redirect()->toRoute('backend');
        }
        
        $oViewModel->setVariable('content', $aContentPage[0]['content']);
        $oViewModel->setVariable('idPage', $aContentPage[0]['idPage']);
        $oViewModel->setTemplate('backend/team/team');

        return $oViewModel;
    }

    public function savepageAction() {
        $oRequest = $this->getRequest();
        if (!$oRequest->isPost()) {
{'fraction_non_alphanumeric': 0.14513387165320868, 'fraction_numerical': 0.004674883127921802, 'mean_word_length': 3.0196413321947055, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4228381', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1301, 'n_words': 242}