'."\n"; + + $scrout .= '' + .$hidden_fields + .''; + + $scrout .= '
'."\n" + .''.&mt('Display Options').''."\n" + .&viewoptions() + .'
'; + + $scrout .= $advanced_buttons; + + $scrout .= &Apache::lonhtmlcommon::start_pick_box(); + my %fields=&Apache::lonmeta::fieldnames(); - # - $scrout .= '

'.&mt("Standard $srchtype Metadata").'

'; - $scrout .= "\n"; - $scrout .= '\n"; + + # Standard Metadata + $scrout .= &Apache::lonhtmlcommon::row_headline() + .'

'.&mt("Standard $srchtype Metadata").'

' + .&searchhelp() + .&Apache::lonhtmlcommon::row_closure(); my %related_word_search = ('title' => 1, 'author' => 0, @@ -883,168 +650,220 @@ ENDHEADER 'abstract' => 1, 'standards'=> 1, 'mime' => 1, - 'subject' => 1, + 'subject' => 1, ); # foreach my $field ('title','author','subject','owner','authorspace', - 'modifyinguser','keywords','notes','abstract', - 'standards','mime') { - $scrout.=''.$/; + $scrout .= &Apache::lonhtmlcommon::row_closure(); } foreach my $field ('lowestgradelevel','highestgradelevel') { - $scrout.=''. - ''. - ''.$/; + 0) + .&Apache::lonhtmlcommon::row_closure(); } - $scrout.=''.$/; - $scrout.=''.$/; - # + + $scrout .= &Apache::lonhtmlcommon::row_title('') + .&Apache::loncommon::filecategoryselect('category', + $env{'form.category'},'category') + .&Apache::lonhtmlcommon::row_closure(); + + my $anydomain = 1; + if ($env{'form.area'} ne 'portfolio') { + unless (&Apache::lonnet::allowed('bre','/res/')) { + $anydomain = 0; + } + } + + $scrout .= &Apache::lonhtmlcommon::row_title(''); + if ($anydomain) { + my $defdom = &Apache::lonnet::default_login_domain(); + my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('shared',$defdom); + $scrout .= &Apache::loncommon::domain_select('domains', + $env{'form.domains'},1,$trusted,$untrusted,'domains'); + } else { + $scrout .= &Apache::loncommon::select_dom_form($env{'user.domain'}, + 'domains','','','', + [$env{'user.domain'}],'',1,'domains'); + } + $scrout .= &Apache::lonhtmlcommon::row_closure(); + # Misc metadata if ($env{'form.area'} ne 'portfolio') { - $scrout.=''.$/; + ) + .&Apache::lonhtmlcommon::row_closure(); } - $scrout.=''; - $scrout .= "
 '. - (' 'x2).&searchhelp()."
'.&titlefield($fields{$field}).''. - &Apache::lonmeta::prettyinput($field, - $env{'form.'.$field}, + 'modifyinguser','keywords','notes','abstract', + 'standards','mime') { + $scrout .= &Apache::lonhtmlcommon::row_title('') + .&Apache::lonmeta::prettyinput($field, + $env{'form.'.$field},'', $field, 'advsearch', - $related_word_search{$field}, - '', + $related_word_search{$field}, + '  ', $env{'form.'.$field.'_related'}, 50); if ($related_word_search{$field}) { - $scrout .= &mt('related words'); + $scrout .= ''; } else { - $scrout .= ' '; + $scrout .= ''; } - $scrout .= '
'.&titlefield($fields{$field}).''. - &Apache::lonmeta::prettyinput($field, - $env{'form.'.$field}, + $scrout .= &Apache::lonhtmlcommon::row_title('') + .&Apache::lonmeta::prettyinput($field, + $env{'form.'.$field},'', $field, 'advsearch', - 0). - '
'. - &titlefield(&mt('MIME Type Category')).''. - &Apache::loncommon::filecategoryselect('category', - $env{'form.category'}). - '
'. - &titlefield(&mt('Domains')).''. - &Apache::loncommon::domain_select('domains', - $env{'form.domains'},1). - '
' - } - $scrout .= '
'. - &titlefield(&mt('Copyright/Distribution')). - ''. - &Apache::lonmeta::selectbox('copyright', - $env{'form.copyright'}, + $scrout .= &Apache::lonhtmlcommon::row_title('') + .&Apache::lonmeta::selectbox('copyright', + $env{'form.copyright'},'', + 'copyright', \&Apache::loncommon::copyrightdescription, ( undef, &Apache::loncommon::copyrightids) - ).'
'. - &titlefield(&mt('Language')).''. - &Apache::lonmeta::selectbox('language', - $env{'form.language'}, + + $scrout .= &Apache::lonhtmlcommon::row_title('') + .&Apache::lonmeta::selectbox('language', + $env{'form.language'},'','language', \&Apache::loncommon::languagedescription, ('any',&Apache::loncommon::languageids) - ).'
\n"; - + ) + .&Apache::lonhtmlcommon::row_closure(); + # Portfolio Metadata if ($env{'form.area'} eq 'portfolio') { # Added fields my $curnumadd = $env{'form.numaddedfields'}; if ($curnumadd eq '') { $curnumadd = 1; } - $scrout .= '

