Completed
Push — develop ( d6d5e2...840c69 )
by
unknown
03:35
created

BackendController::detailAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
dl 0
loc 12
rs 9.4285
c 5
b 0
f 0
cc 1
eloc 7
nc 1
nop 2
1
<?php
2
3
/**
4
 * Class BackendController
5
 */
6
7
namespace HDNET\OnpageIntegration\Controller;
8
9
use HDNET\OnpageIntegration\Provider\MetaDataProvider;
10
use TYPO3\CMS\Core\Utility\GeneralUtility;
11
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
12
13
/**
14
 * Class BackendController
15
 */
16
class BackendController extends ActionController
17
{
18
19
    /**
20
     * @var \HDNET\OnpageIntegration\Loader\ApiResultLoader
21
     * @inject
22
     */
23
    protected $loader;
24
25
    /**
26
     * Represent the index page
27
     */
28
    public function indexAction()
29
    {
30
        $metaDataProvider = GeneralUtility::makeInstance(MetaDataProvider::class);
31
32
        $this->view->assignMultiple([
33
            'lastCrawl'         => $this->loader->load('zoom_lastcrawl'),
34
            'seoMetaData'       => $metaDataProvider->getMetaData('seoaspects'),
35
            'contentMetaData'   => $metaDataProvider->getMetaData('contentaspects'),
36
            'technicalMetaData' => $metaDataProvider->getMetaData('technicalaspects'),
37
            'moduleName'        => 'Zoom Module'
38
        ]);
39
    }
40
41
    /**
42
     * Handle the detail pages
43
     *
44
     * @param $section
45
     * @param $call
46
     */
47
    public function detailAction($section, $call)
48
    {
49
        $apiCallString = 'zoom_' . $section . '_' . $call . '_table';
50
        $table = $this->loader->load($apiCallString);
51
52
        $layout = ucfirst(str_replace('aspects', '', $section));
53
54
        $this->view->assignMultiple([
55
            'table'      => $table,
56
            'layout'     => $layout
57
        ]);
58
    }
59
60
    /**
61
     * Empty Keyword Page
62
     */
63
    public function keywordAction()
64
    {
65
        $this->view->assignMultiple([
66
            'moduleName' => 'Keyword'
67
        ]);
68
    }
69
}
70