@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * |
| 35 | 35 | * @var array $attachmentsMimeType |
| 36 | 36 | */ |
| 37 | - protected $attachmentsMimeType = array('image','applications/pdf', |
|
| 37 | + protected $attachmentsMimeType = array('image', 'applications/pdf', |
|
| 38 | 38 | 'application/x-pdf', |
| 39 | 39 | 'application/acrobat', |
| 40 | 40 | 'applications/vnd.pdf', |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | /** |
| 94 | 94 | * Gets the the maximum number of allowed attachments |
| 95 | 95 | * |
| 96 | - * @return string |
|
| 96 | + * @return integer |
|
| 97 | 97 | */ |
| 98 | 98 | public function getAttachmentsCount() |
| 99 | 99 | { |
@@ -109,8 +109,7 @@ |
||
| 109 | 109 | if ('file-uri' === $params->fromPost('return')) { |
| 110 | 110 | $content = $viewHelperManager->get('basepath') |
| 111 | 111 | ->__invoke($form->getHydrator()->getLastUploadedFile()->getUri()); |
| 112 | - } |
|
| 113 | - else { |
|
| 112 | + } else { |
|
| 114 | 113 | if ($form instanceof SummaryFormInterface) { |
| 115 | 114 | $form->setRenderMode(SummaryFormInterface::RENDER_SUMMARY); |
| 116 | 115 | $viewHelper = 'summaryform'; |
@@ -73,14 +73,14 @@ |
||
| 73 | 73 | $count = $options->getAttachmentsCount(); |
| 74 | 74 | |
| 75 | 75 | $form->setIsDisableCapable(false) |
| 76 | - ->setIsDisableElementsCapable(false) |
|
| 77 | - ->setIsDescriptionsEnabled(true) |
|
| 78 | - ->setDescription( |
|
| 76 | + ->setIsDisableElementsCapable(false) |
|
| 77 | + ->setIsDescriptionsEnabled(true) |
|
| 78 | + ->setDescription( |
|
| 79 | 79 | /*@translate*/ 'Attach images or PDF Documents to your application. Drag&drop them, or click into the attachement area. You can upload up to %sMB', |
| 80 | - [round($size/(1024*1024))>0? round($size/(1024*1024)):round($size/(1024*1024), 1)] |
|
| 81 | - ) |
|
| 82 | - ->setParam('return', 'file-uri') |
|
| 83 | - ->setLabel(/*@translate*/ 'Attachments'); |
|
| 80 | + [round($size/(1024*1024))>0? round($size/(1024*1024)):round($size/(1024*1024), 1)] |
|
| 81 | + ) |
|
| 82 | + ->setParam('return', 'file-uri') |
|
| 83 | + ->setLabel(/*@translate*/ 'Attachments'); |
|
| 84 | 84 | |
| 85 | 85 | /** @var $file FileUpload*/ |
| 86 | 86 | $file = $form->get($this->fileName); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @var string |
| 54 | 54 | */ |
| 55 | - protected $options="Cv/Options"; |
|
| 55 | + protected $options = "Cv/Options"; |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | ->setIsDescriptionsEnabled(true) |
| 78 | 78 | ->setDescription( |
| 79 | 79 | /*@translate*/ 'Attach images or PDF Documents to your CV. Drag&drop them, or click into the attachement area. You can upload up to %sMB', |
| 80 | - [round($size/(1024*1024))>0? round($size/(1024*1024)):round($size/(1024*1024), 1)] |
|
| 80 | + [round($size / (1024 * 1024)) > 0 ? round($size / (1024 * 1024)) : round($size / (1024 * 1024), 1)] |
|
| 81 | 81 | ) |
| 82 | 82 | ->setParam('return', 'file-uri') |
| 83 | 83 | ->setLabel(/*@translate*/ 'Attachments'); |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | $fileId = new \MongoId($file->id); |
| 42 | 42 | $dm = $eventArgs->getDocumentManager(); |
| 43 | 43 | $dm->createQueryBuilder('Cv\Entity\Cv') |
| 44 | - ->update()->multiple(true) |
|
| 45 | - ->field('attachments')->equals($fileId)->pull($fileId) |
|
| 46 | - ->getQuery()->execute(); |
|
| 44 | + ->update()->multiple(true) |
|
| 45 | + ->field('attachments')->equals($fileId)->pull($fileId) |
|
| 46 | + ->getQuery()->execute(); |
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -31,6 +31,6 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function getUri() |
| 33 | 33 | { |
| 34 | - return "/file/Cv.Attachment/" . $this->id . "/" .urlencode($this->name); |
|
| 34 | + return "/file/Cv.Attachment/".$this->id."/".urlencode($this->name); |
|
| 35 | 35 | } |
| 36 | 36 | } |