Completed
Push — master ( 5794c5...08c98b )
by Fabien
53:00
created
Classes/ViewHelpers/Content/FindViewHelper.php 1 patch
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -19,68 +19,68 @@
 block discarded – undo
19 19
  */
20 20
 class FindViewHelper extends AbstractContentViewHelper
21 21
 {
22
-    /**
23
-     * @return void
24
-     * @throws Exception
25
-     */
26
-    public function initializeArguments()
27
-    {
28
-        parent::initializeArguments();
22
+	/**
23
+	 * @return void
24
+	 * @throws Exception
25
+	 */
26
+	public function initializeArguments()
27
+	{
28
+		parent::initializeArguments();
29 29
 
30
-        $this->registerArgument('orderings', 'array', 'Key / value array to be used for ordering. The key corresponds to a field name. The value can be "DESC" or "ASC".', false, array());
31
-        $this->registerArgument('limit', 'int', 'Limit the number of records being fetched.', false, 0);
32
-        $this->registerArgument('offset', 'int', 'Where to start the list of records.', false, 0);
33
-    }
30
+		$this->registerArgument('orderings', 'array', 'Key / value array to be used for ordering. The key corresponds to a field name. The value can be "DESC" or "ASC".', false, array());
31
+		$this->registerArgument('limit', 'int', 'Limit the number of records being fetched.', false, 0);
32
+		$this->registerArgument('offset', 'int', 'Where to start the list of records.', false, 0);
33
+	}
34 34
 
35
-    /**
36
-     * Fetch and returns a list of content objects.
37
-     *
38
-     * @return array
39
-     * @throws \BadMethodCallException
40
-     */
41
-    public function render()
42
-    {
43
-        $selectionIdentifier = (int)$this->arguments['selection'];
35
+	/**
36
+	 * Fetch and returns a list of content objects.
37
+	 *
38
+	 * @return array
39
+	 * @throws \BadMethodCallException
40
+	 */
41
+	public function render()
42
+	{
43
+		$selectionIdentifier = (int)$this->arguments['selection'];
44 44
 
45
-        if ($selectionIdentifier > 0) {
46
-            /** @var SelectionRepository $selectionRepository */
47
-            $selectionRepository = GeneralUtility::makeInstance(SelectionRepository::class);
45
+		if ($selectionIdentifier > 0) {
46
+			/** @var SelectionRepository $selectionRepository */
47
+			$selectionRepository = GeneralUtility::makeInstance(SelectionRepository::class);
48 48
 
49
-            /** @var Selection $selection */
50
-            $selection = $selectionRepository->findByUid($selectionIdentifier);
51
-            $matches = json_decode($selection->getQuery(), true);
52
-            $dataType = $selection->getDataType();
53
-        } else {
54
-            $dataType = $this->arguments['type'];
55
-            if (!empty($this->arguments['dataType'])) {
56
-                print 'Sorry to be so rude! There is something to change in the View Helper "v:find". Please replace attribute "dataType" by "type". This is a shorter syntax...';
57
-                exit();
58
-            }
59
-            $matches = $this->replacesAliases($this->arguments['matches']);
60
-        }
49
+			/** @var Selection $selection */
50
+			$selection = $selectionRepository->findByUid($selectionIdentifier);
51
+			$matches = json_decode($selection->getQuery(), true);
52
+			$dataType = $selection->getDataType();
53
+		} else {
54
+			$dataType = $this->arguments['type'];
55
+			if (!empty($this->arguments['dataType'])) {
56
+				print 'Sorry to be so rude! There is something to change in the View Helper "v:find". Please replace attribute "dataType" by "type". This is a shorter syntax...';
57
+				exit();
58
+			}
59
+			$matches = $this->replacesAliases($this->arguments['matches']);
60
+		}
61 61
 
62
-        $orderings = $this->replacesAliases($this->arguments['orderings']);
63
-        $limit = $this->arguments['limit'];
64
-        $offset = $this->arguments['offset'];
65
-        $ignoreEnableFields = $this->arguments['ignoreEnableFields'];
62
+		$orderings = $this->replacesAliases($this->arguments['orderings']);
63
+		$limit = $this->arguments['limit'];
64
+		$offset = $this->arguments['offset'];
65
+		$ignoreEnableFields = $this->arguments['ignoreEnableFields'];
66 66
 
67
-        $querySignature = $this->getQuerySignature($dataType, $matches, $orderings, $limit, $offset);
67
+		$querySignature = $this->getQuerySignature($dataType, $matches, $orderings, $limit, $offset);
68 68
 
69
-        $resultSet = $this->getResultSetStorage()->get($querySignature);
70
-        if (!$resultSet) {
71
-            $matcher = $this->getMatcher($dataType, $matches);
72
-            $orderings = $this->getOrder($dataType, $orderings);
69
+		$resultSet = $this->getResultSetStorage()->get($querySignature);
70
+		if (!$resultSet) {
71
+			$matcher = $this->getMatcher($dataType, $matches);
72
+			$orderings = $this->getOrder($dataType, $orderings);
73 73
 
74
-            $this->emitPostProcessLimitSignal($dataType, $limit);
75
-            $this->emitPostProcessOffsetSignal($dataType, $offset);
74
+			$this->emitPostProcessLimitSignal($dataType, $limit);
75
+			$this->emitPostProcessOffsetSignal($dataType, $offset);
76 76
 
77
-            $contentRepository = ContentRepositoryFactory::getInstance($dataType);
78
-            $contentRepository->setDefaultQuerySettings($this->getDefaultQuerySettings($ignoreEnableFields));
77
+			$contentRepository = ContentRepositoryFactory::getInstance($dataType);
78
+			$contentRepository->setDefaultQuerySettings($this->getDefaultQuerySettings($ignoreEnableFields));
79 79
 
80
-            $resultSet = $contentRepository->findBy($matcher, $orderings, $limit, $offset);
81
-            $this->getResultSetStorage()->set($querySignature, $resultSet); // store the result set for performance sake.
82
-        }
80
+			$resultSet = $contentRepository->findBy($matcher, $orderings, $limit, $offset);
81
+			$this->getResultSetStorage()->set($querySignature, $resultSet); // store the result set for performance sake.
82
+		}
83 83
 
84
-        return $resultSet;
85
-    }
84
+		return $resultSet;
85
+	}
86 86
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Selection/VisibilityOptionsViewHelper.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,30 +18,30 @@
 block discarded – undo
18 18
  */
19 19
 class VisibilityOptionsViewHelper extends AbstractViewHelper
20 20
 {
21
-    /**
22
-     * Returns the options for the visibility field of a Selection.
23
-     *
24
-     * @return array
25
-     */
26
-    public function render()
27
-    {
28
-        $options[Selection::VISIBILITY_PRIVATE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.private', 'vidi');
29
-        $options[Selection::VISIBILITY_EVERYONE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.everyone', 'vidi');
21
+	/**
22
+	 * Returns the options for the visibility field of a Selection.
23
+	 *
24
+	 * @return array
25
+	 */
26
+	public function render()
27
+	{
28
+		$options[Selection::VISIBILITY_PRIVATE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.private', 'vidi');
29
+		$options[Selection::VISIBILITY_EVERYONE] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.everyone', 'vidi');
30 30
 
31
-        if ($this->getBackendUser()->isAdmin()) {
32
-            $options[Selection::VISIBILITY_ADMIN_ONLY] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.admin_only', 'vidi');
33
-        }
34
-        return $options;
35
-    }
31
+		if ($this->getBackendUser()->isAdmin()) {
32
+			$options[Selection::VISIBILITY_ADMIN_ONLY] = LocalizationUtility::translate('LLL:EXT:vidi/Resources/Private/Language/tx_vidi_selection.xlf:visibility.admin_only', 'vidi');
33
+		}
34
+		return $options;
35
+	}
36 36
 
37 37
 
38
-    /**
39
-     * Returns an instance of the current Backend User.
40
-     *
41
-     * @return BackendUserAuthentication
42
-     */
43
-    protected function getBackendUser()
44
-    {
45
-        return $GLOBALS['BE_USER'];
46
-    }
38
+	/**
39
+	 * Returns an instance of the current Backend User.
40
+	 *
41
+	 * @return BackendUserAuthentication
42
+	 */
43
+	protected function getBackendUser()
44
+	{
45
+		return $GLOBALS['BE_USER'];
46
+	}
47 47
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/PublicPathViewHelper.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,13 +16,13 @@
 block discarded – undo
16 16
  */
17 17
 class PublicPathViewHelper extends AbstractViewHelper
18 18
 {
19
-    /**
20
-     * Returns the public path to Vidi extension.
21
-     *
22
-     * @return string
23
-     */
24
-    public function render()
25
-    {
26
-        return ExtensionManagementUtility::siteRelPath('vidi');
27
-    }
19
+	/**
20
+	 * Returns the public path to Vidi extension.
21
+	 *
22
+	 * @return string
23
+	 */
24
+	public function render()
25
+	{
26
+		return ExtensionManagementUtility::siteRelPath('vidi');
27
+	}
28 28
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Link/BackViewHelper.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -19,30 +19,30 @@
 block discarded – undo
19 19
  */
20 20
 class BackViewHelper extends AbstractViewHelper
21 21
 {
22
-    /**
23
-     * Returns the "back" buttons to be placed in the doc header.
24
-     *
25
-     * @return string
26
-     */
27
-    public function render()
28
-    {
29
-        $result = '';
30
-        if (GeneralUtility::_GET('returnUrl')) {
31
-            $result = sprintf(
32
-                '<a href="%s" class="btn btn-default btn-sm btn-return-top">%s</a>',
33
-                GeneralUtility::_GP('returnUrl'),
34
-                $this->getIconFactory()->getIcon('actions-close', Icon::SIZE_SMALL)
35
-            );
36
-        }
22
+	/**
23
+	 * Returns the "back" buttons to be placed in the doc header.
24
+	 *
25
+	 * @return string
26
+	 */
27
+	public function render()
28
+	{
29
+		$result = '';
30
+		if (GeneralUtility::_GET('returnUrl')) {
31
+			$result = sprintf(
32
+				'<a href="%s" class="btn btn-default btn-sm btn-return-top">%s</a>',
33
+				GeneralUtility::_GP('returnUrl'),
34
+				$this->getIconFactory()->getIcon('actions-close', Icon::SIZE_SMALL)
35
+			);
36
+		}
37 37
 
38
-        return $result;
39
-    }
38
+		return $result;
39
+	}
40 40
 
41
-    /**
42
-     * @return IconFactory|object
43
-     */
44
-    protected function getIconFactory()
45
-    {
46
-        return GeneralUtility::makeInstance(IconFactory::class);
47
-    }
41
+	/**
42
+	 * @return IconFactory|object
43
+	 */
44
+	protected function getIconFactory()
45
+	{
46
+		return GeneralUtility::makeInstance(IconFactory::class);
47
+	}
48 48
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Button/ToolWorkViewHelper.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -17,59 +17,59 @@
 block discarded – undo
17 17
  */
18 18
 class ToolWorkViewHelper extends AbstractViewHelper
19 19
 {
20
-    /**
21
-     * @return void
22
-     */
23
-    public function initializeArguments()
24
-    {
25
-        $this->registerArgument('tool', 'string', '', true);
26
-        $this->registerArgument('label', 'string', '', true);
27
-        $this->registerArgument('arguments', 'array', '', false, []);
28
-    }
20
+	/**
21
+	 * @return void
22
+	 */
23
+	public function initializeArguments()
24
+	{
25
+		$this->registerArgument('tool', 'string', '', true);
26
+		$this->registerArgument('label', 'string', '', true);
27
+		$this->registerArgument('arguments', 'array', '', false, []);
28
+	}
29 29
 
30
-    /**
31
-     * Renders a button for "work" for a Tool.
32
-     *
33
-     * @return string
34
-     */
35
-    public function render()
36
-    {
37
-        $tool = $this->arguments['tool'];
38
-        $label = $this->arguments['label'];
39
-        $arguments = $this->arguments['arguments'];
30
+	/**
31
+	 * Renders a button for "work" for a Tool.
32
+	 *
33
+	 * @return string
34
+	 */
35
+	public function render()
36
+	{
37
+		$tool = $this->arguments['tool'];
38
+		$label = $this->arguments['label'];
39
+		$arguments = $this->arguments['arguments'];
40 40
 
41
-        $parameterPrefix = $this->getModuleLoader()->getParameterPrefix();
41
+		$parameterPrefix = $this->getModuleLoader()->getParameterPrefix();
42 42
 
43
-        // Compute the additional parameters.
44
-        $additionalParameters = array(
45
-            $parameterPrefix => array(
46
-                'controller' => 'Tool',
47
-                'action' => 'work',
48
-                'tool' => $tool,
49
-            ),
50
-        );
43
+		// Compute the additional parameters.
44
+		$additionalParameters = array(
45
+			$parameterPrefix => array(
46
+				'controller' => 'Tool',
47
+				'action' => 'work',
48
+				'tool' => $tool,
49
+			),
50
+		);
51 51
 
52
-        // Add possible additional arguments.
53
-        if (!empty($arguments)) {
54
-            $additionalParameters[$parameterPrefix]['arguments'] = $arguments;
55
-        }
52
+		// Add possible additional arguments.
53
+		if (!empty($arguments)) {
54
+			$additionalParameters[$parameterPrefix]['arguments'] = $arguments;
55
+		}
56 56
 
57
-        $result = sprintf(
58
-            '<a href="%s&returnUrl=%s" class="btn btn-default">%s</a>',
59
-            $this->getModuleLoader()->getModuleUrl($additionalParameters),
60
-            urlencode($GLOBALS['_SERVER']['REQUEST_URI']),
61
-            $label
62
-        );
63
-        return $result;
64
-    }
57
+		$result = sprintf(
58
+			'<a href="%s&returnUrl=%s" class="btn btn-default">%s</a>',
59
+			$this->getModuleLoader()->getModuleUrl($additionalParameters),
60
+			urlencode($GLOBALS['_SERVER']['REQUEST_URI']),
61
+			$label
62
+		);
63
+		return $result;
64
+	}
65 65
 
66
-    /**
67
-     * Get the Vidi Module Loader.
68
-     *
69
-     * @return ModuleLoader|object
70
-     */
71
-    protected function getModuleLoader()
72
-    {
73
-        return GeneralUtility::makeInstance(ModuleLoader::class);
74
-    }
66
+	/**
67
+	 * Get the Vidi Module Loader.
68
+	 *
69
+	 * @return ModuleLoader|object
70
+	 */
71
+	protected function getModuleLoader()
72
+	{
73
+		return GeneralUtility::makeInstance(ModuleLoader::class);
74
+	}
75 75
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Result/ToJsonViewHelper.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -18,54 +18,54 @@
 block discarded – undo
18 18
  */
19 19
 class ToJsonViewHelper extends AbstractViewHelper
20 20
 {
21
-    /**
22
-     * Render a Json response
23
-     *
24
-     */
25
-    public function render()
26
-    {
27
-        $objects = $this->templateVariableContainer->get('objects');
28
-        $columns = $this->templateVariableContainer->get('columns');
29
-        $output = array(
30
-            'sEcho' => $this->getNextTransactionId(),
31
-            'iTotalRecords' => $this->templateVariableContainer->get('numberOfObjects'),
32
-            'iTotalDisplayRecords' => $this->templateVariableContainer->get('numberOfObjects'),
33
-            'iNumberOfRecords' => count($objects),
34
-            'aaData' => $this->getRowsView()->render($objects, $columns),
35
-        );
21
+	/**
22
+	 * Render a Json response
23
+	 *
24
+	 */
25
+	public function render()
26
+	{
27
+		$objects = $this->templateVariableContainer->get('objects');
28
+		$columns = $this->templateVariableContainer->get('columns');
29
+		$output = array(
30
+			'sEcho' => $this->getNextTransactionId(),
31
+			'iTotalRecords' => $this->templateVariableContainer->get('numberOfObjects'),
32
+			'iTotalDisplayRecords' => $this->templateVariableContainer->get('numberOfObjects'),
33
+			'iNumberOfRecords' => count($objects),
34
+			'aaData' => $this->getRowsView()->render($objects, $columns),
35
+		);
36 36
 
37
-        $this->setHttpHeaders();
38
-        print json_encode($output);
39
-    }
37
+		$this->setHttpHeaders();
38
+		print json_encode($output);
39
+	}
40 40
 
41
-    /**
42
-     * @return int
43
-     */
44
-    protected function getNextTransactionId()
45
-    {
46
-        $transaction = 0;
47
-        if (GeneralUtility::_GET('sEcho')) {
48
-            $transaction = (int)GeneralUtility::_GET('sEcho') + 1;
49
-        }
50
-        return $transaction;
51
-    }
41
+	/**
42
+	 * @return int
43
+	 */
44
+	protected function getNextTransactionId()
45
+	{
46
+		$transaction = 0;
47
+		if (GeneralUtility::_GET('sEcho')) {
48
+			$transaction = (int)GeneralUtility::_GET('sEcho') + 1;
49
+		}
50
+		return $transaction;
51
+	}
52 52
 
53
-    /**
54
-     * @return void
55
-     * @throws \InvalidArgumentException
56
-     */
57
-    protected function setHttpHeaders()
58
-    {
59
-        /** @var Response $response */
60
-        $response = $this->templateVariableContainer->get('response');
61
-        $response->withHeader('Content-Type', 'application/json');
62
-    }
53
+	/**
54
+	 * @return void
55
+	 * @throws \InvalidArgumentException
56
+	 */
57
+	protected function setHttpHeaders()
58
+	{
59
+		/** @var Response $response */
60
+		$response = $this->templateVariableContainer->get('response');
61
+		$response->withHeader('Content-Type', 'application/json');
62
+	}
63 63
 
64
-    /**
65
-     * @return Rows|object
66
-     */
67
-    protected function getRowsView()
68
-    {
69
-        return GeneralUtility::makeInstance(Rows::class);
70
-    }
64
+	/**
65
+	 * @return Rows|object
66
+	 */
67
+	protected function getRowsView()
68
+	{
69
+		return GeneralUtility::makeInstance(Rows::class);
70
+	}
71 71
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Grid/PreferencesViewHelper.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,29 +18,29 @@
 block discarded – undo
18 18
  */
19 19
 class PreferencesViewHelper extends AbstractViewHelper
20 20
 {
21
-    /**
22
-     * @return void
23
-     */
24
-    public function initializeArguments()
25
-    {
26
-        $this->registerArgument('key', 'string', '', true);
27
-    }
21
+	/**
22
+	 * @return void
23
+	 */
24
+	public function initializeArguments()
25
+	{
26
+		$this->registerArgument('key', 'string', '', true);
27
+	}
28 28
 
29
-    /**
30
-     * Returns Grid preferences for the given key.
31
-     *
32
-     * @return mixed
33
-     */
34
-    public function render()
35
-    {
36
-        return $this->getModulePreferences()->get($this->arguments['key']);
37
-    }
29
+	/**
30
+	 * Returns Grid preferences for the given key.
31
+	 *
32
+	 * @return mixed
33
+	 */
34
+	public function render()
35
+	{
36
+		return $this->getModulePreferences()->get($this->arguments['key']);
37
+	}
38 38
 
39
-    /**
40
-     * @return ModulePreferences|object
41
-     */
42
-    protected function getModulePreferences()
43
-    {
44
-        return GeneralUtility::makeInstance(ModulePreferences::class);
45
-    }
39
+	/**
40
+	 * @return ModulePreferences|object
41
+	 */
42
+	protected function getModulePreferences()
43
+	{
44
+		return GeneralUtility::makeInstance(ModulePreferences::class);
45
+	}
46 46
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Grid/FacetsViewHelper.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@
 block discarded – undo
18 18
  */
19 19
 class FacetsViewHelper extends AbstractViewHelper
20 20
 {
21
-    /**
22
-     * Returns the json serialization of the search fields.
23
-     *
24
-     * @return string
25
-     */
26
-    public function render()
27
-    {
28
-        $facets = [];
29
-        foreach (Tca::grid()->getFacets() as $facet) {
30
-            /** @var FacetInterface $facet */
31
-            $name = $facet->getName();
32
-            $facets[$name] = $facet->getLabel();
33
-        }
21
+	/**
22
+	 * Returns the json serialization of the search fields.
23
+	 *
24
+	 * @return string
25
+	 */
26
+	public function render()
27
+	{
28
+		$facets = [];
29
+		foreach (Tca::grid()->getFacets() as $facet) {
30
+			/** @var FacetInterface $facet */
31
+			$name = $facet->getName();
32
+			$facets[$name] = $facet->getLabel();
33
+		}
34 34
 
35
-        return json_encode($facets);
36
-    }
35
+		return json_encode($facets);
36
+	}
37 37
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Grid/Column/HeaderViewHelper.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -17,21 +17,21 @@
 block discarded – undo
17 17
  */
18 18
 class HeaderViewHelper extends AbstractViewHelper
19 19
 {
20
-    /**
21
-     * @return void
22
-     */
23
-    public function initializeArguments()
24
-    {
25
-        $this->registerArgument('name', 'string', 'The column name', true);
26
-    }
20
+	/**
21
+	 * @return void
22
+	 */
23
+	public function initializeArguments()
24
+	{
25
+		$this->registerArgument('name', 'string', 'The column name', true);
26
+	}
27 27
 
28
-    /**
29
-     * Returns a possible column header.
30
-     *
31
-     * @return boolean
32
-     */
33
-    public function render()
34
-    {
35
-        return Tca::grid()->getHeader($this->arguments['name']);
36
-    }
28
+	/**
29
+	 * Returns a possible column header.
30
+	 *
31
+	 * @return boolean
32
+	 */
33
+	public function render()
34
+	{
35
+		return Tca::grid()->getHeader($this->arguments['name']);
36
+	}
37 37
 }
Please login to merge, or discard this patch.