Commit 470ee9b5 authored by Thomas Löffler's avatar Thomas Löffler

Remove flattr integration completely

parent 2bbe89b4
Pipeline #3935 passed with stages
in 6 minutes and 54 seconds
......@@ -214,40 +214,6 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
);
$otherExtensionsByUser = $this->extensionRepository->findAllOtherFromFrontendUser($extension, $extension->getFrontendUser());
$this->view->assign('extensionsByUser', $otherExtensionsByUser);
// flattr check
if ($extension->getFlattrUsername() !== '') {
// build flattr url with "auto-submit"
$url = 'https://flattr.com/submit/auto?';
// adds username
$url .= '&user_id=' . urlencode($extension->getFlattrUsername());
// adds current url
/** @var \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder */
$uriBuilder = $this->controllerContext->getUriBuilder();
$uriBuilder->setArguments(
array(
'tx_terfe2_pi1' => array(
'action' => 'show',
'extension' => $extension->getUid()
)
)
);
$uriBuilder->setCreateAbsoluteUri(true);
$url .= '&url=' . urlencode($uriBuilder->buildFrontendUri());
// adds title
$url .= '&title=' . urlencode($extension->getLastVersion()->getTitle());
// adds description
$url .= '&description=' . urlencode($extension->getLastVersion()->getDescription());
// adds language
$url .= '&language=en_GB';
// adds tags
// @todo maybe add extension tags from user?
$url .= '&tags=';
// adds hidden tag
$url .= '&hidden=0';
$this->view->assign('flattrUrl', $url);
}
}
}
......
......@@ -72,20 +72,6 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $downloads = 0;
/**
* Flattr username
*
* @var string
*/
protected $flattrUsername = '';
/**
* Flattr data from result
*
* @var string
*/
protected $flattrData = '';
/**
* Creation date
*
......@@ -532,51 +518,6 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
$this->downloads += $downloads;
}
/**
* Setter for flattrUsername
*
* @param string $flattrUsername
* @return void
*/
public function setFlattrUsername(string $flattrUsername)
{
$this->flattrUsername = $flattrUsername;
}
/**
* Getter for flattrUsername
*
* @return string flattr username
*/
public function getFlattrUsername(): string
{
return $this->flattrUsername;
}
/**
* Setter for flattrData
*
* @param string $flattrData
* @return void
*/
public function setFlattrData(string $flattrData)
{
$this->flattrData = $flattrData;
}
/**
* Getter for flattrData
*
* @return string flattr button added
*/
public function getFlattrData(): string
{
return $this->flattrData;
}
/**
* @return \DateTime
*/
......
......@@ -251,7 +251,6 @@ class FileProvider extends \T3o\TerFe2\Provider\AbstractProvider
$extensions[$extension['extkey']]['ext_key'] = $extension['extkey'];
$extensions[$extension['extkey']]['downloads'] = (int)$extension['alldownloadcounter'];
$extensions[$extension['extkey']]['frontend_user'] = $extension['ownerusername'];
$extensions[$extension['extkey']]['flattr_username'] = trim($extension['flattr_username']);
// Versions
$versionString = $extension['version'];
......
<?php
namespace T3o\TerFe2\Service;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Service for flattr buttons
*/
class FlattrService implements \TYPO3\CMS\Core\SingletonInterface
{
/**
* url for checking if a thing exists for an url
*
* @var string
*/
protected $flattrThingCheck = 'https://api.flattr.com/rest/v2/things/lookup/?url=';
/**
* checks if a flattrable thing exists on given url
*
* @param $url
* @return bool|mixed
*/
public function checkForThing($url)
{
$jsonResult = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($this->flattrThingCheck . urlencode($url));
$result = json_decode($jsonResult);
if ($result->type == 'thing' and $result->id != 0) {
return $result;
}
return false;
}
}
......@@ -25,7 +25,6 @@ class ShowJson extends \TYPO3\CMS\Extbase\Mvc\View\AbstractView
*/
protected $internalKeys = array(
'frontendUser',
'flattrUsername',
'crdate',
'reverseVersionsWithPositiveReviewsByVersionNumber',
'reverseVersionsByVersionNumber',
......
......@@ -178,25 +178,6 @@ return array(
'eval' => 'trim',
),
),
'flattr_username' => array(
'exclude' => 1,
'label' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:tx_terfe2_domain_model_extension.flattr_username',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim',
),
),
'flattr_data' => array(
'exclude' => 1,
'label' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:tx_terfe2_domain_model_extension.flattr_data',
'config' => array(
'type' => 'text',
'rows' => 10,
'cols' => 40,
'eval' => 'trim',
),
),
'repository_url' => array(
'exclude' => 1,
'label' => 'LLL:EXT:ter_fe2/Resources/Private/Language/locallang_db.xlf:tx_terfe2_domain_model_extension.repository_url',
......
......@@ -61,14 +61,4 @@
<f:render partial="InlineRelationList" arguments="{relations: extension.lastVersion.conflicts}" />
</dd>
</f:if>
<f:if condition="{flattrUrl}">
<dt>
<f:translate key="donate" />
</dt>
<dd>
<f:link.external uri="{flattrUrl}" target="_blank"><img
src="https://button.flattr.com/flattr-badge-large.png"
alt="{f:translate(key:'donate')}" /></f:link.external>
</dd>
</f:if>
</dl>
......@@ -48,18 +48,6 @@
</div>
</div>
<div class="form-group row">
<label for="flattrUsername" class="col-3 col-form-label">
flattr username<br />
<span class="small">
<f:link.external uri="http://wiki.typo3.org/How_to_add_flattr_to_TER" target="_blank">[How to set up flattr]</f:link.external>
</span>
</label>
<div class="col-9">
<f:form.textfield class="form-control" id="flattrUsername" property="flattrUsername" additionalAttributes="{placeholder:'Put in your flattr username'}" />
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label" for="tags">Tags</label>
<div class="col-9">
......
......@@ -14,8 +14,6 @@ CREATE TABLE tx_terfe2_domain_model_extension (
last_version int(11) unsigned DEFAULT '0' NOT NULL,
frontend_user tinytext,
downloads int(11) unsigned DEFAULT '0' NOT NULL,
flattr_username varchar(100) DEFAULT '' NOT NULL,
flattr_data text DEFAULT '' NOT NULL,
repository_url varchar(255) DEFAULT '' NOT NULL,
repository_clone_url varchar(255) DEFAULT '' NOT NULL,
external_manual varchar(255) DEFAULT '' NOT NULL,
......
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