--- loncom/interface/lonwishlist.pm 2012/05/16 11:26:03 1.13 +++ loncom/interface/lonwishlist.pm 2012/06/07 02:28:04 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility-routines for wishlist # -# $Id: lonwishlist.pm,v 1.13 2012/05/16 11:26:03 bisitz Exp $ +# $Id: lonwishlist.pm,v 1.15 2012/06/07 02:28:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,7 +50,7 @@ use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon; use Apache::lonlocal; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); use Tree; @@ -466,11 +466,13 @@ sub getNodesToArray { Recursive call starting with all children of the root of the tree (parameter nodes is reference to an array containing the nodes of the current level). -=item * &wishlistImport(nodes) +=item * &wishlistImport(nodes, numskipped) Returns the table-HTML-markup for the wishlist in mode "import". - Recursive call starting with all children of the root of the tree (parameter nodes is reference to an array containing the nodes of the current level). - + Recursive call starting with all children of the root of the tree (parameter nodes is reference to an array containing the nodes of the current level). + Side effect: increments the scalar ref: numskipped with a count of items in + Stored Links unavailable for selection, (e.g., now marked obsolete or + inaccessible in Community context). =item * &makePage(mode, marked) @@ -528,14 +530,16 @@ sub JSforWishlist { # that means that it is checked wether a path contains .problem, .quiz, .exam etc. # this is good for most cases but crashes as soon as a real external website contains one of this pattern in its URL. # so maybe there's a better way to find out wether a given URL belongs to a LON-CAPA-server or not ...? - my $warningLinkNotAllowed1 = &mt('You can only insert links to LON-CAPA resources from the resource-pool '. - 'or to external websites. Paths to LON-CAPA resources must be of the form /res/dom/usr... . '. - 'Paths to external websites must contain the network protocol (e.g. http://...).'); - my $warningLinkNotAllowed2 = &mt('The following link is not allowed: '); + my $warningLinkNotAllowed1 = + &mt('You can only insert links to LON-CAPA resources from the resource-pool'. + ' 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://...'); + my $warningLinkNotAllowed2 = &mt('The following link is not allowed:').' '; my $warningLink = &mt('You must insert a title and a path!'); my $warningFolder = &mt('You must insert a title!'); my $warningDelete = &mt('Are you sure you want to delete the selected entries? Deleting a folder also deletes all entries within this folder!'); - my $warningSave = &mt('You have unsaved changes. You can either save these changes now by clicking "ok" or click "cancel" if you do not want to save your changes.'); + my $warningSave = &mt('You have unsaved changes. You can either save these changes now by clicking "OK" or click "Cancel" if you do not want to save your changes.'); my $warningMoveS = &mt('You must select at minimum one entry to move!'); my $warningMoveD = &mt('You must select a destination folder!'); $foldersOption = ''; @@ -808,7 +812,9 @@ sub JSforWishlist { function setChecked(row,checked) { var childCHECK = document.getElementById(row.id.replace('row','check')); - childCHECK.checked = checked; + if (!childCHECK.disabled) { + childCHECK.checked = checked; + } } function getPreviousFolderRows(row) { @@ -1008,14 +1014,18 @@ sub JSforWishlist { function checkAll() { var checkboxes = document.getElementsByName('check'); for (var i = 0; i < checkboxes.length; i++) { - checkboxes[i].checked = "checked"; + if (!checkboxes[i].disabled) { + checkboxes[i].checked = "checked"; + } } } function uncheckAll() { var checkboxes = document.getElementsByName('check'); for (var i = 0; i < checkboxes.length; i++) { - checkboxes[i].checked = ""; + if (!checkboxes[i].disabled) { + checkboxes[i].checked = ""; + } } } @@ -1270,7 +1280,7 @@ sub wishlistMove { $wishlistHTMLmove .= '
'.&mt("Please note that you can use the checkboxes corresponding to a folder to ". - "easily check all links within this folder. The folder structure itself can't be imported. ". - "All checked links will be imported into the current folder of your course.").'
'; + $inner .= + ''.&mt("Please note that you can use the checkboxes corresponding to a folder to ". - "easily check all links within this folder. The folder structure itself can't be imported. ") - .'
'; + $inner .= + ''.&mt('Note: where a Stored Link is unavailable for import in the current context it is grayed out.').'
'; + } $wishlistHTMLimport = ''; $inner .= '';