Roxen.git / server / base_server / mainconfig.pike

version» Context lines:

Roxen.git/server/base_server/mainconfig.pike:1:   inherit "config/builders"; - string cvs_version = "$Id: mainconfig.pike,v 1.38 1997/05/26 00:28:16 grubba Exp $"; + string cvs_version = "$Id: mainconfig.pike,v 1.39 1997/05/28 00:42:26 per Exp $";   inherit "roxenlib";   inherit "config/draw_things";      import Array;   import Stdio;      /* Work-around for Simulate.perror */   #define perror roxen_perror      #include <confignode.h>
Roxen.git/server/base_server/mainconfig.pike:812:   }               string tablist(array(string) nodes, array(string) links, int selected)   {    array res = ({});    for(int i=0; i<sizeof(nodes); i++)    if(i!=selected) -  PUSH("<a href=\""+links[i]+"\"><img alt=\"/"+nodes[i][1..strlen(nodes[i])-2]+"\\_\" src=/auto/unselected/"+replace(nodes[i]," ","%20")+" border=0></a>"); +  PUSH("<a href=\""+links[i]+"\"><img alt=\"_/"+ +  nodes[i][1..strlen(nodes[i])-2]+"\\__\" src=/auto/unselected/"+ +  replace(nodes[i]," ","%20")+" border=0></a>");    else -  PUSH("<a href=\""+links[i]+"\"><b><img alt=\"/"+nodes[i][1..strlen(nodes[i])-2]+"\\_\" src=/auto/selected/"+replace(nodes[i]," ","%20")+" border=0></b></a>"); - // PUSH("<br>"); +  PUSH("<a href=\""+links[i]+"\"><b><img alt=\"_/"+ +  nodes[i][1..strlen(nodes[i])-2]+"\\__\" src=/auto/selected/"+ +  replace(nodes[i]," ","%20")+" border=0></b></a>"); + //PUSH("<br>");    return res*"";   }      mapping (string:string) selected_nodes =   ([    "Configurations":"/Configurations",    "Globals":"/Globals",    "Status":"/Status",    "Errors":"/Errors",   ]);
Roxen.git/server/base_server/mainconfig.pike:846:    " Global variables ",    " Status info ",    " Error log ",   });         string display_tabular_header(object node)   {    string p, s;    -  s = extract_almost_top(node) - "/"; -  selected_nodes[s] = node->path(1); -  +     array links = ({    selected_nodes[tabs[0]]+"?"+(bar++),    selected_nodes[tabs[1]]+"?"+(bar++),    selected_nodes[tabs[2]]+"?"+(bar++),    selected_nodes[tabs[3]]+"?"+(bar++),    }); -  +  +  if(node != root) +  { +  s = extract_almost_top(node) - "/"; +  selected_nodes[s] = node->path(1); +     links[search(tabs,s)]="/"+s+"/"+"?"+(bar++); -  +  }    return tablist(tab_names, links, search(tabs,s));   }      // Return the number of unfolded nodes on the level directly below the passed   // node.      int nunfolded(object o)   {    int i;    if(o = o->down)
Roxen.git/server/base_server/mainconfig.pike:882:   object button_font = get_font("base_server/config/button_font",0,0,0,"left",1.0,1.0);      mapping auto_image(string in, object id)   {    string key, value;    array trans = ({ (int)("0x"+dR),(int)("0x"+dG),(int)("0x"+dB) });    mapping r;    mixed e;    object i;    -  if(r=cache_lookup("config_images", in)) return r; +  string img_key = "auto/"+replace(in,"/","_")+".gif"-" "; +  +  if(e=file_image(img_key)) +  return e; +     if(!sscanf(in, "%s/%s", key, value)) key=in;       switch(key)    {    case "module":    i = draw_module_header(roxen->allmodules[value][0],    roxen->allmodules[value][2],    module_font);    break;   
Roxen.git/server/base_server/mainconfig.pike:924:    case "selected":    i=draw_selected_button(value,button_font);    break;       case "unselected":    i=draw_unselected_button(value,button_font);    break;    }    if(i)    { -  i->map_closest(i->select_colors(64)+({trans})); -  r = http_string_answer(i->togif(@trans),"image/gif"); -  } +  object o = open("roxen-images/"+img_key,"wct"); +  e=i->map_closest(i->select_colors(64)+({trans}))->togif(@trans);    i=0; -  cache_set("config_images", in, r); -  return r; +  if(o) { o->write(e); o=0; } + #ifdef DEBUG +  else {perror("Cannot open file for "+in+"\n");} + #endif +  return http_string_answer(e,"image/gif");    } -  +  return 0; + }         string remove_font(string t, mapping m, string c)   {    return "<b>"+c+"</b>";   }         int nfolded(object o)   {
Roxen.git/server/base_server/mainconfig.pike:997:    else if(!conf_auth_ok(id->auth))    return http_auth_failed("Roxen server maintenance"); // Denied    } else {    id->prestate = aggregate_multiset(@indices(id->prestate)    &({"fold","unfold"}));       if(sizeof(id->variables)) // This is not 100% neccesary, really.    id->variables = ([ ]);    }    +  // Automatically generated image?    if(sscanf(id->not_query, "/auto/%s", tmp))    return auto_image(tmp,id) || (["data":"No such image"]);       o = find_node(id->not_query); // Find the requested node (from the filename)       if(!o) // Bad node, perhaps an old bookmark or something.    {    id->referer = ({ });    return std_redirect(0, id);    } else if(o == root) {