-
Notifications
You must be signed in to change notification settings - Fork 0
The theme framework
Thanks to its modularity Jeff may support different themes, and the user may set which one to use, setting it as active. All theme classes extends the theme class and implements the theme interface.
A Jeff theme is a module composed by views, css, img, locales, js, template files and a class file. The class which takes its name from the theme name extends the theme class (which then acts like a super class) and implements the theme interface.
The theme interface defines a common interface for all theme objects. Theme objects that extends the theme superclass already have these methods by inheritance. But clearly it's possible to create "stand alone" themes which doesn't extends this superclass, so such themes must implement all the following methods (look at the theme class method definition to read more about them).
Every new installed theme "extends" the default one, in the sense that the new template may only override some features and all other stuffs (img, css, views, locales, js) fallbacks to the default template, this way is quite fast to change for example only the template graphics because it's enough to create some images and rewrite the css stylesheet.
What follow is the list of features a theme might have
-
css (under themes/theme_name/css/)
stylesheet.css: the main theme css
<template_name>.css: the specific global template css
modules css: specific modules css -
js (under themes/theme_name/js)
themejs.js: the main theme javascript file (not present in the default theme)
<active_template>.js: the specific template js -
images (themes/theme_name/img)
the theme images -
locale (themes/theme_name/languages)
the files which contains the associative array used to translate strings -
view (themes/theme_name/view)
all the module's views, that is the module templates -
template files (themes/theme_name/) es public_home.tpl
all the global template files loaded and parsed by the template class - **<template_name>.php (themes/theme_name) the specific theme class
##The specific theme class It inherits all the theme class methods and adds some other used by the layout module to get informations about the theme, here they are:
string getDescription()
returns the theme description
string getImage()
returns the image used to present the theme in the layout arae in the administration
string getName()
returns the template user friendly name