ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/URL/URLclass.pm
(Generate patch)

Comparing COMP/SCRAM/src/URL/URLclass.pm (file contents):
Revision 1.3 by williamc, Fri Nov 12 16:40:45 1999 UTC vs.
Revision 1.4 by williamc, Fri Nov 12 16:59:17 1999 UTC

# Line 12 | Line 12
12   # url()         : return the full url name with all expansion
13   # expandurl(URLbase) : expand the url to include the given base
14   # file()        : return the filename from the end of the path
15 + # base()        : return the basename of the path
16   # param(var)    : return the value of a url parameter
17   #
18   # -- specialised use methods
19   # type()        : get/set the url type
20   # vars()        : get/set the vars hash
21 < # base(base)    : push a base into the url path if it dosnt already mactch
21 > # base(base)    : push a base into the url path if it dosnt already match
22   # transfervars(varhash)  : transfer any variables from varhash into vars
23   #                          only if they do not already exist
24  
# Line 59 | Line 60 | sub expandurl {
60          $self->{vars}={};
61          $self->_url($self->{origurl}); # reset the current url;
62          $self->transfervars($base->cmds());
63 <        $self->base($base->base());
63 >        $self->_base($base->base());
64   }
65  
65 sub base {
66        my $self=shift;
67        if ( @_ ) {
68          my $server=shift;
69          if ( ($server ne "") && ($self->{server}!~/\/\//) &&
70                        ($self->{server}!~/$server/) ) {
71             # only set if not already in there
72             $self->{server}=$server."/".$self->{server};
73          }
74        }
75        return $self->{server};
76 }
66  
67   sub url {
68          my $self=shift;
# Line 95 | Line 84 | sub transfervars {
84          }
85   }
86  
87 + sub base {
88 +        my $self=shift;
89 +        my $base;
90 +        ($base=$self->{server})=~s/(.*\/)/$1/;
91 +        return $base;
92 + }
93 +        
94   sub file {
95          my $self=shift;
96          my $file;
# Line 118 | Line 114 | sub param {
114   #
115   # --- Support Routines
116   #
117 +
118 + # push a base name into the url string
119 + sub _base {
120 +        my $self=shift;
121 +        if ( @_ ) {
122 +          my $server=shift;
123 +          if ( ($server ne "") && ($self->{server}!~/\/\//) &&
124 +                        ($self->{server}!~/$server/) ) {
125 +             # only set if not already in there
126 +             $self->{server}=$server."/".$self->{server};
127 +          }
128 +        }
129 +        return $self->{server};
130 + }
131 +
132   sub _vartostring {
133          my $self=shift;
134  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines