Roxen.git/
server/
modules/
tags/
rxmltags.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2000-03-10
2000-03-10 04:20:30 by Martin Nilsson <mani@lysator.liu.se>
82f713b781883d3ba4700faeaf4c4f1ac39f7599 (
50
lines) (+
22
/-
28
)
[
Show
|
Annotate
]
Branch:
5.2
Changed some containers to simpeltags
Rev: server/modules/tags/rxmltags.pike:1.94
7:
#define _rettext id->misc->defines[" _rettext"] #define _ok id->misc->defines[" _ok"]
-
constant cvs_version="$Id: rxmltags.pike,v 1.
93
2000/03/10
03
:
36
:
49
nilsson Exp $";
+
constant cvs_version="$Id: rxmltags.pike,v 1.
94
2000/03/10
04
:
20
:
30
nilsson Exp $";
constant thread_safe=1; constant language = roxen->language;
803:
// ------------------- Containers ----------------
-
string
container
_charset( string t, mapping m, string c, RequestID id )
+
string
simpletag
_charset( string t, mapping m, string c, RequestID id )
{ if( m->in ) if( catch {
944:
} }
-
string
container
_foreach(string t, mapping args, string c, RequestID id)
+
string
simpletag
_foreach(string t, mapping args, string c, RequestID id)
{ string v = args->variable; array what;
970:
return res; }
-
string
container
_apre(string tag, mapping m, string q, RequestID id)
+
string
simpletag
_apre(string tag, mapping m, string q, RequestID id)
{ string href, s; array(string) foo;
1004:
return make_container("a", m, q); }
-
string
|array(string)
container
_aconf(string tag, mapping m,
+
string
simpletag
_aconf(string tag, mapping m,
string q, RequestID id) { string href,s;
1036:
return make_container("a", m, q); }
-
string
container
_maketag(string tag, mapping m, string cont, RequestID id)
+
string
simpletag
_maketag(string tag, mapping m, string cont, RequestID id)
{ mapping args=(!m->noxml&&m->type=="tag"?(["/":"/"]):([])); cont=parse_html(parse_rxml(cont,id), ([]), (["attrib":
1050:
return make_tag(m->name, args); }
-
string
container
_doc(string tag, mapping m, string s)
+
string
simpletag
_doc(string tag, mapping m, string s)
{ if(!m["quote"]) if(m["pre"]) {
1071:
return replace(s, ({ "<", ">", "& " }), ({ "<", ">", "& " })); }
-
string
container
_autoformat(string tag, mapping m, string s, RequestID id)
+
string
simpletag
_autoformat(string tag, mapping m, string s, RequestID id)
{ s-="\r";
1167:
} }
-
string
container
_smallcaps(string t, mapping m, string s)
+
string
simpletag
_smallcaps(string t, mapping m, string s)
{ Smallcapsstr ret; string spc=m->space?" ":"";
1213:
return ret->value(); }
-
string
container
_random(string tag, mapping m, string s)
+
string
simpletag
_random(string tag, mapping m, string s)
{ string|array q; if(!(q=m->separator || m->sep)) return (q=s/"\n")[random(sizeof(q))]; return (q=s/q)[random(sizeof(q))]; }
-
array(string) container_formoutput(string tag_name, mapping args,
-
string contents, RequestID id)
-
{
-
return ({ do_output_tag( args, ({ id->variables }), contents, id ) });
-
}
-
+
array(string) container_gauge(string t, mapping args, string contents, RequestID id) { NOCACHE();
1244:
} // Removes empty lines
-
array(
string
)
container
_trimlines( string tag_name, mapping args,
+
string
simpletag
_trimlines( string tag_name, mapping args,
string contents, RequestID id ) {
-
contents = replace(
parse_rxml(
contents,
id),
({"\r\n","\r" }), ({"\n","\n"}));
-
return (
{ (
contents / "\n" - ({ "" })) * "\n"
})
;
+
contents = replace(contents, ({"\r\n","\r" }), ({"\n","\n"}));
+
return (contents / "\n" - ({ "" })) * "\n";
} void container_throw( string t, mapping m, string c, RequestID id)
1302:
return ({ make_container(t,m,ret) }); }
-
array(
string
)
container
_default( string t, mapping m, string c, RequestID id)
+
string
simpletag
_default( string t, mapping m, string c, RequestID id)
{ multiset value=(<>); if(m->value) value=mkmultiset((m->value||"")/(m->separator||",")); if(m->variable) value+=(<RXML.user_get_var(m->variable, m->scope)>);
-
c = parse_rxml(c, id );
-
if(value==(<>)) return
({c})
;
+
if(value==(<>)) return
c
;
-
return
({
parse_html(c, (["input":internal_tag_input]),
+
return parse_html(c, (["input":internal_tag_input]),
(["select":internal_tag_select]),
-
m->name, value)
})
;
+
m->name, value);
}
-
string
container
_sort(string t, mapping m, string c, RequestID id)
+
string
simpletag
_sort(string t, mapping m, string c, RequestID id)
{ if(!m->separator) m->separator = "\n";
1423:
return ret; }
-
string
container
_replace( string tag, mapping m, string cont, RequestID id)
+
string
simpletag
_replace( string tag, mapping m, string cont, RequestID id)
{ switch(m->type) {