version 1.155, 2013/09/17 15:04:30
|
version 1.171, 2025/03/16 21:04:09
|
Line 83 use Apache::lonrss();
|
Line 83 use Apache::lonrss();
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonmsgdisplay(); |
use Apache::lonmsgdisplay(); |
use Apache::lontemplate; |
use Apache::lontemplate; |
|
use Apache::longroup; |
|
use Apache::lonhtmlcommon(); |
use HTML::Entities(); |
use HTML::Entities(); |
use Image::Magick; |
use Image::Magick; |
|
|
Line 107 sub handler {
|
Line 109 sub handler {
|
$is_course = &Apache::lonnet::is_course($cdom,$cnum); |
$is_course = &Apache::lonnet::is_course($cdom,$cnum); |
} |
} |
|
|
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my $candisplay = 1; |
my $candisplay = 1; |
if (!$is_course) { |
if (!$is_course) { |
if ($action ne 'portfolio') { |
if ($action ne 'portfolio') { |
$candisplay = &Apache::lonnet::usertools_access($cnum,$cdom,'aboutme'); |
if (($env{'user.name'} eq $cnum) && ($env{'user.domain'} eq $cdom)) { |
|
$candisplay = &Apache::lonnet::usertools_access($cnum,$cdom,'aboutme'); |
|
} else { |
|
$candisplay = &Apache::loncommon::aboutme_on($cnum,$cdom); |
|
} |
if ((!$candisplay) && ($env{'request.course.id'})) { |
if ((!$candisplay) && ($env{'request.course.id'})) { |
$candisplay = &aboutme_access($cnum,$cdom); |
$candisplay = &aboutme_access($cnum,$cdom); |
} |
} |
Line 140 sub handler {
|
Line 147 sub handler {
|
# ------------------------------------------------------------ Get Query String |
# ------------------------------------------------------------ Get Query String |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['forceedit','forcestudent','todocs', |
['forceedit','forcestudent','todocs', |
'register','popup','folderpath','title']); |
'register','popup','folderpath','title','only_body']); |
# ----------------------------------------------- Available Portfolio file display |
# ----------------------------------------------- Available Portfolio file display |
if (($target ne 'tex') && ($action eq 'portfolio')) { |
if (($target ne 'tex') && ($action eq 'portfolio')) { |
&display_portfolio_header($r,$is_course); |
&display_portfolio_header($r,$is_course); |
Line 152 sub handler {
|
Line 159 sub handler {
|
'</ul>'); |
'</ul>'); |
} else { |
} else { |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('port',$cnum,$cdom); |
&Apache::loncommon::blocking_status('port',$clientip,$cnum,$cdom); |
if (!$blocked) { |
if (!$blocked) { |
&display_portfolio_files($r,$is_course); |
&display_portfolio_files($r,$is_course); |
} else { |
} else { |
Line 219 sub handler {
|
Line 226 sub handler {
|
if ($env{'form.popup'}) { # Don't show breadcrumbs in popup window |
if ($env{'form.popup'}) { # Don't show breadcrumbs in popup window |
$args->{'no_nav_bar'} = 1; |
$args->{'no_nav_bar'} = 1; |
} elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it |
} elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it |
if (($env{'request.course.id'}) && |
if (($env{'form.only_body'}) && ($env{'request.course.id'})) { |
($env{'form.folderpath'} =~ /^supplemental/)) { |
$args->{'only_body'} = 1; |
|
} elsif (($env{'request.course.id'}) && |
|
($env{'form.folderpath'} =~ /^supplemental/)) { |
|
&Apache::loncommon::validate_folderpath(1,'',$coursenum,$coursedomain); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $title = $env{'form.title'}; |
my $title = $env{'form.title'}; |
if ($title eq '') { |
if ($title eq '') { |
$title = &mt('Personal Information Page'); |
$title = &mt('Personal Information Page'); |
} |
} |
|
$title = &HTML::Entities::encode($title,'\'"<>&'); |
my $brcrum = |
my $brcrum = |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
if (ref($brcrum) eq 'ARRAY') { |
if (ref($brcrum) eq 'ARRAY') { |
$args->{'bread_crumbs'} = $brcrum; |
$args->{'bread_crumbs'} = $brcrum; |
|
$args->{'bread_crumbs_nomenu'} = 1; |
} |
} |
} else { |
} else { |
$args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme", |
$args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme", |
Line 239 sub handler {
|
Line 251 sub handler {
|
my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args); |
my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args); |
$r->print($start_page); |
$r->print($start_page); |
} |
} |
|
my ($blocked,$blocktext) = |
|
&Apache::loncommon::blocking_status('about',$clientip,$cnum,$cdom); |
|
if ($blocked) { |
|
if ($target eq 'tex') { |
|
$r->print('\noindent{\large\textbf{'.&mt('No user personal information page available').'}}\\\\\\\\'); |
|
} else { |
|
$r->print($blocktext); |
|
} |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
|
|
#----------------Print Privacy note (edit mode) or last modified date. |
#----------------Print Privacy note (edit mode) or last modified date. |
|
|
Line 335 sub handler {
|
Line 358 sub handler {
|
} |
} |
|
|
if ($allowed) { |
if ($allowed) { |
|
my $labeltext = &HTML::Entities::encode(&mt('Choose photo file'),'"&<>'); |
$r->print( |
$r->print( |
'<form name="UploadPhoto" method="post" enctype="multipart/form-data" action="">'. |
'<form name="UploadPhoto" method="post" enctype="multipart/form-data" action="">'. |
'<h3>'.&mt('Upload a Photo').'</h3>'. |
'<h3>'.&mt('Upload a Photo').'</h3>'. |
'<p class="LC_info">'. |
'<p class="LC_info">'. |
&mt('LON-CAPA will automatically scale your uploaded file so the image will not exceed a width of 400px and a height of 500px.').'</p>'. |
&mt('LON-CAPA will automatically scale your uploaded file so the image will not exceed a width of 400px and a height of 500px.').'</p>'. |
'<input type="file" name="uploaddoc" size="50" />'. |
'<input type="file" name="uploaddoc" size="50" aria-label="'.$labeltext.'" />'. |
'<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'. |
'<input type="submit" name="storeupl" value="'.&mt('Upload').'" />'. |
'<input type="hidden" name="popup" value="'.$env{'form.popup'}.'" />'. |
'<input type="hidden" name="popup" value="'.$env{'form.popup'}.'" />'. |
'</form>'); |
'</form>'); |
Line 365 sub handler {
|
Line 389 sub handler {
|
|
|
if ($target ne 'tex') { #Begin Print RSS and portfiles |
if ($target ne 'tex') { #Begin Print RSS and portfiles |
&print_portfiles_link($r,$is_course); |
&print_portfiles_link($r,$is_course); |
if (&Apache::lonrss::advertisefeeds($cnum,$cdom) ne '') { |
if (&Apache::lonrss::advertisefeeds($cnum,$cdom,'','','',1) ne '') { |
&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_Box'); |
&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_Box'); |
$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom)); |
$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,'','','',1)); |
&Apache::lontemplate::print_end_template($r); |
&Apache::lontemplate::print_end_template($r); |
} |
} |
|
|
Line 384 sub handler {
|
Line 408 sub handler {
|
if ($target ne 'tex') {$r->print('<br />');} else {$r->print('\\\\');} |
if ($target ne 'tex') {$r->print('<br />');} else {$r->print('\\\\');} |
} else { |
} else { |
$r->print('<p class="LC_info">'.&mt('No personal information provided').'.</p>'); |
$r->print('<p class="LC_info">'.&mt('No personal information provided').'.</p>'); |
|
if ($target ne 'tex') { |
|
&print_portfiles_link($r,$is_course); |
|
} |
} |
} |
|
|
if ($env{'request.course.id'} |
if ($env{'request.course.id'} |
Line 400 sub handler {
|
Line 427 sub handler {
|
|
|
} else { |
} else { |
$r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\'); |
$r->print('\\\\\textbf{'.&mt('User Notes, Records of Face-To-Face Discussions, and Critical Messages in Course').'}\\\\'.&mt('Shared by course faculty and staff').'\\\\\\\\'); |
&Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom, 'tex'); |
&Apache::lonmsgdisplay::disfacetoface($r,$cnum,$cdom,$target); |
} |
} |
} |
} |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
Line 541 sub display_portfolio_header {
|
Line 568 sub display_portfolio_header {
|
title => &mt('Go to personal information page for [_1]',$name), |
title => &mt('Go to personal information page for [_1]',$name), |
no_mt => 1}, |
no_mt => 1}, |
{href => "/adm/$cdom/$cnum/aboutme/portfolio".$query_string, |
{href => "/adm/$cdom/$cnum/aboutme/portfolio".$query_string, |
text => 'Viewable files', |
text => &mt('Viewable files'), |
title => &mt('Viewable portfolio files for [_1]',$name), |
title => &mt('Viewable portfolio files for [_1]',$name), |
no_mt => 1} |
no_mt => 1} |
]; |
]; |
Line 613 sub portfolio_files {
|
Line 640 sub portfolio_files {
|
withoutpass => 0, |
withoutpass => 0, |
both => 0, |
both => 0, |
}; |
}; |
|
unless (($is_course) || |
|
(&Apache::lonnet::usertools_access($cnum,$cdom,'portaccess',undef,'tools'))) { |
|
return $filecounts; |
|
} |
my $current_permissions = |
my $current_permissions = |
&Apache::lonnet::get_portfile_permissions($cdom,$cnum); |
&Apache::lonnet::get_portfile_permissions($cdom,$cnum); |
my %access_controls = |
my %access_controls = |
&Apache::lonnet::get_access_controls($current_permissions); |
&Apache::lonnet::get_access_controls($current_permissions); |
my $portaccess; |
my $portaccess; |
if ($mode eq 'showlink') { |
if ($mode eq 'showlink') { |
$portaccess = 'both'; |
$portaccess = 'both'; |
Line 630 sub portfolio_files {
|
Line 661 sub portfolio_files {
|
my $diroutput; |
my $diroutput; |
if ($is_course) { |
if ($is_course) { |
my %files_by_group; |
my %files_by_group; |
|
my %curr_groups = &Apache::longroup::coursegroups($cdom,$cnum); |
foreach my $filename (sort(keys(%access_controls))) { |
foreach my $filename (sort(keys(%access_controls))) { |
my ($group,$path) = split('/',$filename,2); |
my ($group,$path) = split('/',$filename,2); |
$files_by_group{$group}{$path} = $access_controls{$filename}; |
if (exists($curr_groups{$group})) { |
|
$files_by_group{$group}{$path} = $access_controls{$filename}; |
|
} |
} |
} |
foreach my $group (sort(keys(%files_by_group))) { |
foreach my $group (sort(keys(%files_by_group))) { |
my %fileshash; |
my %fileshash; |
Line 667 sub portfolio_files {
|
Line 701 sub portfolio_files {
|
sub build_hierarchy { |
sub build_hierarchy { |
my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info, |
my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info, |
$allfileshash,$group) = @_; |
$allfileshash,$group) = @_; |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
my $usercanshare = &Apache::lonnet::usertools_access($cnum,$cdom,'portaccess',undef,'tools'); |
foreach my $filename (sort(keys(%{$access_info}))) { |
foreach my $filename (sort(keys(%{$access_info}))) { |
my $access_status = |
my $access_status = |
&Apache::lonnet::get_portfolio_access($cdom,$cnum,$filename,$group,$$access_info{$filename}); |
&Apache::lonnet::get_portfolio_access($cdom,$cnum,$filename,$group,$clientip, |
|
$access_info->{$filename},\$usercanshare); |
if ($portaccess eq 'both') { |
if ($portaccess eq 'both') { |
if (($access_status ne 'ok') && |
if (($access_status ne 'ok') && |
($access_status !~ /^[^:]+:guest_/)) { |
($access_status !~ /^[^:]+:guest_/)) { |
Line 787 sub parse_directory {
|
Line 824 sub parse_directory {
|
sub aboutme_access { |
sub aboutme_access { |
my ($uname,$udom) = @_; |
my ($uname,$udom) = @_; |
my $privcheck = $env{'request.course.id'}; |
my $privcheck = $env{'request.course.id'}; |
my $sec; |
|
if ($env{'request.course.sec'} ne '') { |
if ($env{'request.course.sec'} ne '') { |
$sec = $env{'request.course.sec'}; |
$privcheck .= '/'.$env{'request.course.sec'}; |
$privcheck .= '/'.$sec; |
|
} |
} |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |