Commit a7cf7fdd authored by Stefan Busemann's avatar Stefan Busemann

[TASK] Add repository, model and base views

parent bcb2dbd4
Pipeline #2965 failed with stages
in 1 minute and 13 seconds
<?php
declare(strict_types=1);
namespace T3o\T3omy\Controller;
use T3o\T3omy\Domain\Repository\MyProfileRepository;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
/**
* Class UserController
*/
class MyProfileController extends ActionController
{
/**
* @var MyProfileRepository
*/
public $myProfileRepository;
/**
* @var persistenceManager
*/
public $persistenceManager;
/**
* @param MyProfileRepository $myProfileRepository
*/
public function injectUserProfileRepository(MyProfileRepository $myProfileRepository)
{
$this->myProfileRepository = $myProfileRepository;
}
/**
* @param PersistenceManager $persistenceManager
*/
public function injectPersistenceManager(PersistenceManager $persistenceManager)
{
$this->persistenceManager = $persistenceManager;
}
public function showAction () {
}
public function editAction () {
}
public function updateAction () {
}
}
<?php
declare(strict_types=1);
namespace T3o\T3omy\Domain\Model;
use TYPO3\CMS\Extbase\Domain\Model\FrontendUser;
/**
* Class UserProfileRepository
*/
class MyProfile extends FrontendUser
{
}
<?php
declare(strict_types=1);
namespace T3o\T3omy\Domain\Repository;
use TYPO3\CMS\Extbase\Persistence\Repository;
/**
* Class UserProfileRepository
*/
class MyProfileRepository extends Repository
{
}
<?php
/**
* Table configuration fe_users
*/
$feUsersColumns = [
'privacy_settings' => [
'exclude' => 0,
'label' => 'Privacy settings',
'config' => [
'type' => 'text',
]
],
];
$fields = 'privacy_settings,about_me,';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'fe_users',
'privacy_settings,',
'',
'after:name'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $feUsersColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
'fe_users',
'--div--;LLL:EXT:femanager/Resources/Private/Language/locallang_db.xlf:fe_users.tab, ' . $fields
);
plugin.tx_t3omy {
view {
templateRootPath = {$plugin.tx_userprofile.view.templateRootPath}
partialRootPath = {$plugin.tx_userprofile.view.partialRootPath}
layoutRootPath = {$plugin.tx_userprofile.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_userprofile.persistence.storagePid}
}
features {
# uncomment the following line to enable the new Property Mapper.
# rewrittenPropertyMapper = 1
}
slackbot {
webhook {
securityToken =
......
plugin.tx_userprofile {
settings {
privacy {
_default {
public = 0
authenticated = 0
groups = 0
}
#column_name = 1 activates the setting for the user
slack_id = 1
githubProfile = 1
twitter = 1
facebook = 1
}
}
}
<svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-miterlimit="1.414" viewBox="0 0 64 64" width="64" height="64">
<path fill="#ff8700" fill-rule="nonzero" d="M46.37 42.73c-.84.247-1.51.34-2.39.34-7.205 0-17.784-25.177-17.784-33.556 0-3.085.73-4.114 1.76-4.997-8.817 1.03-19.397 4.265-22.78 8.378C4.446 13.925 4 15.54 4 17.6c0 13.08 13.962 42.76 23.81 42.76 4.558 0 12.24-7.49 18.56-17.633m-4.6-39.09c9.113 0 18.23 1.47 18.23 6.613 0 10.434-6.617 23.08-9.995 23.08-6.027 0-13.522-16.76-13.522-25.14 0-3.82 1.47-4.552 5.288-4.552"/>
</svg>
......@@ -4,21 +4,22 @@
************************************************************************/
$EM_CONF[$_EXTKEY] = array(
'title' => 't3olayout for my TYPO3',
'description' => 'Base extension for project my.typo3.org layout and specific functions',
'description' => 'Base extension for project my.typo3.org condfiguration, userprofile and specific functions',
'category' => 'extension',
'constraints' => array(
'depends' => array(
'typo3' => '8.7.0-8.99.99',
't3olayout' => '0.1.0-',
't3o_slack' => '0.1.0-',
'fluid_styled_content' => '7.6.0-8.99.99'
'fluid_styled_content' => '7.6.0-8.99.99',
'userprofile'=> '0.0.1-',
),
'conflicts' => array(
),
),
'autoload' => array(
'psr-4' => array(
'T3o\\T3olayout\\' => 'Classes'
'T3o\\T3omy\\' => 'Classes'
),
),
'state' => 'beta',
......@@ -28,5 +29,5 @@ $EM_CONF[$_EXTKEY] = array(
'author' => 'Stefan Busemann',
'author_email' => 'stefan.busemann@typo3.org',
'author_company' => 'typo3',
'version' => '0.2.0',
'version' => '0.3.0',
);
......@@ -3,6 +3,18 @@ if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'T3o.' . $_EXTKEY,
'Pi1',
[
'MyProfile' => 'show, edit, update',
],
[
'MyProfile' => 'edit, update',
]
);
#######################################
###
#######################################
......
......@@ -14,3 +14,20 @@ $iconRegistry->registerIcon(
['source' => 'EXT:t3omy/Resources/Public/Icons/Extension.svg']
);
/**
* FE Plugin
*/
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin('T3o.' . $_EXTKEY, 'Pi1', 'Show and Edit profile for a Frontend User');
/**
* Static TypoScript
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript',
'Main settings for my Userprofile (additional fields)');
/**
* Disable non needed fields in tt_content
*/
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['myprofile_pi1'] = 'select_key';
#
# Table structure for table 'fe_users'
#
CREATE TABLE fe_users (
github_profile = VARCHAR (255),
twitter = VARCHAR (255),
facebook = VARCHAR (255),
);
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