version 1.50, 2009/11/26 05:21:43
|
version 1.55, 2009/12/08 13:33:12
|
Line 177 sub handler {
|
Line 177 sub handler {
|
if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) { |
if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) { |
$forcestudent='student'; |
$forcestudent='student'; |
} |
} |
if ($target ne 'tex') { $r->print('<table><tr><td>'); } |
|
if ($forcestudent or $target eq 'tex') { $allowed=0; } |
if ($forcestudent or $target eq 'tex') { $allowed=0; } |
|
|
if ($allowed) { |
if ($allowed) { |
Line 185 sub handler {
|
Line 184 sub handler {
|
if (($group ne '') && ($env{'form.group'} eq $group)) { |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
$query_str.='&group='.$group.'&'.$refarg; |
$query_str.='&group='.$group.'&'.$refarg; |
} |
} |
$r->print( |
#Function Box for Edit Mode. |
'<p>'. |
my $functionbox = &Apache::lonhtmlcommon::start_funclist(); |
&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'<br /><a href="'.$r->uri.'?'.$query_str.'"><font size="+1">'.&mt('Show Student View').'</font></a>'. |
$functionbox .= &Apache::lonhtmlcommon::add_item_funclist( |
&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'</p>'); |
'<a href="'.$r->uri.'?'.$query_str.'">'.&mt('Show Student View').'</a>'. |
} elsif ($privileged and $target ne 'tex') { |
&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView')); |
|
$functionbox.=&Apache::lonhtmlcommon::end_funclist(); |
|
$r->print(&Apache::loncommon::head_subbox($functionbox).&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes'))); |
|
} elsif ($privileged and $target ne 'tex') { |
my $query_str = 'forceedit=edit'; |
my $query_str = 'forceedit=edit'; |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
if (($group ne '') && ($env{'form.group'} eq $group)) { |
$query_str.='&group='.$group.'&'.$refarg; |
$query_str.='&group='.$group.'&'.$refarg; |
} |
} |
$r->print('<a href="'.$r->uri.'?'.$query_str.'"><font size="+1">' |
#Functionbox for Student view. |
.&mt('Edit').'</font></a>'); |
my $functionbox = &Apache::lonhtmlcommon::start_funclist(); |
|
$functionbox .= &Apache::lonhtmlcommon::add_item_funclist( |
|
"<a href='".$r->uri.'?'.$query_str."'>".&mt('Edit')."</a>"); |
|
$functionbox.=&Apache::lonhtmlcommon::end_funclist(); |
|
$r->print(&Apache::loncommon::head_subbox($functionbox)); |
} |
} |
|
|
if (($env{'form.uploaddoc.filename'}) && |
if (($env{'form.uploaddoc.filename'}) && |
Line 228 sub handler {
|
Line 234 sub handler {
|
&Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); |
&Apache::lonnet::put('bulletinpage_'.$marker,\%syllabus,$dom,$crs); |
} |
} |
|
|
# ---------------------------------------------------------------- Get syllabus |
# ---------------------------------------------------------------- Get discussion board |
if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) { |
if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) { |
if ($syllabus{'uploaded.photourl'}) { |
if ($syllabus{'uploaded.photourl'}) { |
&Apache::lonnet::allowuploaded('/adm/syllabus', |
&Apache::lonnet::allowuploaded('/adm/syllabus', |
$syllabus{'uploaded.photourl'}); |
$syllabus{'uploaded.photourl'}); |
$r->print('<img src="'.$syllabus{'uploaded.photourl'}. |
|
'" align="right" />'); |
|
} |
} |
|
#Outputbox and Inputbox for Image upload |
if ($allowed) { |
if ($allowed) { |
|
&Apache::lontemplate::print_template($r, &mt('Upload a Photo'), '<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>',$allowed,'LC_Box'); |
$r->print( |
$r->print( |
'<form method="post" enctype="multipart/form-data">'. |
'<form method="post" enctype="multipart/form-data" action="">'. |
'<input type="hidden" name="forceedit" value="edit" />'. |
'<input type="hidden" name="forceedit" value="edit" />'. |
'<h3>'.&mt('Upload a Photo').'</h3>'. |
|
'<input type="file" name="uploaddoc" size="50" />'. |
'<input type="file" name="uploaddoc" size="50" />'. |
'<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'. |
'<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'. |
'</form><form method="post">'. |
'</form><form method="post" action="">'. |
'<input type="hidden" name="forceedit" value="edit" />'); |
'<input type="hidden" name="forceedit" value="edit" />'); |
} |
} |
|
#Image in Student view. |
|
elsif($syllabus{'uploaded.photourl'} && $target ne 'tex'){ |
|
$r->print('<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>'); |
|
} |
foreach my $field (sort(keys(%syllabusfields))) { |
foreach my $field (sort(keys(%syllabusfields))) { |
if (($syllabus{$field}) || ($allowed)) { |
if (($syllabus{$field}) || ($allowed)) { |
my $message=$syllabus{$field}; |
my $message=$syllabus{$field}; |
if (&Apache::lonfeedback::newline_to_br($message)) { |
if (!&Apache::lonfeedback::contains_block_html($message)) { |
&Apache::lonfeedback::newline_to_br(\$message); |
&Apache::lonfeedback::newline_to_br(\$message); |
} |
} |
$message |
$message=&Apache::lonhtmlcommon::raw_href_to_link($message); |
=~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g; |
|
if ($allowed) { |
if ($allowed) { |
$message=&Apache::lonspeller::markeduptext($message); |
$message=&Apache::lonspeller::markeduptext($message); |
} |
} |
$message=&Apache::lontexconvert::msgtexconverted($message); |
$message=&Apache::lontexconvert::msgtexconverted($message); |
unless ($field eq 'aaa_title') { |
unless ($field eq 'aaa_title') { |
if (($field ne 'bbb_content') || ($allowed)) { |
#Outputbox |
if ($target ne 'tex') { |
|
$r->print('<h3>'.$syllabusfields{$field}.'</h3>'); |
|
} else { |
|
$r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'); |
|
} |
|
} |
|
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('<blockquote>'. |
&Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box'); |
$message.'</blockquote>'); |
|
} else { |
} else { |
$r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$message).' '); |
$r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.&Apache::lonxml::xmlparse($r,'tex',$message)); |
} |
} |
|
#Inputbox |
if ($allowed) { |
if ($allowed) { |
$r->print('<br /><textarea cols="80" rows="10" name="'.$field.'">'. |
&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field); |
&HTML::Entities::encode($syllabus{$field},'&"<>'). |
|
'</textarea><input type="submit" name="storesyl" value="'.&mt('Save').'" />'); |
|
} |
} |
} else { |
} else { |
|
#Print Topic as Heading |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('<h1>'.$message.'</h1>'); |
$r->print('<h1>'.$message.'</h1>'); |
} else { |
} else { |
$r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$message).'}\\\\'); |
$r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$message).'}\\\\'); |
} |
} |
|
#Outputbox and Inputbox for Topic |
if ($allowed) { |
if ($allowed) { |
$r->print( |
&Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_Box'); |
'<br />'.&mt('Topic').'<br /><textarea cols="80" rows="2" name="'.$field.'">'. |
&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field); |
&HTML::Entities::encode($syllabus{$field},'&"<>'). |
|
'</textarea><input type="submit" name="storesyl" value="'.&mt('Save').'" />'); |
|
} |
} |
} |
} |
} |
} |
Line 295 sub handler {
|
Line 295 sub handler {
|
if ($allowed) { |
if ($allowed) { |
$r->print('</form>'); |
$r->print('</form>'); |
} |
} |
if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');} |
if ($target ne 'tex'){ |
|
$r->print('<br/><br/><hr/><br/>'); |
|
} |
|
else { |
|
$r->print(&Apache::lonxml::xmlparse($r,'tex','<br/><br/><hr/><br/>')); |
|
} |
} else { |
} else { |
$r->print('<p>'.&mt('No page information provided.').'</p>'); |
$r->print('<p>'.&mt('No page information provided.').'</p>'); |
} |
} |
if ($target ne 'tex') { $r->print('</td></tr></table>'); } |
#Lists discussion posts and box for a new discussion post. |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print(&Apache::lonfeedback::list_discussion |
$r->print(&Apache::lonfeedback::list_discussion |
('board','OPEN','bulletin___'.$marker.'___'. |
('board','OPEN','bulletin___'.$marker.'___'. |