Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function __construct( |
||
29 | $name, |
||
30 | $title, |
||
31 | SS_List $items = null, |
||
32 | $folderName = "" |
||
33 | ) { |
||
34 | parent::__construct( |
||
35 | $name, |
||
36 | $title, |
||
37 | $items |
||
38 | ); |
||
39 | $this->setRightTitle('Only PDF files are accepted.'); |
||
40 | //create folder |
||
41 | if (!$folderName) { |
||
42 | $folderName = Config::inst()->get('PDFUploadField', 'pdf_folder_name'); |
||
43 | } |
||
44 | Folder::find_or_make(Director::baseFolder()."/assets/".$folderName); |
||
45 | //set folder |
||
46 | $this->setFolderName($folderName); |
||
47 | $this->setAllowedExtensions(array('pdf')); |
||
48 | $this->setAllowedMaxFileNumber(1); |
||
49 | |||
50 | return $this; |
||
51 | } |
||
52 | } |
||
53 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.