Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Henri Nathanson
content_replacer
Commits
6f8e4d04
Commit
6f8e4d04
authored
Aug 07, 2016
by
Stefan Galinski
🎮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TASK] Make TSFE variable visible
parent
94035ef8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Classes/Service/AbstractParserService.php
Classes/Service/AbstractParserService.php
+8
-4
Classes/Service/SpanParserService.php
Classes/Service/SpanParserService.php
+1
-1
No files found.
Classes/Service/AbstractParserService.php
View file @
6f8e4d04
...
...
@@ -26,6 +26,7 @@ namespace SGalinski\ContentReplacer\Service;
***************************************************************/
use
SGalinski\ContentReplacer\Repository\TermRepository
;
use
TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
;
/**
* Abstract parser that handles the parsing and(!) replacement of terms
...
...
@@ -97,15 +98,18 @@ abstract class AbstractParserService {
* @return string
*/
protected
function
prepareReplacementTerm
(
$replacement
,
$stdWrap
,
$termName
)
{
/** @var $tsfe TypoScriptFrontendController */
$tsfe
=
$GLOBALS
[
'TSFE'
];
if
(
$replacement
!==
''
)
{
$replacement
=
$
GLOBALS
[
'TSFE'
]
->
cObj
->
parseFunc
(
$replacement
,
$this
->
parseFunc
);
$replacement
=
$
tsfe
->
cObj
->
parseFunc
(
$replacement
,
$this
->
parseFunc
);
$replacement
=
preg_replace
(
'/^<p>(.+)<\/p>$/s'
,
'\1'
,
$replacement
);
}
if
(
$stdWrap
!==
''
)
{
$replacement
=
$
GLOBALS
[
'TSFE'
]
->
cObj
->
stdWrap
(
$replacement
=
$
tsfe
->
cObj
->
stdWrap
(
(
$replacement
===
''
?
$termName
:
$replacement
),
$
GLOBALS
[
'TSFE'
]
->
tmpl
->
setup
[
'plugin.'
][
'tx_content_replacer.'
][
$stdWrap
.
'.'
]
$
tsfe
->
tmpl
->
setup
[
'plugin.'
][
'tx_content_replacer.'
][
$stdWrap
.
'.'
]
);
}
...
...
@@ -152,4 +156,4 @@ abstract class AbstractParserService {
* @return string
*/
abstract
public
function
replaceByCategory
(
$category
,
array
$terms
,
$content
);
}
\ No newline at end of file
}
Classes/Service/SpanParserService.php
View file @
6f8e4d04
...
...
@@ -148,4 +148,4 @@ class SpanParserService extends AbstractParserService {
return
preg_replace
(
$search
,
$replace
,
$content
);
}
}
\ No newline at end of file
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment