CRM-18792 - CRM_Core_Theme - Add helper for loading CSS files from themes
authorTim Otten <totten@civicrm.org>
Tue, 7 Jun 2016 00:23:27 +0000 (18:23 -0600)
committereileen <emcnaughton@wikimedia.org>
Sat, 15 Jun 2019 00:11:59 +0000 (20:11 -0400)
commitd89d2545b747160ac91c1bfc93abaebc8a96f1b6
tree8ea9a27b321f79d899ee1977c310f3bf7f4c6163
parent583a99110950126b46f6ed2dad2e85d9a74ad2d9
CRM-18792 - CRM_Core_Theme - Add helper for loading CSS files from themes

CRM-18792 - CRM_Core_Resources - Load civicrm.css through theme system

CRM-18792 - Rename `CRM_Core_Theme` to `\Civi\Core\Theme`

CRM-18792 - Civi\Core\Theme - Remove statics

WIP

CRM_Core_Resources::addCoreStyles - Revert change

CRM-18792 - addStyleFile - Always pass through to theme. Support fallback.

Rename `Civi\Core\Theme` to `Civi\Core\Themes`

The class manages a list of themes -- not just a single theme.

CRM-18792 - Add org.civicrm.demotheme

CRM-18792 - Add uncommitted test files (`Civi\Core\Themes`)

CRM-18792 - Fix regression in CRM_Core_ResourceTest

CRM-18792 - Theme naming - Use prefix '_' for hidden themes

This cleans up a few things:

 * Previously, there was a special case for using FALLBACK in `search_order`.
 * If you're creating a multitheme extension, you may want to define a base theme
   (which is extended by the others). Previously, you were required to show this
   base theme as a user-selectable option. Now, it can be hidden.
 * There was a bug where `resolveUrl()` would sometimes call the wrong callback.
   (It used resolver for `$active` instead of `$themeKey`.)

CRM-18792 - Themes - File overrides and excludes should use same naming

Previously, when using `addStyleFile($cssExt,$css$file)`, the file overrides
and exlcudes would combine them differently e.g.

 * For `addStyleFile('civicrm','css/bootstrap.css')`
   * Override `css/bootstrap.css`
   * Exclude `civicrm:css/bootstrap.css`
 * For `('org.foo.bar','css/bang.css')`
   * Override `org.foo.bar-css/bang.css`
   * Exclude `org.foo.bar:css/bang.css`

Now, they use the same notation:

 * For `addStyleFile('civicrm','css/bootstrap.css')`
   * Override `css/bootstrap.css`
   * Exclude `css/bootstrap.css`
 * For `('org.foo.bar','css/bang.css')`
   * Override `org.foo.bar-css/bang.css`
   * Exclude `org.foo.bar-css/bang.css`

"Display Preferences" - Add the `theme_backend` and `theme_frontend` settings

hook_civicrm_activeTheme - Allow extensions and CMS modules to choose active theme

CRM_Utils_Hook::themes() - Tweak docblock

Civi\Core\Themes - Move cache from `short` to `long`

Remove tools/extensions/org.civicrm.demotheme

Fix merge ahem errors
20 files changed:
CRM/Admin/Form/Preferences/Display.php
CRM/Core/Resources.php
CRM/Utils/Hook.php
Civi/Core/Container.php
Civi/Core/Themes.php [new file with mode: 0644]
Civi/Core/Themes/Resolvers.php [new file with mode: 0644]
settings/Core.setting.php
templates/CRM/Admin/Form/Preferences/Display.hlp
templates/CRM/Admin/Form/Preferences/Display.tpl
tests/extensions/test.extension.uitest/files/foo.css [new file with mode: 0644]
tests/extensions/test.extension.uitest/files/ignoreme.css [new file with mode: 0644]
tests/extensions/test.extension.uitest/info.xml [new file with mode: 0644]
tests/extensions/test.extension.uitest/uitest.php [new file with mode: 0644]
tests/phpunit/Civi/Core/Theme/judy/css/bootstrap.css [new file with mode: 0644]
tests/phpunit/Civi/Core/Theme/judy/css/civicrm.css [new file with mode: 0644]
tests/phpunit/Civi/Core/Theme/liza/css/bootstrap.css [new file with mode: 0644]
tests/phpunit/Civi/Core/Theme/liza/css/civicrm.css [new file with mode: 0644]
tests/phpunit/Civi/Core/Theme/liza/css/civicrm.min.css [new file with mode: 0644]
tests/phpunit/Civi/Core/Theme/liza/test.extension.uitest-files/foo.css [new file with mode: 0644]
tests/phpunit/Civi/Core/ThemesTest.php [new file with mode: 0644]