Commit e355f6d9 authored by mabolek's avatar mabolek Committed by Thomas Löffler
Browse files

[WIP] Basic testing plugin for displaying test data 

parent d8da53fb
<?php
defined('TYPO3_MODE') or die('Access denied.');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'T3o.' . $_EXTKEY,
'KarmaControl',
[
'Manager' => 'test',
],
[
'Manager' => 'test',
]
);
......@@ -6,3 +6,8 @@ defined('TYPO3_MODE') or die('Access denied.');
'Configuration/TypoScript',
'Karma Services'
);
/*
* FE Plugin
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('T3o.' . $_EXTKEY, 'KarmaControl', 'Karma Manager');
<?php
namespace T3o\Karma\Controller;
use T3o\Karma\Service\KarmaService;
use TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository;
/***************************************************************
* Copyright notice
*
* (c) 2018
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class ManagerController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* @var KarmaService
*/
protected $karmaService;
/**
* @var FrontendUserRepository
*/
protected $frontendUserRepository;
/**
* @param KarmaService $karmaService
*/
public function injectKarmaService(KarmaService $karmaService)
{
$this->karmaService = $karmaService;
}
/**
* @param FrontendUserRepository $frontendUserRepository
*/
public function injectFrontendUserRepository(FrontendUserRepository $frontendUserRepository)
{
$this->frontendUserRepository = $frontendUserRepository;
}
/**
* The test action
*/
public function testAction() {
$frontendUser = $this->frontendUserRepository->findByUid(1);
$valueReturned = $this->karmaService->getImmutableKarmaForUser($frontendUser, true, true);
var_dump($valueReturned);
}
}
Supports Markdown
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