X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fxmlhttp.html;h=b2f265afbb6bc03c9faddf10bc50f5f58eb0e737;hp=425e28e3d437b9631aeead40b2f45e5796e179d3;hb=37e92c220a54636ebc7900cd59ec6ce56790ede8;hpb=9e342300c380e29af1b9678f1a9604609e0061b6 diff --git a/httemplate/elements/xmlhttp.html b/httemplate/elements/xmlhttp.html index 425e28e3d..b2f265afb 100644 --- a/httemplate/elements/xmlhttp.html +++ b/httemplate/elements/xmlhttp.html @@ -1,65 +1,133 @@ -<% - my ( $url, @subs ) = @_; +<%doc> - $url .= ( ($url =~ /\?/) ? '&' : '?' ). - 'sub='; +Example: -%> + include( '/elements/xmlhttp.html', + # required + 'url' => $p.'misc/something.html', + 'subs' => [ 'subroutine' ], + # optional + 'method' => 'GET', # defaults to GET, could specify POST + 'key' => 'unique', # unique key + 'skip_empty' => '1', # When the given key value is null or = 0, + # skip making a useless http request + + ); + + +<%shared> +my %initialized = ();#won't work if component is "preloaded"... so don't do that + +<& /elements/rs_init_object.html &> +<& /elements/init_overlib.html &> +<%init> +my ( %opt ) = @_; + +my $url = $opt{'url'}; +my $method = exists($opt{'method'}) ? $opt{'method'} : 'GET'; +#my @subs = @{ $opt{'subs'}; +my $key = exists($opt{'key'}) ? $opt{'key'} : ''; + +$url .= ( ($url =~ /\?/) ? '&' : '?' ) + if $method eq 'GET'; + +