├── Tests ├── Unit │ ├── Logger │ │ ├── Logs │ │ │ ├── TestLog.log │ │ │ └── Exceptions │ │ │ │ └── dummy │ │ └── Expected │ │ │ └── Exception.txt │ ├── State │ │ ├── Session │ │ │ └── Storage │ │ │ │ ├── DBAdapterFactoryTest.php │ │ │ │ ├── DBAdapterTest.php │ │ │ │ └── SessionAdapterTest.php │ │ └── Stubs │ │ │ └── SessionAdapterMock.php │ ├── Rbac │ │ └── AllowAllServiceTest.php │ ├── Utility │ │ ├── AjaxDispatcherTest.php │ │ └── Wget │ │ │ ├── WgetLogEntryTest.php │ │ │ └── TestData │ │ │ └── WgetTest.log │ ├── ViewHelpers │ │ ├── Format │ │ │ ├── FileSizeViewHelperTest.php │ │ │ └── CssNameViewHelperTest.php │ │ └── Tree │ │ │ └── SelectorViewHelperTest.php │ └── Lifecycle │ │ └── HookManagerTest.php └── Functional │ └── Logger │ └── ExpectedErrorMail.txt ├── Documentation ├── En │ ├── Admin │ │ ├── Integration │ │ │ ├── Modules │ │ │ │ └── Index.rst │ │ │ ├── Index.rst │ │ │ ├── Plugins │ │ │ │ └── Index.rst │ │ │ ├── TypoScript │ │ │ │ └── Index.rst │ │ │ ├── ExtensionManager │ │ │ │ └── Index.rst │ │ │ └── Scheduler │ │ │ │ └── Index.rst │ │ └── Index.rst │ ├── Developer │ │ ├── SqlGenerator.png │ │ ├── SqlGenerator.rst │ │ ├── Database │ │ │ └── Index.rst │ │ ├── Index.rst │ │ ├── Assertions.rst │ │ ├── ClassDiagrams │ │ │ └── Index.rst │ │ ├── Utility.rst │ │ └── Controller.rst │ ├── Interface │ │ └── Index.rst │ ├── General │ │ └── Index.rst │ ├── ChangeLog.rst │ └── Index.rst └── Manual.pdf ├── .gitignore ├── Resources ├── Public │ ├── Icons │ │ └── relation.gif │ ├── jstree │ │ └── themes │ │ │ ├── apple │ │ │ ├── d.png │ │ │ ├── bg.jpg │ │ │ ├── throbber.gif │ │ │ └── dot_for_ie.gif │ │ │ ├── classic │ │ │ ├── d.gif │ │ │ ├── d.png │ │ │ ├── throbber.gif │ │ │ └── dot_for_ie.gif │ │ │ ├── default │ │ │ ├── d.gif │ │ │ ├── d.png │ │ │ └── throbber.gif │ │ │ └── default-rtl │ │ │ ├── d.gif │ │ │ ├── d.png │ │ │ ├── dots.gif │ │ │ └── throbber.gif │ └── CSS │ │ └── Backend.css └── Private │ ├── Templates │ ├── Scheduler │ │ └── SqlRunner │ │ │ └── TaskAdditionalFields.html │ ├── Debug │ │ └── Debug.html │ ├── Tca │ │ ├── Tree.html │ │ └── TcaDebug.html │ └── Logger │ │ └── ErrorEmail.html │ ├── Language │ ├── locallang.xml │ └── locallang_db.xml │ └── JSTemplates │ └── Tree │ └── SelectTree.js ├── Configuration ├── Extbase │ └── Persistence │ │ └── Classes.php ├── Backend │ └── AjaxRoutes.php ├── TCA │ └── Overrides │ │ └── pages.php ├── TypoScript │ ├── constants.txt │ └── setup.txt └── Services.yaml ├── ext_conf_template.txt ├── Classes ├── Tree │ ├── TreeStorageInterface.php │ ├── ExtJsJsonTreeWriter.php │ ├── NestedSetTreeInterface.php │ ├── NodeRepositoryInterface.php │ ├── TraversableInterface.php │ ├── TreeBuilderInterface.php │ ├── JSTreeJsonTreeWriter.php │ ├── JSArrayTreeWriter.php │ ├── TreeWalkerVisitorInterface.php │ ├── JSArrayTreeWriterVisitor.php │ ├── JSTreeJsonWriterVisitor.php │ ├── NestedSetNodeInterface.php │ ├── NestedSetVisitor.php │ ├── JsonTreeWriter.php │ ├── ArrayTreeWriter.php │ ├── Stack.php │ └── TreeContext.php ├── ViewHelpers │ ├── ClassConstantViewHelper.php │ ├── StringComparisonViewHelper.php │ ├── Condition │ │ └── IsArrayViewHelper.php │ ├── IsNumericViewHelper.php │ ├── ImplodeViewHelper.php │ ├── RedirectToPageIdViewHelper.php │ ├── ShortLinkViewHelper.php │ ├── ExplodeViewHelper.php │ ├── Format │ │ ├── RemoveSpacesBetweenTagsViewHelper.php │ │ ├── CssNameViewHelper.php │ │ ├── FileSizeViewHelper.php │ │ ├── HighlightViewHelper.php │ │ ├── StringToLowerViewHelper.php │ │ ├── StringToUpperViewHelper.php │ │ └── RemoveLineBreaksViewHelper.php │ ├── MergeArgumentsViewHelper.php │ ├── CaptchaViewHelper.php │ ├── CommentViewHelper.php │ ├── RequestArgumentsViewHelper.php │ ├── CObjectConfigViewHelper.php │ ├── Be │ │ └── TceLinkViewHelper.php │ └── Uri │ │ └── CurrentViewHelper.php ├── Logger │ ├── Writer │ │ └── FileWriter.php │ ├── Processor │ │ ├── SwitchRequestIdProcessor.php │ │ └── ReplaceComponentProcessor.php │ └── Backend │ │ └── FileWriter.php_ignore ├── Exception │ ├── ConfigurationException.php │ ├── LoggerException.php │ ├── InternalException.php │ └── Assertion.php ├── Testing │ └── Selenium │ │ ├── BaseFramework.php │ │ └── FixtureFramework │ │ ├── BaseTestcase.php │ │ └── Tx_PtExtbase_Testing_Selenium_FixtureFramework_FixtureImporter.php ├── Lifecycle │ ├── HookManager.php │ └── EventInterface.php ├── Configuration │ ├── ConfigurationInterface.php │ ├── ConfigurationFactoryInterface.php │ └── ConfigurationBuilderInterface.php ├── Utility │ ├── Lock │ │ ├── LockNotAcquiredException.php │ │ └── LockStrategyInterface.php │ ├── Git │ │ ├── GitException.php │ │ ├── Result │ │ │ ├── PushResult.php │ │ │ └── Result.php │ │ ├── Command │ │ │ ├── Remote │ │ │ │ ├── RemoveCommand.php │ │ │ │ └── AddCommand.php │ │ │ ├── VoidCommand.php │ │ │ ├── AddCommand.php │ │ │ ├── InitCommand.php │ │ │ └── CommitCommand.php │ │ └── GitExecutionManager.php │ ├── Varnish │ │ ├── VarnishAdministrationException.php │ │ └── Result │ │ │ └── Result.php │ ├── GenericShellCommandWrapper │ │ ├── ComponentInterface.php │ │ └── ResultObjectStorage.php │ ├── ServerInformation.php │ ├── RealUrl │ │ └── UrlDecoder.php │ ├── TimeTracker.php │ └── FeBeModeDetector.php ├── Domain │ ├── Repository │ │ ├── TTContentRepository.php │ │ ├── CategoryRepository.php │ │ └── SysLanguageRepository.php │ ├── Model │ │ └── TTContent.php │ └── Validator │ │ └── CaptchaStringValidator.php ├── Collection │ └── SortableEntityInterface.php ├── SignalSlot │ └── Exception │ │ └── InvalidSlotException.php ├── SqlRunner │ └── SqlRunnerInterface.php ├── SqlGenerator │ ├── SqlGeneratorCommandInterface.php │ ├── SqlGeneratorInterface.php │ └── SqlFileSqlGenerator.php ├── Rbac │ ├── RbacServiceInterface.php │ ├── RbacService.php │ └── AllowAllService.php ├── State │ ├── GpVars │ │ └── GpVarsInjectableInterface.php │ ├── IdentifiableInterface.php │ └── Session │ │ ├── SessionPersistableInterface.php │ │ └── Storage │ │ └── AdapterInterface.php ├── ContextInterface.php └── Extbase │ └── Bootstrap.php ├── ExtensionBuilder.json ├── ext_tables.php ├── ext_icon.svg ├── composer.json ├── ext_localconf.php ├── Migrations └── Code │ └── ClassAliasMap.php └── ext_tables.sql /Tests/Unit/Logger/Logs/TestLog.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Tests/Unit/Logger/Logs/Exceptions/dummy: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Documentation/En/Admin/Integration/Modules/Index.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | *.*~ 3 | !.gitignore 4 | changeRevision.php 5 | /Tests/Functional/Logger/Logs/ 6 | -------------------------------------------------------------------------------- /Documentation/Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Documentation/Manual.pdf -------------------------------------------------------------------------------- /Documentation/En/Admin/Index.rst: -------------------------------------------------------------------------------- 1 | Administration 2 | ================= 3 | 4 | .. include:: Integration/Index.rst 5 | -------------------------------------------------------------------------------- /Documentation/En/Admin/Integration/Index.rst: -------------------------------------------------------------------------------- 1 | Integration 2 | =========== 3 | 4 | .. include:: Scheduler/Index.rst 5 | -------------------------------------------------------------------------------- /Resources/Public/Icons/relation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/Icons/relation.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/apple/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/apple/d.png -------------------------------------------------------------------------------- /Documentation/En/Admin/Integration/Plugins/Index.rst: -------------------------------------------------------------------------------- 1 | ~~~~~~~ 2 | Plugins 3 | ~~~~~~~ 4 | 5 | The extension doesn't provide any plugin. 6 | -------------------------------------------------------------------------------- /Documentation/En/Admin/Integration/TypoScript/Index.rst: -------------------------------------------------------------------------------- 1 | ~~~~~~~~~~~~~~~~~~~~~~~~ 2 | TypoScript-Konfiguration 3 | ~~~~~~~~~~~~~~~~~~~~~~~~ 4 | -------------------------------------------------------------------------------- /Documentation/En/Developer/SqlGenerator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Documentation/En/Developer/SqlGenerator.png -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/apple/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/apple/bg.jpg -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/classic/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/classic/d.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/classic/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/classic/d.png -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default/d.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default/d.png -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/apple/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/apple/throbber.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default-rtl/d.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default-rtl/d.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default-rtl/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default-rtl/d.png -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/apple/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/apple/dot_for_ie.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/classic/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/classic/throbber.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default-rtl/dots.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default-rtl/dots.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default/throbber.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/classic/dot_for_ie.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/classic/dot_for_ie.gif -------------------------------------------------------------------------------- /Resources/Public/jstree/themes/default-rtl/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/punktDe/pt_extbase/HEAD/Resources/Public/jstree/themes/default-rtl/throbber.gif -------------------------------------------------------------------------------- /Resources/Private/Templates/Scheduler/SqlRunner/TaskAdditionalFields.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Documentation/En/Interface/Index.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^ 2 | 4. Schnittstellen 3 | ^^^^^^^^^^^^^^^^^ 4 | 5 | Die Extension bindet keine Schnittstellen ein und stellt keine Schnittstellen zur Verfügung. -------------------------------------------------------------------------------- /Configuration/Extbase/Persistence/Classes.php: -------------------------------------------------------------------------------- 1 | [ 7 | 'tableName' => 'pages', 8 | ], 9 | ]; 10 | -------------------------------------------------------------------------------- /Documentation/En/Admin/Integration/ExtensionManager/Index.rst: -------------------------------------------------------------------------------- 1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 | Konfiguration im Extension-Manager 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | Diese Extension hat keine Konfigurationsoptionen. -------------------------------------------------------------------------------- /Documentation/En/General/Index.rst: -------------------------------------------------------------------------------- 1 | General Information 2 | =================== 3 | 4 | pt_extbase provides different extensions and utilities for extbase developers. It also includes a set of viewHelpers for use in many purposes. -------------------------------------------------------------------------------- /Documentation/En/Developer/SqlGenerator.rst: -------------------------------------------------------------------------------- 1 | Sql Generator 2 | ------------- 3 | 4 | The Sql Generator is implemented with the Command-Pattern and is expected to return an array of single SQL commands: 5 | 6 | .. figure:: Developer/SqlGenerator.png 7 | :scale: 140 % 8 | -------------------------------------------------------------------------------- /Documentation/En/Developer/Database/Index.rst: -------------------------------------------------------------------------------- 1 | Datenbank-Modell 2 | ^^^^^^^^^^^^^^^^ 3 | 4 | Das Datenbank-Modell entspricht dem Model der Extension. Per Konvention aus Extbase sind die Namen folgendermaßen aufgebaut: 5 | 6 | ``tx_ptcertification_domain_model_`` 7 | -------------------------------------------------------------------------------- /Documentation/En/Developer/Index.rst: -------------------------------------------------------------------------------- 1 | Development 2 | ============== 3 | 4 | .. include:: ViewHelper/Index.rst 5 | 6 | .. include:: Assertions.rst 7 | 8 | .. include:: Configuration.rst 9 | 10 | .. include:: Controller.rst 11 | 12 | .. include:: Utility.rst 13 | 14 | .. include:: SqlGenerator.rst 15 | -------------------------------------------------------------------------------- /Configuration/Backend/AjaxRoutes.php: -------------------------------------------------------------------------------- 1 | [ 7 | // 'path' => '/folder/tree/expand', 8 | // 'target' => Controller\FileSystemNavigationFrameController::class . '::ajaxExpandCollapse' 9 | // ], 10 | ]; 11 | -------------------------------------------------------------------------------- /Configuration/TCA/Overrides/pages.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'config' => [ 7 | 'type' => 'passthrough', 8 | ] 9 | ] 10 | ]; 11 | 12 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $pageSortingColumn); 13 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Debug/Debug.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
Time:{debugData.debugTime}
{debugData.debugType}{debugData.className}
12 | 13 | 14 |
15 | 16 | 17 |
-------------------------------------------------------------------------------- /Tests/Functional/Logger/ExpectedErrorMail.txt: -------------------------------------------------------------------------------- 1 | 2 | *Server* 3 | spiderman.web.net 4 | 5 | *Message* 6 | The fantastic three 7 | 8 | *Data* 9 | Request-Id: CongratulationsThisIsRequestNumber1000000 10 | time: 42.1337 11 | name: Summer 12 | part: Sun 13 | multiPart: 14 | a 15 | b 16 | c 17 | weather: Sunshine 18 | 19 | *User Agent* 20 | Operating System: Mac OS X 21 | Browser: Chrome 22 | -------------------------------------------------------------------------------- /ext_conf_template.txt: -------------------------------------------------------------------------------- 1 | # cat=logger; type=string; label="Log file path for application log" 2 | logFilePath = 3 | # cat=logger; type=options[Emergency=0,Alert=1,Critical=2,Error=3,Warning=4,Notice=5,Info=6,Debug=7]; label="Log level threshold: The minimum log level at which a message is logged. Default is Info. See \TYPO3\CMS\Core\Log\LogLevel for more information." 4 | logLevelThreshold = error 5 | -------------------------------------------------------------------------------- /Resources/Private/Language/locallang.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | module 5 | Language labels for the Tools for Extbase development extension in the FRONTEND 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Classes/Tree/TreeStorageInterface.php: -------------------------------------------------------------------------------- 1 | 'The given value has to be a positive integer'); -------------------------------------------------------------------------------- /Documentation/En/Developer/ClassDiagrams/Index.rst: -------------------------------------------------------------------------------- 1 | Klassendiagramm 2 | ^^^^^^^^^^^^^^^ 3 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~ 5 | UML-Diagramm des Models 6 | ~~~~~~~~~~~~~~~~~~~~~~~ 7 | 8 | .. figure:: Images/Extensions/pt_certification/Developer/ClassDiagrams/UmlClassDiagram.png 9 | 10 | 3.1: Das Klassendiagramm des Models 11 | 12 | ~~~~~~~~~~~~~~~~ 13 | Sonstige Klassen 14 | ~~~~~~~~~~~~~~~~ 15 | 16 | - Controller 17 | - Manager 18 | - Finisher 19 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Tca/Tree.html: -------------------------------------------------------------------------------- 1 | {namespace ptx=PunktDe\PtExtbase\ViewHelpers} 2 | 3 | 13 | 14 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/ClassConstantViewHelper.php: -------------------------------------------------------------------------------- 1 | 10 | {name}: 11 | {itemSubValue}{item} 12 | 13 | *User Agent* 14 | Operating System: {userAgent.operatingSystem} 15 | Browser: {userAgent.browser} 16 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Condition/IsArrayViewHelper.php: -------------------------------------------------------------------------------- 1 | createFakeFrontend(); 11 | 12 | 13 | HeaderInclusion 14 | --------------- 15 | 16 | 17 | 18 | NameSpace 19 | --------- 20 | 21 | 22 | 23 | Tca 24 | --- 25 | 26 | 27 | 28 | AjaxDispatcher 29 | -------------- 30 | 31 | 32 | 33 | eIDDispatcher 34 | ------------- -------------------------------------------------------------------------------- /Classes/Logger/Writer/FileWriter.php: -------------------------------------------------------------------------------- 1 | closeLogFile(); 18 | } 19 | 20 | $this->logFile = $logFile; 21 | $this->openLogFile(); 22 | 23 | return $this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Classes/Tree/ExtJsJsonTreeWriter.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | public function getDeletedNodes(); 17 | 18 | 19 | 20 | /** 21 | * Returns namespace of tree 22 | * 23 | * @return string namespace 24 | */ 25 | public function getNamespace(); 26 | 27 | 28 | 29 | /** 30 | * Sets namespace of tree 31 | * 32 | * @param string $namespace 33 | */ 34 | public function setNamespace($namespace); 35 | } 36 | -------------------------------------------------------------------------------- /Classes/Logger/Processor/SwitchRequestIdProcessor.php: -------------------------------------------------------------------------------- 1 | setRequestId($requestId); 25 | } 26 | 27 | return $logRecord; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Classes/Tree/NodeRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | public function findByNamespace($namespace); 20 | 21 | 22 | 23 | /** 24 | * Updates a given node if it has already been added to repository or adds it. 25 | * 26 | * @abstract 27 | * @param NodeInterface $node 28 | */ 29 | public function updateOrAdd(NodeInterface $node); 30 | } 31 | -------------------------------------------------------------------------------- /Classes/Tree/TraversableInterface.php: -------------------------------------------------------------------------------- 1 | get(JSTreeJsonWriterVisitor::class); 25 | $visitors[] = $arrayWriterVisitor; 26 | $jsonTreeWriter = $objectManager->get(JsonTreeWriter::class, $visitors, $arrayWriterVisitor); 27 | return $jsonTreeWriter; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Classes/Exception/ConfigurationException.php: -------------------------------------------------------------------------------- 1 | get(JSArrayTreeWriterVisitor::class); 26 | $visitors[] = $arrayWriterVisitor; 27 | $jsonTreeWriter = $objectManager->get(ArrayTreeWriter::class, $visitors, $arrayWriterVisitor); 28 | return $jsonTreeWriter; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Classes/Testing/Selenium/BaseFramework.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * All rights reserved 8 | * 9 | * This script is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * The GNU General Public License can be found at 15 | * http://www.gnu.org/copyleft/gpl.html. 16 | * 17 | * This script is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * This copyright notice MUST APPEAR in all copies of the script! 23 | */ 24 | require_once 'Backend/Security.php'; 25 | require_once 'Backend/Modules.php'; 26 | -------------------------------------------------------------------------------- /ext_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 14 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Classes/Tree/TreeWalkerVisitorInterface.php: -------------------------------------------------------------------------------- 1 | $node->getLabel(), 22 | 'attr' => [ 23 | 'id' => $node->getUid(), 24 | 'data-meta' => '', 25 | 'disabled' => !$node->isAccessible(), 26 | ], 27 | 'children' => [] 28 | ]; 29 | 30 | $this->nodeStack->push($arrayForNode); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Tests/Unit/Logger/Expected/Exception.txt: -------------------------------------------------------------------------------- 1 | Uncaught exception: This is a Test Exception 2 | 3 | 014 Tx_PtDpppBase_Logger_LoggerTest::logException() 4 | 013 ReflectionMethod::invokeArgs(Tx_PtExtbase_Logger_LoggerTest, array|0|) 5 | 012 PHPUnit_Framework_TestCase::runTest() 6 | 011 PHPUnit_Framework_TestCase::runBare() 7 | 010 Tx_Extbase_Tests_Unit_BaseTestCase::runBare() 8 | 009 PHPUnit_Framework_TestResult::run(Tx_PtExtbase_Logger_LoggerTest) 9 | 008 PHPUnit_Framework_TestCase::run(PHPUnit_Framework_TestResult) 10 | 007 PHPUnit_Framework_TestSuite::runTest(Tx_PtExtbase_Logger_LoggerTest, PHPUnit_Framework_TestResult) 11 | 006 PHPUnit_Framework_TestSuite::run(PHPUnit_Framework_TestResult, FALSE, array|0|, array|0|, FALSE) 12 | 005 PHPUnit_TextUI_TestRunner::doRun(PHPUnit_Framework_TestSuite, array|6|) 13 | 004 PHPUnit_TextUI_Command::run(array|5|, TRUE) 14 | 003 PHPUnit_TextUI_Command::main() 15 | 002 Tx_Phpunit_TestRunner_CliTestRunner::run() 16 | 001 include("/var/apache/partnerportal/htdocs/typo3conf/ext/phpunit/Scripts/ManualCliTestRunner.php") 17 | -------------------------------------------------------------------------------- /Classes/Lifecycle/HookManager.php: -------------------------------------------------------------------------------- 1 | updateState(Manager::END); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "punktde/pt_extbase", 3 | "type": "typo3-cms-extension", 4 | "description": "Collection of tools for Extbase Extension development", 5 | "keywords": [ 6 | "TYPO3", 7 | "extension" 8 | ], 9 | "homepage": "http://punkt.de", 10 | "license": [ 11 | "GPL-2.0+" 12 | ], 13 | "require": { 14 | "typo3/cms-core": ">=10.3.0,<11.0", 15 | "php": ">=7.0.0,<8.0.0", 16 | "neos/utility-files": "*" 17 | }, 18 | "require-dev": { 19 | "mikey179/vfsStream": "1.4.*@dev", 20 | "phpunit/phpunit": "~4.8.0" 21 | }, 22 | "autoload": { 23 | "psr-4": { 24 | "PunktDe\\PtExtbase\\": "Classes" 25 | }, 26 | "classmap": [ 27 | "Classes/", 28 | "Tests/" 29 | ] 30 | }, 31 | "replace": { 32 | "pt_extbase": "self.version", 33 | "typo3-ter/pt-extbase": "self.version" 34 | }, 35 | "extra": { 36 | "typo3/cms": { 37 | "extension-key": "pt_extbase", 38 | "cms-package-dir": "{$vendor-dir}/typo3/cms", 39 | "web-dir": ".Build/Web" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Resources/Private/Templates/Tca/TcaDebug.html: -------------------------------------------------------------------------------- 1 | {namespace ptx=PunktDe\PtExtbase\ViewHelpers} 2 | 3 | 5 | 6 | 7 |
8 | 9 | Selected Values (For debugging only!)
10 | 15 |
16 | Field that holds selected node uids (comma separated)
17 | (content of this field is saved in record!) 18 |
19 |
20 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /Classes/Tree/JSTreeJsonWriterVisitor.php: -------------------------------------------------------------------------------- 1 | getUid(); 21 | $metadata = ''; 22 | 23 | 24 | $arrayForNode = [ 25 | 'data' => $node->getLabel(), 26 | 'attr' => [ 27 | 'id' => $node->getUid(), 28 | 'data-meta' => trim($metadata), 29 | 'disabled' => !$node->isAccessible(), 30 | ], 31 | 'children' => [] 32 | ]; 33 | 34 | $this->nodeStack->push($arrayForNode); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Resources/Public/CSS/Backend.css: -------------------------------------------------------------------------------- 1 | .fakeButton { 2 | background-color: #F6F6F6; 3 | background-image: -moz-linear-gradient(center top, #F6F6F6 10%, #D5D5D5 90%); 4 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0.1, #f6f6f6), color-stop(0.9, #d5d5d5)); 5 | background-position: center bottom; 6 | background-repeat: repeat-x; 7 | border: 1px solid #7C7C7C; 8 | border-radius: 1px 1px 1px 1px; 9 | color: #434343; 10 | cursor: pointer; 11 | font-weight: normal; 12 | padding: 3px; 13 | font-size: 11px; 14 | text-decoration: none !important; 15 | min-width: 70px; 16 | display: inline-block; 17 | text-align: center; 18 | } 19 | 20 | .fakeButton:hover { 21 | background-color: #C8C8C8; 22 | background-image: -moz-linear-gradient(center top , #F6F6F6 10%, #BDBCBC 90%); 23 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0.1, #f6f6f6), color-stop(0.9, #BDBCBC)); 24 | } 25 | 26 | .t3-row-header { 27 | background-color: #666; 28 | padding: 6px; 29 | } 30 | 31 | .t3-row-header a,.t3-row-header a:hover { 32 | color: #fff; 33 | } -------------------------------------------------------------------------------- /Classes/Configuration/ConfigurationInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | interface ConfigurationInterface 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /Classes/Utility/Lock/LockNotAcquiredException.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | namespace PunktDe\PtExtbase\Utility\Lock; 28 | 29 | class LockNotAcquiredException extends \Exception 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Documentation/En/Developer/Controller.rst: -------------------------------------------------------------------------------- 1 | ---------- 2 | Controller 3 | ---------- 4 | 5 | AbstractActionController 6 | ------------------------ 7 | 8 | The abstraction action controller extends the extbase ActionController and adds some new functions and behaviours. 9 | 10 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | Exchange Single Fluid Templates and Views 12 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 13 | 14 | Single fluid templates can be exchanged by TypoScript configuration by using the following syntax:: 15 | 16 | plugin..settings.controller...template = full_path_to_template_with.html 17 | 18 | View can be set via TS. View has to be set in TS via:: 19 | 20 | plugin..settings.controller...view = ViewClassName 21 | 22 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 23 | Lifecycle manager 24 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 25 | 26 | The lifecycle manager can be used to trigger actions during the extensions lifecycle. This for example is used to automatically restore the session array at the beginning of the extensions lifecycle and to store it to the database again at the end. -------------------------------------------------------------------------------- /Configuration/Services.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | _defaults: 3 | autowire: true 4 | autoconfigure: true 5 | public: false 6 | 7 | PunktDe\PtExtbase\: 8 | resource: '../Classes/*.php' 9 | 10 | PunktDe\PtExtbase\Utility\: 11 | resource: '../Classes/Utility/{HeaderInclusion,ExtensionSettings}.php' 12 | public: true 13 | 14 | PunktDe\PtExtbase\Logger\: 15 | resource: '../Classes/Logger' 16 | 17 | PunktDe\PtExtbase\Controller\: 18 | resource: '../Classes/Controller' 19 | 20 | PunktDe\PtExtbase\Lifecycle\: 21 | resource: '../Classes/Lifecycle' 22 | public: true 23 | 24 | PunktDe\PtExtbase\Tree\: 25 | resource: '../Classes/Tree' 26 | 27 | PunktDe\PtExtbase\State\: 28 | resource: '../Classes/State' 29 | public: true 30 | 31 | PunktDe\PtExtbase\Domain\Model\: 32 | resource: '../Classes/Domain/Model' 33 | public: true 34 | 35 | PunktDe\PtExtbase\Domain\Repository\: 36 | resource: '../Classes/Domain/Repository' 37 | public: true 38 | 39 | PunktDe\PtExtbase\State\Session\Storage\AdapterInterface: 40 | alias: PunktDe\PtExtbase\State\Session\Storage\NullStorageAdapter 41 | 42 | PunktDe\PtExtbase\Configuration\AbstractConfiguration: 43 | arguments: 44 | $settings: [] 45 | 46 | -------------------------------------------------------------------------------- /Resources/Private/Language/locallang_db.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | database 5 | Language labels for database tables/fields belonging to extension 'pt_extbase' 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Classes/Utility/Git/GitException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | /** 25 | * Git Exception 26 | * 27 | * @package PunktDe\PtExtbase\Utility\Git 28 | */ 29 | class GitException extends \Exception 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Result/PushResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | /** 25 | * Push Result 26 | * 27 | * @package PunktDe\PtExtbase\Utility\Git\Result 28 | */ 29 | class PushResult extends Result 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Classes/Utility/Varnish/VarnishAdministrationException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | /** 25 | * Varnish Administration Exception 26 | * 27 | * @package PunktDe\PtExtbase\Utility\Git 28 | */ 29 | class VarnishAdministrationException extends \Exception 30 | { 31 | } 32 | -------------------------------------------------------------------------------- /Classes/Utility/Lock/LockStrategyInterface.php: -------------------------------------------------------------------------------- 1 | 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | /** 28 | * Repository for TTContent 29 | * 30 | * @package Domain 31 | * @subpackage Repository 32 | * @author Daniel Lienert 33 | */ 34 | class TTContentRepository extends \TYPO3\CMS\Extbase\Persistence\Repository 35 | { 36 | } 37 | -------------------------------------------------------------------------------- /Classes/Collection/SortableEntityInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | /** 25 | * Component Interface 26 | * 27 | * @package PunktDe\PtExtbase\Utility\GenericShellCommandWrapper 28 | */ 29 | interface ComponentInterface 30 | { 31 | /** 32 | * @return array 33 | */ 34 | public function toArray(); 35 | } 36 | -------------------------------------------------------------------------------- /Classes/SignalSlot/Exception/InvalidSlotException.php: -------------------------------------------------------------------------------- 1 | 6 | * All rights reserved 7 | * 8 | * This class is a backport of the corresponding class of FLOW3. 9 | * All credits go to the v5 team. 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | /** 29 | * "Invalid Slot" Exception 30 | * 31 | * @package Extbase 32 | * @subpackage SignalSlot 33 | * @api 34 | */ 35 | class Tx_PtExtbase_SignalSlot_Exception_InvalidSlotException extends \TYPO3\CMS\Extbase\Object\Exception 36 | { 37 | } 38 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/CategoryRepository.php: -------------------------------------------------------------------------------- 1 | 33 | */ 34 | class CategoryRepository extends \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository 35 | { 36 | } 37 | -------------------------------------------------------------------------------- /Classes/Configuration/ConfigurationFactoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | interface ConfigurationFactoryInterface 25 | { 26 | /** 27 | * @param ConfigurationBuilderInterface $configurationBuilder 28 | * @param array $parameters 29 | * @return ConfigurationInterface 30 | */ 31 | public static function getInstance(ConfigurationBuilderInterface $configurationBuilder, $parameters); 32 | } 33 | -------------------------------------------------------------------------------- /Classes/Utility/Varnish/Result/Result.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\AbstractResult; 25 | 26 | /** 27 | * Result 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Varnish\Result 30 | */ 31 | class Result extends AbstractResult 32 | { 33 | /** 34 | * @return void 35 | */ 36 | protected function buildResult() 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Classes/Exception/LoggerException.php: -------------------------------------------------------------------------------- 1 | data = $data; 37 | if (LogLevel::isValidLevel($logLevel)) { 38 | $this->logLevel = $logLevel; 39 | } else { 40 | $this->logLevel = LogLevel::ERROR; 41 | } 42 | $this->data = $data; 43 | } 44 | 45 | /** 46 | * @return string[] 47 | */ 48 | public function getData(): array 49 | { 50 | return $this->data; 51 | } 52 | 53 | /** 54 | * @return integer 55 | */ 56 | public function getLogLevel() 57 | { 58 | return $this->logLevel; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Classes/Tree/NestedSetNodeInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; 25 | 26 | class IsNumericViewHelper extends AbstractViewHelper 27 | { 28 | 29 | public function initializeArguments() 30 | { 31 | $this->registerArgument('value', 'mixed', 'the value to check', true); 32 | } 33 | 34 | /** 35 | * @return boolean 36 | */ 37 | public function render() { 38 | return is_numeric($this->arguments['value']); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Classes/Lifecycle/EventInterface.php: -------------------------------------------------------------------------------- 1 | , 8 | * Ursula Klinger , 9 | * Daniel Lienert , 10 | * Joachim Mathes 11 | * All rights reserved 12 | * 13 | * This script is part of the TYPO3 project. The TYPO3 project is 14 | * free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * The GNU General Public License can be found at 20 | * http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This script is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * This copyright notice MUST APPEAR in all copies of the script! 28 | ***************************************************************/ 29 | 30 | /** 31 | * SQL Runner Interface 32 | * 33 | * @package pt_extbase 34 | * @subpackage SqlRunner 35 | */ 36 | interface Tx_PtExtbase_SqlRunner_SqlRunnerInterface 37 | { 38 | /** 39 | * @abstract 40 | * @param array $sqls 41 | * @return void 42 | */ 43 | public function runSqls($sqls); 44 | } 45 | -------------------------------------------------------------------------------- /Tests/Unit/State/Session/Storage/DBAdapterFactoryTest.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 6 | * All rights reserved 7 | * 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | /** 27 | * Testcase for DB Adapter 28 | * 29 | * @package Tests 30 | * @subpackage State\Session\Storage 31 | * @author Michael Knoll 32 | */ 33 | class Tx_PtExtbase_Tests_Unit_State_Session_Storage_DBAdapterTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 34 | { 35 | /** @test */ 36 | public function notYetImplemented() 37 | { 38 | $this->markTestIncomplete('Test is not yet implemented!'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Tests/Unit/State/Session/Storage/DBAdapterTest.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 6 | * All rights reserved 7 | * 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | /** 27 | * Testcase for DB Adapter Factory 28 | * 29 | * @package Tests 30 | * @subpackage State\Session\Storage 31 | * @author Michael Knoll 32 | */ 33 | class Tx_PtExtbase_Tests_Unit_State_Session_Storage_DBAdapterFactoryTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 34 | { 35 | /** @test */ 36 | public function notYetImplemented() 37 | { 38 | $this->markTestIncomplete('Test is not yet implemented!'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Tests/Unit/State/Session/Storage/SessionAdapterTest.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 6 | * All rights reserved 7 | * 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | /** 27 | * Testcase for Session adapter 28 | * 29 | * @package Tests 30 | * @subpackage State\Session\Storage 31 | * @author Michael Knoll 32 | */ 33 | class Tx_PtExtbase_Tests_Unit_State_Session_Storage_SessionAdapterTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 34 | { 35 | /** @test */ 36 | public function notYetImplemented() 37 | { 38 | $this->markTestIncomplete('Test is not yet implemented!'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Classes/Exception/InternalException.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 28 | 29 | /** 30 | * Usage Example 31 | * 32 | * {areaNames->ptx:implode()} 33 | */ 34 | 35 | 36 | class ImplodeViewHelper extends AbstractViewHelper 37 | { 38 | /** 39 | * @param string $glue 40 | * @return string 41 | */ 42 | public function render($glue = ', ') 43 | { 44 | $pieces = $this->renderChildren(); 45 | return implode($glue, $pieces); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Classes/Utility/ServerInformation.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $visitedNodes = []; 17 | 18 | 19 | 20 | /** 21 | * @see TreeWalkerVisitorInterface::doFirstVisit() 22 | * 23 | * @param NodeInterface $node 24 | * @param integer &$index Holds the visitation index of treewalker 25 | * @param integer &$level Holds level of visitation in tree, starting at 1 26 | */ 27 | public function doFirstVisit(NodeInterface $node, &$index, &$level) 28 | { 29 | $node->setLft($index); 30 | } 31 | 32 | 33 | 34 | /** 35 | * @see TreeWalkerVisitorInterface::doLastVisit() 36 | * 37 | * @param NodeInterface $node 38 | * @param integer &$index Holds the visitation index of treewalker 39 | * @param integer &$level Holds level of visitation in tree, starting at 1 40 | */ 41 | public function doLastVisit(NodeInterface $node, &$index, &$level) 42 | { 43 | $node->setRgt($index); 44 | $this->visitedNodes[] = $node; 45 | } 46 | 47 | 48 | 49 | /** 50 | * Returns array of visited nodes 51 | * 52 | * @return array 53 | */ 54 | public function getVisitedNodes() 55 | { 56 | return $this->visitedNodes; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Classes/Configuration/ConfigurationBuilderInterface.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * This script is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published 8 | * by the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This script is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | * This copyright notice MUST APPEAR in all copies of the script! 20 | ***************************************************************/ 21 | 22 | namespace PunktDe\PtExtbase\Configuration; 23 | 24 | interface ConfigurationBuilderInterface 25 | { 26 | /** 27 | * @param string $key 28 | * @return array 29 | */ 30 | public function getSettings($key = ''); 31 | 32 | /** 33 | * @param $configurationName 34 | * @return array 35 | */ 36 | public function getSettingsForConfigObject($configurationName); 37 | 38 | /** 39 | * @param $objectPath 40 | * @return array 41 | */ 42 | public function getPrototypeSettingsForObject($objectPath); 43 | } 44 | -------------------------------------------------------------------------------- /Classes/SqlGenerator/SqlGeneratorCommandInterface.php: -------------------------------------------------------------------------------- 1 | , 8 | * Ursula Klinger , 9 | * Daniel Lienert , 10 | * Joachim Mathes 11 | * All rights reserved 12 | * 13 | * This script is part of the TYPO3 project. The TYPO3 project is 14 | * free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * The GNU General Public License can be found at 20 | * http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This script is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * This copyright notice MUST APPEAR in all copies of the script! 28 | ***************************************************************/ 29 | 30 | /** 31 | * SQL Generator Command Interface 32 | * 33 | * @package pt_extbase 34 | * @subpackage SqlGenerator 35 | */ 36 | interface Tx_PtExtbase_SqlGenerator_SqlGeneratorCommandInterface 37 | { 38 | /** 39 | * @abstract 40 | * @param string $filePath 41 | * @return array of single SQL commands 42 | */ 43 | public function generate($filePath); 44 | } 45 | -------------------------------------------------------------------------------- /ext_localconf.php: -------------------------------------------------------------------------------- 1 | updateEnd'; 10 | 11 | /** 12 | * Include the eId dispatcher in Frontend environment 13 | */ 14 | $TYPO3_CONF_VARS['FE']['eID_include']['ptxAjax'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('pt_extbase') . 'Classes/Utility/eIDDispatcher.php'; 15 | 16 | /** 17 | * Include the ajax dispatcher in Backend environment 18 | */ 19 | //\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler( 20 | // 'ptxAjax', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('pt_extbase') . 'Classes/Utility/AjaxDispatcher.php:Tx_PtExtbase_Utility_AjaxDispatcher->initAndDispatch', FALSE 21 | //); 22 | 23 | // Scheduler Tasks 24 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['Tx_PtExtbase_Scheduler_SqlRunner_SqlRunnerTask'] = [ 25 | 'extension' => 'pt_extbase', 26 | 'title' => 'SQL Runner', 27 | 'description' => 'Runs an SQL file.', 28 | 'additionalFields' => 'Tx_PtExtbase_Scheduler_SqlRunner_SqlRunnerTaskAdditionalFields' 29 | ]; 30 | 31 | /* 32 | * Test Scheduler Task 33 | */ 34 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][PunktDe\PtExtbase\Tests\Functional\Scheduler\TestTask::class] = [ 35 | 'extension' => 'pt_extbase', 36 | 'title' => 'Pt_Extbase Test Abstract Scheduler Task', 37 | 'description' => 'This Task is for Testing, do not run this task in Production Environment', 38 | ]; 39 | -------------------------------------------------------------------------------- /Migrations/Code/ClassAliasMap.php: -------------------------------------------------------------------------------- 1 | 'PunktDe\\PtExtbase\\Utility\\TcaManager', 4 | 'Tx_PtExtbase_Logger_Logger' => 'PunktDe\\PtExtbase\\Logger\\Logger', 5 | 'Tx_PtExtbase_Logger_LoggerConfiguration' => 'PunktDe\\PtExtbase\\Logger\\LoggerConfiguration', 6 | 'Tx_PtExtbase_Utility_ExtensionSettings' => 'PunktDe\\PtExtbase\\Utility\\ExtensionSettings', 7 | 'Tx_PtExtbase_Utility_FakeFrontendFactory' => 'PunktDe\\PtExtbase\\Utility\\FakeFrontendFactory', 8 | 'Tx_PtExtbase_Exception_ConfigurationException' => 'PunktDe\\PtExtbase\\Exception\\ConfigurationException', 9 | 'Tx_PtExtbase_Exception_LoggerException' => 'PunktDe\\PtExtbase\\Exception\\LoggerException', 10 | 'Tx_PtExtbase_Exception_Internal' => 'PunktDe\\PtExtbase\\Exception\\InternalException', 11 | 'Tx_PtExtbase_Exception_Exception' => 'PunktDe\\PtExtbase\\Exception\\Exception', 12 | 'Tx_PtExtbase_Configuration_AbstractConfiguration' => 'PunktDe\\PtExtbase\\Configuration\\AbstractConfiguration', 13 | 'Tx_PtExtbase_Configuration_AbstractConfigurationBuilder' => 'PunktDe\\PtExtbase\\Configuration\\AbstractConfigurationBuilder', 14 | 'Tx_PtExtbase_Utility_Namespace' => 'PunktDe\\PtExtbase\\Utility\\NamespaceUtility', 15 | 'Tx_PtExtbase_Collection_Collection' => 'PunktDe\\PtExtbase\\Collection\\Collection', 16 | 'Tx_PtExtbase_Collection_ObjectCollection' => 'PunktDe\\PtExtbase\\Collection\\ObjectCollection', 17 | 'Tx_PtExtbase_Tests_Unit_AbstractBaseTestcase' => 'PunktDe\\PtExtbase\\Testing\\Unit\\AbstractBaseTestcase', 18 | 'Tx_PtExtbase_Tests_Unit_AbstractModelTestcase' => 'PunktDe\\PtExtbase\\Testing\\Unit\\AbstractModelTestcase', 19 | 20 | ]; -------------------------------------------------------------------------------- /Tests/Unit/State/Stubs/SessionAdapterMock.php: -------------------------------------------------------------------------------- 1 | ['test2' => ['test3' => 'value']]]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Classes/Rbac/RbacServiceInterface.php: -------------------------------------------------------------------------------- 1 | , punkt.de GmbH 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | 28 | /** 29 | * Interface for RBAC access control services 30 | */ 31 | interface Tx_PtExtbase_Rbac_RbacServiceInterface extends \TYPO3\CMS\Core\SingletonInterface 32 | { 33 | /** 34 | * Returns TRUE, if currently logged in user (frontend or backend) has 35 | * access for given object and action. 36 | * 37 | * @param string $extension Name of extension to grant access 38 | * @param string $object Object to grant access to 39 | * @param string $action Action to grant access to 40 | * @return bool TRUE, if access is granted 41 | */ 42 | public function loggedInUserHasAccess($extension, $object, $action); 43 | } 44 | -------------------------------------------------------------------------------- /Classes/State/GpVars/GpVarsInjectableInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use TYPO3\CMS\Core\Utility\GeneralUtility; 25 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; 26 | 27 | class RedirectToPageIdViewHelper extends AbstractTagBasedViewHelper 28 | { 29 | 30 | public function initializeArguments() 31 | { 32 | parent::initializeArguments(); 33 | $this->registerArgument('pageId', 'int', 'target page id', true); 34 | } 35 | 36 | public function render(){ 37 | $pageId = $this->arguments['pageId']; 38 | $url = GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'); 39 | $url .= "/?id=" . $pageId; 40 | header('Location: ' . $url); 41 | } 42 | } -------------------------------------------------------------------------------- /Classes/Rbac/RbacService.php: -------------------------------------------------------------------------------- 1 | , punkt.de GmbH 6 | * Daniel lienert , punkt.de GmbH 7 | * 8 | * 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | 29 | 30 | class Tx_PtExtbase_Rbac_RbacService implements Tx_PtExtbase_Rbac_RbacServiceInterface 31 | { 32 | /** 33 | * This is currently only a dummy implementation, 34 | * which is used if no other service was configured. 35 | * It just returns false on every request 36 | * 37 | * @param string $extension Extension to grant access to 38 | * @param string $object Object to grant access to 39 | * @param string $action Action to grant access to 40 | * @return bool 41 | */ 42 | public function loggedInUserHasAccess($extension, $object, $action) 43 | { 44 | return false; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Classes/Tree/JsonTreeWriter.php: -------------------------------------------------------------------------------- 1 | get(ArrayWriterVisitor::class); 25 | /** @var ArrayWriterVisitor $arrayWriterVisitor */ 26 | 27 | $visitors[] = $arrayWriterVisitor; 28 | $jsonTreeWriter = $objectManager->get(JsonTreeWriter::class, $visitors, $arrayWriterVisitor); 29 | return $jsonTreeWriter; 30 | } 31 | 32 | 33 | /** 34 | * Constructor for array tree writer 35 | * 36 | * @param array $visitors 37 | * @param ArrayWriterVisitor|TreeWalkerVisitorInterface $arrayWriterVisitor 38 | */ 39 | public function __construct(array $visitors, TreeWalkerVisitorInterface $arrayWriterVisitor) 40 | { 41 | parent::__construct($visitors, $arrayWriterVisitor); 42 | } 43 | 44 | 45 | /** 46 | * Returns JSON notation of given tree 47 | * 48 | * @param TreeInterface $tree 49 | * @return string JSON encoding of tree 50 | */ 51 | public function writeTree(TreeInterface $tree) 52 | { 53 | $nodeArray = parent::writeTree($tree); 54 | 55 | return '[' . json_encode($nodeArray) . ']'; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Resources/Private/JSTemplates/Tree/SelectTree.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ExtJs Tree 3 | * 4 | * @author Daniel Lienert 5 | */ 6 | 7 | Ext.BLANK_IMAGE_URL = "/clear.gif"; 8 | 9 | Ext.onReady(function(){ 10 | var Tree = Ext.tree; 11 | 12 | var multiple = ###multiple###; 13 | var expand = '###expand###'; 14 | 15 | var ptExtbaseTree = new Tree.TreePanel({ 16 | autoScroll:true, 17 | animate:true, 18 | enableDD:false, 19 | containerScroll: true, 20 | useArrows:true, 21 | root: new Ext.tree.AsyncTreeNode({ 22 | expanded: true, 23 | children: ###nodeJSON### 24 | }), 25 | rootVisible: false, 26 | frame: true, 27 | loader: new Ext.tree.TreeLoader(), 28 | listeners: { 29 | 'click': function(node, event){ 30 | if(!multiple) { 31 | Ext.get("###fieldId###").set({value: node.id}); 32 | } 33 | }, 34 | 'checkchange': function(node, checked){ 35 | if(multiple) { 36 | var ids = '', selNodes = ptExtbaseTree.getChecked(); 37 | 38 | Ext.each(selNodes, function(node){ 39 | if(ids.length > 0){ 40 | ids += ', '; 41 | } 42 | ids += node.id; 43 | }); 44 | 45 | Ext.get("###fieldId###").set({value: ids}); 46 | } 47 | } 48 | } 49 | }) 50 | 51 | ptExtbaseTree.render('###fieldId###Div'); 52 | 53 | if(expand == 'root') { 54 | Ext.each(ptExtbaseTree.getRootNode().childNodes, function(node){ 55 | node.expand(); 56 | }); 57 | } 58 | 59 | if(expand == 'all') { 60 | ptExtbaseTree.expandAll(); 61 | } 62 | }); 63 | 64 | -------------------------------------------------------------------------------- /Tests/Unit/Rbac/AllowAllServiceTest.php: -------------------------------------------------------------------------------- 1 | , punkt.de GmbH 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | 28 | /** 29 | * Class implements testcase for rbac allowAllService 30 | */ 31 | class Tx_PtExtbase_Tests_Unit_Rbac_AllowAllServiceTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 32 | { 33 | /** @test */ 34 | public function loggedInUserHasAccessReturnsTrueOnArbitraryRequests() 35 | { 36 | $allowAllService = new Tx_PtExtbase_Rbac_AllowAllService(); 37 | $this->assertTrue($allowAllService->loggedInUserHasAccess('pt_extbase', 'test', 'test')); 38 | $this->assertTrue($allowAllService->loggedInUserHasAccess('yag', 'test', 'test')); 39 | $this->assertTrue($allowAllService->loggedInUserHasAccess('yag', 'album', 'delete')); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/ShortLinkViewHelper.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 27 | 28 | /** 29 | * Request Arguments ViewHelper 30 | * 31 | * @package pt_extbase 32 | * @subpackage ViewHelpers 33 | */ 34 | class ShortLinkViewHelper extends AbstractViewHelper 35 | { 36 | /** 37 | * @param integer $length 38 | * @param string $indexScriptUrl 39 | * 40 | * @return string 41 | */ 42 | public function render($length = 0, $indexScriptUrl = '') 43 | { 44 | $link = $this->renderChildren(); 45 | 46 | $shortLink = \TYPO3\CMS\Core\Utility\GeneralUtility::makeRedirectUrl($link, $length, $indexScriptUrl); 47 | 48 | return $shortLink; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Classes/State/IdentifiableInterface.php: -------------------------------------------------------------------------------- 1 | , 8 | * Ursula Klinger , 9 | * Daniel Lienert , 10 | * Joachim Mathes 11 | * All rights reserved 12 | * 13 | * This script is part of the TYPO3 project. The TYPO3 project is 14 | * free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * The GNU General Public License can be found at 20 | * http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This script is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * This copyright notice MUST APPEAR in all copies of the script! 28 | ***************************************************************/ 29 | 30 | /** 31 | * SQL Generator Command Interface 32 | * 33 | * @package pt_extbase 34 | * @subpackage SqlGenerator 35 | */ 36 | interface Tx_PtExtbase_SqlGenerator_SqlGeneratorInterface 37 | { 38 | /** 39 | * @const TEMP_PREFIX 40 | */ 41 | const TEMP_PREFIX = 'zzzz_temp_'; 42 | 43 | /** 44 | * @const BACKUP_PREFIX 45 | */ 46 | const BACKUP_PREFIX = 'zzzz_bck_'; 47 | 48 | 49 | /** 50 | * @abstract 51 | * @return array of single SQL commands 52 | */ 53 | public function generate(); 54 | } 55 | -------------------------------------------------------------------------------- /Tests/Unit/Utility/AjaxDispatcherTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | /** 25 | * Real URL Test Case 26 | * 27 | * @package pt_extbase 28 | * @subpackage PunktDe\PtExtbase\Tests\Unit\Utility 29 | */ 30 | class AjaxDispatcherTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 31 | { 32 | /** 33 | * @var \Tx_PtExtbase_Utility_AjaxDispatcher 34 | */ 35 | protected $ajaxDispatcher; 36 | 37 | 38 | public function setUp(): void 39 | { 40 | $this->ajaxDispatcher = new \Tx_PtExtbase_Utility_AjaxDispatcher(); 41 | } 42 | 43 | /** 44 | * @test 45 | */ 46 | public function checkLegacyAllowedControllerActions() 47 | { 48 | $this->markTestIncomplete('Should be implemented'); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Classes/Utility/GenericShellCommandWrapper/ResultObjectStorage.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use TYPO3\CMS\Extbase\Persistence\ObjectStorage; 25 | 26 | /** 27 | * Result 28 | * 29 | * @package PunktDe\PtExtbase\Utility\GenericShellCommandWrapper 30 | */ 31 | class ResultObjectStorage extends ObjectStorage implements ComponentInterface 32 | { 33 | /** 34 | * @return array 35 | */ 36 | public function toArray() 37 | { 38 | $array = []; 39 | $storage = array_values($this->storage); 40 | foreach ($storage as $item) { 41 | $object = $item['obj']; /** @var ComponentInterface $object */ 42 | $array[] = $object->toArray(); 43 | } 44 | return $array; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/ExplodeViewHelper.php: -------------------------------------------------------------------------------- 1 | 9 | * All rights reserved 10 | * 11 | * 12 | * This script is part of the TYPO3 project. The TYPO3 project is 13 | * free software; you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation; either version 2 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * The GNU General Public License can be found at 19 | * http://www.gnu.org/copyleft/gpl.html. 20 | * 21 | * This script is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | * 26 | * This copyright notice MUST APPEAR in all copies of the script! 27 | ***************************************************************/ 28 | 29 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; 30 | 31 | 32 | class ExplodeViewHelper extends AbstractViewHelper 33 | { 34 | /** 35 | * Register arguments. 36 | */ 37 | public function initializeArguments() 38 | { 39 | $this->registerArgument('delimiter', 'string', 'Delimiter', true); 40 | $this->registerArgument('string', 'string', 'String', true); 41 | } 42 | /** 43 | * @param string $delimiter 44 | * @param string $string 45 | * 46 | * @return array 47 | */ 48 | public function render() 49 | { 50 | return explode($this->arguments['delimiter'], $this->arguments['string']); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Classes/Testing/Selenium/FixtureFramework/BaseTestcase.php: -------------------------------------------------------------------------------- 1 | , 8 | * Sascha Dörr 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | /** 29 | * BaseTestcase 30 | * 31 | * @package pt_extbase 32 | * @subpackage Testing\Selenium\FixtureFramework 33 | */ 34 | abstract class Tx_PtExtbase_Testing_Selenium_FixtureFramework_SeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase 35 | { 36 | /** 37 | * @return array 38 | */ 39 | abstract public function getFixtures(); 40 | 41 | /** 42 | * @return void 43 | */ 44 | protected function setUp() 45 | { 46 | parent::setUp(); 47 | $fixtureImporter = new Tx_PtExtbase_Testing_Selenium_FixtureFramework_FixtureImporter(); 48 | $fixtureImporter->import($this->getFixtures()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Configuration/TypoScript/setup.txt: -------------------------------------------------------------------------------- 1 | plugin.tx_ptextbase { 2 | view { 3 | templateRootPath = {$plugin.tx_ptextbase.view.templateRootPath} 4 | partialRootPath = {$plugin.tx_ptextbase.view.partialRootPath} 5 | layoutRootPath = {$plugin.tx_ptextbase.view.layoutRootPath} 6 | } 7 | 8 | persistence { 9 | storagePid = {$plugin.tx_ptextbase.persistence.storagePid} 10 | } 11 | } 12 | 13 | 14 | config.tx_extbase { 15 | persistence{ 16 | enableAutomaticCacheClearing = 1 17 | updateReferenceIndex = 0 18 | classes { 19 | Tx_PtExtbase_Domain_Model_TTContent { 20 | mapping { 21 | tableName = tt_content 22 | columns { 23 | lockToDomain.mapOnProperty = lockToDomain 24 | } 25 | } 26 | } 27 | 28 | Tx_PtExtbase_Domain_Model_Page { 29 | mapping { 30 | tableName = pages 31 | columns { 32 | lockToDomain.mapOnProperty = lockToDomain 33 | } 34 | } 35 | } 36 | 37 | Tx_PtExtbase_Domain_Model_SysLanguage { 38 | mapping { 39 | tableName = sys_language 40 | columns { 41 | 42 | } 43 | } 44 | } 45 | 46 | Tx_Extbase_Domain_Model_FrontendUser.mapping.recordType > 47 | Tx_Extbase_Domain_Model_FrontendUserGroup.mapping.recordType > 48 | } 49 | } 50 | } 51 | 52 | 53 | plugin.tx_ptextbase._CSS_DEFAULT_STYLE ( 54 | 55 | .tx-extbase-highlight { 56 | font-weight:bold; 57 | color: #003399; 58 | } 59 | 60 | .pt-extbase-groupselector { 61 | border: 1px solid #7C7C7C; 62 | padding:5px; 63 | } 64 | 65 | ) 66 | 67 | # Dependency Injections 68 | config.tx_extbase.objects.Tx_PtExtbase_SqlRunner_SqlRunnerInterface.className = Tx_PtExtbase_SqlRunner_Typo3SqlRunner 69 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Format/RemoveSpacesBetweenTagsViewHelper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * All rights reserved 9 | * 10 | * This script is free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | */ 25 | 26 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; 27 | 28 | class RemoveSpacesBetweenTagsViewHelper extends AbstractViewHelper 29 | { 30 | /** 31 | * Initialize arguments 32 | * 33 | * @return void 34 | */ 35 | public function initializeArguments() 36 | { 37 | $this->registerArgument('string', 'string', 'The string to remove the linebreaks', false); 38 | } 39 | 40 | /** 41 | * Render 42 | * 43 | * @return string 44 | */ 45 | public function render() 46 | { 47 | $input = $this->arguments['string']; 48 | if ($input === null) { 49 | $input = $this->renderChildren(); 50 | } 51 | if (is_string($input)) { 52 | $result = preg_replace('~>\s*<~', '><', $input); 53 | } 54 | 55 | return $result; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Classes/Logger/Backend/FileWriter.php_ignore: -------------------------------------------------------------------------------- 1 | closeLogFile(); 46 | } 47 | $this->logFile = $logFile; 48 | $this->openLogFile(); 49 | return $this; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Format/CssNameViewHelper.php: -------------------------------------------------------------------------------- 1 | 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | 29 | 30 | /** 31 | * StringToLower ViewHelper 32 | * 33 | * @package pt_extbase 34 | * @subpackage ViewHelpers\Format 35 | */ 36 | class CssNameViewHelper extends AbstractViewHelper 37 | { 38 | /** 39 | * Render 40 | * 41 | * Renders a valid CSS class/id name 42 | * 43 | * @return string 44 | */ 45 | public function render() 46 | { 47 | $name = $this->renderChildren(); 48 | 49 | $name = trim($name); 50 | $name = \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($name); 51 | $name = strtolower($name); 52 | $name = str_replace([' ', '_'], '-', $name); 53 | 54 | return $name; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/MergeArgumentsViewHelper.php: -------------------------------------------------------------------------------- 1 | 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | 29 | 30 | /** 31 | * Merge Arguments ViewHelper 32 | * 33 | * @package pt_extbase 34 | * @subpackage ViewHelpers 35 | */ 36 | class MergeArgumentsViewHelper extends AbstractViewHelper 37 | { 38 | 39 | /** 40 | * Initializes the "value" and "key" arguments 41 | */ 42 | public function initializeArguments() 43 | { 44 | $this->registerArgument('argument1', 'array', 'Argument1', true); 45 | $this->registerArgument('argument2', 'array', 'Argument2', true); 46 | } 47 | 48 | /** 49 | * @return array 50 | */ 51 | public function render() 52 | { 53 | return array_merge_recursive($this->arguments['argument1'], $this->arguments['argument2']); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Classes/Utility/RealUrl/UrlDecoder.php: -------------------------------------------------------------------------------- 1 | 10 | * 11 | * This script is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU Lesser General Public License as published 13 | * by the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This script is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | class UrlDecoder extends RealUrlDecoder 28 | { 29 | 30 | public function __construct() 31 | { 32 | parent::__construct(); 33 | unset($this->siteScript); 34 | 35 | if ($this->tsfe === null) { 36 | $this->tsfe = $GLOBALS['TSFE']; 37 | } 38 | if ($this->emptySegmentValue === null) { 39 | $this->initialize(); 40 | } 41 | } 42 | 43 | /** 44 | * @param string $path 45 | * @return integer 46 | */ 47 | public function decodePathAndReturnPageId($path) 48 | { 49 | $result = $this->doDecoding($path); 50 | 51 | return $result->getPageId(); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /Classes/ViewHelpers/Format/FileSizeViewHelper.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 7 | * All rights reserved 8 | * 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | use TYPO3\CMS\Core\Utility\GeneralUtility; 28 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 29 | 30 | /** 31 | * @package ViewHelpers 32 | */ 33 | class FileSizeViewHelper extends AbstractViewHelper 34 | { 35 | /** 36 | * @param string $labels Labels in format "B| KB| MB| GB" 37 | * @param string $useIecLabels 38 | * @return string The formated filesize 39 | */ 40 | public function render($labels = '', $useIecLabels = false) 41 | { 42 | $numberToFormat = (int) trim($this->renderChildren()); 43 | $value = GeneralUtility::formatSize($numberToFormat, $labels); 44 | if (!$useIecLabels && substr($value, -1) === 'i') { 45 | $value = substr($value, 0, -1); 46 | } 47 | return $value; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Classes/Testing/Selenium/FixtureFramework/Tx_PtExtbase_Testing_Selenium_FixtureFramework_FixtureImporter.php: -------------------------------------------------------------------------------- 1 | , 8 | * Sascha Dörr 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | /** 29 | * FixtureImporter 30 | * 31 | * @package pt_extbase 32 | * @subpackage Testing\Selenium\FixtureFramework 33 | */ 34 | class Tx_PtExtbase_Testing_Selenium_FixtureFramework_FixtureImporter 35 | { 36 | /** 37 | * @param array $fixtures 38 | * @return void 39 | */ 40 | public function import($fixtures) 41 | { 42 | foreach ($fixtures as $fixture) { /** @var Tx_PtExtbase_Testing_Selenium_FixtureFramework_Fixture $fixture */ 43 | if ($fixture instanceof Tx_PtExtbase_Testing_Selenium_FixtureFramework_Fixture) { 44 | $fixture->getSetUpOperation()->execute($fixture->getConnection(), $fixture->getDataSet()); 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Command/Remote/RemoveCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; 25 | 26 | /** 27 | * Remote Remove Command 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Git\Command\Remote 30 | */ 31 | class RemoveCommand extends GenericShellCommand 32 | { 33 | /** 34 | * A list of allowed git command options 35 | * 36 | * @var array 37 | */ 38 | protected $argumentMap = [ 39 | 'name' => '%s' 40 | ]; 41 | 42 | 43 | /** 44 | * @var array 45 | */ 46 | protected $arguments = [ 47 | 'name' => '' 48 | ]; 49 | 50 | 51 | /** 52 | * @param string $name 53 | * @return $this 54 | */ 55 | public function setName($name) 56 | { 57 | $this->arguments['name'] = $name; 58 | return $this; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Tests/Unit/ViewHelpers/Format/FileSizeViewHelperTest.php: -------------------------------------------------------------------------------- 1 | ['145', false, '145 '], 30 | 'KiloBytes' => ['1450', false, '1.42 K'], 31 | 'MegaBytes' => ['2540000', false, '2.42 M'], 32 | 'Gigabytes' => ['1234567890', false, '1.15 G'], 33 | 'BytesUseIecLabel' => ['145', true, '145 '], 34 | 'KiloBytesUseIecLabel' => ['1450', true, '1.42 Ki'], 35 | 'MegaBytesUseIecLabel' => ['2540000', true, '2.42 Mi'], 36 | 'GigabytesUseIecLabel' => ['1234567890', true, '1.15 Gi'] 37 | ]; 38 | } 39 | 40 | 41 | /** 42 | * @test 43 | * @dataProvider fileSizeDataProvider 44 | */ 45 | public function render($input, $useIecLabel, $formatedOutput) 46 | { 47 | $viewHelper = $this->getMockBuilder(FileSizeViewHelper::class) 48 | ->setMethods(['renderChildren']) 49 | ->getMock(); 50 | 51 | $viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue($input)); 52 | $actualResult = $viewHelper->render('', $useIecLabel); 53 | $this->assertEquals($formatedOutput, $actualResult); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Tests/Unit/Utility/Wget/WgetLogEntryTest.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | namespace PunktDe\PtExtbase\Tests\Utility\Wget; 28 | 29 | class WgetLogEntryTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 30 | { 31 | /** 32 | * @var \PunktDe\PtExtbase\Utility\Wget\WgetLogEntry 33 | */ 34 | protected $wgetLogEntry; 35 | 36 | 37 | public function setUp(): void 38 | { 39 | $wgetLogEntryProxyClass = $this->buildAccessibleProxy(\PunktDe\PtExtbase\Utility\Wget\WgetLogEntry::class); 40 | $this->wgetLogEntry = new $wgetLogEntryProxyClass(); 41 | } 42 | 43 | 44 | public function tearDown(): void 45 | { 46 | } 47 | 48 | 49 | /** 50 | * @test 51 | */ 52 | public function wgetLogEntryCanBeIdentifiedAsError() 53 | { 54 | $this->wgetLogEntry->setStatus(500); 55 | $this->assertTrue($this->wgetLogEntry->isError()); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ext_tables.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE tx_ptextbase_cache_state ( 2 | id int(11) NOT NULL auto_increment, 3 | identifier varchar(128) NOT NULL DEFAULT '', 4 | crdate int(11) unsigned NOT NULL DEFAULT '0', 5 | content mediumtext, 6 | lifetime int(11) unsigned NOT NULL DEFAULT '0', 7 | PRIMARY KEY (id), 8 | KEY cache_id (`identifier`) 9 | ); 10 | 11 | 12 | 13 | CREATE TABLE tx_ptextbase_cache_state_tags ( 14 | id int(11) NOT NULL auto_increment, 15 | identifier varchar(128) NOT NULL DEFAULT '', 16 | tag varchar(128) NOT NULL DEFAULT '', 17 | PRIMARY KEY (id), 18 | KEY cache_id (`identifier`), 19 | KEY cache_tag (`tag`) 20 | ); 21 | 22 | 23 | 24 | CREATE TABLE tx_ptextbase_tree_node ( 25 | uid int(11) NOT NULL auto_increment, 26 | pid int(11) DEFAULT '0' NOT NULL, 27 | 28 | label tinytext, 29 | namespace tinytext, 30 | lft int(11) DEFAULT '0' NOT NULL, 31 | rgt int(11) DEFAULT '0' NOT NULL, 32 | root int(11) DEFAULT '0' NOT NULL, 33 | 34 | tstamp int(11) unsigned DEFAULT '0' NOT NULL, 35 | crdate int(11) unsigned DEFAULT '0' NOT NULL, 36 | deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, 37 | hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, 38 | 39 | t3ver_oid int(11) DEFAULT '0' NOT NULL, 40 | t3ver_id int(11) DEFAULT '0' NOT NULL, 41 | t3ver_wsid int(11) DEFAULT '0' NOT NULL, 42 | t3ver_label varchar(30) DEFAULT '' NOT NULL, 43 | t3ver_state tinyint(4) DEFAULT '0' NOT NULL, 44 | t3ver_stage tinyint(4) DEFAULT '0' NOT NULL, 45 | t3ver_count int(11) DEFAULT '0' NOT NULL, 46 | t3ver_tstamp int(11) DEFAULT '0' NOT NULL, 47 | t3_origuid int(11) DEFAULT '0' NOT NULL, 48 | 49 | sys_language_uid int(11) DEFAULT '0' NOT NULL, 50 | l18n_parent int(11) DEFAULT '0' NOT NULL, 51 | l18n_diffsource mediumblob NOT NULL, 52 | 53 | PRIMARY KEY (uid), 54 | KEY parent (pid), 55 | KEY lft (lft), 56 | KEY rgt (rgt), 57 | KEY root (root) 58 | ); -------------------------------------------------------------------------------- /Classes/Tree/ArrayTreeWriter.php: -------------------------------------------------------------------------------- 1 | get(ArrayWriterVisitor::class); 34 | $visitors[] = $arrayWriterVisitor; 35 | 36 | $arrayTreeWriter = $objectManager->get(ArrayTreeWriter::class, $visitors, $arrayWriterVisitor); 37 | return $arrayTreeWriter; 38 | } 39 | 40 | 41 | /** 42 | * Constructor for array tree writer 43 | * 44 | * @param array $visitors 45 | * @param ArrayWriterVisitor|TreeWalkerVisitorInterface $arrayWriterVisitor 46 | * @throws \Exception 47 | */ 48 | public function __construct(array $visitors, TreeWalkerVisitorInterface $arrayWriterVisitor) 49 | { 50 | parent::__construct($visitors); 51 | $this->arrayWriterVisitor = $arrayWriterVisitor; 52 | } 53 | 54 | 55 | 56 | /** 57 | * Returns array of given tree 58 | * 59 | * @param TreeInterface $tree 60 | * @return array 61 | */ 62 | public function writeTree(TreeInterface $tree) 63 | { 64 | $this->traverseTreeDfs($tree); 65 | $nodeArray = $this->arrayWriterVisitor->getNodeArray(); 66 | return $nodeArray; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Classes/Domain/Model/TTContent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | /** 28 | * Class implements read only access to tt_content table 29 | * 30 | * @package Domain 31 | * @subpackage Model\Extern 32 | * @author Daniel Lienert 33 | */ 34 | class TTContent extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity 35 | { 36 | /** 37 | * Type of the content element 38 | * 39 | * @var string $listType 40 | */ 41 | protected $listType; 42 | 43 | 44 | /** 45 | * Setter for listType 46 | * 47 | * @param string $listType 48 | * @return void 49 | */ 50 | public function setListType($listType) 51 | { 52 | $this->listType = $listType; 53 | } 54 | 55 | 56 | /** 57 | * Getter for listType 58 | * 59 | * @return string listType 60 | */ 61 | public function getListType() 62 | { 63 | return $this->listType; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Classes/Domain/Repository/SysLanguageRepository.php: -------------------------------------------------------------------------------- 1 | 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | /** 29 | * Repository for Pages 30 | * 31 | * @package Domain 32 | * @subpackage Repository 33 | * @author Michael Knoll 34 | */ 35 | class SysLanguageRepository extends \TYPO3\CMS\Extbase\Persistence\Repository 36 | { 37 | /** 38 | * Constructor of the repository. 39 | * Sets the respect storage page to false. 40 | * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager 41 | */ 42 | public function __construct(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) 43 | { 44 | parent::__construct($objectManager); 45 | $this->defaultQuerySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings(); 46 | $this->defaultQuerySettings->setRespectStoragePage(false); 47 | $this->defaultQuerySettings->setRespectSysLanguage(false); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Format/HighlightViewHelper.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 27 | 28 | /** 29 | * Timestamp ViewHelper 30 | * 31 | * @author Daniel Lienert 32 | * 33 | * @package pt_extbase 34 | * @subpackage ViewHelpers\Format 35 | */ 36 | class HighlightViewHelper extends AbstractViewHelper 37 | { 38 | /** 39 | * @param string $text 40 | * @param mixed $highlight variant 41 | * @return string 42 | */ 43 | public function render($text, $highlight) 44 | { 45 | if (!is_array($highlight)) { 46 | $highlight = [$highlight]; 47 | } 48 | 49 | $highlightTemplate = '$1'; 50 | 51 | foreach ($highlight as $highlightString) { 52 | $text = preg_replace("|($highlightString)|Ui", $highlightTemplate, $text); 53 | } 54 | 55 | return $text; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Classes/Utility/TimeTracker.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | namespace PunktDe\PtExtbase\Utility; 28 | 29 | class TimeTracker 30 | { 31 | /** 32 | * @var array 33 | */ 34 | protected static $startDates; 35 | 36 | 37 | /** 38 | * @param $trackIdentifier 39 | */ 40 | public static function start($trackIdentifier) 41 | { 42 | self::$startDates[$trackIdentifier] = microtime(true); 43 | } 44 | 45 | 46 | /** 47 | * @param $trackIdentifier 48 | * @return float Measured time in milliseconds 49 | */ 50 | public static function stop($trackIdentifier) 51 | { 52 | if (!array_key_exists($trackIdentifier, self::$startDates)) { 53 | return -1; 54 | } else { 55 | $startDate = self::$startDates[$trackIdentifier]; 56 | unset(self::$startDates[$trackIdentifier]); 57 | 58 | return (int)((microtime(true) - $startDate) * 1000); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Classes/Rbac/AllowAllService.php: -------------------------------------------------------------------------------- 1 | , punkt.de GmbH 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | 28 | /** 29 | * Class implements rbac service that allows all requested access 30 | * 31 | * This service can be used as a default service when "disabling" rbac in your extension. 32 | */ 33 | class Tx_PtExtbase_Rbac_AllowAllService implements Tx_PtExtbase_Rbac_RbacServiceInterface 34 | { 35 | /** 36 | * Returns TRUE, if currently logged in user (frontend or backend) has 37 | * access for given object and action. 38 | * 39 | * Within this implementation of rbac service, we always return TRUE 40 | * for "disabling" rbac. 41 | * 42 | * @param string $extension Name of extension to grant access 43 | * @param string $object Object to grant access to 44 | * @param string $action Action to grant access to 45 | * @return bool TRUE, if access is granted 46 | */ 47 | public function loggedInUserHasAccess($extension, $object, $action) 48 | { 49 | return true; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Classes/State/Session/SessionPersistableInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; 27 | 28 | /** 29 | * StringToLower ViewHelper 30 | * 31 | * @package pt_extbase 32 | * @subpackage ViewHelpers\Format 33 | */ 34 | class StringToLowerViewHelper extends AbstractViewHelper 35 | { 36 | /** 37 | * Initialize arguments 38 | * 39 | * @return void 40 | */ 41 | public function initializeArguments(): void 42 | { 43 | $this->registerArgument('string', 'string', 'The array key of a config items array', false); 44 | } 45 | 46 | /** 47 | * Render 48 | * 49 | * @return string 50 | */ 51 | public function render() 52 | { 53 | $result = $this->arguments['string']; 54 | if ($result === null) { 55 | $result = $this->renderChildren(); 56 | } 57 | if (is_string($result)) { 58 | $result = strtolower($result); 59 | } 60 | return $result; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Format/StringToUpperViewHelper.php: -------------------------------------------------------------------------------- 1 | 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 28 | 29 | /** 30 | * StringToLower ViewHelper 31 | * 32 | * @package pt_extbase 33 | * @subpackage ViewHelpers\Format 34 | */ 35 | class StringToUpperViewHelper extends AbstractViewHelper 36 | { 37 | /** 38 | * Initialize arguments 39 | * 40 | * @return void 41 | */ 42 | public function initializeArguments() 43 | { 44 | $this->registerArgument('string', 'string', 'The array key of a config items array', false); 45 | } 46 | 47 | /** 48 | * Render 49 | * 50 | * @return string 51 | */ 52 | public function render() 53 | { 54 | $result = $this->arguments['string']; 55 | if ($result === null) { 56 | $result = $this->renderChildren(); 57 | } 58 | if (is_string($result)) { 59 | $result = strtoupper($result); 60 | } 61 | return $result; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Classes/State/Session/Storage/AdapterInterface.php: -------------------------------------------------------------------------------- 1 | elements = []; 26 | } 27 | 28 | 29 | /** 30 | * @return mixed 31 | * @throws \Exception 32 | */ 33 | public function top() 34 | { 35 | if ($this->isEmpty()) { 36 | throw new \Exception('Trying to get top element of empty stack!', 1307861850); 37 | } 38 | return end($this->elements); 39 | } 40 | 41 | 42 | 43 | /** 44 | * Pushes an element upon the stack 45 | * 46 | * @param mixed $element 47 | */ 48 | public function push($element) 49 | { 50 | $this->elements[] = $element; 51 | } 52 | 53 | 54 | /** 55 | * @return $this 56 | * @throws \Exception 57 | */ 58 | public function pop() 59 | { 60 | if ($this->isEmpty()) { 61 | throw new \Exception('Trying to pop an empty stack!', 1307861851); 62 | } 63 | array_pop($this->elements); 64 | return $this; 65 | } 66 | 67 | 68 | 69 | /** 70 | * Returns true, if stack is empty 71 | * 72 | * @return bool Returns true, if stack is empty 73 | */ 74 | public function isEmpty() 75 | { 76 | return empty($this->elements); 77 | } 78 | 79 | 80 | 81 | /** 82 | * Returns a string representation of this stack 83 | * 84 | * @return string 85 | */ 86 | public function toString() 87 | { 88 | $string = ''; 89 | foreach (array_reverse($this->elements) as $node) { 90 | $string .= $node->toString(); 91 | } 92 | return $string; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Command/VoidCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; 25 | 26 | /** 27 | * Void Command 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Git\Command 30 | */ 31 | class VoidCommand extends GenericShellCommand 32 | { 33 | /** 34 | * A list of allowed git command options 35 | * 36 | * @var array 37 | */ 38 | protected $argumentMap = [ 39 | 'version' => '--version', 40 | ]; 41 | 42 | 43 | /** 44 | * @var array 45 | */ 46 | protected $arguments = [ 47 | 'version' => false 48 | ]; 49 | 50 | 51 | 52 | /** 53 | * @param boolean $version 54 | * @return $this 55 | */ 56 | public function setVersion($version) 57 | { 58 | $this->arguments['version'] = $version; 59 | return $this; 60 | } 61 | 62 | 63 | 64 | /** 65 | * @return string 66 | */ 67 | public function getCommandName() 68 | { 69 | return ''; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Classes/Tree/TreeContext.php: -------------------------------------------------------------------------------- 1 | resetToDefault(); 29 | } 30 | 31 | 32 | 33 | /** 34 | * @return void 35 | */ 36 | public function resetToDefault() 37 | { 38 | if (TYPO3_MODE === 'BE' || $GLOBALS['TYPO3_AJAX']) { 39 | $this->writable = true; 40 | } 41 | } 42 | 43 | 44 | 45 | /** 46 | * @param $writable 47 | */ 48 | public function setWritable($writable) 49 | { 50 | $this->writable = $writable; 51 | } 52 | 53 | 54 | 55 | /** 56 | * @return boolean 57 | */ 58 | public function isWritable() 59 | { 60 | return $this->writable; 61 | } 62 | 63 | 64 | /** 65 | * @return bool 66 | */ 67 | public function isIncludeDeleted() 68 | { 69 | return $this->includeDeleted; 70 | } 71 | 72 | 73 | /** 74 | * @param bool $includeDeleted 75 | */ 76 | public function setIncludeDeleted($includeDeleted) 77 | { 78 | $this->includeDeleted = $includeDeleted; 79 | } 80 | 81 | 82 | /** 83 | * @return bool 84 | */ 85 | public function respectEnableFields() 86 | { 87 | return !$this->isWritable(); 88 | } 89 | 90 | 91 | 92 | /** 93 | * @param boolean $respectEnableFields 94 | */ 95 | public function setRespectEnableFields($respectEnableFields) 96 | { 97 | $this->writable = !$respectEnableFields; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Format/RemoveLineBreaksViewHelper.php: -------------------------------------------------------------------------------- 1 | 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | 29 | /** 30 | * Remove Line Breaks ViewHelper 31 | * 32 | * @package pt_extbase 33 | * @subpackage ViewHelpers\Format 34 | */ 35 | class RemoveLineBreaksViewHelper extends AbstractViewHelper 36 | { 37 | /** 38 | * Initialize arguments 39 | * 40 | * @return void 41 | */ 42 | public function initializeArguments() 43 | { 44 | $this->registerArgument('string', 'string', 'The string to remove the linebreaks', false); 45 | } 46 | 47 | /** 48 | * Render 49 | * 50 | * @return string 51 | */ 52 | public function render() 53 | { 54 | $input = $this->arguments['string']; 55 | if ($input === null) { 56 | $input = $this->renderChildren(); 57 | } 58 | if (is_string($input)) { 59 | $result = preg_replace("/\n\r|\r\n|\n|\r/", "", $input); 60 | } 61 | 62 | return $result; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/CaptchaViewHelper.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper; 27 | 28 | /** 29 | * Captcha 30 | * 31 | * @package pt_extbase 32 | * @subpackage ViewHelpers 33 | */ 34 | class CaptchaViewHelper extends AbstractTagBasedViewHelper 35 | { 36 | protected $tagName = 'img'; 37 | 38 | /** 39 | * @var string 40 | */ 41 | protected $captchaGeneratorPath; 42 | 43 | /** 44 | * Initialize ViewHelper 45 | * 46 | * @return void 47 | */ 48 | public function initialize() 49 | { 50 | parent::initialize(); 51 | $this->registerUniversalTagAttributes(); 52 | $this->captchaGeneratorPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('captcha') . 'captcha/captcha.php'; 53 | } 54 | 55 | /** 56 | * Render 57 | * 58 | * @return string 59 | */ 60 | public function render() 61 | { 62 | $this->tag->addAttribute('src', $this->captchaGeneratorPath); 63 | return $this->tag->render(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Classes/Logger/Processor/ReplaceComponentProcessor.php: -------------------------------------------------------------------------------- 1 | 8 | * 9 | * This script is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published 11 | * by the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This script is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | * This copyright notice MUST APPEAR in all copies of the script! 23 | ***************************************************************/ 24 | 25 | use \TYPO3\CMS\Core\Log\LogRecord; 26 | use \TYPO3\CMS\Core\Log\Processor\AbstractProcessor; 27 | 28 | /** 29 | * Replace Component Processor 30 | * 31 | * This processor replaces the component of a log message by the first entry 32 | * of the logger data. This is a convention which is used by the pt_extbase 33 | * logger to allow different components within one logger. 34 | * 35 | * @package pt_extbase 36 | */ 37 | class ReplaceComponentProcessor extends AbstractProcessor 38 | { 39 | /** 40 | * @param LogRecord $logRecord 41 | * @return LogRecord 42 | */ 43 | public function processLogRecord(LogRecord $logRecord) 44 | { 45 | $data = $logRecord->getData(); 46 | 47 | if (array_key_exists('loggerComponent', $data)) { 48 | $logRecord->setComponent($data['loggerComponent']); 49 | unset($data['loggerComponent']); 50 | } 51 | 52 | $logRecord->setData($data); 53 | 54 | return $logRecord; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Tests/Unit/Lifecycle/HookManagerTest.php: -------------------------------------------------------------------------------- 1 | updateState(-1000); // we set a state that makes no sense 44 | $fakeArray = []; // we need a variable for passing parameter by reference 45 | $hookManager->updateEnd($fakeArray, $fakeArray); 46 | $this->assertEquals($lifecycleManager->getState(), \PunktDe\PtExtbase\Lifecycle\Manager::END); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/CommentViewHelper.php: -------------------------------------------------------------------------------- 1 | 13 | * 14 | * 15 | * This script is part of the TYPO3 project. The TYPO3 project is 16 | * free software; you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation; either version 2 of the License, or 19 | * (at your option) any later version. 20 | * 21 | * The GNU General Public License can be found at 22 | * http://www.gnu.org/copyleft/gpl.html. 23 | * 24 | * This script is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * GNU General Public License for more details. 28 | * 29 | * This copyright notice MUST APPEAR in all copies of the script! 30 | ***************************************************************/ 31 | 32 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; 33 | 34 | /** 35 | * CommentViewHelper 36 | * Displays nothing by default or the comment, if the variable "show" is set to true 37 | * Remove this viewheper if a appropriate viewhelper is implemented in fluid 38 | * 39 | * @author Daniel Lienert 40 | * @package ViewHelpers 41 | */ 42 | class CommentViewHelper extends AbstractViewHelper 43 | { 44 | /** 45 | * Return nothing or the comment if the variable is set to "show" 46 | * TODO: Think about a global variable to display / hide all comments 47 | * 48 | * @param boolean $show 49 | * @return string 50 | */ 51 | public function render($show = false) 52 | { 53 | if ($show) { 54 | return $this->renderChildren(); 55 | } else { 56 | return ''; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/RequestArgumentsViewHelper.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 27 | 28 | /** 29 | * Request Arguments ViewHelper 30 | * 31 | * @package pt_extbase 32 | * @subpackage ViewHelpers 33 | */ 34 | class RequestArgumentsViewHelper extends AbstractViewHelper 35 | { 36 | /** 37 | * @var \TYPO3\CMS\Extbase\Mvc\Request 38 | */ 39 | protected $request; 40 | 41 | /** 42 | * Initialize arguments 43 | * 44 | * @return void 45 | */ 46 | public function initializeArguments() 47 | { 48 | $this->registerArgument('key', 'string', 'The argument name', true); 49 | } 50 | 51 | /** 52 | * Initialize ViewHelper 53 | * 54 | * @return void 55 | */ 56 | public function initialize() 57 | { 58 | $this->request = $this->controllerContext->getRequest(); 59 | } 60 | 61 | /** 62 | * Render 63 | * 64 | * @return string 65 | */ 66 | public function render() 67 | { 68 | return $this->request->getArgument($this->arguments['key']); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Classes/Domain/Validator/CaptchaStringValidator.php: -------------------------------------------------------------------------------- 1 | , 8 | * Ursula Klinger , 9 | * Daniel Lienert , 10 | * Joachim Mathes 11 | * All rights reserved 12 | * 13 | * This script is part of the TYPO3 project. The TYPO3 project is 14 | * free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * The GNU General Public License can be found at 20 | * http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This script is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * This copyright notice MUST APPEAR in all copies of the script! 28 | ***************************************************************/ 29 | 30 | /** 31 | * Zora-Card-Id Validator 32 | * 33 | * @package pt_extbase 34 | * @subpackage Domain\Validator 35 | */ 36 | class Tx_PtExtbase_Domain_Validator_CaptchaStringValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator 37 | { 38 | const CAPTCHA_SESSION_KEY = 'tx_captcha_string'; 39 | 40 | protected $acceptsEmptyValues = false; 41 | 42 | /** 43 | * @var 44 | */ 45 | protected $captchaString; 46 | 47 | /** 48 | * @param string $captchaString The value that should be validated 49 | * @return boolean TRUE if the value is valid, FALSE if an error occurred 50 | */ 51 | public function isValid($captchaString) 52 | { 53 | session_start(); 54 | if ($captchaString != $_SESSION[self::CAPTCHA_SESSION_KEY]) { 55 | $this->addError('PtExtbase.CaptchaStringValidator.InputStringWrong', 1340029430); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Command/AddCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; 25 | 26 | /** 27 | * Add Command 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Git\Command 30 | */ 31 | class AddCommand extends GenericShellCommand 32 | { 33 | /** 34 | * A list of allowed git command options 35 | * 36 | * @var array 37 | */ 38 | protected $argumentMap = [ 39 | 'all' => '--all', 40 | 'path' => '%s' 41 | ]; 42 | 43 | 44 | /** 45 | * @var array 46 | */ 47 | protected $arguments = [ 48 | 'path' => '', 49 | 'all' => false 50 | ]; 51 | 52 | 53 | 54 | /** 55 | * @param boolean $path 56 | * @return $this 57 | */ 58 | public function setPath($path) 59 | { 60 | $this->arguments['path'] = $path; 61 | return $this; 62 | } 63 | 64 | 65 | /** 66 | * @param boolean $all 67 | * @return $this 68 | */ 69 | public function setAll($all) 70 | { 71 | $this->arguments['all'] = $all; 72 | return $this; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/CObjectConfigViewHelper.php: -------------------------------------------------------------------------------- 1 | 7 | * All rights reserved 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | use TYPO3\CMS\Core\TypoScript\TypoScriptService; 27 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 28 | 29 | /** 30 | * cObject Array viewHelper 31 | * 32 | * @package pt_extbase 33 | * @subpackage ViewHelpers 34 | */ 35 | class CObjectConfigViewHelper extends AbstractViewHelper 36 | { 37 | /** 38 | * Initialize arguments 39 | * 40 | * @return void 41 | */ 42 | public function initializeArguments() 43 | { 44 | } 45 | 46 | 47 | /** 48 | * Renders a cObject form an extbase formatted config 49 | * 50 | * @param mixed $config 51 | * @param array $data 52 | * @return string 53 | */ 54 | public function render($config, $data = []) 55 | { 56 | if (!is_array($config)) { 57 | return $config; 58 | } 59 | 60 | if ($data) { 61 | \Tx_PtExtbase_Div::getCobj()->start($data); 62 | } 63 | return \Tx_PtExtbase_Div::getCobj()->cObjGetSingle($config['_typoScriptNodeValue'], TypoScriptService::convertPlainArrayToTypoScriptArray($config)); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Result/Result.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\AbstractResult; 25 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\ExecutionManager; 26 | use PunktDe\PtExtbase\Utility\Git\GitExecutionManager; 27 | 28 | /** 29 | * Result 30 | * 31 | * @package PunktDe\PtExtbase\Utility\Git\Result 32 | */ 33 | class Result extends AbstractResult 34 | { 35 | 36 | /** 37 | * @var GitExecutionManager 38 | */ 39 | protected $executionManager; 40 | 41 | /** 42 | * @param ExecutionManager $executionManager 43 | * @see injectSpecificExecutionManager 44 | */ 45 | public function injectExecutionManager(ExecutionManager $executionManager): void 46 | { 47 | } 48 | 49 | /** 50 | * @param GitExecutionManager $executionManager 51 | */ 52 | public function injectSpecificExecutionManager(GitExecutionManager $executionManager): void 53 | { 54 | $this->executionManager = $executionManager; 55 | } 56 | 57 | /** 58 | * @return void 59 | */ 60 | protected function buildResult() 61 | { 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Tests/Unit/Utility/Wget/TestData/WgetTest.log: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache/2.4.6 (Red Hat) 3 | Last-Modified: Wed, 09 Jul 2014 09:08:45 GMT 4 | X-Page-is-cacheable: 1 5 | Vary: Accept-Encoding,User-Agent 6 | Content-Type: text/html; charset=utf-8 7 | Content-Length: 3951 8 | Date: Thu, 26 Feb 2015 10:50:40 GMT 9 | X-Varnish: 800975658 10 | Age: 0 11 | Via: 1.1 varnish 12 | Connection: close 13 | Cache-Control: no-cache, no-store, must-revalidate 14 | Expires: 0 15 | Pragma: no-cache 16 | 2015-02-26 11:50:40 URL:https://test.de/data-ok.html [18845] -> "/var/www/html/htdocs/fileadmin/Archive/Data/test.de/data-ok.html" [1] 17 | HTTP/1.1 404 Not Found 18 | Server: Apache/2.4.6 (Red Hat) 19 | Content-Type: text/html; charset=iso-8859-1 20 | Content-Length: 275 21 | Accept-Ranges: bytes 22 | Date: Thu, 26 Feb 2015 10:50:57 GMT 23 | X-Varnish: 800975747 24 | Age: 0 25 | Via: 1.1 varnish 26 | Connection: keep-alive 27 | https://test.de/typo3conf/jquery.selectBox-arrow.gif: 28 | 2015-02-26 11:50:57 ERROR 404: Not Found. 29 | HTTP/1.1 200 OK 30 | Server: Apache/2.4.6 (Red Hat) 31 | Last-Modified: Wed, 09 Jul 2014 09:08:46 GMT 32 | X-Page-is-cacheable: 1 33 | Vary: Accept-Encoding,User-Agent 34 | Content-Type: text/html; charset=utf-8 35 | Content-Length: 1000 36 | Date: Thu, 26 Feb 2015 10:50:58 GMT 37 | X-Varnish: 800975658 38 | Age: 0 39 | Via: 1.1 varnish 40 | Connection: close 41 | Cache-Control: no-cache, no-store, must-revalidate 42 | Expires: 0 43 | Pragma: no-cache 44 | 2015-02-26 11:50:40 URL:https://test.de/data-ok2.html [18845] -> "/var/www/html/htdocs/fileadmin/Archive/Data/test.de/data-ok2.html" [1] 45 | HTTP/1.1 404 Not Found 46 | Date: Fri, 27 Feb 2015 11:07:49 GMT 47 | Server: Apache 48 | Vary: Accept-Encoding 49 | Content-Length: 275 50 | Keep-Alive: timeout=5, max=39 51 | Connection: Keep-Alive 52 | Content-Type: text/html; charset=iso-8859-1 53 | http://partnerportal.dpppa.dev.punkt.de/typo3conf/ext/pt_dppp_base/Resources/Public/Styles/jquery.selectBox-arrow.gif: 54 | 2015-02-27 12:07:49 ERROR 404: Not Found. 55 | FINISHED --2015-02-27 12:07:49-- 56 | Total wall clock time: 6.1s 57 | Downloaded: 61 files, 935K in 0.009s (99.5 MB/s) -------------------------------------------------------------------------------- /Classes/Exception/Assertion.php: -------------------------------------------------------------------------------- 1 | file = $file; 58 | } 59 | 60 | 61 | 62 | /** 63 | * Set line 64 | * 65 | * @param string line 66 | * @return void 67 | */ 68 | public function setLine($line) 69 | { 70 | $this->line = $line; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Command/Remote/AddCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; 25 | 26 | /** 27 | * Remote Add Command 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Git\Command\Remote 30 | */ 31 | class AddCommand extends GenericShellCommand 32 | { 33 | /** 34 | * A list of allowed git command options 35 | * 36 | * @var array 37 | */ 38 | protected $argumentMap = [ 39 | 'name' => '%s', 40 | 'url' => '%s' 41 | ]; 42 | 43 | 44 | /** 45 | * @var array 46 | */ 47 | protected $arguments = [ 48 | 'name' => '', 49 | 'url' => '' 50 | ]; 51 | 52 | 53 | 54 | /** 55 | * @param string $name 56 | * @return $this 57 | */ 58 | public function setName($name) 59 | { 60 | $this->arguments['name'] = $name; 61 | return $this; 62 | } 63 | 64 | 65 | 66 | /** 67 | * @param string $url 68 | * @return $this 69 | */ 70 | public function setUrl($url) 71 | { 72 | $this->arguments['url'] = $url; 73 | return $this; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Be/TceLinkViewHelper.php: -------------------------------------------------------------------------------- 1 | registerArgument('action', 'string', 'Action', true); 18 | $this->registerArgument('recordType', 'string', 'RecordType', true); 19 | $this->registerArgument('uid', 'int', 'uid', false, 0); 20 | $this->registerArgument('pid', 'int', 'pid', false, 0); 21 | } 22 | 23 | /** 24 | * @return string 25 | * @throws \Exception 26 | */ 27 | public function render() { 28 | 29 | $action = $this->arguments['action']; 30 | $recordType = $this->arguments['recordType']; 31 | $uid = $this->arguments['uid']; 32 | $pid = $this->arguments['pid']; 33 | 34 | if ($action === 'new') { 35 | $urlParameters = [ 36 | 'edit' => [ 37 | $recordType => [ 38 | (string)$pid => $action 39 | ] 40 | ], 41 | 'id' => (string)$pid, 42 | 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') 43 | ]; 44 | 45 | } elseif ($action === 'edit') { 46 | $urlParameters = [ 47 | $action => [ 48 | $recordType => [ 49 | (string)$uid => $action 50 | ] 51 | ], 52 | 'id' => (string)$pid, 53 | 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') 54 | ]; 55 | } else { 56 | throw new \Exception(sprintf('action %s is not yet implemented', $action), 1484586867); 57 | } 58 | 59 | $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); 60 | return $uriBuilder->buildUriFromRoute('record_edit', $urlParameters); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Classes/ViewHelpers/Uri/CurrentViewHelper.php: -------------------------------------------------------------------------------- 1 | , 7 | * 8 | * 9 | * All rights reserved 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | use TYPO3\CMS\Core\Utility\GeneralUtility; 28 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper 29 | 30 | /** 31 | * ViewHelper used to render a HEAD meta tag 32 | * 33 | * @author Daniel Lienert 34 | * @package Viewhelpers 35 | * @subpackage Uri 36 | */ 37 | class CurrentViewHelper extends AbstractViewHelper 38 | { 39 | /** 40 | * Disable the escaping interceptor because otherwise the child nodes would be escaped before this view helper 41 | * can decode the text's entities. 42 | * 43 | * @var boolean 44 | */ 45 | protected $escapingInterceptorEnabled = false; 46 | 47 | /** 48 | * @param bool $absolute 49 | * @param array $additionalParams 50 | * @return string 51 | */ 52 | public function render($absolute = true, $additionalParams = []) 53 | { 54 | if ($absolute === true) { 55 | $uri = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'); 56 | } else { 57 | $uri = GeneralUtility::getIndpEnv('REQUEST_URI'); 58 | } 59 | 60 | return $uri; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Command/InitCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; 25 | 26 | /** 27 | * Init Command 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Git\Command 30 | */ 31 | class InitCommand extends GenericShellCommand 32 | { 33 | /** 34 | * A list of allowed git command options 35 | * 36 | * @var array 37 | */ 38 | protected $argumentMap = [ 39 | 'bare' => '--bare', 40 | 'shared' => '--shared' 41 | ]; 42 | 43 | 44 | /** 45 | * @var array 46 | */ 47 | protected $arguments = [ 48 | 'bare' => false, 49 | 'shared' => false 50 | ]; 51 | 52 | 53 | /** 54 | * @param boolean $bare 55 | * @return $this 56 | */ 57 | public function setBare($bare) 58 | { 59 | $this->arguments['bare'] = $bare; 60 | return $this; 61 | } 62 | 63 | 64 | 65 | /** 66 | * @param boolean $shared 67 | * @return $this 68 | */ 69 | public function setShared($shared) 70 | { 71 | $this->arguments['shared'] = $shared; 72 | return $this; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Classes/ContextInterface.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 8 | * All rights reserved 9 | * 10 | * 11 | * This script is part of the TYPO3 project. The TYPO3 project is 12 | * free software; you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation; either version 2 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * The GNU General Public License can be found at 18 | * http://www.gnu.org/copyleft/gpl.html. 19 | * 20 | * This script is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | * 25 | * This copyright notice MUST APPEAR in all copies of the script! 26 | ***************************************************************/ 27 | 28 | /** 29 | * Interface for Context object (to configure used object via typoscrit) 30 | * 31 | * @author Daniel Lienert 32 | */ 33 | 34 | interface ContextInterface extends \TYPO3\CMS\Core\SingletonInterface 35 | { 36 | /** 37 | * Defines if the extension act as it is in cached mode 38 | * @return bool 39 | */ 40 | public function isInCachedMode(); 41 | 42 | 43 | 44 | /** 45 | * Set the cached mode for the complete extension. 46 | * This is autmatically set when extlsit is used as standalone cached extension 47 | * 48 | * @param bool $inCachedMode 49 | */ 50 | public function setInCachedMode($inCachedMode); 51 | 52 | 53 | 54 | /** 55 | * @return \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext 56 | */ 57 | public function getControllerContext(); 58 | 59 | 60 | 61 | /** 62 | * @return string 63 | */ 64 | public function getExtensionName(); 65 | 66 | 67 | 68 | /** 69 | * @return string 70 | */ 71 | public function getExtensionNamespace(); 72 | } 73 | -------------------------------------------------------------------------------- /Classes/Extbase/Bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; 25 | 26 | /** 27 | * Extbase Bootstrap 28 | * 29 | * @package PunktDe\PtExtbase\Extbase 30 | */ 31 | class Bootstrap 32 | { 33 | /** 34 | * @var ObjectManagerInterface 35 | */ 36 | protected $objectManager; 37 | 38 | 39 | /** 40 | * @param ObjectManagerInterface $objectManager 41 | */ 42 | public function injectObjectManager(ObjectManagerInterface $objectManager) 43 | { 44 | $this->objectManager = $objectManager; 45 | } 46 | 47 | 48 | 49 | /** 50 | * @param string $extensionName The condensed upper camel case extension key 51 | * @param string $pluginName 52 | * @return void 53 | */ 54 | public function boot($extensionName, $pluginName = 'dummy') 55 | { 56 | $configuration['extensionName'] = $extensionName; 57 | $configuration['pluginName'] = $pluginName; 58 | $extbaseBootstrap = $this->objectManager->get('TYPO3\CMS\Extbase\Core\Bootstrap'); /** @var \TYPO3\CMS\Extbase\Core\Bootstrap $extbaseBootstrap */ 59 | $extbaseBootstrap->initialize($configuration); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Classes/Utility/FeBeModeDetector.php: -------------------------------------------------------------------------------- 1 | , punkt.de GmbH 6 | * 7 | * 8 | * All rights reserved 9 | * 10 | * This script is part of the TYPO3 project. The TYPO3 project is 11 | * free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * The GNU General Public License can be found at 17 | * http://www.gnu.org/copyleft/gpl.html. 18 | * 19 | * This script is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * This copyright notice MUST APPEAR in all copies of the script! 25 | ***************************************************************/ 26 | 27 | 28 | /** 29 | * Class implements detector for TYPO3 mode. 30 | * 31 | * This class is mainly used for testing, as it can be mocked and hence 32 | * return arbitrary modes in a test. 33 | * 34 | * @author Michael Knoll 35 | * @package rbac 36 | */ 37 | class Tx_PtExtbase_Utility_FeBeModeDetector implements \TYPO3\CMS\Core\SingletonInterface 38 | { 39 | /** 40 | * Returns mode, TYPO3 is currently run in. 41 | * 42 | * @return string 43 | */ 44 | public function getMode() 45 | { 46 | if (TYPO3_MODE == 'BE') { 47 | return 'BE'; 48 | } else { 49 | return 'FE'; 50 | } 51 | } 52 | 53 | 54 | 55 | /** 56 | * Returns TRUE, if we are in BE mode 57 | * 58 | * @return bool 59 | */ 60 | public function inBackendMode() 61 | { 62 | return ($this->getMode() == 'BE'); 63 | } 64 | 65 | 66 | 67 | /** 68 | * Returns TRUE, if we are in FE mode 69 | * 70 | * @return bool 71 | */ 72 | public function inFrontendMode() 73 | { 74 | return ($this->getMode() == 'FE'); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Classes/SqlGenerator/SqlFileSqlGenerator.php: -------------------------------------------------------------------------------- 1 | , 8 | * Ursula Klinger , 9 | * Daniel Lienert , 10 | * Joachim Mathes 11 | * All rights reserved 12 | * 13 | * This script is part of the TYPO3 project. The TYPO3 project is 14 | * free software; you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation; either version 2 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * The GNU General Public License can be found at 20 | * http://www.gnu.org/copyleft/gpl.html. 21 | * 22 | * This script is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | * 27 | * This copyright notice MUST APPEAR in all copies of the script! 28 | ***************************************************************/ 29 | 30 | /** 31 | * SQL-File SQL Generator 32 | * 33 | * @package pt_extbase 34 | * @subpackage SqlGenerator 35 | */ 36 | class Tx_PtExtbase_SqlGenerator_SqlFileSqlGenerator implements Tx_PtExtbase_SqlGenerator_SqlGeneratorCommandInterface 37 | { 38 | /** 39 | * @var Tx_PtExtbase_Parser_Sql_MultipleQueriesFileParser 40 | */ 41 | protected $multipleQueriesFileParser; 42 | 43 | /** 44 | * @param Tx_PtExtbase_Parser_Sql_MultipleQueriesFileParser $multipleQueriesFileParser 45 | * @return void 46 | */ 47 | public function injectMultipleQueriesFileParser(Tx_PtExtbase_Parser_Sql_MultipleQueriesFileParser $multipleQueriesFileParser) 48 | { 49 | $this->multipleQueriesFileParser = $multipleQueriesFileParser; 50 | } 51 | 52 | /** 53 | * @param string $filePath 54 | * @return array 55 | */ 56 | public function generate($filePath) 57 | { 58 | return $this->multipleQueriesFileParser->parse($filePath); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Classes/Utility/Git/GitExecutionManager.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use Neos\Utility\Files; 25 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\ExecutionManager; 26 | use PunktDe\PtExtbase\Utility\Git\Command; 27 | 28 | /** 29 | * Git Execution Manager 30 | * 31 | * @package PunktDe\PtExtbase\Utility\Git 32 | */ 33 | class GitExecutionManager extends ExecutionManager 34 | { 35 | /** 36 | * @var \PunktDe\PtExtbase\Utility\Git\GitRepository 37 | */ 38 | protected $repository; 39 | 40 | 41 | /** 42 | * @var string 43 | */ 44 | protected $commandLine = ''; 45 | 46 | 47 | /** 48 | * @return string 49 | */ 50 | protected function renderCommand() 51 | { 52 | $this->commandLine = sprintf('cd %s; %s --git-dir=%s %s', $this->repository->getRepositoryRootPath(), $this->repository->getCommandPath(), Files::concatenatePaths([$this->repository->getRepositoryRootPath(), '.git']), $this->command->render()); 53 | } 54 | 55 | 56 | 57 | /** 58 | * @param \PunktDe\PtExtbase\Utility\Git\GitRepository $repository 59 | */ 60 | public function setRepository($repository) 61 | { 62 | $this->repository = $repository; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Classes/Utility/Git/Command/CommitCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * This script is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This script is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * This copyright notice MUST APPEAR in all copies of the script! 22 | ***************************************************************/ 23 | 24 | use PunktDe\PtExtbase\Utility\GenericShellCommandWrapper\GenericShellCommand; 25 | 26 | /** 27 | * Commit Command 28 | * 29 | * @package PunktDe\PtExtbase\Utility\Git\Command 30 | */ 31 | class CommitCommand extends GenericShellCommand 32 | { 33 | /** 34 | * A list of allowed git command options 35 | * 36 | * @var array 37 | */ 38 | protected $argumentMap = [ 39 | 'allowEmpty' => '--allow-empty', 40 | 'message' => '--message %s' 41 | ]; 42 | 43 | 44 | /** 45 | * @var array 46 | */ 47 | protected $arguments = [ 48 | 'allowEmpty' => false, 49 | 'message' => '' 50 | ]; 51 | 52 | 53 | 54 | /** 55 | * @param boolean $allowEmpty 56 | * @return $this 57 | */ 58 | public function setAllowEmpty($allowEmpty) 59 | { 60 | $this->arguments['allowEmpty'] = $allowEmpty; 61 | return $this; 62 | } 63 | 64 | 65 | 66 | /** 67 | * @param string $message 68 | * @return $this 69 | */ 70 | public function setMessage($message) 71 | { 72 | $this->arguments['message'] = sprintf("\"%s\"", $message); 73 | return $this; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Tests/Unit/ViewHelpers/Tree/SelectorViewHelperTest.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 6 | * All rights reserved 7 | * 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | /** 27 | * Testcase for Tree SelectorViewHelper 28 | * 29 | * @package pt_extbase 30 | * @subpackage Tests\ViewHelpers\Tree 31 | * @author Daniel Lienert 32 | */ 33 | class Tx_PtExtbase_Tests_Unit_ViewHelpers_Tree_SelectorViewhelperTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 34 | { 35 | /** 36 | * @var \PunktDe\PtExtbase\ViewHelpers\Tree\SelectorViewHelper 37 | */ 38 | protected $accessibleProxyClass; 39 | 40 | /** 41 | * @var \PunktDe\PtExtbase\ViewHelpers\Javascript\TemplateViewHelper 42 | */ 43 | protected $accessibleProxy; 44 | 45 | 46 | public function setUp(): void 47 | { 48 | $this->accessibleProxyClass = $this->buildAccessibleProxy('\PunktDe\PtExtbase\ViewHelpers\Tree\SelectorViewHelper'); 49 | $this->accessibleProxy = new $this->accessibleProxyClass(); 50 | } 51 | 52 | public function tearDown(): void 53 | { 54 | unset($this->accessibleProxy); 55 | } 56 | 57 | /** 58 | * @test 59 | */ 60 | public function classExists() 61 | { 62 | $this->assertTrue(class_exists('\PunktDe\PtExtbase\ViewHelpers\Tree\SelectorViewHelper')); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Tests/Unit/ViewHelpers/Format/CssNameViewHelperTest.php: -------------------------------------------------------------------------------- 1 | , Michael Knoll 6 | * All rights reserved 7 | * 8 | * 9 | * This script is part of the TYPO3 project. The TYPO3 project is 10 | * free software; you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation; either version 2 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * The GNU General Public License can be found at 16 | * http://www.gnu.org/copyleft/gpl.html. 17 | * 18 | * This script is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * This copyright notice MUST APPEAR in all copies of the script! 24 | ***************************************************************/ 25 | 26 | 27 | /** 28 | * 29 | * @package Tests 30 | * @subpackage ViewHelpers/Format 31 | * @author Daniel Lienert 32 | */ 33 | 34 | class Tx_PtExtbase_Tests_Unit_ViewHelpers_Format_CssNameViewHelperTest extends \PunktDe\PtExtbase\Testing\Unit\AbstractBaseTestcase 35 | { 36 | /** 37 | * 38 | * @returns array 39 | */ 40 | public static function nameDataProvider() 41 | { 42 | return [ 43 | 'camelCase ' => ['DasIstEinTest', 'das-ist-ein-test'], 44 | 'Spaces ' => ['Das ist ein Test', 'das-ist-ein-test'], 45 | 'Spaces before and after ' => [' Das ist ein Test ', 'das-ist-ein-test'], 46 | ]; 47 | } 48 | 49 | 50 | /** 51 | * @test 52 | * @dataProvider nameDataProvider 53 | */ 54 | public function render($input, $formatedOutput) 55 | { 56 | $viewHelper = $this->getMockBuilder(\PunktDe\PtExtbase\ViewHelpers\Format\CssNameViewHelper::class) 57 | ->setMethods(['renderChildren']) 58 | ->getMock(); 59 | $viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue($input)); 60 | 61 | $actualResult = $viewHelper->render(); 62 | $this->assertEquals($formatedOutput, $actualResult); 63 | } 64 | } 65 | --------------------------------------------------------------------------------