Class: atkTheme
Source Location: /ui/class.atktheme.inc
Class atkTheme
Method Summary
| static
String
|
absPath() |
Convert a relative theme path to an absolute path. |
| atkTheme |
atkTheme() |
Constructor, initializes class and certain values |
| atkTheme |
&getInstance() |
Function to get an Instance of the atkTheme class, ensures that there is never more than one instance (Singleton pattern) |
| string |
iconPath() |
Returns full path for themed icon file |
| string |
imgPath() |
Returns full path for themed image file |
| string |
stylePath() |
Returns full path for themed style file |
| string |
themeDir() |
Gets the directory of the current theme |
| string |
tplPath() |
Returns full path for themed template file |
| void |
_loadTheme() |
Load the theme information into memory. |
Methods
static String absPath(
String
$relpath, [String
$location = '']
)
|
|
Convert a relative theme path to an absolute path.
If a relative path starts with 'module/something' this method converts the start of the path to the location where the module 'something' is actually installed.
Parameters:
|
String |
$relpath: |
The relative path to convert |
|
String |
$location: |
|
API Tags:
| Return: | The absolute path |
Constructor, initializes class and certain values
API Tags:
var getAttribute(
string
$attribname, [string
$default = ""]
)
|
|
Returns the value for themevalue
Example: getAttribute("highlight"); returns "#eeeeee"
Parameters:
|
string |
$attribname: |
the name of the attribute in the themedefinition |
|
string |
$default: |
the default to fall back on |
API Tags:
| Return: | the value of the attribute in the themedefinition |
void getFileLocation(
string
$type, string
$name, [string
$module = ""]
)
|
|
Retrieve the location of a file
Parameters:
|
string |
$type: |
the type of the file |
|
string |
$name: |
the name of the themefile |
|
string |
$module: |
the name of the module requesting the file |
API Tags:
String getIconFileFromModuleTheme(
string
$icon, string
$type, [string
$ext = ""]
)
|
|
Get the icon file from the module theme
Parameters:
|
string |
$icon: |
the name of the icon |
|
string |
$type: |
the type of the icon |
|
string |
$ext: |
the file extension |
API Tags:
String getIconFileFromTheme(
string
$iconname, string
$type, array
$theme, [string
$ext = ""]
)
|
|
Get the icon file from the theme
Parameters:
|
string |
$iconname: |
the name of the icon |
|
string |
$type: |
the type of the icon |
|
array |
$theme: |
the theme array containing all files |
|
string |
$ext: |
the file extension |
API Tags:
atkTheme &getInstance(
[bool
$reset = false]
)
|
|
Function to get an Instance of the atkTheme class, ensures that there is never more than one instance (Singleton pattern)
Parameters:
|
bool |
$reset: |
Always reset and return a new instance |
API Tags:
string iconPath(
string
$icon, string
$type, [string
$module = ""], [string
$ext = ''], [boolean
$useDefault = true]
)
|
|
Returns full path for themed icon file
Parameters:
|
string |
$icon: |
the icon name (no extension) |
|
string |
$type: |
the icon type (example: "recordlist") |
|
string |
$module: |
the name of the module requesting the file |
|
string |
$ext: |
the extension of the file, if this is empty, atkTheme will check several extensions. |
|
boolean |
$useDefault: |
use default icon fallback if not found? |
API Tags:
| Return: | the full path of the icon file |
string imgPath(
string
$img, [string
$module = ""]
)
|
|
Returns full path for themed image file
Parameters:
|
string |
$img: |
the image name |
|
string |
$module: |
the name of the module requesting the file |
API Tags:
| Return: | the full path of the image file |
string stylePath(
string
$style, [string
$module = ""]
)
|
|
Returns full path for themed style file
Parameters:
|
string |
$style: |
the name of the CSS file |
|
string |
$module: |
the name of the module requesting the file |
API Tags:
| Return: | the full path of the style file |
Gets the directory of the current theme
API Tags:
| Return: | full path of the current theme |
string tplPath(
string
$tpl, [string
$module = ""]
)
|
|
Returns full path for themed template file
Parameters:
|
string |
$tpl: |
the template name |
|
string |
$module: |
the name of the module requesting the file |
API Tags:
| Return: | the full path of the template file |
String _getIconFileWithExtFromTheme(
string
$iconname, string
$ext, string
$type, array
$theme
)
|
|
Get the icon file from this theme
Parameters:
|
string |
$iconname: |
the iconname |
|
string |
$ext: |
the file extension |
|
string |
$type: |
the icon type |
|
array |
$theme: |
the theme array containing all files |
API Tags:
Load the theme information into memory.
If a cached file with theme information doesn't exist, it is compiled from the theme dir.