version 1.112, 2004/06/17 01:44:34
|
version 1.114, 2004/06/17 20:43:04
|
Line 60 my %hash; # global user-specific gdbm fi
|
Line 60 my %hash; # global user-specific gdbm fi
|
my %dirs; # keys are directories, values are the open/close status |
my %dirs; # keys are directories, values are the open/close status |
my %language; # has the reference information present in language.tab |
my %language; # has the reference information present in language.tab |
my %dynhash; # hash of hashes for dynamic metadata |
my %dynhash; # hash of hashes for dynamic metadata |
|
my %fieldnames; # Metadata fieldnames |
# ----- Values which are set by the handler subroutine and are accessible to |
# ----- Values which are set by the handler subroutine and are accessible to |
# ----- other methods. |
# ----- other methods. |
my $extrafield; # default extra table cell |
my $extrafield; # default extra table cell |
Line 87 sub handler {
|
Line 87 sub handler {
|
# these global to this package? It is just so wrong....) |
# these global to this package? It is just so wrong....) |
undef (@Only); |
undef (@Only); |
undef (@Omit); |
undef (@Omit); |
|
%fieldnames=&Apache::lonmeta::fieldnames(); |
|
|
# ------------------------------------- read in machine configuration variables |
# ------------------------------------- read in machine configuration variables |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
Line 136 sub handler {
|
Line 137 sub handler {
|
my $extra=''; |
my $extra=''; |
if (defined($ENV{'form.titleelement'})) { |
if (defined($ENV{'form.titleelement'})) { |
my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'}); |
my $verify_title = &Apache::lonnet::gettitle($ENV{'form.acts'}); |
&Apache::lonnet::logthis("Hrrm $ENV{'form.acts'} -- $verify_title"); |
# &Apache::lonnet::logthis("Hrrm $ENV{'form.acts'} -- $verify_title"); |
$verify_title=~s/'/\\'/g; |
$verify_title=~s/'/\\'/g; |
$extra='window.opener.document.forms["'.$ENV{'form.form'}.'"].elements["'.$ENV{'form.titleelement'}.'"].value=\''.$verify_title.'\';'; |
$extra='window.opener.document.forms["'.$ENV{'form.form'}.'"].elements["'.$ENV{'form.titleelement'}.'"].value=\''.$verify_title.'\';'; |
} |
} |
Line 684 sub dynmetaread {
|
Line 685 sub dynmetaread {
|
if (($hash{'display_attrs_8'}==1) || ($hash{'display_attrs_11'}==1)) { |
if (($hash{'display_attrs_8'}==1) || ($hash{'display_attrs_11'}==1)) { |
%dynhash= |
%dynhash= |
(%dynhash,&Apache::lonmeta::get_dynamic_metadata_from_sql($uri)); |
(%dynhash,&Apache::lonmeta::get_dynamic_metadata_from_sql($uri)); |
&Apache::lonnet::logthis('Found: '.$uri." : ".join(',',keys %dynhash)); |
|
} |
} |
} |
} |
|
|
Line 874 sub display_line {
|
Line 874 sub display_line {
|
} |
} |
# Set the icon for the file |
# Set the icon for the file |
my $iconname = &Apache::loncommon::icon($listname); |
my $iconname = &Apache::loncommon::icon($listname); |
$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap>"); |
$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap='1' align='top'>"); |
|
|
my $metafile = $Apache::lonnet::perlvar{'lonDocRoot'}.$pathprefix. |
my $metafile = $Apache::lonnet::perlvar{'lonDocRoot'}.$pathprefix. |
$filecom[0].'.meta'; |
$filecom[0].'.meta'; |
Line 1017 sub display_line {
|
Line 1017 sub display_line {
|
if ($hash{'display_attrs_8'} == 1) { |
if ($hash{'display_attrs_8'} == 1) { |
# statistics |
# statistics |
$r->print("<td>"); |
$r->print("<td>"); |
if ($dynhash{$filelink}->{'stdno'}) { |
&dynmetaprint($r,$filelink,'count'); |
$r->print(&mt('Number of students: '). |
&dynmetaprint($r,$filelink,'course'); |
$dynhash{$filelink}->{'stdno'}.'<br />'); |
&dynmetaprint($r,$filelink,'stdno'); |
} |
&dynmetaprint($r,$filelink,'avetries'); |
|
&dynmetaprint($r,$filelink,'difficulty'); |
|
&dynmetaprint($r,$filelink,'disc'); |
|
&dynmetaprint($r,$filelink,'clear'); |
|
&dynmetaprint($r,$filelink,'technical'); |
|
&dynmetaprint($r,$filelink,'correct'); |
|
&dynmetaprint($r,$filelink,'helpful'); |
|
&dynmetaprint($r,$filelink,'depth'); |
$r->print(" </td>\n"); |
$r->print(" </td>\n"); |
|
|
} |
} |
Line 1037 sub display_line {
|
Line 1044 sub display_line {
|
} |
} |
if ($hash{'display_attrs_11'} == 1) { |
if ($hash{'display_attrs_11'} == 1) { |
# links |
# links |
$r->print("<td>$filelink"); |
$r->print('<td>'); |
if ($dynhash{$filelink}->{'goto_list'}) { |
&dynmetaprint($r,$filelink,'goto_list'); |
$r->print(&mt('Number of students: '). |
&dynmetaprint($r,$filelink,'comefrom_list'); |
$dynhash{$filelink}->{'goto_list'}.'<br />'); |
&dynmetaprint($r,$filelink,'sequsage_list'); |
} |
&dynmetaprint($r,$filelink,'dependencies'); |
if ($dynhash{$filelink}->{'comefrom_list'}) { |
$r->print('</td>'); |
$r->print(&mt('Number of students: '). |
} |
$dynhash{$filelink}->{'comefrom_list'}.'<br />'); |
|
} |
|
$r->print(" </td>\n"); |
|
} |
|
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
} |
} |
|
|
Line 1135 sub display_line {
|
Line 1138 sub display_line {
|
|
|
} |
} |
|
|
|
sub dynmetaprint { |
|
my ($r,$filelink,$item)=@_; |
|
if ($dynhash{$filelink}->{$item}) { |
|
$r->print("\n<br />".$fieldnames{$item}.': '. |
|
&Apache::lonmeta::prettyprint($item, |
|
$dynhash{$filelink}->{$item}, |
|
(($ENV{'form.catalogmode'} ne 'groupimport')?'preview':''), |
|
'', |
|
(($ENV{'form.catalogmode'} eq 'groupimport')?'document.forms.fileattr':''),1)); |
|
} |
|
} |
|
|
# ------------------- prints the beginning of a form for directory or file link |
# ------------------- prints the beginning of a form for directory or file link |
sub begin_form { |
sub begin_form { |
my ($r,$uri) = @_; |
my ($r,$uri) = @_; |