Review main Merged

24523[FEATURE] Allow adding multiple CSS files in RTE

Eric Chavaillaz CR +2 V +2 Normal +80 −31 updated 10/23/14, 12:48

Commit message

Allow to add more than one CSS file in the RTE header.

The new syntax is like this:
    RTE.default.contentCSS {
        file1 = fileadmin/myStylesheet1.css
        file2 = fileadmin/myStylesheet2.css
    }

If no CSS files are set, the RTE default CSS file is still added.

Review

  • Code review CR +2
    • Stanislas Rolland +2
  • Verified V +2
    • Stanislas Rolland +2

Issues 1

Files 6

Review log 28

Show 3 earlier messages
  1. Mr. Jenkins commented on patch set 1 10/10/13, 12:08

  2. Philipp Gampe commented on patch set 1 V -1 CR -1 10/10/13, 12:12

    Patch misses the compat handling for the old setting. Essentially, you have to add any filename given directly to contentCSS to the array defined in contentCSS. Do to the nature of TypoScript, you do this without hacks.

    RteHtmlAreaBase.php:544

    add compat handling for contentCSS = filename here: if (isset($this->thisConfig['contentCSS'])) { $contentCss[] = $this->getContentCssFileName(); }

    RteHtmlAreaBase.php:547

    !empty is wrong here ... it should be count() I guess?

    RteHtmlAreaBase.php:555

    is_array is not needed, because it is defined above ... you can just check with count() === 0 if the arrays has entries

    RteHtmlAreaBase.php:983

    it is always an array, because you add ['default'] in case it is empty

    htmlarea.js:1045

    are you sure that this part is not needed?
  3. Eric Chavaillaz uploaded patch set 2 10/10/13, 12:51

  1. Eric Chavaillaz commented on patch set 2 10/10/13, 12:54

    For the deleted lines in the js file, I am almost sure because those lines are here to check if a <link> tag is already inserted with the contentCSS property...
  2. Mr. Jenkins commented on patch set 2 10/10/13, 13:02

  3. Xavier Perseguers commented on patch set 2 10/10/13, 14:28

    RteHtmlAreaBase.php:533

    $contentCssFile (capital F) please

    htmlarea.js:159

    Why this comment line again?
  4. Xavier Perseguers uploaded patch set 3 10/10/13, 14:32

  5. Mr. Jenkins commented on patch set 3 10/10/13, 14:44

  6. Eric Chavaillaz commented on patch set 3 10/10/13, 14:54

    Thanks Xavier for the corrections.
  7. Stefan Neufeind commented on patch set 3 CR -1 10/17/13, 14:15

    RteHtmlAreaBase.php:543

    add "array" as type for the return Maybe in the same step also rename to "getContentCssFilenames" or just "...Files"? Those are multiple names/files now

    RteHtmlAreaBase.php:544

    check if that array exists. If not, initialise with an empty array

    RteHtmlAreaBase.php:547

    maybe just prepend that to the array and further below do an array_unique() for all the entries?

    RteHtmlAreaBase.php:988

    you miss the "versionnumbered"-part here (to force the browser to reload a new version of the file)
  8. Eric Chavaillaz uploaded patch set 4 10/17/13, 15:44

  9. Mr. Jenkins commented on patch set 4 10/17/13, 15:57

  10. Stefan Neufeind commented on patch set 4 CR +1 10/17/13, 17:03

    Looks okay by reading imho

    RteHtmlAreaBase.php:560

    you could move this if a few lines below and avoid the following else then (actually a "duplication" - sort of).
  11. Eric Chavaillaz uploaded patch set 5 10/17/13, 17:24

  12. Mr. Jenkins commented on patch set 5 10/17/13, 17:36

  13. Stefan Neufeind voted on patch set 5 CR +1 10/17/13, 17:52

  14. Krzysztof Adamczyk voted on patch set 5 V +1 CR +1 06/11/14, 14:30

  15. Xavier Perseguers commented on patch set 5 06/12/14, 10:06

    RteHtmlAreaBase.php:533

    same here (see below)

    RteHtmlAreaBase.php:987

    You should not use the result of a method in a foreach => $contentCssFileNames = $this->getContentCssFileNames(); foreach ($contentCssFileNames as $contentCssFileName) {
  16. Eric Chavaillaz uploaded patch set 6 06/12/14, 11:38

  17. Mr. Jenkins commented on patch set 6 06/12/14, 12:50

  18. Xavier Perseguers uploaded patch set 7 09/21/14, 12:49

  19. Xavier Perseguers voted on patch set 7 CR +1 09/21/14, 12:50

  20. Stefan Neufeind voted on patch set 7 CR +1 09/21/14, 16:01

  21. Stanislas Rolland uploaded patch set 8 10/23/14, 01:55

  22. Markus Klein commented on patch set 8 10/23/14, 03:00

    Feature-50039-MultipleCssFilesInRte.rst:3

    these need to be same length as title
  23. Stanislas Rolland uploaded patch set 9 10/23/14, 12:47

  24. Stanislas Rolland voted on patch set 9 CR +2 V +2 10/23/14, 12:48

  25. Stanislas Rolland merged patch set 9 10/23/14, 12:48