I want to add a avatar image upload field for admin users.
I want when you go to system > permissions > users, and click the "Add New User" button, a image upload section is within the add new user form.
My plan is to use the following code to create a new column in the "admin_user" database table, to store the image link.
$installer = $this;
$installer->startSetup();
$installer->getConnection()->addColumn($installer->getTable('admin_user'),'avatar', 'varchar(255) NOT NULL DEFAULT "0"');
This would then make it easy to call and display said image wherever i need to.
$this->getUser()->getAvatar()
The issue is, i dont know how to add a image uploader and have it generate a link and place it in the database field.
Please provide as much info as possible. Any help will be greatly appreciated.
UPDATE 26/07/2015:
With the help provided in the accepted answer, I was able to create a module that provide some of the features I need. I see that the image uploader is now shown in the form, the image name is saved to the database, but unfortunately, I don't see the image in the media folder. Could someone help me to solve this last section please?
Please find the code used in accepted answer below.
Best Answer
You Need to override core magento code here -
here we have generated a custom module which will do this and override the core functionality -
Namespace - "A2bizz"
Generate below Directory Paths and their corresponding files and put the given code in it -
Now create a directory named 'avatar' inside media folder and continue with your installer to generate field to your desired place.
Hope it will work for you.
[EDITED]