Changeset 81


Ignore:
Timestamp:
12/05/10 23:59:23 (13 years ago)
Author:
nanardon
Message:
  • add initial page
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/admin/lib/Sophie/Cli.pm

    r11 r81  
    6666                my ($self, $start, $media) = @_; 
    6767                if ($media) { 
    68                     return (<$start*>) 
     68                    my $res = $self->xmlreq('admin.ls_local', $start); 
     69                    return @{ $res->value }; 
    6970                } else { 
    7071                my $res = $self->xmlreq('distrib.struct', 
     
    7677        } 
    7778    ); 
     79    $env->add_func('unsetpath', { 
     80            code => sub { 
     81                my ($self, $media, $path) = @_; 
     82                my $res = $self->xmlreq('admin.media_remove_path', 
     83                    $self->{dist}, 
     84                    $media, 
     85                    $path, 
     86                ); 
     87            }, 
     88            completion => sub { 
     89                my ($self, $start, $media) = @_; 
     90                if ($media) { 
     91                    my $res = $self->xmlreq('admin.list_path', 
     92                        $self->{dist}, 
     93                        $media, 
     94                    ); 
     95                    return @{ $res->value }; 
     96                } else { 
     97                my $res = $self->xmlreq('distrib.struct', 
     98                    $self->{dist}, 
     99                ); 
     100                return map { $_->{label} } @{ $res->value }; 
     101                } 
     102            }, 
     103        } 
     104    ); 
    78105    $env->add_func('listpath', { 
    79106            code => sub { 
     
    98125                my ($self, $media, $group) = @_; 
    99126                my $res = $self->xmlreq('admin.add_media',$self->{dist}, 
    100                     { dist_label => $media, 
     127                    { label => $media, 
    101128                      group_label => $group }, 
    102129                ); 
     
    104131            }, 
    105132            completion => sub { 
    106                 my ($self) = @_; 
    107                 my $res = $self->xmlreq('distrib.struct', 
    108                     $self->{dist}, 
    109                 ); 
    110                 return map { $_->{label} } @{ $res->value }; 
     133                my ($self, $start, $label) = @_; 
     134                my $res = $self->xmlreq('distrib.struct', 
     135                    $self->{dist}, 
     136                ); 
     137                return ((map { $_->{label} } @{ $res->value }), $label ? 
     138                    ($label) : ()) 
    111139            }, 
    112140        } 
Note: See TracChangeset for help on using the changeset viewer.