Skip to content

Commit

Permalink
[WIP][FEATURE] Synchronization status
Browse files Browse the repository at this point in the history
  • Loading branch information
christianfutterlieb committed Feb 10, 2024
1 parent c0c70f2 commit 8cb739b
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
59 changes: 59 additions & 0 deletions Classes/Role/SynchronizationStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

declare(strict_types=1);

namespace AawTeam\BackendRoles\Role;

/*
* Copyright by Agentur am Wasser | Maeder & Partner AG
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/

use AawTeam\BackendRoles\Exception\RoleDefinitionException;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;

/**
* SynchronizationStatus
*/
class SynchronizationStatus
{
public const NOT_SYNCED = 0;
public const OUT_OF_SYNC = 1;
public const SYNC_OK = 2;

public function typeIconUserFunction(array $parameters): string
{
$row = $parameters['row'];
return 'actions-synchronize';
return 'status-user-admin';
}

// protected int $status;

// public function __construct(int $status)
// {
// if (!in_array($status, [self::NOT_SYNCED, self::OUT_OF_SYNC, self::SYNC_OK])) {
// throw new \InvalidArgumentException('Invalid status: ' . $status);
// }
// $this->status = $status;
// }

// public function isSynced(): bool
// {
// $this->status !== self::NOT_SYNCED;
// }

// public function isOutOfSync(): bool
// {
// $this->status === self::OUT_OF_SYNC;
// }

// public function isSyncOk(): bool
// {
// $this->status === self::SYNC_OK;
// }
}
3 changes: 3 additions & 0 deletions Configuration/TCA/Overrides/be_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_groups', $columns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_groups', 'tx_backendroles_role_identifier', '', 'after:title');

$GLOBALS['TCA']['be_groups']['ctrl']['typeicon_column'] = 'no-sir';
$GLOBALS['TCA']['be_groups']['ctrl']['typeicon_classes']['userFunc'] = \AawTeam\BackendRoles\Role\SynchronizationStatus::class . '->typeIconUserFunction';

// Load extension configuration
$extConf = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
Expand Down

0 comments on commit 8cb739b

Please sign in to comment.