26 lines
921 B
PHP
Raw Normal View History

<?php
class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopShutdown()
{
2016-04-07 15:48:55 +00:00
Zend_Registry::get('firebug')->info('PLUGIN PDF - START');
$layout = Zend_Layout::getMVCInstance();
if ($layout->isEnabled()) {
$controller = $this->_request->getControllerName();
$action = $this->_request->getActionName();
2013-11-29 13:54:52 +00:00
$page = new Scores_Export_Print($controller, $action);
if ($page->exportable('pdf')){
$layout = $this->_response->getBody();
$filename = $page->filename('pdf', $this->_request->getParams());
$content = preg_replace('@<link href="/@si','<link href="./',$layout);
$content = preg_replace('@src="/@si','src="./',$content);
$c = Zend_Registry::get('config');
2016-02-12 14:25:27 +00:00
file_put_contents($c->profil->path->shared.'/temp/pages/'.$filename.'.html', $content);
}
}
2016-04-07 15:48:55 +00:00
Zend_Registry::get('firebug')->info('PLUGIN PDF - END');
}
}