-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskin_transformations.xml
More file actions
110 lines (87 loc) · 4.75 KB
/
skin_transformations.xml
File metadata and controls
110 lines (87 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?xml version = "1.0" encoding = "UTF-8"?>
<!-- Definition file for the SkinTransformer plugin
This file defines the transformations to be processed for ILIAS templates
Each transformation is defined by a <trans> element with some attributes.
When an ILIAS template is read or delivered, the SkinTransformer plugin
searches for matching transformations to be applied to this template.
The <trans> element has a set of attributes:
at (mandatory):
Selects the hook when the transformation should invoked.
* input: when a template file is read by ilTemplate with loadTemplate()
or addBlockFile()
* output: when a template is delivered by ilTemplate with get() or show()
Other hooks are named with the service and the hook part:
* Services/Utilities/redirect: when a redirection is done
* Services/Container/async_item_list: when an item list is delivered
of (mandatory for input|output):
A template or any of the templates from an ILIAS component
that should be processed, e.g.:
* tpl.main.html
* Services/MainMenu/tpl.main_menu.html
* Services/MainMenu
The value is an identifier rather than a physical path. It is equal
to the relative path of a customized template in the skin directory
but the customized template does not need to exist - the corresponding
default template is also processed.
The transformations for a template are searched in definition order.
Only the first matching transformation is applied, unless "next" indicates,
that the next matching should be applied, too.
by (optional):
A path to a php class file that does the transformation.
The path is relative to the skin directory.
The php file must contain a class and be named like this class,
e.g. class.ilMyTransformation.php for ilMyTransformation.
This class must provide a public method transform($code, $trans)
that has two parameters:
* $code - the original code that has to be transformed
* $trans - an assoc array with the attributes of the <trans> element
The method should return the transformed code as string.
MyTransformation can be an extension of the ilSkinTransformer class.
The class file of ilSkinTransformer is already included by the plugin
and is used directly if "by" is not specified.
with (otional):
A path to a specification that is used for the processing.
"With" can be used by an own transformer class in any way.
The standard ilSkinTransformer interprets it this way:
* If "with" is a path to an .xsl file in the skin directory, this
stylesheet will be used to do an XSLT transformation of the code.
* If "with" is a path to any other file in the skin directory
the contents of this file will replace the output.
* If "with" is empty, the output will be empty.
for (optional):
A template or an ILIAS component that has to be used by ILIAS
before the transformation is called, e.g.
* tpl.confirm.html
* Services/Calendar/tpl.minical.html
* Modules/Forum
This can be used to select specific transformations (e.g. for tpl.main.html)
only if certain contents are likely being included.
Templates are checked for being read with loadTmplate() or addBlockFile().
Components are checked for classes being used in the controller history
of for at least one of their templates being read.
next (optional):
A "true" indicates that the processing should continue with the next found transformation.
This is for example neccessary if the main output should be processed by module
specific transformations as well as by general transformations.
keep (optional):
A "true" indicates that the php class specified with "by" or the compiled xsl stylesheet
specified with "with" should be kept in memory for further transformations.
This will increase performance if a transformation is called very often (e.g. for lists).
debug (optional):
This allows to exit at the transformation step and show the processed html code:
"before" will output the code before the transformation,
"after" will output the applied transformation.
"dom" will output the code after loading as a DOM object, but before transformation
utf8fix (optional):
This allows to fix utf8 bugs in DomDocument::loadHTML()
"entities" will convert all non-ascii chars to HTML entities before loading
"prefix" will add an utf8 encoding prefix to the code before loading
style (optional):
Apply the transformation only for the specified style
Note: style name and id should be the same (except case)
All of the attributes may also be be set for the <transformation> element. If
an attribute is empty in a <trans> element, it will be taken from there.
-->
<transformations keep="true" debug="">
<trans style="delos" at="output" of="tpl.main.html" with="delos_main.xsl" debug=""/>
</transformations>