Admin tool: "Addon File Editor (AFE)"

This tool enables you to view, edit, delete, create, upload or backup files of installed Add-ons such as modules, templates and languages from LEPTON backend without downloading the files first. You can also create installation packages off installed Add-ons, ready for installation from LEPTON backend.

@author:
Christian Sommer (doc)
LEPTON Project
@copyright:
Christian Sommer © 2008-2010
LEPTON Project © 2010-2014
@license:
GNU General Public license 3.0
@translations:
Christian Sommer (doc)
@platform:
LEPTON 2.x

Quick navigation:

A: Installation

  1. Download "addon_file_editor_xx.zip" and install it via backend: -> Add-ons -> Modules
  2. Access the tool from the backend: -> Admin-Tools -> Addon File Editor.

B: Requirements and Limitations

Only Add-ons which fulfill the following criterias can be edited by the Addon File Editor:

  1. add-ons must be listed in the database table "addons"
  2. add-ons must be readable from PHP
  3. a index.php file must exist in the main folder of the Add-on
  4. to edit add-on files highlighted red, you must activate the FTP layer first (see section D)

C: Working with Addon File Editor

Add-on Overview:

The tool creates a list with all installed Add-ons, when invoked via: -> Admin-Tools -> Addon File Editor.

The Add-ons are grouped into three sections: Modules, Templates and Languages. If Javascript is enabled, the sections are automatically collapsed. You can expand/collapse the sections by mouse click. The settings are stored in a Cookie and will be remembered during the lifetime of the Cookie.

To open the files and folders of a specific Add-on in the file manager, click on the Addon name. To create a backup of an installed Add-on with all files and folders contained, click on the download symbol on the right hand site of the overview list.

File manager:

The file manager shows the files and folders of a specific Add-on. Per default, only files with "recognized" file extensions are displayed (text, images, archives). You can change the "recognized" file extension via config.inc.php. To display all files, adjust $show_all_files in config.inc.php.

To edit a text file, or to view an image in a new browser window, click on the file name. To "rename" or "delete" files, click one the action icons on the right hand site of the file manager.

You can create new files/folders or upload a file via the action links shown at the top of the file manager. The Reload option forces to read in all files and folders again. Use this option if you have installed a new Addon.

If Pixlr support is enabled (config.inc.php), an edit icon is also shown for images. Click on the edit icon to transfer the image from your webspace to the online image editor Pixlr for further editing. When you save the file in Pixlr, the file will be donwloaded to your webserver and renamed into image_name.pixlr.jpg. The original image therefore remains untouched (you can delete it if it is no longer required). Your browser requires a Flash Plugin to use the Pixlr service. For details view Chapter D.

D: Settings and Configuration

Most settings can be changed via configuration file config.inc.php located in the Addon File Editor folder. You can add or remove file types for text, image, and archives. The following file types are known by default:

Files with other extensions than the ones listed above are hidden by default ($show_all_files = false). To hide certain Add-ons, add their directory name to the array $hidden_addons = array(). If you add 'addon_file_editor" to this array, you can not change the config.inc.php file from AFE anymore.

The maximum allowed file size for uploads is limited to 2 MB ($max_upload_size = 2), Pixlr support is disabled per default ($pixlr_support = false).

The tool integrates an optional FTP layer, which allows you to access Add-ons normally owned by the ftp-user (like core templates or core modules uploaded via FTP). You can configure the FTP layer with the FTP assistant via: http://yourdomain.com/modules/addon_file_editor/ftp_assistant.php
File which can only be edited with the FTP support enabled are highlighted in red.

E: Pixlr Image Editing (FAQ)

For image editing, the 3rd party online photo editing service http://pixlr.com is used. To use Pixlr, the following requirments must be given:

  1. You must enable this feature manually by setting $pixlr_support = true; (config.inc.php)
  2. Your browser requires the Adobe Flash Player Plugin
  3. The image must exist on your webserver and be accessible from the WWW (localhost will not work)
  4. The image must be read- and writeable by PHP (no FTP support implemented yet)
  5. The following formats are supported: Read (gif, jpg, png); Write: (jpg, png)

Please note:
Your images are uploaded to pixlr.com and deleted automatically from their server after 5 minutes. Please read the Pixlr FAQ before using this service.

F: Troubleshooting

When you invoke the Addon File Editor, the current status of the installed Add-ons is analysed and cached. This allows to browse the Addon File Editor without re-loading the Add-on files again. This however comes to one price. If you install or deinstall Add-ons via backend once the Addon File Editor was invoked, you have to RELOAD the Add-on files to reflect the changes in the file system. This can be done by clicking on the [ Reload ] link in the top of the overview list or the file browser. If you still have problems, try to clear your browser cache, cookies and session variables (e.g. by log-out) then try again.

Have fun.