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

version» Context lines:

Roxen.git/server/modules/tags/configtablist.pike:1:   /* -  * $Id: configtablist.pike,v 1.7 1998/03/08 13:48:51 per Exp $ +  * $Id: configtablist.pike,v 1.8 1998/03/13 15:29:05 js Exp $    *    * Makes a tab-list like the one in the config-interface.    * -  * $Author: per $ +  * $Author: js $    */    - constant cvs_version="$Id: configtablist.pike,v 1.7 1998/03/08 13:48:51 per Exp $"; + constant cvs_version="$Id: configtablist.pike,v 1.8 1998/03/13 15:29:05 js Exp $";   constant thread_safe=1;      #include <module.h>   inherit "module";   inherit "roxenlib";      /*    * Functions    */   
Roxen.git/server/modules/tags/configtablist.pike:25:    "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"    "<tr><td><b>selected</b></td><td>Whether the tab is selected "    "or not.</td></tr>\n" +  "<tr><td><b>bgcolor</b></td><td>What color to use as background. " +  "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,
Roxen.git/server/modules/tags/configtablist.pike:46:   }      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+=a->bgcolor; +  else +  dir+="white"; +  dir+="/";    m_delete(a, "selected");       img_attrs->src = QUERY(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) + "\\_";    }
Roxen.git/server/modules/tags/configtablist.pike:95: Inside #if constant(thread_create)
   //    // 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)   { +  array pagecolor; //=({ 122, 122, 122 }); //parse_color("lightblue");    array(string) arr = f/"/";    if (sizeof(arr) > 1) {    object interface = load_interface();    object(Image.image) button;       if (arr[-1][sizeof(arr[-1])-4..] == ".gif") {    arr[-1] = arr[-1][..sizeof(arr[-1])-5];    }    -  +  pagecolor=parse_color(replace(arr[1],"|","#",)); +     switch (arr[0]) {    case "s": /* Selected */ -  button = interface->draw_selected_button(arr[1..]*"/", -  interface->button_font); +  button = interface->draw_selected_button(arr[2..]*"/", +  interface->button_font, +  pagecolor);    break;    case "u": /* Unselected */ -  button = interface->draw_unselected_button(arr[1..]*"/", -  interface->button_font); +  button = interface->draw_unselected_button(arr[2..]*"/", +  interface->button_font, +  pagecolor);    break;    default:    return 0;    } -  return http_string_answer(button->togif(), "image/gif"); +  return http_string_answer(Image.GIF.encode(button,@pagecolor), +  "image/gif");    }    return 0;   }