Custom ajax image upload with crop/resize and form_builder
Hello,
I'd like to be able to upload pictures making use of an ajax-based uploader, and then be able to define crop areas for various size presets (square, rectangular, double square) using something like jcrop or similar.
The thing is, I'd like to add said functionality to an adv. module while still making use of the form_builder's form_fields() definitions - so that the rest of the form would benefit from all the built-in goodness.
So, the question is: what's the best way to achieve this?
I'd be tempted to add a 'custom' type of field to the $fields array with a lot of stuff in its 'after_html' index ... like taking a view and slamming it inside it... with all its JS calls and html - but i have the feeling I'm doing it wrong...
I'm sure I can't be the only one in need of something similar...
Any ideas?
Thanks!!!
Comments
http://www.getfuelcms.com/user_guide/modules/advanced
So, could you please clarify this :
If i were to make a controller alongside my models in an advanced module, could i load the models required and use the data table class to display the entries like they are with normal modules in the backend?
Which view should i take a look at if i wanted to replicate the looks of the entry listing sections of the backend?
Thanks a lot...
If your controller inherits from the Fuel_base_controller.php, you can use the "_render" method to have your view be displayed within the Admin shell.
There is a layout and block file that may be of interest located at:
fuel/modules/fuel/views/_layouts/module_list.php
fuel/modules/fuel/views/_blocks/module_list_table.php
$this->load->module_view(FUEL_FOLDER, '_blocks/module_list', $vars);