Roxen.git / server / modules / configuration / config_tags.pike

version» Context lines:

Roxen.git/server/modules/configuration/config_tags.pike:6:   #include <stat.h>   #include <config_interface.h>   #include <config.h>   #include <roxen.h>   #include <module.h>   //<locale-token project="roxen_config">LOCALE</locale-token>   #define LOCALE(X,Y) _STR_LOCALE("roxen_config",X,Y)      #define CU_AUTH id->misc->config_user->auth    - constant cvs_version = "$Id: config_tags.pike,v 1.207 2011/07/14 15:20:16 grubba Exp $"; + constant cvs_version = "$Id$";   constant module_type = MODULE_TAG|MODULE_CONFIG;   constant module_name = "Tags: Administration interface tags";      /* Not exactly true, but the config filesystem forbids parallell    * accesses anyway so there is no need for an extra lock here..    */   constant thread_safe = 1;      void create()   {
Roxen.git/server/modules/configuration/config_tags.pike:208:    if( stringp(q = QALIAS( "left-background" )) && strlen( q ) )    res += " background="+q;    return ENCODE_RXML_XML(res, type);       case "content-tableargs":    res = " width=\"100%\" valign=\"top\"";    if( stringp(q = QALIAS( "content-background" )) && strlen( q ) )    res += " background="+q;    return ENCODE_RXML_XML(res, type);    +  case "set-wiz-id": +  // Used in links with form variables. +  return sprintf("_roxen_wizard_id=%s", +  Roxen.html_encode_string(Roxen.get_wizard_id_cookie(id) || ""));       /* standalone, nothing is based on these. */    case "warncolor": return ENCODE_RXML_TEXT("darkred", type);    case "content-toptableargs": return ENCODE_RXML_TEXT("", type);    case "split-tableargs": return ENCODE_RXML_TEXT("", type);    case "split2-tableargs": return ENCODE_RXML_TEXT("", type);    case "split2-width": return ENCODE_RXML_TEXT("", type);    case "left-image": return ENCODE_RXML_TEXT("/internal-roxen-unit", type);    case "selected-indicator": return ENCODE_RXML_TEXT("/internal-roxen-next", type);    case "database-small": return ENCODE_RXML_TEXT("/internal-roxen-database_small", type);
Roxen.git/server/modules/configuration/config_tags.pike:428:   {    RoxenModule cfs = id->conf->find_module( "config_filesystem#0" );       // There is one occasion when there is no id->port_obj: When the    // port for the configuration interface is changed.    string base =(id->port_obj ?    combine_path((id->port_obj->path||"/"),    cfs->query_location()[1..])+    "diff.pike":    cfs->query_location()+"diff.pike"); -  return base+"?variable="+Roxen.http_encode_url(var->path()); +  return base+"?variable="+Roxen.http_encode_url(var->path())+ +  "&amp;&usr.set-wiz-id;";   }      mapping get_variable_map( string s, object mod, RequestID id, int noset )   {    if( !mod ) return ([]);    object var = mod->getvar( s );    mapping res = ([ "sname":s]);       int defv = !!id->variables[var->path()+"do_default.x"];    if( defv )
Roxen.git/server/modules/configuration/config_tags.pike:489:    return res;   }      object get_conf( object mod )   {    if( mod->my_configuration )    return mod->my_configuration();    return mod;   }    - mapping get_variable_section( string s, object mod, RequestID id ) + mapping low_variable_section(string|object localized_name, +  object mod, RequestID id)   { -  Variable.Variable var = mod->getvar( s ); +     string section = RXML.get_var( "section", "form" ); -  LocaleString localized_name = var->name(); -  s = (string)localized_name; +  string s = (string)localized_name;    if( sscanf( s, "%s:%*s", s ) ) {    string s2 = s;    string old_loc;    if (objectp(localized_name) &&    (old_loc = roxen.get_locale()) != "eng") {    roxen.set_locale("eng"); // Standard.    s2 = (string)localized_name;    roxen.set_locale(old_loc);    sscanf(s2, "%s:", s2);    }
Roxen.git/server/modules/configuration/config_tags.pike:521:    else    return ([    "section":"Settings",    "sectionname":LOCALE(256,"Settings"),    "selected":    ((section=="Settings" || !section)?"selected":""),    ]);    return 0;   }    + mapping get_variable_section( string s, object mod, RequestID id ) + { +  Variable.Variable var = mod->getvar( s ); +  LocaleString localized_name = var->name(); +  return low_variable_section(localized_name, mod, id); + } +    array get_variable_maps( object mod,    mapping m,    RequestID id,    int fnset )   {    if( !mod )    return ({});    while( id->misc->orig )    id = id->misc->orig;    array variables = map( indices(mod->query()),
Roxen.git/server/modules/configuration/config_tags.pike:875:    inherit RXML.Tag;    constant name = "emit";    constant plugin_name = "config-variables-sections";       array get_dataset(mapping m, RequestID id)    {    array v = get_variable_sections( find_config_or_error( m->configuration ),    m, id );       string section = RXML.get_var( "section", "form" ); -  if( m["add-module-priorities"] ) +  if( m["add-module-priorities"] && (id->conf != m->configuration) )    v = ({    ([    "section":"ModulePriorities",    "sectionname":LOCALE(551,"Module Priorities"),    "selected":(section=="ModulePriorities")?"selected":"",    ]),    }) + v;    if( m["add-status"] )    v = ({    ([
Roxen.git/server/modules/configuration/config_tags.pike:990:   class TagCFHeadline   {    inherit RXML.Tag;    constant name = "cf-headline";       class Frame    {    inherit RXML.Frame;    array do_return( RequestID id )    { +  result_type = RXML.t_text;    return ({ roxen->query("config_header_string") });    }    }   }      class TagGlobalVariablesSectionsplugin   {    inherit RXML.Tag;    constant name = "emit";    constant plugin_name = "global-variables-sections";
Roxen.git/server/modules/configuration/config_tags.pike:1098:    "<td valign='top'><img src='&usr.count-"+(++id->misc->_rul_cnt&3)+    ";' /></td><td valign='top'>"+c+"</td></tr>\n";   }      string simpletag_rul( string t, mapping m, string c, RequestID id )   {    id->misc->_rul_cnt = -1;    return "<table>"+c+"</table>";   }    + string simpletag_roxen_wizard_id_variable(string t, mapping m, string c, +  RequestID id) + { +  string wizard_id = Roxen.get_wizard_id_cookie(id); +  if (!sizeof(wizard_id || "")) { +  wizard_id = Roxen.set_wizard_id_cookie(id); +  } +  if (wizard_id != id->variables["_roxen_wizard_id"]) { +  foreach(id->real_variables; string var;) { +  m_delete(id->real_variables, var); +  } +  foreach(id->variables; string var;) { +  m_delete(id->real_variables, var); +  } +  id->variables["_roxen_wizard_id"] = wizard_id; +  } +  return sprintf("<input type='hidden' name='_roxen_wizard_id' " +  "value='%s' />", +  Roxen.html_encode_string(wizard_id)); + } +    class TagCfPerm   {    inherit RXML.Tag;    constant name = "cf-perm";    constant flags = 0;    class Frame    {    inherit RXML.Frame;    int do_iterate;    void do_enter( RequestID id )