@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | * @param FormValidator $form |
| 30 | 30 | * @param int $fck_config |
| 31 | 31 | */ |
| 32 | - public function createForm (&$form, $fck_config=0) |
|
| 32 | + public function createForm(&$form, $fck_config = 0) |
|
| 33 | 33 | { |
| 34 | 34 | parent::createForm($form, $fck_config); |
| 35 | 35 | |
| 36 | 36 | if (!isset($_GET['editQuestion'])) { |
| 37 | - $form->addElement('file','imageUpload',array('<img src="'.Display::return_icon('hotspot.png', null, null, ICON_SIZE_BIG, false, true).'" />', get_lang('UploadJpgPicture')) ); |
|
| 37 | + $form->addElement('file', 'imageUpload', array('<img src="'.Display::return_icon('hotspot.png', null, null, ICON_SIZE_BIG, false, true).'" />', get_lang('UploadJpgPicture'))); |
|
| 38 | 38 | |
| 39 | 39 | // setting the save button here and not in the question class.php |
| 40 | 40 | // Saving a question |
| 41 | 41 | $form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion'); |
| 42 | 42 | //$form->addButtonSave(get_lang('GoToQuestion'), 'submitQuestion'); |
| 43 | - $form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array ('jpg', 'jpeg', 'png', 'gif')); |
|
| 43 | + $form->addRule('imageUpload', get_lang('OnlyImagesAllowed'), 'filetype', array('jpg', 'jpeg', 'png', 'gif')); |
|
| 44 | 44 | $form->addRule('imageUpload', get_lang('NoImage'), 'uploadedfile'); |
| 45 | 45 | } else { |
| 46 | 46 | // setting the save button here and not in the question class.php |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $_course = api_get_course_info(); |
| 61 | 61 | parent::processCreation($form, $objExercise); |
| 62 | 62 | |
| 63 | - if(!empty($file_info['tmp_name'])) { |
|
| 63 | + if (!empty($file_info['tmp_name'])) { |
|
| 64 | 64 | $this->uploadPicture($file_info['tmp_name'], $file_info['name']); |
| 65 | 65 | $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
| 66 | 66 | $picturePath = $documentPath.'/images'; |
@@ -75,12 +75,12 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - function createAnswersForm ($form) |
|
| 78 | + function createAnswersForm($form) |
|
| 79 | 79 | { |
| 80 | 80 | // nothing |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - function processAnswersCreation ($form) |
|
| 83 | + function processAnswersCreation($form) |
|
| 84 | 84 | { |
| 85 | 85 | // nothing |
| 86 | 86 | } |
@@ -101,25 +101,25 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - function createForm (&$form, $fck_config=0) |
|
| 104 | + function createForm(&$form, $fck_config = 0) |
|
| 105 | 105 | { |
| 106 | - parent::createForm ($form, $fck_config); |
|
| 106 | + parent::createForm($form, $fck_config); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - function processCreation ($form, $objExercise = null) |
|
| 109 | + function processCreation($form, $objExercise = null) |
|
| 110 | 110 | { |
| 111 | 111 | $file_info = $form -> getSubmitValue('imageUpload'); |
| 112 | - parent::processCreation ($form, $objExercise); |
|
| 112 | + parent::processCreation($form, $objExercise); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - function createAnswersForm ($form) |
|
| 115 | + function createAnswersForm($form) |
|
| 116 | 116 | { |
| 117 | - parent::createAnswersForm ($form); |
|
| 117 | + parent::createAnswersForm($form); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - function processAnswersCreation ($form) |
|
| 120 | + function processAnswersCreation($form) |
|
| 121 | 121 | { |
| 122 | - parent::processAnswersCreation ($form); |
|
| 122 | + parent::processAnswersCreation($form); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |