New to this forum but I've been using Appgini for my prototypes for several years.
I made this hook/extension long time ago, thought it might be usefull for some. Didn't find anything like this in this forum, hence my contribution.
This hook extends the functionality of the standard WYSIWYG editor Appgini uses by default for editing html fields. More specifically, this hook adds image upload functionality to the default NicEditor without touching the database. Nothing gets overwritten and no need for configuration inside your Appgini Project. You can use it side by side with the default-provided NicEditor. See attached screenshot.
INSTRUCTIONS
------------------
- Create a folder inside the 'images' folder in the root of your generated application, name it 'uploadedImages'.*
- Create a folder inside your 'hooks' folder, name it 'editor'.
- Create 3 files inside the 'editor' directory: (provided as zip, attachment below)
- nicEdit.js (a modified version of the default nicEdit.js)
- nicEditorIcons.gif (extra buttons to be shown in the toolbar)
- nicupload.php (php script that will provide upload functionality)**
- Change the template/custom view of that page to load this editor configuration instead:
- this line:
Code: Select all
<script src="nicEdit.js"></script>
- becomes:
Code: Select all
<script src="hooks/editor/nicEdit.js"></script>
* if you want to change the upload directory you'll need to provide another folder (step 2), and change the following lines inside nicupload.php accordingly:
Code: Select all
define('NICUPLOAD_PATH', '../../images/uploadedImages');
Code: Select all
define('NICUPLOAD_URI', '../../images/uploadedImages');