2013-12-26 14:42:44 +00:00

21 lines
636 B
PHP

<?php
class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopShutdown()
{
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$user = new Scores_Utilisateur();
$controller = $this->_request->getControllerName();
$action = $this->_request->getActionName();
$view = $layout->getView();
$page = new Scores_Export_Print($controller, $action);
if ($page->exportable('xml') && !empty($view->exportObjet) && in_array($user->getIdClient(), array(1,147)) ) {
$page->objectToXML($view->exportObjet, $this->_request->getParams());
}
}
}
}