Branch: Tag:

2009-11-26

2009-11-26 15:12:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now uses Roxen.timeout_dequantifier() to calculate the timeouts.

Rev: server/modules/graphics/atlas.pike:1.20
Rev: server/modules/graphics/business.pike:1.155
Rev: server/modules/graphics/cimg.pike:1.84
Rev: server/modules/graphics/gbutton.pike:1.121
Rev: server/modules/graphics/graphic_text.pike:1.309
Rev: server/modules/graphics/gxml.pike:1.48

1:   // This is a roxen module. Copyright © 1996 - 2009, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.308 2009/11/24 15:17:33 grubba Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.309 2009/11/26 15:12:34 grubba Exp $";      #include <module.h>   inherit "module";
1042:    class Frame {    inherit RXML.Frame;    array do_return(RequestID id) { +  int timeout = Roxen.timeout_dequantifier(args);    content=fix_text(content||"",args,id);    mapping p=mk_gtext_arg(args,id);    if(args->href && !p->fgcolor) p->fgcolor=id->misc->gtext_link||"#0000ff";    string ext="";    if(query("ext")) ext="."+(p->format || "gif"); -  int timeout = UNDEFINED; -  if (args["unix-time"]) { -  timeout = (int)args["unix-time"] - time(1); -  } -  timeout = Roxen.time_dequantifier(args, timeout); +     if(!args->short)    return ({ query_absolute_internal_location(id) +    image_cache->store( ({p,content}), id, timeout )+ext });
1083:    inherit RXML.Frame;       array do_return(RequestID id) { +  int timeout = Roxen.timeout_dequantifier(args, timeout);    mapping p=mk_gtext_arg(args,id);    if(args->href && !p->fgcolor) p->fgcolor=id->misc->gtext_link||"#0000ff"; -  int timeout = UNDEFINED; -  if (args["unix-time"]) { -  timeout = (int)args["unix-time"] - time(1); -  } -  timeout = Roxen.time_dequantifier(args, timeout); +     if(!args->short)    return ({ query_absolute_internal_location(id) +    "$"+image_cache->store(p, id, timeout)+"/" });
1176:    m_delete(arg, "border");    arg->style = "border: none;" + (arg->style || "");    -  int timeout = UNDEFINED; -  if (arg["unix-time"]) { -  timeout = (int)arg["unix-time"] - time(1); -  } -  timeout = Roxen.time_dequantifier(arg, timeout); -  if (!zero_type(timeout)) { -  // Clean up the args mapping. -  foreach(({ "unix-time", "seconds", "minutes", "beats", "hours", -  "days", "weeks", "months", "years" }), string a) { -  m_delete(arg, a); -  } -  // Make sure the timeout is positive (and reasonable). -  if (timeout < 60) timeout = 60; -  } +  int timeout = Roxen.timeout_dequantifier(arg);    int no_draw = !id->misc->generate_images;    if(arg->split)    {