]> git.p6c8.net - devedit.git/commitdiff
Added a checkbox for editing a file after creating it
authorpcanterino <>
Mon, 24 May 2010 10:08:17 +0000 (10:08 +0000)
committerpcanterino <>
Mon, 24 May 2010 10:08:17 +0000 (10:08 +0000)
devedit.pl
modules/Command.pm
templates/dirlist.htm

index 87afee436416af3105f43bf3cbb3c3dda7edf663..d74a1bce0716a3e8f91ef9bd08c79af9164befde 100644 (file)
@@ -30,7 +30,7 @@ use Command;
 use Output;
 use Tool;
 
-$VERSION = '3.1';
+$VERSION = '3.2-dev';
 
 # Path to configuration file
 # Change if necessary!
index 8fcf6d6f35b575a851bdd90a40edddc4537b7b83..431eb4dea6bc8ba22964cb6dc2762be0e99250c1 100644 (file)
@@ -6,7 +6,7 @@ package Command;
 # Execute Dev-Editor's commands
 #
 # Author:        Patrick Canterino <patrick@patshaping.de>
-# Last modified: 2009-12-29
+# Last modified: 2010-05-24
 #
 # Copyright (C) 1999-2000 Roland Bluethgen, Frank Schoenmann
 # Copyright (C) 2003-2009 Patrick Canterino
@@ -493,7 +493,15 @@ sub exec_mkfile($$)
   return error($config->{'errors'}->{'file_exists'},$dir,{FILE => $new_virtual}) if(-e $new_physical);
 
   file_create($new_physical) or return error($config->{'errors'}->{'mkfile_failed'},$dir,{FILE => $new_virtual});
-  return devedit_reload({command => 'show', file => $dir});
+  
+  if($data->{'cgi'}->param('edit'))
+  {
+   return devedit_reload({command => 'beginedit', file => $new_virtual});
+  }
+  else
+  {
+   return devedit_reload({command => 'show', file => $dir});
+  }
  }
  else
  {
index 10ade36ba964c9ff9553c38a875dcecebbbb4af2..4777d4189a1c16e8a3ef605912328d0c17bbbdb7 100644 (file)
@@ -44,7 +44,7 @@
 <form action="{SCRIPT}">
 <input type="hidden" name="command" value="mkfile">
 <input type="hidden" name="curdir" value="{DIR}">
-<td>{DIR} <input type="text" name="newfile"> <input type="submit" value="Create!"></td>
+<td>{DIR} <input type="text" name="newfile"> <input type="submit" value="Create!"> <input type="checkbox" name="edit" id="edit" value="1"><label for="edit">Open file for editing</label></td>
 </form>
 </tr>
 {IF dir_writeable}

patrick-canterino.de