Autoloading PagePrint

This commit is contained in:
Michael RICOIS 2013-11-18 13:41:34 +00:00
parent fe434d5da9
commit ca94202d5c
4 changed files with 8 additions and 11 deletions

View File

@ -57,8 +57,7 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
} else {
//Gestion affichage Lien Print / PDF / XML
require_once 'Scores/PagePrint.php';
$page = new PagePrint($controller, $action);
$page = new Scores_PagePrint($controller, $action);
if ($page->exportable('print')){
$view->print = $page->filename('print', $request->getParams());

View File

@ -7,9 +7,8 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
if ($layout->isEnabled()) {
$controller = $this->_request->getControllerName();
$action = $this->_request->getActionName();
require_once 'Scores/PagePrint.php';
$page = new PagePrint($controller, $action);
$page = new Scores_PagePrint($controller, $action);
if ($page->exportable('pdf')){
$layout = $this->_response->getBody();
$filename = $page->filename('pdf', $this->_request->getParams());

View File

@ -4,13 +4,12 @@ class Application_Controller_Plugin_Xml extends Zend_Controller_Plugin_Abstract
public function dispatchLoopShutdown()
{
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
if ($layout->isEnabled()) {
$controller = $this->_request->getControllerName();
$action = $this->_request->getActionName();
$action = $this->_request->getActionName();
$view = $layout->getView();
require_once 'Scores/PagePrint.php';
$page = new PagePrint($controller, $action);
$page = new Scores_PagePrint($controller, $action);
if ($page->exportable('xml') && !empty($view->exportObjet)) {
$page->objectToXML($view->exportObjet, $this->_request->getParams());
}

View File

@ -1,5 +1,5 @@
<?php
class PagePrint
class Scores_PagePrint
{
protected $controller = null;
protected $action = null;