'.&mt('Custom Metadata fields').'

'; - $scrout .= "\n"; - $scrout .= ''.''; + my $customlabel = &mt('Text box description'); + $scrout .= &Apache::lonhtmlcommon::row_headline() + .'

'.&mt('Custom Metadata fields').'

' + .&Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title(''.$customlabel.'', + '','','',1) + .&mt('Field Name').' | '.&mt('Field Value(s)') + .&Apache::lonhtmlcommon::row_closure(); for (my $j=0; $j<$curnumadd; $j++) { my $num = $j+1; - $scrout .= ''. - ''; - } - $scrout .= '
 '. - &mt('Field Name').''. - &mt('Field Value(s)').'
'.&mt('Custom metadata [_1]: ',$num). - ''. - '
'. - '
'; - } else { + my $namelabel = &mt('name of custom metadata field [_1]',$num); + my $valuelabel = &mt('value of custom metadata field [_1]',$num); + $scrout .= &Apache::lonhtmlcommon::row_title(&mt('Custom metadata [_1]',$num)) + .'' + .' ' + .'' + .&Apache::lonhtmlcommon::row_closure(); + } + my $addcustomlabel = &mt('Add metadata field option'); + $scrout .= &Apache::lonhtmlcommon::row_title(''.$addcustomlabel.'', + '','','',1) + .'' + .'' + .&Apache::lonhtmlcommon::row_closure(); +} else { # # Dynamic metadata - $scrout .= '

'.&mt('Problem Statistics').'

'; - $scrout .= "\n"; - $scrout .= ''.''."\n"; + my $statslabel = &mt('Text box description'); + $scrout .= &Apache::lonhtmlcommon::row_headline() + .'

'.&mt('Problem Statistics').'

' + .&Apache::lonhtmlcommon::row_closure(); + $scrout .= &Apache::lonhtmlcommon::row_title(''.$statslabel.'', + '','','',1) + .&mt('Minimum').' | '.&mt('Maximum') + .&Apache::lonhtmlcommon::row_closure(); foreach my $statistic ({ name=>'count', - description=>'Network-wide number of accesses (hits)',}, + description=>'Network-wide number of accesses (hits)', + minlabel => 'minimum hit count', + maxlabel => 'maximum hit count'}, { name=>'stdno', description=> - 'Statistics calculated for number of students',}, + 'Statistics calculated for number of students', + minlabel => 'minimum number of students in calculation', + maxlabel => 'maximum number of students in calculation'}, { name => 'avetries', - description=>'Average number of tries till solved',}, + description=>'Average number of tries till solved', + minlabel => 'minimum average tries till solved', + maxlabel => 'maximum average tries till solved'}, { name => 'difficulty', - description=>'Degree of difficulty',}, + description=>'Degree of difficulty', + minlabel => 'minimum degree of difficulty', + maxlabel => 'maximum degree of difficulty'}, { name => 'disc', - description=>'Degree of discrimination'}) { - $scrout .= ''.$/; - } - $scrout .= "
 '. - &mt('Minimum').''. - &mt('Maximum').'
'. - &titlefield(&mt($statistic->{'description'})). - ''. - ''. - '
\n"; - $scrout .= '

'.&mt('Evaluation Data').'

'; - $scrout .= "\n"; - $scrout .= ''.''."\n"; + description=>'Degree of discrimination', + minlabel => 'minimum degree of discrimination', + maxlabel => 'maximum degree of discrimination'}) { + $scrout .= &Apache::lonhtmlcommon::row_title(&titlefield(&mt($statistic->{'description'}))) + .'' + .' ' + .'' + .&Apache::lonhtmlcommon::row_closure(); + } + my $evallabel = &mt('Text box description'); + $scrout .= &Apache::lonhtmlcommon::row_headline() + .'

