Roxen.git / server / etc / modules / Variable.pmod / module.pmod

version» Context lines:

Roxen.git/server/etc/modules/Variable.pmod/module.pmod:124:    diff = diff[..sizeof(diff)-2];    foreach(diff, string row)    {    row = Roxen.html_encode_string(row);    row = replace(row, "\t", " ");    row = replace(row, " ", "&nbsp;");    switch(row[0])    {    case '&': r += "<tt>"+row+"</tt><br>\n";    break; -  case '+': r += "<tt><font color='darkgreen'>"+row+"</font></tt><br>\n"; +  case '+': r += "<font color='darkgreen'><tt>"+row+"</tt></font><br>\n";    added++;    break; -  case '-': r += "<tt><font color='darkred'>"+row+"</font></tt><br>\n"; +  case '-': r += "<font color='darkred'><tt>"+row+"</tt></font><br>\n";    deleted++;    break;    case 'L': r += "<i>"+row+"</i><br>\n";    break;    }    }    if (!hide_header)    r =    "<b>" + LOCALE(476, "Change in content") + "</b><br />\n"+    "<i>"+(added==1? LOCALE(477, "1 line added."):
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1372:       protected string _title( mixed what )    //! Get the title used as description (shown to the user) for an    //! element gotten from the get_choice_list() function.    {    if( mapping tt = get_translation_table() )    return tt[ what ] || (string)what;    return (string)what;    }    +  protected string render_element(mixed elem) +  //! Render the title used as description (shown to the user) for an +  //! element gotten from the get_choice_list() function. +  //! +  //! The default implementation just calls @[_title()], +  //! and quotes the result. +  //! +  //! Overload this for more advanced rendering. +  { +  return Roxen.html_encode_string(_title(elem)); +  } +     string render_form( RequestID id, void|mapping additional_args )    {    string autosubmit = "";    if(additional_args && additional_args->autosubmit)    autosubmit = " autosubmit='autosubmit' onChange='javascript:submit();'";    if (multiselect) {    array(string) current = map(query(), _name);    string res = "<table>\n";    foreach( get_choice_list(), mixed elem )    {
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1393:    "type": "checkbox",    "name": path(),    "value": _name(elem),    ]);    if(has_value(current, m->value)) {    m->checked="checked";    current -= ({ m->value });    }    res += sprintf("<tr><td>%s</td><td>%s</td></tr>\n",    Roxen.make_tag( "input", m), -  Roxen.html_encode_string(_title(elem))); +  render_element(elem));    }    // Make an entry for the current values if they're not in the list,    // to ensure that the value doesn't change as a side-effect by    // another change.    foreach(current, string value)    {    mapping m = ([    "type": "checkbox",    "name": path(),    "value": value,