version 1.198, 2008/11/28 17:04:25
|
version 1.204, 2009/01/03 19:14:19
|
Line 87 sub display_common {
|
Line 87 sub display_common {
|
my $groupitem = &group_form_data(); |
my $groupitem = &group_form_data(); |
|
|
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my %text=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'upload' => 'Upload', |
'upload' => 'Upload', |
'upload_label' => |
'upload_label' => 'Upload file to current directory', |
'Upload file to current directory:', |
|
'createdir' => 'Create Subdirectory', |
'createdir' => 'Create Subdirectory', |
'createdir_label' => |
'createdir_label' => |
'Create subdirectory in current directory:', |
'Create subdirectory in current directory', |
'parse' => 'If HTML file, upload embedded images/multimedia/css/linked files' |
'parse' => 'If HTML file, upload embedded images/multimedia/css/linked files' |
); |
); |
my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); |
my $escuri = &HTML::Entities::encode($r->uri,'&<>"'); |
Line 108 sub display_common {
|
Line 107 sub display_common {
|
$parse_check = <<"END"; |
$parse_check = <<"END"; |
<br /> |
<br /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<label>$text{'parse'} |
<label>$lt{'parse'} |
<input type="checkbox" name="parserflag" checked="checked" /> |
<input type="checkbox" name="parserflag" checked="checked" /> |
</label> |
</label> |
</span> |
</span> |
END |
END |
} |
} |
$r->print(<<"TABLE"); |
|
<table id="LC_portfolio_actions"> |
$r->print('<div>'); |
<tr id="LC_portfolio_upload"> |
# Upload File |
<td class="LC_label"> |
$r->print('<div class="LC_left_float">' |
$text{'upload_label'} |
.'<form method="post" enctype="multipart/form-data" action="'.$escuri.'">' |
</td> |
.'<fieldset>' |
<td class="LC_value"> |
.'<legend>'.$lt{'upload_label'}.'</legend>' |
<form method="post" enctype="multipart/form-data" action="$escuri"> |
.$groupitem |
$groupitem |
.'<input name="uploaddoc" type="file" />' |
<input name="uploaddoc" type="file" /> |
.'<input type="hidden" name="currentpath" value="'.$current_path.'" />' |
<input type="hidden" name="currentpath" value="$current_path" /> |
.'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />' |
<input type="hidden" name="action" value="$env{"form.action"}" /> |
.'<input type="hidden" name="fieldname" value="'.$env{"form.fieldname"}.'" />' |
<input type="hidden" name="fieldname" value="$env{"form.fieldname"}" /> |
.'<input type="hidden" name="mode" value="'.$env{"form.mode"}.'" />' |
<input type="hidden" name="mode" value="$env{"form.mode"}" /> |
.'<input type="submit" name="storeupl" value="'.$lt{'upload'}.'" />' |
<input type="submit" name="storeupl" value="$text{'upload'}" /> |
.$help_fileupload |
$help_fileupload |
.$parse_check |
$parse_check |
.'</fieldset>' |
</form> |
.'</form>' |
</td> |
.'</div>' |
</tr> |
); |
<tr id="LC_portfolio_createdir"> |
# Create Subdirectory |
<td class="LC_label"> |
$r->print('<div class="LC_left_float">' |
$text{'createdir_label'} |
.'<form method="post" action="'.$escuri.'">' |
</td> |
.'<fieldset>' |
<td class="LC_value"> |
.'<legend>'.$lt{'createdir_label'}.'</legend>' |
<form method="post" action="$escuri"> |
.'<input name="newdir" type="text" />'.$groupitem |
<input name="newdir" type="input" />$groupitem |
.'<input type="hidden" name="currentpath" value="'.$current_path.'" />' |
<input type="hidden" name="currentpath" value="$current_path" /> |
.'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />' |
<input type="hidden" name="action" value="$env{"form.action"}" /> |
.'<input type="hidden" name="fieldname" value="'.$env{"form.fieldname"}.'" />' |
<input type="hidden" name="fieldname" value="$env{"form.fieldname"}" /> |
.'<input type="hidden" name="mode" value="'.$env{"form.mode"}.'" />' |
<input type="hidden" name="mode" value="$env{"form.mode"}" /> |
.'<input type="submit" name="createdir" value="'.$lt{'createdir'}.'" />' |
<input type="submit" name="createdir" value="$text{'createdir'}" />$help_createdir |
.$help_createdir |
</form> |
.'</fieldset>' |
</td> |
.'</form>' |
</tr> |
.'</div>' |
</table> |
); |
TABLE |
$r->print('</div>'); |
} |
} # end "if can_upload" |
|
|
my @tree = split (/\//,$current_path); |
my @tree = split (/\//,$current_path); |
my %anchor_fields = ( |
my %anchor_fields = ( |
'selectfile' => $port_path, |
'selectfile' => $port_path, |
Line 271 sub display_directory {
|
Line 271 sub display_directory {
|
$display_out = '<form method="post" action="'.$url.'">'. |
$display_out = '<form method="post" action="'.$url.'">'. |
&group_form_data(). |
&group_form_data(). |
'<input type="hidden" name="action" value="deletedir" />'. |
'<input type="hidden" name="action" value="deletedir" />'. |
|
'<p>'. |
'<input type="submit" name="deletedir" value="'.&mt("Delete Directory").'" />'. |
'<input type="submit" name="deletedir" value="'.&mt("Delete Directory").'" />'. |
|
'</p>'. |
'<input type="hidden" name="selectfile" value="" />'. |
'<input type="hidden" name="selectfile" value="" />'. |
'<input type="hidden" name="currentpath" value="'.$current_path.'" />'. |
'<input type="hidden" name="currentpath" value="'.$current_path.'" />'. |
'</form>'; |
'</form>'; |
Line 487 sub display_directory {
|
Line 489 sub display_directory {
|
$r->print(&Apache::loncommon::end_data_table()); |
$r->print(&Apache::loncommon::end_data_table()); |
if ($can_delete) { |
if ($can_delete) { |
$r->print(' |
$r->print(' |
|
<p> |
<input type="submit" name="doit" value="'.&mt('Delete Selected').'" />'. |
<input type="submit" name="doit" value="'.&mt('Delete Selected').'" />'. |
&Apache::loncommon::help_open_topic('Portfolio DeleteFile').' |
&Apache::loncommon::help_open_topic('Portfolio DeleteFile').' |
|
</p> |
<input type="hidden" name="action" value="delete" /> |
<input type="hidden" name="action" value="delete" /> |
<input type="hidden" name="currentpath" value="'.$current_path.'" /> |
<input type="hidden" name="currentpath" value="'.$current_path.'" /> |
</form>' |
</form>' |
Line 690 sub rename {
|
Line 694 sub rename {
|
} else { |
} else { |
&open_form($r,$url); |
&open_form($r,$url); |
$r->print('<p>'.&mt('Rename [_1] to [_2]?', &display_file() |
$r->print('<p>'.&mt('Rename [_1] to [_2]?', &display_file() |
, '<input name="filenewname" type="input" size="50" />').'</p>'); |
, '<input name="filenewname" type="text" size="50" />').'</p>'); |
&close_form($r,$url); |
&close_form($r,$url); |
} |
} |
} |
} |
Line 797 sub display_access {
|
Line 801 sub display_access {
|
$info .= '</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.'); |
$info .= '</li><li>'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.'); |
$info .= '</li><li>'.&explain_conditionals(); |
$info .= '</li><li>'.&explain_conditionals(); |
$info .= '</li></ul>'. |
$info .= '</li></ul>'. |
&mt('A listing of files viewable without log-in is available at: ')."<a href=\"/adm/$udom/$uname/aboutme/portfolio\">http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio</a>.<br />"; |
&mt('A listing of files viewable without log-in is available at: ')."<a href=\"/adm/$udom/$uname/aboutme/portfolio\">".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme/portfolio</a>.<br />"; |
if ($group eq '') { |
if ($group eq '') { |
$info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:"); |
$info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:"); |
} else { |
} else { |
$info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on the course information page:"); |
$info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on the course information page:"); |
} |
} |
$info .= "<br /><a href=\"/adm/$udom/$uname/aboutme\">http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme</a><br />"; |
$info .= "<br /><a href=\"/adm/$udom/$uname/aboutme\">".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme</a><br />"; |
if ($group ne '') { |
if ($group ne '') { |
$info .= &mt("Users with privileges to edit course contents may add a course information page to a course using the 'Course Info' button in DOCS").'<br />'; |
$info .= &mt("Users with privileges to edit course contents may add a course information page to a course using the 'Course Info' button in DOCS").'<br />'; |
} |
} |
Line 1496 sub course_row {
|
Line 1500 sub course_row {
|
} |
} |
$max_id ++; |
$max_id ++; |
my $role_selects = &role_selectors($num,$role_id,$type,$content,'display'); |
my $role_selects = &role_selectors($num,$role_id,$type,$content,'display'); |
$r->print('<tr><td><span style="white-space: nowrap"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); |
$r->print('<tr><td><span class="LC_nobreak"><label><input type="checkbox" name="delete_role_'.$num.'" value="'.$role_id.'" />'.&mt('Delete').'</label></span><br /><input type="hidden" name="preserve_role_'.$num.'" value="'.$role_id.'" /></td>'.$role_selects.'</tr>'); |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
} |
} |
Line 1571 sub additional_item {
|
Line 1575 sub additional_item {
|
|
|
sub actionbox { |
sub actionbox { |
my ($status,$num,$scope) = @_; |
my ($status,$num,$scope) = @_; |
my $output = '<span style="white-space: nowrap"><label>'; |
my $output = '<span class="LC_nobreak"><label>'; |
if ($status eq 'new') { |
if ($status eq 'new') { |
my $checkstate; |
my $checkstate; |
if ($scope eq 'domains' || $scope eq 'users' || $scope eq 'course') { |
if ($scope eq 'domains' || $scope eq 'users' || $scope eq 'course') { |
Line 1582 sub actionbox {
|
Line 1586 sub actionbox {
|
&mt('Activate'); |
&mt('Activate'); |
} else { |
} else { |
$output .= '<input type="checkbox" name="delete" value="'.$num. |
$output .= '<input type="checkbox" name="delete" value="'.$num. |
'" />'.&mt('Delete').'</label></span><br /><span style="white-space: nowrap">'. |
'" />'.&mt('Delete').'</label></span><br /><span class="LC_nobreak">'. |
'<label><input type="checkbox" name="update" value="'. |
'<label><input type="checkbox" name="update" value="'. |
$num.'" />'.&mt('Update'); |
$num.'" />'.&mt('Update'); |
} |
} |
Line 1601 sub dateboxes {
|
Line 1605 sub dateboxes {
|
undef,undef,1); |
undef,undef,1); |
my $enddate = &Apache::lonhtmlcommon::date_setter('portform', |
my $enddate = &Apache::lonhtmlcommon::date_setter('portform', |
'enddate_'.$num,$end,undef,undef,undef,1,undef, |
'enddate_'.$num,$end,undef,undef,undef,1,undef, |
undef,undef,1). ' <span style="white-space: nowrap"><label>'. |
undef,undef,1). ' <span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="noend_'. |
'<input type="checkbox" name="noend_'. |
$num.'" '.$noend.' />'.&mt('No end date'). |
$num.'" '.$noend.' />'.&mt('No end date'). |
'</label></span>'; |
'</label></span>'; |
Line 2241 sub handler {
|
Line 2245 sub handler {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
# Give the LON-CAPA page header |
# Give the LON-CAPA page header |
|
my $brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}]; |
|
|
if ($env{"form.mode"} eq 'selectfile'){ |
if ($env{"form.mode"} eq 'selectfile'){ |
$r->print(&Apache::loncommon::start_page($title,undef, |
$r->print(&Apache::loncommon::start_page($title,undef, |
{'only_body' => 1})); |
{'only_body' => 1})); |
Line 2248 sub handler {
|
Line 2254 sub handler {
|
$r->print(&Apache::loncommon::start_page('New role-based condition',undef, |
$r->print(&Apache::loncommon::start_page('New role-based condition',undef, |
{'no_nav_bar' => 1, })); |
{'no_nav_bar' => 1, })); |
} else { |
} else { |
$r->print(&Apache::loncommon::start_page($title)); |
$r->print(&Apache::loncommon::start_page($title,undef, |
|
{'bread_crumbs' => $brcrum})); |
} |
} |
$r->rflush(); |
$r->rflush(); |
|
if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) { |
|
$r->print('<h2>'.&mt('No user portfolio available') .'</h2>'. |
|
&mt('This is a result of one of the following:').'<ul>'. |
|
'<li>'.&mt('The administrator of this domain has disabled portfolio functionality for this specific user.').'</li>'. |
|
'<li>'.&mt('The domain has been configured to disable, by default, portfolio functionality for all users in the domain.').'</li>'. |
|
'</ul>'); |
|
$r->print(&Apache::loncommon::end_page()); |
|
return OK; |
|
} |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('port',$uname,$udom); |
&Apache::loncommon::blocking_status('port',$uname,$udom); |
if ($blocked) { |
if ($blocked) { |