Page 1 of 2

Editing TXT files in backend

Posted: Thu Apr 19, 2018 7:44 am
by Tata
Some Plugins use TXT files to store additional information used in outputs. Using e.g. imgalbum, with each image there is created its thumbnail, watermarked image and a textfile. Then using hi_kcfinder or elfinder_xh there is a way to see the files, but no option to open-edit-save them again. So if the admin wants to add som longer image description, it is only possible trough FTP. Is there a way to make it possible directly in the backend? Can this feature be included in one of the filemanagers (filemanager, hi_kcfinder, elfinder_xh) or is it easier to make the editor as a plugin?)
E.g.
txt-editor.jpg

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 11:20 am
by cmb
AFAIK, elfinder_xh already supports editing text files.

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 11:56 am
by Tata
cmb wrote:
Thu Apr 19, 2018 11:20 am
AFAIK, elfinder_xh already supports editing text files.
Actually it does. I just have not tested this on Host. And on localhost it returned
editor-txt.png

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 1:03 pm
by frase
On localhost (xampp), XH 1.7.2, PHP 7.1.1 it does.
elfinder.png
For XH 1.7.x you must use the master-file:
https://github.com/bbfriend/elfinder_xh ... master.zip

(No Plugin-Config available.)

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 2:09 pm
by cmb
The problem is that text files are not allowed to be edited for the downloads/ folder. If you access Files from the adminmenu directly, and then enter downloads/, it works. The allowed MIME types can be customized by changing $upload_allow here (this may only work for the CMS filebrowser; not for the editor filebrowsers).

Also note that the PHP ini option display_errors has to be disabled for PHP 7.2 at least, or that error_reporting has to be turned off; otherwise Deprecation notices cause malfunctions. It seems an update to latest elFinder is in order.

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 3:19 pm
by frase
[question in german, for better understanding ;-) ]
cmb wrote:
Thu Apr 19, 2018 2:09 pm
The problem is that text files are not allowed to be edited for the downloads/ folder. If you access Files from the adminmenu directly, and then enter downloads/, it works.
Bin mir nicht sicher, wie du das meinst.
Bei mir funktioniert das alles bestens.
Wenn ich "Dateien" im Adminmenü aufrufe, dann sowieso - egal ob in "downloads" oder "images" ...
Aber auch bei der Seitenbearbeitung im Editor, z.B. "Bild einfügen/bearbeiten".
Im "Quelle"-Dialog (Ordner-mit-Lupe-Symbol) kann ich mich durch die Verzeichnisse hangeln und txt-Files öffnen und bearbeiten.
In diesem Bearbeitungsfenster dann "speichern und schließen" wählen. Er tut es.

Wo liegt das Problem?
(XH-Filebrowser Konfiguration original)

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 3:46 pm
by Tata
frase wrote:
Thu Apr 19, 2018 3:19 pm
Im "Quelle"-Dialog (Ordner-mit-Lupe-Symbol) kann ich mich durch die Verzeichnisse hangeln und txt-Files öffnen und bearbeiten.
Das kann ich auch bestätigen. So funktioniert es auch am Localhost (MAMP v4.2.1 - PHP 7.1.8, CMSimple_XH v1.6.10)

Re: Editing TXT files in backend

Posted: Thu Apr 19, 2018 4:25 pm
by cmb
frase wrote:
Thu Apr 19, 2018 3:19 pm
Wo liegt das Problem?
Wenn ich im Adminmenü Dateien → Downloads wähle, dann kann ich .txt Dateien nicht speichern. Wähle ich Dateien, und öffne dann den downloads/ Ordner, dann klappt es. Ist auch nicht verwunderlich, dann für "downloads" wird nur "application" erlaubt, aber für "userfiles" auch "text" (plus die anderen, die für "images" und "media" erlaubt sind).

Re: Editing TXT files in backend

Posted: Fri Apr 20, 2018 7:00 am
by frase
cmb wrote:
Thu Apr 19, 2018 4:25 pm
Wenn ich im Adminmenü Dateien → Downloads wähle, dann kann ich .txt Dateien nicht speichern.
Ja, natürlich.
Tata wollte ja die Bildbeschreibungen im Backend ändern.
Also sollte es mit dem "Bild einfügen/bearbeiten"-Dialog doch ganz komfortabel zu lösen sein.

Re: Editing TXT files in backend

Posted: Fri Apr 20, 2018 8:58 am
by Tata
Genau das war mein Punkt. Es ist aber Geschmaks Frage. Ich lieber manchmal:
1. alle Bilder bearbeiten und für die Webseite algemein vorbereiten, in eine Galleriestruktur verteilen
2. die gesammte Gallerie hochladen
3. die Unterseiten für die jeweilige Albumsseiten vorbereiten
4. die Beschreibungen für die Bilder erstellen - hier wäre es mehr komfortable es im Filemanager machen.
Nutze ich aber imgalbum, kann ich wohl kaum mit einzelnen Bilder arbeiten, weil die erst durch Pluginaufruf auf der Seite gezeigt sind.
Es geht wirklich nur so, dass es nicht direkt die Images unter Files gewählt sind sondern erst Files, dann die Images und dann die "TXT" Bearbeitung.
Alles ist damit in Ordnung.
Danke für die Tips.