Passed
Push — master ( 93a20b...7b7bce )
by Aimeos
75:55 queued 51s
created

SupplierController::removeMetatags()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 15
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 11
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 15
rs 9.9
1
<?php
2
3
/**
4
 * @license GPLv3, http://www.gnu.org/copyleft/gpl.html
5
 * @copyright Metaways Infosystems GmbH, 2012
6
 * @copyright Aimeos (aimeos.org), 2014-2020
7
 * @package TYPO3
8
 */
9
10
11
namespace Aimeos\Aimeos\Controller;
12
13
14
use Aimeos\Aimeos\Base;
15
use TYPO3\CMS\Core\Utility\GeneralUtility;
16
17
18
/**
19
 * Aimeos supplier controller.
20
 *
21
 * @package TYPO3
22
 */
23
class SupplierController extends AbstractController
24
{
25
	/**
26
	 * Renders the supplier detail section.
27
	 */
28
	public function detailAction()
29
	{
30
		$this->removeMetatags();
31
		$client = \Aimeos\Client\Html::create( $this->getContext(), 'supplier/detail' );
32
		return $this->getClientOutput( $client );
33
	}
34
35
36
	/**
37
	 * Removes the meta tags if available
38
	 */
39
	protected function removeMetatags()
40
	{
41
		if( class_exists( '\TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry' )
42
			&& !\Aimeos\Aimeos\Base::getExtConfig( 'typo3Metatags', true )
43
		) {
44
			$registry = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry' );
45
46
			$registry->getManagerForProperty( 'keywords' )->removeProperty( 'keywords' );
47
			$registry->getManagerForProperty( 'description' )->removeProperty( 'description' );
48
			$registry->getManagerForProperty( 'og:type' )->removeProperty( 'og:type' );
49
			$registry->getManagerForProperty( 'og:title' )->removeProperty( 'og:title' );
50
			$registry->getManagerForProperty( 'og:url' )->removeProperty( 'og:url' );
51
			$registry->getManagerForProperty( 'og:description' )->removeProperty( 'og:description' );
52
			$registry->getManagerForProperty( 'og:image' )->removeProperty( 'og:image' );
53
			$registry->getManagerForProperty( 'twitter:card' )->removeProperty( 'twitter:card' );
54
		}
55
	}
56
}
57