Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • T TYPO3.CMS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • accessibilityaccessibility
  • TYPO3.CMS
  • Repository
  • TYPO3.CMS
  • typo3
  • sysext
  • backend
  • Classes
  • Controller
  • NewRecordController.php
Find file Blame History Permalink
  • ohader's avatar
    [TASK] Avoid inline JavaScript generated by BackendUtility:viewOnClick · f16b4787
    ohader authored Jul 16, 2020 and benni's avatar benni committed Dec 10, 2020
    Inline JavaScript produced by BackendUtility:viewOnClick is substituted
    with markup based instructions and static JavaScript event handlers.
    
    // basically delivers window.open(generatedUri)
    BackendUtility::viewOnClick($pageId, $backPath, $rootLine, $section,
        $viewUri, $getVars, $switchFocus);
    
    can be substituted with e.g.
    
    \TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($pageId, $viewUri)
        ->withRootLine($rootLine)
        ->withSection($section)
        ->withAdditionalQueryParameters($getVars)
        ->serializeDispatcherAttributes([
            PreviewUriBuilder::OPTION_SWITCH_FOCUS => $switchFocus,
        ]);
    
    which results in the following HTML data attributes
    (data can be retrieved as array of complete element as well)
    
    data-dispatch-action="TYPO3.WindowManager.localOpen"
    data-dispatch-args="["https://...",null,"previewWin"]"
    
    Resolves: #91123
    Releases: master
    Change-Id: Iedd9bfe60827977677ee68e2c948c63e359abf84
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64243
    
    
    Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Tested-by: default avatarTYPO3com <noreply@typo3.com>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    f16b4787