[LON-CAPA-cvs] cvs: modules /gerd/harvesting londocs.pm
www
www at source.lon-capa.org
Sat Jul 7 17:02:37 EDT 2012
www Sat Jul 7 21:02:37 2012 EDT
Modified files:
/modules/gerd/harvesting londocs.pm
Log:
All changes for recommender prototype in londocs done.
Index: modules/gerd/harvesting/londocs.pm
diff -u modules/gerd/harvesting/londocs.pm:1.3 modules/gerd/harvesting/londocs.pm:1.4
--- modules/gerd/harvesting/londocs.pm:1.3 Sat Jul 7 16:09:18 2012
+++ modules/gerd/harvesting/londocs.pm Sat Jul 7 21:02:37 2012
@@ -4,7 +4,7 @@
#
# Documents
#
-# $Id: londocs.pm,v 1.3 2012/07/07 16:09:18 www Exp $
+# $Id: londocs.pm,v 1.4 2012/07/07 21:02:37 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -49,11 +49,6 @@
use Cwd;
use LONCAPA qw(:DEFAULT :match);
-# Need this to evaluate basket
-#
-use Apache::lonindexer();
-#
-
my $iconpath;
my %hash;
@@ -66,7 +61,6 @@
my %help=();
-
sub mapread {
my ($coursenum,$coursedom,$map)=@_;
return
@@ -2617,14 +2611,44 @@
<input type="hidden" name="active" value="bb" />
SEDFFORM
#
-# Take out the search button.
-# Insert basket contents
- my $basket="1,2,3,4,5,6";
+# ============== All changes for prototype recommender in this area:
+#
+# * Take out the search button.
+# * Insert basket contents
+#
+ my $basketcontainer= ($env{'form.pagepath'}) ? 'page'
+ : 'sequence';
+ my $basketfolder=$env{'form.folder'};
+ if ($basketfolder eq '') {
+ $basketfolder='default';
+ }
+
+
+
+ my ($errtext,$fatal) = &mapread($coursenum,$coursedom,
+ $basketfolder.'.'.$basketcontainer);
+#
+# Remember for recommender
+#
+
+ my $basket='';
+ foreach my $res (@LONCAPA::map::resources) {
+ my ($title,$id)=split(/\:/,$res);
+ if ($id=~/\/res\//) {
+ $basket.=','.&escape($id);
+ }
+ }
#
my @simpleeditdefaultforma = (
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport(\''.$basket.'\');"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport(\"$basket\");'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" },
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{lnks}.'" onclick="javascript:open_StoredLinks_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_StoredLinks_Import();'>$lt{'lnks'}</a>" },
);
+
+#
+# ===================== End Recommender Prototype Changes
+#
+
+
$simpleeditdefaultform .= &create_form_ul(&create_list_elements(@simpleeditdefaultforma));
$simpleeditdefaultform .=(<<SEDFFORM);
<hr id="bb_hrule" style="width:0px;text-align:left;margin-left:0" />
More information about the LON-CAPA-cvs
mailing list