cryptonas/cbox-tree.d/usr/share/cryptobox/templates/macros.cs
lars 882b9d1bb7 removed last hard coded texts
'EnterCurrentCryptoPassword' added to language files
'EnterAdminPassword' renamed to 'EnterCurrentAdminPassword'
language file loaded immeadiately before rendering
sort language links in web interface lexically
reordered 'find' options to avoid warnings
2005-09-20 22:29:55 +00:00

84 lines
2.2 KiB
Smalltalk

<?cs def:warning(warnname) ?><?cs
each:item = Lang.WarningMessage ?><?cs
if:(name(item) == warnname)
?><div class="warning">
<h1><?cs var:item.Title ?></h1>
<p><?cs var:item.Text ?></p></div>
<?cs
/if ?><?cs
/each ?><?cs
/def ?>
<?cs def:error(errname) ?><?cs
each:item = Lang.ErrorMessage ?><?cs
if:(name(item) == errname)
?><div class="error">
<h1><?cs var:item.Title ?></h1>
<p><?cs var:item.Text ?></p></div>
<?cs
/if ?><?cs
/each ?><?cs
/def ?>
<?cs def:success(succname) ?><?cs
each:item = Lang.SuccessMessage ?><?cs
if:(name(item) == succname)
?><div class="success">
<h1><?cs var:item.Title ?></h1>
<p><?cs var:item.Text ?></p></div>
<?cs
/if ?><?cs
/each ?><?cs
/def ?>
<?cs def:parseTree(root) ?><?cs #
# the output looks quite ugly and is not very helpful as there are
# only a few values
?><!-- data tree
<?cs each:item = root ?><?cs
name:item ?>: <?cs var:item ?><?cs
each:subitem = item ?> / <?cs name:subitem ?>=<?cs var:subitem ?><?cs /each ?>
<?cs /each ?>
-->
<?cs /def ?>
<?cs def:getSelfURL(append,exclude) ?><?cs #
# construct the URL of the script out of the ScriptName, Data.PostData
# (except for the value mentioned in 'exclude') and a possible
# suffix (append)
# e.g.:
# - 'append' is 'weblang=de'
# - 'exclude' is 'weblang'
# BEWARE: both parameters have to be defined!
?><?cs set:PostSuffix='' ?><?cs
set:tmp_concat='?' ?><?cs
each:item = Data.PostData ?><?cs
if:(name(item) != exclude) ?><?cs
set:PostSuffix=PostSuffix + tmp_concat + name(item) + '=' + item ?><?cs
set:tmp_concat='&' ?><?cs
/if ?><?cs
/each ?><?cs
if:?append ?><?cs set:PostSuffix=PostSuffix + tmp_concat + append ?><?cs
/if ?><?cs
var:ScriptName ?><?cs var:PostSuffix ?><?cs
/def ?>
<?cs def:help_popUp_broken(text,filename) ?><?cs #
# show a pop-up information block on the right side of the screen
# usually good for small explanatory texts
# does not work for ie?
?><a class="popup"><?cs
var:text ?><span><?cs
linclude:Settings.DocDir + '/' + Settings.DocLang + '/hints/' + filename + '.html' ?></span></a><?cs
/def ?>
<?cs def:help_popUp(text,filename) ?><?cs
var:text ?><?cs
/def ?>