2005-12-25 17:12:31 +01:00
|
|
|
<?cs def:checkbox(option)
|
|
|
|
?><?cs if:Lang.Options[option]
|
2006-03-29 23:13:14 +02:00
|
|
|
?><input type="checkbox" name="option_<?cs var:option ?>" id="option_<?cs
|
|
|
|
var:option ?>" value="selected" <?cs
|
|
|
|
if:(Data.List.Options[option] == 1) ?>checked="checked"<?cs
|
|
|
|
/if ?> /> <label for="option_<?cs var:option ?>"><?cs
|
|
|
|
var:html_escape(Lang.Options[option])
|
2006-04-10 15:30:32 +02:00
|
|
|
?></label>
|
|
|
|
<input type="hidden" name="available_option_<?cs
|
|
|
|
var:option ?>" value="true" /><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
else ?>unknown option (<?cs var:option ?>)<?cs /if ?><?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
/def ?><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
|
2006-03-29 23:13:14 +02:00
|
|
|
def:setting(setting)
|
2005-12-25 17:12:31 +01:00
|
|
|
?><?cs if:Lang.Settings[setting]
|
|
|
|
?><input type="checkbox" name="setting_state_<?cs var:setting
|
|
|
|
?>" id="setting_state_<?cs var:setting ?>" value="selected" <?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
if:(Data.List.Settings[setting].state == 1) ?>checked="checked"<?cs /if
|
|
|
|
?> /> <label for="setting_state_<?cs var:setting ?>"><?cs
|
|
|
|
var:html_escape(Lang.Settings[setting])
|
|
|
|
?></label><ul><li><input type="text" name="setting_value_<?cs var:setting
|
2005-12-25 17:12:31 +01:00
|
|
|
?>" id="setting_value_<?cs var:setting ?>" value="<?cs
|
2006-04-10 15:30:32 +02:00
|
|
|
var:html_escape(Data.List.Settings[setting].value) ?>" size="30" /></li></ul>
|
|
|
|
<input type="hidden" name="available_setting_<?cs
|
|
|
|
var:setting ?>" value="true"><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
else ?>unknown setting (<?cs var:setting ?>)<?cs /if ?><?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
/def ?><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
|
2006-03-29 23:13:14 +02:00
|
|
|
def:warning(warntext)
|
2006-05-02 02:10:12 +02:00
|
|
|
?><div class="warning"><?cs alt:html_escape(warntext) ?>unknown warning message (<?cs
|
|
|
|
var:html_escape(Data.Warning) ?>)<?cs /alt ?></div><?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
/def ?><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
|
2006-03-29 23:13:14 +02:00
|
|
|
def:error(errtext)
|
2005-12-25 17:12:31 +01:00
|
|
|
?><div class="error">
|
2006-05-02 02:10:12 +02:00
|
|
|
<?cs alt:html_escape(errtext) ?>unknown error message (<?cs
|
|
|
|
var:html_escape(Data.Error) ?>)<?cs /alt ?></div><?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
/def ?><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
|
2006-03-29 23:13:14 +02:00
|
|
|
def:success(succtext)
|
2005-12-25 17:12:31 +01:00
|
|
|
?><div class="success">
|
2006-05-02 02:10:12 +02:00
|
|
|
<?cs alt:html_escape(succtext) ?>unknown success message (<?cs
|
|
|
|
var:html_escape(Data.Success) ?>)<?cs /alt ?></div><?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
/def ?><?cs
|
2005-12-25 17:12:31 +01:00
|
|
|
|
2006-03-29 23:13:14 +02:00
|
|
|
def:limit_string_len(text,limit)
|
2005-12-25 17:12:31 +01:00
|
|
|
?><?cs set:text2 = text ?><?cs set:len = string.length(text2) ?><?cs
|
|
|
|
if:len > limit ?><?cs
|
|
|
|
var:string.slice(text,0,limit / #2 + limit % #2 - 1) ?>...<?cs
|
|
|
|
var:string.slice(text,len - limit / #2 + #3 - #1, len) ?><?cs
|
|
|
|
else ?><?cs var:text ?><?cs /if ?><?cs
|
2006-03-29 23:13:14 +02:00
|
|
|
/def ?><?cs
|
|
|
|
|
|
|
|
def:show_options(element)
|
|
|
|
?><?cs if:subcount(element) == 0 ?><li><?cs
|
|
|
|
linclude:TemplateDir + '/config_options/' + element + '.cs' ?></li><?cs
|
|
|
|
else ?><?cs if:element["Self"] ?><li><?cs
|
|
|
|
linclude:TemplateDir + '/config_options/' + element["Self"] + '.cs' ?><?cs
|
|
|
|
/if ?><ul><?cs each:opts = element ?><?cs if:name(opts) != "Self" ?><?cs
|
|
|
|
call:show_options(opts) ?><?cs
|
|
|
|
/if ?><?cs /each
|
|
|
|
?></ul><?cs if:element["Self"] ?></li><?cs /if ?><?cs
|
|
|
|
/if ?><?cs
|
|
|
|
/def ?><?cs
|
|
|
|
|
|
|
|
def:is_substring(text_in, search_in)
|
|
|
|
?><?cs set:text = text_in
|
|
|
|
?><?cs set:search = search_in
|
|
|
|
?><?cs set:found = 0
|
|
|
|
?><?cs loop: index = #0, string.length(text), #1
|
|
|
|
?><?cs if:string.slice(text, index, index + string.length(search) - #1) == searchi
|
|
|
|
?><?cs set:found = 1 ?><?cs /if
|
|
|
|
?><?cs /loop ?><?cs
|
|
|
|
/def ?><?cs
|
2006-01-06 22:53:45 +01:00
|
|
|
|
2006-03-29 23:13:14 +02:00
|
|
|
def:link(attr1, value1, attr2, value2, attr3, value3)
|
|
|
|
?><?cs each:attrs = Temp
|
|
|
|
?><?cs set:attrs = ""
|
|
|
|
?><?cs /each
|
|
|
|
?><?cs each:attrs = Config.UI.LinkAttrs
|
2006-05-29 13:35:47 +02:00
|
|
|
?><?cs set:Temp[url_escape(name(attrs))] = url_escape(attrs)
|
2006-03-29 23:13:14 +02:00
|
|
|
?><?cs /each
|
|
|
|
?><?cs if:attr1 != "" ?><?cs set:Temp[attr1] = value1 ?><?cs /if
|
|
|
|
?><?cs if:attr2 != "" ?><?cs set:Temp[attr2] = value2 ?><?cs /if
|
|
|
|
?><?cs if:attr3 != "" ?><?cs set:Temp[attr3] = value3 ?><?cs /if
|
|
|
|
?><?cs var:ScriptName
|
|
|
|
?><?cs set:first_each = 1
|
|
|
|
?><?cs if:subcount(Temp) > 0
|
|
|
|
?><?cs each:attrs = Temp
|
|
|
|
?><?cs if:(name(attrs) != "") && (attrs != "")
|
|
|
|
?><?cs if:first_each == 1 ?><?cs
|
|
|
|
set:first_each = 0 ?>?<?cs
|
|
|
|
else
|
|
|
|
?>&<?cs /if
|
|
|
|
?><?cs var:url_escape(name(attrs)) ?>=<?cs var:url_escape(attrs)
|
|
|
|
?><?cs /if
|
|
|
|
?><?cs /each
|
|
|
|
?><?cs /if ?><?cs
|
2006-01-06 22:53:45 +01:00
|
|
|
/def ?>
|
2006-05-29 13:35:47 +02:00
|
|
|
|