Hello Community,
the standard filebrowser has two modes of operation, sometimes called "CMS browser" and "editor browser". The former is used for direct access via the admin menu (Files -> ...); the latter is used from the editor. The separation of both modes is conceptionally necessary, and there's nothing wrong with it. However, I dislike that the "editor browser" is accessed via a separate file (namely plugins/filebrowser/editorbrowser.php), what has lead to code duplication (see for instance Filebrowser_View::fileList() vs. ::fileListForEditor()) and also blows up the session (e.g. the complete localization is stored there).
I can't see any good reason for a separate editorbrowser.php. It should work perfectly fine to go through index.php as usual for the "editor browser" as well, and this way we could simplify the filebrowser's code and slim down the session. Therefore I propose to refactor the filebrowser for CMSimple_XH 1.7 respectively.
Christoph
Refactor filebrowser to rid editorbrowser.php
Refactor filebrowser to rid editorbrowser.php
Christoph M. Becker – Plugins for CMSimple_XH
Re: Refactor filebrowser to rid editorbrowser.php
I'd like to suggest this patch. Note that the editorhooks for other editors than tinymce would still have to be patched, as well as the editor plugins themselves (cf. plugins/tinymce/init.php).
PS: Oops, nearly forgot to mention that the filebrowser defined $_SESSION['xh_session'] which is required by hi_updatecheck, and maybe other plugins. The patch removes this session variable. It might be reasonable to define it in the core (on login) for backward compatibility, but I'm not sure whether this is necessary, or a good idea at all.
PS: Oops, nearly forgot to mention that the filebrowser defined $_SESSION['xh_session'] which is required by hi_updatecheck, and maybe other plugins. The patch removes this session variable. It might be reasonable to define it in the core (on login) for backward compatibility, but I'm not sure whether this is necessary, or a good idea at all.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Refactor filebrowser to rid editorbrowser.php
Thought $_SESSION['xh_session'] is defined by the core . It's still defined when another filebrowser is active because the core includes all installed plugins.cmb wrote:PS: Oops, nearly forgot to mention that the filebrowser defined $_SESSION['xh_session'] which is required by hi_updatecheck, and maybe other plugins. The patch removes this session variable. It might be reasonable to define it in the core (on login) for backward compatibility, but I'm not sure whether this is necessary, or a good idea at all.
If you put "filebrowser" to the list of disabled plugins or deactivate it with hi_admin, $_SESSION['xh_session'] remains undefined.
So IMO it would be the best to get rid from $_SESSION['xh_session'].
Re: Refactor filebrowser to rid editorbrowser.php
No, it was a filebrowser thing from "the beginning" (r134). (Unfortunately, there are no older revisions regarding the Filebrowser in the SF repo , because the development of XH 1.5 happened mostly outside from it.)Holger wrote:Thought $_SESSION['xh_session'] is defined by the core .
I would like to do that.Holger wrote:So IMO it would be the best to get rid from $_SESSION['xh_session'].
Christoph M. Becker – Plugins for CMSimple_XH
Re: Refactor filebrowser to rid editorbrowser.php
+1cmb wrote:I would like to do that.
So maybe we could, as discussed by PM, rely on $_SESSION['xh_password'] instead...
Re: Refactor filebrowser to rid editorbrowser.php
Well, both solutions have a flaw: they don't check whether the user is logged in to the right installation, but rather whether the user is logged in to any CMSimple_XH installation on the domain (see also my PM).Holger wrote:So maybe we could, as discussed by PM, rely on $_SESSION['xh_password'] instead...
Christoph M. Becker – Plugins for CMSimple_XH
Re: Refactor filebrowser to rid editorbrowser.php
Done (r1518).cmb wrote:Therefore I propose to refactor the filebrowser for CMSimple_XH 1.7 respectively.
Christoph M. Becker – Plugins for CMSimple_XH