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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1:   // This is a roxen module. Copyright © 1996 - 2000, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.229 2000/04/29 20:26:58 kuntri Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.230 2000/08/25 00:31:45 nilsson Exp $";      #include <module.h>   inherit "module";   inherit "roxenlib";         // ------------------- Module registration ---------------------      constant module_type = MODULE_PARSER;   constant module_name = "Graphic text";
Roxen.git/server/modules/graphics/graphic_text.pike:829:   string simpletag_gtext(string t, mapping arg, string c, RequestID id)   {    if((c-" ")=="") return "";       c=fix_text(c,arg,id);    mapping p=mk_gtext_arg(arg,id);       string ext="";    if(query("ext")) ext="."+(p->format || "gif");    -  string lp="%s", url="", ea=""; +  string lp="%s", url="", ea=" ";       int input=0;    if(arg->submit)    {    input=1;    m_delete(arg,"submit");    }       if(arg->href)    {    url = arg->href;    lp = replace(make_tag("a",arg-hreffilter),"%","%%")+"%s</a>";    if(!p->fgcolor) p->fgcolor=id->misc->gtext_link||"#0000ff";    m_delete(arg, "href");    }    -  +  foreach( ({ "class", "onClick", "onclick", "onMouseover", "onmouseover", +  "onMouseout", "onmouseout" }), string name) +  if(arg[name]) { +  ea+=name+"="; +  if(!has_value(arg[name], "\"")) ea+="\""+arg[name]+"\" "; +  else if(!has_value(arg[name], "'")) ea+="'"+arg[name]+"' "; +  else ea+="\""+replace(arg[name], "'", "&#39;")+"\" "; +  m_delete(arg, name); +  } +     if(!arg->noxml) { arg["/"]="/"; m_delete(arg, "noxml"); }    if(!arg->border) arg->border=arg->border||"0";       if(arg->split)    {    string res="",split=arg->split;    if(lower_case(split)=="split") split=" ";    m_delete(arg,"split");    c=replace(c, "\n", " ");    int setalt=!arg->alt;
Roxen.git/server/modules/graphics/graphic_text.pike:911:    if(size) {    arg->width=(string)max(arg->xsize,size->xsize);    arg->height=(string)max(arg->ysize,size->ysize);    }       if(!id->supports->images) return sprintf(lp,arg->alt);       string sn="i"+id->misc->gtext_mi++;    if(!id->supports->js_image_object) {    return (!input)? -  ("<a "+ea+"href=\""+url+"\">"+make_tag("img",arg+(["name":sn]))+"</a>"): +  ("<a"+ea+"href=\""+url+"\">"+make_tag("img",arg+(["name":sn]))+"</a>"):    make_tag("input",arg+(["type":"image"]));    }       arg->name=sn;    string res="\n<script>\n";    if(!id->misc->gtext_magic_java) {    res += "function i(ri,hi,txt)\n"    "{\n"    " document.images[ri].src = hi.src;\n"    " if( txt != 0 )\n"    " setTimeout(\"top.window.status = '\"+txt+\"'\", 100);\n"    "}\n";    }    id->misc->gtext_magic_java="yes";       return    res+    " "+sn+"l = new Image("+arg->width+", "+arg->height+");"+sn+"l.src = \""+arg->src+"\";\n"    " "+sn+"h = new Image("+arg->width+", "+arg->height+");"+sn+"h.src = \""+query_internal_location()+num2+ext+"\";\n"    "</script>\n"+ -  "<a "+ea+"href=\""+url+"\" "+ +  "<a"+ea+"href=\""+url+"\" "+    (input?"onClick='document.forms[0].submit();' ":"")    +"onMouseover=\"i('"+sn+"',"+sn+"h,"+((strlen(magic) && magic != "magic")?    "'"+replace(magic,"'","`")+"'":    "0")+"); return true;\" "    "onMouseout=\"document.images['"+sn+"'].src = "+sn+"l.src;\">"    +make_tag("img",arg)+"</a>";    }       if(input)    return make_tag("input",arg+(["type":"image"]));