1. 08 May, 2022 1 commit
  2. 04 May, 2022 1 commit
  3. 22 Apr, 2022 1 commit
    • Benni Mack's avatar
      [!!!][FEATURE] Introduce dedicated class to create typolinks with unified Event · 4f7c4d1c
      Benni Mack authored and Oliver Bartsch's avatar Oliver Bartsch committed
      This change moves all "typolink" functionality
      from cObj->typolink into a custom "LinkFactory"
      class which then calls custom LinkBuilders (as before)
      to do their work.
      
      The main benefit is separation of concerns, thinning
      out functionality from the monster ContentObjectRenderer
      functionality.
      
      Instead of the global hook
      $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc']
      a new PSR-14 Event "AfterLinkIsGeneratedEvent" is introduced,
      which in turn uses the LinkResult to operate on.
      
      This new Event also makes the hook
      $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors']
      obsolete, which was used for non-page links + URLs. As
      all functionality for frontend links are now running
      through this event, which contains all information.
      
      In addition, typolink.userFunc now receives
      a LinkResult object instead of a <a> string with arguments,
      and needs to return a LinkResult object again.
      
      Also, the ATagParams hook vanished as well, since the
      new Event can be used easily (and in a much better way!)
      
      Both parts are breaking, all other parts are expected
      to work as before.
      
      A new HtmlLinkResult is added, which allows for building
      a HSC'ed <a> tag properly in typolink().
      
      Architectural Details:
      
      * LinkFactory (new class) is now handling the "typolink" logic
        for creating any kind of links or URLs (page/mails/files).
        For the actual logic of e.g, pages the "PageLinkBuilder" is used
        in this place.
      * Internally, LinkFactory follows the same generation as
        cObj->typolink() before, but uses methods to make the code
        more readable.
      * In the end, LinkFactory will return a "LinkResultInterface"
        which contains everything to build a <a> tag, however it
        cannot return a "UriInterface" from PSR-7, as a
        link to mailto: is not a URL, thus, not supported by PSR-7.
      * The main "cObj->typolink()" method then takes the LinkResultInterface
        and wraps it into a HtmlLinkResult which does a htmlspecialchars()
        around all the attributes and the $linkText. So this is still
        the way to go to use from a public API point of view.
      * As typolink() heavily depends on stdWrap() and thus on cObject
        this information needs to be injected properly of course, and
        has the hard dependency when creating links in the Frontend.
      * new methods $cObj->createUrl() and $cObj->createLink() are added
        to make use of the LinkInterface functionality programmatically,
        so people can choose to get a hsc'ed result via typolink(),
        or typolink_URL(), or a pure data via createUrl() and createLink().
      
      Next steps / further patches:
      * Deprecate "lastTypoLink_LD" etc.
      * Move LinkResultFactory into LinkFactory with ClassAlias
      * Maybe add another method to just generate an URL to the LinkFactory
      * Create JsonLinkResult object and clean up original LinkResult object
      
      Resolves: #96641
      Resolves: #92029
      Releases: main
      Change-Id: Ic9ce01153a0cfdcbacb15e1e3f3e382f95400192
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72999
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
      Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
      Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
      Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
      4f7c4d1c
  4. 07 Apr, 2022 1 commit
  5. 01 Apr, 2022 1 commit
    • Oliver Bartsch's avatar
      [FEATURE] Introduce TCA type "color" · 12a6613f
      Oliver Bartsch authored
      In the process of using dedicated TCA types,
      the new TCA type "color" is introduced and
      replaces "renderType=colorpicker" of TCA
      type "input".
      
      Notable changes to the previous behaviour:
      
      - The maxlength is set to 7, since this is
        the maximum length for the hex color
        (#XXXXX | /#[0-9a-fA-F]{3,6}/)
      - The only allowed eval is "null"
      - "trim" is always done in DataHandler and FormEngine
      
      Note: The maxlength might change again
      as soon as we switch to another color
      picker which supports e.g. opacity
      specification.
      
      The TCA type is now wrapped into a custom
      element. Also does it now use the general
      ValuePicker JS module, instead of duplicating
      this functionality in the ColorPicker JS module.
      
      The ColorPicker JS module is furthermore
      refactored. Global initialization of the
      color pickers is deprecated. To initialize
      the ColorPicker for an element, it has to
      be provided as first argument in the
      initialize() method.
      
      used command:
      > composer u typo3/cms-styleguide
      
      Resolves: #97271
      Releases: main
      Change-Id: I1418b100ae214499be7b01f6c94539a6cb6baa3b
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74121
      
      Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
      Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
      Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
      12a6613f
  6. 30 Mar, 2022 1 commit
  7. 24 Mar, 2022 1 commit
  8. 22 Mar, 2022 1 commit
  9. 21 Mar, 2022 2 commits
  10. 25 Feb, 2022 1 commit
  11. 07 Feb, 2022 1 commit
    • Oliver Bartsch's avatar
      [!!!][FEATURE] New Module Registration API · 29db88c3
      Oliver Bartsch authored and Benni Mack's avatar Benni Mack committed
      This change introduces a new way to register
      TYPO3 Backend Modules.
      
      Each module is now registered during build-time
      in a dedicated registry. Therefore, The registration
      is moved from ext_tables.php to the
      Configuration/Backend/Modules.php file.
      
      Accessing the registered modules can be done via
      a central API, the ModuleProvider class. This class
      takes care of access permissions and further
      processing (e.g. module menu generation).
      
      $GLOBALS[TBE_MODULES] is fully removed as no sane
      backwards-compatibility (for a use-case) is available.
      
      A new PSR-14 event BeforeModuleCreationEvent is added,
      which allows to manipulate a module configuration, before
      it is used to create and register the module.
      
      Existing registrations do no longer work. However, to support
      extenion authors in maintaining multiple versions, the previously
      used API methods (e.g. `addModule` and `registerModule`) will
      stay until TYPO3 v13.0. No trigger_error() is used, so extension
      authors use the Extension Scanner to detect usages.
      
      Executed commands:
      
         composer u typo3/cms-styleguide
      
      Resolves: #96733
      Releases: main
      Change-Id: I07f4bc417e6effb1215cf0e373cc60f2b13ba8ad
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73058
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
      Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      29db88c3
  12. 01 Feb, 2022 1 commit
  13. 14 Jan, 2022 1 commit
  14. 13 Jan, 2022 1 commit
  15. 12 Jan, 2022 1 commit
  16. 08 Dec, 2021 1 commit
  17. 04 Dec, 2021 1 commit
  18. 03 Dec, 2021 1 commit
  19. 02 Dec, 2021 4 commits
  20. 01 Dec, 2021 3 commits
  21. 30 Nov, 2021 4 commits
  22. 29 Nov, 2021 1 commit
  23. 28 Nov, 2021 4 commits
  24. 24 Sep, 2021 1 commit
  25. 16 Sep, 2021 1 commit
  26. 15 Sep, 2021 1 commit
    • Christian Kuhn's avatar
      [TASK] Deprecate ext:backend BackendTemplateView · 98267055
      Christian Kuhn authored
      The BackendTemplateView is a - usually Extbase backend
      module related - Fluid view that adds a default backend
      ModuleTemplate to render backend module content.
      
      That implementation has a couple of drawbacks:
      * Using BackendTemplateView hides a dependency to the
        request object by triggering a fallback in ModuleTemplate
        accessing $GLOBALS['TYPO3_REQUEST'].
      * Using $this->view->getModuleTemplate() is pretty ugly,
        controllers should work with the ModuleTemplateFactory
        instead and retrieve an instance of ModuleTemplate using
        create($request).
      * The level of indirection by having ModuleTemplate within
        the view class magically created makes controller actions
        harder to follow and understand.
      
      With extbase Request nowadays implementing ServerRequestInterface
      we can get rid of this indirection: Controllers should get an
      instance of ModuleTemplateFactory injected, receive the
      ModuleTemplate using ->create($request), and add further
      title and doc header related details using that instance.
      
      The patch changes ext:indexed_search, ext:extensionmanager and
      ext:form to do that, and deprecates BackendTemplateView.
      
      Change-Id: I613a560c8fc3c35343e31f397479f0c008a4a314
      Resolves: #95164
      Related: #92513
      Related: #94428
      Related: #94209
      Related: #93885
      Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70973
      
      Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
      Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
      Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
      Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
      Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
      Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
      98267055
  27. 09 Sep, 2021 1 commit
  28. 08 Sep, 2021 1 commit