--- loncom/homework/lonhomework.pm 2008/03/12 02:46:53 1.291
+++ loncom/homework/lonhomework.pm 2008/07/07 11:02:25 1.295
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Homework handler
#
-# $Id: lonhomework.pm,v 1.291 2008/03/12 02:46:53 raeburn Exp $
+# $Id: lonhomework.pm,v 1.295 2008/07/07 11:02:25 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -937,6 +937,7 @@ sub editxmlmode {
&Apache::loncommon::resize_textarea_js().
&Apache::structuretags::setmode_javascript();
my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1;
+ my $dragmath = &Apache::lonhtmlcommon::dragmath("LC_editxmltext");
my $start_page =
&Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js,
{'no_auto_mt_title' => 1,
@@ -959,6 +960,7 @@ sub editxmlmode {
+
@@ -966,7 +968,8 @@ sub editxmlmode {
-
+ '
+ .$dragmath.'
'.&Apache::lonxml::message_location().'
@@ -1079,8 +1082,10 @@ sub get_template_list {
}
my @files = glob($Apache::lonnet::perlvar{'lonIncludes'}.
'/templates/*.'.$glob_extension);
- @files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title'))]} (@files);
- @files = sort {$a->[1] cmp $b->[1]} (@files);
+ @files = map {[$_,&mt(&Apache::lonnet::metadata($_, 'title')),
+ (&Apache::lonnet::metadata($_, 'category')?&mt(&Apache::lonnet::metadata($_, 'category')):&mt('Miscellaneous')),
+ &mt(&Apache::lonnet::metadata($_, 'help'))]} (@files);
+ @files = sort {$a->[2].$a->[1] cmp $b->[2].$b->[1]} (@files);
my ($midpoint,$seconddiv,$numfiles);
$numfiles = 0;
foreach my $file (@files) {
@@ -1095,16 +1100,28 @@ sub get_template_list {
}
}
my $count = 0;
+ my $currentcategory='';
foreach my $file (@files) {
next if ($file->[1] !~ /\S/);
+ if ($file->[2] ne $currentcategory) {
+ $currentcategory=$file->[2];
+ if ((!$seconddiv) && ($count >= $midpoint)) {
+ $result .= ''."\n".''."\n";
+ $seconddiv = 1;
+ }
+ $result.='
'.$currentcategory.'
';
+ $count++;
+ }
$result .=
'
'."\n";
- $count ++;
- if ((!$seconddiv) && ($count >= $midpoint)) {
- $result .= ''."\n".''."\n";
- $seconddiv = 1;
+ $file->[1].'';
+ if ($file->[3]) {
+ $result.=&Apache::loncommon::help_open_topic($file->[3]);
}
+ my $filename=$file->[0];
+ $filename=~s/^\/home\/httpd\/html//;
+ $result.='
'.&mt('Example').''."\n";
+ $count ++;
}
if ($numfiles > 0) {
$result .= '
'."\n".''."\n";