Page 1 of 1

Filebrowser: editorbrowser duplicates "Folder" in heading

Posted: Fri Dec 26, 2014 11:36 pm
by cmb
Hello Community,

I've noticed that the editorbrowser duplicates the term "Folder" in its headings. For instance, there is "Userfiles Folder Folder" or "Userfiles Ordner Ordner". The obvious solution would be the following patch:

Code: Select all

Index: plugins/filebrowser/classes/Filebrowser_View.php
===================================================================
--- plugins/filebrowser/classes/Filebrowser_View.php	(revision 3)
+++ plugins/filebrowser/classes/Filebrowser_View.php	(working copy)
@@ -187,7 +187,7 @@
 
         $title = isset($tx['title']['userfiles'])
             ? utf8_ucfirst($tx['title']['userfiles'])
-            : ucfirst('Userfiles ' . $this->translate('folder'));
+            : ucfirst('Userfiles');
         $html = '<ul><li class="openFolder"><a href="?'
             . htmlspecialchars($this->linkParams, ENT_QUOTES, 'UTF-8') . '">'
             . $title . ' ' . $this->lang['folder'] . '</a>';
However, this should be carefully investigated and double-checked (I wonder why $this->translate('folder') has been introduced in the first place).

Anyway, we should fix this minor bug bug for XH 1.6.5.

Christoph

Re: Filebrowser: editorbrowser duplicates "Folder" in headin

Posted: Sun Dec 28, 2014 5:48 pm
by cmb
cmb wrote:I wonder why $this->translate('folder') has been introduced in the first place
translate('folder') has been there for a long a time. The bug, however, had been introduced in r1061 when I revised the doc blocks and noticed that $plugin_tx is used in Filebrowser_View::folderList() instead of the usually more fitting Filebrowser_View::lang[]. For the editorbrowser $plugin_tx is undefined, but Filebrowser_View::lang[] is defined, so the duplication happened.

Therefore the patch suggested above is the Right[tm] solution. Done (r1422).

BTW: the text "Userfiles" should be internationalized, but I suggest to delay that until XH 1.7, when the filebrowser will hopefully be refactored to rid editorbrowser.php. I've set a @todo note to not forget about it.