[LON-CAPA-cvs] cvs: loncom /interface lonindexer.pm lonwishlist.pm
raeburn
raeburn at source.lon-capa.org
Sat May 31 12:01:33 EDT 2014
raeburn Sat May 31 16:01:33 2014 EDT
Modified files:
/loncom/interface lonindexer.pm lonwishlist.pm
Log:
- No import into a course/community for a Stored Link pointing at a directory
in the Shared Content Repository.
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.220 loncom/interface/lonindexer.pm:1.221
--- loncom/interface/lonindexer.pm:1.220 Mon Aug 12 16:44:08 2013
+++ loncom/interface/lonindexer.pm Sat May 31 16:01:33 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Directory Indexer
#
-# $Id: lonindexer.pm,v 1.220 2013/08/12 16:44:08 raeburn Exp $
+# $Id: lonindexer.pm,v 1.221 2014/05/31 16:01:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1000,7 +1000,7 @@
# Wishlistlink
$r->print('</form></td><td><a href="javascript:;" '.
'title="'.&mt('Save a link for this folder in your personal Stored Links repository').'" '.
- 'onclick="set_wishlistlink('."'$plainname','$startdir$listname'".')">'.
+ 'onclick="set_wishlistlink('."'$plainname','$startdir$listname"."/'".')">'.
'<img class="LC_icon" src="/res/adm/pages/wishlist.png" '.
'alt="'.&mt('save in Stored Links').'" style="width:22px;"/></a>'.$tabtag);
$r->print(&Apache::loncommon::end_data_table_row());
@@ -1250,7 +1250,7 @@
# Wishlistlink
$r->print('</td><td><a href="javascript:;" '.
'title="'.&mt('Save a link for this folder in Stored Links').'" '.
- 'onclick="set_wishlistlink('."'$listname','$startdir$listname'".')">'.
+ 'onclick="set_wishlistlink('."'$listname','$startdir$listname"."/'".')">'.
'<img class="LC_icon" src="/res/adm/pages/wishlist.png" '.
'alt="'.&mt('save in Stored Links').'" style="width:22px;"/></a></td>');
# Attributes
@@ -1297,8 +1297,8 @@
}
if ($hash{'display_attrs_7'} == 1) {
$r->print('<td> </td>');
- }
- if ($hash{'display_attrs_11'} == 1) {
+ }
+ if ($hash{'display_attrs_11'} == 1) {
$r->print('<td> </td>');
}
if ($hash{'display_attrs_12'} == 1) {
Index: loncom/interface/lonwishlist.pm
diff -u loncom/interface/lonwishlist.pm:1.21 loncom/interface/lonwishlist.pm:1.22
--- loncom/interface/lonwishlist.pm:1.21 Fri Feb 28 19:24:03 2014
+++ loncom/interface/lonwishlist.pm Sat May 31 16:01:33 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility-routines for wishlist
#
-# $Id: lonwishlist.pm,v 1.21 2014/02/28 19:24:03 bisitz Exp $
+# $Id: lonwishlist.pm,v 1.22 2014/05/31 16:01:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1361,16 +1361,30 @@
foreach my $n (@$nodes) {
my $index = $n->value()->nindex();
+
+ #
+ # Determine which resources in stored links may be imported into a course/community.
+ # (a) Import of directories in /res space is not supported.
+ # (b) Import of a resource into a community requires user has 'bro' privilege for resource
+ # (i.e., user has author or co-author role for corresponcding Authoring Space).
+ # (c) Import of a resource into a course requires user has 'be' privilege for resource.
+ #
+
if ($n->value()->path() =~ m{^(/res/$match_domain/$match_username/)}) {
- if ($is_community) {
- unless (&Apache::lonnet::allowed('bro',$n->value()->path())) {
- $nopick{$n->value()->path()} = $n->value()->title();
- $$numskipped ++;
- }
+ if ($n->value()->path() =~ m{/$}) {
+ $nopick{$n->value()->path()} = $n->value()->title();
+ $$numskipped ++;
} else {
- unless (&Apache::lonnet::allowed('bre',$n->value()->path())) {
- $nopick{$n->value()->path()} = $n->value()->title();
- $$numskipped ++;
+ if ($is_community) {
+ unless (&Apache::lonnet::allowed('bro',$n->value()->path())) {
+ $nopick{$n->value()->path()} = $n->value()->title();
+ $$numskipped ++;
+ }
+ } else {
+ unless (&Apache::lonnet::allowed('bre',$n->value()->path())) {
+ $nopick{$n->value()->path()} = $n->value()->title();
+ $$numskipped ++;
+ }
}
}
}
More information about the LON-CAPA-cvs
mailing list