[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonsimplepage.pm lonsyllabus.pm lontemplate.pm
bisitz
bisitz@source.lon-capa.org
Mon, 11 May 2009 13:34:10 -0000
This is a MIME encoded message
--bisitz1242048850
Content-Type: text/plain
bisitz Mon May 11 13:34:10 2009 EDT
Modified files:
/loncom/interface lontemplate.pm lonsimplepage.pm lonaboutme.pm
lonsyllabus.pm
Log:
Consistent script code style
--bisitz1242048850
Content-Type: text/plain
Content-Disposition: attachment; filename="bisitz-20090511133410.txt"
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.32 loncom/interface/lontemplate.pm:1.33
--- loncom/interface/lontemplate.pm:1.32 Thu May 7 11:12:47 2009
+++ loncom/interface/lontemplate.pm Mon May 11 13:34:10 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# "Template" Functions to generate html output
#
-# $Id: lontemplate.pm,v 1.32 2009/05/07 11:12:47 bisitz Exp $
+# $Id: lontemplate.pm,v 1.33 2009/05/11 13:34:10 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,17 +44,17 @@
use HTML::Entities();
-sub start_columnSection{
+sub start_columnSection {
my ($r) = @_;
$r->print('<div class="LC_columnSection">');
}
-sub end_columnSection{
+sub end_columnSection {
my ($r) = @_;
$r->print('</div>');
}
-sub print_aboutme_content_template{
+sub print_aboutme_content_template {
my ($r,$allowed,$target,$syllabusfields_ref,$syllabus_ref) = @_;
my %syllabusfields = %{$syllabusfields_ref};
my %syllabus = %{$syllabus_ref};
@@ -70,15 +70,14 @@
}
$message=&Apache::lontexconvert::msgtexconverted($message);
if ($target ne 'tex') {
- if($allowed){
+ if ($allowed) {
$r->print('<p>');
}
if($field eq 'aaa_contactinfo') {
$r->print('<div class="LC_Clear_AboutMe_Image" > </div>');
&print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecial');
- }
- else{
+ } else {
&print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecial');
}
@@ -88,7 +87,7 @@
}
if ($allowed) {
&print_editbox_template($r,$syllabus{$field},$field);
- if($target ne 'tex'){
+ if ($target ne 'tex') {
$r->print('</p>');
}
}
@@ -97,18 +96,18 @@
}
-sub start_ContentBox{
+sub start_ContentBox {
my ($r,$allowed) = @_;
$r->print('<div class="LC_ContentBox">');
}
-sub end_ContentBox{
+sub end_ContentBox {
my ($r) = @_;
$r->print('</div>');
}
-sub send_message{
+sub send_message {
my ($r,$cnum,$cdom) = @_;
my $s;
my $image = qq{<img name="Send message" src="/res/adm/pages/mail-message-new.png" border="none" align="middle" />};
@@ -124,6 +123,7 @@
$r->print('<div class="LC_BoxPadding">' .$content . '</div>');
$r->print('</div>');
}
+
sub print_start_template
{
my ($r,$topic,$boxclass) = @_;
@@ -131,12 +131,14 @@
$r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
$r->print('<div class="LC_BoxPadding">' );
}
+
sub print_end_template
{
my ($r) = @_;
$r->print('</div>');
$r->print('</div>');
}
+
sub print_editbox_template
{
my ($r,$content,$field) = @_;
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.79 loncom/interface/lonsimplepage.pm:1.80
--- loncom/interface/lonsimplepage.pm:1.79 Thu May 7 16:20:37 2009
+++ loncom/interface/lonsimplepage.pm Mon May 11 13:34:10 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Simple Page Editor
#
-# $Id: lonsimplepage.pm,v 1.79 2009/05/07 16:20:37 amueller Exp $
+# $Id: lonsimplepage.pm,v 1.80 2009/05/11 13:34:10 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -255,19 +255,19 @@
#---Print help Text
if($target ne 'tex'){
- if($allowed){
+ if ($allowed) {
$r->print(&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')));
}
}
#---Print Function
if ($target ne 'tex') {
- if($allowed || $privileged){
+ if ($allowed || $privileged) {
$r->print(&Apache::lontemplate::start_functionslist());
- if($allowed){
+ if ($allowed) {
$r->print(&Apache::lontemplate::item_functionslist(
'<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Student View').'</a>'
.&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView')));
- }elsif($privileged){
+ } elsif ($privileged) {
my $edittext = &mt('Edit');
if ($group ne '') {
$edittext = &mt('Edit Group Homepage');
@@ -312,11 +312,11 @@
'<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'.
'</form><form method="post">'.
'<input type="hidden" name="forceedit" value="edit" />');
- if($syllabus{'uploaded.photourl'}) {
+ if ($syllabus{'uploaded.photourl'}) {
$r->print('<form method="post"><input type="submit" name="delupl" value="'.&mt('Delete Photo').'" />' );
}
}
- if($allowed){
+ if ($allowed) {
$r->print($image.'<div class="clear"> </div>');
}
@@ -341,7 +341,7 @@
$r->print('<br />');
} elsif ($field eq 'aaa_title') {
if ($target ne 'tex') {
- if($allowed){
+ if ($allowed) {
$r->print('<p>');
}
$r->print('<h2>'.$message.'</h2>');
@@ -362,7 +362,7 @@
if(!$allowed) {$r->print($image); }
} else {
if ($target ne 'tex') {
- if($allowed){
+ if ($allowed) {
$r->print('<p>');
}
&Apache::lontemplate::print_template($r,$syllabusfields{$field},$message,$allowed,'LC_ContentBoxSpecial');
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.127 loncom/interface/lonaboutme.pm:1.128
--- loncom/interface/lonaboutme.pm:1.127 Tue Apr 21 17:58:17 2009
+++ loncom/interface/lonaboutme.pm Mon May 11 13:34:10 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Personal Information Page
#
-# $Id: lonaboutme.pm,v 1.127 2009/04/21 17:58:17 neumanie Exp $
+# $Id: lonaboutme.pm,v 1.128 2009/05/11 13:34:10 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -95,7 +95,7 @@
return OK if $r->header_only;
my $target=$env{'form.grade_target'};
# ------------------------------------------------------------ Print the screen
- if ($target eq 'tex') {
+ if ($target eq 'tex') {
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
}
my (undef,undef,$cdom,$cnum,undef,$action)=split(/\//,$r->uri);
@@ -217,7 +217,7 @@
$args->{'bread_crumbs'} = [{href=>"/adm/fhwfdev/$cnum/aboutme",text=>"Personal Information Page"}];
my $start_page = &Apache::loncommon::start_page("Personal Data",$rss_link,$args);
$r->print($start_page);
-
+
#Print Privacy Note
if ($allowed) {
$r->print('<div class="LC_info">'
@@ -226,7 +226,7 @@
.'</div>'
);
}
-
+
#Print last modified
my $lastmod;
@@ -246,9 +246,9 @@
}
#----------------Print Functions
- if ($target ne 'tex'){
+ if ($target ne 'tex') {
$r->print(&Apache::lontemplate::start_functionslist());
- if($allowed){
+ if ($allowed) {
my $query_string = &build_query_string({'forcestudent' => '1','popup' => $env{'form.popup'}});
$r->print(&Apache::lontemplate::item_functionslist(
'<a href="'.$r->uri.$query_string.'">'.&mt('Show Public View').'</a>'
@@ -377,10 +377,9 @@
&Apache::lontemplate::print_aboutme_content_template($r,$allowed,$target,\%syllabusfields,\%syllabus);
#End Print Content
- if($target ne 'tex')#Begin Print RSS and portfiles
- {
+ if($target ne 'tex') { #Begin Print RSS and portfiles
&print_portfiles_link($r,$is_course);
- if(&Apache::lonrss::advertisefeeds($cnum,$cdom) ne ''){
+ if (&Apache::lonrss::advertisefeeds($cnum,$cdom) ne '') {
&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_ContentBoxSpecial');
$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom));
&Apache::lontemplate::print_end_template($r);
@@ -397,9 +396,9 @@
$r->print('</form>');
}
if ($target ne 'tex') {$r->print('<br />');} else {$r->print('\\\\');}
- } else {
+ } else {
$r->print('<p>'.&mt('No personal information provided').'.</p>');
- }
+ }
if ($env{'request.course.id'}
&& &Apache::lonnet::allowed('srm',$env{'request.course.id'})
@@ -418,7 +417,7 @@
$r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\');
&Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom);
}
- }
+ }
if ($target ne 'tex') {
$r->print('</div>');
$r->print('</div>');
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.88 loncom/interface/lonsyllabus.pm:1.89
--- loncom/interface/lonsyllabus.pm:1.88 Tue Apr 28 14:43:06 2009
+++ loncom/interface/lonsyllabus.pm Mon May 11 13:34:10 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.88 2009/04/28 14:43:06 amueller Exp $
+# $Id: lonsyllabus.pm,v 1.89 2009/05/11 13:34:10 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -248,7 +248,7 @@
#-Print Help Text
if ($target ne 'tex') {
- if($allowed){
+ if ($allowed) {
$r->print(&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')));
}
}
@@ -263,9 +263,9 @@
$r->print('<div class="LC_info">'.&mt('Last updated').': '.
$lastmod . ' '.
($who ? &mt('by').' '.$who
- : '' ) .
+ : '' ) .
'</div>' );
-
+
} else {
$r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.
($who? &mt('by').'\\\\ '.
@@ -275,13 +275,13 @@
}
#--------Functions
if ($target ne 'tex') {
- if($allowed || $privileged){
+ if( $allowed || $privileged) {
$r->print(&Apache::lontemplate::start_functionslist());
- if($allowed){
+ if ($allowed) {
$r->print(&Apache::lontemplate::item_functionslist(
'<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Public View').'</a>'
.&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView')));
- }elsif($privileged){
+ } elsif ($privileged) {
$r->print(&Apache::lontemplate::item_functionslist(
'<a href="'.$r->uri.'?forceedit=1">'.&mt('Edit').'</a>'));
}
@@ -289,10 +289,10 @@
}
}
#----------------------------Print Headtitle
-if($target ne 'tex'){
+if ($target ne 'tex') {
$r->print('<h1>'.$courseenv{'description'}.'</h1>');
$r->print('<h3>'. &Apache::lonnet::domain($cdom,'description').'</h3>');
-}else{
+} else {
$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'.
&Apache::lonnet::domain($cdom,'description').'}\\\\');
}
@@ -343,14 +343,13 @@
my $day = &Apache::lonannounce::showday(time,2,
&Apache::lonannounce::readcalendar($cdom.'_'.$cnum));
if ($target ne 'tex') {
- if($allowed){
+ if ($allowed) {
&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_ContentBoxSpecial');
$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit));
my $editurl= &Apache::lonnet::absolute_url().'/adm/'.$cdom.'/'.$cnum.'/_rss.html';
$r->print( '<a href="'.$editurl.'">'.&mt('New RSS Feed or Blog').'</a>');
&Apache::lontemplate::print_end_template($r);
- }
- elsif(&Apache::lonrss::advertisefeeds($cnum,$cdom) ne ''){
+ } elsif (&Apache::lonrss::advertisefeeds($cnum,$cdom) ne '') {
&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_ContentBoxSpecial');
$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit));
&Apache::lontemplate::print_end_template($r);
@@ -383,7 +382,7 @@
} elsif ($embstyle eq 'img') {# embed as an image
$output='<img src="'.$filelink.'" />';
}
- if($output ne ''){
+ if ($output ne '') {
if ($target ne 'tex') {
$message.='<p>'.$output.'</p>';
} else {
@@ -405,7 +404,7 @@
}
$message=&Apache::lontexconvert::msgtexconverted($message);
if ($target ne 'tex') {
- if($allowed){
+ if ($allowed) {
$r->print('<p>');
}
&Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_ContentBoxSpecial');
@@ -416,7 +415,7 @@
push(@htmlids,$field);
}
if ($allowed) {
- if($target ne 'tex'){
+ if ($target ne 'tex') {
$r->print('</p>');
&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
}
--bisitz1242048850--