--- loncom/interface/loncommon.pm 2009/08/14 07:49:01 1.692.4.7
+++ loncom/interface/loncommon.pm 2008/12/03 00:09:56 1.702
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.692.4.7 2009/08/14 07:49:01 raeburn Exp $
+# $Id: loncommon.pm,v 1.702 2008/12/03 00:09:56 harmsja Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -406,10 +406,9 @@ sub studentbrowser_javascript {
|| ($env{'request.role'}=~/^(au|dc|su)/)
) { return ''; }
return (<<'ENDSTDBRW');
-
ENDSTDBRW
}
sub selectstudent_link {
- my ($form,$unameele,$udomele,$courseadvonly)=@_;
- my $callargs = "'".$form."','".$unameele."','".$udomele."'";
+ my ($form,$unameele,$udomele)=@_;
if ($env{'request.course.id'}) {
if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})
&& !&Apache::lonnet::allowed('srm',$env{'request.course.id'}.
'/'.$env{'request.course.sec'})) {
return '';
}
- if ($courseadvonly) {
- $callargs .= ",'',1,1";
- }
- return ''.
- ''.
- &mt('Select User').' ';
+ return "".&mt('Select User')." ";
}
if ($env{'request.role'}=~/^(au|dc|su)/) {
- $callargs .= ",1";
- return ''.
- ''.
- &mt('Select User').' ';
+ return "".&mt('Select User')." ";
}
return '';
}
@@ -463,7 +453,6 @@ sub selectstudent_link {
sub authorbrowser_javascript {
return <<"ENDAUTHORBRW";
ENDAUTHORBRW
}
sub coursebrowser_javascript {
my ($domainfilter,$sec_element,$formname)=@_;
- my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Community - for which you wish to add/modify a user role');
+ my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');
my $output = '
-';
return $output;
}
@@ -620,17 +602,8 @@ function setSect(sectionlist) {
sub selectcourse_link {
my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
- my $linktext = &mt('Select Course');
- if ($selecttype eq 'Community') {
- $linktext = &mt('Select Community');
- }
- return ''
- ."".$linktext.' '
- .' ';
+ return "".&mt('Select Course')." ";
}
sub selectauthor_link {
@@ -737,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(...)
@@ -838,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
@@ -976,12 +932,10 @@ sub help_open_topic {
# 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;
}
@@ -989,30 +943,24 @@ 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 {
@@ -1039,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;
@@ -1413,7 +1359,6 @@ sub resize_textarea_js {
my $geometry = &viewport_geometry_js();
return <<"RESIZE";
RESIZE
@@ -1685,7 +1629,7 @@ sub multiple_select_form {
$size = scalar(keys(%$hash));
}
}
- $output.="\n".'';
+ $output.="\n";
my @order;
if (ref($order) eq 'ARRAY') {
@order = @{$order};
@@ -1742,17 +1686,17 @@ sub select_form {
sub display_filter {
if (!$env{'form.show'}) { $env{'form.show'}=10; }
if (!$env{'form.displayfilter'}) { $env{'form.displayfilter'}='currentfolder'; }
- return ''.&mt('Records [_1]',
+ return ''.&mt('Records [_1]',
&Apache::lonmeta::selectbox('show',$env{'form.show'},undef,
(&mt('all'),10,20,50,100,1000,10000))).
- ' '.
+ ' '.
&mt('Filter [_1]',
&select_form($env{'form.displayfilter'},
'displayfilter',
('currentfolder' => 'Current folder/page',
'containing' => 'Containing phrase',
'none' => 'None'))).
- ' ';
+ ' ';
}
sub gradeleveldescription {
@@ -1796,7 +1740,7 @@ sub select_level_form {
=pod
-=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange)
+=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.
@@ -1805,21 +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.
+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) = @_;
- if ($onchange) {
- $onchange = ' onchange="'.$onchange.'"';
- }
+ 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;
@@ -1875,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))) {
@@ -2170,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 = '';
@@ -2185,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 = '';
}
}
@@ -2209,7 +2148,7 @@ sub authform_kerberos {
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) {
@@ -2218,7 +2157,7 @@ sub authform_kerberos {
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2279,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 = '';
@@ -2295,7 +2234,7 @@ sub authform_internal{
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'int'}) {
@@ -2304,7 +2243,7 @@ sub authform_internal{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2319,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;
}
@@ -2334,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 = '';
@@ -2350,7 +2289,7 @@ sub authform_local{
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'loc'}) {
@@ -2359,7 +2298,7 @@ sub authform_local{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2388,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 = '';
@@ -2401,7 +2340,7 @@ sub authform_filesystem{
}
} else {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
if (!$can_assign{'fsys'}) {
@@ -2410,7 +2349,7 @@ sub authform_filesystem{
if (defined($in{'mode'})) {
if ($in{'mode'} eq 'modifycourse') {
if ($authnum == 1) {
- $authtype = ' ';
+ $authtype = ' ';
}
}
}
@@ -2778,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
@@ -2833,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
@@ -2878,7 +2761,7 @@ sub aboutmewrapper {
return;
}
return ''.$link.' ';
+ ($target?' target="$target"':'').' title="'.&mt("View this user's personal page").'">'.$link.'';
}
# ------------------------------------------------------------ Syllabus Wrapper
@@ -2913,27 +2796,6 @@ sub track_student_link {
&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
@@ -3171,28 +3033,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 ##
###############################################################
@@ -3331,7 +3171,7 @@ sub relative_to_absolute {
}
$thisdir=~s-/[^/]*$--;
foreach my $link (@rlinks) {
- unless (($link=~/^https?\:\/\//i) ||
+ unless (($link=~/^http:\/\//i) ||
($link=~/^\//) ||
($link=~/^javascript:/i) ||
($link=~/^mailto:/i) ||
@@ -3908,7 +3748,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' &&
@@ -4042,7 +3882,7 @@ sub get_domainconf {
foreach my $key (keys(%{$domconfig{'login'}})) {
if (ref($domconfig{'login'}{$key}) eq 'HASH') {
foreach my $img (keys(%{$domconfig{'login'}{$key}})) {
- $designhash{$udom.'.login.'.$key.'_'.$img} =
+ $designhash{$udom.'.login.'.$key.'_'.$img} =
$domconfig{'login'}{$key}{$img};
}
} else {
@@ -4269,7 +4109,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),
@@ -4556,9 +4396,9 @@ sub standard_css {
my $sans = 'Verdana,Arial,Helvetica,sans-serif';
my $mono = 'monospace';
- my $data_table_head = $sidebg;
- my $data_table_light = '#FAFAFA';
- my $data_table_dark = '#F0F0F0';
+ my $data_table_head = $tabbg;
+ my $data_table_light = '#EEEEEE';
+ my $data_table_dark = '#DDDDDD';
my $data_table_darker = '#CCCCCC';
my $data_table_highlight = '#FFFF00';
my $mail_new = '#FFBB77';
@@ -4571,39 +4411,43 @@ 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;
- font-weight: bold;
- text-align: left;
+ font-size:90%;
}
table.LC_data_table tr.LC_odd_row > td,
-table.LC_pick_box tr > td.LC_odd_row,
table.LC_aboutme_port tr td {
background-color: $data_table_light;
padding: 2px;
}
table.LC_data_table tr.LC_even_row > td,
-table.LC_pick_box tr > td.LC_even_row,
table.LC_aboutme_port tr.LC_even_row td {
background-color: $data_table_dark;
- padding: 2px;
}
table.LC_data_table tr.LC_data_table_highlight td {
background-color: $data_table_darker;
@@ -4893,7 +4742,7 @@ table.LC_nested tr.LC_empty_row td {
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 {
@@ -4904,7 +4753,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;
@@ -4914,7 +4763,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,
@@ -4925,18 +4774,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;
}
@@ -4988,24 +4837,6 @@ 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;
@@ -5024,55 +4855,27 @@ table#LC_cstr_controls tr th {
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 {
+table.LC_data_table tr > td.LC_browser_file,
+table.LC_data_table tr > td.LC_browser_file_published {
background: #CCFF88;
}
-table#LC_browser tr.LC_browser_file_locked,
-table#LC_browser tr.LC_browser_file_unpublished {
+table.LC_data_table tr > td.LC_browser_file_locked,
+table.LC_data_table tr > td.LC_browser_file_unpublished {
background: #FFAA99;
}
-table#LC_browser tr.LC_browser_file_obsolete {
+table.LC_data_table tr > td.LC_browser_file_obsolete {
background: #AAAAAA;
}
-table#LC_browser tr.LC_browser_file_modified,
-table#LC_browser tr.LC_browser_file_metamodified {
+table.LC_data_table tr > td.LC_browser_file_modified,
+table.LC_data_table tr > td.LC_browser_file_metamodified {
background: #FFFF77;
}
-table#LC_browser tr.LC_browser_folder {
+table.LC_data_table tr.LC_browser_folder > td {
background: #CCCCFF;
}
-table.LC_data_table tr > td.LC_roles_is {
-/* background: #77FF77; */
-}
-table.LC_data_table tr > td.LC_roles_future {
- background: #FFFF77;
-}
-table.LC_data_table tr > td.LC_roles_will {
- background: #FFAA77;
-}
-table.LC_data_table tr > td.LC_roles_expired {
- background: #FF7777;
-}
-table.LC_data_table tr > td.LC_roles_will_not {
- background: #AAFF77;
-}
-table.LC_data_table tr > td.LC_roles_selected {
- background: #11CC55;
-}
-
span.LC_current_location {
- font-size: x-large;
+ font-size:larger;
background: $pgbg;
}
@@ -5116,9 +4919,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 {
@@ -5129,7 +4932,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 {
@@ -5168,15 +4971,14 @@ table.LC_pick_box {
border-spacing: 1px;
}
table.LC_pick_box td.LC_pick_box_title {
- background: $sidebg;
+ background: $tabbg;
font-weight: bold;
text-align: right;
- vertical-align: top;
width: 184px;
padding: 8px;
}
table.LC_pick_box td.LC_selfenroll_pick_box_title {
- background: $sidebg;
+ background: $tabbg;
font-weight: bold;
text-align: right;
width: 350px;
@@ -5192,7 +4994,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;
}
@@ -5234,7 +5036,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;
}
@@ -5267,7 +5069,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 {
@@ -5288,7 +5090,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;
@@ -5405,7 +5206,7 @@ span.LC_cusr_subheading {
table.LC_docs_documents {
background: #BBBBBB;
- border-width: 0;
+ border-width: 0px;
border-collapse: collapse;
}
@@ -5422,7 +5223,7 @@ table.LC_docs_documents td.LC_docs_docum
}
.LC_docs_entry_move {
- border: none;
+ border: 0px;
border-collapse: collapse;
}
@@ -5478,7 +5279,7 @@ table.LC_sty_end {
}
table.LC_double_column {
- border-width: 0;
+ border-width: 0px;
border-collapse: collapse;
width: 100%;
padding: 2px;
@@ -5582,10 +5383,10 @@ 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;
margin: 2px;
@@ -5617,7 +5418,7 @@ table.LC_edit_problem_header_title {
background: $tabbg;
border-collapse: collapse;
- padding: 0;
+ padding: 0px
}
div.LC_edit_problem_discards {
@@ -5633,7 +5434,7 @@ hr.LC_edit_problem_divide {
color: $tabbg;
background-color: $tabbg;
height: 3px;
- border: none;
+ border: 0px;
}
img.stift{
border-width:0;
@@ -5658,14 +5459,305 @@ table#LC_mainmenu td.LC_mainmenu_col_fie
font-weight: bold;
}
fieldset#LC_mainmenu_fieldset {
- margin:0 10px 10px 0;
+ margin:0px 10px 10px 0px;
+
+}
+/* ---- 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.smallMenu a:hover,
+ol#MenuBreadcrumbs a:hover,
+ul#TabMainMenuContent a:hover,
+.FormSectionClearButton input:hover{
+ color:#BF2317;
+ text-decoration:none;
+}
+
+h1 {
+ padding:5px 10px 5px 0px;
+ line-height:130%;
+}
+
+h2,h3,h4,h5,h6
+{
+margin:5px 0px 5px 0px;
+line-height:130%;
+}
+.hcell{
+ padding:3px 15px 3px 15px;
+ margin:0px;
+ background-color:$pgbg;
+ background-color:$ border-bottom:solid 1px $lg_border_color;
+}
+.noBorder {
+ border:0px;
+}
+/*
+.bgLightGrey { background:URL(images/TabMenuBG.png) repeat-x left top; }
+.bgLightGreyYellow {background-color:#EFECE0;}
+*/
+
+
+/* Main Header with discription of Person, Course, etc. */
+.HeadRight {
+ text-align: right;
+ float: right;
+ margin: 0px;
+ padding: 0px;
+ right:0;
+ position:absolute;
+ overflow:hidden;
+}
+
+p {
+ padding: 10px;
+
+}
+.FormSectionClearButton input {
+ background-color:transparent;
+ border:0px;
+ cursor:pointer;
+ text-decoration:underline;
+}
+
+
+dl,ul,div,fieldset {
+ margin: 10px 10px 10px 0px;
+ overflow:hidden;
+}
+ol.smallMenu {
+ margin: 0px;
+}
+
+ol.smallMenu li {
+ display: inline;
+ padding: 5px 5px 0px 10px;
+ vertical-align: top;
+}
+
+ol.smallMenu li img {
+ vertical-align: bottom;
+}
+
+ol.smallMenu a {
+ font-size: 90%;
+ color: RGB(80, 80, 80);
+ text-decoration: none;
+}
+
+ol#TabMainMenuContent {
+
+ margin: 0px 0px 10px 0px;
+ padding: 0px;
+}
+
+ol#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 15px 5px 15px;
+ margin-right:4px;
+ line-height: 140%;
+ font-weight: bold;
+ overflow:hidden;
+/* background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left top;*/
+}
+
+ol#TabMainMenuContent li a{
+ color: RGB(47, 47, 47);
+ text-decoration: none;
+}
+
+ol#TabMainMenuContent div.columnSection {
+ margin-bottom: 0px;
+}
+
+ol#MenuBreadcrumbs, ol#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: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left
+ top;*/
+}
+
+ol#MenuBreadcrumbs li, ol#PathBreadcrumbs li {
+/* background: url(images/pfeil_white.png) no-repeat left center;*/
+ display: inline;
+ padding: 0px 0px 0px 10px;
+ vertical-align: bottom;
+ overflow:hidden;
+}
+
+ol#MenuBreadcrumbs li a {
+ text-decoration: none;
+ font-size:90%;
+}
+ol#PathBreadcrumbs li a{
+ text-decoration:none;
+ font-size:100%;
+ font-weight:bold;
+}
+
+.ContentBoxSpecial
+{
+ border: solid 1px $lg_border_color;
+}
+.ContentBox {
+ padding:10px;
+}
+.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.ListStyleClean dt {
+ padding-right: 5px;
+ display: table-header-group;
+}
+
+dl.ListStyleClean dd {
+ display: table-row;
+}
+
+.ListStyleClean,
+.ListStyleSimple,
+.ListStyleNormal,
+.ListStyleNormal_Border,
+.ListStyleSpecial
+ {
+ /*display:block; */
+ list-style-position: inside;
+ list-style-type: none;
+ overflow: hidden;
+ padding: 0px;
+}
+
+.ListStyleSimple li,
+.ListStyleSimple dd,
+.ListStyleNormal li,
+.ListStyleNormal dd,
+.ListStyleSpecial li,
+.ListStyleSpecial dd
+ {
+ margin: 0px;
+ padding: 5px 5px 5px 10px;
+ clear: both;
+}
+
+.ListStyleClean li,
+.ListStyleClean dd {
+ padding-top: 0px;
+ padding-bottom: 0px;
+}
+
+.ListStyleSimple dd,
+.ListStyleSimple li{
+ border-bottom: solid 1px $lg_border_color;
+}
+
+.ListStyleSpecial li,
+.ListStyleSpecial dd {
+ list-style-type: none;
+ background-color: RGB(220, 220, 220);
+ margin-bottom: 4px;
+}
+
+table.SimpleTable {
+ margin:5px;
+ border:solid 1px $lg_border_color;
+ }
+
+table.SimpleTable tr {
+ padding:0px;
+ border:solid 1px $lg_border_color;
+}
+table.SimpleTable thead{
+ background:rgb(220,220,220);
+}
+
+div.columnSection {
+ display: block;
+ clear: both;
+ overflow: hidden;
+ margin:0px;
+}
+
+div.columnSection>* {
+ float: left;
+ margin: 10px 20px 10px 0px;
+ overflow:hidden;
+}
+div.columnSection > .ContentBox,
+div.columnSection > .ContentBoxSpecial
+ {
+ width: 400px;
+
+}
+
+.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:60%;
}
-div.LC_createcourse {
- margin: 10px 10px 10px 10px;
+.LC_loginpage_loginInfo {
+ margin-top:20px;
+ margin-left:20px;
+ float:left;
+ width:30%;
+ border:1px solid #CCCCCC;
+ 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
}
@@ -5793,8 +5885,7 @@ sub xml_begin {
.'';
} else {
- $output=''.
- '';
+ $output='';
}
return $output;
}
@@ -5935,26 +6026,10 @@ sub start_page {
if ($args->{'html_encode'}) {
$result = &html_encode($result);
}
- #Breadcrumbs
- if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {
- &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') {
- 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();
- }
- }
return $result;
}
+
=pod
=item * &head()
@@ -6185,7 +6260,7 @@ sub get_users_function {
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';
}
@@ -6196,37 +6271,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
@@ -6742,37 +6786,21 @@ 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 '') {
- if ($defquota eq '') {
- $defquota = $quotahash{'quotas'}{'defaultquota'}{$item};
- $settingstatus = $item;
- } elsif ($quotahash{'quotas'}{'defaultquota'}{$item} > $defquota) {
- $defquota = $quotahash{'quotas'}{'defaultquota'}{$item};
- $settingstatus = $item;
- }
- }
- } else {
- if ($quotahash{'quotas'}{$item} ne '') {
- if ($defquota eq '') {
- $defquota = $quotahash{'quotas'}{$item};
- $settingstatus = $item;
- } elsif ($quotahash{'quotas'}{$item} > $defquota) {
- $defquota = $quotahash{'quotas'}{$item};
- $settingstatus = $item;
- }
+ if ($quotahash{'quotas'}{$item} ne '') {
+ if ($defquota eq '') {
+ $defquota = $quotahash{'quotas'}{$item};
+ $settingstatus = $item;
+ } elsif ($quotahash{'quotas'}{$item} > $defquota) {
+ $defquota = $quotahash{'quotas'}{$item};
+ $settingstatus = $item;
}
}
}
}
if ($defquota eq '') {
- if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {
- $defquota = $quotahash{'quotas'}{'defaultquota'}{'default'};
- } else {
- $defquota = $quotahash{'quotas'}{'default'};
- }
+ $defquota = $quotahash{'quotas'}{'default'};
$settingstatus = 'default';
}
} else {
@@ -6921,14 +6949,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).' ';
}
}
}
@@ -6965,7 +6991,6 @@ ENDSCRIPT
my $output = <<"END_BLOCK";
$new_user_create
@@ -7212,7 +7236,6 @@ sub personal_data_fieldtitles {
middlename => 'Middle Name',
generation => 'Generation',
gen => 'Generation',
- inststatus => 'Affiliation',
);
return %fieldtitles;
}
@@ -7282,56 +7305,6 @@ 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
-
=back
=head1 HTTP Helpers
@@ -7884,7 +7857,7 @@ sub upfile_select_html {
# xml => &mt('HTML/XML'),
);
my $Str = ' '.
- ' '.&mt('Type').': ';
+ ' Type: ';
foreach my $type (sort(keys(%Types))) {
$Str .= ''.$Types{$type}." \n";
}
@@ -7930,8 +7903,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());
@@ -8629,10 +8601,9 @@ sub restore_settings {
=item * &build_recipient_list()
-Build recipient lists for four types of e-mail:
-(a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors
-(d) Help requests, generated by
-lonerrorhandler.pm, CHECKRPMS, loncron, and lonsupportreq.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),
@@ -8656,21 +8627,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);
@@ -9314,9 +9281,7 @@ sub construct_course {
'policy.email',
'comment.email',
'pch.users.denied',
- 'plc.users.denied',
- 'hidefromcat',
- 'categories'],
+ 'plc.users.denied'],
$$crsudom,$$crsunum);
}
@@ -9579,8 +9544,8 @@ sub course_type {
sub group_term {
my $crstype = &course_type();
my %names = (
- 'Course' => 'group',
- 'Community' => 'group',
+ 'Course' => 'group',
+ 'Group' => 'team',
);
return $names{$crstype};
}
@@ -9644,22 +9609,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) = @_;
@@ -9790,17 +9739,6 @@ sub init_user_environment {
}
}
- foreach my $tool ('aboutme','blog','portfolio') {
- $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",
@@ -9839,7 +9777,7 @@ sub _add_to_env {
# --- Get the symbolic name of a problem and the url
sub get_symb {
my ($request,$silent) = @_;
- (my $url=$env{'form.url'}) =~ s-^https?\://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+ (my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));
if ($symb eq '') {
if (!$silent) {
@@ -9866,13 +9804,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);
}