Menu

Add a new extension

Help
Herod2k
2009-12-14
2013-04-29
  • Herod2k

    Herod2k - 2009-12-14

    Hi, I'd like to add the .tpl (smarty) extension with the same properties of html.

    Thanks

    Herod2k

     
  • Tony Sutherland

    Tony Sutherland - 2010-08-09

    I modified the arrays in code.php to identify new extensions within the system.  These seemed to display in the drop down list when creating a new file, but, then subsequently, the system would not allow me to create a file with that extension.  It would also not allow a file to be uploaded with that extension - well, not strictly not allow the upload - because it actually did the upload successfully, it was just that when the file had been uploaded, it showed in the file list display on the left hand panel but the system would then not allow the file to be edited or viewed.  Is there some other area in the system whereby new extensions must be modified etc?

     
  • Tony Sutherland

    Tony Sutherland - 2010-08-09

    I read through a bunch of the code and found that in "add.php" line 50, the system checks that there is a file which exists called "template.ext" where "template" is the actual string "template" and "ext" is the extension of the file to be created.  Thus creating such a template file allows the file to now be created.  It places the newly created file in the tree display on the left, but it now can not be selected and edited.

     
  • Tony Sutherland

    Tony Sutherland - 2010-08-09

    Maybe finally fixed the problem.  In the code for "type.php" (in the code/tree folder), every single extension appears the be hard-coded into this code, with specific other fields specified for a particular type of extension.  Copying the "php" lines at the bottom of this file and making it "py" finally allowed the code to work for a new type of extension.
    At the end of the process, the conclusion is that it maybe a good idea to refactor some code to allow this new extension specification to all happen within the code.php file (or better still, have the complete code.php set of variables read in from a YAML file, for instance), to set the required controls.

     
  • QL Studio

    QL Studio - 2010-08-09

    Hi Tony,

    sorry not to have made that process a whole load simpler… this project is all but forgotten these days.. but there is still hope of an update with some of the more important problems being addressed - but perhaps not until winter ( unless anyone else fancies doing it first! ).

    good luck and thanks for the update.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.