Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_mail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_mail
Commits
b4822aa6
Commit
b4822aa6
authored
6 years ago
by
Kevin Ditscheid
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] Do not extend UriViewHelper because it's messy and breaks in 9
parent
038dc3ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Feature upgrade to9 lts
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/ViewHelpers/Widget/UriViewHelper.php
+60
-1
60 additions, 1 deletion
Classes/ViewHelpers/Widget/UriViewHelper.php
with
60 additions
and
1 deletion
Classes/ViewHelpers/Widget/UriViewHelper.php
+
60
−
1
View file @
b4822aa6
...
...
@@ -28,11 +28,15 @@ namespace SGalinski\SgMail\ViewHelpers\Widget;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface
;
use
TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper
;
use
TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic
;
/**
* Class UriViewHelper
*/
class
UriViewHelper
extends
\TYPO3\CMS\Fluid\ViewHelpers\Widget\UriViewHelper
{
class
UriViewHelper
extends
AbstractViewHelper
{
use
CompileWithRenderStatic
;
/**
* @var boolean
...
...
@@ -44,6 +48,61 @@ class UriViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Widget\UriViewHelper {
*/
protected
$escapeChildren
=
FALSE
;
/**
* Initialize arguments
*/
public
function
initializeArguments
()
{
$this
->
registerArgument
(
'useCacheHash'
,
'bool'
,
'True whether the cache hash should be appended to the URL'
,
FALSE
,
FALSE
);
$this
->
registerArgument
(
'addQueryStringMethod'
,
'string'
,
'Method to be used for query string'
);
$this
->
registerArgument
(
'action'
,
'string'
,
'Target action'
);
$this
->
registerArgument
(
'arguments'
,
'array'
,
'Arguments'
,
FALSE
,
[]);
$this
->
registerArgument
(
'section'
,
'string'
,
'The anchor to be added to the URI'
,
FALSE
,
''
);
$this
->
registerArgument
(
'format'
,
'string'
,
'The requested format, e.g. ".html'
,
FALSE
,
''
);
$this
->
registerArgument
(
'ajax'
,
'bool'
,
'TRUE if the URI should be to an AJAX widget, FALSE otherwise.'
,
FALSE
,
FALSE
);
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public
static
function
renderStatic
(
array
$arguments
,
\Closure
$renderChildrenClosure
,
RenderingContextInterface
$renderingContext
)
{
$ajax
=
$arguments
[
'ajax'
];
if
(
$ajax
===
TRUE
)
{
return
static
::
getAjaxUri
(
$renderingContext
,
$arguments
);
}
return
static
::
getWidgetUri
(
$renderingContext
,
$arguments
);
}
/**
* Get the URI for an AJAX Request.
*
* @param RenderingContextInterface $renderingContext
* @param array $arguments
* @return string the AJAX URI
*/
protected
static
function
getAjaxUri
(
RenderingContextInterface
$renderingContext
,
array
$arguments
)
{
$controllerContext
=
$renderingContext
->
getControllerContext
();
$action
=
$arguments
[
'action'
];
$arguments
=
$arguments
[
'arguments'
];
if
(
$action
===
NULL
)
{
$action
=
$controllerContext
->
getRequest
()
->
getControllerActionName
();
}
$arguments
[
'id'
]
=
$GLOBALS
[
'TSFE'
]
->
id
;
// @todo page type should be configurable
$arguments
[
'type'
]
=
7076
;
$arguments
[
'fluid-widget-id'
]
=
$controllerContext
->
getRequest
()
->
getWidgetContext
()
->
getAjaxWidgetIdentifier
();
$arguments
[
'action'
]
=
$action
;
return
'?'
.
http_build_query
(
$arguments
,
NULL
,
'&'
);
}
/**
* Get the URI for a non-AJAX Request.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment