@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | // Show message to confirm that a tool it to be hidden from available tools |
23 | 23 | // visibility 0,1->2 |
24 | 24 | if (!empty($_GET['askDelete'])) { |
25 | - $content .='<div id="toolhide">'.get_lang('DelLk').'<br /> |
|
25 | + $content .= '<div id="toolhide">'.get_lang('DelLk').'<br /> |
|
26 | 26 | <a href="'.api_get_self().'">'.get_lang('No').'</a> | |
27 | 27 | <a href="'.api_get_self().'?delete=yes&id='.$id.'">'.get_lang('Yes').'</a> |
28 | 28 | </div>'; |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | |
50 | 50 | // Start of tools for CourseAdmins (teachers/tutors) |
51 | 51 | if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) { |
52 | - $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;"> |
|
52 | + $content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;"> |
|
53 | 53 | <div class="normal-message" id="id_normal_message" style="display:none">'; |
54 | - $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/> '; |
|
55 | - $content .= get_lang('PleaseStandBy'); |
|
56 | - $content .= '</div> |
|
54 | + $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/> '; |
|
55 | + $content .= get_lang('PleaseStandBy'); |
|
56 | + $content .= '</div> |
|
57 | 57 | <div class="alert alert-success" id="id_confirmation_message" style="display:none"></div> |
58 | 58 | </div>'; |
59 | 59 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $list2 = CourseHome::get_tools_category(TOOL_COURSE_PLUGIN); |
80 | 80 | |
81 | 81 | $my_list = array_merge($my_list, $list2); |
82 | - $items = CourseHome::show_tools_category($my_list); |
|
82 | + $items = CourseHome::show_tools_category($my_list); |
|
83 | 83 | $content .= return_block(get_lang('Interaction'), $items, 'course-tools-interaction'); |
84 | 84 | |
85 | 85 | $my_list = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | <span class="viewcaption">'.get_lang('SessionData').'</span> |
95 | 95 | <table class="course_activity_home">'; |
96 | 96 | $content .= CourseHome::show_session_data($session_id); |
97 | - $content .= '</table></div></div>'; |
|
97 | + $content .= '</table></div></div>'; |
|
98 | 98 | } |
99 | 99 | |
100 | - $content .= '<div class="row">'; |
|
100 | + $content .= '<div class="row">'; |
|
101 | 101 | $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); |
102 | 102 | $content .= CourseHome::show_tools_category($my_list); |
103 | 103 | $content .= '</div>'; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | $html = '<div class="row"> |
181 | 181 | <div class="col-xs-12 col-md-12"> |
182 | - <div class="title-tools">' . $title . '</div> |
|
182 | + <div class="title-tools">' . $title.'</div> |
|
183 | 183 | </div> |
184 | 184 | </div> |
185 | 185 | <div class="row '.$class.'">'.$content.'</div>'; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | array(), |
357 | 357 | null, |
358 | 358 | ICON_SIZE_MEDIUM |
359 | - ) . ' ' . $tool_name . '</a>'; |
|
359 | + ).' '.$tool_name.'</a>'; |
|
360 | 360 | |
361 | 361 | // This part displays the links to hide or remove a tool. |
362 | 362 | // These links are only visible by the course manager. |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | $session_id = api_get_session_id(); |
697 | 697 | $is_platform_admin = api_is_platform_admin(); |
698 | 698 | |
699 | - if ($session_id == 0 ) { |
|
699 | + if ($session_id == 0) { |
|
700 | 700 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true) && api_is_course_admin(); |
701 | 701 | } else { |
702 | 702 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true) && !api_is_coach(); |
@@ -1072,8 +1072,8 @@ discard block |
||
1072 | 1072 | |
1073 | 1073 | $toolName = api_underscore_to_camel_case($toolName); |
1074 | 1074 | |
1075 | - if (isset($GLOBALS['Tool' . $toolName])) { |
|
1076 | - return get_lang('Tool' . $toolName); |
|
1075 | + if (isset($GLOBALS['Tool'.$toolName])) { |
|
1076 | + return get_lang('Tool'.$toolName); |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | return $toolName; |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | $navigation_items = self::get_navigation_items(true); |
1173 | 1173 | $course_id = api_get_course_id(); |
1174 | 1174 | |
1175 | - $class= null; |
|
1175 | + $class = null; |
|
1176 | 1176 | $idLearn = null; |
1177 | 1177 | $item = null; |
1178 | 1178 | $marginLeft = 160; |
@@ -1197,10 +1197,10 @@ discard block |
||
1197 | 1197 | } else if (api_get_setting('show_navigation_menu') == 'icons') { |
1198 | 1198 | $class = 'icons'; |
1199 | 1199 | $marginLeft = 25; |
1200 | - $item = Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1200 | + $item = Display::return_icon(substr($navigation_item['image'], 0, -3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1201 | 1201 | } else { |
1202 | 1202 | $class = 'icons-text'; |
1203 | - $item = $navigation_item['name'] . Display::return_icon(substr($navigation_item['image'],0,-3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1203 | + $item = $navigation_item['name'].Display::return_icon(substr($navigation_item['image'], 0, -3)."png", $navigation_item['name'], array('class'=>'tool-img'), ICON_SIZE_SMALL); |
|
1204 | 1204 | } |
1205 | 1205 | |
1206 | 1206 | if (stristr($url_item['path'], $url_current['path'])) { |
@@ -1212,13 +1212,13 @@ discard block |
||
1212 | 1212 | if (strpos($navigation_item['link'], 'chat') !== false && |
1213 | 1213 | api_get_course_setting('allow_open_chat_window', $course_id) |
1214 | 1214 | ) { |
1215 | - $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . ' " href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$navigation_item['target'].'"'; |
|
1215 | + $html .= '<a '.$idLearn.' class="btn btn-default text-left '.$class.' " href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.api_get_course_id().'\',config=\'height=\'+600+\', width=\'+825+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="'.$navigation_item['target'].'"'; |
|
1216 | 1216 | $html .= ' title="'.$navigation_item['name'].'">'; |
1217 | - $html .= $item; |
|
1217 | + $html .= $item; |
|
1218 | 1218 | $html .= '</a>'; |
1219 | 1219 | } else { |
1220 | - $html .= '<a ' . $idLearn . ' class="btn btn-default text-left ' . $class . '" href="'.$navigation_item['link'].'" target="_top" title="'.$navigation_item['name'].'">'; |
|
1221 | - $html .= $item; |
|
1220 | + $html .= '<a '.$idLearn.' class="btn btn-default text-left '.$class.'" href="'.$navigation_item['link'].'" target="_top" title="'.$navigation_item['name'].'">'; |
|
1221 | + $html .= $item; |
|
1222 | 1222 | $html .= '</a>'; |
1223 | 1223 | } |
1224 | 1224 | |
@@ -1226,14 +1226,14 @@ discard block |
||
1226 | 1226 | } |
1227 | 1227 | $html .= '</ul>'; |
1228 | 1228 | $html .= '<script>$(function() { |
1229 | - $("#toolnavbox a").stop().animate({"margin-left":"-' . $marginLeft . 'px"},1000); |
|
1229 | + $("#toolnavbox a").stop().animate({"margin-left":"-' . $marginLeft.'px"},1000); |
|
1230 | 1230 | $("#toolnavbox > li").hover( |
1231 | 1231 | function () { |
1232 | 1232 | $("a",$(this)).stop().animate({"margin-left":"-2px"},200); |
1233 | 1233 | $("span",$(this)).css("display","block"); |
1234 | 1234 | }, |
1235 | 1235 | function () { |
1236 | - $("a",$(this)).stop().animate({"margin-left":"-' . $marginLeft . 'px"},200); |
|
1236 | + $("a",$(this)).stop().animate({"margin-left":"-' . $marginLeft.'px"},200); |
|
1237 | 1237 | $("span",$(this)).css("display","initial"); |
1238 | 1238 | } |
1239 | 1239 | ); |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | return array(); |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
1332 | + $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
1333 | 1333 | $sql = "SELECT * FROM $table |
1334 | 1334 | WHERE category in ('authoring','interaction') |
1335 | 1335 | AND c_id = $courseId |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | $temp = new Image($path); |
1436 | 1436 | $r = $temp->convert2bw(); |
1437 | 1437 | $ext = pathinfo($path, PATHINFO_EXTENSION); |
1438 | - $bwPath = substr($path,0,-(strlen($ext)+1)) . '_na.' . $ext; |
|
1438 | + $bwPath = substr($path, 0, -(strlen($ext) + 1)).'_na.'.$ext; |
|
1439 | 1439 | |
1440 | 1440 | if ($r === false) { |
1441 | 1441 | error_log('Conversion to B&W of '.$path.' failed in '.__FILE__.' at line '.__LINE__); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $course_id = api_get_course_int_id(); |
60 | 60 | $user_id = intval($user_id); |
61 | 61 | $sessionId = api_get_session_id(); |
62 | - $session_id_and = ' AND te.session_id = ' . $sessionId . ' '; |
|
62 | + $session_id_and = ' AND te.session_id = '.$sessionId.' '; |
|
63 | 63 | $exercise_id = intval($exercise_id); |
64 | 64 | |
65 | 65 | if (!empty($exercise_id)) { |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | te.c_id = ce.c_id $user_id_and $session_id_and AND |
96 | 96 | ce.active <>-1"; |
97 | 97 | } else { |
98 | - $user_id_and = ' AND te.exe_user_id = ' . api_get_user_id() . ' '; |
|
98 | + $user_id_and = ' AND te.exe_user_id = '.api_get_user_id().' '; |
|
99 | 99 | // get only this user's results |
100 | - $sql="SELECT ".(api_is_western_name_order() ? "firstname as userpart1, lastname userpart2" : "lastname as userpart1, firstname as userpart2").", |
|
100 | + $sql = "SELECT ".(api_is_western_name_order() ? "firstname as userpart1, lastname userpart2" : "lastname as userpart1, firstname as userpart2").", |
|
101 | 101 | official_code, |
102 | 102 | ce.title as extitle, |
103 | 103 | te.exe_result as exresult, |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $data .= get_lang('Title').';'; |
350 | 350 | $data .= get_lang('StartDate').';'; |
351 | 351 | $data .= get_lang('EndDate').';'; |
352 | - $data .= get_lang('Duration'). ' ('.get_lang('MinMinutes').') ;'; |
|
352 | + $data .= get_lang('Duration').' ('.get_lang('MinMinutes').') ;'; |
|
353 | 353 | $data .= get_lang('Score').';'; |
354 | 354 | $data .= get_lang('Total').';'; |
355 | 355 | $data .= get_lang('Status').';'; |
@@ -360,11 +360,11 @@ discard block |
||
360 | 360 | //results |
361 | 361 | foreach ($this->results as $row) { |
362 | 362 | if (api_is_western_name_order()) { |
363 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
364 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
363 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
364 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
365 | 365 | } else { |
366 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
367 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
366 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['last_name']), ENT_QUOTES, $charset)).';'; |
|
367 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['first_name']), ENT_QUOTES, $charset)).';'; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | // Official code |
@@ -373,8 +373,8 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | |
376 | - $data .= str_replace("\r\n",' ',api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';'; |
|
377 | - $data .= str_replace("\r\n",' ',implode(", ", GroupManager :: get_user_group_name($row['user_id']))).';'; |
|
376 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['email']), ENT_QUOTES, $charset)).';'; |
|
377 | + $data .= str_replace("\r\n", ' ', implode(", ", GroupManager :: get_user_group_name($row['user_id']))).';'; |
|
378 | 378 | |
379 | 379 | if ($export_user_fields) { |
380 | 380 | //show user fields data, if any, for this user |
@@ -386,13 +386,13 @@ discard block |
||
386 | 386 | true |
387 | 387 | ); |
388 | 388 | if (!empty($user_fields_values)) { |
389 | - foreach($user_fields_values as $value) { |
|
390 | - $data .= '"'.str_replace('"','""',api_html_entity_decode(strip_tags($value), ENT_QUOTES, $charset)).'";'; |
|
389 | + foreach ($user_fields_values as $value) { |
|
390 | + $data .= '"'.str_replace('"', '""', api_html_entity_decode(strip_tags($value), ENT_QUOTES, $charset)).'";'; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
395 | - $data .= str_replace("\r\n",' ', api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';'; |
|
395 | + $data .= str_replace("\r\n", ' ', api_html_entity_decode(strip_tags($row['title']), ENT_QUOTES, $charset)).';'; |
|
396 | 396 | $data .= str_replace("\r\n", ' ', $row['start_date']).';'; |
397 | 397 | $data .= str_replace("\r\n", ' ', $row['end_date']).';'; |
398 | 398 | $data .= str_replace("\r\n", ' ', $row['duration']).';'; |
@@ -20,26 +20,26 @@ discard block |
||
20 | 20 | use Symfony\Component\Console\Helper\HelperSet; |
21 | 21 | use Doctrine\DBAL\Types\Type; |
22 | 22 | |
23 | -(@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php'; |
|
23 | +(@include_once __DIR__.'/../vendor/autoload.php') || @include_once __DIR__.'/../../../autoload.php'; |
|
24 | 24 | |
25 | -$directories = array(getcwd(), getcwd() . DIRECTORY_SEPARATOR . 'config'); |
|
25 | +$directories = array(getcwd(), getcwd().DIRECTORY_SEPARATOR.'config'); |
|
26 | 26 | |
27 | 27 | $configFile = null; |
28 | 28 | foreach ($directories as $directory) { |
29 | - $configFile = $directory . DIRECTORY_SEPARATOR . 'cli-config.php'; |
|
29 | + $configFile = $directory.DIRECTORY_SEPARATOR.'cli-config.php'; |
|
30 | 30 | |
31 | 31 | if (file_exists($configFile)) { |
32 | 32 | break; |
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -if ( ! file_exists($configFile)) { |
|
36 | +if (!file_exists($configFile)) { |
|
37 | 37 | ConsoleRunner::printCliConfigTemplate(); |
38 | 38 | exit(1); |
39 | 39 | } |
40 | 40 | |
41 | -if ( ! is_readable($configFile)) { |
|
42 | - echo 'Configuration file [' . $configFile . '] does not have read permission.' . "\n"; |
|
41 | +if (!is_readable($configFile)) { |
|
42 | + echo 'Configuration file ['.$configFile.'] does not have read permission.'."\n"; |
|
43 | 43 | exit(1); |
44 | 44 | } |
45 | 45 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | $helperSet = require $configFile; |
67 | 67 | |
68 | -if ( ! ($helperSet instanceof HelperSet)) { |
|
68 | +if (!($helperSet instanceof HelperSet)) { |
|
69 | 69 | foreach ($GLOBALS as $helperSetCandidate) { |
70 | 70 | if ($helperSetCandidate instanceof HelperSet) { |
71 | 71 | $helperSet = $helperSetCandidate; |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | |
4 | -require_once __DIR__ . '/../../main/inc/global.inc.php'; |
|
4 | +require_once __DIR__.'/../../main/inc/global.inc.php'; |
|
5 | 5 | require_once __DIR__.'/CourseBlockPlugin.php'; |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . '/config.php'; |
|
3 | +require_once __DIR__.'/config.php'; |
|
4 | 4 | $plugin_info = CourseBlockPlugin::create()->get_info(); |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | $vid = isset($_REQUEST['vid']) ? $_REQUEST['vid'] : ''; |
113 | 113 | if ($vid) { |
114 | 114 | $vhosts = Database::select('*', 'vchamilo', array('where' => array('id = ?' => $vid))); |
115 | - $vhost = (object)array_pop($vhosts); |
|
115 | + $vhost = (object) array_pop($vhosts); |
|
116 | 116 | } else { |
117 | - $vhost = (object)$_configuration; |
|
117 | + $vhost = (object) $_configuration; |
|
118 | 118 | $vhost->slug = Virtual::getSlugFromUrl($vhost->root_web); |
119 | 119 | $vhost->id = 0; |
120 | 120 | } |
@@ -302,16 +302,16 @@ discard block |
||
302 | 302 | case 'clearcache': |
303 | 303 | // Removes cache directory. |
304 | 304 | if (empty($automation)) { |
305 | - if (array_key_exists('vids', $_REQUEST)) { |
|
305 | + if (array_key_exists('vids', $_REQUEST)) { |
|
306 | 306 | $toclear = Database::select('*', 'vchamilo', array('where' => array("id IN ('$vidlist')" => array()))); |
307 | 307 | } else { |
308 | 308 | $vid = isset($_REQUEST['vid']) ? $_REQUEST['vid'] : 0; |
309 | 309 | if ($vid) { |
310 | 310 | $vhosts = Database::select('*', 'vchamilo', array('where' => array('id = ?' => $vid))); |
311 | - $vhost = (object)array_pop($vhosts); |
|
311 | + $vhost = (object) array_pop($vhosts); |
|
312 | 312 | $toclear[$vhost->id] = $vhost; |
313 | 313 | } else { |
314 | - $toclear[0] = (object)$_configuration; |
|
314 | + $toclear[0] = (object) $_configuration; |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | } else { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | //$uploadPath = Virtual::getConfig('vchamilo', 'upload_real_root'); |
335 | 335 | |
336 | 336 | // Get instance archive |
337 | - $archivepath = api_get_path(SYS_ARCHIVE_PATH, (array)$instance); |
|
337 | + $archivepath = api_get_path(SYS_ARCHIVE_PATH, (array) $instance); |
|
338 | 338 | $templatepath = $archivePath.'/'.$instance['slug'].'/twig'; |
339 | 339 | Display::addFlash(Display::return_message("Deleting cache $templatepath \n")); |
340 | 340 | removeDir($templatepath); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $dataroot = $_REQUEST['dataroot']; |
21 | 21 | |
22 | 22 | $absalternatecourse = Virtual::getConfig('vchamilo', 'course_real_root'); |
23 | -if (!empty($absalternatecourse)){ |
|
23 | +if (!empty($absalternatecourse)) { |
|
24 | 24 | // this is the relocated case |
25 | 25 | $coursedir = str_replace('//', '/', $absalternatecourse.'/'.$dataroot); |
26 | 26 | } else { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | return $this->_form->display(); |
45 | 45 | } |
46 | 46 | |
47 | - public function definition_after_data(){ |
|
47 | + public function definition_after_data() { |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function return_form() |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | * @param bool $slashed true means return data with addslashes applied |
65 | 65 | * @return object submitted data; NULL if not valid or not submitted |
66 | 66 | */ |
67 | - public function get_data($slashed=true) |
|
67 | + public function get_data($slashed = true) |
|
68 | 68 | { |
69 | - $cform =& $this->_form; |
|
69 | + $cform = & $this->_form; |
|
70 | 70 | |
71 | 71 | if ($this->is_submitted() and $this->is_validated()) { |
72 | 72 | $data = $cform->exportValues(null, $slashed); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if (empty($data)) { |
75 | 75 | return null; |
76 | 76 | } else { |
77 | - return (object)$data; |
|
77 | + return (object) $data; |
|
78 | 78 | } |
79 | 79 | } else { |
80 | 80 | return null; |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @param bool $slashed true means return data with addslashes applied |
88 | 88 | * @return object submitted data; NULL if not submitted |
89 | 89 | */ |
90 | - public function get_submitted_data($slashed=true) |
|
90 | + public function get_submitted_data($slashed = true) |
|
91 | 91 | { |
92 | - $cform =& $this->_form; |
|
92 | + $cform = & $this->_form; |
|
93 | 93 | |
94 | 94 | if ($this->is_submitted()) { |
95 | 95 | $data = $cform->exportValues(null, $slashed); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (empty($data)) { |
98 | 98 | return null; |
99 | 99 | } else { |
100 | - return (object)$data; |
|
100 | + return (object) $data; |
|
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | return null; |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function is_cancelled() |
123 | 123 | { |
124 | - $cform =& $this->_form; |
|
125 | - if ($cform->isSubmitted()){ |
|
126 | - foreach ($cform->_cancelButtons as $cancelbutton){ |
|
127 | - if (optional_param($cancelbutton, 0, PARAM_RAW)){ |
|
124 | + $cform = & $this->_form; |
|
125 | + if ($cform->isSubmitted()) { |
|
126 | + foreach ($cform->_cancelButtons as $cancelbutton) { |
|
127 | + if (optional_param($cancelbutton, 0, PARAM_RAW)) { |
|
128 | 128 | return true; |
129 | 129 | } |
130 | 130 | } |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | * |
169 | 169 | * @return bool true if form data valid |
170 | 170 | */ |
171 | - public function validate_defined_fields($validateonnosubmit=false) |
|
171 | + public function validate_defined_fields($validateonnosubmit = false) |
|
172 | 172 | { |
173 | 173 | static $validated = null; // one validation is enough |
174 | - $cform =& $this->_form; |
|
174 | + $cform = & $this->_form; |
|
175 | 175 | |
176 | - if ($this->no_submit_button_pressed() && empty($validateonnosubmit)){ |
|
176 | + if ($this->no_submit_button_pressed() && empty($validateonnosubmit)) { |
|
177 | 177 | return false; |
178 | 178 | } elseif ($validated === null) { |
179 | 179 | $internal_val = $cform->validate(); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | $data = $cform->exportValues(null, true); |
193 | 193 | $chamilo_val = $this->validation($data, $files); |
194 | - if ((is_array($chamilo_val) && count($chamilo_val)!==0)) { |
|
194 | + if ((is_array($chamilo_val) && count($chamilo_val) !== 0)) { |
|
195 | 195 | // non-empty array means errors |
196 | 196 | foreach ($chamilo_val as $element => $msg) { |
197 | 197 | $cform->setElementError($element, $msg); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | return $nosubmit; |
218 | 218 | } |
219 | 219 | |
220 | - $cform =& $this->_form; |
|
220 | + $cform = & $this->_form; |
|
221 | 221 | $nosubmit = false; |
222 | 222 | if (!$this->is_submitted()) { |
223 | 223 | return false; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | public function set_data($default_values, $slashed = false) |
247 | 247 | { |
248 | 248 | if (is_object($default_values)) { |
249 | - $default_values = (array)$default_values; |
|
249 | + $default_values = (array) $default_values; |
|
250 | 250 | } |
251 | 251 | $filter = $slashed ? 'stripslashes' : NULL; |
252 | 252 | $this->_form->setDefaults($default_values, $filter); |
@@ -266,14 +266,14 @@ discard block |
||
266 | 266 | } |
267 | 267 | |
268 | 268 | $errors = array(); |
269 | - $mform =& $this->_form; |
|
269 | + $mform = & $this->_form; |
|
270 | 270 | |
271 | 271 | // check the files |
272 | 272 | $status = $this->_upload_manager->preprocess_files(); |
273 | 273 | |
274 | 274 | // now check that we really want each file |
275 | 275 | foreach ($_FILES as $elname => $file) { |
276 | - if ($mform->elementExists($elname) and $mform->getElementType($elname)=='file') { |
|
276 | + if ($mform->elementExists($elname) and $mform->getElementType($elname) == 'file') { |
|
277 | 277 | $required = $mform->isElementRequired($elname); |
278 | 278 | if (!empty($this->_upload_manager->files[$elname]['uploadlog']) && |
279 | 279 | empty($this->_upload_manager->files[$elname]['clear']) |