Roxen.git / server / modules / graphics / graphic_text.pike

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - string cvs_version="$Id: graphic_text.pike,v 1.28 1997/02/22 00:02:14 per Exp $"; + string cvs_version="$Id: graphic_text.pike,v 1.29 1997/02/22 13:02:50 per Exp $";   #include <module.h>   inherit "module";   inherit "roxenlib";      import Image;      array register_module()   {    return ({ MODULE_LOCATION | MODULE_PARSER,    "Graphics text",
Roxen.git/server/modules/graphics/graphic_text.pike:701:   // Allow <accessed> and others inside <gtext>.    contents = parse_rxml(contents, id, foo, defines);       string pre, post, defalign, gt, rest, magic;    int i, split;       // No images here, let's generate an alternative..    if(!id->supports->images || id->prestate->noimages)    {    if(!arg->split) contents=replace(contents,"\n", "\n<br>\n"); -  if(arg->submit) return "<input type=submit value=\""+contents+"\">"; +  if(arg->submit) return "<input type=submit name=\""+(arg->name+".x")+"\" value=\""+contents+"\">";    switch(t)    {    case "gtext":    case "anfang":    if(arg->href)    return "<a href=\""+arg->href+"\">"+contents+"</a>";    return contents;    default:    if(sscanf(t, "%s%d", t, i)==2)    rest="<h"+i+">"+contents+"</h"+i+">";
Roxen.git/server/modules/graphics/graphic_text.pike:901:    } else {    FIX(bgcolor,"#c0c0c0",bg);    FIX(text, "#000000",fg);    FIX(link, "#0000ee",link);    FIX(alink, "#ff0000",alink);    FIX(vlink, "#551a8b",vlink);    }    if(changed) return ("<body "+make_args(args)+">");   }    +    string tag_fix_color(string tagname, mapping args, object id, object file,    mapping defines)   {    int changed; -  +  +  if(!id->misc->colors) +  id->misc->colors = ({ ({ defines->fg, defines->bg }) }); +  else +  id->misc->colors += ({ ({ defines->fg, defines->bg }) }); +    #define FIX(X,Y) if(args->X){defines->Y=args->X;if(args->X[0]!='#'){args->X=ns_color(parse_color(args->X));changed = 1;}}       FIX(bgcolor,bg);    FIX(text,fg);    FIX(color,fg);    if(changed)return ("<"+tagname+" "+make_args(args)+">");    return 0;   }    -  + string pop_color(string tagname,mapping args,object id,object file, +  mapping defines) + { +  array c = id->misc->colors; +  if(c && sizeof(c)) +  { +  defines->fg = c[-1][0]; +  defines->bg = c[-1][1]; +  id->misc->colors = c[..sizeof(c)-2]; +  } + } +    mapping query_tag_callers()   {    return ([ -  "body":tag_body, "font":tag_fix_color, +  "body":tag_body, +  "font":tag_fix_color,    "table":tag_fix_color, -  "tr":tag_fix_color, "td":tag_fix_color +  "tr":tag_fix_color, +  "td":tag_fix_color, +  "/td":pop_color, +  "/tr":pop_color, +  "/font":pop_color, +  "/body":pop_color, +  "/table":pop_color,    ]);   }         mapping query_container_callers()   {    return ([ "anfang":tag_graphicstext,    "gh":tag_graphicstext,    "gh1":tag_graphicstext, "gh2":tag_graphicstext,    "gh3":tag_graphicstext, "gh4":tag_graphicstext,    "gh5":tag_graphicstext, "gh6":tag_graphicstext,    "gh7":tag_graphicstext, "gh8":tag_graphicstext,    "gh9":tag_graphicstext, "gh10":tag_graphicstext,    "gh11":tag_graphicstext,"gh12":tag_graphicstext,    "gtext":tag_graphicstext, ]);   }