Skip to content
This repository was archived by the owner on Feb 20, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/testTYPO3v11.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/testTYPO3v12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v3

- name: Cache composer dependencies
uses: actions/cache@v1
uses: actions/cache@v4
env:
cache-name: cache-composer-dependencies
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "TYPO3 10 Test"
name: "TYPO3 13 Test"

on:
pull_request:
Expand All @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v3

- name: Cache composer dependencies
uses: actions/cache@v1
uses: actions/cache@v4
env:
cache-name: cache-composer-dependencies
with:
Expand All @@ -26,5 +26,6 @@ jobs:
- name: "Run tests"
uses: php-actions/composer@v6
with:
php_version: 7.4
command: run testTYPO3v10
php_version: 8.4
php_extensions: intl
command: run testTYPO3v13
66 changes: 30 additions & 36 deletions Classes/Toolbar/Clock.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,27 @@

use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\View\ViewFactoryData;
use TYPO3\CMS\Core\View\ViewInterface;
use TYPO3\CMS\Fluid\View\FluidViewFactory;

/**
* Clock toolbar class
*/
class Clock implements ToolbarItemInterface {
/**
* @var StandaloneView
*/
protected $view;

/**
* @var PageRenderer
*/
protected $pageRenderer;

class Clock implements ToolbarItemInterface
{
/**
* Constructs the Clock toolbar item
*/
public function __construct()
public function __construct(protected readonly ExtensionConfiguration $extensionConfiguration, protected readonly FluidViewFactory $viewFactory)
{
}

protected function createView(): ViewInterface
{
$this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Oclock/Luxon');
$this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Oclock/Clock');
$this->view = GeneralUtility::makeInstance(StandaloneView::class);
/** @var ExtensionConfiguration $extensionConfiguration */
$extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class);
/** @var array{dashboard:string[],additionalTemplateRootPath:string,additionalPartialRootPath:string,additionalLayoutRootPath:string} $extConf */
$extConf = $extensionConfiguration->get('oclock');
$extConf = $this->extensionConfiguration->get('oclock');
$rootPaths = [
'template' => [
'EXT:oclock/Resources/Private/Templates/'
Expand All @@ -46,26 +36,30 @@ public function __construct()
]
];
if (!empty($extConf['additionalTemplateRootPath'])) {
$templateRootPaths['template'][] = $extConf['additionalTemplateRootPath'];
$rootPaths['template'][] = $extConf['additionalTemplateRootPath'];
}
if (!empty($extConf['additionalPartialRootPath'])) {
$templateRootPaths['partial'][] = $extConf['additionalPartialRootPath'];
$rootPaths['partial'][] = $extConf['additionalPartialRootPath'];
}
if (!empty($extConf['additionalLayoutRootPath'])) {
$templateRootPaths['layout'][] = $extConf['additionalLayoutRootPath'];
$rootPaths['layout'][] = $extConf['additionalLayoutRootPath'];
}
$this->view->setTemplateRootPaths($rootPaths['template']);
$this->view->setPartialRootPaths($rootPaths['partial']);
$this->view->setLayoutRootPaths($rootPaths['layout']);


$viewData = GeneralUtility::makeInstance(
ViewFactoryData::class,
$rootPaths['template'],
$rootPaths['partial'],
$rootPaths['layout']
);
return $this->viewFactory->create($viewData);
}

/**
* Checks the access rights to the Clock ToolbarItem
*
* @return bool
*/
public function checkAccess(): bool
public function checkAccess(): bool
{
return true;
}
Expand All @@ -75,11 +69,11 @@ public function checkAccess(): bool
*
* @return string
*/
public function getItem(): string
public function getItem(): string
{
$this->view->setTemplate('Toolbar/Item');
$this->view->assign('date', new \DateTime());
return $this->view->render();
$view = $this->createView();
$view->assign('date', new \DateTime());
return $view->render('Toolbar/Item');
}

/**
Expand All @@ -99,9 +93,9 @@ public function hasDropDown(): bool
*/
public function getDropDown(): string
{
$this->view->setTemplate('Toolbar/DropDown');
$this->view->assign('date', new \DateTime());
return $this->view->render();
$view = $this->createView();
$view->assign('date', new \DateTime());
return $view->render('Toolbar/DropDown');
}

/**
Expand Down
166 changes: 0 additions & 166 deletions Classes/Widgets/ClockWidget.php

This file was deleted.

10 changes: 10 additions & 0 deletions Configuration/JavaScriptModules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
'dependencies' => [
'backend'
],
'imports' => [
'@the-coding-owl/oclock/' => 'EXT:oclock/Resources/Public/JavaScript/'
]
];
28 changes: 0 additions & 28 deletions Configuration/Services.php

This file was deleted.

Loading
Loading