--- loncom/publisher/lonpubdir.pm 2011/10/25 22:04:20 1.132 +++ loncom/publisher/lonpubdir.pm 2014/04/06 19:39:04 1.151 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA -# Construction Space Directory Lister +# Authoring Space Directory Lister # -# $Id: lonpubdir.pm,v 1.132 2011/10/25 22:04:20 www Exp $ +# $Id: lonpubdir.pm,v 1.151 2014/04/06 19:39:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,7 +33,6 @@ use strict; use Apache::File; use File::Copy; use Apache::Constants qw(:common :http :methods); -use Apache::loncacc; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::londiff(); @@ -47,12 +46,12 @@ sub handler { my $r=shift; - # Validate access to the construction space and get username@domain. + # Validate access to the construction space and get username:domain. my $uname; my $udom; - ($uname,$udom)=&Apache::loncacc::constructaccess($r->uri); + ($uname,$udom)=&Apache::lonnet::constructaccess($r->uri); unless (($uname) && ($udom)) { return HTTP_NOT_ACCEPTABLE; } @@ -80,15 +79,23 @@ sub handler { my $numdir = 0; my $numres = 0; + # Retrieving value for sortby from QUERY_STRING + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sortby']); + + # Default sort by 'Name' + if (! exists($env{'form.sortby'})) { + $env{'form.sortby'} = 'filename'; + } + # Start off the directory table. $r->print(&Apache::loncommon::start_data_table() .&Apache::loncommon::start_data_table_header_row() .'