w3easyEditor / w3easyAdmin Manual

Online File and Folder (code & wysiwyg) Editor, Manager, Admin Tool and Backup Script

w3easyEditor / w3easyAdmin Manual

Postby admin » 01.07.2012 13:55

w3easyEditor, w3easyAdmin
(C) 2011/2012 by Joachim Haack, http://w3easy.org

PHP 5 (maybe also PHP 4 will do)
NO DATABASE required

GNU General Public License, Version 3

External Applications (w3easyAdmin only)
Integration prepared:
CKEditor version 3.6.1, revision 7072. License: GPL, LGPL, MPL or commercial
KCFinder version 2.51. License: GPL, LGPL
PHFTP version 4.2. License: GPL
JScrypt (integrated). License: Public Domain
Backup functions: See w3easyBackup script. Licenses: GPL

w3easyTools Integrated (w3easyAdmin only)
integrated resp. integration prepared:
w3easyProtect (integration prepared)

Warning: Concerning the backup function we strongly recommend to have a look at the 'Known Problems' section in the w3easyBackup script manual.

The w3easyEditor / w3easyAdmin is quite a powerful file editor resp. administration tool, so we should better call it the 'w3heavyEditor'...;).

It not only edits files containing the content, but literally all files of your site and also on your local pc, if you use it there, and it also edits files comprehending code (but except those including a textarea). This way you should always handle it with care, otherwise you could ruin your site in a fraction of a second...

The w3easyEditor / w3easyAdmin is coincidentally a basic file and folder manager that lets you create, rename and delete files and folders or copy files. A file and folder viewer is included, so that you will always keep a good overview about the achitecture of your site. There is also a functionality to chmod files and folders and the tool displays informations about the file/folder permissions, the respective owner of a file/folder, the realpath to a file/folder and the date and time when it was last edited.
To make the editing more easy there is an optional window showing some basic html tags to help you building up the html code by using copy and paste and also an optional preview that displays your work in progress.
Moreover with the w3easyEditor / w3easyAdmin you may execute file uploads.

In the w3easyEditor (only) I even added an option to change the skin between the corporate w3easyCMS design and the former original ('blue jeans') design. You won't nag about design, will you?

The w3easyAdmin (only) contains furthermore a backup function (same as in the w3easyBackup script) to backup your site resp. selected content files and folders.

Additionally the w3easAdmin (only) integrates some useful external applications resp. an integration of the following applications is prepared: The CKEditor (advanced wysiwyg editor), the KCFinder (primer as file- and upload manager for the CKEditor, but also as standalone uploader and image viewer), an online ftp manager (PHFTP), a text encryption tool (JScrypt, primer to encrypt login data f.e. for your ftp account) and the w3easyProtect script to easily password protect any directory on your sever with .htaccess protection.

First unpack and then upload the script folder to your webspace.
Make sure that only you have access to the scriptfolder. I'd recommend .htaccess directory protection using the w3easyProtect script.
(Note: If you upload the script to an already protected web directory, as it should be the case if you use the w3easyCMS, there is no additional directory protection necessary.)
Make sure that you have permission to edit the config file(s). Depending on your server settings chmod the config file(s) to 0666, 0664 or 0644 if necessary.
If you integrate external applications, you furthermore have to make writable the respective folders, where files may be edited or created.

