value()->path());
$wishlistHTMLview .= ''.
- 'value()->path()."'".');">'.
+ ''.
''.
$n->value()->title().' | ';
}
@@ -1305,9 +1310,10 @@ sub wishlistMove {
$highlight = 'style="color:red;"';
}
# link-image and title
+ my $quotable_link = &Apache::loncommon::escape_single($n->value()->path());
$wishlistHTMLmove .= ' | '.
''.
- 'value()->path()."'".');" '.$highlight.'>'.
+ ''.
''.
$n->value()->title().' | ';
}
@@ -1361,16 +1367,30 @@ sub wishlistImport {
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 ++;
+ }
}
}
}
@@ -1411,7 +1431,8 @@ sub wishlistImport {
else {
$wishlistHTMLimport .= '';
unless ($nopick{$n->value()->path()}) {
- $wishlistHTMLimport .= 'value()->path()."'".');">';
+ my $quotable_link = &Apache::loncommon::escape_single($n->value()->path());
+ $wishlistHTMLimport .= '';
}
$wishlistHTMLimport .= ''.
''.$n->value()->title().' | ';
@@ -1459,6 +1480,11 @@ sub makePage {
$root = $rootgiven;
@childrenRt = $root->children();
+ my $windowname = 'loncapaclient';
+ if ($env{'request.lti.login'}) {
+ $windowname .= 'lti';
+ }
+
# breadcrumbs and start_page
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb(
@@ -1467,9 +1493,9 @@ sub makePage {
my $startPage = &Apache::loncommon::start_page('Stored Links',undef,
{'add_entries' => {
'onload' => 'javascript:onLoadAction('."'".$mode."'".');',
- 'onunload' => 'javascript:window.name = '."'loncapaclient'"}});
+ 'onunload' => 'javascript:window.name = '."'$windowname'"}});
- my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs(&mt('Stored Links'),'Wishlist');
+ my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Stored Links','Wishlist');
# get javascript-code for wishlist-interactions
my $js = &JSforWishlist();
@@ -1644,6 +1670,8 @@ sub makePopUpNewLink {
' or to external websites.'.
' Paths to LON-CAPA resources must be of the form /res/domain/user/...'.
' Paths to external websites must contain the network protocol, e.g. http://...');
+ &js_escape(\$warningLink);
+ &js_escape(\$warningLinkNotAllowed1);
my $inPageWishlistlink1 = ''.&mt('Save to Stored Links').'
';
# If no title is delivered, 'New Link' is called up from the wishlist-interface, so after
@@ -1747,7 +1775,7 @@ sub makePopUpNewFolder {
'bgcolor' => '#FFFFFF',});
my $warningFolder = &mt('You must insert a title!');
-
+ &js_escape(\$warningFolder);
my $inPageNewFolder = ''.&mt('New Folder').'
'.
'