'.
-&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').' Show Public View'.
- &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'
');
- }
- if (($ENV{'form.uploaddoc.filename'}) &&
- ($ENV{'form.storeupl'}) && ($allowed)) {
- if ($ENV{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/) {
- $syllabus{'uploaded.photourl'}=
- &Apache::lonnet::userfileupload('uploaddoc',1);
- }
- $syllabus{'uploaded.lastmodified'}=time;
- &Apache::lonnet::put('smppage_'.$marker,\%syllabus,$dom,$crs);
- }
- if (($allowed) && ($ENV{'form.storesyl'})) {
- foreach (keys %syllabusfields) {
- my $field=$ENV{'form.'.$_};
- $field=~s/\s+$//s;
- $field=&Apache::lonfeedback::clear_out_html($field,1);
- $syllabus{$_}=$field;
- }
- $syllabus{'uploaded.lastmodified'}=time;
- &Apache::lonnet::put('smppage_'.$marker,\%syllabus,$dom,$crs);
- }
+ my $allowed;
-# ---------------------------------------------------------------- Get syllabus
- if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
- if ($syllabus{'uploaded.photourl'}) {
- $r->print('');
- }
- if ($allowed) {
- $r->print(
- '
');
+ }
+
+ #print the image
+ my $image='';
+ if ($syllabus{'uploaded.photourl'}) {
+ &Apache::lonnet::allowuploaded('/adm/smppg',
+ $syllabus{'uploaded.photourl'});
+
+ $image='';
+ if ($target eq 'tex') {
+ $image=&Apache::lonxml::xmlparse($r,'tex',$image);
+ }
+ }
+
+ if ($allowed) {
+ &Apache::lontemplate::print_start_template($r, &mt('Upload a Photo'),'LC_Box');
+ $r->print($image);
+ $r->print("
");
+ $r->print(
+ ''.
+ ''.
+ ''.
+ '');
+ &Apache::lontemplate::print_end_template($r);
+
+
+# if ($syllabus{'uploaded.photourl'}) {
+# $r->print('');
+# }
+ }
+ #Image in Student view and printout.
+ else {
+ $r->print($image);
+ }
+
+ my $links_handler = sub {
+ my ($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed) = @_;
+ if ($group ne '') {
+ my %data = %{$data_ref};
+ my %fields = %{$fields_ref};
+ $r->print(' ');
+ &display_group_links($r, $target, $group, 'edit', $refarg, %groupinfo);
+ $r->print(' ');
+ }
+ };
+ my $title_handler = sub {};
+ my %custom_handlers = (
+ 'abb_links' => $links_handler,
+ 'aaa_title' => $title_handler
+ );
+ &Apache::lontemplate::print_template_fields($r, \%syllabus, \%syllabusfields,
+ $target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_handlers, $group);
+
+ if ($allowed && ($env{'form.grade_target'} ne 'tex')) {
+ $r->print(&Apache::lonhtmlcommon::htmlareaselectactive
+ ('bbb_content').'');
+ }
+
+ } else {
+ if ($group ne '') {
+ &display_group_links($r,$target,$group,'view',$refarg,%groupinfo);
+ } else {
+ my $text=&mt('No page information provided.');
+ if ($target ne 'tex') {
+ $r->print('