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

banghart lon-capa-cvs@mail.lon-capa.org
Fri, 10 Sep 2004 20:48:33 -0000


banghart		Fri Sep 10 16:48:33 2004 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Prohibits deleting of portfolio root
  
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.44 loncom/interface/portfolio.pm:1.45
--- loncom/interface/portfolio.pm:1.44	Fri Sep 10 16:31:35 2004
+++ loncom/interface/portfolio.pm	Fri Sep 10 16:48:33 2004
@@ -74,7 +74,7 @@
 	      &Apache::lonhtmlcommon::select_recent('portfolio','currentpath',
 						    'this.form.submit();'));
     $r->print("</form>");
-    if ($is_empty) {
+    if ($is_empty && ($current_path ne '/')) {
         $displayOut = '<form method="post" action="/adm/portfolio">'.
         '<input type="hidden" name="action" value="deletedir" />'.
         '<input type="submit" name="deletedir" value="'.&mt("Delete Directory").'" />'.
@@ -379,7 +379,7 @@
 	my @dir_list=&Apache::lonnet::dirlist($current_path,
 					    $ENV{'user.domain'},
 					    $ENV{'user.name'},$portfolio_root);
-    if (@dir_list[0] eq 'no_such_dir'){
+    if ($dir_list[0] eq 'no_such_dir'){
         # two main reasons for this: 1) never been here, so directory structure not created
         #                            2) back-button navigation after deleting a directory
         if ($current_path eq '/'){