Active
Project:
TinyBrowser
Version:
6.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2010 at 10:31 UTC
Updated:
26 Feb 2010 at 22:25 UTC
I just needed tinybrowser to upload images and not add them to any editors (not even plain text).
I did this to use a Forms API button:
function tw_node_form($form_state) {
//Upload images
if(module_exists('tinybrowser')){
drupal_add_js(drupal_get_path('module', 'tinybrowser') .'/tinybrowser/tb_standalone.js.php');
$form['uploadsubmit'] = array(
'#type' => 'submit',
'#value' => t('Upload Images'),
'#attributes' => array("onclick" => 'tinyBrowserPopUp("image","edit-preview"); return(false);'),
);
$form['preview'] = array(
'#type' => 'textarea',
'#rows' => 1,
'#disabled' => TRUE,
);
}
}
The textarea is needed to fool the tinyBrowserPopUp function, it is not used.
Maybe the developer can add another function in a future release that does not need to check for a textarea.
Thanks for a very handy module.
Quentin
Comments
Comment #1
pixture commentedYes, what you did is the best for that purpose. Currently TinyBrowser opens up a new window(or tab) and display the selected file/image/media when the specified form field ID is not textarea (or input type=text with the next release). The reason I made it this way was to make it behave as same as IMCE. I never thought the use case like you did. I will think this as a possible feature to investigate.
Thanks,
Comment #2
bryancasler commentedI like the idea of this