[LON-CAPA-cvs] cvs: loncom /interface lonsimplepage.pm
wenzelju
wenzelju@source.lon-capa.org
Thu, 07 Jan 2010 14:45:08 -0000
wenzelju Thu Jan 7 14:45:08 2010 EDT
Modified files:
/loncom/interface lonsimplepage.pm
Log:
- Moved Photo into template box for consistent use of template boxes.
- Removed unnecessary div with LC_clear_footer.
- Code style.
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.91 loncom/interface/lonsimplepage.pm:1.92
--- loncom/interface/lonsimplepage.pm:1.91 Tue Dec 22 06:32:35 2009
+++ loncom/interface/lonsimplepage.pm Thu Jan 7 14:45:08 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Simple Page Editor
#
-# $Id: lonsimplepage.pm,v 1.91 2009/12/22 06:32:35 faziophi Exp $
+# $Id: lonsimplepage.pm,v 1.92 2010/01/07 14:45:08 wenzelju Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -328,7 +328,7 @@
}
#print the image
- my $image;
+ my $image='';
if ($syllabus{'uploaded.photourl'}) {
&Apache::lonnet::allowuploaded('/adm/smppg',
$syllabus{'uploaded.photourl'});
@@ -341,26 +341,26 @@
}
if ($allowed) {
- $r->print('<input type="hidden" name="forceedit" value="edit" />');
- my $upload_photo_label = &mt('Upload a Photo');
- my $upload_button_label = &mt('Upload');
-
- my $content_for_upload_photo=<<"UPLOAD_PHOTO";
- <input type="file" name="uploaddoc" size="50" />
- <input type="submit" name="storeupl" value="$upload_button_label" />
- <input type="hidden" name="forceedit" value="edit" />
-UPLOAD_PHOTO
- &Apache::lontemplate::print_template($r, $upload_photo_label,$content_for_upload_photo,$allowed, 'LC_Box');
+ &Apache::lontemplate::print_start_template($r, &mt('Upload a Photo'),'LC_Box');
+ $r->print($image);
+ $r->print("<br /><br />");
+ $r->print(
+ '<input type="hidden" name="forceedit" value="edit" />'.
+ '<input type="file" name="uploaddoc" size="50" />'.
+ '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
+ '<input type="hidden" name="forceedit" value="edit" />');
+ &Apache::lontemplate::print_end_template($r);
+
# if ($syllabus{'uploaded.photourl'}) {
# $r->print('<input type="submit" name="delupl"'
# .' value="'.&mt('Delete Photo').'" />');
# }
}
- if ($allowed) {
- $r->print($image.'<div class="LC_footer_clear"> </div>');
+ #Image in Student view and printout.
+ else {
+ $r->print($image);
}
- if (!$allowed) {$r->print($image); }
foreach my $field (sort(keys(%syllabusfields))) {
if (($syllabus{$field}) || ($allowed) ||