Changeset 81 for server/trunk/admin
- Timestamp:
- 12/05/10 23:59:23 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/admin/lib/Sophie/Cli.pm
r11 r81 66 66 my ($self, $start, $media) = @_; 67 67 if ($media) { 68 return (<$start*>) 68 my $res = $self->xmlreq('admin.ls_local', $start); 69 return @{ $res->value }; 69 70 } else { 70 71 my $res = $self->xmlreq('distrib.struct', … … 76 77 } 77 78 ); 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 ); 78 105 $env->add_func('listpath', { 79 106 code => sub { … … 98 125 my ($self, $media, $group) = @_; 99 126 my $res = $self->xmlreq('admin.add_media',$self->{dist}, 100 { dist_label => $media,127 { label => $media, 101 128 group_label => $group }, 102 129 ); … … 104 131 }, 105 132 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) : ()) 111 139 }, 112 140 }
Note: See TracChangeset
for help on using the changeset viewer.