I'm getting the following Javascript alert when I click the 'browse' button on the image insert popup of the WYSIWYG:
error: error in [unknown object].fireEvent():
event name: open_browser_callback
error message: MediabrowserUtility is not defined
So it looks like mage/adminhtml/browser.js
isn't being included which is where MediabrowserUtility
is defined.
My Form.php file for this page looks like this:
<?php
class Limesharp_Playzone_Block_Adminhtml_Competition_Edit_Form extends Mage_Adminhtml_Block_Widget_Form{
protected function _prepareForm(){
if (Mage::getSingleton('adminhtml/session')->getCompetitionData())
{
$data = Mage::getSingleton('adminhtml/session')->getCompetitionData();
Mage::getSingleton('adminhtml/session')->getCompetitionData(null);
}
elseif (Mage::registry('competition_data'))
{
$data = Mage::registry('competition_data')->getData();
}
else
{
$data = array();
}
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
'method' => 'post',
'enctype' => 'multipart/form-data',
));
$form->setUseContainer(true);
$this->setForm($form);
$fieldset = $form->addFieldset('competition_form', array(
'legend' =>Mage::helper('playzone')->__('Competition Details')
));
...
$fieldset->addField('details', 'editor', array(
'label' => Mage::helper('playzone')->__('Details'),
'name' => 'details',
'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(),
'wysiwyg' => true
));
$form->setValues($data);
return parent::_prepareForm();
}
protected function _prepareLayout(){
parent::_prepareLayout();
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
}
}
}
What needs to happen for that file to be included?