[LON-CAPA-cvs] cvs: loncom /interface lonwishlistdisplay.pm
raeburn
raeburn at source.lon-capa.org
Sun Feb 16 16:50:17 EST 2014
raeburn Sun Feb 16 21:50:17 2014 EDT
Modified files:
/loncom/interface lonwishlistdisplay.pm
Log:
- Coding style changes and white space removal only.
- defined()
- cuddled else.
Index: loncom/interface/lonwishlistdisplay.pm
diff -u loncom/interface/lonwishlistdisplay.pm:1.4 loncom/interface/lonwishlistdisplay.pm:1.5
--- loncom/interface/lonwishlistdisplay.pm:1.4 Fri Aug 3 01:26:33 2012
+++ loncom/interface/lonwishlistdisplay.pm Sun Feb 16 21:50:16 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to display the wishlist (handler)
#
-# $Id: lonwishlistdisplay.pm,v 1.4 2012/08/03 01:26:33 raeburn Exp $
+# $Id: lonwishlistdisplay.pm,v 1.5 2014/02/16 21:50:16 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -76,12 +76,12 @@
$root = &Apache::lonwishlist::newEntry($root, $env{'form.title'}, $env{'form.path'}, $env{'form.note'});
}
- # get unprocessed_cgi (i.e. marked entries, mode ...)
+ # get unprocessed_cgi (i.e. marked entries, mode ...)
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['action','mark','markedToMove','mode','newtitle','note','rat','setTitle','setPath']);
# change the order of entries within a level, that means sorting the entries
my $changeOrder = 0;
- if (defined $env{'form.sel'}) {
+ if (defined($env{'form.sel'})) {
my @sel = &Apache::loncommon::get_env_multiple('form.sel');
my $indexNode;
my $at;
@@ -93,37 +93,35 @@
}
if ($at ne '') {
$changeOrder = 1;
- $root = &Apache::lonwishlist::sortEntries($root, $indexNode,$at);
+ $root = &Apache::lonwishlist::sortEntries($root, $indexNode,$at);
}
}
# get all marked (checkboxes) entries
my @marked = ();
- if (defined $env{'form.mark'}) {
+ if (defined($env{'form.mark'})) {
@marked = &Apache::loncommon::get_env_multiple('form.mark');
}
# move entries from one folder to another
- if (defined $env{'form.markedToMove'}) {
+ if (defined($env{'form.markedToMove'})) {
my $markedToMove = $env{'form.markedToMove'};
my @ToMove = split(/\,/,$markedToMove);
my $moveTo = $env{'form.mark'};
- if (defined $moveTo){
- $root = &Apache::lonwishlist::moveEntries($root, \@ToMove,$moveTo);
+ if (defined($moveTo)) {
+ $root = &Apache::lonwishlist::moveEntries($root, \@ToMove,$moveTo);
}
$changeOrder = 1;
-
}
# delete entries
if ($env{'form.action'} eq 'delete') {
$root = &Apache::lonwishlist::deleteEntries($root, \@marked);
}
-
# get all titles and notes and save them
# only save, if user wants to save changes
- # do not save, when current action is 'delete' or 'sort' or 'move'
+ # do not save, when current action is 'delete' or 'sort' or 'move'
my @newTitles = ();
my @newPaths = ();
my @newNotes = ();
@@ -156,30 +154,23 @@
my $page;
if ($env{'form.mode'} eq 'edit') {
$page = &Apache::lonwishlist::makePage($root, "edit");
- }
- elsif ($env{'form.mode'} eq 'move') {
+ } elsif ($env{'form.mode'} eq 'move') {
$page = &Apache::lonwishlist::makePage($root, "move", \@marked);
- }
- elsif ($env{'form.mode'} eq 'import') {
+ } elsif ($env{'form.mode'} eq 'import') {
$page = &Apache::lonwishlist::makePageImport($root, $env{'form.rat'});
- }
- elsif ($env{'form.mode'} eq 'newLink') {
+ } elsif ($env{'form.mode'} eq 'newLink') {
$page = &Apache::lonwishlist::makePopUpNewLink($env{'form.setTitle'},$env{'form.setPath'});
- }
- elsif ($env{'form.mode'} eq 'newFolder') {
+ } elsif ($env{'form.mode'} eq 'newFolder') {
$page = &Apache::lonwishlist::makePopUpNewFolder();
- }
- elsif ($env{'form.mode'} eq 'set') {
+ } elsif ($env{'form.mode'} eq 'set') {
$page = &Apache::lonwishlist::makePageSet();
- }
- else {
+ } else {
$page = &Apache::lonwishlist::makePage($root, "view");
}
@marked = ();
$r->print($page);
- }
- # An error occured, print an error-page
- else {
+ } else {
+ # An error occured, print an error-page
my $errorPage = &Apache::lonwishlist::makeErrorPage();
$r->print($errorPage);
}
More information about the LON-CAPA-cvs
mailing list