odea/application/controllers/IndexController.php
2012-05-02 18:19:07 +00:00

48 lines
1.3 KiB
PHP

<?php
Class IndexController extends Zend_Controller_Action
{
public function init()
{
$this->view->headScript()
->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript')
->appendFile('/themes/default/scripts/fields.js', 'text/javascript')
->appendFile('/themes/default/scripts/autocompleted.js', 'text/javascript');
/* Initialize action controller here */
}
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
if ($user->customisation) {
$this->view->assign('preferences', $user->customisation);
}
}
public function criteresAction()
{
$ajax = $this->getRequest()->getParam('ajax');
if($ajax)
$this->_helper->layout()->disableLayout();
require_once 'Scores/SessionCiblage.php';
require_once 'Scores/Field.php';
$session = new SessionCiblage();
$this->view->field = new Fields();
$this->view->criteres = $session->getCriteres();
}
public function removeAction()
{
require_once('Scores/SessionCiblage.php');
$this->_helper->layout()->disableLayout();
$session = new SessionCiblage();
$session->unsetCritere($this->getRequest()->getParam('critere'));
$objet = new Object_Comptage();
$objet->count(null, null);
$this->_redirect('/');
}
}