[%# start of content %]
[% dw.ml("Backlink", {
'link' => "$site.root/customize/advanced/",
'text' => dw.ml('.back2'),
}) %]
[%# show the public layers %]
[% UNLESS id %]
[%- sections.title = '.title' | ml -%]
[% BLOCK recurse %]
[% lay = pub.$lid %]
[% RETURN UNLESS lay > 0 %]
[%# set to true if the layer is not core and is not a layout %]
[% is_child = lay.type != 'core' && lay.type != 'layout' %]
[%# show link to detailed view %]
[% layerinfo.$lid.name | html %]
([% lay.type %][% NOT is_child ? ": $lid" : '' %])
[%# done unless there are children to recurse through %]
[% RETURN UNLESS NOT is_child && lay.children %]
[%# if we're not expanding these children, stop and show a link %]
[% IF lay.type == 'layout' && expand != lid %]
[% num_children = 0 %]
[% FOREACH child IN lay.children.list() %]
[% is_active = layer_is_active(child) %]
[% num_children = num_children + 1 IF NOT defined(is_active) || is_active %]
[% END %]
[% RETURN %]
[% END %]
[%# This sorts first by type backwards (so that layout and theme sort before %]
[%# i18nc and i18n) and then by name, thus causing the layouts to group by type %]
[%# and then be alphabetical within their type. %]
[% children = childsort (lay.children) %]
[%# expand children %]
[% FOREACH child IN children %]
[% is_active = layer_is_active(child) %]
[% is_active %]
[% NEXT UNLESS NOT defined(is_active) || is_active %]
[% PROCESS recurse lid = child %]
[% END %]
[% END %]
[% # iterate through core layers %]
[% FOREACH key IN s2_keys.sort %]
[% is_active = layer_is_active(key) %]
[% NEXT UNLESS NOT defined(is_active) || is_active %]
[% PROCESS recurse lid = key %]
[% END %]
[% RETURN %]
[% END %]
[%### details on a specific layer ### %]
[%# public styles are pulled from the system account, so we don't %]
[%# want to check privileges in case they're private styles %]
[% UNLESS srcview == 1 || isadmin || can_manage || pub.$id %]
return $err->($ML{'.error.cantviewlayer'})
[% END %]
[%# link to layer list if this is a public layer, otherwise user's layer list %]
[% IF pub.$id.size %]
[% dw.ml('Backlink', { 'link' => "$site.root/customize/advanced/layerbrowse", 'text' => dw.ml('.nav.publiclayers') }) %]
[% ELSE %]
[% dw.ml('Backlink', { 'link' => "$site.root/customize/advanced/layers", 'text' => dw.ml('.nav.yourlayers') }) %]
[% dw.ml('Actionlink', { 'link' => "" _ dw.ml('.nav.editlayer') _ "" }) %]
[% END %]
[% IF layer.b2lid.size %]
[% dw.ml('Actionlink', { 'link' => "{'b2lid'}\">" _ dw.ml('.nav.parentlayer') _ "" }) %]
[% END %]
[% IF pub.$id.size && (! srcview || srcview != 0) %]
[% dw.ml('Actionlink', { 'link' => dw.ml('.nav.viewsource') _ " " _ dw.ml('.nav.viewsource.raw') _ " | " _ dw.ml('.nav.viewsource.highlighted') _ "" }) %]
[% END %]
[%# layerinfo %]
[% IF s2info.info %]
[% info = s2info.info %]
[% dw.ml('.layerinfo.header') %]
[% FOREACH k IN info.keys.sort %]
[% IF k == "name" %]
[%- sections.title = info.$k -%]
[% END %]
| [% k | html %] | [% info.$k | html %] |
[% END %]
[% END %]
[%# sets %]
[% IF s2info.set %]
[% set = s2info.set %]
[% dw.ml ('.propertiesset.header') %]
[% FOREACH k IN set.keys.sort %]
| [% k %] | [% format_value(set.$k) %] |
[% END %]
[% END %]
[%# global functions %]
[% gb = s2info.global %]
[% IF gb.keys %]
[% dw.ml('.globalfunctions.header') %]
[% FOREACH fname IN gb.keys.sort %]
[% rt = gb.$fname.returntype %]
[% IF defined(class.rt) %]
[% rt = "[class[$rt]]" %]
[% END %]
[% ds = ehtml(gb.$fname.docstring) || " " %]
[% args = gb.$fname.args %]
| [% xlink_args(args) %] : [% xlink(rt) %] | [% xlink(ds) %] |
[% END %]
[% END %]
[% IF class.size > 0 %]
[%# class index %]
[% dw.ml('.classes.header') %]
[% dw.ml('.classes.sort.alphabetical') %]
[% FOREACH cname IN class.keys.sort %]
- [% cname %]
[% END %]
|
[% dw.ml('.classes.sort.hierarchical') %]
[% BLOCK dumpsub %]
[% "$parentclass" IF parentclass != "" %]
[% didul = 0 %]
[% FOREACH cname IN class.keys.sort %]
[% NEXT UNLESS class.$cname.parent == parentclass %]
[% UNLESS didul > 0 %]
[% didul = didul + 1 %]
[% END %]
[% INCLUDE dumpsub parentclass = cname %]
[% END %]
[% " " IF didul > 0 %]
[% END %]
[% INCLUDE dumpsub parentclass = "" %]
|
[%# classes %]
[% FOREACH cname IN class.keys.sort %]
[% dw.ml('.classname.header', {'name' => cname}) %]
[% ds = ehtml(class.$cname.docstring) %]
[% IF class.$cname.parent %]
[% name = "[class[" _ class.$cname.parent _ "]]" %]
[% ds = dw.ml('.classname.childclass', {'name' => name}) _ " $ds" %]
[% END %]
[% IF ds && ds != '' %]
[% xlink(ds) %]
[% END %]
[%# build functions & methods %]
[% BLOCK add %]
[% FOREACH k IN class.$aname.funcs.keys %]
[% func.$k = class.$aname.funcs.$k %]
[% func.$k._declclass = aname %]
[% END %]
[% FOREACH k IN class.$aname.vars.keys %]
[% var.$k = class.$aname.vars.$k %]
[% var.$k._declclass = aname %]
[% END %]
[% parentclass = class.$aname.parent %]
[% PROCESS add aname = parentclass IF parentclass %]
[% END %]
[% PROCESS add aname = cname %]
[% IF var.size > 0 %]
[% dw.ml ('.members.header') %]
[% END %]
[% FOREACH k IN var.keys.sort %]
[% type = var.$k.type %]
[% cleantype = type.remove('\W+') %]
[% type = type.replace('(\w+)', '[class[$1]]') IF class.$cleantype.defined %]
[% ds = ehtml(var.$k.docstring) || " " %]
[% IF var.$k.readonly %]
[% ds = xlink(ds) _ " " _ dw.ml('.members.readonly') _ "" %]
[% END %]
| [% xlink(type) %] [% k %] | [% ds %] |
[% END %]
[% "
" IF var %]
[% IF func.size > 0 %]
[% dw.ml ('.methods.header') %]
[% END %]
[% FOREACH k IN func.keys.sort %]
[% rt = func.$k.returntype %]
[% IF defined(rt) %]
[% rt = "[class[$rt]]" %]
[% END %]
[% ds = ehtml(func.$k.docstring) || " " %]
[% args = k %]
| [% xlink_args(args) %] : [% xlink(rt) %] | [% xlink(ds) %] |
[% END %]
[% "
" IF func.size > 0 %]
[% func = {} %]
[% var = {} %]
[% END %]
[% END %]
[% sections.head = BLOCK %]
[% END %]