type = HOT_SPOT; } function display(){ } function createForm ($form) { parent::createForm ($form); if(!isset($_GET['editQuestion'])) { $form->addElement('file','imageUpload',get_lang('UploadJpgPicture')); $form->addRule('imageUpload', get_lang('OnlyJPG'), 'mimetype',array('image/jpeg','image/pjpeg','image/gif','image/png')); $form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile'); } } function processCreation ($form, $objExercise) { $file_info = $form -> getSubmitValue('imageUpload'); parent::processCreation ($form, $objExercise); if(!empty($file_info['tmp_name'])) { $this->uploadPicture($file_info['tmp_name'], $file_info['name']); list($width,$height) = getimagesize($file_info['tmp_name']); if($width>=$height) $this->resizePicture('width',544); else $this->resizePicture('height',408); $this->save(); } } function createAnswersForm ($form) { // nothing } function processAnswersCreation ($form) { // nothing } } endif; ?>