Commit 337b9b95 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Fixes issues after upgrade in ter_fe2

parent a352656b
Pipeline #438 passed with stages
in 3 minutes
...@@ -216,9 +216,10 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -216,9 +216,10 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
//$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString()); //$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString());
$this->view->assign('documentationLink', $documentationLink); $this->view->assign('documentationLink', $documentationLink);
$GLOBALS['TSFE']->getPageRenderer()->addMetaTag('<meta name="description" content="' . htmlspecialchars($extension->getLastVersion()->getDescription()) . '" />'); $pageRenderer = $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class);
$pageRenderer->addMetaTag('<meta name="description" content="' . htmlspecialchars($extension->getLastVersion()->getDescription()) . '" />');
if ($extension->getTags()->count() > 0) { if ($extension->getTags()->count() > 0) {
$GLOBALS['TSFE']->getPageRenderer()->addMetaTag('<meta name="keywords" content="' . htmlspecialchars(implode(',', $extension->getTags()->toArray())) . '" />'); $pageRenderer->addMetaTag('<meta name="keywords" content="' . htmlspecialchars(implode(',', $extension->getTags()->toArray())) . '" />');
} }
// gets all other extensions from the owner // gets all other extensions from the owner
...@@ -237,7 +238,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst ...@@ -237,7 +238,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
// adds username // adds username
$url .= '&user_id=' . urlencode($extension->getFlattrUsername()); $url .= '&user_id=' . urlencode($extension->getFlattrUsername());
// adds current url // adds current url
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ /** @var \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder */
$uriBuilder = $this->controllerContext->getUriBuilder(); $uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->setArguments( $uriBuilder->setArguments(
array( array(
......
...@@ -55,7 +55,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab ...@@ -55,7 +55,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
{ {
$this->extensionRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_ExtensionRepository'); $this->extensionRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_ExtensionRepository');
$this->versionRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_VersionRepository'); $this->versionRepository = $this->objectManager->get('Tx_TerFe2_Domain_Repository_VersionRepository');
$this->userRepository = $this->objectManager->get(Tx_TerFe2_Domain_Repository_UserRepository::class); $this->userRepository = $this->objectManager->get(\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository::class);
} }
/** /**
......
...@@ -324,7 +324,7 @@ class Tx_TerFe2_Domain_Model_Extension extends Tx_TerFe2_Domain_Model_AbstractEn ...@@ -324,7 +324,7 @@ class Tx_TerFe2_Domain_Model_Extension extends Tx_TerFe2_Domain_Model_AbstractEn
/** /**
* Get versions reverse sorted by version number * Get versions reverse sorted by version number
* *
* @return array Versions * @return array|\Tx_TerFe2_Domain_Model_Version[] Versions
*/ */
public function getReverseVersionsByVersionNumber() public function getReverseVersionsByVersionNumber()
{ {
......
<?php <?php
namespace T3o\TerFe2\ViewHelpers;
/******************************************************************* /*******************************************************************
* Copyright notice * Copyright notice
* *
...@@ -28,7 +30,7 @@ ...@@ -28,7 +30,7 @@
* *
* For documentation and examples visit http://www.jqplot.com * For documentation and examples visit http://www.jqplot.com
*/ */
class Tx_TerFe2_ViewHelpers_ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper class ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{ {
/** /**
...@@ -76,18 +78,18 @@ class Tx_TerFe2_ViewHelpers_ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHe ...@@ -76,18 +78,18 @@ class Tx_TerFe2_ViewHelpers_ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHe
// Check object type // Check object type
if (!$object instanceof \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface) { if (!$object instanceof \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface) {
throw new Exception('Charts can only be rendered for domain objects yet'); throw new \Exception('Charts can only be rendered for domain objects yet');
} }
// Check given method name // Check given method name
if (empty($method)) { if (empty($method)) {
throw new Exception('Can not render a chart without render method'); throw new \Exception('Can not render a chart without render method');
} }
// Get method name // Get method name
$method = 'get' . ucfirst(trim($method)); $method = 'get' . ucfirst(trim($method));
if (!method_exists($this, $method)) { if (!method_exists($this, $method)) {
throw new Exception('No method with name "' . $method . '" defined in chart view helper'); throw new \Exception('No method with name "' . $method . '" defined in chart view helper');
} }
// Get chart options // Get chart options
...@@ -108,11 +110,11 @@ class Tx_TerFe2_ViewHelpers_ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHe ...@@ -108,11 +110,11 @@ class Tx_TerFe2_ViewHelpers_ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHe
/** /**
* Returns downloads by version * Returns downloads by version
* *
* @param Tx_TerFe2_Domain_Model_Extension Extension object * @param \Tx_TerFe2_Domain_Model_Extension Extension object
* @param integer $pointCount Count of points to render in one line * @param integer $pointCount Count of points to render in one line
* @return array Lines to render in chart * @return array Lines to render in chart
*/ */
protected function getDownloadsByVersion(Tx_TerFe2_Domain_Model_Extension $extension, $pointCount = 10) protected function getDownloadsByVersion(\Tx_TerFe2_Domain_Model_Extension $extension, $pointCount = 10)
{ {
$points = array(); $points = array();
$versions = $extension->getReverseVersionsByVersionNumber(); $versions = $extension->getReverseVersionsByVersionNumber();
......
<?php <?php
namespace T3o\TerFe2\ViewHelpers;
/******************************************************************* /*******************************************************************
* Copyright notice * Copyright notice
* *
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
/** /**
* DateTime view helper * DateTime view helper
*/ */
class Tx_TerFe2_ViewHelpers_DateTimeViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper class DateTimeViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{ {
/** /**
...@@ -66,14 +68,14 @@ class Tx_TerFe2_ViewHelpers_DateTimeViewHelper extends \TYPO3\CMS\Fluid\Core\Vie ...@@ -66,14 +68,14 @@ class Tx_TerFe2_ViewHelpers_DateTimeViewHelper extends \TYPO3\CMS\Fluid\Core\Vie
} }
if (empty($dateTime)) { if (empty($dateTime)) {
$dateTime = new DateTime; $dateTime = new \DateTime;
} }
if (is_int($dateTime) || is_string($dateTime)) { if (is_int($dateTime) || is_string($dateTime)) {
return date($format, (int)$dateTime); return date($format, (int)$dateTime);
} }
if ($dateTime instanceof DateTime) { if ($dateTime instanceof \DateTime) {
return $dateTime->format($format); return $dateTime->format($format);
} }
......
<?php <?php
namespace T3o\TerFe2\ViewHelpers;
/******************************************************************* /*******************************************************************
* Copyright notice * Copyright notice
* *
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
/** /**
* Extension icon view helper * Extension icon view helper
*/ */
class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper class ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper
{ {
/** /**
...@@ -35,23 +37,11 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor ...@@ -35,23 +37,11 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor
protected $tagName = 'img'; protected $tagName = 'img';
/** /**
* @var Tx_TerFe2_Provider_ProviderManager * @var \Tx_TerFe2_Provider_ProviderManager
* @inject
*/ */
protected $providerManager; protected $providerManager;
/**
* Inject provider manager
*
* @param Tx_TerFe2_Provider_ProviderManager $providerManager
* @return void
*/
public function injectProviderManager(Tx_TerFe2_Provider_ProviderManager $providerManager)
{
$this->providerManager = $providerManager;
}
/** /**
* Initialize arguments * Initialize arguments
* *
...@@ -68,11 +58,11 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor ...@@ -68,11 +58,11 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor
/** /**
* Renders an extension icon for given version object * Renders an extension icon for given version object
* *
* @param Tx_TerFe2_Domain_Model_Version $version Version object * @param \Tx_TerFe2_Domain_Model_Version $version Version object
* @param string $fileType File type * @param string $fileType File type
* @return string Rendered image tag * @return string Rendered image tag
*/ */
public function render(Tx_TerFe2_Domain_Model_Version $version = NULL, $fileType = 'png') public function render(\Tx_TerFe2_Domain_Model_Version $version = NULL, $fileType = 'png')
{ {
if ($version === NULL) { if ($version === NULL) {
$version = $this->renderChildren(); $version = $this->renderChildren();
...@@ -82,12 +72,12 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor ...@@ -82,12 +72,12 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor
$provider = $version->getExtensionProvider(); $provider = $version->getExtensionProvider();
if (!empty($provider)) { if (!empty($provider)) {
$imageUrl = $this->providerManager->getProvider($provider)->getIconUrl($version, $fileType); $imageUrl = $this->providerManager->getProvider($provider)->getIconUrl($version, $fileType);
if (empty($imageUrl) || !file_exists(Tx_TerFe2_Utility_File::getAbsolutePathFromUrl($imageUrl))) { if (empty($imageUrl) || !file_exists(\Tx_TerFe2_Utility_File::getAbsolutePathFromUrl($imageUrl))) {
$imageUrl = $this->providerManager->getProvider($provider)->getIconUrl($version, 'gif'); $imageUrl = $this->providerManager->getProvider($provider)->getIconUrl($version, 'gif');
} }
} }
if (empty($imageUrl) || !file_exists(Tx_TerFe2_Utility_File::getAbsolutePathFromUrl($imageUrl))) { if (empty($imageUrl) || !file_exists(\Tx_TerFe2_Utility_File::getAbsolutePathFromUrl($imageUrl))) {
$imageUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl('typo3/clear.gif'); $imageUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl('typo3/clear.gif');
} }
......
<?php <?php
namespace T3o\TerFe2\ViewHelpers;
/******************************************************************* /*******************************************************************
* Copyright notice * Copyright notice
* *
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
/** /**
* Filesize view helper * Filesize view helper
*/ */
class Tx_TerFe2_ViewHelpers_FilesizeViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper class FilesizeViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{ {
/** /**
......
<?php <?php
namespace T3o\TerFe2\ViewHelpers;
/******************************************************************* /*******************************************************************
* Copyright notice * Copyright notice
* *
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
/** /**
* Format view helper * Format view helper
*/ */
class Tx_TerFe2_ViewHelpers_FormatViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper class FormatViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{ {
/** /**
...@@ -49,11 +51,11 @@ class Tx_TerFe2_ViewHelpers_FormatViewHelper extends \TYPO3\CMS\Fluid\Core\ViewH ...@@ -49,11 +51,11 @@ class Tx_TerFe2_ViewHelpers_FormatViewHelper extends \TYPO3\CMS\Fluid\Core\ViewH
} }
if (empty($function) || !function_exists($function)) { if (empty($function) || !function_exists($function)) {
throw new Exception('Function "' . $function . '" not found to modify content'); throw new \Exception('Function "' . $function . '" not found to modify content');
} }
if (!is_string($content) && !is_array($content)) { if (!is_string($content) && !is_array($content)) {
throw new Exception('"' . ucfirst(gettype($content)) . '" is not an allowed type in format view helper'); throw new \Exception('"' . ucfirst(gettype($content)) . '" is not an allowed type in format view helper');
} }
if (is_array($content)) { if (is_array($content)) {
......
<?php <?php
namespace T3o\TerFe2\ViewHelpers;
/******************************************************************* /*******************************************************************
* Copyright notice * Copyright notice
* *
...@@ -26,7 +28,7 @@ ...@@ -26,7 +28,7 @@
/** /**
* Raw content view helper * Raw content view helper
*/ */
class Tx_TerFe2_ViewHelpers_RawViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper class RawViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{ {
/** /**
......
<div class="tx_terfe2"> <div class="tx_terfe2">
<div class="tx_terfe2_messages"> <div class="tx_terfe2_messages">
<f:flashMessages renderMode="div"/> <f:flashMessages />
</div> </div>
<div class="tx_terfe2_content"> <div class="tx_terfe2_content">
<f:render section="main"/> <f:render section="main"/>
</div> </div>
</div> </div>
\ No newline at end of file
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{authors}"> <f:if condition="{authors}">
<f:then> <f:then>
<f:widget.paginate objects="{authors}" as="paginateAuthors" <f:widget.paginate objects="{authors}" as="paginateAuthors"
...@@ -17,4 +15,4 @@ ...@@ -17,4 +15,4 @@
<f:else> <f:else>
<f:translate key="msg.no_entries_found"/> <f:translate key="msg.no_entries_found"/>
</f:else> </f:else>
</f:if> </f:if>
\ No newline at end of file
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{extensions}"> <f:if condition="{extensions}">
<f:then> <f:then>
<div class="ter-ext-list-count"> <div class="ter-ext-list-count">
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:for each="{extensions}" as="extension"> <f:for each="{extensions}" as="extension">
<item> <item>
<title><terfe2:cdata>{extension.lastVersion.title} [{extension.extKey}] (v{extension.lastVersion.versionString})</terfe2:cdata></title> <title><terfe2:cdata>{extension.lastVersion.title} [{extension.extKey}] (v{extension.lastVersion.versionString})</terfe2:cdata></title>
...@@ -9,4 +7,4 @@ ...@@ -9,4 +7,4 @@
<content:encoded><terfe2:cdata>{extension.lastVersion.uploadComment}</terfe2:cdata></content:encoded> <content:encoded><terfe2:cdata>{extension.lastVersion.uploadComment}</terfe2:cdata></content:encoded>
<pubDate><terfe2:dateTime format="{settings.rssOutput.dateFormat}">{extension.lastVersion.uploadDate}</terfe2:dateTime></pubDate> <pubDate><terfe2:dateTime format="{settings.rssOutput.dateFormat}">{extension.lastVersion.uploadDate}</terfe2:dateTime></pubDate>
</item> </item>
</f:for> </f:for>
\ No newline at end of file
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<div class="ter-ext-list-search"> <div class="ter-ext-list-search">
<form method="post" action="{f:uri.action(controller:'Extension', action:'search', noCacheHash: 1)}"> <form method="post" action="{f:uri.action(controller:'Extension', action:'search', noCacheHash: 1)}">
<f:form.textfield name="tx_terfe2_pi1[search][needle]" id="ter-ext-list-search-needle" value="{search.needle}"/> <f:form.textfield name="tx_terfe2_pi1[search][needle]" id="ter-ext-list-search-needle" value="{search.needle}"/>
...@@ -15,4 +13,4 @@ ...@@ -15,4 +13,4 @@
}"/> }"/>
</span> </span>
</form> </form>
</div> </div>
\ No newline at end of file
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<dl class="row"> <dl class="row">
<dt class="col-sm-3"><f:translate key="version" /></dt> <dt class="col-sm-3"><f:translate key="version" /></dt>
<dd class="col-sm-9">{extension.lastVersion.versionString}</dd> <dd class="col-sm-9">{extension.lastVersion.versionString}</dd>
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<tr> <tr>
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{relations}"> <f:if condition="{relations}">
<f:then> <f:then>
<ul class="list-unstyled mb-0"> <ul class="list-unstyled mb-0">
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{tags}"> <f:if condition="{tags}">
<f:then> <f:then>
<ul> <ul>
...@@ -13,4 +11,4 @@ ...@@ -13,4 +11,4 @@
<f:else> <f:else>
<f:translate key="msg.no_entries_found"/> <f:translate key="msg.no_entries_found"/>
</f:else> </f:else>
</f:if> </f:if>
\ No newline at end of file
{namespace terfe2=Tx_TerFe2_ViewHelpers} <html xmlns:terfe2="http://typo3.org/ns/T3o/TerFe2/ViewHelpers">
<f:layout name="Default" /> <f:layout name="Default" />
...@@ -151,7 +151,9 @@ ...@@ -151,7 +151,9 @@
<h3> <h3>
<f:translate key="downloads_by_version" /> <f:translate key="downloads_by_version" />
</h3> </h3>
<terfe2:chart object="{extension}" method="downloadsByVersion" height="220" width="375" pointCount="{settings.defaultPointCount}" renderOnLoad="1" /> <f:format.raw>
<terfe2:chart object="{extension}" method="downloadsByVersion" height="220" width="375" pointCount="{settings.defaultPointCount}" renderOnLoad="1" />
</f:format.raw>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<f:render partial="ExtensionSingleInfo" arguments="{extension:extension, settings:settings, owner:owner, flattrUrl:flattrUrl, documentationLink:documentationLink, qualityLinkNotBroken:qualityLinkNotBroken, urlToQualityServer:urlToQualityServer}" /> <f:render partial="ExtensionSingleInfo" arguments="{extension:extension, settings:settings, owner:owner, flattrUrl:flattrUrl, documentationLink:documentationLink, qualityLinkNotBroken:qualityLinkNotBroken, urlToQualityServer:urlToQualityServer}" />
...@@ -251,3 +253,5 @@ ...@@ -251,3 +253,5 @@
</f:section> </f:section>
</html>
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