First select with the quick file selector the preset config file(s) ('w3easyEditor: 'config.php' resp. 'config'; w3easyAdmin: 'w3eA_config.php' resp. 'easyAdmin_config' and 'w3eB_config' resp. 'easyBackup_config'). Then fill in the general values as described in the config settings. Most variables are self-explanatory, the others we describe below.

Code: Select all
// general
$domain        = "domain.tld"; // your domain (NO trailing slash)
$path_to_root  = "../../../"; // path to root (trailing slash)
$path_to_admin = "../"; // path to admin area (trailing slash)
$folder_base   = "./"; // (trailing slash)
$secure_edit   = ""; // "" or "yes" or "no"
$charset       = "UTF-8"; // "UTF-8", "iso-8859-1"

$path_to_admin: only to specify, if you have an admin area on your site.
$folder_base: asks for the path to the directory the w3easyAdmin shall display when it is called. The default value should be the root directory, so for a start you should fill in the same path as for the root directory. You may change it any later, if it occurs that another directory will better meet your purposes.
$secure_edit: If not set to 'no', you will have to confirm the editing of a file, i.e. you will have to check 2 radio buttons to edit a file. If set to 'no', you have to check only 1 radio button to edit a file.

The following settings (w3easyAdmin only) care for the integration of the external applications. If the modules shall be integrated, you better leave them as they are, otherwise you may outcomment them by 2 slashes at the beginning of the respective line:

Code: Select all
// application integration
$pt_cke_cfg       = "modules/ckeditor/ckeditor.js";
$pt_w3eA_cke_cfg  = "../w3eA_cke_cfg.js";
$pt_w3eA_kcf_fr   = "modules/w3eA_kcf_frame.php";
$pt_w3eA_phftp_fr = "modules/w3eA_phftp_frame.php";
$pt_w3eProtect    = "modules/w3easyProtect";
$pt_w3eA_jscrypt  = "modules/jscrypt/w3eA_jscrypt.php";

With the individual settings you may preselect folders and files that you need more often for your work. See the examples below:

Code: Select all
// quick folder
$name_quick_folder_1 = "w3easyAdmin"; // selection name
$path_quick_folder_1 = "./"; // path to quick folder

// quick_file
$name_quick_file_1 = "easyAdmin_config"; // selection name
$file_quick_file_1 = "w3eA_config.php"; // file incl. extension(s)
$path_quick_file_1 = "./"; // path to file (Same folder = "./")

Settings for the backup function (w3easyAdmin only):
Warning: Concerning the backup function we strongly recommend to have a look at the 'Known Problems' section in the w3easyBackup script manual.
To configure the backup settings, select with the quick file selector the preset backup config file ('w3eB_config.php' resp. 'easyBackup_config'). Fill in the values as described in the config. Most variables are self-explanatory, the others we describe below.

Code: Select all
// general backup settings
$configBackupDir = 'backup/'; // backup directory
$configEmail     = ''; // email address for backup file

// files and folders to backup resp. to skip
// root files
$root_files      = 'yes'; // backup rootfiles? 'yes' or ''

// directories/files to backup (relative path, trailing slash)
$configBackup[]  = '../content/';

// directories/files to skip (relative path)
$configSkip[] = '../content/trash/';

// Databases you wish to backup, can be many (if tables array contains table names, only // those tables will be backed up)
$configBackupDB[] = array(
'server'   => 'localhost',
'username' => 'root',
'password' => 'password',
'database' => 'databasename',
'tables'   => array()
// or alternatively:
// 'tables'   => array('table_1', 'table_2', 'table_3')

Concerning the databases settings, replace the example values with your specific values!

External Applications Integration
The integration of some external applications (see 'External Applications' near page top) in the w3easyAdmin is already prepared. Note, that the links to the external applications near the top of the w3easyAdmin window will only be displayed, if the respective links are specified (and not outcommented) in the 'w3eA_config.php' file.
More detailed informations about the integration and usage of the external applications you might find in the w3easyCMS Dokumentation or for sure in the respective applications documentations.

CKEditor (WYSIWYG Editor)
Download, unpack and then upload the the CKEditor folder in the following directory (btw: you don't need to upload the '_source' folder): 'w3easyAdmin/modules/'. The name of the folder, where the ckeditor is uploaded, has to be: 'ckeditor'.
We have already prepared a custom CKEditor configuration file ('/modules/w3eA_cke_cfg.js') so that you can use the CKEditor without further preparation.

The job described in this paragraph is already done by us, but for those, who might be interested in this stuff, this is, how the 'custom configuration file' integration worked:
I pointed the ckeditor instance to a custom configuration file named 'w3eA_cke_cfg.js' and put the file beneath the CKEditor folder. The custom configuration file is basically a copy of the original config.js, that may be customized f.e. by specific CKEditor toolbar settings without changing any original file.
Path from the file, where the CKEditor is integrated, to the ckeditor/config.js:
$pt_cke_cfg = path from 'w3easyAdmin/index.php' => 'modules/ckeditor/ckeditor.js'.
Path from the 'modules/ckeditor/ckeditor.js' file to the custom config file:
$pt_w3eA_cke_cfg = path from 'modules/ckeditor/ckeditor.js' => 'modules/w3eA_cke_cfg.js'.

KCFinder (File Manager, Uploader and Image Viewer)
Download, unpack and then upload the the KCFinder script folder to the following directory: 'w3easyAdmin/modules/'. The name of the folder, where the kcfinder is uploaded, has to be: 'kcfinder'.
Now we have to tell the KCFinder where the upload folder is located. This we have to specify in the '/kcfinder/config.php' file. Thus we have to change the respective entry (relative path from the KCFinder folder to our site's upload folder:
'uploadURL' => 'path/to/upload'
In the case of the w3easyCMS the path will be: 'uploadURL' => '../../../../../upload'.

The job described in this paragraph is already done by us, but for those, who might be interested in this stuff, this is, how the integration of the KCFinder to the CKEditor worked:
To integrate the KCFinder as custom file manager in the CKEditor, we use once again the custom CKEditor configuration file that we already created for customizimg the CKEditor toolbar. There we have to specify the paths from the file, where the CKEditor editor instance is settled (= our w3easyAdmin index file) to the files, where the KCFinder browser and uploader is started. For either the uploader as the browser handles 3 different upload directories (= files, images, flash), we have to set 2x3 = 6 (!;) paths to the KCFinder start files.
'w3easyAdmin/index.php' => 'modules/kcfinder/browse.php?type=xy' (x 3)
'w3easyAdmin/index.php' => 'modules/kcfinder/upload.php?type=xy' (x 3)

To use the KCFinder also without the CKEditor, we integrated the tool in the 'w3easyAdmin/modules/w3eA_kcf_frame.php' file. Calling this file (by the link on the top right of the w3easyAdmin window) you may use the KCFinder as a comfortable standalone image and media file uploader and even as a famous image (pre)viewer.

PHFTP (Online FTP Manager)
Download, unpack and then upload the the PHFTP folder in the following directory: '/w3easyAdmin/modules/'. The name of the folder, where the PHFTP is uploaded, has to be: 'phftp'.
To use the PHFTP web ftp manager you have to create a '/tmp/' folder anywhere on your web space, to make it writable (by chmoding it to 777 maybe) and to specifiy the path to the folder in the '/phftp/config/config.php' file. The path to the /tmp/ folder has to be the realpath.
To determine the realpath, navigate with the w3easyAdmin to the respective /tmp/ folder. Then have a look at the bottom of the application. There the realpath is displayed.

The Backup Function and the JScrypt tool is already integrated.
Furthermore you may integrate the w3easyProtect script by uploading the script in the 'w3easyAdmin/modules/' folder and specifying the path to the script in the 'w3eA_config.php' file.

Always be careful with what you edit, delete or rename - as said in the beginning the w3easyEditor may be quite an alluring but powerful devil...
It is strongly recommended first to try out and play around carefully with the w3easyEditor in a secure environment for testing before you get productive...
Note: For any file or folder editing operation the we3asyEditor needs adequate file/folder permissions. Mainly it should work in a directory that has 777 permissions and with a file that has 666 permissions (but not always, as I exprienced lately!!!). But these permissions are not recommended. In many cases the script should also work in a 755/644 or a 775/664 permission environment, if the script is the owner of the file. The script becomes regularly the owner of a file/folder, if it created the file/folder. So if you have difficulties with permissions, you could temporarily set the respective folder permissions with a ftp manager to 777, then you can create the files/folders you want to have editable with the editor and after this you can reset the permissions to 755/644. Now the script is the owner of the created files and should be able to edit them also within a 755/644 permissions environment. Note, that this trick will not work in the root directory, because in most cases you cannot create the root directory by the editor script.

Practical Usage
The basic principles the w3easyEditor follows are:
If you want the w3easyEditor to do something, you have to define a task by checking a radio button or select an entry or both and then press the submit button. If you press the submit button without having checked or selected anything, the w3easyEditor will keep your edits virtually in memory, but will not save it to a file. So if you want to save your work, you first have to check the respective radio button or select something and then you have to press submit.
To create a new directory or file you have to specify the name of the file resp. folder in the respective text input lines on the right above the radio buttons. Then check the respective radio button and press submit.
To copy or rename a file you first have to select the file to copy or to rename. Then specify the new name of the file in the respective text input line on the right above the radio buttons. Then check the respective radio button and press submit.
To edit or chmod a file or a folder select the respective file/folder. To save your changes, check the resp. radio button and press submit.

Zorry for my bad English, have fun and take it w3easy... ;)
User avatar
Posts: 21
Joined: 17.03.2011 17:36

Return to w3easyAdmin / w3easyEditor

Who is online

Users browsing this forum: No registered users and 1 guest