Roxen.git / server / modules / tags / configtablist.pike

version» Context lines:

Roxen.git/server/modules/tags/configtablist.pike:1:   /* -  * $Id: configtablist.pike,v 1.11 1998/07/10 01:08:11 js Exp $ +  * $Id: configtablist.pike,v 1.12 1999/02/27 00:42:13 marcus Exp $    *    * Makes a tab-list like the one in the config-interface.    * -  * $Author: js $ +  * $Author: marcus $    */    - constant cvs_version="$Id: configtablist.pike,v 1.11 1998/07/10 01:08:11 js Exp $"; + constant cvs_version="$Id: configtablist.pike,v 1.12 1999/02/27 00:42:13 marcus Exp $";   constant thread_safe=1;      #define use_contents_cache 0   #define use_gif_cache 1   #include <module.h>   inherit "module";   inherit "roxenlib";      #if use_contents_cache   mapping(string:string) contents_cache = ([]);
Roxen.git/server/modules/tags/configtablist.pike:22: Inside #if use_gif_cache
  #if use_gif_cache   mapping(string:string) gif_cache = ([]);   #endif      /*    * Functions    */      array register_module()   { -  return(({ MODULE_PARSER|MODULE_LOCATION, "Config tab-list", +  return(({ MODULE_PARSER, "Config tab-list",    "Adds some tags for making a config-interface "    "look-alike tab-list.<br>\n"    "Usage:<br>\n"    "<ul><pre>&lt;config_tablist&gt;\n"    "&lt;tab href=\"/tab1/\"&gt;Some text&lt;/tab&gt;\n"    "&lt;tab href=\"/tab2/\"&gt;Some more text&lt;/tab&gt;\n"    "&lt;tab href=\"a/strange/place/\"&gt;Tab 3&lt;/tab&gt;\n"    "&lt;/config_tablist&gt;\n"    "</pre></ul>Attributes for the &lt;tab&gt; tag:<br>\n"    "<ul><table border=0>\n"
Roxen.git/server/modules/tags/configtablist.pike:46:    "Defaults to white.</td></tr>\n"    "<tr><td><b>alt</b></td><td>Alt-text for the image (default: "    "\"_/\" + text + \"\\_\").</td></tr>\n"    "<tr><td><b>border</b></td><td>Border for the image (default: "    "0).</td></tr>\n"    "</table></ul>\n", 0, 1 }));   }      void create()   { -  defvar("location", "/configtabs/", "Mountpoint", TYPE_LOCATION|VAR_MORE, -  "The URL-prefix for the buttons."); +    }      string tag_config_tab(string t, mapping a, string contents)   {    string dir = "u/";    mapping img_attrs = ([]);    if(a->help) return register_module()[2];    if (a->selected) {    dir = "s/";    }    if(a->bgcolor)    dir+=replace(a->bgcolor,"#","|");    else    dir+="white";    dir+="/";    m_delete(a, "selected");    -  img_attrs->src = QUERY(location) + dir + +  img_attrs->src = query_internal_location() + dir +    replace(http_encode_string(contents), "?", "%3f") + ".gif";    if (a->alt) {    img_attrs->alt = a->alt;    m_delete(a, "alt");    } else {    img_attrs->alt = "_/" + html_encode_string(contents) + "\\_";    }    if (a->border) {    img_attrs->border = a->border;    m_delete(a, "border");
Roxen.git/server/modules/tags/configtablist.pike:140: Inside #if constant(thread_create)
  #if constant(thread_create)    // Only one thread at a time may call roxen->configuration_interface().    //    // load_interface() shouldn't be called recursively,    // so don't protect against it.    mixed key = interface_lock->lock();   #endif /* constant(thread_create) */    return(roxen->configuration_interface());   }    - mapping find_file(string f, object id) + mapping find_internal(string f, object id)   {    string s;   #if use_gif_cache    if(s=gif_cache[f])    {   // werror("Configtablist: "+f+" found in cache.\n");    return http_string_answer(s,"image/gif");    }   #endif