]> git.p6c8.net - devedit.git/commitdiff
When viewing a file, insert the contents of the file into the template AFTER
authorpcanterino <>
Sat, 23 Oct 2004 13:29:13 +0000 (13:29 +0000)
committerpcanterino <>
Sat, 23 Oct 2004 13:29:13 +0000 (13:29 +0000)
parsing the "editable" {IF}-block.
(Ever tried to view the viewfile.htm template file using Dev-Editor? Oh my god!)

modules/Command.pm

index 1479e2a15c826cd188349ea3dfa04345c10d12c0..d14fec105323e589227e1480b3bbf2be3a9928c0 100644 (file)
@@ -6,7 +6,7 @@ package Command;
 # Execute Dev-Editor's commands
 #
 # Author:        Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-10-22
+# Last modified: 2004-10-23
 #
 
 use strict;
@@ -222,9 +222,10 @@ sub exec_show($$)
     $tpl->fillin("DIR",upper_path($virtual));
     $tpl->fillin("URL",equal_url($config->{'httproot'},$virtual));
     $tpl->fillin("SCRIPT",$script);
-    $tpl->fillin("CONTENT",encode_entities($$content));
 
-    $tpl->parse_if_block("editable",-r $physical && -w $physical && -T $physical && not ($config->{'max_file_size'} && $size > $config->{'max_file_size'}) && $uselist->unused($virtual));
+    $tpl->parse_if_block("editable",-r $physical && -w $physical && -T $physical && not ($config->{'max_file_size'} && $size > $config->{'max_file_size'}) && $uselist->unused($virtual)); 
+
+    $tpl->fillin("CONTENT",encode_entities($$content));
    }
   }
  }
@@ -270,7 +271,7 @@ sub exec_beginedit($$)
    return error($config->{'errors'}->{'file_too_large'},upper_path($virtual),{SIZE => $config->{'max_file_size'}})
   }
   else
-   {
+  {
    # Text file
 
    $uselist->add_file($virtual);

patrick-canterino.de