Class Horde_Themes_Css
This class provides an interface to handling CSS stylesheets for Horde
applications.
Copyright 2010-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
Methods summary
public
|
#
addStylesheet( string $file, string $url )
Adds an external stylesheet to the output.
Adds an external stylesheet to the output.
Parameters
- $file
- The CSS filepath.
- $url
- The CSS URL.
|
public
|
#
addThemeStylesheet( string $file )
Adds a themed stylesheet to the output.
Adds a themed stylesheet to the output.
Parameters
- $file
- The stylesheet name.
|
public
array
|
#
getStylesheetUrls( array $opts = array() )
Generate the stylesheet URLs needed to display the current page.
Honors configuration choices as to stylesheet caching.
Generate the stylesheet URLs needed to display the current page.
Honors configuration choices as to stylesheet caching.
Parameters
- $opts
- Additional options:
<
<p>pre>
'app' - (string) The current application.
'nobase' - (boolean) If true, don't load base stylesheets.
'nohorde' - (boolean) If true, don't load files from Horde.
'nocache' - (boolean) If true, don't load files from Cache.</p>
Returns
array The list of URLs to display (Horde_Url objects).
Since
Horde_Core 1.3.0
'sub' - (string) A subdirectory containing additional CSS files to
load as an overlay to the base CSS files.
'subonly' - (boolean) If true, only load the files in 'sub', not
the default theme files.
'theme' - (string) Use this theme instead of the default.
'themeonly' - (boolean) If true, only load the theme files.
|
public
array
|
#
getStylesheets( mixed $theme = '', array $opts = array() )
Return the list of base stylesheets to display.
Return the list of base stylesheets to display.
Parameters
- $theme
- <p>The theme to use; specify an empty value to
retrieve the theme from user preferences, and
false for no theme.</p>
- $opts
- Additional options:
<pre><span class="php-quote">'app'</span> - (string) The <span class="php-keyword2">current</span> application.
<span class="php-quote">'nobase'</span> - (boolean) <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, don<span class="php-quote">'t load base stylesheets.
'</span>nohorde<span class="php-quote">' - (boolean) If true, don'</span>t load files from Horde.
<span class="php-quote">'sub'</span> - (string) A subdirectory containing additional CSS files to
load <span class="php-keyword1">as</span> an overlay to the base CSS files.
<span class="php-quote">'subonly'</span> - (boolean) <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, only load the files in <span class="php-quote">'sub'</span>, not
the <span class="php-keyword1">default</span> theme files.
<span class="php-quote">'themeonly'</span> - (boolean) <span class="php-keyword1">If</span> <span class="php-keyword1">true</span>, only load the theme files.</pre>
Returns
array An array of 2-element array arrays containing 2 keys:
fs - (string) Filesystem location of stylesheet.
uri - (string) URI of stylesheet.
|
public
array
|
#
getBaseStylesheetList( )
Returns the list of base stylesheets, based on the current language
and browser settings.
Returns the list of base stylesheets, based on the current language
and browser settings.
Returns
array A list of base CSS files to load.
|
public
string
|
#
loadCssFiles( array $files )
Loads CSS files, cleans up the input, and concatenates to a string.
Loads CSS files, cleans up the input, and concatenates to a string.
Parameters
- $files
- <p>List of CSS files as returned from
getStylesheets().</p>
Returns
string CSS data.
|