[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm

damieng damieng at source.lon-capa.org
Thu Jun 18 11:10:52 EDT 2015


damieng		Thu Jun 18 15:10:52 2015 EDT

  Modified files:              
    /loncom/interface	lonsearchcat.pm 
  Log:
  search: fixed bug 6774 + opening previews in a modal, as with import
  
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.346 loncom/interface/lonsearchcat.pm:1.347
--- loncom/interface/lonsearchcat.pm:1.346	Tue Jun 16 20:24:39 2015
+++ loncom/interface/lonsearchcat.pm	Thu Jun 18 15:10:52 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.346 2015/06/16 20:24:39 damieng Exp $
+# $Id: lonsearchcat.pm,v 1.347 2015/06/18 15:10:52 damieng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3332,7 +3332,7 @@
         '<b>'.$prefix.
         '<img src="'.&Apache::loncommon::icon($values{'url'}).'" alt="" />'.' '.
         '<a href="'.$jumpurl.'?inhibitmenu=yes" '.
-        'target="preview">'.$values{'title'}."</a></b>\n".
+        'target="preview" onclick="openMyModal(this.href, 500, 500, \'yes\');return false;">'.$values{'title'}."</a></b>\n".
         &display_tools($values{'title'}, $jumpurl).
         "<p>\n".
         '<b>'.$values{'author'}.'</b>,'.
@@ -3465,7 +3465,7 @@
     my $link = '<br />'.&display_url($jumpurl,1).'<br />';
     $result .=
         '<a href="'.$jumpurl.'?inhibitmenu=yes"'.
-        ' target="preview">'.$values{'title'}.'</a>'.
+        ' target="preview" onclick="openMyModal(this.href, 500, 500, \'yes\');return false;">'.$values{'title'}.'</a>'.
         &display_tools($values{'title'}, $jumpurl).<<END;
 <br />
 $link<br />
@@ -3511,7 +3511,7 @@
     }
     $jumpurl = &HTML::Entities::encode($jumpurl,'<>&"');
     $result.=' <span class="LC_nobreak">'.
-	'<a href="'.$jumpurl.'?inhibitmenu=yes" target="preview">'.
+	'<a href="'.$jumpurl.'?inhibitmenu=yes" target="preview" onclick="openMyModal(this.href, 500, 500, \'yes\');return false;">'.
         &HTML::Entities::encode($values{'title'},'<>&"').'</a></span> '.
         &display_tools($values{'title'}, $jumpurl).
 	$link.' <b>'.$values{'author'}.'</b> ('.$values{'domain'}.')';
@@ -3531,8 +3531,13 @@
                   $url,
                   'preview',
                   '',
-                  (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),
+                  '',
                   $skiplast).' ';
+        # replace the links to open in a new window
+        # (because the search opens in a new window, it gets
+        # confusing when the links open a tab in the
+        # parent window; ideally we should not force windows)
+        $link =~ s/(href="[^"]*")/\1 onclick="window.open(this.href, '_blank', 'toolbar=1,location=1,menubar=0');return false;"/g;
     }
     return $link;
 }




More information about the LON-CAPA-cvs mailing list