Changeset 851

Show
Ignore:
Timestamp:
12/07/06 02:24:20 (2 years ago)
Author:
gboggs
Message:

Gracefully throw an error if uploading before blog configuring is attempted. BugId: 45692

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/wheeljack/lib/MT/App/CMS.pm

    r849 r851  
    91289128    $param{extra_paths} = \@extra_paths; 
    91299129    $param{refocus} = 1; 
     9130    $param{missing_paths} = -d $blog->site_path || -d $blog->archive_path ? 0 : 1; 
    91309131    $app->build_page('upload.tmpl', \%param); 
    91319132} 
     
    91769177        $root_path = $blog->archive_path; 
    91779178    } 
     9179    return $app->error($app->translate( 
     9180        "Before you can upload a file, you need to configure the publishing paths for your weblog." 
     9181    )) unless $root_path; 
    91789182    $relative_path = $q->param('extra_path'); 
    91799183    $middle_path = $q->param('middle_path') || ''; 
  • branches/wheeljack/tmpl/cms/upload.tmpl

    r811 r851  
    1212//--> 
    1313</script> 
     14 
     15<TMPL_IF NAME=MISSING_PATHS> 
     16<h2><span class="weblog-title-highlight"><MT_TRANS phrase="You need to configure your weblog."></span></h2> 
     17<MT_TRANS phrase="Before you can upload a file, you need to configure the publishing paths for your weblog. <a href="javascript:void(0);" onclick="closeDialog('[_1]');">Click here</a> to configure your weblog's publishing paths." params="<TMPL_VAR NAME=SCRIPT_URL>?__mode=cfg_archives&amp;blog_id=<TMPL_VAR NAME=BLOG_ID>"> 
     18 
     19<div class="panel-commands"> 
     20<form onsubmit="return false" onclick="window.focus();"> 
     21<input onclick="closeDialog()" type="button" value="<MT_TRANS phrase="Close">" /> 
     22</form> 
     23</div>  
     24 
     25<TMPL_ELSE> 
    1426 
    1527<form method="post" enctype="multipart/form-data" action="<TMPL_VAR NAME=SCRIPT_URL>"> 
     
    6476<input type="hidden" name="magic_token" value="<TMPL_VAR NAME=MAGIC_TOKEN>" /> 
    6577</form> 
     78</TMPL_IF> 
    6679 
    6780<TMPL_INCLUDE NAME="footer-dialog.tmpl">