I'm trying to add an extra js file to an admin block and I would like to do that by php code.
Scenario
My block is a tab block for admin edit form so it extends Mage_Adminhtml_Block_Widget_Form
and implements Mage_Adminhtml_Block_Widget_Tab_Interface
My approach
In the tab block class __prepareLayout() method I have added this line:
$this->getLayout()->getBlock('head')->addJs('folder/gallery.js');
This should be ok but actually is not importing any js.