@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | //Plugins NOT installed |
131 | 131 | echo Display::page_subheader(get_lang('Plugins')); |
132 | - echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token=' . $token . '">'; |
|
132 | + echo '<form class="form-horizontal" name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'&sec_token='.$token.'">'; |
|
133 | 133 | echo '<table class="data_table">'; |
134 | 134 | echo '<tr>'; |
135 | 135 | echo '<th width="20px">'; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $plugin_list = array(); |
143 | 143 | $my_plugin_list = $plugin_obj->get_plugin_regions(); |
144 | - foreach($my_plugin_list as $plugin_item) { |
|
144 | + foreach ($my_plugin_list as $plugin_item) { |
|
145 | 145 | $plugin_list[$plugin_item] = $plugin_item; |
146 | 146 | } |
147 | 147 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if (file_exists(api_get_path(SYS_PLUGIN_PATH).$plugin.'/readme.txt')) { |
181 | 181 | echo Display::url( |
182 | 182 | "<em class='fa fa-file-text-o'></em> readme.txt", |
183 | - api_get_path(WEB_PLUGIN_PATH) . $plugin . "/readme.txt", |
|
183 | + api_get_path(WEB_PLUGIN_PATH).$plugin."/readme.txt", |
|
184 | 184 | [ |
185 | 185 | 'class' => 'btn btn-default ajax', |
186 | 186 | 'data-title' => $plugin_info['title'], |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $show_name = ucwords(str_replace('_', ' ', $style_dir)); |
323 | 323 | |
324 | 324 | if ($is_style_changeable) { |
325 | - $list_of_names[$style_dir] = $show_name; |
|
325 | + $list_of_names[$style_dir] = $show_name; |
|
326 | 326 | } |
327 | 327 | $counter++; |
328 | 328 | } |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | if (is_dir($dir)) { |
354 | 354 | $zip = new PclZip($arch); |
355 | 355 | // Remove path prefix except the style name and put file on disk |
356 | - $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir,0,-strlen($safe_style_dir))); |
|
356 | + $zip->create($dir, PCLZIP_OPT_REMOVE_PATH, substr($dir, 0, -strlen($safe_style_dir))); |
|
357 | 357 | //@TODO: use more generic script to download. |
358 | - $str = '<a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch) . '">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
358 | + $str = '<a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.str_replace(api_get_path(SYS_ARCHIVE_PATH), '', $arch).'">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
|
359 | 359 | Display::display_normal_message($str, false); |
360 | 360 | } else { |
361 | 361 | Display::addFlash(Display::return_message(get_lang('FileNotFound'), 'warning')); |
@@ -371,15 +371,15 @@ discard block |
||
371 | 371 | |
372 | 372 | $logoForm->addHtml(Display::return_message(sprintf(get_lang('TheLogoMustBeSizeXAndFormatY'), '250 x 70', 'PNG'), 'info')); |
373 | 373 | |
374 | - $dir = api_get_path(SYS_PUBLIC_PATH).'css/themes/' . $selected . '/images/'; |
|
375 | - $url = api_get_path(WEB_CSS_PATH).'themes/' . $selected . '/images/'; |
|
374 | + $dir = api_get_path(SYS_PUBLIC_PATH).'css/themes/'.$selected.'/images/'; |
|
375 | + $url = api_get_path(WEB_CSS_PATH).'themes/'.$selected.'/images/'; |
|
376 | 376 | $logoFileName = 'header-logo.png'; |
377 | 377 | $newLogoFileName = 'header-logo-custom.png'; |
378 | 378 | |
379 | 379 | if (is_file($dir.$newLogoFileName)) { |
380 | - $logoForm->addLabel(get_lang('CurrentLogo'), '<img id="header-logo-custom" src="'. $url . $newLogoFileName .'?'. time() . '">'); |
|
380 | + $logoForm->addLabel(get_lang('CurrentLogo'), '<img id="header-logo-custom" src="'.$url.$newLogoFileName.'?'.time().'">'); |
|
381 | 381 | } else { |
382 | - $logoForm->addLabel(get_lang('CurrentLogo'), '<img id="header-logo-custom" src="'. $url . $logoFileName .'?'. time() . '">'); |
|
382 | + $logoForm->addLabel(get_lang('CurrentLogo'), '<img id="header-logo-custom" src="'.$url.$logoFileName.'?'.time().'">'); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | $logoForm->addFile('new_logo', get_lang('UpdateLogo')); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $imageInfo = getimagesize($_FILES['new_logo']['tmp_name']); |
404 | 404 | $width = $imageInfo[0]; |
405 | 405 | $height = $imageInfo[1]; |
406 | - if ($width <= 250 && $height <= 70 ) { |
|
406 | + if ($width <= 250 && $height <= 70) { |
|
407 | 407 | if (is_file($dir.$newLogoFileName)) { |
408 | 408 | unlink($dir.$newLogoFileName); |
409 | 409 | } |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | }); |
448 | 448 | </script>'; |
449 | 449 | echo Display::tabs( |
450 | - array(get_lang('Update'),get_lang('UpdateLogo'), get_lang('UploadNewStylesheet')), |
|
450 | + array(get_lang('Update'), get_lang('UpdateLogo'), get_lang('UploadNewStylesheet')), |
|
451 | 451 | array($form_change->return_form(), $logoForm->return_form(), $form->return_form()) |
452 | 452 | ); |
453 | 453 | } else { |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | if (!empty($areas_to_installed)) { |
623 | 623 | $plugin_obj->remove_all_regions($plugin); |
624 | 624 | foreach ($areas_to_installed as $region) { |
625 | - if (!empty($region) && $region != '-1' ) { |
|
625 | + if (!empty($region) && $region != '-1') { |
|
626 | 626 | $plugin_obj->add_to_region($plugin, $region); |
627 | 627 | } |
628 | 628 | } |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | $values = api_get_settings_options('search_enabled'); |
715 | 715 | $form->addElement('header', null, get_lang('SearchEnabledTitle')); |
716 | 716 | |
717 | - $group = array (); |
|
717 | + $group = array(); |
|
718 | 718 | if (is_array($values)) { |
719 | 719 | foreach ($values as $key => $value) { |
720 | 720 | $element = & $form->createElement('radio', 'search_enabled', '', get_lang($value['display_text']), $value['value']); |
@@ -740,12 +740,12 @@ discard block |
||
740 | 740 | |
741 | 741 | if ($search_enabled == 'true') { |
742 | 742 | $values = api_get_settings_options('search_show_unlinked_results'); |
743 | - $group = array (); |
|
743 | + $group = array(); |
|
744 | 744 | foreach ($values as $key => $value) { |
745 | 745 | $element = & $form->createElement('radio', 'search_show_unlinked_results', '', get_lang($value['display_text']), $value['value']); |
746 | 746 | $group[] = $element; |
747 | 747 | } |
748 | - $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'),get_lang('SearchShowUnlinkedResultsComment')), '', false); |
|
748 | + $form->addGroup($group, 'search_show_unlinked_results', array(get_lang('SearchShowUnlinkedResultsTitle'), get_lang('SearchShowUnlinkedResultsComment')), '', false); |
|
749 | 749 | $default_values['search_show_unlinked_results'] = api_get_setting('search_show_unlinked_results'); |
750 | 750 | |
751 | 751 | $sf_values = array(); |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | $sf_values[$sf['code']] = $sf['name']; |
754 | 754 | } |
755 | 755 | $group = array(); |
756 | - $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
756 | + $url = Display::div(Display::url(get_lang('AddSpecificSearchField'), 'specific_fields.php'), array('class'=>'sectioncomment')); |
|
757 | 757 | if (empty($sf_values)) { |
758 | 758 | $form->addElement('html', get_lang('SearchPrefilterPrefix').$url); |
759 | 759 | } else { |
@@ -820,10 +820,10 @@ discard block |
||
820 | 820 | $dir_is_writable = Display::return_icon('bullet_red.png', get_lang('Error')); |
821 | 821 | } |
822 | 822 | |
823 | - $data[] = array(get_lang('XapianModuleInstalled'),$xapian_loaded); |
|
824 | - $data[] = array(get_lang('DirectoryExists').' - '.$xapian_path,$dir_exists); |
|
825 | - $data[] = array(get_lang('IsWritable').' - '.$xapian_path,$dir_is_writable); |
|
826 | - $data[] = array(get_lang('SpecificSearchFieldsAvailable') ,$specific_fields_exists); |
|
823 | + $data[] = array(get_lang('XapianModuleInstalled'), $xapian_loaded); |
|
824 | + $data[] = array(get_lang('DirectoryExists').' - '.$xapian_path, $dir_exists); |
|
825 | + $data[] = array(get_lang('IsWritable').' - '.$xapian_path, $dir_is_writable); |
|
826 | + $data[] = array(get_lang('SpecificSearchFieldsAvailable'), $specific_fields_exists); |
|
827 | 827 | |
828 | 828 | echo Display::tag('h3', get_lang('Settings')); |
829 | 829 | $table = new SortableTableFromArray($data); |
@@ -833,16 +833,16 @@ discard block |
||
833 | 833 | |
834 | 834 | //@todo windows support |
835 | 835 | if (api_is_windows_os() == false) { |
836 | - $list_of_programs = array('pdftotext','ps2pdf', 'catdoc','html2text','unrtf', 'catppt', 'xls2csv'); |
|
836 | + $list_of_programs = array('pdftotext', 'ps2pdf', 'catdoc', 'html2text', 'unrtf', 'catppt', 'xls2csv'); |
|
837 | 837 | |
838 | - foreach($list_of_programs as $program) { |
|
838 | + foreach ($list_of_programs as $program) { |
|
839 | 839 | $output = $ret_val = null; |
840 | 840 | exec("which $program", $output, $ret_val); |
841 | 841 | $icon = Display::return_icon('bullet_red.png', get_lang('NotInstalled')); |
842 | 842 | if (!empty($output[0])) { |
843 | 843 | $icon = Display::return_icon('bullet_green.png', get_lang('Installed')); |
844 | 844 | } |
845 | - $data2[]= array($program, $output[0], $icon); |
|
845 | + $data2[] = array($program, $output[0], $icon); |
|
846 | 846 | } |
847 | 847 | echo Display::tag('h3', get_lang('ProgramsNeededToConvertFiles')); |
848 | 848 | $table = new SortableTableFromArray($data2); |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | if ($action != 'add') { |
875 | 875 | echo '<div class="actions" style="margin-left: 1px;">'; |
876 | 876 | echo '<a href="settings.php?category=Templates&action=add">'. |
877 | - Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
877 | + Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
878 | 878 | echo '</div>'; |
879 | 879 | } |
880 | 880 | |
@@ -993,8 +993,8 @@ discard block |
||
993 | 993 | * @since Dokeos 1.8.6 |
994 | 994 | */ |
995 | 995 | function actions_filter($id) { |
996 | - $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
997 | - $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
996 | + $return = '<a href="settings.php?category=Templates&action=edit&id='.Security::remove_XSS($id).'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
997 | + $return .= '<a href="settings.php?category=Templates&action=delete&id='.Security::remove_XSS($id).'" onClick="javascript:if(!confirm('."'".get_lang('ConfirmYourChoice')."'".')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
998 | 998 | return $return; |
999 | 999 | } |
1000 | 1000 | |
@@ -1044,7 +1044,7 @@ discard block |
||
1044 | 1044 | $form->addElement('html_editor', 'template_text', get_lang('Text'), null, array('ToolbarSet' => 'AdminTemplates', 'Width' => '100%', 'Height' => '400')); |
1045 | 1045 | |
1046 | 1046 | // Setting the form elements: the form to upload an image to be used with the template. |
1047 | - $form->addElement('file','template_image',get_lang('Image'),''); |
|
1047 | + $form->addElement('file', 'template_image', get_lang('Image'), ''); |
|
1048 | 1048 | |
1049 | 1049 | // Setting the form elements: a little bit information about the template image. |
1050 | 1050 | $form->addElement('static', 'file_comment', '', get_lang('TemplateImageComment100x70')); |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | // Store the information in the database (as insert or as update). |
1123 | 1123 | $table_system_template = Database :: get_main_table('system_template'); |
1124 | 1124 | if ($_GET['action'] == 'add') { |
1125 | - $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1125 | + $content_template = Security::remove_XSS($values['template_text'], COURSEMANAGERLOWSECURITY); |
|
1126 | 1126 | $params = [ |
1127 | 1127 | 'title' => $values['title'], |
1128 | 1128 | 'content' => $content_template, |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | |
1133 | 1133 | // Display a feedback message. |
1134 | 1134 | Display::display_confirmation_message(get_lang('TemplateAdded')); |
1135 | - echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
1135 | + echo '<a href="settings.php?category=Templates&action=add">'.Display::return_icon('new_template.png', get_lang('AddTemplate'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
1136 | 1136 | } else { |
1137 | 1137 | $content_template = '<head>{CSS}<style type="text/css">.text{font-weight: normal;}</style></head><body>'.Database::escape_string($values['template_text']).'</body>'; |
1138 | 1138 | $sql = "UPDATE $table_system_template set title = '".Database::escape_string($values['title'])."', content = '".$content_template."'"; |
@@ -1150,7 +1150,7 @@ discard block |
||
1150 | 1150 | display_templates(); |
1151 | 1151 | } else { |
1152 | 1152 | $token = Security::get_token(); |
1153 | - $form->addElement('hidden','sec_token'); |
|
1153 | + $form->addElement('hidden', 'sec_token'); |
|
1154 | 1154 | $form->setConstants(array('sec_token' => $token)); |
1155 | 1155 | // Display the form. |
1156 | 1156 | $form->display(); |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | |
1251 | 1251 | $form = new FormValidator('settings', 'post', 'settings.php?category='.Security::remove_XSS($_GET['category'])); |
1252 | 1252 | |
1253 | - $form->addElement('hidden', 'search_field', (!empty($_GET['search_field'])?Security::remove_XSS($_GET['search_field']):null)); |
|
1253 | + $form->addElement('hidden', 'search_field', (!empty($_GET['search_field']) ? Security::remove_XSS($_GET['search_field']) : null)); |
|
1254 | 1254 | |
1255 | 1255 | $url_id = api_get_current_access_url_id(); |
1256 | 1256 | |
@@ -1317,9 +1317,9 @@ discard block |
||
1317 | 1317 | if (empty($row['category'])) |
1318 | 1318 | $row['category'] = 0; |
1319 | 1319 | |
1320 | - if (is_array($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ])) { |
|
1320 | + if (is_array($settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']])) { |
|
1321 | 1321 | // We are sure that the other site have a selected value. |
1322 | - if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '') |
|
1322 | + if ($settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value'] != '') |
|
1323 | 1323 | $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value']; |
1324 | 1324 | } |
1325 | 1325 | // There is no else{} statement because we load the default $row['selected_value'] of the main Chamilo site. |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | array('maxlength' => '8') |
1341 | 1341 | ); |
1342 | 1342 | $form->applyFilter($row['variable'], 'html_filter'); |
1343 | - $default_values[$row['variable']] = round($row['selected_value']/1024/1024, 1); |
|
1343 | + $default_values[$row['variable']] = round($row['selected_value'] / 1024 / 1024, 1); |
|
1344 | 1344 | } elseif ($row['variable'] == 'account_valid_duration') { |
1345 | 1345 | $form->addElement( |
1346 | 1346 | 'text', |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | ), |
1369 | 1369 | $hideme |
1370 | 1370 | ); |
1371 | - $form->applyFilter($row['variable'],'html_filter'); |
|
1371 | + $form->applyFilter($row['variable'], 'html_filter'); |
|
1372 | 1372 | $default_values[$row['variable']] = $row['selected_value']; |
1373 | 1373 | } |
1374 | 1374 | break; |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | if (file_exists($file)) { |
1380 | 1380 | $value = file_get_contents($file); |
1381 | 1381 | } |
1382 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1382 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1383 | 1383 | $default_values[$row['variable']] = $value; |
1384 | 1384 | } elseif ($row['variable'] == 'footer_extra_content') { |
1385 | 1385 | $file = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt'; |
@@ -1387,16 +1387,16 @@ discard block |
||
1387 | 1387 | if (file_exists($file)) { |
1388 | 1388 | $value = file_get_contents($file); |
1389 | 1389 | } |
1390 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1390 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1391 | 1391 | $default_values[$row['variable']] = $value; |
1392 | 1392 | } else { |
1393 | - $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10'), $hideme); |
|
1393 | + $form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), array('rows'=>'10'), $hideme); |
|
1394 | 1394 | $default_values[$row['variable']] = $row['selected_value']; |
1395 | 1395 | } |
1396 | 1396 | break; |
1397 | 1397 | case 'radio': |
1398 | 1398 | $values = api_get_settings_options($row['variable']); |
1399 | - $group = array (); |
|
1399 | + $group = array(); |
|
1400 | 1400 | if (is_array($values)) { |
1401 | 1401 | foreach ($values as $key => $value) { |
1402 | 1402 | $element = &$form->createElement( |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | WHERE variable='".$row['variable']."' AND access_url = 1"; |
1428 | 1428 | |
1429 | 1429 | $result = Database::query($sql); |
1430 | - $group = array (); |
|
1430 | + $group = array(); |
|
1431 | 1431 | while ($rowkeys = Database::fetch_array($result)) { |
1432 | 1432 | // Profile tab option should be hidden when the social tool is enabled. |
1433 | 1433 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -1499,10 +1499,10 @@ discard block |
||
1499 | 1499 | |
1500 | 1500 | switch ($row['variable']) { |
1501 | 1501 | case 'pdf_export_watermark_enable': |
1502 | - $url = PDF::get_watermark(null); |
|
1502 | + $url = PDF::get_watermark(null); |
|
1503 | 1503 | |
1504 | 1504 | if ($url != false) { |
1505 | - $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png',get_lang('DelImage')).'</a>'; |
|
1505 | + $delete_url = '<a href="?delete_watermark">'.get_lang('DelImage').' '.Display::return_icon('delete.png', get_lang('DelImage')).'</a>'; |
|
1506 | 1506 | $form->addElement('html', '<div style="max-height:100px; max-width:100px; margin-left:162px; margin-bottom:10px; clear:both;"><img src="'.$url.'" style="margin-bottom:10px;" />'.$delete_url.'</div>'); |
1507 | 1507 | } |
1508 | 1508 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $navigation['mycourses']['key'] = 'my-course'; |
40 | 40 | |
41 | 41 | // My Profile |
42 | - $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : '' ); |
|
42 | + $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : ''); |
|
43 | 43 | $navigation['myprofile']['title'] = get_lang('ModifyProfile'); |
44 | 44 | $navigation['myprofile']['key'] = 'profile'; |
45 | 45 | // Link to my agenda |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | // Gradebook |
51 | 51 | if (api_get_setting('gradebook_enable') == 'true') { |
52 | - $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : '' ); |
|
52 | + $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&courseCode='.$_course['official_code'] : ''); |
|
53 | 53 | $navigation['mygradebook']['title'] = get_lang('MyGradebook'); |
54 | 54 | $navigation['mygradebook']['key'] = 'gradebook'; |
55 | 55 | } |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | // Reporting |
58 | 58 | if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) { |
59 | 59 | // Link to my space |
60 | - $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh()?'session.php':''); |
|
60 | + $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh() ? 'session.php' : ''); |
|
61 | 61 | $navigation['session_my_space']['title'] = get_lang('MySpace'); |
62 | 62 | $navigation['session_my_space']['key'] = 'my-space'; |
63 | 63 | } else if (api_is_student_boss()) { |
64 | - $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH) . 'mySpace/student.php'; |
|
64 | + $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/student.php'; |
|
65 | 65 | $navigation['session_my_space']['title'] = get_lang('MySpace'); |
66 | 66 | $navigation['session_my_space']['key'] = 'my-space'; |
67 | 67 | } else { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | // Social |
83 | - if (api_get_setting('allow_social_tool')=='true') { |
|
83 | + if (api_get_setting('allow_social_tool') == 'true') { |
|
84 | 84 | $navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php'; |
85 | 85 | $navigation['social']['title'] = get_lang('SocialNetwork'); |
86 | 86 | $navigation['social']['key'] = 'social-network'; |
@@ -161,14 +161,14 @@ discard block |
||
161 | 161 | 'id' => 'header-logo' |
162 | 162 | ); |
163 | 163 | $testServer = api_get_setting('server_type'); |
164 | - if ($testServer == 'test' && is_file($logoBase . 'svg')) { |
|
165 | - $logo = $logoBase . 'svg'; |
|
164 | + if ($testServer == 'test' && is_file($logoBase.'svg')) { |
|
165 | + $logo = $logoBase.'svg'; |
|
166 | 166 | $attributes['width'] = '245'; |
167 | 167 | $attributes['height'] = '68'; |
168 | 168 | $imageUrl = api_get_path(WEB_CSS_PATH).'themes/'.$theme.'/images/header-logo.svg'; |
169 | 169 | } else { |
170 | - $logo = $logoBase . 'png'; |
|
171 | - $customLogo = $customLogoBase . 'png'; |
|
170 | + $logo = $logoBase.'png'; |
|
171 | + $customLogo = $customLogoBase.'png'; |
|
172 | 172 | $imageUrl = api_get_path(WEB_CSS_PATH).'themes/'.$theme.'/images/header-logo.png'; |
173 | 173 | $customImageUrl = api_get_path(WEB_CSS_PATH).'themes/'.$theme.'/images/header-logo-custom.png'; |
174 | 174 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $_course = api_get_course_info(); |
219 | 219 | $course_id = 0; |
220 | 220 | if (!empty($_course)) { |
221 | - $course_id = $_course['code']; |
|
221 | + $course_id = $_course['code']; |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | $user_id = api_get_user_id(); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (api_get_setting('gradebook_enable') == 'true') { |
316 | 316 | if (api_get_setting('show_tabs', 'my_gradebook') == 'true') { |
317 | 317 | $navigation['mygradebook'] = $possible_tabs['mygradebook']; |
318 | - } else{ |
|
318 | + } else { |
|
319 | 319 | $menu_navigation['mygradebook'] = $possible_tabs['mygradebook']; |
320 | 320 | } |
321 | 321 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | if (api_get_setting('allow_social_tool') == 'true') { |
341 | 341 | $navigation['social'] = isset($possible_tabs['social']) ? $possible_tabs['social'] : null; |
342 | 342 | } |
343 | - } else{ |
|
343 | + } else { |
|
344 | 344 | $menu_navigation['social'] = isset($possible_tabs['social']) ? $possible_tabs['social'] : null; |
345 | 345 | } |
346 | 346 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) { |
350 | 350 | $navigation['dashboard'] = isset($possible_tabs['dashboard']) ? $possible_tabs['dashboard'] : null; |
351 | 351 | } |
352 | - } else{ |
|
352 | + } else { |
|
353 | 353 | $menu_navigation['dashboard'] = isset($possible_tabs['dashboard']) ? $possible_tabs['dashboard'] : null; |
354 | 354 | } |
355 | 355 | |
@@ -440,32 +440,32 @@ discard block |
||
440 | 440 | $home_top = ''; |
441 | 441 | |
442 | 442 | if (is_file($homep.$menutabs.'_'.$lang.$ext) && is_readable($homep.$menutabs.'_'.$lang.$ext)) { |
443 | - $home_top = @(string)file_get_contents($homep.$menutabs.'_'.$lang.$ext); |
|
443 | + $home_top = @(string) file_get_contents($homep.$menutabs.'_'.$lang.$ext); |
|
444 | 444 | } elseif (is_file($homep.$menutabs.$lang.$ext) && is_readable($homep.$menutabs.$lang.$ext)) { |
445 | - $home_top = @(string)file_get_contents($homep.$menutabs.$lang.$ext); |
|
445 | + $home_top = @(string) file_get_contents($homep.$menutabs.$lang.$ext); |
|
446 | 446 | } else { |
447 | 447 | //$errorMsg = get_lang('HomePageFilesNotReadable'); |
448 | 448 | } |
449 | 449 | |
450 | 450 | $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top))); |
451 | 451 | |
452 | - $open = str_replace('{rel_path}',api_get_path(REL_PATH), $home_top); |
|
452 | + $open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top); |
|
453 | 453 | $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open))); |
454 | 454 | |
455 | 455 | $open_mtloggedin = ''; |
456 | 456 | if (api_get_user_id() && !api_is_anonymous()) { |
457 | 457 | if (is_file($homep.$mtloggedin.'_'.$lang.$ext) && is_readable($homep.$mtloggedin.'_'.$lang.$ext)) { |
458 | - $home_top = @(string)file_get_contents($homep.$mtloggedin.'_'.$lang.$ext); |
|
458 | + $home_top = @(string) file_get_contents($homep.$mtloggedin.'_'.$lang.$ext); |
|
459 | 459 | $home_top = str_replace('::private', '', $home_top); |
460 | 460 | } elseif (is_file($homep.$mtloggedin.$lang.$ext) && is_readable($homep.$mtloggedin.$lang.$ext)) { |
461 | - $home_top = @(string)file_get_contents($homep.$mtloggedin.$lang.$ext); |
|
461 | + $home_top = @(string) file_get_contents($homep.$mtloggedin.$lang.$ext); |
|
462 | 462 | $home_top = str_replace('::private', '', $home_top); |
463 | 463 | } else { |
464 | 464 | //$errorMsg = get_lang('HomePageFilesNotReadable'); |
465 | 465 | } |
466 | 466 | |
467 | 467 | $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top))); |
468 | - $open_mtloggedin = str_replace('{rel_path}',api_get_path(REL_PATH), $home_top); |
|
468 | + $open_mtloggedin = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top); |
|
469 | 469 | $open_mtloggedin = api_to_system_encoding($open_mtloggedin, api_detect_encoding(strip_tags($open_mtloggedin))); |
470 | 470 | } |
471 | 471 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | if (!empty($open) OR !empty($open_mtloggedin)) { |
475 | 475 | if (strpos($open.$open_mtloggedin, 'show_menu') === false) { |
476 | 476 | if (api_is_anonymous()) { |
477 | - $navigation[SECTION_CAMPUS] = null; |
|
477 | + $navigation[SECTION_CAMPUS] = null; |
|
478 | 478 | } |
479 | 479 | } else { |
480 | 480 | if (api_get_user_id() && !api_is_anonymous()) { |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | if (count($navigation) > 0 || !empty($lis)) { |
489 | 489 | $pre_lis = ''; |
490 | 490 | foreach ($navigation as $section => $navigation_info) { |
491 | - $key = (!empty($navigation_info['key'])?'tab-'.$navigation_info['key']:''); |
|
491 | + $key = (!empty($navigation_info['key']) ? 'tab-'.$navigation_info['key'] : ''); |
|
492 | 492 | if (isset($GLOBALS['this_section'])) { |
493 | 493 | $current = $section == $GLOBALS['this_section'] ? ' id="current" class="active '.$key.'" ' : ' class="'.$key.'"'; |
494 | 494 | } else { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | |
533 | 533 | if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) { |
534 | 534 | |
535 | - $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : ''); |
|
535 | + $navigation_item['url'] = $web_course_path.$_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : ''); |
|
536 | 536 | $_course['name'] = api_htmlentities($_course['name']); |
537 | 537 | $course_title = cut($_course['name'], MAX_LENGTH_BREADCRUMB); |
538 | 538 | |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name; |
548 | 548 | break; |
549 | 549 | default: |
550 | - if (api_get_session_id() != -1 ) { |
|
550 | + if (api_get_session_id() != -1) { |
|
551 | 551 | $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name; |
552 | 552 | } else { |
553 | 553 | $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name']).' '.$course_title; |
@@ -581,22 +581,22 @@ discard block |
||
581 | 581 | // titles for shared folders |
582 | 582 | if ($breadcrumb_step['name'] == 'shared_folder') { |
583 | 583 | $navigation_item['title'] = get_lang('UserFolders'); |
584 | - } elseif(strstr($breadcrumb_step['name'], 'shared_folder_session_')) { |
|
584 | + } elseif (strstr($breadcrumb_step['name'], 'shared_folder_session_')) { |
|
585 | 585 | $navigation_item['title'] = get_lang('UserFolders'); |
586 | - } elseif(strstr($breadcrumb_step['name'], 'sf_user_')) { |
|
586 | + } elseif (strstr($breadcrumb_step['name'], 'sf_user_')) { |
|
587 | 587 | $userinfo = api_get_user_info(substr($breadcrumb_step['name'], 8)); |
588 | 588 | $navigation_item['title'] = $userinfo['complete_name']; |
589 | - } elseif($breadcrumb_step['name'] == 'chat_files') { |
|
589 | + } elseif ($breadcrumb_step['name'] == 'chat_files') { |
|
590 | 590 | $navigation_item['title'] = get_lang('ChatFiles'); |
591 | - } elseif($breadcrumb_step['name'] == 'images') { |
|
591 | + } elseif ($breadcrumb_step['name'] == 'images') { |
|
592 | 592 | $navigation_item['title'] = get_lang('Images'); |
593 | - } elseif($breadcrumb_step['name'] == 'video') { |
|
593 | + } elseif ($breadcrumb_step['name'] == 'video') { |
|
594 | 594 | $navigation_item['title'] = get_lang('Video'); |
595 | - } elseif($breadcrumb_step['name'] == 'audio') { |
|
595 | + } elseif ($breadcrumb_step['name'] == 'audio') { |
|
596 | 596 | $navigation_item['title'] = get_lang('Audio'); |
597 | - } elseif($breadcrumb_step['name'] == 'flash') { |
|
597 | + } elseif ($breadcrumb_step['name'] == 'flash') { |
|
598 | 598 | $navigation_item['title'] = get_lang('Flash'); |
599 | - } elseif($breadcrumb_step['name'] == 'gallery') { |
|
599 | + } elseif ($breadcrumb_step['name'] == 'gallery') { |
|
600 | 600 | $navigation_item['title'] = get_lang('Gallery'); |
601 | 601 | } |
602 | 602 | // Fixes breadcrumb title now we applied the Security::remove_XSS and |
@@ -663,35 +663,35 @@ discard block |
||
663 | 663 | if (!empty($final_navigation)) { |
664 | 664 | // $home_link.= '<span class="divider">/</span>'; |
665 | 665 | if (!empty($home_link)) { |
666 | - $lis.= Display::tag('li', $home_link); |
|
666 | + $lis .= Display::tag('li', $home_link); |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | foreach ($final_navigation as $bread) { |
670 | 670 | $bread_check = trim(strip_tags($bread)); |
671 | 671 | if (!empty($bread_check)) { |
672 | - if ($final_navigation_count-1 > $i) { |
|
672 | + if ($final_navigation_count - 1 > $i) { |
|
673 | 673 | $bread .= ''; |
674 | 674 | } |
675 | - $lis.= Display::tag('li', $bread,array('class'=>'active')); |
|
675 | + $lis .= Display::tag('li', $bread, array('class'=>'active')); |
|
676 | 676 | $i++; |
677 | 677 | } |
678 | 678 | } |
679 | 679 | } else { |
680 | 680 | if (!empty($home_link)) { |
681 | - $lis.= Display::tag('li', $home_link); |
|
681 | + $lis .= Display::tag('li', $home_link); |
|
682 | 682 | } |
683 | 683 | } |
684 | 684 | |
685 | 685 | // View as student/teacher link |
686 | 686 | $view = null; |
687 | 687 | if (!empty($view_as_student_link)) { |
688 | - $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link','class' => 'pull-right')); |
|
688 | + $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link', 'class' => 'pull-right')); |
|
689 | 689 | } |
690 | 690 | |
691 | 691 | if (!empty($navigation_right)) { |
692 | - foreach($navigation_right as $item){ |
|
692 | + foreach ($navigation_right as $item) { |
|
693 | 693 | $extra_class = isset($item['class']) ? $item['class'] : null; |
694 | - $lis.= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right')); |
|
694 | + $lis .= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right')); |
|
695 | 695 | } |
696 | 696 | } |
697 | 697 |