Hello,
I am trying to add an upload field with a QFfield_callback so i start by initiating the module but then i get this error:
Fatal: Using $this when not in object context in /home/site/public_html/crm/modules/Custom/CheckList/CheckListCommon_0.php on line 50
I know wat it means, but i don't know how to solve it in EPESI..
I searched for it in the docs first but it didn't help me out.
heres my code now:
public static function QFfield_file_upload(&$form, $field, $label, $mode, $default) {
if ($mode == 'add' || $mode == 'edit') {
$form = $this->init_module('Utils/FileUpload', array(false));
$form->set_upload_button_caption(__('Upload'));
$form->add_upload_element();
if ($mode == 'edit')
$form->setDefaults(array($field => $default));
} else {
$form->addElement('static', $field, $label);
$form->setDefaults(array($field => $default));
}
}
Greetings,
Andy