Hello,
excellent job! That is the right way how to achieve that.
Just create 2 clones of the original "FieldText.php" and "InputText.php" files. Rename it to "FieldFilepicker.php" under plugins/imanager/lib/processors/fields/
and "InputFilepicker.php" under plugins/imanager/lib/processors/inputs/
Rename the php classes in these files to "FieldFilepicker" and "InputFilepicker" and insert your code there that you posted above.
(just change the window.open line to
to make it a bit more dynamic)
Then edit the "plugins/imanager/tpl/row.fields.im.tpl" file and put there a new option line:
And make a backup of that file. That's all you need to do. Now you can select the File Picker field under the "Fields Menu".
At the next ItemManager release your files remain unchanged with the exception of row.fields.im.tpl, but you have created a copy of that file.
regards
excellent job! That is the right way how to achieve that.
Just create 2 clones of the original "FieldText.php" and "InputText.php" files. Rename it to "FieldFilepicker.php" under plugins/imanager/lib/processors/fields/
and "InputFilepicker.php" under plugins/imanager/lib/processors/inputs/
Rename the php classes in these files to "FieldFilepicker" and "InputFilepicker" and insert your code there that you posted above.
(just change the window.open line to
Code:
window.open("'.IM_SITE_URL.'plugins/i18n_specialpages/browser/filebrowser.php?func=fill_image_'.$this->id.'&type=images", "browser", "width=800,height=500,left=100,top=100,scrollbars=yes");
to make it a bit more dynamic)
Then edit the "plugins/imanager/tpl/row.fields.im.tpl" file and put there a new option line:
Code:
<option value="filepicker"[[selected-filepicker]]>File Picker</option>
At the next ItemManager release your files remain unchanged with the exception of row.fields.im.tpl, but you have created a copy of that file.
regards