'.&mt('Evaluation Data').'

' + .&Apache::lonhtmlcommon::row_closure(); + $scrout .= &Apache::lonhtmlcommon::row_title(''.$evallabel.'', + '','','',1) + .&mt('Minimum').' | '.&mt('Maximum') + .&Apache::lonhtmlcommon::row_closure(); foreach my $evaluation ( { name => 'clear', - description => 'Material presented in clear way'}, + description => 'Material presented in clear way', + minlabel => 'minimum score: clarity', + maxlabel => 'maximum score: clarity'}, { name =>'depth', - description => 'Material covered with sufficient depth'}, + description => 'Material covered with sufficient depth', + minlabel => 'minimum score: coverage depth', + maxlabel => 'maximum score: coverage depth'}, { name => 'helpful', - description => 'Material is helpful'}, + description => 'Material is helpful', + minlabel => 'minimum score: content helpful', + maxlabel => 'maximum score: content helpful'}, { name => 'correct', - description => 'Material appears to be correct'}, + description => 'Material appears to be correct', + minlabel => 'minimum score: correctness', + maxlabel => 'maximum score: correctness'}, { name => 'technical', - description => 'Resource is technically correct'}){ - $scrout .= ''.$/; + description => 'Resource is technically correct', + minlabel => 'minimum score: technical correctness', + maxlabel => 'maximum score: technical correctness'}) { + $scrout .= &Apache::lonhtmlcommon::row_title(&titlefield(&mt($evaluation->{'description'}))) + .'' + .' ' + .'' + .&Apache::lonhtmlcommon::row_closure(); } - $scrout .= "
 '. - &mt('Minimum').''. - &mt('Maximum').'
'. - &titlefield(&mt($evaluation->{'description'})). - ''. - ''. - ''. - '
\n"; } # # Creation/Modification date limits - $scrout .= '

'.&mt('Creation and Modification dates').'

'; - $scrout .= "\n\n"; - $scrout .= "\n"; + my $dateslabel = &mt('Text box description'); + $scrout .= &Apache::lonhtmlcommon::row_headline() + .'

'.&mt('Creation and Modification dates').'

' + .&Apache::lonhtmlcommon::row_closure(); + $scrout .= &Apache::lonhtmlcommon::row_title(''.$dateslabel.'', + '','','',1) + .&mt('Month[_1]Day[_2]Year',' 'x14,' 'x6) + .&Apache::lonhtmlcommon::row_closure(); + my $cafter = &Apache::lonhtmlcommon::date_setter('advsearch', # formname 'creationdate1', # fieldname @@ -1063,10 +882,13 @@ ENDHEADER '', # state 1, # no_hh_mm_ss ); - $scrout .= '' - .'' - .'' - .''; + $scrout .= &Apache::lonhtmlcommon::row_title(&mt('Created between')) + .$cafter + .&Apache::lonhtmlcommon::row_closure(1) + .&Apache::lonhtmlcommon::row_title(&mt('and')) + .$cbefore + .&Apache::lonhtmlcommon::row_closure(); + my $lafter = &Apache::lonhtmlcommon::date_setter('advsearch', 'revisiondate1', @@ -1085,16 +907,19 @@ ENDHEADER '', # state 1, # no_hh_mm_ss ); - $scrout .= '' - .'' - .'' - .''; - $scrout.="
 ".&mt('(Month - Day - Year)')."
'.&mt('Created between').''.$cafter.'
'.&mt('and').''.$cbefore.'
'.&mt('Last modified between').''.$lafter.'
'.&mt('and').''.$lbefore.'
\n"; - $scrout.=< -ENDDOCUMENT - $scrout .= &Apache::loncommon::end_page(); + $scrout .= &Apache::lonhtmlcommon::row_title(&mt('Last modified between')) + .$lafter + .&Apache::lonhtmlcommon::row_closure(1) + .&Apache::lonhtmlcommon::row_title(&mt('and')) + .$lbefore + .&Apache::lonhtmlcommon::row_closure(1); # Last row of total pick_box + + $scrout .= &Apache::lonhtmlcommon::end_pick_box(); + + $scrout .= $advanced_buttons + .''; + + $scrout .= '