Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document type detection #183

Closed
nk932714 opened this issue May 30, 2019 · 6 comments · Fixed by #400
Closed

Document type detection #183

nk932714 opened this issue May 30, 2019 · 6 comments · Fixed by #400

Comments

@nk932714
Copy link

nk932714 commented May 30, 2019

It would be awesome if file manager automatically recognize the document type.
image

Example :- if we are editing php file then document type should automatically pick php template. But it is picking only JavaScript. we have to manually change this to php.

However is there any way to set default language to php from javaScript. because I'm working only on Php files. So every time after i click save i have to choose php template. its annoying.

@prasathmani
Copy link
Owner

image
e.g. editor.getSession().setMode( {path:"ace/mode/php", inline:true} );
note : dropdown selection will not change

@nk932714
Copy link
Author

Thanks buddy for your quick reply. It helps.
But the problem is that now I'm unable to switch to JavaScript. Anyways i don't need JavaScript.
eg: I'm editing http://xxxx.xxx/tinyfilemanager.php?p=&edit=tinyfilemanager.php here editing edit=tinyfilemanager.php then it should choose mode automatically. i.e php in this case. and if i'm editing http://xxxx.xxx/tinyfilemanager.php?p=&edit=translation.json then it should choose mode to Json.

I believe a simple this code would be ok for this

<?php if (isset($_GET['edit'])) { $filename_= $_GET["edit"]; $ext_ = pathinfo($filename_, PATHINFO_EXTENSION);	}     else { $ext_= "javascript";      } ?>

editor.getSession().setMode( {path:"ace/mode/<?php echo $ext_; ?>", inline:true} ); ```

@prasathmani
Copy link
Owner

In next release I will add this feature

@nk932714
Copy link
Author

nk932714 commented Jun 3, 2019

Thanks @prasathmani

prasathmani pushed a commit that referenced this issue Jul 23, 2019
view file is insecure #187
Get files size (recursive) #186
There is no possibility for translation for some hints (title =) #185
View dirSize instead of word "Folder" #184
Document type detection #183
Stored Cross-site Scripting (XSS) Vulnerability detected in File Names #180
strings in code #177
Remove tracking #164
@prasathmani
Copy link
Owner

@nk932714 , your suggestion added.

@nk932714
Copy link
Author

Thanks a lot @prasathmani

prasathmani pushed a commit that referenced this issue Jul 20, 2020
Fixes setting drop down boxes to the current ace editor mode and theme on page load.
ner00 pushed a commit to ner00/tinyfilemanager that referenced this issue May 7, 2023
view file is insecure prasathmani#187
Get files size (recursive) prasathmani#186
There is no possibility for translation for some hints (title =) prasathmani#185
View dirSize instead of word "Folder" prasathmani#184
Document type detection prasathmani#183
Stored Cross-site Scripting (XSS) Vulnerability detected in File Names prasathmani#180
strings in code prasathmani#177
Remove tracking prasathmani#164
ner00 pushed a commit to ner00/tinyfilemanager that referenced this issue May 7, 2023
Fixes setting drop down boxes to the current ace editor mode and theme on page load.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants