Skip to content

Commit

Permalink
hide listing on others tab if corresponding tab is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Jul 31, 2023
1 parent c9bedc3 commit c9d72aa
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 8 deletions.
6 changes: 5 additions & 1 deletion plugins/SitesManager/SiteContentDetection/Cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
return $view->render();
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
if ($detector->wasDetected(self::class)) {
return ''; // don't show on others page if tab is being displayed
}

return sprintf(
'<p>%s</p>',
Piwik::translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
return $view->render();
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
if ($detector->wasDetected(self::class)) {
return ''; // don't show on others page if tab is being displayed
}

return sprintf(
'<p>%s</p>',
Piwik::translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
<p>' . Piwik::translate( 'SitesManager_SiteWithoutDataMatomoTagManagerNotActive', ['<a href="https://matomo.org/docs/tag-manager/" rel="noreferrer noopener" target="_blank">', '</a>']) . '</p>';
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
return sprintf(
'<p>%s</p>',
Expand Down
6 changes: 5 additions & 1 deletion plugins/SitesManager/SiteContentDetection/ReactJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
';
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
if ($detector->wasDetected(self::class)) {
return ''; // don't show on others page if tab is being displayed
}

return sprintf(
'<p>%s</p>',
Piwik::translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): ?st
/**
* Returns the content that should be displayed in the Others tab on the no data page
*
* @param SiteContentDetector|null $detector
* @return string|null
*/
public function renderOthersInstruction(): ?string
public function renderOthersInstruction(SiteContentDetector $detector = null): ?string
{
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/SitesManager/SiteContentDetection/SpaPwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
return '';
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
return sprintf(
'<p>%s</p>',
Expand Down
6 changes: 5 additions & 1 deletion plugins/SitesManager/SiteContentDetection/VueJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
return $view->render();
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
if ($detector->wasDetected(self::class)) {
return ''; // don't show on others page if tab is being displayed
}

return sprintf(
'<p>%s</p>',
Piwik::translate(
Expand Down
6 changes: 5 additions & 1 deletion plugins/SitesManager/SiteContentDetection/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ public function renderInstructionsTab(SiteContentDetector $detector = null): str
return $view->render();
}

public function renderOthersInstruction(): string
public function renderOthersInstruction(SiteContentDetector $detector = null): string
{
if ($detector->wasDetected(self::class)) {
return ''; // don't show on others page if tab is being displayed
}

return sprintf(
'<p>%s</p>',
Piwik::translate(
Expand Down

0 comments on commit c9d72aa

Please sign in to comment.