Task #63729

Epic #62041: twbs Bootstrap backend, refactor EXT:t3skin and HTML5 output

Epic #62334: Modals in Backend

API for twbs modals

Added by Andreas Fernandez almost 6 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Must have
Category:
Backend User Interface
Target version:
Start date:
2014-12-10
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Bootstrap brings modal to us. That's nice, but currently hard to implement in the TYPO3 backend.
We need an API to create modals easiliy, similar to our Flashmessages.

Example:

TYPO3.Modal({
    title: 'Fnord',
    closable: false,
    severity: TYPO3.Severity.ok
    content: '<p>I\'m a content, I contain content.</p>',
    actions = [
        {
            text: 'Login',
            trigger: TYPO3.Loginrefresh.triggerSubmit()
        }, {
            text: 'No, log out.',
            trigger: TYPO3.Loginrefresh.logout()
        }
    ]
});

This call would return the generated modal. You may need it to do things with the modal, the API does not provide (yet).

.show() displays the modal directly.

API options (* marks required):
  • title* (string): The header displayed in the top bar of the modal
  • content* (string): The content (duh!) in the modal body
  • closable (bool): Marks the modal as closable. Default: true
  • severity (int): Marks the severity of the modal and draws a left border. Default: TYPO3.Severity.info (-1)
  • actions (array): The action buttons rendered into the modal footer. If empty or undefined, the footer is not rendered

A minimal API call would look like this:

TYPO3.Modal({
    title: 'Fnord',
    content: '<p>I\'m a content, I contain content.</p>',
}).show();

Some thoughts:
  • Generated modals are kept in the DOM, so they don't need to be created again if they are needed.
  • To avoid bloating the DOM, we just keep the ten(?) latest modals
  • Make sure modals are attached to window.top, not the frame that calls it (Kudos to Kay Strobach)

Associated revisions

Revision 4a22b59e (diff)
Added by Andreas Fernandez almost 6 years ago

[FEATURE] API for Bootstrap Modals

This patch introduces a new BE API for modals.
We introduce only a confirm method, because
the modal should be used as few as possible and
only for small information or confirm dialogs.

Resolves: #63729
Releases: master
Change-Id: Ie2ed6742fbebbc982afabb4eff01045fb2318492
Reviewed-on: http://review.typo3.org/35313
Reviewed-by: Frank Nägler <>
Tested-by: Frank Nägler <>
Reviewed-by: Benjamin Mack <>
Tested-by: Benjamin Mack <>

History

#1 Updated by Andreas Fernandez almost 6 years ago

  • Check, if content has HTML. If not, wrap it with <p>

#2 Updated by Gerrit Code Review almost 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#3 Updated by Gerrit Code Review almost 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#4 Updated by Gerrit Code Review almost 6 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#5 Updated by Felix Kopp almost 6 years ago

  • Parent task set to #62334

#6 Updated by Gerrit Code Review almost 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#7 Updated by Gerrit Code Review almost 6 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#8 Updated by Gerrit Code Review almost 6 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#9 Updated by Gerrit Code Review almost 6 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#10 Updated by Gerrit Code Review almost 6 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#11 Updated by Gerrit Code Review almost 6 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#12 Updated by Gerrit Code Review almost 6 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#13 Updated by Gerrit Code Review almost 6 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#14 Updated by Gerrit Code Review almost 6 years ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#15 Updated by Gerrit Code Review almost 6 years ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#16 Updated by Gerrit Code Review almost 6 years ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#17 Updated by Gerrit Code Review almost 6 years ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#18 Updated by Gerrit Code Review almost 6 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#19 Updated by Gerrit Code Review almost 6 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#20 Updated by Gerrit Code Review almost 6 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#21 Updated by Gerrit Code Review almost 6 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35313

#22 Updated by Andreas Fernandez almost 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#23 Updated by Riccardo De Contardi about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF