[LON-CAPA-cvs] cvs: loncom /publisher lonpubdir.pm lonretrieve.pm

www www at source.lon-capa.org
Fri Dec 23 12:21:18 EST 2011


www		Fri Dec 23 17:21:18 2011 EDT

  Modified files:              
    /loncom/publisher	lonpubdir.pm lonretrieve.pm 
  Log:
  Modal windows for retrieve and subsequent screens
  
  
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.139 loncom/publisher/lonpubdir.pm:1.140
--- loncom/publisher/lonpubdir.pm:1.139	Fri Dec 23 14:54:26 2011
+++ loncom/publisher/lonpubdir.pm	Fri Dec 23 17:21:18 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.139 2011/12/23 14:54:26 www Exp $
+# $Id: lonpubdir.pm,v 1.140 2011/12/23 17:21:18 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -596,11 +596,18 @@
 
 	if (!$meta_same) {
 	    $title = &mt('Metadata Modified').'<br />'.$title.
-		'<br /><a href="/adm/diff?filename=/priv/'.$linkfilename.'.meta'.
-		'&versiontwo=priv" target="cat">'.&mt('Metadata Diffs').'</a>';
-	    $title.="\n".'<br /><a href="/adm/retrieve?filename='.$linkfilename.'.meta" target="_parent">'.&mt('Retrieve Metadata').'</a>';
+		'<br />'.
+                &Apache::loncommon::modal_link(
+                    '/adm/diff?filename=/priv/'.$linkfilename.'.meta'.'&versiontwo=priv',
+                    &mt('Metadata Diffs'),600,500);
+	    $title.="\n".'<br />'.
+                &Apache::loncommon::modal_link(
+                    '/adm/retrieve?filename='.$linkfilename.'.meta&inhibitmenu=yes&add_modal=yes',
+                    &mt('Retrieve Metadata'),600,500);
 	}
-	$status.="\n".'<br /><a href="/adm/retrieve?filename='.$linkfilename.'" target="_parent">'.&mt('Retrieve').'</a>';
+	$status.="\n".'<br />'.
+             &Apache::loncommon::modal_link(
+                 '/adm/retrieve?filename='.$linkfilename.'&inhibitmenu=yes&add_modal=yes',&mt('Retrieve'),600,500);
     }
     my $editlink='';
     my $editlink2='';
Index: loncom/publisher/lonretrieve.pm
diff -u loncom/publisher/lonretrieve.pm:1.47 loncom/publisher/lonretrieve.pm:1.48
--- loncom/publisher/lonretrieve.pm:1.47	Mon Nov 14 00:20:31 2011
+++ loncom/publisher/lonretrieve.pm	Fri Dec 23 17:21:18 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to retrieve an old version of a file
 #
-# $Id: lonretrieve.pm,v 1.47 2011/11/14 00:20:31 raeburn Exp $
+# $Id: lonretrieve.pm,v 1.48 2011/12/23 17:21:18 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -118,7 +118,7 @@
     my ($main,$suffix,$is_meta) = &get_file_info($fn);
     
     if (-e $resfn) {  
-	$r->print('<form action="/adm/retrieve" method="post">'.
+	$r->print('<form action="/adm/retrieve?inhibitmenu=yes" method="post">'.
 		  '<input type="hidden" name="filename" value="/priv/'.$udom.'/'.$uname.$fn.'" />'.
 		  '<input type="hidden" name="phase" value="two" />'.
 		  &Apache::loncommon::start_data_table().
@@ -154,17 +154,18 @@
               '<td>'.&Apache::lonlocal::locallocaltime($rmtime).'</td>');
 		
 		if (!$is_meta) {
-		    $r->print('<td><a href="'.$urldir.$filename.'.meta" target="cat">'.
-			      &mt('Metadata Version').' '.$version.'</a></td>');
+		    $r->print('<td>'.
+                              &Apache::loncommon::modal_link($urldir.$filename.'.meta',
+			      &mt('Metadata Version [_1]',$version),550,450).'</td>');
 		}
 		if ($is_meta
 		    || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {
-		    $r->print(
-			      '<td><a target="cat" href="/adm/diff?filename=/priv/'.
-			      $udom,'/'.$uname.$fn.
-			      '&versiontwo=priv&versionone='.$version.
-			      '">'.&mt('Diffs with Version').' '.$version.
-			      '</a></td>');
+		    $r->print('<td>'.
+                              &Apache::loncommon::modal_link(
+                               '/adm/diff?filename=/priv/'.$udom,'/'.$uname.$fn.
+			      '&versiontwo=priv&versionone='.$version,
+			       &mt('Diffs with Version [_1]',$version),550,450).
+			      '</td>');
 		}
 		$r->print(&Apache::loncommon::end_data_table_row());
 	    }
@@ -177,16 +178,19 @@
           '<td>'.&Apache::lonlocal::locallocaltime($rmtime).'</td>'
     );
 	if (!$is_meta) {
-	    $r->print('<td><a href="'.$urldir.$main.'.'.$suffix.'.meta" target="cat">'.
-		      &mt('Metadata current version').'</a></td>');           
+	    $r->print('<td>',
+                      &Apache::loncommon::modal_link($urldir.$main.'.'.$suffix.'.meta',
+		      &mt('Metadata current version'),550,450).'</td>');           
 	}
 	if ($is_meta 
 	    || &Apache::loncommon::fileembstyle($suffix) eq 'ssi') {
-	    $r->print(
-		      '<td><a target="cat" href="/adm/diff?filename=/priv/'.
+	    $r->print('<td>'.
+                      &Apache::loncommon::modal_link(
+                       '/adm/diff?filename=/priv/'.
 		      $udom.'/'.$uname.$fn.
-		      '&versiontwo=priv'.
-		      '">'.&mt('Diffs with current Version').'</a></td>');
+		      '&versiontwo=priv',
+		      &mt('Diffs with current Version'),550,450).
+                      '</td>');
 	}
 	$r->print(&Apache::loncommon::end_data_table_row().
 		  &Apache::loncommon::end_data_table().
@@ -202,23 +206,6 @@
 	$r->print('<p class="LC_warning">'.&mt('No previous versions published.').'</p>');
     }
 
-    my $dir =  &Apache::loncommon::authorspace($fn)
-              .&File::Basename::dirname($fn)
-              .'/';
-    $r->print('<br />'
-             .&Apache::loncommon::head_subbox(
-                  &Apache::lonhtmlcommon::start_funclist()
-                 .&Apache::lonhtmlcommon::add_item_funclist(
-                     '<a href="/priv/'.$udom.'/'.$uname.$fn.'">'
-                    .&mt('Back to Resource')
-                    .'</a>')
-                 .&Apache::lonhtmlcommon::add_item_funclist(
-                     '<a href="'.$dir.'">'
-                    .&mt('Back to Directory')
-                    .'</a>')
-                 .&Apache::lonhtmlcommon::end_funclist()
-             )
-    );
 }
 
 # ---------------------------------- Interface for presenting specified version
@@ -259,6 +246,7 @@
                      .&mt('ok')
                      .'</span>');
             print $logfile "Copied sucessfully.\n\n";
+            $r->print(&Apache::lonhtmlcommon::scripttag('parent.location.reload();'));
         } else {
             my $error=$!;
 	    $r->print('<span class="LC_error">'
@@ -266,10 +254,6 @@
                      .'</span>');
             print $logfile "Copy failed: $error\n\n";
         }
-        $r->print('</p>'
-                 .'<p><a href="/priv/'.$udom.'/'.$uname.$fn.'">'
-                 .&mt('Back to Resource')
-                 .'</a></p>');
     } else {
        $r->print('<p class="LC_info">'.&mt('Please pick a version to retrieve:').'</p>');
        &phaseone($r,$fn,$uname,$udom);




More information about the LON-CAPA-cvs mailing list