Roxen.git
/
server
/
modules
/
tags
/
obox.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/tags/obox.pike:1:
// The outlined box module // // Fredrik Noring et al // // Several modifications by Francesco Chemolli.
-
constant cvs_version = "$Id: obox.pike,v 1.
6
1997
/
11
/
09
18
:
38
:
53
grubba
Exp $";
+
constant cvs_version = "$Id: obox.pike,v 1.
7
1998
/
03
/
07
19
:
03
:
44
noring
Exp $";
constant thread_safe=1; #include <module.h> inherit "module"; inherit "roxenlib";
-
#define
INFO(s)
/
/ perror(
"
### %O"+(s))
-
#define DEBUG(s) perror("### %O\n",(s))
-
#define FATAL(s) perror("### %O\n"+(s))
+
constant
unit_gif
=
"
/
internal-roxen-unit
"
;
-
#define
ERROR(a)
sprintf("<b><obox>
error:</b> %s<br>\n", (a))
+
static
private
int loaded
;
-
constant
unit_gif
=
"/
internal-roxen-unit
";
+
static
private
string
doc()
+
{
+
return !loaded?
"
":replace(Stdio.read_bytes("modules
/
tags/doc/obox
"
)||"",
+
({ "{", "}" }), ({ "<
;
", ">" }));
+
}
static string img_placeholder (mapping args) { int width=((int)args->outlinewidth)||1; return sprintf("<img src=\"%s\" alt=\"\" width=%d height=%d>", unit_gif, width, width); } static string handle_title(string name, mapping junk_args,
Roxen.git/server/modules/tags/obox.pike:109:
} string container_obox(string name, mapping args, string contents, object request_id) { string s; if (args->help) { args->right = 250; args->title = "The Outlined Box container tag";
-
contents =
"Usage:<p>"
-
"<<b>obox</b> <b>title</b>=\"Sample title\">"
-
"<br>Anything, html, text, ...<br>"
-
"<<b>/obox</b>><p>\n"
-
"Options:<p>\n\n"
-
"<b>left</b>: Length of line on the left side of the title<br>\n"
-
"<b>right</b>: Length of line on the right side of to the title<br>\n"
-
"<i>Notice</i> that left and right arguments are constrained by the "
-
"width argument, if specified.<br>\n"
-
"<b>spacing</b>: Width of the space inside the box<br>\n"
-
"<b>titlecolor</b>: Color of the title of the box<br>\n"
-
"<b>outlinecolor</b>: Color of the outline<br>\n"
-
"<b>outlinewidth</b>: Width
(
in pixels
)
of the outline<br>\n"
-
"<b>bgcolor</b>: Color of the background and title label<br>\n"
-
"<b>textcolor</b>: Color of the text inside the box<br>\n"
-
"<b>align</b>: How to align the box (left|right)<br>\n"
-
"<b>width</b>: width of the generated box<br>\n"
-
"<b>style=<
;
caption|groupbox></b>: "
-
"style of the generated box. "
-
"(<i>default: groupbox</i>)<br>\n"
-
"<p>\n\n"
-
"If the title is not specified in the argument list,<br>"
-
"you can put it inside the box text, in a <TITLE> "
-
"HTML container,<br>should it be needed for HTML clarity.<br>";
+
contents =
doc
();
} // Set the defaults... args->outlinecolor = args->outlinecolor || "#000000"; args->style = args->style || "groupbox"; if (!args->title) { contents=parse_html(contents,([]),(["title":handle_title,]),args); } switch (name) {
Roxen.git/server/modules/tags/obox.pike:179:
} return s; } array register_module() { return ({ MODULE_PARSER, "Outlined box",
-
"This is a container tag making outlined boxes.<
br
>"
-
"<obox help></obox> gives help.",
+
"This is a container tag making outlined boxes.<
p
>"
+
"
<tt>
<obox help></obox>
</tt>
gives help.
\n\n<p>
"
+doc()
,
0, 1 }); }
-
+
void start(int num, object configuration)
+
{
+
loaded = 1;
+
}
+
mapping query_container_callers() { return ([ "obox":container_obox, ]); }