@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | if (empty($document_data)) { |
71 | - $document_id = $parent_id = 0; |
|
71 | + $document_id = $parent_id = 0; |
|
72 | 72 | $path = '/'; |
73 | 73 | } else { |
74 | 74 | $document_id = $document_data['id']; |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | |
202 | 202 | // Link back to the documents overview |
203 | 203 | if ($is_certificate_mode) { |
204 | - $actions = '<a href="document.php?id='.$document_id.'&selectcat=' . $selectcat.'&'.api_get_cidreq().'">'. |
|
205 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
204 | + $actions = '<a href="document.php?id='.$document_id.'&selectcat='.$selectcat.'&'.api_get_cidreq().'">'. |
|
205 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
206 | 206 | } else { |
207 | 207 | $actions = '<a href="document.php?id='.$document_id.'&'.api_get_cidreq().'">'. |
208 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
208 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | // Link to create a folder |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | if ($action == 'delete') { |
27 | 27 | CourseCategory::deleteNode($categoryId); |
28 | 28 | Display::addFlash(Display::return_message(get_lang('Deleted'))); |
29 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
29 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
30 | 30 | exit(); |
31 | 31 | } elseif (($action == 'add' || $action == 'edit') && isset($_POST['formSent']) && $_POST['formSent']) { |
32 | 32 | if ($action == 'add') { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | } elseif ($action == 'moveUp') { |
56 | 56 | CourseCategory::moveNodeUp($categoryId, $_GET['tree_pos'], $category); |
57 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
57 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
58 | 58 | Display::addFlash(Display::return_message(get_lang('Updated'))); |
59 | 59 | exit(); |
60 | 60 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $form_title = ($action == 'add') ? get_lang('AddACategory') : get_lang('EditNode'); |
80 | 80 | if (!empty($category)) { |
81 | - $form_title .= ' ' . get_lang('Into') . ' ' . Security::remove_XSS($category); |
|
81 | + $form_title .= ' '.get_lang('Into').' '.Security::remove_XSS($category); |
|
82 | 82 | } |
83 | 83 | $url = api_get_self().'?action='.Security::remove_XSS($action).'&category='.Security::remove_XSS($category).'&id='.Security::remove_XSS($categoryId); |
84 | 84 | $form = new FormValidator('course_category', 'post', $url); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $vimeoMatch = preg_match('#://player.vimeo.com/#i', $matches[1]); |
62 | 62 | $googleMapsMatch = preg_match('#src="https://maps.google.com/#i', $matches[1]); |
63 | 63 | $slideShare = preg_match('#src="(https?:)?//www.slideshare.net/#', $matches[1]); |
64 | - $platformDomain = preg_match('#src="https?://(.+\.)?' . $hostName[1] . '#i', $matches[1]); |
|
64 | + $platformDomain = preg_match('#src="https?://(.+\.)?'.$hostName[1].'#i', $matches[1]); |
|
65 | 65 | |
66 | 66 | if ($youTubeMatch || $vimeoMatch || $googleMapsMatch || $slideShare || $platformDomain) { |
67 | 67 | $extra = ' frameborder="0"'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } elseif ($vimeoMatch) { |
71 | 71 | $extra .= ' webkitAllowFullScreen mozallowfullscreen allowFullScreen'; |
72 | 72 | } |
73 | - return '<iframe ' . $matches[1] . $extra . '></iframe>'; |
|
73 | + return '<iframe '.$matches[1].$extra.'></iframe>'; |
|
74 | 74 | } else { |
75 | 75 | return ''; |
76 | 76 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 0, //howMany |
75 | 75 | 1, //$orderby = 1 |
76 | 76 | 'ASC', |
77 | - -1, //visibility |
|
77 | + -1, //visibility |
|
78 | 78 | $_GET['q'], |
79 | 79 | null, //$urlId |
80 | 80 | true //AlsoSearchCode |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | if (!empty($course['category_code'])) { |
98 | 98 | $parents = CourseCategory::getParentsToString($course['category_code']); |
99 | - $title = $parents . $course['title']; |
|
99 | + $title = $parents.$course['title']; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $results['items'][] = array( |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | INNER JOIN $session_course_user r ON u.user_id = r.user_id |
177 | 177 | WHERE session_id = %d AND c_id = '%s' |
178 | 178 | AND (u.firstname LIKE '%s' OR u.username LIKE '%s' OR u.lastname LIKE '%s')"; |
179 | - $needle = '%' . $_GET['q'] . '%'; |
|
179 | + $needle = '%'.$_GET['q'].'%'; |
|
180 | 180 | $sql_query = sprintf($sql, $_GET['session_id'], $course['real_id'], $needle, $needle, $needle); |
181 | 181 | |
182 | 182 | $result = Database::query($sql_query); |
@@ -195,11 +195,11 @@ discard block |
||
195 | 195 | case 'search_exercise_by_course': |
196 | 196 | if (api_is_platform_admin()) { |
197 | 197 | $course = api_get_course_info_by_id($_GET['course_id']); |
198 | - $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0 ; |
|
198 | + $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0; |
|
199 | 199 | $exercises = ExerciseLib::get_all_exercises($course, $session_id, false, $_GET['q'], true, 3); |
200 | 200 | |
201 | 201 | foreach ($exercises as $exercise) { |
202 | - $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title']) ); |
|
202 | + $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title'])); |
|
203 | 203 | } |
204 | 204 | if (!empty($data)) { |
205 | 205 | $data[] = array('id' => 'T', 'text' => 'TODOS'); |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | $sql, |
225 | 225 | intval($_GET['course_id']), |
226 | 226 | intval($_GET['session_id']), |
227 | - '%' . Database::escape_string($_GET['q']).'%' |
|
227 | + '%'.Database::escape_string($_GET['q']).'%' |
|
228 | 228 | ); |
229 | 229 | $result = Database::query($sql_query); |
230 | 230 | while ($survey = Database::fetch_assoc($result)) { |
231 | - $survey['title'] .= ($survey['anonymous'] == 1) ? ' (' . get_lang('Anonymous') . ')' : ''; |
|
231 | + $survey['title'] .= ($survey['anonymous'] == 1) ? ' ('.get_lang('Anonymous').')' : ''; |
|
232 | 232 | $data[] = array( |
233 | 233 | 'id' => $survey['id'], |
234 | 234 | 'text' => strip_tags(html_entity_decode($survey['title'])) |
@@ -9,16 +9,16 @@ |
||
9 | 9 | /** |
10 | 10 | * Class constructor |
11 | 11 | */ |
12 | - public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
12 | + public function __construct($elementName = null, $elementLabel = null, $options = null, $attributes = null) |
|
13 | 13 | { |
14 | 14 | parent::__construct($elementName, $elementLabel, $options, $attributes); |
15 | 15 | // Get all languages |
16 | 16 | $themes = api_get_themes(); |
17 | 17 | $this->_options = array(); |
18 | 18 | $this->_values = array(); |
19 | - $this->addOption('--',''); // no theme select |
|
20 | - for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | - $this->addOption($themes[1][$i],$themes[0][$i]); |
|
19 | + $this->addOption('--', ''); // no theme select |
|
20 | + for ($i = 0; $i < count($themes[0]); $i++) { |
|
21 | + $this->addOption($themes[1][$i], $themes[0][$i]); |
|
22 | 22 | } |
23 | 23 | } |
24 | 24 | } |
@@ -14,28 +14,28 @@ discard block |
||
14 | 14 | * @param $form_name |
15 | 15 | * @param null $action |
16 | 16 | */ |
17 | - public function __construct($form_name, $action= null) |
|
17 | + public function __construct($form_name, $action = null) |
|
18 | 18 | { |
19 | 19 | parent :: __construct($form_name, 'post', $action); |
20 | 20 | $displayscore = ScoreDisplay :: instance(); |
21 | 21 | $customdisplays = $displayscore->get_custom_score_display_settings(); |
22 | 22 | |
23 | - $nr_items = (count($customdisplays)!='0') ? count($customdisplays) : '1'; |
|
24 | - $this->setDefaults(array ( |
|
23 | + $nr_items = (count($customdisplays) != '0') ? count($customdisplays) : '1'; |
|
24 | + $this->setDefaults(array( |
|
25 | 25 | 'scorecolpercent' => $displayscore->get_color_split_value() |
26 | 26 | )); |
27 | 27 | |
28 | 28 | $this->addElement('hidden', 'maxvalue', '100'); |
29 | 29 | $this->addElement('hidden', 'minvalue', '0'); |
30 | - $counter= 1; |
|
30 | + $counter = 1; |
|
31 | 31 | |
32 | 32 | //setting the default values |
33 | 33 | |
34 | - if(is_array($customdisplays)) { |
|
34 | + if (is_array($customdisplays)) { |
|
35 | 35 | foreach ($customdisplays as $customdisplay) { |
36 | - $this->setDefaults(array ( |
|
37 | - 'endscore[' . $counter . ']' => $customdisplay['score'], |
|
38 | - 'displaytext[' . $counter . ']' => $customdisplay['display'] |
|
36 | + $this->setDefaults(array( |
|
37 | + 'endscore['.$counter.']' => $customdisplay['score'], |
|
38 | + 'displaytext['.$counter.']' => $customdisplay['display'] |
|
39 | 39 | )); |
40 | 40 | $counter++; |
41 | 41 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $this->addElement('header', get_lang('ScoreEdit')); |
47 | 47 | |
48 | 48 | if ($displayscore->is_coloring_enabled()) { |
49 | - $this->addElement('html', '<b>' . get_lang('ScoreColor') . '</b>'); |
|
49 | + $this->addElement('html', '<b>'.get_lang('ScoreColor').'</b>'); |
|
50 | 50 | $this->addElement('text', 'scorecolpercent', array(get_lang('Below'), get_lang('WillColorRed'), '%'), array( |
51 | 51 | 'size' => 5, |
52 | 52 | 'maxlength' => 5, |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $this->addRule('scorecolpercent', get_lang('OnlyNumbers'), 'numeric'); |
61 | - $this->addRule(array('scorecolpercent','maxvalue'), get_lang('Over100'), 'compare', '<='); |
|
62 | - $this->addRule(array('scorecolpercent','minvalue'), get_lang('UnderMin'), 'compare', '>'); |
|
61 | + $this->addRule(array('scorecolpercent', 'maxvalue'), get_lang('Over100'), 'compare', '<='); |
|
62 | + $this->addRule(array('scorecolpercent', 'minvalue'), get_lang('UnderMin'), 'compare', '>'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | //Settings for the scoring system |
66 | 66 | |
67 | 67 | if ($displayscore->is_custom()) { |
68 | - $this->addElement('html', '<br /><b>' . get_lang('ScoringSystem') . '</b>'); |
|
68 | + $this->addElement('html', '<br /><b>'.get_lang('ScoringSystem').'</b>'); |
|
69 | 69 | $this->addElement('static', null, null, get_lang('ScoreInfo')); |
70 | 70 | $this->setDefaults(array( |
71 | 71 | 'beginscore' => '0' |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | 'input-size' => 2 |
78 | 78 | )); |
79 | 79 | |
80 | - for ($counter= 1; $counter <= 20; $counter++) { |
|
81 | - $renderer =& $this->defaultRenderer(); |
|
80 | + for ($counter = 1; $counter <= 20; $counter++) { |
|
81 | + $renderer = & $this->defaultRenderer(); |
|
82 | 82 | $elementTemplateTwoLabel = |
83 | - '<div id=' . $counter . ' style="display: '.(($counter<=$nr_items)?'inline':'none').';"> |
|
83 | + '<div id='.$counter.' style="display: '.(($counter <= $nr_items) ? 'inline' : 'none').';"> |
|
84 | 84 | |
85 | 85 | <!-- BEGIN required --><span class="form_required">*</span> <!-- END required --> |
86 | 86 | |
@@ -105,39 +105,39 @@ discard block |
||
105 | 105 | |
106 | 106 | '; |
107 | 107 | |
108 | - $elementTemplateTwoLabel2 =' |
|
108 | + $elementTemplateTwoLabel2 = ' |
|
109 | 109 | <div class="col-sm-2"> |
110 | 110 | <!-- BEGIN error --><span class="form_error">{error}</span> |
111 | 111 | <!-- END error --> |
112 | 112 | {element} |
113 | 113 | </div> |
114 | 114 | <div class="col-sm-1"> |
115 | - <a href="javascript:plusItem(' . ($counter+1) . ')"> |
|
116 | - <img style="display: '.(($counter>=$nr_items)?'inline':'none').';" id="plus-' . ($counter+1) . '" src="'.Display::returnIconPath('add.png').'" alt="'.get_lang('Add').'" title="'.get_lang('Add').'"></a> |
|
117 | - <a href="javascript:minItem(' . ($counter) . ')"> |
|
118 | - <img style="display: '.(($counter>=$nr_items && $counter!=1)?'inline':'none').';" id="min-' . $counter . '" src="'.Display::returnIconPath('delete.png').'" alt="'.get_lang('Delete').'" title="'.get_lang('Delete').'"></a> |
|
115 | + <a href="javascript:plusItem(' . ($counter + 1).')"> |
|
116 | + <img style="display: '.(($counter >= $nr_items) ? 'inline' : 'none').';" id="plus-'.($counter + 1).'" src="'.Display::returnIconPath('add.png').'" alt="'.get_lang('Add').'" title="'.get_lang('Add').'"></a> |
|
117 | + <a href="javascript:minItem(' . ($counter).')"> |
|
118 | + <img style="display: '.(($counter >= $nr_items && $counter != 1) ? 'inline' : 'none').';" id="min-'.$counter.'" src="'.Display::returnIconPath('delete.png').'" alt="'.get_lang('Delete').'" title="'.get_lang('Delete').'"></a> |
|
119 | 119 | </div> |
120 | 120 | </div> |
121 | 121 | </div>'; |
122 | 122 | |
123 | 123 | $scorebetw = array(); |
124 | - $this->addElement('text', 'endscore[' . $counter . ']', null, array ( |
|
124 | + $this->addElement('text', 'endscore['.$counter.']', null, array( |
|
125 | 125 | 'size' => 5, |
126 | 126 | 'maxlength' => 5, |
127 | 127 | 'id' => 'txta-'.$counter, |
128 | 128 | 'input-size' => 2 |
129 | 129 | )); |
130 | 130 | |
131 | - $this->addElement('text', 'displaytext[' . $counter . ']', null,array ( |
|
131 | + $this->addElement('text', 'displaytext['.$counter.']', null, array( |
|
132 | 132 | 'size' => 40, |
133 | 133 | 'maxlength' => 40, |
134 | 134 | 'id' => 'txtb-'.$counter |
135 | 135 | )); |
136 | - $renderer->setElementTemplate($elementTemplateTwoLabel, 'endscore[' . $counter . ']'); |
|
137 | - $renderer->setElementTemplate($elementTemplateTwoLabel2, 'displaytext[' . $counter . ']'); |
|
138 | - $this->addRule('endscore[' . $counter . ']', get_lang('OnlyNumbers'), 'numeric'); |
|
139 | - $this->addRule(array ('endscore[' . $counter . ']', 'maxvalue'), get_lang('Over100'), 'compare', '<='); |
|
140 | - $this->addRule(array ('endscore[' . $counter . ']', 'minvalue'), get_lang('UnderMin'), 'compare', '>'); |
|
136 | + $renderer->setElementTemplate($elementTemplateTwoLabel, 'endscore['.$counter.']'); |
|
137 | + $renderer->setElementTemplate($elementTemplateTwoLabel2, 'displaytext['.$counter.']'); |
|
138 | + $this->addRule('endscore['.$counter.']', get_lang('OnlyNumbers'), 'numeric'); |
|
139 | + $this->addRule(array('endscore['.$counter.']', 'maxvalue'), get_lang('Over100'), 'compare', '<='); |
|
140 | + $this->addRule(array('endscore['.$counter.']', 'minvalue'), get_lang('UnderMin'), 'compare', '>'); |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class UserForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_USER_INFO= 1; |
|
12 | + const TYPE_USER_INFO = 1; |
|
13 | 13 | const TYPE_SIMPLE_SEARCH = 3; |
14 | 14 | /** |
15 | 15 | * Builds a form containing form items based on a given parameter |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | * @param method |
20 | 20 | * @param action |
21 | 21 | */ |
22 | - public function __construct($form_type, $user, $form_name, $method= 'post', $action= null) |
|
22 | + public function __construct($form_type, $user, $form_name, $method = 'post', $action = null) |
|
23 | 23 | { |
24 | 24 | parent :: __construct($form_name, $method, $action); |
25 | - $this->form_type= $form_type; |
|
25 | + $this->form_type = $form_type; |
|
26 | 26 | if (isset ($user)) { |
27 | - $this->user_info= $user; |
|
27 | + $this->user_info = $user; |
|
28 | 28 | } |
29 | 29 | if (isset ($result_object)) { |
30 | - $this->result_object= $result_object; |
|
30 | + $this->result_object = $result_object; |
|
31 | 31 | } |
32 | 32 | if ($this->form_type == self :: TYPE_USER_INFO) { |
33 | 33 | $this->build_user_info_form(); |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | 'keyword' => Security::remove_XSS($_GET['search']) |
46 | 46 | )); |
47 | 47 | } |
48 | - $renderer =& $this->defaultRenderer(); |
|
48 | + $renderer = & $this->defaultRenderer(); |
|
49 | 49 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
50 | - $this->addElement('text','keyword',''); |
|
50 | + $this->addElement('text', 'keyword', ''); |
|
51 | 51 | $this->addButtonSearch(get_lang('Search'), 'submit'); |
52 | 52 | } |
53 | 53 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
62 | 62 | } |
63 | 63 | $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']); |
64 | - $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>'); |
|
64 | + $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:'.$this->user_info['email'].'">'.$this->user_info['email'].'</a>'); |
|
65 | 65 | $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']); |
66 | 66 | $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']); |
67 | 67 | $this->addButtonSave(get_lang('Back'), 'submit'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | parent :: display(); |
73 | 73 | } |
74 | 74 | |
75 | - function setDefaults($defaults= array(), $filter = null) |
|
75 | + function setDefaults($defaults = array(), $filter = null) |
|
76 | 76 | { |
77 | 77 | parent :: setDefaults($defaults, $filter); |
78 | 78 | } |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | * @param method |
22 | 22 | * @param action |
23 | 23 | */ |
24 | - public function __construct($form_type, $form_name, $method = 'post', $action = null, $target='', $locked_status) |
|
24 | + public function __construct($form_type, $form_name, $method = 'post', $action = null, $target = '', $locked_status) |
|
25 | 25 | { |
26 | - parent :: __construct($form_name, $method, $action,$target); |
|
26 | + parent :: __construct($form_name, $method, $action, $target); |
|
27 | 27 | $this->form_type = $form_type; |
28 | 28 | if ($this->form_type == self :: TYPE_IMPORT) { |
29 | 29 | $this->build_import_form(); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | protected function build_pdf_export_form() |
43 | 43 | { |
44 | - $renderer =& $this->defaultRenderer(); |
|
44 | + $renderer = & $this->defaultRenderer(); |
|
45 | 45 | $renderer->setCustomElementTemplate('<span>{element}</span>'); |
46 | 46 | $this->addElement('header', get_lang('ChooseOrientation')); |
47 | 47 | $this->addElement('radio', 'orientation', null, get_lang('Portrait'), 'portrait'); |
48 | 48 | $this->addElement('radio', 'orientation', null, get_lang('Landscape'), 'landscape'); |
49 | 49 | $this->addButtonExport(get_lang('Export')); |
50 | - $this->setDefaults(array ( |
|
50 | + $this->setDefaults(array( |
|
51 | 51 | 'orientation' => 'portrait' |
52 | 52 | )); |
53 | 53 | } |
@@ -59,19 +59,19 @@ discard block |
||
59 | 59 | $this->addElement('radio', 'file_type', null, 'XML (Extensible Markup Language)', 'xml'); |
60 | 60 | $this->addElement('radio', 'file_type', null, 'PDF (Portable Document Format)', 'pdf'); |
61 | 61 | $this->addButtonExport(get_lang('Export')); |
62 | - $this->setDefaults(array ( |
|
62 | + $this->setDefaults(array( |
|
63 | 63 | 'file_type' => 'csv' |
64 | 64 | )); |
65 | 65 | } |
66 | 66 | |
67 | - protected function build_export_form_option($show_pdf=true) |
|
67 | + protected function build_export_form_option($show_pdf = true) |
|
68 | 68 | { |
69 | 69 | $this->addElement('header', get_lang('ChooseFormat')); |
70 | 70 | $this->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV (Comma-Separated Values)', 'csv'); |
71 | 71 | $this->addElement('radio', 'file_type', null, 'XML (Extensible Markup Language)', 'xml'); |
72 | - $this->addElement('radio', 'file_type', Display::return_icon('info3.gif',get_lang('ToExportMustLockEvaluation')), 'PDF (Portable Document Format)', 'pdf', array('disabled')); |
|
72 | + $this->addElement('radio', 'file_type', Display::return_icon('info3.gif', get_lang('ToExportMustLockEvaluation')), 'PDF (Portable Document Format)', 'pdf', array('disabled')); |
|
73 | 73 | $this->addButtonExport(get_lang('Export')); |
74 | - $this->setDefaults(array ( |
|
74 | + $this->setDefaults(array( |
|
75 | 75 | 'file_type' => 'csv' |
76 | 76 | )); |
77 | 77 | } |
@@ -80,16 +80,16 @@ discard block |
||
80 | 80 | { |
81 | 81 | $this->addElement('hidden', 'formSent'); |
82 | 82 | $this->addElement('header', get_lang('ImportFileLocation')); |
83 | - $this->addElement('file', 'import_file',get_lang('Location')); |
|
84 | - $allowed_file_types = array ( |
|
83 | + $this->addElement('file', 'import_file', get_lang('Location')); |
|
84 | + $allowed_file_types = array( |
|
85 | 85 | 'xml', |
86 | 86 | 'csv' |
87 | 87 | ); |
88 | 88 | //$this->addRule('file', get_lang('InvalidExtension') . ' (' . implode(',', $allowed_file_types) . ')', 'filetype', $allowed_file_types); |
89 | - $this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)', 'csv'); |
|
90 | - $this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">' . get_lang('ExampleXMLFile') . '</a>)', 'xml'); |
|
91 | - $this->addElement('checkbox','overwrite', null,get_lang('OverwriteScores')); |
|
92 | - $this->addElement('checkbox','ignoreerrors',null,get_lang('IgnoreErrors')); |
|
89 | + $this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv'); |
|
90 | + $this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">'.get_lang('ExampleXMLFile').'</a>)', 'xml'); |
|
91 | + $this->addElement('checkbox', 'overwrite', null, get_lang('OverwriteScores')); |
|
92 | + $this->addElement('checkbox', 'ignoreerrors', null, get_lang('IgnoreErrors')); |
|
93 | 93 | $this->addButtonImport(get_lang('Ok')); |
94 | 94 | $this->setDefaults(array( |
95 | 95 | 'formSent' => '1', |
@@ -27,18 +27,18 @@ |
||
27 | 27 | |
28 | 28 | if (!empty($_POST)) |
29 | 29 | { |
30 | - foreach ( $_POST as $key => $value ) |
|
30 | + foreach ($_POST as $key => $value) |
|
31 | 31 | { |
32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
32 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) |
|
33 | 33 | continue; |
34 | 34 | |
35 | - if ( get_magic_quotes_gpc() ) |
|
36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
35 | + if (get_magic_quotes_gpc()) |
|
36 | + $value = htmlspecialchars(stripslashes((string) $value)); |
|
37 | 37 | else |
38 | - $value = htmlspecialchars( (string)$value ); |
|
38 | + $value = htmlspecialchars((string) $value); |
|
39 | 39 | ?> |
40 | 40 | <tr> |
41 | - <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
|
41 | + <th style="vertical-align: top"><?php echo htmlspecialchars((string) $key); ?></th> |
|
42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
43 | 43 | </tr> |
44 | 44 | <?php |