mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
42 lines
791 B
PHP
42 lines
791 B
PHP
<?php
|
|
/*
|
|
* @copyright Copyright (C) 2010-2021 Combodo SARL
|
|
* @license http://opensource.org/licenses/AGPL-3.0
|
|
*/
|
|
|
|
|
|
class DownloadPage extends AjaxPage
|
|
{
|
|
/**@var string */
|
|
protected $sContent;
|
|
|
|
public function __construct($s_title)
|
|
{
|
|
parent::__construct($s_title);
|
|
}
|
|
|
|
/**
|
|
* @param string $sContent
|
|
*
|
|
*/
|
|
public function add($sContent)
|
|
{
|
|
$this->sContent = $sContent;
|
|
}
|
|
|
|
public function output()
|
|
{
|
|
if (!empty($this->sContentType)) {
|
|
$this->add_header('Content-type: '.$this->sContentType);
|
|
}
|
|
if (!empty($this->sContentDisposition)) {
|
|
$this->add_header('Content-Disposition: '.$this->sContentDisposition.'; filename="'.$this->sContentFileName.'"');
|
|
}
|
|
foreach ($this->a_headers as $s_header) {
|
|
header($s_header);
|
|
}
|
|
|
|
echo $this->sContent;
|
|
}
|
|
}
|