diff options
author | JulienMoumne <julien@piwik.org> | 2012-08-14 00:26:46 +0400 |
---|---|---|
committer | JulienMoumne <julien@piwik.org> | 2012-08-14 00:26:46 +0400 |
commit | 7427003ab87ef41d1b1f23365480cf8c8bb11242 (patch) | |
tree | 203b52fb8bcb69f2b4b999cb828dc3386c29e8ae /core/ReportRenderer | |
parent | 4931b9809c69947a16b67954802cecd5140bdfad (diff) |
refs #2708
* fixing a bug in ''Piwik::getPrettyValue()'' where a revenue evolution would be prettified like so: ''$ 100%''
* fixing a bug happening when no data is available for the selected day
* when MultiSites plugin is deactivated, invite user via SMS to activate it back
* SMS API accounts are now managed using an API key instead of a username and a password
* adding ''[too long]'' at the end of the SMS content when it reaches the maximum length allowed by the SMS API
* support for UCS-2 characters
* Mediaburst rebranded to Clockwork
* various UI improvements based on comment:31:ticket:2708
* PDFReport.generateReport now supports $outputType=3 : output report in browser
* removing non-libre select-to-autocomplete jQuery plugin
* tracking count of phone number validation requests and SMS sent
* SMS content now contains CoreHome_ThereIsNoDataForThisReport when applicable
* setting SMS From with General_Reports when configured report is MultiSites_getAll
* adding Clockwork description
TODO
* using POST instead of GET to send SMS to go around a Clockwork limitation
git-svn-id: http://dev.piwik.org/svn/trunk@6727 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/ReportRenderer')
-rw-r--r-- | core/ReportRenderer/Html.php | 14 | ||||
-rw-r--r-- | core/ReportRenderer/Pdf.php | 12 |
2 files changed, 22 insertions, 4 deletions
diff --git a/core/ReportRenderer/Html.php b/core/ReportRenderer/Html.php index dc5c8320a8..912b521f3c 100644 --- a/core/ReportRenderer/Html.php +++ b/core/ReportRenderer/Html.php @@ -25,6 +25,9 @@ class Piwik_ReportRenderer_Html extends Piwik_ReportRenderer const REPORT_TABLE_ROW_TEXT_SIZE = 11; const REPORT_BACK_TO_TOP_TEXT_SIZE = 9; + const HTML_CONTENT_TYPE = 'text/html'; + const HTML_FILE_EXTENSION = 'html'; + private $rendering = ""; public function setLocale($locale) @@ -36,14 +39,21 @@ class Piwik_ReportRenderer_Html extends Piwik_ReportRenderer { $this->epilogue(); - return Piwik_ReportRenderer::writeFile($filename, 'html', $this->rendering); + return Piwik_ReportRenderer::writeFile($filename, self::HTML_FILE_EXTENSION, $this->rendering); } public function sendToBrowserDownload($filename) { $this->epilogue(); - Piwik_ReportRenderer::sendToBrowser($filename, 'html', 'text/html', $this->rendering); + Piwik_ReportRenderer::sendToBrowser($filename, self::HTML_FILE_EXTENSION, self::HTML_CONTENT_TYPE, $this->rendering); + } + + public function sendToBrowserInline($filename) + { + $this->epilogue(); + + Piwik_ReportRenderer::inlineToBrowser(self::HTML_CONTENT_TYPE, $this->rendering); } private function epilogue() diff --git a/core/ReportRenderer/Pdf.php b/core/ReportRenderer/Pdf.php index 1d9f204cfb..c0279a17d0 100644 --- a/core/ReportRenderer/Pdf.php +++ b/core/ReportRenderer/Pdf.php @@ -37,6 +37,8 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer const MAX_GRAPH_REPORTS = 3; const MAX_2COL_TABLE_REPORTS = 2; + const PDF_CONTENT_TYPE = 'pdf'; + private $reportFontStyle = ''; private $reportSimpleFontSize = 9; private $reportHeaderFontSize = 16; @@ -117,7 +119,7 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer public function sendToDisk($filename) { - $filename = Piwik_ReportRenderer::appendExtension($filename, "pdf"); + $filename = Piwik_ReportRenderer::appendExtension($filename, self::PDF_CONTENT_TYPE); $outputFilename = Piwik_ReportRenderer::getOutputPath($filename); $this->TCPDF->Output($outputFilename, 'F'); @@ -127,10 +129,16 @@ class Piwik_ReportRenderer_Pdf extends Piwik_ReportRenderer public function sendToBrowserDownload($filename) { - $filename = Piwik_ReportRenderer::appendExtension($filename, "pdf"); + $filename = Piwik_ReportRenderer::appendExtension($filename, self::PDF_CONTENT_TYPE); $this->TCPDF->Output($filename, 'D'); } + public function sendToBrowserInline($filename) + { + $filename = Piwik_ReportRenderer::appendExtension($filename, self::PDF_CONTENT_TYPE); + $this->TCPDF->Output($filename, 'I'); + } + public function renderFrontPage($websiteName, $prettyDate, $description, $reportMetadata) { $websiteTitle = $this->formatText(Piwik_Translate('General_Website') . " " . $websiteName); |