@@ -25,38 +25,38 @@ |
||
25 | 25 | class FilePickerMenuItem extends AbstractComponentView |
26 | 26 | { |
27 | 27 | |
28 | - /** |
|
29 | - * Renders a "file picker" menu item to be placed in the grid menu of Media. |
|
30 | - * |
|
31 | - * @return string |
|
32 | - */ |
|
33 | - public function render() |
|
34 | - { |
|
35 | - $result = ''; |
|
36 | - if ($this->getModuleLoader()->hasPlugin('filePicker')) { |
|
37 | - $result = sprintf('<li><a href="%s" class="mass-file-picker" data-argument="assets">%s Insert files</a>', |
|
38 | - $this->getMassDeleteUri(), |
|
39 | - $this->getIconFactory()->getIcon('extensions-media-image-export', Icon::SIZE_SMALL) |
|
40 | - ); |
|
41 | - } |
|
42 | - return $result; |
|
43 | - } |
|
28 | + /** |
|
29 | + * Renders a "file picker" menu item to be placed in the grid menu of Media. |
|
30 | + * |
|
31 | + * @return string |
|
32 | + */ |
|
33 | + public function render() |
|
34 | + { |
|
35 | + $result = ''; |
|
36 | + if ($this->getModuleLoader()->hasPlugin('filePicker')) { |
|
37 | + $result = sprintf('<li><a href="%s" class="mass-file-picker" data-argument="assets">%s Insert files</a>', |
|
38 | + $this->getMassDeleteUri(), |
|
39 | + $this->getIconFactory()->getIcon('extensions-media-image-export', Icon::SIZE_SMALL) |
|
40 | + ); |
|
41 | + } |
|
42 | + return $result; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * Render a mass delete URI. |
|
47 | - * |
|
48 | - * @return string |
|
49 | - */ |
|
50 | - protected function getMassDeleteUri() |
|
51 | - { |
|
52 | - $urlParameters = array( |
|
53 | - MediaModule::getParameterPrefix() => array( |
|
54 | - 'controller' => 'Asset', |
|
55 | - 'action' => '', |
|
56 | - 'format' => 'json', |
|
57 | - ), |
|
58 | - ); |
|
59 | - return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters); |
|
60 | - } |
|
45 | + /** |
|
46 | + * Render a mass delete URI. |
|
47 | + * |
|
48 | + * @return string |
|
49 | + */ |
|
50 | + protected function getMassDeleteUri() |
|
51 | + { |
|
52 | + $urlParameters = array( |
|
53 | + MediaModule::getParameterPrefix() => array( |
|
54 | + 'controller' => 'Asset', |
|
55 | + 'action' => '', |
|
56 | + 'format' => 'json', |
|
57 | + ), |
|
58 | + ); |
|
59 | + return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters); |
|
60 | + } |
|
61 | 61 | |
62 | 62 | } |
@@ -22,25 +22,25 @@ |
||
22 | 22 | class CategoryRenderer extends ColumnRendererAbstract |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * Renders category list of an asset in the grid. |
|
27 | - * |
|
28 | - * @return string |
|
29 | - */ |
|
30 | - public function render() |
|
31 | - { |
|
32 | - $result = ''; |
|
25 | + /** |
|
26 | + * Renders category list of an asset in the grid. |
|
27 | + * |
|
28 | + * @return string |
|
29 | + */ |
|
30 | + public function render() |
|
31 | + { |
|
32 | + $result = ''; |
|
33 | 33 | |
34 | - $categories = $this->object['metadata']['categories']; |
|
35 | - if (!empty($categories)) { |
|
34 | + $categories = $this->object['metadata']['categories']; |
|
35 | + if (!empty($categories)) { |
|
36 | 36 | |
37 | - /** @var $category \TYPO3\CMS\Extbase\Domain\Model\Category */ |
|
38 | - foreach ($categories as $category) { |
|
39 | - $result .= sprintf('<li>%s</li>', $category['title']); |
|
40 | - } |
|
41 | - $result = sprintf('<ul class="category-list">%s</ul>', $result); |
|
42 | - } |
|
43 | - return $result; |
|
44 | - } |
|
37 | + /** @var $category \TYPO3\CMS\Extbase\Domain\Model\Category */ |
|
38 | + foreach ($categories as $category) { |
|
39 | + $result .= sprintf('<li>%s</li>', $category['title']); |
|
40 | + } |
|
41 | + $result = sprintf('<ul class="category-list">%s</ul>', $result); |
|
42 | + } |
|
43 | + return $result; |
|
44 | + } |
|
45 | 45 | |
46 | 46 | } |
@@ -22,24 +22,24 @@ |
||
22 | 22 | class FrontendPermissionRenderer extends ColumnRendererAbstract |
23 | 23 | { |
24 | 24 | |
25 | - /** |
|
26 | - * Render permission in the grid. |
|
27 | - * |
|
28 | - * @return string |
|
29 | - */ |
|
30 | - public function render() |
|
31 | - { |
|
32 | - $result = ''; |
|
25 | + /** |
|
26 | + * Render permission in the grid. |
|
27 | + * |
|
28 | + * @return string |
|
29 | + */ |
|
30 | + public function render() |
|
31 | + { |
|
32 | + $result = ''; |
|
33 | 33 | |
34 | - $frontendUserGroups = $this->object['metadata']['fe_groups']; |
|
35 | - if (!empty($frontendUserGroups)) { |
|
34 | + $frontendUserGroups = $this->object['metadata']['fe_groups']; |
|
35 | + if (!empty($frontendUserGroups)) { |
|
36 | 36 | |
37 | - /** @var $frontendUserGroup \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup */ |
|
38 | - foreach ($frontendUserGroups as $frontendUserGroup) { |
|
39 | - $result .= sprintf('<li style="list-style: disc">%s</li>', $frontendUserGroup['title']); |
|
40 | - } |
|
41 | - $result = sprintf('<ul>%s</ul>', $result); |
|
42 | - } |
|
43 | - return $result; |
|
44 | - } |
|
37 | + /** @var $frontendUserGroup \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup */ |
|
38 | + foreach ($frontendUserGroups as $frontendUserGroup) { |
|
39 | + $result .= sprintf('<li style="list-style: disc">%s</li>', $frontendUserGroup['title']); |
|
40 | + } |
|
41 | + $result = sprintf('<ul>%s</ul>', $result); |
|
42 | + } |
|
43 | + return $result; |
|
44 | + } |
|
45 | 45 | } |
@@ -20,14 +20,14 @@ |
||
20 | 20 | interface FormFieldInterface |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - public function render(); |
|
23 | + /** |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + public function render(); |
|
27 | 27 | |
28 | - /** |
|
29 | - * @param string $template |
|
30 | - * @return \Fab\Media\Form\FormFieldInterface |
|
31 | - */ |
|
32 | - public function setTemplate($template); |
|
28 | + /** |
|
29 | + * @param string $template |
|
30 | + * @return \Fab\Media\Form\FormFieldInterface |
|
31 | + */ |
|
32 | + public function setTemplate($template); |
|
33 | 33 | } |
@@ -20,39 +20,39 @@ |
||
20 | 20 | interface ThumbnailProcessorInterface |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * @param ThumbnailService $thumbnailService |
|
25 | - * @return $this |
|
26 | - */ |
|
27 | - public function setThumbnailService(ThumbnailService $thumbnailService); |
|
23 | + /** |
|
24 | + * @param ThumbnailService $thumbnailService |
|
25 | + * @return $this |
|
26 | + */ |
|
27 | + public function setThumbnailService(ThumbnailService $thumbnailService); |
|
28 | 28 | |
29 | - /** |
|
30 | - * Render a thumbnail. |
|
31 | - * |
|
32 | - * @return string |
|
33 | - */ |
|
34 | - public function create(); |
|
29 | + /** |
|
30 | + * Render a thumbnail. |
|
31 | + * |
|
32 | + * @return string |
|
33 | + */ |
|
34 | + public function create(); |
|
35 | 35 | |
36 | - /** |
|
37 | - * Render the URI of the thumbnail. |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function renderUri(); |
|
36 | + /** |
|
37 | + * Render the URI of the thumbnail. |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function renderUri(); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Render the tag image which is the main one for a thumbnail. |
|
45 | - * |
|
46 | - * @param string $result |
|
47 | - * @return string |
|
48 | - */ |
|
49 | - public function renderTagImage($result); |
|
43 | + /** |
|
44 | + * Render the tag image which is the main one for a thumbnail. |
|
45 | + * |
|
46 | + * @param string $result |
|
47 | + * @return string |
|
48 | + */ |
|
49 | + public function renderTagImage($result); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Render a wrapping anchor around the thumbnail. |
|
53 | - * |
|
54 | - * @param string $result |
|
55 | - * @return string |
|
56 | - */ |
|
57 | - public function renderTagAnchor($result); |
|
51 | + /** |
|
52 | + * Render a wrapping anchor around the thumbnail. |
|
53 | + * |
|
54 | + * @param string $result |
|
55 | + * @return string |
|
56 | + */ |
|
57 | + public function renderTagAnchor($result); |
|
58 | 58 | } |
@@ -21,29 +21,29 @@ |
||
21 | 21 | interface ThumbnailInterface |
22 | 22 | { |
23 | 23 | |
24 | - /** |
|
25 | - * The thumbnail of the asset (default value). |
|
26 | - */ |
|
27 | - const OUTPUT_IMAGE = 'image'; |
|
28 | - |
|
29 | - /** |
|
30 | - * The thumbnail will be wrapped with an anchor. |
|
31 | - */ |
|
32 | - const OUTPUT_IMAGE_WRAPPED = 'imageWrapped'; |
|
33 | - |
|
34 | - /** |
|
35 | - * Output the URI of the thumbnail. |
|
36 | - */ |
|
37 | - const OUTPUT_URI = 'uri'; |
|
38 | - |
|
39 | - /** |
|
40 | - * Open thumbnail in a new window. |
|
41 | - */ |
|
42 | - const TARGET_BLANK = '_blank'; |
|
43 | - |
|
44 | - /** |
|
45 | - * Open thumbnail in the same window. |
|
46 | - */ |
|
47 | - const TARGET_SELF = '_self'; |
|
24 | + /** |
|
25 | + * The thumbnail of the asset (default value). |
|
26 | + */ |
|
27 | + const OUTPUT_IMAGE = 'image'; |
|
28 | + |
|
29 | + /** |
|
30 | + * The thumbnail will be wrapped with an anchor. |
|
31 | + */ |
|
32 | + const OUTPUT_IMAGE_WRAPPED = 'imageWrapped'; |
|
33 | + |
|
34 | + /** |
|
35 | + * Output the URI of the thumbnail. |
|
36 | + */ |
|
37 | + const OUTPUT_URI = 'uri'; |
|
38 | + |
|
39 | + /** |
|
40 | + * Open thumbnail in a new window. |
|
41 | + */ |
|
42 | + const TARGET_BLANK = '_blank'; |
|
43 | + |
|
44 | + /** |
|
45 | + * Open thumbnail in the same window. |
|
46 | + */ |
|
47 | + const TARGET_SELF = '_self'; |
|
48 | 48 | |
49 | 49 | } |
@@ -24,35 +24,35 @@ |
||
24 | 24 | class MoveViewHelper extends AbstractViewHelper |
25 | 25 | { |
26 | 26 | |
27 | - /** |
|
28 | - * Render a move storage URI. |
|
29 | - * |
|
30 | - * @return string |
|
31 | - */ |
|
32 | - public function render() |
|
33 | - { |
|
34 | - |
|
35 | - $urlParameters = array( |
|
36 | - VidiModule::getParameterPrefix() => array( |
|
37 | - 'controller' => 'Content', |
|
38 | - 'action' => 'move', |
|
39 | - 'fieldNameAndPath' => $this->templateVariableContainer->get('fieldNameAndPath'), |
|
40 | - 'matches' => $this->templateVariableContainer->get('matches'), |
|
41 | - ), |
|
42 | - ); |
|
43 | - |
|
44 | - $moduleUrl = BackendUtility::getModuleUrl( |
|
45 | - VidiModule::getSignature(), |
|
46 | - $urlParameters |
|
47 | - ); |
|
48 | - |
|
49 | - // Work around a bug in BackendUtility::getModuleUrl if matches is empty getModuleUrl() will not return the parameter. |
|
50 | - $matches = $this->templateVariableContainer->get('matches'); |
|
51 | - if (empty($matches)) { |
|
52 | - $moduleUrl .= '&' . urlencode(VidiModule::getParameterPrefix() . '[matches]='); |
|
53 | - } |
|
54 | - |
|
55 | - return $moduleUrl; |
|
56 | - } |
|
27 | + /** |
|
28 | + * Render a move storage URI. |
|
29 | + * |
|
30 | + * @return string |
|
31 | + */ |
|
32 | + public function render() |
|
33 | + { |
|
34 | + |
|
35 | + $urlParameters = array( |
|
36 | + VidiModule::getParameterPrefix() => array( |
|
37 | + 'controller' => 'Content', |
|
38 | + 'action' => 'move', |
|
39 | + 'fieldNameAndPath' => $this->templateVariableContainer->get('fieldNameAndPath'), |
|
40 | + 'matches' => $this->templateVariableContainer->get('matches'), |
|
41 | + ), |
|
42 | + ); |
|
43 | + |
|
44 | + $moduleUrl = BackendUtility::getModuleUrl( |
|
45 | + VidiModule::getSignature(), |
|
46 | + $urlParameters |
|
47 | + ); |
|
48 | + |
|
49 | + // Work around a bug in BackendUtility::getModuleUrl if matches is empty getModuleUrl() will not return the parameter. |
|
50 | + $matches = $this->templateVariableContainer->get('matches'); |
|
51 | + if (empty($matches)) { |
|
52 | + $moduleUrl .= '&' . urlencode(VidiModule::getParameterPrefix() . '[matches]='); |
|
53 | + } |
|
54 | + |
|
55 | + return $moduleUrl; |
|
56 | + } |
|
57 | 57 | |
58 | 58 | } |
@@ -23,13 +23,13 @@ |
||
23 | 23 | class ModuleSignatureViewHelper extends AbstractViewHelper |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * Returns the BE module signature. |
|
28 | - * |
|
29 | - * @return string |
|
30 | - */ |
|
31 | - public function render() |
|
32 | - { |
|
33 | - return VidiModule::getSignature(); |
|
34 | - } |
|
26 | + /** |
|
27 | + * Returns the BE module signature. |
|
28 | + * |
|
29 | + * @return string |
|
30 | + */ |
|
31 | + public function render() |
|
32 | + { |
|
33 | + return VidiModule::getSignature(); |
|
34 | + } |
|
35 | 35 | } |
@@ -23,78 +23,78 @@ |
||
23 | 23 | class Path |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * @var string |
|
28 | - */ |
|
29 | - static protected $extensionName = 'media'; |
|
26 | + /** |
|
27 | + * @var string |
|
28 | + */ |
|
29 | + static protected $extensionName = 'media'; |
|
30 | 30 | |
31 | - /** |
|
32 | - * Return a public path pointing to a resource. |
|
33 | - * |
|
34 | - * @param string $resource |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - static public function getRelativePath($resource) |
|
38 | - { |
|
31 | + /** |
|
32 | + * Return a public path pointing to a resource. |
|
33 | + * |
|
34 | + * @param string $resource |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + static public function getRelativePath($resource) |
|
38 | + { |
|
39 | 39 | |
40 | - // If file is not found, resolve the path |
|
41 | - if (!is_file(PATH_site . $resource)) { |
|
42 | - $resource = substr(self::resolvePath($resource), strlen(PATH_site)); |
|
43 | - } |
|
40 | + // If file is not found, resolve the path |
|
41 | + if (!is_file(PATH_site . $resource)) { |
|
42 | + $resource = substr(self::resolvePath($resource), strlen(PATH_site)); |
|
43 | + } |
|
44 | 44 | |
45 | - return PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site . $resource)) . PathUtility::basename($resource); |
|
46 | - } |
|
45 | + return PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site . $resource)) . PathUtility::basename($resource); |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Resolves path e.g. EXT:media/Resources/Public/foo.png or ../../foo and returns an absolute path to the given resource. |
|
50 | - * |
|
51 | - * @param string $resource |
|
52 | - * @return string |
|
53 | - */ |
|
54 | - static public function resolvePath($resource) |
|
55 | - { |
|
56 | - $resource = self::canonicalPath($resource); |
|
57 | - if (!is_file(PATH_site . $resource)) { |
|
58 | - $resource = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName) . '/Resources/Public/' . $resource; |
|
59 | - } |
|
60 | - return GeneralUtility::getFileAbsFileName($resource); |
|
61 | - } |
|
48 | + /** |
|
49 | + * Resolves path e.g. EXT:media/Resources/Public/foo.png or ../../foo and returns an absolute path to the given resource. |
|
50 | + * |
|
51 | + * @param string $resource |
|
52 | + * @return string |
|
53 | + */ |
|
54 | + static public function resolvePath($resource) |
|
55 | + { |
|
56 | + $resource = self::canonicalPath($resource); |
|
57 | + if (!is_file(PATH_site . $resource)) { |
|
58 | + $resource = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName) . '/Resources/Public/' . $resource; |
|
59 | + } |
|
60 | + return GeneralUtility::getFileAbsFileName($resource); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Tell whether a resource exist. |
|
65 | - * |
|
66 | - * @param string $resource |
|
67 | - * @return string |
|
68 | - */ |
|
69 | - static public function exists($resource) |
|
70 | - { |
|
71 | - return is_file(self::resolvePath($resource)); |
|
72 | - } |
|
63 | + /** |
|
64 | + * Tell whether a resource exist. |
|
65 | + * |
|
66 | + * @param string $resource |
|
67 | + * @return string |
|
68 | + */ |
|
69 | + static public function exists($resource) |
|
70 | + { |
|
71 | + return is_file(self::resolvePath($resource)); |
|
72 | + } |
|
73 | 73 | |
74 | - /** |
|
75 | - * Tell whether a resource does not exist. |
|
76 | - * |
|
77 | - * @param string $resource |
|
78 | - * @return string |
|
79 | - */ |
|
80 | - static public function notExists($resource) |
|
81 | - { |
|
82 | - return !self::exists($resource); |
|
83 | - } |
|
74 | + /** |
|
75 | + * Tell whether a resource does not exist. |
|
76 | + * |
|
77 | + * @param string $resource |
|
78 | + * @return string |
|
79 | + */ |
|
80 | + static public function notExists($resource) |
|
81 | + { |
|
82 | + return !self::exists($resource); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * Returns a canonical path by stripping relative segment ../foo/../bar will become foo/bar |
|
87 | - * |
|
88 | - * @param $resource |
|
89 | - * @return string |
|
90 | - */ |
|
91 | - static public function canonicalPath($resource) |
|
92 | - { |
|
93 | - $segments = explode('/', $resource); |
|
94 | - $keys = array_keys($segments, '..'); |
|
95 | - foreach ($keys as $key) { |
|
96 | - unset($segments[$key]); |
|
97 | - } |
|
98 | - return implode('/', $segments); |
|
99 | - } |
|
85 | + /** |
|
86 | + * Returns a canonical path by stripping relative segment ../foo/../bar will become foo/bar |
|
87 | + * |
|
88 | + * @param $resource |
|
89 | + * @return string |
|
90 | + */ |
|
91 | + static public function canonicalPath($resource) |
|
92 | + { |
|
93 | + $segments = explode('/', $resource); |
|
94 | + $keys = array_keys($segments, '..'); |
|
95 | + foreach ($keys as $key) { |
|
96 | + unset($segments[$key]); |
|
97 | + } |
|
98 | + return implode('/', $segments); |
|
99 | + } |
|
100 | 100 | } |