prasathmani / tinyfilemanager

Single-file PHP file manager, browser and manage your files efficiently and easily with tinyfilemanager
https://tinyfilemanager.github.io
GNU General Public License v3.0
5.03k stars 1.68k forks source link

Impossible to set on default editor.session.setMode("ace/mode/php"); (PHP theme) in advanced editor #1199

Open forcash2019 opened 5 months ago

forcash2019 commented 5 months ago

Hi I can't figure it out how to set on default PHP theme

I can sucessfully set editor.session.setMode("ace/mode/php_laravel_blade"); php_laravel_blade":"PHP (Blade Template) based on this section function renderThemeMode() but when i'm trying to do it for just PHP theme ("php":"PHP") it's just not working!

can you explain me on which line I need to make this modification?

tobypeschel commented 5 days ago

I had the same issue and resolved it by setting inline to false:

var editor = ace.edit("editor");
editor.getSession().setMode({
    path: "ace/mode/<?php echo $ext; ?>",
    inline: false
});

After that change, .php files were opening with their mode as PHP as expected.