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

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
//$documentationLink = $documentationService->getDocumentationLink($extension->getExtKey(), $extension->getLastVersion()->getVersionString());
$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) {
$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
......@@ -237,7 +238,7 @@ class Tx_TerFe2_Controller_ExtensionController extends Tx_TerFe2_Controller_Abst
// adds username
$url .= '&user_id=' . urlencode($extension->getFlattrUsername());
// adds current url
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
/** @var \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder */
$uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->setArguments(
array(
......
......@@ -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->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
/**
* Get versions reverse sorted by version number
*
* @return array Versions
* @return array|\Tx_TerFe2_Domain_Model_Version[] Versions
*/
public function getReverseVersionsByVersionNumber()
{
......
<?php
namespace T3o\TerFe2\ViewHelpers;
/*******************************************************************
* Copyright notice
*
......@@ -28,7 +30,7 @@
*
* 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
// Check object type
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
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
$method = 'get' . ucfirst(trim($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
......@@ -108,11 +110,11 @@ class Tx_TerFe2_ViewHelpers_ChartViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHe
/**
* 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
* @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();
$versions = $extension->getReverseVersionsByVersionNumber();
......
<?php
namespace T3o\TerFe2\ViewHelpers;
/*******************************************************************
* Copyright notice
*
......@@ -26,7 +28,7 @@
/**
* 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
}
if (empty($dateTime)) {
$dateTime = new DateTime;
$dateTime = new \DateTime;
}
if (is_int($dateTime) || is_string($dateTime)) {
return date($format, (int)$dateTime);
}
if ($dateTime instanceof DateTime) {
if ($dateTime instanceof \DateTime) {
return $dateTime->format($format);
}
......
<?php
namespace T3o\TerFe2\ViewHelpers;
/*******************************************************************
* Copyright notice
*
......@@ -26,7 +28,7 @@
/**
* 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
protected $tagName = 'img';
/**
* @var Tx_TerFe2_Provider_ProviderManager
* @var \Tx_TerFe2_Provider_ProviderManager
* @inject
*/
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
*
......@@ -68,11 +58,11 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor
/**
* 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
* @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) {
$version = $this->renderChildren();
......@@ -82,12 +72,12 @@ class Tx_TerFe2_ViewHelpers_ExtensionIconViewHelper extends \TYPO3\CMS\Fluid\Cor
$provider = $version->getExtensionProvider();
if (!empty($provider)) {
$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');
}
}
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');
}
......
<?php
namespace T3o\TerFe2\ViewHelpers;
/*******************************************************************
* Copyright notice
*
......@@ -26,7 +28,7 @@
/**
* 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
namespace T3o\TerFe2\ViewHelpers;
/*******************************************************************
* Copyright notice
*
......@@ -26,7 +28,7 @@
/**
* 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
}
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)) {
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)) {
......
<?php
namespace T3o\TerFe2\ViewHelpers;
/*******************************************************************
* Copyright notice
*
......@@ -26,7 +28,7 @@
/**
* 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_messages">
<f:flashMessages renderMode="div"/>
<f:flashMessages />
</div>
<div class="tx_terfe2_content">
<f:render section="main"/>
</div>
</div>
\ No newline at end of file
</div>
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{authors}">
<f:then>
<f:widget.paginate objects="{authors}" as="paginateAuthors"
......@@ -17,4 +15,4 @@
<f:else>
<f:translate key="msg.no_entries_found"/>
</f:else>
</f:if>
\ No newline at end of file
</f:if>
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{extensions}">
<f:then>
<div class="ter-ext-list-count">
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:for each="{extensions}" as="extension">
<item>
<title><terfe2:cdata>{extension.lastVersion.title} [{extension.extKey}] (v{extension.lastVersion.versionString})</terfe2:cdata></title>
......@@ -9,4 +7,4 @@
<content:encoded><terfe2:cdata>{extension.lastVersion.uploadComment}</terfe2:cdata></content:encoded>
<pubDate><terfe2:dateTime format="{settings.rssOutput.dateFormat}">{extension.lastVersion.uploadDate}</terfe2:dateTime></pubDate>
</item>
</f:for>
\ No newline at end of file
</f:for>
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<div class="ter-ext-list-search">
<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}"/>
......@@ -15,4 +13,4 @@
}"/>
</span>
</form>
</div>
\ No newline at end of file
</div>
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<dl class="row">
<dt class="col-sm-3"><f:translate key="version" /></dt>
<dd class="col-sm-9">{extension.lastVersion.versionString}</dd>
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<table class="table table-hover">
<thead>
<tr>
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{relations}">
<f:then>
<ul class="list-unstyled mb-0">
......
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<f:if condition="{tags}">
<f:then>
<ul>
......@@ -13,4 +11,4 @@
<f:else>
<f:translate key="msg.no_entries_found"/>
</f:else>
</f:if>
\ No newline at end of file
</f:if>
{namespace terfe2=Tx_TerFe2_ViewHelpers}
<html xmlns:terfe2="http://typo3.org/ns/T3o/TerFe2/ViewHelpers">
<f:layout name="Default" />
......@@ -151,7 +151,9 @@
<h3>
<f:translate key="downloads_by_version" />
</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 class="col-md-6">
<f:render partial="ExtensionSingleInfo" arguments="{extension:extension, settings:settings, owner:owner, flattrUrl:flattrUrl, documentationLink:documentationLink, qualityLinkNotBroken:qualityLinkNotBroken, urlToQualityServer:urlToQualityServer}" />
......@@ -251,3 +253,5 @@
</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