Commit 82ab86b6 authored by Stefan Busemann's avatar Stefan Busemann

[BUGFIX] Update viewhelpers for TYPO3 V9

parent 677e7f94
...@@ -22,12 +22,11 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper ...@@ -22,12 +22,11 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper
/** /**
* Check if a property of the userprofile is visible in the current context * Check if a property of the userprofile is visible in the current context
* *
* @param int $frontendUserUID
* @return string * @return string
*/ */
public function render(int $frontendUserUID) public function render()
{ {
$feUser = $this->slackFrontendUserRepository->findByUid($frontendUserUID); $feUser = $this->slackFrontendUserRepository->findByUid($this->arguments['frontendUserUID']);
$slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId()); $slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId());
if ($slackUser) { if ($slackUser) {
...@@ -38,7 +37,7 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper ...@@ -38,7 +37,7 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper
} }
} else { } else {
// @todo render link to register for slack // @todo render link to register for slack
if ($GLOBALS['TSFE']->fe_user->user['uid'] == $frontendUserUID) { if ($GLOBALS['TSFE']->fe_user->user['uid'] == $this->arguments['frontendUserUID']) {
// @todo add TS configuration // @todo add TS configuration
$content = '<a href="https://my.typo3.org/?id=23">Get your TYPO3 Slack Account</a>'; $content = '<a href="https://my.typo3.org/?id=23">Get your TYPO3 Slack Account</a>';
} else { } else {
...@@ -48,4 +47,15 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper ...@@ -48,4 +47,15 @@ class ShowSlackLinkViewHelper extends AbstractViewHelper
return $content; return $content;
} }
/**
* Initialize
*
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('frontendUserUID', 'integer', 'UID of the FrontendUser which should get displayed');
}
} }
...@@ -25,12 +25,11 @@ class IsSlackOnlineViewhelper extends AbstractViewHelper ...@@ -25,12 +25,11 @@ class IsSlackOnlineViewhelper extends AbstractViewHelper
/** /**
* Checks if the user is online in slack * Checks if the user is online in slack
* *
* @param int $frontendUserUID
* @return string * @return string
*/ */
public function render($frontendUserUID) public function render()
{ {
$feUser = $this->slackFrontendUserRepository->findByUid($frontendUserUID); $feUser = $this->slackFrontendUserRepository->findByUid($this->arguments['frontendUserUID']);
$slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId()); $slackUser = $this->slackUserRepository->findBySlackId($feUser->getSlackId());
if ($slackUser) { if ($slackUser) {
...@@ -45,4 +44,15 @@ class IsSlackOnlineViewhelper extends AbstractViewHelper ...@@ -45,4 +44,15 @@ class IsSlackOnlineViewhelper extends AbstractViewHelper
} }
return $status; return $status;
} }
/**
* Initialize
*
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('frontendUserUID', 'integer', 'UID of the FrontendUser which should get displayed');
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment