6.0.0-git
2024-03-29

Diff for Doc/Dev/ThemesH4 between 2 and 3

[[toc]]

+ H4 Themes !HowTo

++ Default Theme

Each application defines a default theme.  This default theme is used as the base of all other themes.  The default theme is not accessible to end users, and should not be altered when developing a new theme.

++ User Preference Theme

The default theme is then extended by the theme defined in the user's 'theme' preference entry.

++ Theme Inheritance

Theme elements are inherited in the following order:

# **application**/themes/**theme**/graphics
# horde/themes/**theme**/graphics
# **application**/themes/graphics**application**/themes/default/graphics
# horde/themes/graphicshorde/themes/default/graphics

(The **application** entries listed above will not be skipped if horde is the current application.)

For images & sounds, the first matching item is used working down the inheritance tree.

For CSS, the inheritance order determines the order the stylesheets are output.  CSS files located at the top of the inheritance tree will be loaded //LAST//, horde default stylesheets will be loaded //FIRST//.

++ Theme Layout

Themes are located in the themes/[themename] directory.

+++ CSS

CSS files should normally go into the base theme directory.  There are several filenames that have special meaning in Horde:

||~ Filename ||~ Description ||
|| {{screen.css}} || The default CSS definition ||
|| {{rtl.css}} || Styles to use if the current language is a Right-to-Left language ||
|| {{embed.css}} || Used for embedded display ||

Additionally, the following CSS files will be automatically added based on the current browser:

||~ Filename ||~ Browser ||
|| {{ie8.css}} || Internet Explorer 8 ||
|| {{ie7.css}} || Internet Explorer 7 ||
|| {{ie6_or_less.css}} || Internet Explorer <= 6 ||
|| {{opera.css}} || Opera ||
|| {{mozilla.css}} || Mozilla-based browser (i.e. Firefox) ||
|| {{webkit.css}} || Webkit-based browser (i.e. Google Chrome, Safari) ||

URLs contained in CSS should be relative URLs.

+++ Graphics

Graphics live in the {{graphics/}} folder of your theme's base directory.

+++ Sounds

Sounds live in the {{sounds/}} folder of your theme's base directory.

Sounds must be in WAV format (with a {{.wav}} file prefix).

+++ Information File

**##red|This file is only needed in the horde theme directory. It is not needed in an applications's theme directory##**

The {{info.php}} contains information regarding the theme.  It must be a file that can be parsed by PHP.  It should contain the following variables:

||~ Variable Name ||~ Description ||
|| $theme_name || This is the theme name as it will appear in the theme list in the users' display options. ||

An example for info.php:

<code type="php">
<?php
/**
 * This is my personal theme.
 * It is based on the colors of my bike when I was five.
 *
 * Copyright 2010@author John Doe <john@example.com>
 */
$theme_name = _("My Theme Name");
</code>