Skip to content

Commit

Permalink
Added status messages to media upload dialog. Also added a 'blank' de…
Browse files Browse the repository at this point in the history
…fault media type selection.
  • Loading branch information
Nick authored and theory committed Apr 19, 2011
1 parent 3727f76 commit 98cdb16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions comp/widgets/profile/media_upload.mc
Expand Up @@ -9,6 +9,7 @@
req => 1,
objs => \@elems,
useTable => 0,
default => ['',''],
&></td>
<td><input type="file" name="<% $file_widget %>|file" /></td>
<td align="right">
Expand Down
9 changes: 8 additions & 1 deletion lib/Bric/App/Callback/ContainerProf.pm
Expand Up @@ -205,7 +205,14 @@ sub create_related_media : Callback( priority => 6) {
# Bail on error or when there is no file.
my $param = $self->params;
return if $param->{_inconsistent_state_};
return unless $param->{"$widget|file"};
if (!$param->{'media_prof|at_id'}) {
$self->add_message('Please select a media type to upload.');
return;
}
if (!$param->{"$widget|file"}) {
$self->add_message('Please select a file to upload.');
return;
}

# Get a handle on things to restore later.
my $element = $self->_locate_subelement(
Expand Down

0 comments on commit 98cdb16

Please sign in to comment.