Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
t3o
my.typo3.org
Commits
f4191d7f
Commit
f4191d7f
authored
Nov 05, 2018
by
mabolek
Browse files
[TASK] Adding new plugin shells
parent
dd7d0b04
Pipeline
#5610
failed with stages
in 12 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
html/typo3conf/ext/karma/Classes/Controller/AbstractController.php
0 → 100644
View file @
f4191d7f
<?php
namespace
T3o\Karma\Controller
;
use
T3o\Karma\Domain\Repository\KarmaSourceRepository
;
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
AbstractController
extends
\
TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
/**
* @var KarmaService
*/
protected
$karmaService
;
/**
* @var FrontendUserRepository
*/
protected
$frontendUserRepository
;
/**
* @var KarmaSourceRepository
*/
protected
$karmaSourceRepository
;
/**
* @param KarmaService $karmaService
*/
public
function
injectKarmaService
(
KarmaService
$karmaService
)
{
$this
->
karmaService
=
$karmaService
;
}
/**
* @param FrontendUserRepository $frontendUserRepository
*/
public
function
injectFrontendUserRepository
(
FrontendUserRepository
$frontendUserRepository
)
{
$this
->
frontendUserRepository
=
$frontendUserRepository
;
}
/**
* @param KarmaSourceRepository $karmaSourceRepository
*/
public
function
injectKarmaSourceRepository
(
KarmaSourceRepository
$karmaSourceRepository
)
{
$this
->
karmaSourceRepository
=
$karmaSourceRepository
;
}
}
html/typo3conf/ext/karma/Classes/Controller/ManagerController.php
0 → 100644
View file @
f4191d7f
<?php
namespace
T3o\Karma\Controller
;
/***************************************************************
* 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
AbstractController
{
/**
* The test action
*/
public
function
testAction
()
{
$frontendUser
=
$this
->
frontendUserRepository
->
findByUid
(
1
);
$karmaSource
=
$this
->
karmaSourceRepository
->
findByUid
(
1
);
$this
->
karmaService
->
addKarmaToUser
(
12
,
$frontendUser
,
$karmaSource
);
$valueReturned
=
$this
->
karmaService
->
getImmutableKarmaForUser
(
$frontendUser
,
true
,
true
);
var_dump
(
$valueReturned
);
}
}
html/typo3conf/ext/karma/Classes/Controller/UserDisplayController.php
0 → 100644
View file @
f4191d7f
<?php
namespace
T3o\Karma\Controller
;
/***************************************************************
* 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
UserDisplayController
extends
AbstractController
{
/**
* Lists karma ledger entries for the currently logged-in user
*/
public
function
listAction
()
{
}
/*
* Shows a small karma earned widget for the currently logged-in user
*/
public
function
statusWidgetAction
()
{
}
}
html/typo3conf/ext/karma/ext_localconf.php
View file @
f4191d7f
<?php
defined
(
'TYPO3_MODE'
)
or
die
(
'Access denied.'
);
\
TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
configurePlugin
(
'T3o.'
.
$_EXTKEY
,
'KarmaControl'
,
[
'Manager'
=>
'test'
,
],
[
'Manager'
=>
'test'
,
]
);
\
TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
configurePlugin
(
'T3o.'
.
$_EXTKEY
,
'UserKarmaList'
,
[
'UserDisplay'
=>
'list'
,
],
[
'UserDisplay'
=>
''
,
]
);
\
TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
configurePlugin
(
'T3o.'
.
$_EXTKEY
,
'UserKarmaWidget'
,
[
'UserDisplay'
=>
'statusWidget'
,
],
[
'UserDisplay'
=>
''
,
]
);
html/typo3conf/ext/karma/ext_tables.php
View file @
f4191d7f
...
...
@@ -6,3 +6,10 @@ defined('TYPO3_MODE') or die('Access denied.');
'Configuration/TypoScript'
,
'Karma Services'
);
/*
* FE Plugin
*/
\
TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
registerPlugin
(
'T3o.'
.
$_EXTKEY
,
'KarmaControl'
,
'Karma Manager'
);
\
TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
registerPlugin
(
'T3o.'
.
$_EXTKEY
,
'UserKarmaList'
,
'Karma List for Users'
);
\
TYPO3\CMS\Extbase\Utility\ExtensionUtility
::
registerPlugin
(
'T3o.'
.
$_EXTKEY
,
'UserKarmaWidget'
,
'Karma Widget for Users'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment