Editing TXT files in backend

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Editing TXT files in backend

Post by Tata » Thu Apr 19, 2018 7:44 am

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
You do not have the required permissions to view the files attached to this post.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Editing TXT files in backend

Post by cmb » Thu Apr 19, 2018 11:20 am

AFAIK, elfinder_xh already supports editing text files.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Editing TXT files in backend

Post by Tata » Thu Apr 19, 2018 11:56 am

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
You do not have the required permissions to view the files attached to this post.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Editing TXT files in backend

Post by frase » Thu Apr 19, 2018 1:03 pm

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.)
You do not have the required permissions to view the files attached to this post.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Editing TXT files in backend

Post by cmb » 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. 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.
Christoph M. Becker – Plugins for CMSimple_XH

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Editing TXT files in backend

Post by frase » Thu Apr 19, 2018 3:19 pm

[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)

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Editing TXT files in backend

Post by Tata » Thu Apr 19, 2018 3:46 pm

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)
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Editing TXT files in backend

Post by cmb » Thu Apr 19, 2018 4:25 pm

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).
Christoph M. Becker – Plugins for CMSimple_XH

frase
Posts: 5085
Joined: Thu Apr 21, 2016 6:32 am
Location: Saxony
Contact:

Re: Editing TXT files in backend

Post by frase » Fri Apr 20, 2018 7:00 am

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.

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Editing TXT files in backend

Post by Tata » Fri Apr 20, 2018 8:58 am

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.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Post Reply