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

version» Context lines:

Roxen.git/server/etc/modules/Variable.pmod/module.pmod:1: - // $Id: module.pmod,v 1.63 2001/08/17 19:32:36 per Exp $ + // $Id: module.pmod,v 1.64 2001/08/24 14:44:26 nilsson Exp $      #include <module.h>   #include <roxen.h>      // Locale macros   //<locale-token project="roxen_config"> LOCALE </locale-token>      #define LOCALE(X,Y) \    ([string](mixed)Locale.translate("roxen_config",roxenp()->locale->get(),X,Y))   
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:53:    if( !oneliner )    {    if( v->diff( 1 ) )    {    m = ([ "href":diff_url,"target":"_new", ]);    diff_button =    Roxen.make_container( "a",m,    Roxen.make_container(    button_tag,    ([]), -  LOCALE(0,"Show changes") +  LOCALE(474,"Show changes")    ) );    }    }    m = ([ "href":def_url, ]);    return diff_button + " " +    Roxen.make_container( "a",m,    Roxen.make_container( button_tag, ([]), -  LOCALE(0, "Restore default value" )+ +  LOCALE(475, "Restore default value" )+    (oneliner||"") ) );      }      class Diff   {    static private array(string) diff;       static private    array(string) print_row(array(string) diff_old, array(string) diff_new,
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:131:    break;    case '-': r += "<tt><font color='darkred'>"+row+"</font></tt><br>\n";    deleted++;    break;    case 'L': r += "<i>"+row+"</i><br>\n";    break;    }    }    if (!hide_header)    r = -  "<b>" + LOCALE(201, "Change in content") + "</b><br />\n"+ -  "<i>"+(added==1? LOCALE(452, "1 line added."): -  sprintf(LOCALE(453, "%d lines added."), added)) + " " + -  (deleted==1? LOCALE(454, "1 line deleted."): -  sprintf(LOCALE(455, "%d lines deleted."), deleted)) + +  "<b>" + LOCALE(476, "Change in content") + "</b><br />\n"+ +  "<i>"+(added==1? LOCALE(477, "1 line added."): +  sprintf(LOCALE(478, "%d lines added."), added)) + " " + +  (deleted==1? LOCALE(479, "1 line deleted."): +  sprintf(LOCALE(480, "%d lines deleted."), deleted)) +    "</i><p>\n"+    r;    return r;    }       array get()    {    return diff;    }   
Roxen.git/server/etc/modules/Variable.pmod/module.pmod:797:    case 1: return "";    case 2:    array lines_orig = default_value()/"\n";    array lines_new = query()/"\n";       Diff diff = Diff( lines_new, lines_orig, 2 );       if( sizeof(diff->get()) )    return diff->html();    else -  return "<i>"+LOCALE(0,"No difference\n" )+"</i>"; +  return "<i>"+LOCALE(481,"No difference\n" )+"</i>";    }    }       array(string) verify_set_from_form( mixed new )    {    return ({ 0, [string]new-"\r" });    }       string render_form( RequestID id, void|mapping additional_args )    {