--- loncom/interface/loncommon.pm 2014/02/19 19:49:30 1.1075.2.66
+++ loncom/interface/loncommon.pm 2014/04/24 13:26:23 1.1186
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1075.2.66 2014/02/19 19:49:30 raeburn Exp $
+# $Id: loncommon.pm,v 1.1186 2014/04/24 13:26:23 kruse Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -69,9 +69,11 @@ use Apache::lontexconvert();
use Apache::lonclonecourse();
use Apache::lonuserutils();
use Apache::lonuserstate();
+use Apache::courseclassifier();
use LONCAPA qw(:DEFAULT :match);
use DateTime::TimeZone;
use DateTime::Locale::Catalog;
+use Text::Aspell;
use Authen::Captcha;
use Captcha::reCAPTCHA;
use Crypt::DES;
@@ -160,6 +162,7 @@ sub ssi_with_retries {
# ----------------------------------------------- Filetypes/Languages/Copyright
my %language;
my %supported_language;
+my %supported_codes;
my %latex_language; # For choosing hyphenation in
my %latex_language_bykey; # for choosing hyphenation from metadata
my %cprtag;
@@ -194,14 +197,15 @@ BEGIN {
while (my $line = <$fh>) {
next if ($line=~/^\#/);
chomp($line);
- my ($key,$two,$country,$three,$enc,$val,$sup,$latex)=(split(/\t/,$line));
+ my ($key,$code,$country,$three,$enc,$val,$sup,$latex)=(split(/\t/,$line));
$language{$key}=$val.' - '.$enc;
if ($sup) {
$supported_language{$key}=$sup;
+ $supported_codes{$key} = $code;
}
if ($latex) {
$latex_language_bykey{$key} = $latex;
- $latex_language{$two} = $latex;
+ $latex_language{$code} = $latex;
}
}
close($fh);
@@ -665,7 +669,7 @@ if (!Array.prototype.indexOf) {
var n = 0;
if (arguments.length > 0) {
n = Number(arguments[1]);
- if (n !== n) { // shortcut for verifying if it's NaN
+ if (n !== n) { // shortcut for verifying if it is NaN
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
@@ -901,12 +905,12 @@ sub check_uncheck_jscript {
function checkAll(field) {
if (field.length > 0) {
for (i = 0; i < field.length; i++) {
- if (!field[i].disabled) {
+ if (!field[i].disabled) {
field[i].checked = true;
}
}
} else {
- if (!field.disabled) {
+ if (!field.disabled) {
field.checked = true;
}
}
@@ -1016,6 +1020,33 @@ sub select_language {
=pod
+
+=item * &list_languages()
+
+Returns an array reference that is suitable for use in language prompters.
+Each array element is itself a two element array. The first element
+is the language code. The second element a descsriptiuon of the
+language itself. This is suitable for use in e.g.
+&Apache::edit::select_arg (once dereferenced that is).
+
+=cut
+
+sub list_languages {
+ my @lang_choices;
+
+ foreach my $id (&languageids()) {
+ my $code = &supportedlanguagecode($id);
+ if ($code) {
+ my $selector = $supported_codes{$id};
+ my $description = &plainlanguagedescription($id);
+ push (@lang_choices, [$selector, $description]);
+ }
+ }
+ return \@lang_choices;
+}
+
+=pod
+
=item * &linked_select_forms(...)
linked_select_forms returns a string containing a block
@@ -1236,11 +1267,7 @@ sub help_open_topic {
$topic=~s/\W/\_/g;
if (!$stayOnPage) {
- if ($env{'browser.mobile'}) {
- $link = "javascript:openMyModal('/adm/help/${filename}.hlp',$width,$height,'yes');";
- } else {
- $link = "javascript:void(open('/adm/help/${filename}.hlp', 'Help_for_$topic', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))";
- }
+ $link = "javascript:openMyModal('/adm/help/${filename}.hlp',$width,$height,'yes');";
} elsif ($stayOnPage eq 'popup') {
$link = "javascript:void(open('/adm/help/${filename}.hlp', 'Help_for_$topic', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))";
} else {
@@ -1289,8 +1316,10 @@ sub helpLatexCheatsheet {
.&help_open_topic('Other_Symbols',&mt('Other Symbols'),$stayOnPage,undef,600)
.'';
unless ($not_author) {
- $out .= ' '
- .&help_open_topic('Authoring_Output_Tags',&mt('Output Tags'),$stayOnPage,undef,600)
+ $out .= ''
+ .&help_open_topic('Authoring_Output_Tags',&mt('Output Tags'),$stayOnPage,undef,600)
+ .' '
+ .&help_open_topic('Authoring_Multilingual_Problems',&mt('How to create problems in different languages'),$stayOnPage,undef,600)
.' ';
}
$out .= ' '; # End cheatsheet
@@ -1354,10 +1383,8 @@ sub help_open_menu {
sub top_nav_help {
my ($text) = @_;
$text = &mt($text);
- my $stay_on_page;
- unless ($env{'environment.remote'} eq 'on') {
- $stay_on_page = 1;
- }
+ my $stay_on_page = 1;
+
my ($link,$banner_link);
unless ($env{'request.noversionuri'} =~ m{^/adm/helpmenu}) {
$link = ($stay_on_page) ? "javascript:helpMenu('display')"
@@ -1387,9 +1414,9 @@ sub help_menu_js {
&Apache::loncommon::start_page('Help Menu', undef,
{'frameset' => 1,
'js_ready' => 1,
- 'use_absolute' => $httphost,
+ 'use_absolute' => $httphost,
'add_entries' => {
- 'border' => '0',
+ 'border' => '0',
'rows' => "110,*",},});
my $end_page =
&Apache::loncommon::end_page({'frameset' => 1,
@@ -2191,7 +2218,7 @@ The optional $onchange argument specifie
The optional $incdoms is a reference to an array of domains which will be the only available options.
-The optional $excdoms is a reference to an array of domains which will be excluded from the available options.
+The optional $excdoms is a reference to an array of domains which will be excluded from the available options.
=cut
@@ -2209,7 +2236,7 @@ sub select_dom_form {
}
if ($includeempty) { @domains=('',@domains); }
if (ref($excdoms) eq 'ARRAY') {
- map { $exclude{$_} = 1; } @{$excdoms};
+ map { $exclude{$_} = 1; } @{$excdoms};
}
my $selectdomain = "\n";
foreach my $dom (@domains) {
@@ -2556,7 +2583,7 @@ sub authform_nochange {
kerb_def_dom => 'MSU.EDU',
@_,
);
- my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'});
+ my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'});
my $result;
if (!$authnum) {
$result = &mt('Under your current role you are not permitted to change login settings for this user');
@@ -3052,13 +3079,73 @@ sub get_related_words {
untie %thesaurus_db;
return @Words;
}
+###############################################################
+#
+# Spell checking
+#
=pod
=back
+=head1 Spell checking
+
+=over 4
+
+=item * &check_spelling($wordlist $language)
+
+Takes a string containing words and feeds it to an external
+spellcheck program via a pipeline. Returns a string containing
+them mis-spelled words.
+
+Parameters:
+
+=over 4
+
+=item - $wordlist
+
+String that will be fed into the spellcheck program.
+
+=item - $language
+
+Language string that specifies the language for which the spell
+check will be performed.
+
+=back
+
+=back
+
+Note: This sub assumes that aspell is installed.
+
+
=cut
+
+sub check_spelling {
+ my ($wordlist, $language) = @_;
+ my @misspellings;
+
+ # Generate the speller and set the langauge.
+ # if explicitly selected:
+
+ my $speller = Text::Aspell->new;
+ if ($language) {
+ $speller->set_option('lang', $language);
+ }
+
+ # Turn the word list into an array of words by splittingon whitespace
+
+ my @words = split(/\s+/, $wordlist);
+
+ foreach my $word (@words) {
+ if(! $speller->check($word)) {
+ push(@misspellings, $word);
+ }
+ }
+ return join(' ', @misspellings);
+
+}
+
# -------------------------------------------------------------- Plaintext name
=pod
@@ -3808,7 +3895,7 @@ sub get_previous_attempt {
if ($key =~/$regexp$/ && (defined &$gradesub)) {
$value = &$gradesub($value);
}
- $prevattempts.=''.$value.' ';
+ $prevattempts.=''. $value.' ';
} else {
$prevattempts.=' ';
}
@@ -3824,7 +3911,7 @@ sub get_previous_attempt {
if ($key =~/$regexp$/ && (defined &$gradesub)) {
$value = &$gradesub($value);
}
- $prevattempts.=''.$value.' ';
+ $prevattempts.=''.$value.' ';
}
}
$prevattempts.= &end_data_table_row().&end_data_table();
@@ -3845,11 +3932,13 @@ sub get_previous_attempt {
sub format_previous_attempt_value {
my ($key,$value) = @_;
if (($key =~ /timestamp/) || ($key=~/duedate/)) {
- $value = &Apache::lonlocal::locallocaltime($value);
+ $value = &Apache::lonlocal::locallocaltime($value);
} elsif (ref($value) eq 'ARRAY') {
- $value = '('.join(', ', @{ $value }).')';
+ $value = &HTML::Entities::encode('('.join(', ', @{ $value }).')','"<>&');
} elsif ($key =~ /answerstring$/) {
my %answers = &Apache::lonnet::str2hash($value);
+ my @answer = %answers;
+ %answers = map {&HTML::Entities::encode($_, '"<>&')} @answer;
my @anskeys = sort(keys(%answers));
if (@anskeys == 1) {
my $answer = $answers{$anskeys[0]};
@@ -3872,7 +3961,7 @@ sub format_previous_attempt_value {
}
}
} else {
- $value = &unescape($value);
+ $value = &HTML::Entities::encode(&unescape($value), '"<>&');
}
return $value;
}
@@ -5020,9 +5109,6 @@ Inputs:
=item * $bgcolor, used to override the bgcolor on a webpage to a specific value
-=item * $no_inline_link, if true and in remote mode, don't show the
- 'Switch To Inline Menu' link
-
=item * $args, optional argument valid values are
no_auto_mt_title -> prevents &mt()ing the title arg
inherit_jsmath -> when creating popup window in a page,
@@ -5044,7 +5130,7 @@ other decorations will be returned.
sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
- $no_nav_bar,$bgcolor,$no_inline_link,$args,$advtoolsref)=@_;
+ $no_nav_bar,$bgcolor,$args,$advtoolsref)=@_;
my $public;
if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
@@ -5068,7 +5154,10 @@ sub bodytag {
@design{keys(%$addentries)} = @$addentries{keys(%$addentries)};
# role and realm
- my ($role,$realm) = split(/\./,$env{'request.role'},2);
+ my ($role,$realm) = split(m{\./},$env{'request.role'},2);
+ if ($realm) {
+ $realm = '/'.$realm;
+ }
if ($role eq 'ca') {
my ($rdom,$rname) = ($realm =~ m{^/($match_domain)/($match_username)$});
$realm = &plainname($rname,$rdom);
@@ -5118,23 +5207,7 @@ sub bodytag {
$role = '('.$role.') ' if $role;
- if ($env{'request.state'} eq 'construct') { $forcereg=1; }
-
-
-
- my $funclist;
- if (($env{'environment.remote'} eq 'on') && ($env{'request.state'} ne 'construct')) {
- $bodytag .= Apache::lonhtmlcommon::scripttag(Apache::lonmenu::utilityfunctions($httphost), 'start')."\n".
- Apache::lonmenu::serverform();
- my $forbodytag;
- &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
- $forcereg,$args->{'group'},
- $args->{'bread_crumbs'},
- $advtoolsref,'',\$forbodytag);
- unless (ref($args->{'bread_crumbs'}) eq 'ARRAY') {
- $funclist = $forbodytag;
- }
- } else {
+ if ($env{'request.state'} eq 'construct') { $forcereg=1; }
# if ($env{'request.state'} eq 'construct') {
# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
@@ -5146,11 +5219,11 @@ sub bodytag {
my ($left,$right) = Apache::lonmenu::primary_menu();
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
- if ($dc_info) {
+ if ($dc_info) {
$dc_info = qq|$dc_info |;
- }
- $bodytag .= qq|$left $role
- $realm $dc_info
|;
+ }
+ $bodytag .= qq|$left $role
+ $realm $dc_info
|;
return $bodytag;
}
@@ -5165,7 +5238,7 @@ sub bodytag {
}
$bodytag .= qq|$realm $dc_info
|;
- #if directed to not display the secondary menu, don't.
+ #if directed to not display the secondary menu, don't.
if ($args->{'no_secondary_menu'}) {
return $bodytag;
}
@@ -5177,18 +5250,15 @@ sub bodytag {
if ($env{'request.state'} eq 'construct') {
$bodytag .= &Apache::lonmenu::innerregister($forcereg,
$args->{'bread_crumbs'});
- } elsif ($forcereg) {
+ } elsif ($forcereg) {
$bodytag .= &Apache::lonmenu::innerregister($forcereg,undef,
$args->{'group'});
} else {
- my $forbodytag;
- &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
- $forcereg,$args->{'group'},
- $args->{'bread_crumbs'},
- $advtoolsref,'',\$forbodytag);
- unless (ref($args->{'bread_crumbs'}) eq 'ARRAY') {
- $bodytag .= $forbodytag;
- }
+ $bodytag .=
+ &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
+ $forcereg,$args->{'group'},
+ $args->{'bread_crumbs'},
+ $advtoolsref);
}
}else{
# this is to seperate menu from content when there's no secondary
@@ -5198,54 +5268,6 @@ sub bodytag {
}
return $bodytag;
- }
-
-#
-# Top frame rendering, Remote is up
-#
-
- my $imgsrc = $img;
- if ($img =~ /^\/adm/) {
- $imgsrc = &lonhttpdurl($img);
- }
- my $upperleft=' ';
-
- my $help=($no_inline_link?''
- :&Apache::loncommon::top_nav_help('Help'));
-
- # Explicit link to get inline menu
- my $menu= ($no_inline_link?''
- :''.&mt('Switch to Inline Menu Mode').' ');
-
- if ($dc_info) {
- $dc_info = qq|($dc_info) |;
- }
-
- my $name = &plainname($env{'user.name'},$env{'user.domain'});
- unless ($public) {
- $name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'},
- undef,'LC_menubuttons_link');
- }
-
- unless ($env{'form.inhibitmenu'}) {
- $bodytag .= qq|$name $role
- $realm $dc_info
|;
- }
- if ($env{'request.state'} eq 'construct') {
- if (!$public){
- if ($env{'request.state'} eq 'construct') {
- $funclist = &Apache::lonhtmlcommon::scripttag(
- &Apache::lonmenu::utilityfunctions($httphost), 'start').
- &Apache::lonhtmlcommon::scripttag('','end').
- &Apache::lonmenu::innerregister($forcereg,
- $args->{'bread_crumbs'});
- }
- }
- }
- return $bodytag."\n".$funclist;
}
sub dc_courseid_toggle {
@@ -5277,15 +5299,8 @@ sub make_attr_string {
delete($attr_ref->{$key});
}
}
- if ($env{'environment.remote'} eq 'on') {
- $attr_ref->{'onload'} =
- &Apache::lonmenu::loadevents(). $on_load;
- $attr_ref->{'onunload'}=
- &Apache::lonmenu::unloadevents().$on_unload;
- } else {
- $attr_ref->{'onload'} = $on_load;
- $attr_ref->{'onunload'}= $on_unload;
- }
+ $attr_ref->{'onload'} = $on_load;
+ $attr_ref->{'onunload'}= $on_unload;
}
my $attr_string;
@@ -6734,7 +6749,6 @@ ul#LC_secondary_menu li {
font-weight: bold;
line-height: 1.8em;
border-right: 1px solid black;
- vertical-align: middle;
float: left;
}
@@ -7295,8 +7309,8 @@ sub headtag {
if (!$args->{'frameset'}) {
$result .= &Apache::lonhtmlcommon::htmlareaheaders();
}
- if ($args->{'force_register'}) {
- $result .= &Apache::lonmenu::registerurl(1);
+ if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) {
+ $result .= Apache::lonxml::display_title();
}
if (!$args->{'no_nav_bar'}
&& !$args->{'only_body'}
@@ -7340,7 +7354,7 @@ ADDMETA
if (!$args->{'frameset'}) {
$result .= ' /';
}
- $result .= '>'
+ $result .= '>'
.$inhibitprint
.$head_extra;
if ($env{'browser.mobile'}) {
@@ -7366,12 +7380,12 @@ sub font_settings {
my $headerstring='';
if ((!$env{'browser.mathml'} && $env{'browser.unicode'}) ||
((ref($args) eq 'HASH') && ($args->{'browser.unicode'}))) {
- $headerstring.=
- ' {'frameset'}) {
- $headerstring.= ' /';
+ $headerstring.= ' /';
}
- $headerstring .= '>'."\n";
+ $headerstring .= '>'."\n";
}
return $headerstring;
}
@@ -7524,16 +7538,14 @@ $args - additional optional args support
skip_phases -> hash ref of
head -> skip the generation
body -> skip all generation
- no_inline_link -> if true and in remote mode, don't show the
- 'Switch To Inline Menu' link
no_auto_mt_title -> prevent &mt()ing the title arg
inherit_jsmath -> when creating popup window in a page,
should it have jsmath forced on by the
current page
bread_crumbs -> Array containing breadcrumbs
bread_crumbs_component -> if exists show it as headline else show only the breadcrumbs
- group -> includes the current group, if page is for a
- specific group
+ group -> includes the current group, if page is for a
+ specific group
=back
@@ -7563,8 +7575,8 @@ sub start_page {
$args->{'function'}, $args->{'add_entries'},
$args->{'only_body'}, $args->{'domain'},
$args->{'force_register'}, $args->{'no_nav_bar'},
- $args->{'bgcolor'}, $args->{'no_inline_link'},
- $args, \@advtools);
+ $args->{'bgcolor'}, $args,
+ \@advtools);
}
}
@@ -7604,11 +7616,6 @@ sub start_page {
}else{
$result .= &Apache::lonhtmlcommon::breadcrumbs();
}
- } elsif (($env{'environment.remote'} eq 'on') &&
- ($env{'form.inhibitmenu'} ne 'yes') &&
- ($env{'request.noversionuri'} =~ m{^/res/}) &&
- ($env{'request.noversionuri'} !~ m{^/res/adm/pages/})) {
- $result .= '
';
}
return $result;
}
@@ -7753,7 +7760,7 @@ sub modal_adhoc_inner {
my ($funcname,$width,$height,$content)=@_;
my $innerwidth=$width-20;
$content=&js_ready(
- &start_page('Dialog',undef,{'only_body'=>1,'bgcolor'=>'#FFFFFF'}).
+ &start_page('Dialog',undef,{'only_body'=>1,'bgcolor'=>'#FFFFFF'}).
&start_scrollbox($width.'px',$innerwidth.'px',$height.'px','myModal','#FFFFFF',undef,1).
$content.
&end_scrollbox().
@@ -8398,7 +8405,7 @@ sub get_sections {
}
}
- if ($check_students) {
+ if ($check_students) {
my ($classlist) = &Apache::loncoursedata::get_classlist($cdom,$cnum);
my $sec_index = &Apache::loncoursedata::CL_SECTION();
my $status_index = &Apache::loncoursedata::CL_STATUS();
@@ -8794,8 +8801,8 @@ sub get_user_quota {
if ($quota eq '' || wantarray) {
if ($quotaname eq 'course') {
my %domdefs = &Apache::lonnet::get_domain_defaults($udom);
- if (($crstype eq 'official') || ($crstype eq 'unofficial') ||
- ($crstype eq 'community') || ($crstype eq 'textbook')) {
+ if (($crstype eq 'official') || ($crstype eq 'unofficial') ||
+ ($crstype eq 'community') || ($crstype eq 'textbook')) {
$defquota = $domdefs{$crstype.'quota'};
}
if ($defquota eq '') {
@@ -8966,10 +8973,10 @@ sub excess_filesize_warning {
}
$disk_quota = int($disk_quota * 1000);
if (($current_disk_usage + $filesize) > $disk_quota) {
- return ''.
+ return ''.
&mt("Unable to $action [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.",
- ''.$filename.' ',$filesize).'
'.
- ' '.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',
+ ''.$filename.' ',$filesize).'
'.
+ ''.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',
$disk_quota,$current_disk_usage).
'
';
}
@@ -8979,6 +8986,8 @@ sub excess_filesize_warning {
###############################################
+
+
sub get_secgrprole_info {
my ($cdom,$cnum,$needroles,$type) = @_;
my %sections_count = &get_sections($cdom,$cnum);
@@ -9420,7 +9429,14 @@ sub personal_data_fieldtitles {
sub sorted_inst_types {
my ($dom) = @_;
- my ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($dom);
+ my ($usertypes,$order);
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
+ if (ref($domdefaults{'inststatus'}) eq 'HASH') {
+ $usertypes = $domdefaults{'inststatus'}{'inststatustypes'};
+ $order = $domdefaults{'inststatus'}{'inststatusorder'};
+ } else {
+ ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($dom);
+ }
my $othertitle = &mt('All users');
if ($env{'request.course.id'}) {
$othertitle = &mt('Any users');
@@ -9829,7 +9845,7 @@ sub ask_for_embedded_content {
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
}
- if (($actionurl eq '/adm/portfolio') ||
+ if (($actionurl eq '/adm/portfolio') ||
($actionurl eq '/adm/coursegrp_portfolio')) {
my $current_path='/';
if ($env{'form.currentpath'}) {
@@ -9861,18 +9877,18 @@ sub ask_for_embedded_content {
$toplevel = $url;
if ($args->{'context'} eq 'paste') {
($cdom,$cnum) = ($url =~ m{^\Q/uploaded/\E($match_domain)/($match_courseid)/});
- ($path) =
+ ($path) =
($toplevel =~ m{^(\Q/uploaded/$cdom/$cnum/\E(?:docs|supplemental)/(?:default|\d+)/\d+)/});
$fileloc = &Apache::lonnet::filelocation('',$toplevel);
$fileloc =~ s{^/}{};
}
}
- } elsif ($actionurl eq '/adm/dependencies') {
+ } elsif ($actionurl eq '/adm/dependencies') {
if ($env{'request.course.id'} ne '') {
if (ref($args) eq 'HASH') {
$url = $args->{'docs_url'};
$title = $args->{'docs_title'};
- $toplevel = $url;
+ $toplevel = $url;
unless ($toplevel =~ m{^/}) {
$toplevel = "/$url";
}
@@ -9943,8 +9959,8 @@ sub ask_for_embedded_content {
my $dirptr = 16384;
foreach my $path (keys(%subdependencies)) {
$currsubfile{$path} = {};
- if (($actionurl eq '/adm/portfolio') ||
- ($actionurl eq '/adm/coursegrp_portfolio')) {
+ if (($actionurl eq '/adm/portfolio') ||
+ ($actionurl eq '/adm/coursegrp_portfolio')) {
my ($sublistref,$listerror) =
&Apache::lonnet::dirlist($url.$path,$udom,$uname,$getpropath);
if (ref($sublistref) eq 'ARRAY') {
@@ -10086,7 +10102,7 @@ sub ask_for_embedded_content {
$counter = scalar(keys(%existing));
$numpathchg = scalar(keys(%pathchanges));
return ($output,$counter,$numpathchg,\%existing);
- } elsif (($actionurl eq "/public/$cdom/$cnum/syllabus") &&
+ } elsif (($actionurl eq "/public/$cdom/$cnum/syllabus") &&
(ref($args) eq 'HASH') && ($args->{'context'} eq 'rewrites')) {
$counter = scalar(keys(%existing));
$numpathchg = scalar(keys(%pathchanges));
@@ -10315,7 +10331,7 @@ sub ask_for_embedded_content {
Performs clean-up of directories, subdirectories and filename in an
embedded object, referenced in an HTML file which is being uploaded
-to a course or portfolio, where
+to a course or portfolio, where
"Upload embedded images/multimedia files if HTML file" checkbox was
checked.
@@ -10334,7 +10350,7 @@ sub clean_path {
@contents = ($embed_file);
}
my $lastidx = scalar(@contents)-1;
- for (my $i=0; $i<=$lastidx; $i++) {
+ for (my $i=0; $i<=$lastidx; $i++) {
$contents[$i]=~s{\\}{/}g;
$contents[$i]=~s/\s+/\_/g;
$contents[$i]=~s{[^/\w\.\-]}{}g;
@@ -10673,7 +10689,7 @@ sub modify_html_refs {
}
my (%allfiles,%codebase,$output,$content);
my @changes = &get_env_multiple('form.namechange');
- unless ((@changes > 0) || ($context eq 'syllabus')) {
+ unless ((@changes > 0) || ($context eq 'syllabus')) {
if (wantarray) {
return ('',0,0);
} else {
@@ -10808,7 +10824,7 @@ sub modify_html_refs {
}
}
if ($rewrites) {
- my $saveresult;
+ my $saveresult;
my $url = &Apache::lonnet::store_edited_file($container,$content,$udom,$uname,\$saveresult);
if ($url eq $container) {
my ($fname) = ($container =~ m{/([^/]+)$});
@@ -10914,11 +10930,11 @@ sub check_for_upload {
if ($currsize < $filesize) {
my $extra = $filesize - $currsize;
if (($current_disk_usage + $extra) > $disk_quota) {
- my $msg = ''.
+ my $msg = ''.
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded if existing (smaller) file with same name (size = [_3] kilobytes) is replaced.',
- ''.$fname.' ',$filesize,$currsize).'
'.
- ' '.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',
- $disk_quota,$current_disk_usage);
+ ''.$fname.' ',$filesize,$currsize).''.
+ ''.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',
+ $disk_quota,$current_disk_usage).'
';
return ('will_exceed_quota',$msg);
}
}
@@ -10927,21 +10943,21 @@ sub check_for_upload {
}
}
if (($current_disk_usage + $filesize) > $disk_quota){
- my $msg = ''.
- &mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.',''.$fname.' ',$filesize).' '.
- ' '.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage);
+ my $msg = ''.
+ &mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.',''.$fname.' ',$filesize).'
'.
+ ''.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage).'
';
return ('will_exceed_quota',$msg);
} elsif ($found_file) {
if ($locked_file) {
- my $msg = '';
+ my $msg = '';
$msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].',''.$fname.' ',''.$port_path.$env{'form.currentpath'}.' ');
- $msg .= '
';
+ $msg .= '';
$msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.',''.$fname.' ');
return ('file_locked',$msg);
} else {
- my $msg = '';
+ my $msg = '';
$msg .= &mt(' A file by that name: [_1] was found in [_2].',''.$fname.' ',$port_path.$env{'form.currentpath'});
- $msg .= '
';
+ $msg .= '';
return ('existingfile',$msg);
}
}
@@ -11081,6 +11097,7 @@ function camtasiaToggle() {
for (var i=0; i '.&mt('Filename should end with one of: [_1].',
'.zip, .tar, .bz2, .gz, .tar.gz, .tar.bz2, .tgz');
@@ -11395,7 +11412,7 @@ sub process_decompression {
$env{'form.archive_title_'.$i} = $env{'form.camtasia_foldername'};
$displayed{'folder'} = $i;
} elsif ((($item eq "$contents[0]/index.html") && ($version == 6)) ||
- (($item eq "$contents[0]/$contents[0]".'.html') && ($version == 8))) {
+ (($item eq "$contents[0]/$contents[0]".'.html') && ($version == 8))) {
$env{'form.archive_'.$i} = 'display';
$env{'form.archive_title_'.$i} = $env{'form.camtasia_moviename'};
$displayed{'web'} = $i;
@@ -11847,7 +11864,7 @@ sub process_extracted_files {
$folders{'0'} = $items[-2];
if ($env{'form.folderpath'} =~ /\:1$/) {
$containers{'0'}='page';
- } else {
+ } else {
$containers{'0'}='sequence';
}
}
@@ -11967,7 +11984,7 @@ sub process_extracted_files {
}
}
} else {
- $warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).' ';
+ $warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).' ';
}
}
for (my $i=1; $i<=$numitems; $i++) {
@@ -11989,7 +12006,7 @@ sub process_extracted_files {
}
if ($itemidx eq '') {
$itemidx = 0;
- }
+ }
if (grep(/^\Q$referrer{$i}\E$/,@archdirs)) {
if ($mapinner{$referrer{$i}}) {
$fullpath = "$prefix$dir/$docstype/$mapinner{$referrer{$i}}";
@@ -12036,12 +12053,12 @@ sub process_extracted_files {
$showpath = "$relpath/$title";
} else {
$showpath = "/$title";
- }
+ }
$result .= ''.&mt('[_1] included as a dependency',$showpath).' '."\n";
- }
+ }
unless ($ishome) {
my $fetch = "$fullpath/$title";
- $fetch =~ s/^\Q$prefix$dir\E//;
+ $fetch =~ s/^\Q$prefix$dir\E//;
$prompttofetch{$fetch} = 1;
}
}
@@ -12051,7 +12068,7 @@ sub process_extracted_files {
$path,$env{'form.archive_content_'.$referrer{$i}}).' ';
}
} else {
- $warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).' ';
+ $warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).' ';
}
}
if (keys(%todelete)) {
@@ -13241,14 +13258,14 @@ generated by lonerrorhandler.pm, CHECKRP
lonsupportreq.pm, loncoursequeueadmin.pm, searchcat.pl respectively.
Inputs:
-defmail (scalar - email address of default recipient),
+defmail (scalar - email address of default recipient),
mailing type (scalar: errormail, packagesmail, helpdeskmail,
requestsmail, updatesmail, or idconflictsmail).
defdom (domain for which to retrieve configuration settings),
-origmail (scalar - email address of recipient from loncapa.conf,
-i.e., predates configuration by DC via domainprefs.pm
+origmail (scalar - email address of recipient from loncapa.conf,
+i.e., predates configuration by DC via domainprefs.pm
Returns: comma separated list of addresses to which to send e-mail.
@@ -13656,6 +13673,12 @@ sub assign_category_rows {
return $text;
}
+=pod
+
+=back
+
+=cut
+
############################################################
############################################################
@@ -13786,7 +13809,7 @@ sub commit_studentrole {
}
}
} else {
- if ($secchange) {
+ if ($secchange) {
$$logmsg .= &mt('Error when attempting section change for [_1] from old section "[_2]" to new section: "[_3]" in course [_4] -error:',$uname,$oldsec,$sec,$cid).' '.$modify_section_result.$linefeed;
} else {
$$logmsg .= &mt('Error when attempting to modify role for [_1] for section: "[_2]" in course [_3] -error:',$uname,$sec,$cid).' '.$modify_section_result.$linefeed;
@@ -14206,7 +14229,7 @@ sub construct_course {
if (ref($crsinfo{$$crsudom.'_'.$$crsunum}) eq 'HASH') {
$crsinfo{$$crsudom.'_'.$$crsunum}{'uniquecode'} = $code;
my $putres = &Apache::lonnet::courseidput($$crsudom,\%crsinfo,$crsuhome,'notime');
- }
+ }
if (ref($coderef)) {
$$coderef = $code;
}
@@ -14291,7 +14314,7 @@ sub make_unique_code {
my $tries = 0;
my $gotlock = &Apache::lonnet::newput_dom('uniquecodes',$lockhash,$cdom);
my ($code,$error);
-
+
while (($gotlock ne 'ok') && ($tries<3)) {
$tries ++;
sleep 1;
@@ -14584,7 +14607,7 @@ sub init_user_environment {
my %reqauthor = &Apache::lonnet::get('requestauthor',['author_status','author'],
$domain,$username);
my $reqstatus = $reqauthor{'author_status'};
- if ($reqstatus eq 'approval' || $reqstatus eq 'approved') {
+ if ($reqstatus eq 'approval' || $reqstatus eq 'approved') {
if (ref($reqauthor{'author'}) eq 'HASH') {
$userenv{'requestauthorqueued'} = $reqstatus.':'.
$reqauthor{'author'}{'timestamp'};
@@ -14675,6 +14698,535 @@ sub clean_symb {
return ($symb,$enc);
}
+############################################################
+############################################################
+
+=pod
+
+=head1 Routines for building display used to search for courses
+
+
+=over 4
+
+=item * &build_filters()
+
+Create markup for a table used to set filters to use when selecting
+courses in a domain. Used by lonpickcourse.pm, lonmodifycourse.pm
+and quotacheck.pl
+
+
+Inputs:
+
+filterlist - anonymous array of fields to include as potential filters
+
+crstype - course type
+
+roleelement - fifth arg in selectcourse_link() populates fifth arg in javascript: opencrsbrowser() function, used
+ to pop-open a course selector (will contain "extra element").
+
+multelement - if multiple course selections will be allowed, this will be a hidden form element: name: multiple; value: 1
+
+filter - anonymous hash of criteria and their values
+
+action - form action
+
+numfiltersref - ref to scalar (count of number of elements in institutional codes -- e.g., 4 for year, semester, department, and number)
+
+caller - caller context (e.g., set to 'modifycourse' when routine is called from lonmodifycourse.pm)
+
+cloneruname - username of owner of new course who wants to clone
+
+clonerudom - domain of owner of new course who wants to clone
+
+typeelem - text to use for left column in row containing course type (i.e., Course, Community or Course/Community)
+
+codetitlesref - reference to array of titles of components in institutional codes (official courses)
+
+codedom - domain
+
+formname - value of form element named "form".
+
+fixeddom - domain, if fixed.
+
+prevphase - value to assign to form element named "phase" when going back to the previous screen
+
+cnameelement - name of form element in form on opener page which will receive title of selected course
+
+cnumelement - name of form element in form on opener page which will receive courseID of selected course
+
+cdomelement - name of form element in form on opener page which will receive domain of selected course
+
+setroles - includes access constraint identifier when setting a roles-based condition for acces to a portfolio file
+
+clonetext - hidden form elements containing list of courses cloneable by intended course owner when DC creates a course
+
+clonewarning - warning message about missing information for intended course owner when DC creates a course
+
+
+Returns: $output - HTML for display of search criteria, and hidden form elements.
+
+
+Side Effects: None
+
+=cut
+
+# ---------------------------------------------- search for courses based on last activity etc.
+
+sub build_filters {
+ my ($filterlist,$crstype,$roleelement,$multelement,$filter,$action,
+ $numtitlesref,$caller,$cloneruname,$clonerudom,$typeelement,
+ $codetitlesref,$codedom,$formname,$fixeddom,$prevphase,
+ $cnameelement,$cnumelement,$cdomelement,$setroles,
+ $clonetext,$clonewarning) = @_;
+ my ($list,$jscript);
+ my $onchange = 'javascript:updateFilters(this)';
+ my ($domainselectform,$sincefilterform,$createdfilterform,
+ $ownerdomselectform,$persondomselectform,$instcodeform,
+ $typeselectform,$instcodetitle);
+ if ($formname eq '') {
+ $formname = $caller;
+ }
+ foreach my $item (@{$filterlist}) {
+ unless (($item eq 'descriptfilter') || ($item eq 'instcodefilter') ||
+ ($item eq 'sincefilter') || ($item eq 'createdfilter')) {
+ if ($item eq 'domainfilter') {
+ $filter->{$item} = &LONCAPA::clean_domain($filter->{$item});
+ } elsif ($item eq 'coursefilter') {
+ $filter->{$item} = &LONCAPA::clean_courseid($filter->{$item});
+ } elsif ($item eq 'ownerfilter') {
+ $filter->{$item} = &LONCAPA::clean_username($filter->{$item});
+ } elsif ($item eq 'ownerdomfilter') {
+ $filter->{'ownerdomfilter'} =
+ &LONCAPA::clean_domain($filter->{$item});
+ $ownerdomselectform = &select_dom_form($filter->{'ownerdomfilter'},
+ 'ownerdomfilter',1);
+ } elsif ($item eq 'personfilter') {
+ $filter->{$item} = &LONCAPA::clean_username($filter->{$item});
+ } elsif ($item eq 'persondomfilter') {
+ $persondomselectform = &select_dom_form($filter->{'persondomfilter'},
+ 'persondomfilter',1);
+ } else {
+ $filter->{$item} =~ s/\W//g;
+ }
+ if (!$filter->{$item}) {
+ $filter->{$item} = '';
+ }
+ }
+ if ($item eq 'domainfilter') {
+ my $allow_blank = 1;
+ if ($formname eq 'portform') {
+ $allow_blank=0;
+ } elsif ($formname eq 'studentform') {
+ $allow_blank=0;
+ }
+ if ($fixeddom) {
+ $domainselectform = ' '.
+ &Apache::lonnet::domain($codedom,'description');
+ } else {
+ $domainselectform = &select_dom_form($filter->{$item},
+ 'domainfilter',
+ $allow_blank,'',$onchange);
+ }
+ } else {
+ $list->{$item} = &HTML::Entities::encode($filter->{$item},'<>&"');
+ }
+ }
+
+ # last course activity filter and selection
+ $sincefilterform = &timebased_select_form('sincefilter',$filter);
+
+ # course created filter and selection
+ if (exists($filter->{'createdfilter'})) {
+ $createdfilterform = &timebased_select_form('createdfilter',$filter);
+ }
+
+ my %lt = &Apache::lonlocal::texthash(
+ 'cac' => "$crstype Activity",
+ 'ccr' => "$crstype Created",
+ 'cde' => "$crstype Title",
+ 'cdo' => "$crstype Domain",
+ 'ins' => 'Institutional Code',
+ 'inc' => 'Institutional Categorization',
+ 'cow' => "$crstype Owner/Co-owner",
+ 'cop' => "$crstype Personnel Includes",
+ 'cog' => 'Type',
+ );
+
+ if (($formname eq 'ccrs') || ($formname eq 'requestcrs')) {
+ my $typeval = 'Course';
+ if ($crstype eq 'Community') {
+ $typeval = 'Community';
+ }
+ $typeselectform = ' ';
+ } else {
+ $typeselectform = '".&mt($posstype)."\n";
+ }
+ $typeselectform.=" ";
+ }
+
+ my ($cloneableonlyform,$cloneabletitle);
+ if (exists($filter->{'cloneableonly'})) {
+ my $cloneableon = '';
+ my $cloneableoff = ' checked="checked"';
+ if ($filter->{'cloneableonly'}) {
+ $cloneableon = $cloneableoff;
+ $cloneableoff = '';
+ }
+ $cloneableonlyform = ' '.&mt('Required').' '.(' 'x3).' '.&mt('No restriction').' ';
+ if ($formname eq 'ccrs') {
+ $cloneabletitle = &mt('Cloneable for').' '.$cloneruname.':'.$clonerudom;
+ } else {
+ $cloneabletitle = &mt('Cloneable by you');
+ }
+ }
+ my $officialjs;
+ if ($crstype eq 'Course') {
+ if (exists($filter->{'instcodefilter'})) {
+# if (($fixeddom) || ($formname eq 'requestcrs') ||
+# ($formname eq 'modifycourse') || ($formname eq 'filterpicker')) {
+ if ($codedom) {
+ $officialjs = 1;
+ ($instcodeform,$jscript,$$numtitlesref) =
+ &Apache::courseclassifier::instcode_selectors($codedom,'filterpicker',
+ $officialjs,$codetitlesref);
+ if ($jscript) {
+ $jscript = ''."\n";
+ }
+ }
+ if ($instcodeform eq '') {
+ $instcodeform =
+ ' ';
+ $instcodetitle = $lt{'ins'};
+ } else {
+ $instcodetitle = $lt{'inc'};
+ }
+ if ($fixeddom) {
+ $instcodetitle .= ' ('.$codedom.')';
+ }
+ }
+ }
+ my $output = qq|
+'."\n".' '."\n";
+ return $jscript.$clonewarning.$output;
+}
+
+=pod
+
+=item * &timebased_select_form()
+
+Create markup for a dropdown list used to select a time-based
+filter e.g., Course Activity, Course Created, when searching for courses
+or communities
+
+Inputs:
+
+item - name of form element (sincefilter or createdfilter)
+
+filter - anonymous hash of criteria and their values
+
+Returns: HTML for a select box contained a blank, then six time selections,
+ with value set in incoming form variables currently selected.
+
+Side Effects: None
+
+=cut
+
+sub timebased_select_form {
+ my ($item,$filter) = @_;
+ if (ref($filter) eq 'HASH') {
+ $filter->{$item} =~ s/[^\d-]//g;
+ if (!$filter->{$item}) { $filter->{$item}=-1; }
+ return &select_form(
+ $filter->{$item},
+ $item,
+ { '-1' => '',
+ '86400' => &mt('today'),
+ '604800' => &mt('last week'),
+ '2592000' => &mt('last month'),
+ '7776000' => &mt('last three months'),
+ '15552000' => &mt('last six months'),
+ '31104000' => &mt('last year'),
+ 'select_form_order' =>
+ ['-1','86400','604800','2592000','7776000',
+ '15552000','31104000']});
+ }
+}
+
+=pod
+
+=item * &js_changer()
+
+Create script tag containing Javascript used to submit course search form
+when course type or domain is changed, and also to hide 'Searching ...' on
+page load completion for page showing search result.
+
+Inputs: None
+
+Returns: markup containing updateFilters() and hideSearching() javascript functions.
+
+Side Effects: None
+
+=cut
+
+sub js_changer {
+ return <
+//
+
+
+ENDJS
+}
+
+=pod
+
+=item * &search_courses()
+
+Process selected filters form course search form and pass to lonnet::courseiddump
+to retrieve a hash for which keys are courseIDs which match the selected filters.
+
+Inputs:
+
+dom - domain being searched
+
+type - course type ('Course' or 'Community' or '.' if any).
+
+filter - anonymous hash of criteria and their values
+
+numtitles - for institutional codes - number of categories
+
+cloneruname - optional username of new course owner
+
+clonerudom - optional domain of new course owner
+
+domcloner - Optional "domcloner" flag; has value=1 if user has ccc priv in domain being filtered by,
+ (used when DC is using course creation form)
+
+codetitles - reference to array of titles of components in institutional codes (official courses).
+
+
+Returns: %courses - hash of courses satisfying search criteria, keys = course IDs, values are corresponding colon-separated escaped description, institutional code, owner and type.
+
+
+Side Effects: None
+
+=cut
+
+
+sub search_courses {
+ my ($dom,$type,$filter,$numtitles,$cloneruname,$clonerudom,$domcloner,$codetitles) = @_;
+ my (%courses,%showcourses,$cloner);
+ if (($filter->{'ownerfilter'} ne '') ||
+ ($filter->{'ownerdomfilter'} ne '')) {
+ $filter->{'combownerfilter'} = $filter->{'ownerfilter'}.':'.
+ $filter->{'ownerdomfilter'};
+ }
+ foreach my $item ('descriptfilter','coursefilter','combownerfilter') {
+ if (!$filter->{$item}) {
+ $filter->{$item}='.';
+ }
+ }
+ my $now = time;
+ my $timefilter =
+ ($filter->{'sincefilter'}==-1?1:$now-$filter->{'sincefilter'});
+ my ($createdbefore,$createdafter);
+ if (($filter->{'createdfilter'} ne '') && ($filter->{'createdfilter'} !=-1)) {
+ $createdbefore = $now;
+ $createdafter = $now-$filter->{'createdfilter'};
+ }
+ my ($instcodefilter,$regexpok);
+ if ($numtitles) {
+ if ($env{'form.official'} eq 'on') {
+ $instcodefilter =
+ &Apache::courseclassifier::instcode_search_str($dom,$numtitles,$codetitles);
+ $regexpok = 1;
+ } elsif ($env{'form.official'} eq 'off') {
+ $instcodefilter = &Apache::courseclassifier::instcode_search_str($dom,$numtitles,$codetitles);
+ unless ($instcodefilter eq '') {
+ $regexpok = -1;
+ }
+ }
+ } else {
+ $instcodefilter = $filter->{'instcodefilter'};
+ }
+ if ($instcodefilter eq '') { $instcodefilter = '.'; }
+ if ($type eq '') { $type = '.'; }
+
+ if (($clonerudom ne '') && ($cloneruname ne '')) {
+ $cloner = $cloneruname.':'.$clonerudom;
+ }
+ %courses = &Apache::lonnet::courseiddump($dom,
+ $filter->{'descriptfilter'},
+ $timefilter,
+ $instcodefilter,
+ $filter->{'combownerfilter'},
+ $filter->{'coursefilter'},
+ undef,undef,$type,$regexpok,undef,undef,
+ undef,undef,$cloner,$env{'form.cc_clone'},
+ $filter->{'cloneableonly'},
+ $createdbefore,$createdafter,undef,
+ $domcloner);
+ if (($filter->{'personfilter'} ne '') && ($filter->{'persondomfilter'} ne '')) {
+ my $ccrole;
+ if ($type eq 'Community') {
+ $ccrole = 'co';
+ } else {
+ $ccrole = 'cc';
+ }
+ my %rolehash = &Apache::lonnet::get_my_roles($filter->{'personfilter'},
+ $filter->{'persondomfilter'},
+ 'userroles',undef,
+ [$ccrole,'in','ad','ep','ta','cr'],
+ $dom);
+ foreach my $role (keys(%rolehash)) {
+ my ($cnum,$cdom,$courserole) = split(':',$role);
+ my $cid = $cdom.'_'.$cnum;
+ if (exists($courses{$cid})) {
+ if (ref($courses{$cid}) eq 'HASH') {
+ if (ref($courses{$cid}{roles}) eq 'ARRAY') {
+ if (!grep(/^\Q$courserole\E$/,@{$courses{$cid}{roles}})) {
+ push (@{$courses{$cid}{roles}},$courserole);
+ }
+ } else {
+ $courses{$cid}{roles} = [$courserole];
+ }
+ $showcourses{$cid} = $courses{$cid};
+ }
+ }
+ }
+ %courses = %showcourses;
+ }
+ return %courses;
+}
+
+
+=pod
+
+=back
+
+=cut
+
+
sub build_release_hashes {
my ($checkparms,$checkresponsetypes,$checkcrstypes,$anonsurvey,$randomizetry) = @_;
return unless((ref($checkparms) eq 'HASH') && (ref($checkresponsetypes) eq 'HASH') &&
@@ -15047,7 +15599,7 @@ sub check_recaptcha {
}
sub emailusername_info {
- my @fields = ('lastname','firstname','institution','web','location','officialemail');
+ my @fields = ('firstname','lastname','institution','web','location','officialemail');
my %titles = &Apache::lonlocal::texthash (
lastname => 'Last Name',
firstname => 'First Name',
@@ -15123,12 +15675,6 @@ sub des_decrypt {
return $plaintext;
}
-=pod
-
-=back
-
-=cut
-
1;
__END__;