Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 67 lines (53 sloc) 1.427 kB
3a87948 @echo511 Initial commit
authored
1 <?php
2
5b3208e @echo511 PSR-0
authored
3 namespace Echo511\Plupload;
3a87948 @echo511 Initial commit
authored
4
1552d9f @echo511 Cleaning
authored
5 /**
6 * This file is a part of Plupload component for Nette Framework.
7 *
8 * @author Nikolas Tsiongas
9 * @package Plupload component
10 * @license New BSD License
11 */
3a87948 @echo511 Initial commit
authored
12 class PluploadSettings extends \Nette\Object
13 {
14
15 // Runtimes we want to use
16 private $runtimes = array('html5');
17
18 // Max size of upload file
19 private $maxFileSize = '10mb';
20
21 // Max size of single chunk
22 private $maxChunkSize = '5mb';
23
24
25 /*********** Setters ***********/
26 function setRuntimes(array $runtimes)
27 {
28 $possible = array('gears', 'flash', 'silverlight', 'browserplus', 'html5');
29 foreach($runtimes as $runtime) {
30 if(!in_array($runtime, $possible)) {
31 throw new Exception('There is no runtime called: '.$runtime);
32 }
33 }
34 $this->runtimes = $runtimes;
35 return $this;
36 }
37
38 public function setMaxFileSize($expr)
39 {
1552d9f @echo511 Cleaning
authored
40 $this->maxFileSize = $expr;
41 return $this;
3a87948 @echo511 Initial commit
authored
42 }
43
44 public function setMaxChunkSize($expr)
45 {
1552d9f @echo511 Cleaning
authored
46 $this->maxChunkSize = $expr;
47 return $this;
3a87948 @echo511 Initial commit
authored
48 }
49
50
51 /*********** Getters ***********/
52 public function getRuntimes()
53 {
1552d9f @echo511 Cleaning
authored
54 return implode(",", $this->runtimes);
3a87948 @echo511 Initial commit
authored
55 }
56
57 public function getMaxFileSize()
58 {
1552d9f @echo511 Cleaning
authored
59 return $this->maxFileSize;
3a87948 @echo511 Initial commit
authored
60 }
61
62 public function getMaxChunkSize()
63 {
1552d9f @echo511 Cleaning
authored
64 return $this->maxChunkSize;
3a87948 @echo511 Initial commit
authored
65 }
66
67 }
Something went wrong with that request. Please try again.