--- loncom/publisher/lonpubdir.pm 2014/10/13 14:50:42 1.161 +++ loncom/publisher/lonpubdir.pm 2015/12/10 16:26:59 1.166 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Authoring Space Directory Lister # -# $Id: lonpubdir.pm,v 1.161 2014/10/13 14:50:42 goltermann Exp $ +# $Id: lonpubdir.pm,v 1.166 2015/12/10 16:26:59 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,7 +67,9 @@ sub handler { $r->send_http_header; &Apache::lonhtmlcommon::clear_breadcrumbs(); - $r->print(&Apache::loncommon::start_page('Authoring Space'). + my $js = ''; + $r->print(&Apache::loncommon::start_page('Authoring Space', $js). '
'. '

'. &mt('Your Authoring Space is currently in the location used by LON-CAPA version 2.10 and older, but your domain is using a newer LON-CAPA version ([_1]).',$version).'

'. @@ -87,7 +89,14 @@ sub handler { my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom); - &startpage($r, $uname, $udom, $thisdisfn); # Put out the start of page. + my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; + my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname, + "$londocroot/priv/$udom/$uname"); # expressed in kB + my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom, + 'author'); # expressed in MB + + # Put out the start of page. + &startpage($r, $uname, $udom, $thisdisfn, $current_disk_usage, $disk_quota); if (!-d $fn) { if (-e $fn) { @@ -108,8 +117,8 @@ sub handler { return OK; } - &dircontrols($r,$uname,$udom,$thisdisfn); # Put out actions for directory, - # browse/upload + new file page. + # Put out actions for directory, browse/upload + new file page. + &dircontrols($r,$uname,$udom,$thisdisfn, $current_disk_usage, $disk_quota); &resourceactions($r,$uname,$udom,$thisdisfn); # Put out form used for printing/deletion etc. my $numdir = 0; @@ -187,20 +196,20 @@ sub handler { } else { $idx = 2; } # No arrow if column is not sorted $output .= (($columns{$key}{order}) ? '' .$columns{$key}{text}.$arrows[$idx].'' : ''.$columns{$key}{text}.''); } -my $result = ""; $r->print($result); $r->print('
'.&Apache::loncommon::start_data_table() - .'' + .'' .&Apache::loncommon::start_data_table_header_row() . $output .&Apache::loncommon::end_data_table_header_row() ); @@ -310,7 +319,7 @@ my $result = "'; + $r->print(&Apache::loncommon::start_page('Authoring Space', $js)); - my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; - my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,"$londocroot/priv/$udom/$uname"); - my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom,'author'); #expressed in MB - $disk_quota = 1000 * $disk_quota; # convert from MB to kB + $disk_quota = 1024 * $disk_quota; # convert from MB to kB $r->print(&Apache::loncommon::head_subbox( '
' @@ -482,7 +493,7 @@ ENDPUBDIRSCRIPT } sub dircontrols { - my ($r,$uname,$udom,$thisdisfn) = @_; + my ($r,$uname,$udom,$thisdisfn, $current_disk_usage, $disk_quota) = @_; my %lt=&Apache::lonlocal::texthash( cnpd => 'Cannot publish directory', cnrd => 'Cannot retrieve directory', @@ -521,6 +532,9 @@ sub dircontrols { pick => 'Please select an action to perform using the new filename', ); my $mytype = $lt{'type'}; # avoid conflict with " and ' in javascript + # Calculate free space in bytes. + # $disk_quota is in MB and $current_disk_usage is in kB + my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage); $r->printf(<
@@ -551,7 +565,8 @@ sub dircontrols {
$lt{'updc'} - + +
@@ -585,24 +600,59 @@ sub dircontrols { -    +    +
+ Quickactions: + + + + + + + + + + +
-
-
- $lt{'qs'} - - - - %s -
- - -
-
+
+ $lt{'qs'} + + + + %s +
+ + +
END @@ -864,6 +914,10 @@ sub putresource { if ($filename=~/$LONCAPA::assess_re/) { $editlink=' ('.&mt('EditXML').')'; $editlink2='
('.&mt('Edit').')'; + if ($env{'browser.type'} ne 'explorer' || $env{'browser.version'} > 9) { + my $daxeurl = '/daxepage'.$linkdir.'/'.$filename; + $editlink .= ' (Daxe)'; + } } if ($filename=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm|sty)$/) { $editlink.=' ('.&mt('Clean Up').')';