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=~s/\\<\;/g;
- $field=~s/\>/\>\;/g;
- $syllabus{$_}=$field;
- }
- $syllabus{'uploaded.lastmodified'}=time;
- &Apache::lonnet::put('smppage_'.$marker,\%syllabus,$dom,$crs);
- }
+ my $allowed;
+
+ if ($group ne '') {
+ $allowed = $group_edit_perm;
+ if (!$allowed) {
+ $allowed = $group_home_edit;
+ }
+ } else {
+ $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
+ }
+ my $privileged=$allowed;
+ if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) {
+ $forcestudent='student';
+ }
+
+ if ($forcestudent or $target eq 'tex') { $allowed=0; }
+
+ if ($allowed) {
+ $r->print('
'.
+ &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').' '.&mt('Show Student View').''.
+ &Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'
');
+ } elsif ($privileged and $target ne 'tex') {
+ my $edittext = &mt('Edit');
+ if ($group ne '') {
+ $edittext = &mt('Edit Group Homepage');
+ }
+ $r->print(''.$edittext.'');
+ if ($group ne '') {
+ if ($group_edit_perm) {
+ $r->print(' '.
+ ''.
+ &mt('Edit Group Settings').'');
+ }
+ }
+ }
+ if (($env{'form.uploaddoc.filename'} and $target ne 'tex') &&
+ ($env{'form.storeupl'}) && ($allowed)) {
+ if ($env{'form.uploaddoc.filename'}=~/\.(gif|jpg|png|jpeg)$/i) {
+ if ($syllabus{'uploaded.photourl'}) {
+ &Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
+ }
+ if ($group ne '') {
+ $syllabus{'uploaded.photourl'}=&Apache::lonnet::userfileupload(
+ 'uploaddoc',1,"grouppage/$group");
+ } else {
+ $syllabus{'uploaded.photourl'}=
+ &Apache::lonnet::userfileupload('uploaddoc',1,'simplepage');
+ }
+ }
+ $syllabus{'uploaded.lastmodified'}=time;
+ &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs);
+ }
+ if (($allowed) && ($env{'form.storesyl'})) {
+ foreach (keys %syllabusfields) {
+ my $field=$env{'form.'.$_};
+ chomp($field);
+ $field=~s/\s+$//s;
+ $field=~s/^\s+//s;
+ $field=~s/\ $//s;
+ $field=&Apache::lonfeedback::clear_out_html($field,1);
+ $syllabus{$_}=$field;
+ }
+ $syllabus{'uploaded.lastmodified'}=time;
+ &Apache::lonnet::put($namespace,\%syllabus,$dom,$crs);
+ }
# ---------------------------------------------------------------- Get syllabus
- if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {
- if ($syllabus{'uploaded.photourl'}) {
- $r->print('');
- }
- if ($allowed) {
- $r->print(
- '
');
+ $message=&Apache::lontexconvert::msgtexconverted($message);
+ if ($_ eq 'abb_links' && $group ne '') {
+ $r->print(' ');
+ &display_group_links($r,$target,$group,'edit',$refarg,
+ %groupinfo);
+ $r->print(' ');
+ } elsif ($_ eq 'aaa_title') {
+ if ($target ne 'tex') {
+ $r->print('
'.$message.'
');
+ } else {
+ my $safeinit;
+ $r->print(&Apache::lonxml::xmlparse($r,'tex','
'.$message.'
'));
+ }
+ if ($allowed) {
+ if ($env{'form.grade_target'} ne 'tex') {
+ $r->print(
+ ' Title ');
+ } else {
+ my $safeinit;
+ $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$_},$safeinit));
+ }
+ }
+ } else {
+ if (($_ ne 'bbb_content') || ($allowed)) {
+ if ($target ne 'tex') {
+ $r->print('
'.$syllabusfields{$_}.'
');
+ } else {
+ my $safeinit;
+ $r->print(&Apache::lonxml::xmlparse($r,'tex','
'.$syllabusfields{$_}.'
'));
+ }
+ }
+ if ($target ne 'tex') {
+ $r->print('
'.
+ $message.'
');
+ } else {
+ my $safeinit;
+ $r->print(&Apache::lonxml::xmlparse($r,'tex',$message));
+ }
+ if ($allowed) {
+ if ($target ne 'tex') {
+ $r->print(' ');
+ } else {
+ my $safeinit;
+ $r->print(&Apache::lonxml::xmlparse($r,'tex',$syllabus{$_},$safeinit));
+ }
+ }
+ }
+ }
+ }
+ if ($allowed && ($env{'form.grade_target'} ne 'tex')) {
+ $r->print(&Apache::lonhtmlcommon::htmlareaselectactive
+ ('bbb_content').'');
+ }
+ if ($env{'form.grade_target'} ne 'tex') {$r->print('');}
} else {
- $r->print('
No page information provided.
');
+ if ($group ne '') {
+ &display_group_links($r,$target,$group,'view',$refarg,%groupinfo);
+ } else {
+ $r->print(&mt('