File: NzbHandler_Display.php

package info (click to toggle)
spotweb 20130826%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,132 kB
  • ctags: 11,281
  • sloc: php: 31,367; xml: 1,009; sh: 148; makefile: 83
file content (24 lines) | stat: -rwxr-xr-x 761 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
class NzbHandler_Display extends NzbHandler_abs
{
	function __construct(SpotSettings $settings, array $nzbHandling)
	{
		parent::__construct($settings, 'Display', 'Show', $nzbHandling);
	} # __construct

	public function processNzb($fullspot, $nzblist)
	{
		$nzb = $this->prepareNzb($fullspot, $nzblist);
		
		Header("Content-Type: " . $nzb['mimetype']);
		
		/* Een NZB file hoeft niet per se als attachment binnen te komen */
		switch($this->_nzbHandling['prepare_action']) {
			case 'zip'	: Header("Content-Disposition: attachment; filename=\"" . $nzb['filename'] . "\""); break;
			default		: Header("Content-Disposition: inline; filename=\"" . $nzb['filename'] . "\"");
		} # switch
		echo $nzb['nzb'];

	} # processNzb

} # class NzbHandler_Display