'
- ."".$linktext.' '
- .'';
+ my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
+ return "".&mt('Select Course')." ";
}
sub selectauthor_link {
@@ -782,14 +612,6 @@ sub selectauthor_link {
&mt('Select Author').'';
}
-sub selectuser_link {
- my ($form,$unameelem,$domelem,$lastelem,$firstelem,$emailelem,$hdomelem,
- $coursedom,$linktext,$caller) = @_;
- return ''.$linktext.' ';
-}
-
sub check_uncheck_jscript {
my $jscript = <<"ENDSCRT";
function checkAll(field) {
@@ -888,21 +710,6 @@ sub select_datelocale {
return $output;
}
-sub select_language {
- my ($name,$selected,$includeempty) = @_;
- my %langchoices;
- if ($includeempty) {
- %langchoices = ('' => 'No language preference');
- }
- foreach my $id (&languageids()) {
- my $code = &supportedlanguagecode($id);
- if ($code) {
- $langchoices{$code} = &plainlanguagedescription($id);
- }
- }
- return &select_form($selected,$name,%langchoices);
-}
-
=pod
=item * &linked_select_forms(...)
@@ -989,8 +796,7 @@ sub linked_select_forms {
my $first = "document.$formname.$firstselectname";
# output the javascript to do the changing
my $result = '';
- $result.='
END
# output the initial values for the selection lists
@@ -1121,18 +926,16 @@ sub help_open_topic {
if ($text ne "") {
$template .=
"".
- "$text ";
+ "$text ";
}
# Add the graphic
my $title = &mt('Online Help');
my $helpicon=&lonhttpdurl("/adm/help/help.png");
- $template .= ''.
- ' ';
- if ($text ne '') {
- $template.='
';
- }
+ $template .= <<"ENDTEMPLATE";
+
+ENDTEMPLATE
+ if ($text ne '') { $template.='' };
return $template;
}
@@ -1140,37 +943,31 @@ sub help_open_topic {
# This is a quicky function for Latex cheatsheet editing, since it
# appears in at least four places
sub helpLatexCheatsheet {
- my ($topic,$text,$not_author) = @_;
- my $out;
+ my $other = shift;
my $addOther = '';
- if ($topic) {
- $addOther = &Apache::loncommon::help_open_topic($topic,$text,
+ if ($other) {
+ $addOther = Apache::loncommon::help_open_topic($other, shift,
undef, undef, 600) .
'';
}
- $out = ''.
- $addOther .
- &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),
- undef,undef,600).
- ' '.
- &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),
- undef,undef,600).
- ' ';
- unless ($not_author) {
- $out .= ''.
- &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),
- undef,undef,600).
- ' ';
- }
- $out .= '
';
- return $out;
+ return ''.
+ $addOther .
+ &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),
+ undef,undef,600)
+ .' '.
+ &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),
+ undef,undef,600)
+ .' '.
+ &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),
+ undef,undef,600)
+ .'
';
}
sub general_help {
my $helptopic='Student_Intro';
if ($env{'request.role'}=~/^(ca|au)/) {
$helptopic='Authoring_Intro';
- } elsif ($env{'request.role'}=~/^(cc|co)/) {
+ } elsif ($env{'request.role'}=~/^cc/) {
$helptopic='Course_Coordination_Intro';
} elsif ($env{'request.role'}=~/^dc/) {
$helptopic='Domain_Coordination_Intro';
@@ -1190,9 +987,7 @@ sub update_help_link {
my $banner_link = "/adm/helpmenu?page=banner&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp&stayonpage=$stayOnPage";
my $output .= <<"ENDOUTPUT";
ENDOUTPUT
return $output;
@@ -1269,8 +1064,8 @@ sub help_menu_js {
my $template .= <<"ENDTEMPLATE";
ENDTEMPLATE
return $template;
@@ -1333,7 +1128,7 @@ sub help_open_bug {
{
$template .=
"".
- "$text ";
+ "$text ";
}
# Add the graphic
@@ -1378,7 +1173,7 @@ sub help_open_faq {
{
$template .=
"".
- "$text ";
+ "$text ";
}
# Add the graphic
@@ -1564,7 +1359,6 @@ sub resize_textarea_js {
my $geometry = &viewport_geometry_js();
return <<"RESIZE";
RESIZE
@@ -1836,7 +1629,7 @@ sub multiple_select_form {
$size = scalar(keys(%$hash));
}
}
- $output.="\n".'';
+ $output.="\n";
my @order;
if (ref($order) eq 'ARRAY') {
@order = @{$order};
@@ -1882,7 +1675,7 @@ sub select_form {
$selectform.=
'&').'" '.
($key eq $def ? 'selected="selected" ' : '').
- ">".$hash{$key}." \n";
+ ">".&mt($hash{$key})."\n";
}
$selectform.=" ";
return $selectform;
@@ -1947,7 +1740,7 @@ sub select_level_form {
=pod
-=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms)
+=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc)
Returns a string containing a form to
allow a user to select the domain to preform an operation in.
@@ -1956,28 +1749,16 @@ See loncreateuser.pm for an example invo
If the $includeempty flag is set, it also includes an empty choice ("no domain
selected");
-If the $showdomdesc flag is set, the domain name is followed by the domain description.
-
-The optional $onchange argument specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted.
-
-The optional $incdoms is a reference to an array of domains which will be the only available options.
+If the $showdomdesc flag is set, the domain name is followed by the domain description.
=cut
#-------------------------------------------
sub select_dom_form {
- my ($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms) = @_;
- if ($onchange) {
- $onchange = ' onchange="'.$onchange.'"';
- }
- my @domains;
- if (ref($incdoms) eq 'ARRAY') {
- @domains = sort {lc($a) cmp lc($b)} (@{$incdoms});
- } else {
- @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());
- }
+ my ($defdom,$name,$includeempty,$showdomdesc) = @_;
+ my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());
if ($includeempty) { @domains=('',@domains); }
- my $selectdomain = "\n";
+ my $selectdomain = "\n";
foreach my $dom (@domains) {
$selectdomain.="'.$dom;
@@ -2033,7 +1814,7 @@ sub home_server_form_item {
if ($numlib > 1) {
$result .= ' '."\n";
if ($default) {
- $result .= ' '.&mt('default').
+ $result .= ' '.&mt('default').
' '."\n";
}
foreach my $hostid (sort(keys(%servers))) {
@@ -2328,14 +2109,14 @@ sub authform_kerberos {
$autharg,$jscall);
my ($authnum,%can_assign) = &get_assignable_auth($in{'domain'});
if ($in{'kerb_def_auth'} eq 'krb5') {
- $check5 = ' checked="checked"';
+ $check5 = ' checked="on"';
} else {
- $check4 = ' checked="checked"';
+ $check4 = ' checked="on"';
}
$krbarg = $in{'kerb_def_dom'};
if (defined($in{'curr_authtype'})) {
if ($in{'curr_authtype'} eq 'krb') {
- $krbcheck = ' checked="checked"';
+ $krbcheck = ' checked="on"';
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifyuser') {
$krbcheck = '';
@@ -2343,10 +2124,10 @@ sub authform_kerberos {
}
if (defined($in{'curr_kerb_ver'})) {
if ($in{'curr_krb_ver'} eq '5') {
- $check5 = ' checked="checked"';
+ $check5 = ' checked="on"';
$check4 = '';
} else {
- $check4 = ' checked="checked"';
+ $check4 = ' checked="on"';
$check5 = '';
}
}
@@ -2367,7 +2148,7 @@ sub authform_kerberos {
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) {
@@ -2376,7 +2157,7 @@ sub authform_kerberos {
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2437,7 +2218,7 @@ sub authform_internal{
if (defined($in{'curr_authtype'})) {
if ($in{'curr_authtype'} eq 'int') {
if ($can_assign{'int'}) {
- $intcheck = 'checked="checked" ';
+ $intcheck = 'checked="on" ';
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifyuser') {
$intcheck = '';
@@ -2453,7 +2234,7 @@ sub authform_internal{
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'int'}) {
@@ -2462,7 +2243,7 @@ sub authform_internal{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2477,7 +2258,7 @@ sub authform_internal{
$result = &mt
('[_1] Internally authenticated (with initial password [_2])',
''.$authtype,' '.$autharg);
- $result.=" ".&mt('Visible input').' ';
+ $result.=" ".&mt('Visible input').' ';
return $result;
}
@@ -2492,7 +2273,7 @@ sub authform_local{
if (defined($in{'curr_authtype'})) {
if ($in{'curr_authtype'} eq 'loc') {
if ($can_assign{'loc'}) {
- $loccheck = 'checked="checked" ';
+ $loccheck = 'checked="on" ';
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifyuser') {
$loccheck = '';
@@ -2508,7 +2289,7 @@ sub authform_local{
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'loc'}) {
@@ -2517,7 +2298,7 @@ sub authform_local{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2546,7 +2327,7 @@ sub authform_filesystem{
if (defined($in{'curr_authtype'})) {
if ($in{'curr_authtype'} eq 'fsys') {
if ($can_assign{'fsys'}) {
- $fsyscheck = 'checked="checked" ';
+ $fsyscheck = 'checked="on" ';
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifyuser') {
$fsyscheck = '';
@@ -2559,7 +2340,7 @@ sub authform_filesystem{
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'fsys'}) {
@@ -2568,7 +2349,7 @@ sub authform_filesystem{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2936,43 +2717,6 @@ sub flush_email_cache {
&Apache::lonnet::devalidate_cache_new('emailscache',$id);
}
-# -------------------------------------------------------------------- getlangs
-
-=pod
-
-=item * &getlangs($uname,$udom)
-
-Gets a user's language preference and returns it as a hash with key:
-language.
-
-=cut
-
-
-sub getlangs {
- my ($uname,$udom) = @_;
- if (!$udom) { $udom =$env{'user.domain'}; }
- if (!$uname) { $uname=$env{'user.name'}; }
- my $id=$uname.':'.$udom;
- my ($langs,$cached)=&Apache::lonnet::is_cached_new('userlangs',$id);
- if ($cached) {
- return %{$langs};
- } else {
- my %loadlangs=&Apache::lonnet::get('environment',['languages'],
- $udom,$uname);
- &Apache::lonnet::do_cache_new('userlangs',$id,\%loadlangs);
- return %loadlangs;
- }
-}
-
-sub flush_langs_cache {
- my ($uname,$udom)=@_;
- if (!$udom) { $udom =$env{'user.domain'}; }
- if (!$uname) { $uname=$env{'user.name'}; }
- return if ($udom eq 'public' && $uname eq 'public');
- my $id=$uname.':'.$udom;
- &Apache::lonnet::devalidate_cache_new('userlangs',$id);
-}
-
# ------------------------------------------------------------------ Screenname
=pod
@@ -2991,25 +2735,6 @@ sub screenname {
return $names{'screenname'};
}
-# ------------------------------------------------------------- Confirm Wrapper
-=pod
-
-=item confirmwrapper
-
-Wrap messages about completion of operation in box
-
-=cut
-
-sub confirmwrapper {
- my ($message)=@_;
- if ($message) {
- return "\n".''."\n"
- .$message."\n"
- .'
'."\n";
- } else {
- return $message;
- }
-}
# ------------------------------------------------------------- Message Wrapper
@@ -3036,22 +2761,19 @@ sub aboutmewrapper {
return;
}
return ''.$link.' ';
+ ($target?' target="$target"':'').' title="'.&mt("View this user's personal page").'">'.$link.'';
}
# ------------------------------------------------------------ Syllabus Wrapper
sub syllabuswrapper {
- my ($linktext,$coursedir,$domain,$fontcolor)=@_;
- if ($fontcolor) {
- $linktext=''.$linktext.' ';
- }
+ my ($linktext,$coursedir,$domain)=@_;
return qq{$linktext };
}
sub track_student_link {
- my ($linktext,$sname,$sdom,$target,$start,$only_body) = @_;
+ my ($linktext,$sname,$sdom,$target,$start) = @_;
my $link ="/adm/trackstudent?";
my $title = 'View recent activity';
if (defined($sname) && $sname !~ /^\s*$/ &&
@@ -3065,34 +2787,12 @@ sub track_student_link {
$target = '';
}
if ($start) { $link.='&start='.$start; }
- if ($only_body) { $link .= '&only_body=1'; }
$title = &mt($title);
$linktext = &mt($linktext);
return qq{$linktext }.
&help_open_topic('View_recent_activity');
}
-sub slot_reservations_link {
- my ($linktext,$sname,$sdom,$target) = @_;
- my $link ="/adm/slotrequest?command=showresv&origin=aboutme";
- my $title = 'View slot reservation history';
- if (defined($sname) && $sname !~ /^\s*$/ &&
- defined($sdom) && $sdom !~ /^\s*$/) {
- $link .= "&uname=$sname&udom=$sdom";
- $title .= ' of this student';
- }
- if (defined($target) && $target !~ /^\s*$/) {
- $target = qq{target="$target"};
- } else {
- $target = '';
- }
- $title = &mt($title);
- $linktext = &mt($linktext);
- return qq{$linktext };
-# FIXME uncomment when help item created: &help_open_topic('Slot_Reservation_History');
-
-}
-
# ===================================================== Display a student photo
@@ -3330,28 +3030,6 @@ sub languages {
return $preferred_possibilities[0];
}
-sub user_lang {
- my ($touname,$toudom,$fromcid) = @_;
- my @userlangs;
- if (($fromcid ne '') && ($env{'course.'.$fromcid.'.languages'} ne '')) {
- @userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/,
- $env{'course.'.$fromcid.'.languages'}));
- } else {
- my %langhash = &getlangs($touname,$toudom);
- if ($langhash{'languages'} ne '') {
- @userlangs = split(/\s*(\,|\;|\:)\s*/,$langhash{'languages'});
- } else {
- my %domdefs = &Apache::lonnet::get_domain_defaults($toudom);
- if ($domdefs{'lang_def'} ne '') {
- @userlangs = ($domdefs{'lang_def'});
- }
- }
- }
- my @languages=&Apache::lonlocal::get_genlanguages(@userlangs);
- my $user_lh = Apache::localize->get_handle(@languages);
- return $user_lh;
-}
-
###############################################################
## Student Answer Attempts ##
###############################################################
@@ -3737,13 +3415,10 @@ sub findallcourses {
$udom = $env{'user.domain'};
}
if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname,'.',undef,
- $extra);
+ my %roleshash = &Apache::lonnet::dump('roles',$udom,$uname);
if (!%roles) {
%roles = (
cc => 1,
- co => 1,
in => 1,
ep => 1,
ta => 1,
@@ -4070,7 +3745,7 @@ sub blocking_status {
&Apache::lonnet::coursedescription($course);
$coursedesc = $courseinfo{'description'};
}
- $category = "Group portfolio files in the course '$coursedesc'";
+ $category = "Group files in the course '$coursedesc'";
} else {
$category = 'Portfolio files belonging to ';
if ($env{'user.name'} eq 'public' &&
@@ -4173,7 +3848,7 @@ sub determinedomain {
my $domain=shift;
if (! $domain) {
# Determine domain if we have not been given one
- $domain = &Apache::lonnet::default_login_domain();
+ $domain = $Apache::lonnet::perlvar{'lonDefDomain'};
if ($env{'user.domain'}) { $domain=$env{'user.domain'}; }
if ($env{'request.role.domain'}) {
$domain=$env{'request.role.domain'};
@@ -4196,39 +3871,16 @@ sub get_domainconf {
if (defined($cached)) { return %{$result}; }
my %domconfig = &Apache::lonnet::get_dom('configuration',
- ['login','rolecolors','loginvia'],$udom);
+ ['login','rolecolors'],$udom);
my (%designhash,%legacy);
if (keys(%domconfig) > 0) {
if (ref($domconfig{'login'}) eq 'HASH') {
if (keys(%{$domconfig{'login'}})) {
foreach my $key (keys(%{$domconfig{'login'}})) {
if (ref($domconfig{'login'}{$key}) eq 'HASH') {
- if ($key eq 'loginvia') {
- if (ref($domconfig{'login'}{'loginvia'}) eq 'HASH') {
- my @ids = &Apache::lonnet::current_machine_ids();
- foreach my $hostname (@ids) {
- if (ref($domconfig{'login'}{'loginvia'}{$hostname}) eq 'HASH') {
- if ($domconfig{'login'}{'loginvia'}{$hostname}{'server'}) {
- my $server = $domconfig{'login'}{'loginvia'}{$hostname}{'server'};
- $designhash{$udom.'.login.loginvia'} = $server;
- if ($domconfig{'login'}{'loginvia'}{$hostname}{'serverpath'} eq 'custom') {
-
- $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'custompath'};
- } else {
- $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'serverpath'};
- }
- if ($domconfig{'login'}{'loginvia'}{$hostname}{'exempt'}) {
- $designhash{$udom.'.login.loginvia_exempt_'.$hostname} = $domconfig{'login'}{'loginvia'}{$hostname}{'exempt'};
- }
- }
- }
- }
- }
- } else {
- foreach my $img (keys(%{$domconfig{'login'}{$key}})) {
- $designhash{$udom.'.login.'.$key.'_'.$img} =
- $domconfig{'login'}{$key}{$img};
- }
+ foreach my $img (keys(%{$domconfig{'login'}{$key}})) {
+ $designhash{$udom.'.login.'.$key.'_'.$img} =
+ $domconfig{'login'}{$key}{$img};
}
} else {
$designhash{$udom.'.login.'.$key}=$domconfig{'login'}{$key};
@@ -4255,11 +3907,6 @@ sub get_domainconf {
} else {
$legacy{'rolecolors'} = 1;
}
- if (ref($domconfig{'autoenroll'}) eq 'HASH') {
- if ($domconfig{'autoenroll'}{'co-owners'}) {
- $designhash{$udom.'.autoassign.co-owners'}=$domconfig{'autoenroll'}{'co-owners'};
- }
- }
if (keys(%legacy) > 0) {
my %legacyhash = &get_legacy_domconf($udom);
foreach my $item (keys(%legacyhash)) {
@@ -4459,7 +4106,7 @@ sub bodytag {
my $font = &designparm($function.'.font',$domain);
my $pgbg = $bgcolor || &designparm($function.'.pgbg',$domain);
- my %design = ( 'style' => 'margin-top: 0',
+ my %design = ( 'style' => 'margin-top: 0px',
'bgcolor' => $pgbg,
'text' => $font,
'alink' => &designparm($function.'.alink',$domain),
@@ -4570,7 +4217,7 @@ ENDROLE
.''.&mt('Construction Space').' : '
.''
.&Apache::lonmenu::constspaceform();
@@ -4744,11 +4391,15 @@ sub standard_css {
my $vlink = &designparm($function.'.vlink', $domain);
my $link = &designparm($function.'.link', $domain);
+ my $loginbg = &designparm('login.sidebg',$domain);
+ my $bgcol = &designparm('login.bgcol',$domain);
+ my $textcol = &designparm('login.textcol',$domain);
+
my $sans = 'Verdana,Arial,Helvetica,sans-serif';
my $mono = 'monospace';
my $data_table_head = $tabbg;
- my $data_table_light = '#FAFAFA';
- my $data_table_dark = '#F0F0F0';
+ my $data_table_light = '#EEEEEE';
+ my $data_table_dark = '#DDDDDD';
my $data_table_darker = '#CCCCCC';
my $data_table_highlight = '#FFFF00';
my $mail_new = '#FFBB77';
@@ -4761,31 +4412,52 @@ sub standard_css {
my $mail_other_hover = '#669999';
my $table_header = '#DDDDDD';
my $feedback_link_bg = '#BBBBBB';
- my $lg_border_color = '#C8C8C8';
+ my $lg_border_color = '#C8C8C8';
my $border = ($env{'browser.type'} eq 'explorer' ||
- $env{'browser.type'} eq 'safari' ) ? '0 2px 0 2px'
- : '0 3px 0 4px';
+ $env{'browser.type'} eq 'safari' ) ? '0px 2px 0px 2px'
+ : '0px 3px 0px 4px';
return < td {
- background-color: #CCCCCC;
+ background-color: #CCC;
font-weight: bold;
text-align: left;
}
@@ -5101,27 +4738,19 @@ table.LC_data_table tr td.LC_leftcol_hea
}
table.LC_data_table tr.LC_empty_row td,
table.LC_nested tr.LC_empty_row td {
+ background-color: #FFFFFF;
font-weight: bold;
font-style: italic;
text-align: center;
padding: 8px;
}
-
-table.LC_data_table tr.LC_empty_row td {
- background-color: $tabbg;
-}
-
-table.LC_nested tr.LC_empty_row td {
- background-color: #FFFFFF;
-}
-
table.LC_nested tr.LC_empty_row td {
padding: 4ex
}
table.LC_nested_outer tr th {
font-weight: bold;
background-color: $data_table_head;
- font-size: smaller;
+ font-size: small;
border-bottom: 1px solid #000000;
}
table.LC_nested_outer tr td.LC_subheader {
@@ -5132,7 +4761,7 @@ table.LC_nested_outer tr td.LC_subheader
text-align: right;
}
table.LC_nested tr.LC_info_row td {
- background-color: #CCCCCC;
+ background-color: #CCC;
font-weight: bold;
font-size: small;
text-align: center;
@@ -5142,7 +4771,7 @@ table.LC_nested_outer tr th.LC_left_item
text-align: left;
}
table.LC_nested td {
- background-color: #FFFFFF;
+ background-color: #FFF;
font-size: small;
}
table.LC_nested_outer tr th.LC_right_item,
@@ -5153,18 +4782,18 @@ table.LC_nested tr td.LC_right_item {
}
table.LC_nested tr.LC_odd_row td {
- background-color: #EEEEEE;
+ background-color: #EEE;
}
table.LC_createuser {
}
table.LC_createuser tr.LC_section_row td {
- font-size: smaller;
+ font-size: small;
}
table.LC_createuser tr.LC_info_row td {
- background-color: #CCCCCC;
+ background-color: #CCC;
font-weight: bold;
text-align: center;
}
@@ -5216,91 +4845,23 @@ table.LC_mail_list tr.LC_mail_even {
table.LC_mail_list tr.LC_mail_odd {
}
-
-table#LC_portfolio_actions {
- width: auto;
- background: $pgbg;
- border: none;
- border-spacing: 2px 2px;
- padding: 0;
- margin: 0;
- border-collapse: separate;
-}
-table#LC_portfolio_actions td.LC_label {
- background: $tabbg;
- text-align: right;
-}
-table#LC_portfolio_actions td.LC_value {
- background: $tabbg;
-}
-
-table#LC_cstr_controls {
- width: 100%;
- border-collapse: collapse;
-}
-table#LC_cstr_controls tr td {
- border: 4px solid $pgbg;
- padding: 4px;
- text-align: center;
- background: $tabbg;
-}
-table#LC_cstr_controls tr th {
- border: 4px solid $pgbg;
- background: $table_header;
- text-align: center;
- font-family: $sans;
- font-size: smaller;
-}
-
-table#LC_browser {
-
-}
-table#LC_browser tr th {
- background: $table_header;
-}
-table#LC_browser tr td {
- padding: 2px;
-}
-table#LC_browser tr.LC_browser_file,
-table#LC_browser tr.LC_browser_file_published {
- background: #CCFF88;
-}
-table#LC_browser tr.LC_browser_file_locked,
-table#LC_browser tr.LC_browser_file_unpublished {
- background: #FFAA99;
-}
-table#LC_browser tr.LC_browser_file_obsolete {
- background: #AAAAAA;
-}
-table#LC_browser tr.LC_browser_file_modified,
-table#LC_browser tr.LC_browser_file_metamodified {
- background: #FFFF77;
-}
-table#LC_browser tr.LC_browser_folder {
- background: #CCCCFF;
-}
-
table.LC_data_table tr > td.LC_browser_file,
table.LC_data_table tr > td.LC_browser_file_published {
- background: #AAEE77;
+ background: #CCFF88;
}
-
table.LC_data_table tr > td.LC_browser_file_locked,
table.LC_data_table tr > td.LC_browser_file_unpublished {
background: #FFAA99;
}
-
table.LC_data_table tr > td.LC_browser_file_obsolete {
- background: #888888;
+ background: #AAAAAA;
}
-
table.LC_data_table tr > td.LC_browser_file_modified,
table.LC_data_table tr > td.LC_browser_file_metamodified {
- background: #F8F866;
+ background: #FFFF77;
}
-
table.LC_data_table tr.LC_browser_folder > td {
- background: #E0E8FF;
+ background: #CCCCFF;
}
table.LC_data_table tr > td.LC_roles_is {
@@ -5323,7 +4884,7 @@ table.LC_data_table tr > td.LC_roles_sel
}
span.LC_current_location {
- font-size: x-large;
+ font-size:larger;
background: $pgbg;
}
@@ -5367,9 +4928,9 @@ table.LC_parm_overview_restrictions th {
border-color: $pgbg;
}
table#LC_helpmenu {
- border: none;
+ border: 0px;
height: 55px;
- border-spacing: 0;
+ border-spacing: 0px;
}
table#LC_helpmenu fieldset legend {
@@ -5380,7 +4941,7 @@ table#LC_helpmenu_links {
width: 100%;
border: 1px solid black;
background: $pgbg;
- padding: 0;
+ padding: 0px;
border-spacing: 1px;
}
table#LC_helpmenu_links tr td {
@@ -5422,7 +4983,6 @@ table.LC_pick_box td.LC_pick_box_title {
background: $tabbg;
font-weight: bold;
text-align: right;
- vertical-align: top;
width: 184px;
padding: 8px;
}
@@ -5443,7 +5003,7 @@ table.LC_pick_box td.LC_pick_box_select
padding: 8px;
}
table.LC_pick_box td.LC_pick_box_separator {
- padding: 0;
+ padding: 0px;
height: 1px;
background: black;
}
@@ -5485,7 +5045,7 @@ table.LC_helpform_receipt td.LC_oddrow_v
background-color: $data_table_light;
}
table.LC_helpform_receipt td.LC_pick_box_separator {
- padding: 0;
+ padding: 0px;
height: 1px;
background: black;
}
@@ -5518,7 +5078,7 @@ table.LC_group_priv_box td.LC_groups_fun
}
table.LC_group_priv td {
text-align: left;
- padding: 0;
+ padding: 0px;
}
table.LC_notify_front_page {
@@ -5539,7 +5099,6 @@ table.LC_notify_front_page td {
background: $tabbg;
vertical-align: middle;
margin: 2ex 0ex 2ex 0ex;
- padding: 3px;
}
.LC_topic_bar span {
vertical-align: middle;
@@ -5641,7 +5200,7 @@ table.LC_prior_match tr td {
border: 1px solid #000000;
}
-.LC_nobreak {
+span.LC_nobreak {
white-space: nowrap;
}
@@ -5656,7 +5215,7 @@ span.LC_cusr_subheading {
table.LC_docs_documents {
background: #BBBBBB;
- border-width: 0;
+ border-width: 0px;
border-collapse: collapse;
}
@@ -5673,7 +5232,7 @@ table.LC_docs_documents td.LC_docs_docum
}
.LC_docs_entry_move {
- border: none;
+ border: 0px;
border-collapse: collapse;
}
@@ -5729,7 +5288,7 @@ table.LC_sty_end {
}
table.LC_double_column {
- border-width: 0;
+ border-width: 0px;
border-collapse: collapse;
width: 100%;
padding: 2px;
@@ -5769,23 +5328,6 @@ div.LC_clear_float_footer {
}
-div.LC_grade_select_mode {
- font-family: $sans;
-}
-div.LC_grade_select_mode div div {
- margin: 5px;
-}
-div.LC_grade_select_mode_selector {
- margin: 5px;
- float: left;
-}
-div.LC_grade_select_mode_selector_header {
- font: bold medium $sans;
-}
-div.LC_grade_select_mode_type {
- clear: left;
-}
-
div.LC_grade_show_user {
margin-top: 20px;
border: 1px solid black;
@@ -5793,7 +5335,8 @@ div.LC_grade_show_user {
div.LC_grade_user_name {
background: #DDDDEE;
border-bottom: 1px solid black;
- font: bold large $sans;
+ font-weight: bold;
+ font-size: large;
}
div.LC_grade_show_user_odd_row div.LC_grade_user_name {
background: #DDEEDD;
@@ -5812,7 +5355,8 @@ div.LC_grade_show_problem_header,
div.LC_grade_submissions_header,
div.LC_grade_message_center_header,
div.LC_grade_assign_header {
- font: bold large $sans;
+ font-weight: bold;
+ font-size: large;
}
div.LC_grade_show_problem_problem,
div.LC_grade_submissions_body,
@@ -5823,7 +5367,8 @@ div.LC_grade_assign_body {
background: #FFFFFF;
}
span.LC_grade_check_note {
- font: normal medium $sans;
+ font-weight: normal;
+ font-size: medium;
display: inline;
position: absolute;
right: 1em;
@@ -5833,12 +5378,13 @@ table.LC_scantron_action {
width: 100%;
}
table.LC_scantron_action tr th {
- font: normal bold $sans;
+ font-weight:bold;
+ font-style:normal;
}
-
-div.LC_edit_problem_header,
+.LC_edit_problem_header,
div.LC_edit_problem_footer {
- font: normal medium $sans;
+ font-weight: normal;
+ font-size: medium;
margin: 2px;
}
div.LC_edit_problem_header,
@@ -5855,12 +5401,14 @@ div.LC_edit_problem_header_edit_row {
margin-bottom: 5px;
}
div.LC_edit_problem_header_title {
- font: larger bold $sans;
+ font-weight: bold;
+ font-size: larger;
background: $tabbg;
padding: 3px;
}
table.LC_edit_problem_header_title {
- font: larger bold $sans;
+ font-size: larger;
+ font-weight: bold;
width: 100%;
border-color: $pgbg;
border-style: solid;
@@ -5868,7 +5416,7 @@ table.LC_edit_problem_header_title {
background: $tabbg;
border-collapse: collapse;
- padding: 0;
+ padding: 0px
}
div.LC_edit_problem_discards {
@@ -5884,7 +5432,7 @@ hr.LC_edit_problem_divide {
color: $tabbg;
background-color: $tabbg;
height: 3px;
- border: none;
+ border: 0px;
}
img.stift{
border-width:0;
@@ -5908,15 +5456,367 @@ table#LC_mainmenu td.LC_mainmenu_col_fie
font-size: small;
font-weight: bold;
}
-fieldset#LC_mainmenu_fieldset {
- margin:0 10px 10px 0;
-
-}
div.LC_createcourse {
margin: 10px 10px 10px 10px;
}
+/* ---- Remove when done ----
+# The following styles is part of the redesign of LON-CAPA and are
+# subject to change during this project.
+# Don't rely on their current functionality as they might be
+# changed or removed.
+# --------------------------*/
+
+a:hover,
+ol.LC_smallMenu a:hover,
+ol#LC_MenuBreadcrumbs a:hover,
+ol#LC_PathBreadcrumbs a:hover,
+ul#LC_TabMainMenuContent a:hover,
+.LC_FormSectionClearButton input:hover
+ul.LC_TabContent li:hover a{
+ color:#BF2317;
+ text-decoration:none;
+}
+
+h1 {
+ padding:5px 10px 5px 20px;
+ line-height:130%;
+}
+
+h2,h3,h4,h5,h6
+{
+ margin:5px 0px 5px 0px;
+ padding:0px;
+ line-height:130%;
+}
+.LC_hcell{
+ padding:3px 15px 3px 15px;
+ margin:0px;
+ background-color:$tabbg;
+ border-bottom:solid 1px $lg_border_color;
+}
+.LC_noBorder {
+ border:0px;
+}
+
+.LC_bgLightGrey{
+ background:URL(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
+}
+.LC_bgLightGreyYellow {
+ background-color:#EFECE0;
+}
+
+/* Main Header with discription of Person, Course, etc. */
+.LC_HeadRight {
+ text-align: right;
+ float: right;
+ margin: 0px;
+ padding: 0px;
+ right:0;
+ position:absolute;
+ overflow:hidden;
+}
+
+p, .LC_ContentBox {
+ padding: 10px;
+
+}
+.LC_FormSectionClearButton input {
+
+ border:0px;
+ cursor:pointer;
+ text-decoration:underline;
+}
+
+
+dl,ul,div,fieldset {
+ margin: 10px 10px 10px 0px;
+ overflow:hidden;
+}
+ol.LC_smallMenu, ol#LC_PathBreadcrumbs {
+ margin: 0px;
+}
+
+ol.LC_smallMenu li {
+ display: inline;
+ padding: 5px 5px 0px 10px;
+ vertical-align: top;
+}
+
+ol.LC_smallMenu li img {
+ vertical-align: bottom;
+}
+
+ol.LC_smallMenu a {
+ font-size: 90%;
+ color: RGB(80, 80, 80);
+ text-decoration: none;
+}
+
+ol#LC_TabMainMenuContent {
+ display:block;
+ list-style:none;
+ margin: 0px 0px 10px 0px;
+ padding: 0px;
+}
+
+ol#LC_TabMainMenuContent li {
+ display: inline;
+ vertical-align: bottom;
+ border-bottom: solid 1px RGB(175, 175, 175);
+ border-right: solid 1px RGB(175, 175, 175);
+ padding: 5px 10px 5px 10px;
+ margin-right:3px;
+ line-height: 140%;
+ font-weight: bold;
+ white-space:nowrap;
+ background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
+}
+
+ol#LC_TabMainMenuContent li a{
+ color: RGB(47, 47, 47);
+ text-decoration: none;
+}
+ul.LC_TabContent {
+ margin:0px;
+ padding:0px;
+ display:block;
+ list-style:none;
+ min-height:1.5em;
+}
+ul.LC_TabContent li{
+ display:inline;
+ vertical-align:top;
+ border-bottom:solid 1px $lg_border_color;
+ border-right:solid 1px $lg_border_color;
+ padding:5px 10px 5px 10px;
+ margin-right:2px;
+ background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
+}
+ul.LC_TabContent li a, ul.LC_TabContent li{
+ color:rgb(47,47,47);
+ text-decoration:none;
+ font-size:95%;
+ font-weight:bold;
+ white-space:nowrap;
+}
+.LC_hideThis
+{
+ display:none;
+ visibility:hidden;
+}
+
+ol#LC_MenuBreadcrumbs, ol#LC_PathBreadcrumbs {
+ border-top: solid 1px RGB(255, 255, 255);
+ height: 20px;
+ line-height: 20px;
+ vertical-align: bottom;
+ margin: 0px 0px 30px 0px;
+ padding-left: 10px;
+ list-style-position: inside;
+ background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
+}
+
+ol#LC_MenuBreadcrumbs li, ol#LC_PathBreadcrumbs li {
+ background: url(/adm/lonIcons/arrow_white.png) no-repeat left center;
+ display: inline;
+ padding: 0px 0px 0px 10px;
+ vertical-align: bottom;
+ overflow:hidden;
+}
+
+ol#LC_MenuBreadcrumbs li a {
+ text-decoration: none;
+ font-size:90%;
+}
+ol#LC_PathBreadcrumbs li a{
+ text-decoration:none;
+ font-size:100%;
+ font-weight:bold;
+}
+.LC_ContentBoxSpecial
+{
+ border: solid 1px $lg_border_color;
+}
+.LC_PopUp
+{
+ padding:10px;
+ border-left:solid 1px $lg_border_color;
+ border-top:solid 1px $lg_border_color;
+ border-bottom:outset 1px $lg_border_color;
+ border-right:outset 1px $lg_border_color;
+ display:none;
+ position:absolute;
+ right:0;
+ background-color:white;
+ z-index:5;
+}
+
+dl.LC_ListStyleClean dt {
+ padding-right: 5px;
+ display: table-header-group;
+}
+
+dl.LC_ListStyleClean dd {
+ display: table-row;
+}
+
+.LC_ListStyleClean,
+.LC_ListStyleSimple,
+.LC_ListStyleNormal,
+.LC_ListStyleNormal_Border,
+.LC_ListStyleSpecial
+ {
+ /*display:block; */
+ list-style-position: inside;
+ list-style-type: none;
+ overflow: hidden;
+ padding: 0px;
+}
+
+.LC_ListStyleSimple li,
+.LC_ListStyleSimple dd,
+.LC_ListStyleNormal li,
+.LC_ListStyleNormal dd,
+.LC_ListStyleSpecial li,
+.LC_ListStyleSpecial dd
+ {
+ margin: 0px;
+ padding: 5px 5px 5px 10px;
+ clear: both;
+}
+
+.LC_ListStyleClean li,
+.LC_ListStyleClean dd {
+ padding-top: 0px;
+ padding-bottom: 0px;
+}
+
+.LC_ListStyleSimple dd,
+.LC_ListStyleSimple li{
+ border-bottom: solid 1px $lg_border_color;
+}
+
+.LC_ListStyleSpecial li,
+.LC_ListStyleSpecial dd {
+ list-style-type: none;
+ background-color: RGB(220, 220, 220);
+ margin-bottom: 4px;
+}
+
+table.LC_SimpleTable {
+ margin:5px;
+ border:solid 1px $lg_border_color;
+ }
+
+table.LC_SimpleTable tr {
+ padding:0px;
+ border:solid 1px $lg_border_color;
+}
+table.LC_SimpleTable thead{
+ background:rgb(220,220,220);
+}
+
+div.LC_columnSection {
+ display: block;
+ clear: both;
+ overflow: hidden;
+ margin:0px;
+}
+
+div.LC_columnSection>* {
+ float: left;
+ margin: 10px 20px 10px 0px;
+ overflow:hidden;
+}
+div.LC_columnSection > .LC_ContentBox,
+div.LC_columnSection > .LC_ContentBoxSpecial
+ {
+ width: 400px;
+}
+
+.ContentBoxSpecialTemplate
+{
+ border: solid 1px $lg_border_color;
+}
+.ContentBoxTemplate {
+ padding:10px;
+}
+
+div.LC_columnSection > .ContentBoxTemplate,
+div.LC_columnSection > .ContentBoxSpecialTemplate
+ {
+ width: 600px;
+
+}
+
+.clear{
+ clear: both;
+ line-height: 0px;
+ font-size: 0px;
+ height: 0px;
+}
+
+.LC_loginpage_container {
+ text-align:left;
+ margin : 0 auto;
+ width:65%;
+ padding: 10px;
+ height: auto;
+ background-color:#FFFFFF;
+ border:1px solid #CCCCCC;
+}
+
+
+.LC_loginpage_loginContainer {
+ float:left;
+ width: 182px;
+ border:1px solid #CCCCCC;
+ background-color:$loginbg;
+}
+
+.LC_loginpage_loginContainer h2{
+ margin-top:0;
+ display:block;
+ background:$bgcol;
+ color:$textcol;
+ padding-left:5px;
+}
+.LC_loginpage_loginInfo {
+ margin-left:20px;
+ float:left;
+ width:30%;
+ border:1px solid #CCCCCC;
+ padding:10px;
+}
+
+.LC_loginpage_loginDomain {
+ margin-right:20px;
+ width:20%;
+ float:left;
+ padding:10px;
+}
+
+.LC_loginpage_space {
+ clear:both;
+ margin-bottom:20px;
+ border-bottom: 1px solid #CCCCCC;
+}
+
+.LC_loginpage_fieldset{
+ border: 1px solid #CCCCCC;
+ margin: 0 auto;
+}
+
+.LC_loginpage_legend{
+ padding: 2px;
+ margin: 0px;
+ font-size:14px;
+ font-weight:bold;
+}
+
+
END
}
@@ -6044,8 +5944,7 @@ sub xml_begin {
.'';
} else {
- $output=''.
- '';
+ $output='';
}
return $output;
}
@@ -6181,31 +6080,26 @@ sub start_page {
}
if ($args->{'js_ready'}) {
- $result = &js_ready($result);
+ $result = &js_ready($result);
}
if ($args->{'html_encode'}) {
- $result = &html_encode($result);
+ $result = &html_encode($result);
}
- #Breadcrumbs
- if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {
+
+ if (exists($args->{'bread_crumbs'})) {
&Apache::lonhtmlcommon::clear_breadcrumbs();
- #if any br links exists, add them to the breadcrumbs
- if (exists($args->{'bread_crumbs'}) and ref($args->{'bread_crumbs'}) eq 'ARRAY') {
+ if (ref($args->{'bread_crumbs'}) eq 'ARRAY') {
foreach my $crumb (@{$args->{'bread_crumbs'}}){
&Apache::lonhtmlcommon::add_breadcrumb($crumb);
}
}
-
- #if bread_crumbs_component exists show it as headline else show only the breadcrumbs
- if (exists($args->{'bread_crumbs_component'})){
- $result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'});
- } else {
- $result .= &Apache::lonhtmlcommon::breadcrumbs();
- }
+ $result .= &Apache::lonhtmlcommon::breadcrumbs();
}
+
return $result;
}
+
=pod
=item * &head()
@@ -6348,7 +6242,7 @@ sub simple_error_page {
}
sub start_data_table_empty_row {
- $row_count[0]++;
+# $row_count[0]++;
return ''."\n";;
}
@@ -6430,13 +6324,13 @@ Returns either 'student','coordinator','
###############################################
sub get_users_function {
my $function = 'student';
- if ($env{'request.role'}=~/^(cc|co|in|ta|ep)/) {
+ if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
$function='coordinator';
}
if ($env{'request.role'}=~/^(su|dc|ad|li)/) {
$function='admin';
}
- if (($env{'request.role'}=~/^(au|ca|aa)/) ||
+ if (($env{'request.role'}=~/^(au|ca)/) ||
($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) {
$function='author';
}
@@ -6447,37 +6341,6 @@ sub get_users_function {
=pod
-=item * &show_course()
-
-Used by lonmenu.pm and lonroles.pm to determine whether to use the word
-'Courses' or 'Roles' in inline navigation and on screen displaying user's roles.
-Inputs:
-None
-
-Outputs:
-Scalar: 1 if 'Course' to be used, 0 otherwise.
-
-=cut
-
-###############################################
-sub show_course {
- my $course = !$env{'user.adv'};
- if (!$env{'user.adv'}) {
- foreach my $env (keys(%env)) {
- next if ($env !~ m/^user\.priv\./);
- if ($env !~ m/^user\.priv\.(?:st|cm)/) {
- $course = 0;
- last;
- }
- }
- }
- return $course;
-}
-
-###############################################
-
-=pod
-
=item * &check_user_status()
Determines current status of supplied role for a
@@ -6494,14 +6357,13 @@ role status: active, previous or future.
sub check_user_status {
my ($udom,$uname,$cdom,$crs,$role,$sec) = @_;
- my $extra = &Apache::lonnet::freeze_escape({'skipcheck' => 1});
- my %userinfo = &Apache::lonnet::dump('roles',$udom,$uname,'.',undef,$extra);
+ my %userinfo = &Apache::lonnet::dump('roles',$udom,$uname);
my @uroles = keys %userinfo;
my $srchstr;
my $active_chk = 'none';
my $now = time;
if (@uroles > 0) {
- if (($role eq 'cc') || ($role eq 'co') || ($sec eq '') || (!defined($sec))) {
+ if (($role eq 'cc') || ($sec eq '') || (!defined($sec))) {
$srchstr = '/'.$cdom.'/'.$crs.'_'.$role;
} else {
$srchstr = '/'.$cdom.'/'.$crs.'/'.$sec.'_'.$role;
@@ -6982,8 +6844,6 @@ If the user's status includes multiple t
the largest default quota which applies to the user determines the
default quota returned.
-=back
-
=cut
###############################################
@@ -6996,7 +6856,7 @@ sub default_quota {
['quotas'],$udom);
if (ref($quotahash{'quotas'}) eq 'HASH') {
if ($inststatus ne '') {
- my @statuses = map { &unescape($_); } split(/:/,$inststatus);
+ my @statuses = split(/:/,$inststatus);
foreach my $item (@statuses) {
if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {
if ($quotahash{'quotas'}{'defaultquota'}{$item} ne '') {
@@ -7132,7 +6992,6 @@ sub user_picker {
# loncreateuser::print_user_query_page()
# has been completed.
next if ($option eq 'alc');
- next if (($option eq 'crs') && ($env{'form.form'} eq 'requestcrs'));
next if ($option eq 'crs' && !$env{'request.course.id'});
if ($curr_selected{'srchin'} eq $option) {
$srchinsel .= '
@@ -7176,14 +7035,12 @@ sub user_picker {
if ($cancreate) {
$new_user_create = ' &"').'" onclick="javascript:setSearch(\'1\','.$caller.');" />
';
} else {
- my $helplink = 'javascript:helpMenu('."'display'".')';
+ my $helplink = ' href="javascript:helpMenu('."'display'".')"';
my %usertypetext = (
official => 'institutional',
unofficial => 'non-institutional',
);
- $new_user_create = ''.
- &mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.").' '.
- &mt('Please contact the [_1]helpdesk[_2] for assistance.','',' ').'
';
+ $new_user_create = ''.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.").' '.&mt('Contact the helpdesk for assistance.',$helplink).' ';
}
}
}
@@ -7220,7 +7077,6 @@ ENDSCRIPT
my $output = <<"END_BLOCK";
$new_user_create
+
+
END_BLOCK
- $output .= &Apache::lonhtmlcommon::start_pick_box().
- &Apache::lonhtmlcommon::row_title($lt{'doma'}).
- $domform.
- &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title($lt{'usr'}).
- $srchbysel.
- $srchtypesel.
- ' '.
- $srchinsel.
- &Apache::lonhtmlcommon::row_closure(1).
- &Apache::lonhtmlcommon::end_pick_box().
- ' ';
return $output;
}
@@ -7463,7 +7322,6 @@ sub personal_data_fieldtitles {
middlename => 'Middle Name',
generation => 'Generation',
gen => 'Generation',
- inststatus => 'Affiliation',
);
return %fieldtitles;
}
@@ -7533,56 +7391,8 @@ sub get_institutional_codes {
=pod
-=head1 Slot Helpers
-
-=over 4
-
-=item * sorted_slots()
-
-Sorts an array of slot names in order of slot start time (earliest first).
-
-Inputs:
-
-=over 4
-
-slotsarr - Reference to array of unsorted slot names.
-
-slots - Reference to hash of hash, where outer hash keys are slot names.
-
-=back
-
-Returns:
-
-=over 4
-
-sorted - An array of slot names sorted by the start time of the slot.
-
-=back
-
=back
-=cut
-
-
-sub sorted_slots {
- my ($slotsarr,$slots) = @_;
- my @sorted;
- if ((ref($slotsarr) eq 'ARRAY') && (ref($slots) eq 'HASH')) {
- @sorted =
- sort {
- if (ref($slots->{$a}) && ref($slots->{$b})) {
- return $slots->{$a}{'starttime'} <=> $slots->{$b}{'starttime'}
- }
- if (ref($slots->{$a})) { return -1;}
- if (ref($slots->{$b})) { return 1;}
- return 0;
- } @{$slotsarr};
- }
- return @sorted;
-}
-
-=pod
-
=head1 HTTP Helpers
=over 4
@@ -7872,9 +7682,9 @@ sub upload_embedded {
' '.
$orig_uploaded_filename.' ';
} else {
- $output .= ''.
+ $output .= ''.
&mt('View embedded file: [_1]',''.
- $orig_uploaded_filename.' ').' ';
+ $orig_uploaded_filename.'').' ';
}
}
close($fh);
@@ -8179,8 +7989,7 @@ sub csv_print_samples {
$r->print(&mt('Samples').' '.&start_data_table().
&start_data_table_header_row());
foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) {
- $r->print(''.&mt('Column [_1]',($sample+1)).' ');
- }
+ $r->print(''.&mt('Column [_1]',($sample+1)).' '); }
$r->print(&end_data_table_header_row());
foreach my $hash (@$samples) {
$r->print(&start_data_table_row());
@@ -8222,9 +8031,9 @@ sub csv_print_select_table {
&end_data_table_header_row()."\n");
foreach my $array_ref (@$d) {
my ($value,$display,$defaultcol)=@{ $array_ref };
- $r->print(&start_data_table_row().''.$display.' ');
+ $r->print(&start_data_table_row().' '.$display.' ');
- $r->print('print('');
$r->print(' ');
foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) {
@@ -8878,11 +8687,9 @@ sub restore_settings {
=item * &build_recipient_list()
-Build recipient lists for five types of e-mail:
-(a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors
-(d) Help requests, (e) Course requests needing approval, generated by
-lonerrorhandler.pm, CHECKRPMS, loncron, lonsupportreq.pm and
-loncoursequeueadmin.pm respectively.
+Build recipient lists for three types of e-mail:
+(a) Error Reports, (b) Package Updates, (c) Help requests, generated by
+lonerrorhandler.pm, CHECKRPMS and lonsupportreq.pm respectively.
Inputs:
defmail (scalar - email address of default recipient),
@@ -8906,21 +8713,17 @@ sub build_recipient_list {
my %domconfig =
&Apache::lonnet::get_dom('configuration',['contacts'],$defdom);
if (ref($domconfig{'contacts'}) eq 'HASH') {
- if (exists($domconfig{'contacts'}{$mailing})) {
- if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') {
- my @contacts = ('adminemail','supportemail');
- foreach my $item (@contacts) {
- if ($domconfig{'contacts'}{$mailing}{$item}) {
- my $addr = $domconfig{'contacts'}{$item};
- if (!grep(/^\Q$addr\E$/,@recipients)) {
- push(@recipients,$addr);
- }
+ if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') {
+ my @contacts = ('adminemail','supportemail');
+ foreach my $item (@contacts) {
+ if ($domconfig{'contacts'}{$mailing}{$item}) {
+ my $addr = $domconfig{'contacts'}{$item};
+ if (!grep(/^\Q$addr\E$/,@recipients)) {
+ push(@recipients,$addr);
}
- $otheremails = $domconfig{'contacts'}{$mailing}{'others'};
}
+ $otheremails = $domconfig{'contacts'}{$mailing}{'others'};
}
- } elsif ($origmail ne '') {
- push(@recipients,$origmail);
}
} elsif ($origmail ne '') {
push(@recipients,$origmail);
@@ -9052,8 +8855,6 @@ sub extract_categories {
my $trailstr;
if ($name eq 'instcode') {
$trailstr = &mt('Official courses (with institutional codes)');
- } elsif ($name eq 'communities') {
- $trailstr = &mt('Communities');
} else {
$trailstr = $name;
}
@@ -9164,16 +8965,14 @@ Inputs:
cathash - reference to hash of categories defined for the domain (from
configuration.db)
-currcat - scalar with an & separated list of categories assigned to a course.
-
-type - scalar contains course type (Course or Community).
+currcat - scalar with an & separated list of categories assigned to a course.
Returns: $output (markup to be displayed)
=cut
sub assign_categories_table {
- my ($cathash,$currcat,$type) = @_;
+ my ($cathash,$currcat) = @_;
my $output;
if (ref($cathash) eq 'HASH') {
my (@cats,@trails,%allitems,%idx,@jsarray,@path,$maxdepth);
@@ -9182,20 +8981,15 @@ sub assign_categories_table {
if (@cats > 0) {
my $itemcount = 0;
if (ref($cats[0]) eq 'ARRAY') {
+ $output = &Apache::loncommon::start_data_table();
my @currcategories;
if ($currcat ne '') {
@currcategories = split('&',$currcat);
}
- my $table;
for (my $i=0; $i<@{$cats[0]}; $i++) {
my $parent = $cats[0][$i];
- next if ($parent eq 'instcode');
- if ($type eq 'Community') {
- next unless ($parent eq 'communities');
- } else {
- next if ($parent eq 'communities');
- }
my $css_class = $itemcount%2?' class="LC_odd_row"':'';
+ next if ($parent eq 'instcode');
my $item = &escape($parent).'::0';
my $checked = '';
if (@currcategories > 0) {
@@ -9203,26 +8997,18 @@ sub assign_categories_table {
$checked = ' checked="checked" ';
}
}
- my $parent_title = $parent;
- if ($parent eq 'communities') {
- $parent_title = &mt('Communities');
- }
- $table .= ''.
- ' '.$parent_title.' '.
- ' ';
+ $output .= ''.
+ ' '.$parent.' '.
+ ' ';
my $depth = 1;
push(@path,$parent);
- $table .= &assign_category_rows($itemcount,\@cats,$depth,$parent,\@path,\@currcategories);
+ $output .= &assign_category_rows($itemcount,\@cats,$depth,$parent,\@path,\@currcategories);
pop(@path);
- $table .= ' ';
+ $output .= ' ';
$itemcount ++;
}
- if ($itemcount) {
- $output = &Apache::loncommon::start_data_table().
- $table.
- &Apache::loncommon::end_data_table();
- }
+ $output .= &Apache::loncommon::end_data_table();
}
}
}
@@ -9467,64 +9253,40 @@ sub check_clone {
my $clonehome=&Apache::lonnet::homeserver($clonecrsunum,$clonecrsudom);
my $clonemsg;
my $can_clone = 0;
- my $lctype = lc($args->{'crstype'});
- if ($lctype ne 'community') {
- $lctype = 'course';
- }
+
if ($clonehome eq 'no_host') {
- if ($args->{'crstype'} eq 'Community') {
- $clonemsg = &mt('No new community created.').$linefeed.&mt('A new community could not be cloned from the specified original - [_1] - because it is a non-existent community.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});
- } else {
- $clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});
- }
+ $clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});
} else {
my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1});
- if ($args->{'crstype'} eq 'Community') {
- if ($clonedesc{'type'} ne 'Community') {
- $clonemsg = &mt('No new community created.').$linefeed.&mt('A new community could not be cloned from the specified original - [_1] - because it is a course not a community.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});
- return ($can_clone, $clonemsg, $cloneid, $clonehome);
- }
- }
- if (($env{'request.role.domain'} eq $args->{'clonedomain'}) &&
- (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'}))) {
- $can_clone = 1;
- } else {
- my %clonehash = &Apache::lonnet::get('environment',['cloners'],
- $args->{'clonedomain'},$args->{'clonecourse'});
- my @cloners = split(/,/,$clonehash{'cloners'});
+ if ($env{'request.role.domain'} eq $args->{'clonedomain'}) {
+ $can_clone = 1;
+ } else {
+ my %clonehash = &Apache::lonnet::get('environment',['cloners'],
+ $args->{'clonedomain'},$args->{'clonecourse'});
+ my @cloners = split(/,/,$clonehash{'cloners'});
if (grep(/^\*$/,@cloners)) {
$can_clone = 1;
} elsif (grep(/^\*\:\Q$args->{'ccdomain'}\E$/,@cloners)) {
$can_clone = 1;
} else {
- my $ccrole = 'cc';
- if ($args->{'crstype'} eq 'Community') {
- $ccrole = 'co';
- }
- my %roleshash =
- &Apache::lonnet::get_my_roles($args->{'ccuname'},
- $args->{'ccdomain'},
- 'userroles',['active'],[$ccrole],
- [$args->{'clonedomain'}]);
- if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':'.$ccrole}) || (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/,@cloners))) {
- $can_clone = 1;
- } elsif (&Apache::lonnet::is_course_owner($args->{'clonedomain'},$args->{'clonecourse'},$args->{'ccuname'},$args->{'ccdomain'})) {
- $can_clone = 1;
- } else {
- if ($args->{'crstype'} eq 'Community') {
- $clonemsg = &mt('No new community created.').$linefeed.&mt('The new community could not be cloned from the existing community because the new community owner ([_1]) does not have cloning rights in the existing community ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'});
- } else {
- $clonemsg = &mt('No new course created.').$linefeed.&mt('The new course could not be cloned from the existing course because the new course owner ([_1]) does not have cloning rights in the existing course ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'});
- }
- }
- }
+ my %roleshash =
+ &Apache::lonnet::get_my_roles($args->{'ccuname'},
+ $args->{'ccdomain'},
+ 'userroles',['active'],['cc'],
+ [$args->{'clonedomain'}]);
+ if (($roleshash{$args->{'clonecourse'}.':'.$args->{'clonedomain'}.':cc'}) || (grep(/^\Q$args->{'ccuname'}\E:\Q$args->{'ccdomain'}\E$/,@cloners))) {
+ $can_clone = 1;
+ } else {
+ $clonemsg = &mt('No new course created.').$linefeed.&mt('The new course could not be cloned from the existing course because the new course owner ([_1]) does not have cloning rights in the existing course ([_2]).',$args->{'ccuname'}.':'.$args->{'ccdomain'},$clonedesc{'description'});
+ }
+ }
}
}
return ($can_clone, $clonemsg, $cloneid, $clonehome);
}
sub construct_course {
- my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context,$cnum,$category) = @_;
+ my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context) = @_;
my $outcome;
my $linefeed = ' '."\n";
if ($context eq 'auto') {
@@ -9562,9 +9324,7 @@ sub construct_course {
$args->{'crscode'},
$args->{'ccuname'}.':'.
$args->{'ccdomain'},
- $args->{'crstype'},
- $cnum,$context,$category);
-
+ $args->{'crstype'});
# Note: The testing routines depend on this being output; see
# Utils::Course. This needs to at least be output as a comment
@@ -9594,10 +9354,6 @@ sub construct_course {
$cenv{'url'}=$oldcenv{'url'};
# Restore title
$cenv{'description'}=$oldcenv{'description'};
-# Restore creation date, creator and creation context.
- $cenv{'internal.created'}=$oldcenv{'internal.created'};
- $cenv{'internal.creator'}=$oldcenv{'internal.creator'};
- $cenv{'internal.creationcontext'}=$oldcenv{'internal.creationcontext'};
# Mark as cloned
$cenv{'clonedfrom'}=$cloneid;
# Need to clone grading mode
@@ -9876,22 +9632,12 @@ sub course_type {
sub group_term {
my $crstype = &course_type();
my %names = (
- 'Course' => 'group',
- 'Community' => 'group',
+ 'Course' => 'group',
+ 'Group' => 'team',
);
return $names{$crstype};
}
-sub course_types {
- my @types = ('official','unofficial','community');
- my %typename = (
- official => 'Official course',
- unofficial => 'Unofficial course',
- community => 'Community',
- );
- return (\@types,\%typename);
-}
-
sub icon {
my ($file)=@_;
my $curfext = lc((split(/\./,$file))[-1]);
@@ -9951,22 +9697,6 @@ sub escape_url {
return join('/',@urlslices).'/'.$lastitem;
}
-sub compare_arrays {
- my ($arrayref1,$arrayref2) = @_;
- my (@difference,%count);
- @difference = ();
- %count = ();
- if ((ref($arrayref1) eq 'ARRAY') && (ref($arrayref2) eq 'ARRAY')) {
- foreach my $element (@{$arrayref1}, @{$arrayref2}) { $count{$element}++; }
- foreach my $element (keys(%count)) {
- if ($count{$element} == 1) {
- push(@difference,$element);
- }
- }
- }
- return @difference;
-}
-
# -------------------------------------------------------- Initliaze user login
sub init_user_environment {
my ($r, $username, $domain, $authhost, $form, $args) = @_;
@@ -10098,16 +9828,10 @@ sub init_user_environment {
}
foreach my $tool ('aboutme','blog','portfolio') {
- $userenv{'availabletools.'.$tool} =
+ $userenv{'availabletools.'.$tool} =
&Apache::lonnet::usertools_access($username,$domain,$tool,'reload');
}
- foreach my $crstype ('official','unofficial','community') {
- $userenv{'canrequest.'.$crstype} =
- &Apache::lonnet::usertools_access($username,$domain,$crstype,
- 'reload','requestcourses');
- }
-
$env{'user.environment'} = "$lonids/$cookie.id";
if (tie(my %disk_env,'GDBM_File',"$lonids/$cookie.id",
@@ -10120,8 +9844,8 @@ sub init_user_environment {
}
untie(%disk_env);
} else {
- &Apache::lonnet::logthis("WARNING: ".
- 'Could not create environment storage in lonauth: '.$!.' ');
+ &Apache::lonnet::logthis("WARNING: ".
+ 'Could not create environment storage in lonauth: '.$!.' ');
return 'error: '.$!;
}
}
@@ -10173,13 +9897,11 @@ sub get_annotation {
}
sub clean_symb {
- my ($symb,$delete_enc) = @_;
+ my ($symb) = @_;
&Apache::lonenc::check_decrypt(\$symb);
my $enc = $env{'request.enc'};
- if ($delete_enc) {
- delete($env{'request.enc'});
- }
+ delete($env{'request.enc'});
return ($symb,$enc);
}