Roxen.git
/
server
/
modules
/
tags
/
indirect_href.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/tags/indirect_href.pike:1:
// This is a roxen module. Copyright © 1996 - 2000, Roxen IS. // // This module makes it possible to write symbolic names instead of // absoulte hrefs. // // made by Mattias Wingstedt
-
constant cvs_version = "$Id: indirect_href.pike,v 1.
13
2000/03/17 00:
30
:
48
nilsson Exp $";
+
constant cvs_version = "$Id: indirect_href.pike,v 1.
14
2000/03/17 00:
51
:
00
nilsson Exp $";
constant thread_safe=1; #include <module.h> inherit "module"; inherit "roxenlib"; mapping hrefs; string tagname; void create()
Roxen.git/server/modules/tags/indirect_href.pike:56:
mapping all = ([ ]); hrefs = ([ ]); if (lines = (query( "hrefs" )-" "-"\t") /"\n") foreach (lines, string line) if (sscanf( line, "%s=%s", variable, value ) >= 2) hrefs[ variable ] = value; tagname = query( "tagname" ); }
-
string
tag_
newa(string tag, mapping m, string q)
+
string newa(string tag, mapping m, string q)
{ if(!m->name && !m->random) return q; if(m->name) { m->href=hrefs[m->name]; m_delete(m, "name"); } if(m->random) { m->href=values(hrefs)[random(sizeof(hrefs))]; m_delete(m, "random"); } return make_container("a",m,q); } mapping query_simpletag_callers() {
-
return ([ tagname : ({ 0,
tag_
newa }) ]);
+
return ([ tagname : ({ 0, newa }) ]);
}