@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @param string Optional help file name |
| 56 | 56 | * @param string $page_header |
| 57 | 57 | */ |
| 58 | - public static function display_header($tool_name ='', $help = null, $page_header = null) |
|
| 58 | + public static function display_header($tool_name = '', $help = null, $page_header = null) |
|
| 59 | 59 | { |
| 60 | 60 | $origin = api_get_origin(); |
| 61 | 61 | $showHeader = true; |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $grid_class = array(), |
| 352 | 352 | $elementCount = 0 |
| 353 | 353 | ) { |
| 354 | - $column = 0; |
|
| 354 | + $column = 0; |
|
| 355 | 355 | $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20; |
| 356 | 356 | |
| 357 | 357 | $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name); |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | * @param bool Filter (true) or not (false) |
| 477 | 477 | * @return void |
| 478 | 478 | */ |
| 479 | - public static function display_confirmation_message ($message, $filter = true, $returnValue = false) |
|
| 479 | + public static function display_confirmation_message($message, $filter = true, $returnValue = false) |
|
| 480 | 480 | { |
| 481 | 481 | $message = self::return_message($message, 'confirm', $filter); |
| 482 | 482 | if ($returnValue) { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | * @param bool Filter (true) or not (false) |
| 494 | 494 | * @return void |
| 495 | 495 | */ |
| 496 | - public static function display_error_message ($message, $filter = true, $returnValue = false) |
|
| 496 | + public static function display_error_message($message, $filter = true, $returnValue = false) |
|
| 497 | 497 | { |
| 498 | 498 | $message = self::return_message($message, 'error', $filter); |
| 499 | 499 | if ($returnValue) { |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | * @param string $type |
| 509 | 509 | * @param bool $filter |
| 510 | 510 | */ |
| 511 | - public static function return_message_and_translate($message, $type='normal', $filter = true) |
|
| 511 | + public static function return_message_and_translate($message, $type = 'normal', $filter = true) |
|
| 512 | 512 | { |
| 513 | 513 | $message = get_lang($message); |
| 514 | 514 | echo self::return_message($message, $type, $filter); |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $class = ""; |
| 535 | - switch($type) { |
|
| 535 | + switch ($type) { |
|
| 536 | 536 | case 'warning': |
| 537 | 537 | $class .= 'alert alert-warning'; |
| 538 | 538 | break; |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | * @param string optional, class from stylesheet |
| 561 | 561 | * @return string encrypted mailto hyperlink |
| 562 | 562 | */ |
| 563 | - public static function encrypted_mailto_link ($email, $clickable_text = null, $style_class = '') |
|
| 563 | + public static function encrypted_mailto_link($email, $clickable_text = null, $style_class = '') |
|
| 564 | 564 | { |
| 565 | 565 | if (is_null($clickable_text)) { |
| 566 | 566 | $clickable_text = $email; |
@@ -575,14 +575,14 @@ discard block |
||
| 575 | 575 | } |
| 576 | 576 | // Encrypt email |
| 577 | 577 | $hmail = ''; |
| 578 | - for ($i = 0; $i < strlen($email); $i ++) { |
|
| 578 | + for ($i = 0; $i < strlen($email); $i++) { |
|
| 579 | 579 | $hmail .= '&#'.ord($email { |
| 580 | 580 | $i }).';'; |
| 581 | 581 | } |
| 582 | 582 | $hclickable_text = null; |
| 583 | 583 | // Encrypt clickable text if @ is present |
| 584 | 584 | if (strpos($clickable_text, '@')) { |
| 585 | - for ($i = 0; $i < strlen($clickable_text); $i ++) { |
|
| 585 | + for ($i = 0; $i < strlen($clickable_text); $i++) { |
|
| 586 | 586 | $hclickable_text .= '&#'.ord($clickable_text { |
| 587 | 587 | $i }).';'; |
| 588 | 588 | } |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | } |
| 615 | 615 | // Encrypt email |
| 616 | 616 | $hmail = ''; |
| 617 | - for ($i = 0; $i < strlen($email); $i ++) { |
|
| 617 | + for ($i = 0; $i < strlen($email); $i++) { |
|
| 618 | 618 | $hmail .= '&#'.ord($email { |
| 619 | 619 | $i }).';'; |
| 620 | 620 | } |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | public static function get_alphabet_options($selected_letter = '') |
| 648 | 648 | { |
| 649 | 649 | $result = ''; |
| 650 | - for ($i = 65; $i <= 90; $i ++) { |
|
| 650 | + for ($i = 65; $i <= 90; $i++) { |
|
| 651 | 651 | $letter = chr($i); |
| 652 | 652 | $result .= '<option value="'.$letter.'"'; |
| 653 | 653 | if ($selected_letter == $letter) { |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | public static function get_numeric_options($min, $max, $selected_num = 0) |
| 669 | 669 | { |
| 670 | 670 | $result = ''; |
| 671 | - for ($i = $min; $i <= $max; $i ++) { |
|
| 671 | + for ($i = $min; $i <= $max; $i++) { |
|
| 672 | 672 | $result .= '<option value="'.$i.'"'; |
| 673 | 673 | if (is_int($selected_num)) |
| 674 | 674 | if ($selected_num == $i) { |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | $size = ICON_SIZE_SMALL; |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | - $size_extra = $size . '/'; |
|
| 748 | + $size_extra = $size.'/'; |
|
| 749 | 749 | |
| 750 | 750 | // Checking the img/ folder |
| 751 | 751 | $icon = $w_code_path.'img/'.$image; |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | $theme = 'themes/chamilo/icons/'; |
| 754 | 754 | |
| 755 | 755 | if ($loadThemeIcon) { |
| 756 | - $theme = 'themes/' . api_get_visual_theme() . '/icons/'; |
|
| 756 | + $theme = 'themes/'.api_get_visual_theme().'/icons/'; |
|
| 757 | 757 | // Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX |
| 758 | 758 | if (is_file($alternateCssPath.$theme.$size_extra.$image)) { |
| 759 | 759 | $icon = $alternateWebCssPath.$theme.$size_extra.$image; |
@@ -775,11 +775,11 @@ discard block |
||
| 775 | 775 | // ask for the SVG version directly |
| 776 | 776 | $testServer = api_get_setting('server_type'); |
| 777 | 777 | if ($testServer == 'test' && $return_only_path == false) { |
| 778 | - $svgImage = substr($image, 0, -3) . 'svg'; |
|
| 779 | - if (is_file($code_path . $theme . 'svg/' . $svgImage)) { |
|
| 780 | - $icon = $w_code_path . $theme . 'svg/' . $svgImage; |
|
| 781 | - } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) { |
|
| 782 | - $icon = $w_code_path . 'img/icons/svg/' . $svgImage; |
|
| 778 | + $svgImage = substr($image, 0, -3).'svg'; |
|
| 779 | + if (is_file($code_path.$theme.'svg/'.$svgImage)) { |
|
| 780 | + $icon = $w_code_path.$theme.'svg/'.$svgImage; |
|
| 781 | + } elseif (is_file($code_path.'img/icons/svg/'.$svgImage)) { |
|
| 782 | + $icon = $w_code_path.'img/icons/svg/'.$svgImage; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | if (empty($additional_attributes['height'])) { |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | } |
| 860 | 860 | } |
| 861 | 861 | //some tags don't have this </XXX> |
| 862 | - if (in_array($tag, array('img','input','br'))) { |
|
| 862 | + if (in_array($tag, array('img', 'input', 'br'))) { |
|
| 863 | 863 | $return_value = '<'.$tag.' '.$attribute_list.' />'; |
| 864 | 864 | } else { |
| 865 | 865 | $return_value = '<'.$tag.' '.$attribute_list.' > '.$content.'</'.$tag.'>'; |
@@ -912,13 +912,13 @@ discard block |
||
| 912 | 912 | public static function input($type, $name, $value, $attributes = array()) |
| 913 | 913 | { |
| 914 | 914 | if (isset($type)) { |
| 915 | - $attributes['type']= $type; |
|
| 915 | + $attributes['type'] = $type; |
|
| 916 | 916 | } |
| 917 | 917 | if (isset($name)) { |
| 918 | - $attributes['name']= $name; |
|
| 918 | + $attributes['name'] = $name; |
|
| 919 | 919 | } |
| 920 | 920 | if (isset($value)) { |
| 921 | - $attributes['value']= $value; |
|
| 921 | + $attributes['value'] = $value; |
|
| 922 | 922 | } |
| 923 | 923 | return self::tag('input', '', $attributes); |
| 924 | 924 | } |
@@ -951,14 +951,14 @@ discard block |
||
| 951 | 951 | ) { |
| 952 | 952 | $html = ''; |
| 953 | 953 | $extra = ''; |
| 954 | - $default_id = 'id="' . $name . '" '; |
|
| 954 | + $default_id = 'id="'.$name.'" '; |
|
| 955 | 955 | foreach ($extra_attributes as $key => $parameter) { |
| 956 | 956 | if ($key == 'id') { |
| 957 | 957 | $default_id = ''; |
| 958 | 958 | } |
| 959 | - $extra .= $key . '="' . $parameter . '" '; |
|
| 959 | + $extra .= $key.'="'.$parameter.'" '; |
|
| 960 | 960 | } |
| 961 | - $html .= '<select name="' . $name . '" ' . $default_id . ' ' . $extra . '>'; |
|
| 961 | + $html .= '<select name="'.$name.'" '.$default_id.' '.$extra.'>'; |
|
| 962 | 962 | |
| 963 | 963 | if ($show_blank_item) { |
| 964 | 964 | if (empty($blank_item_text)) { |
@@ -966,14 +966,14 @@ discard block |
||
| 966 | 966 | } else { |
| 967 | 967 | $blank_item_text = Security::remove_XSS($blank_item_text); |
| 968 | 968 | } |
| 969 | - $html .= self::tag('option', '-- ' . $blank_item_text . ' --', array('value' => '-1')); |
|
| 969 | + $html .= self::tag('option', '-- '.$blank_item_text.' --', array('value' => '-1')); |
|
| 970 | 970 | } |
| 971 | 971 | if ($values) { |
| 972 | 972 | foreach ($values as $key => $value) { |
| 973 | 973 | if (is_array($value) && isset($value['name'])) { |
| 974 | 974 | $value = $value['name']; |
| 975 | 975 | } |
| 976 | - $html .= '<option value="' . $key . '"'; |
|
| 976 | + $html .= '<option value="'.$key.'"'; |
|
| 977 | 977 | |
| 978 | 978 | if (is_array($default)) { |
| 979 | 979 | foreach ($default as $item) { |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | } |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | - $html .= '>' . $value . '</option>'; |
|
| 991 | + $html .= '>'.$value.'</option>'; |
|
| 992 | 992 | } |
| 993 | 993 | } |
| 994 | 994 | $html .= '</select>'; |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | */ |
| 1015 | 1015 | public static function tabs($header_list, $content_list, $id = 'tabs', $attributes = array(), $ul_attributes = array()) |
| 1016 | 1016 | { |
| 1017 | - if (empty($header_list) || count($header_list) == 0 ) { |
|
| 1017 | + if (empty($header_list) || count($header_list) == 0) { |
|
| 1018 | 1018 | return ''; |
| 1019 | 1019 | } |
| 1020 | 1020 | |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | |
| 1052 | 1052 | $main_div = self::tag('div', $ul.self::tag('div', $divs, ['class' => 'tab-content']), $attributes); |
| 1053 | 1053 | |
| 1054 | - return $main_div ; |
|
| 1054 | + return $main_div; |
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | /** |
@@ -1099,8 +1099,8 @@ discard block |
||
| 1099 | 1099 | */ |
| 1100 | 1100 | public static function grid_html($div_id) |
| 1101 | 1101 | { |
| 1102 | - $table = self::tag('table','', array('id' => $div_id)); |
|
| 1103 | - $table .= self::tag('div','', array('id' => $div_id.'_pager')); |
|
| 1102 | + $table = self::tag('table', '', array('id' => $div_id)); |
|
| 1103 | + $table .= self::tag('div', '', array('id' => $div_id.'_pager')); |
|
| 1104 | 1104 | return $table; |
| 1105 | 1105 | } |
| 1106 | 1106 | |
@@ -1161,7 +1161,7 @@ discard block |
||
| 1161 | 1161 | $obj->colNames = $column_names; |
| 1162 | 1162 | $obj->colModel = $column_model; |
| 1163 | 1163 | $obj->pager = '#'.$div_id.'_pager'; |
| 1164 | - $obj->datatype = 'json'; |
|
| 1164 | + $obj->datatype = 'json'; |
|
| 1165 | 1165 | $obj->viewrecords = 'true'; |
| 1166 | 1166 | |
| 1167 | 1167 | $all_value = 10000000; |
@@ -1224,10 +1224,10 @@ discard block |
||
| 1224 | 1224 | // Adding static data. |
| 1225 | 1225 | if (!empty($data)) { |
| 1226 | 1226 | $data_var = $div_id.'_data'; |
| 1227 | - $json.=' var '.$data_var.' = '.json_encode($data).';'; |
|
| 1227 | + $json .= ' var '.$data_var.' = '.json_encode($data).';'; |
|
| 1228 | 1228 | $obj->data = $data_var; |
| 1229 | 1229 | $obj->datatype = 'local'; |
| 1230 | - $json.="\n"; |
|
| 1230 | + $json .= "\n"; |
|
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | $obj->end = 'end'; |
@@ -1241,20 +1241,20 @@ discard block |
||
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | 1243 | // Fixing true/false js values that doesn't need the "" |
| 1244 | - $json_encode = str_replace(':"true"',':true',$json_encode); |
|
| 1244 | + $json_encode = str_replace(':"true"', ':true', $json_encode); |
|
| 1245 | 1245 | // wrap_cell is not a valid jqgrid attributes is a hack to wrap a text |
| 1246 | 1246 | $json_encode = str_replace('"wrap_cell":true', 'cellattr : function(rowId, value, rowObject, colModel, arrData) { return \'class = "jqgrid_whitespace"\'; }', $json_encode); |
| 1247 | - $json_encode = str_replace(':"false"',':false',$json_encode); |
|
| 1247 | + $json_encode = str_replace(':"false"', ':false', $json_encode); |
|
| 1248 | 1248 | $json_encode = str_replace('"formatter":"action_formatter"', 'formatter:action_formatter', $json_encode); |
| 1249 | - $json_encode = str_replace(array('{"first":"first",','"end":"end"}'), '', $json_encode); |
|
| 1249 | + $json_encode = str_replace(array('{"first":"first",', '"end":"end"}'), '', $json_encode); |
|
| 1250 | 1250 | if ( |
| 1251 | 1251 | plagiarismActive() |
| 1252 | 1252 | && plagiarismTool() |
| 1253 | 1253 | == TOOL_COMPILATIO |
| 1254 | - && ( strpos($_SERVER['REQUEST_URI'], 'work/work.php') |
|
| 1254 | + && (strpos($_SERVER['REQUEST_URI'], 'work/work.php') |
|
| 1255 | 1255 | !== false |
| 1256 | 1256 | || strpos($_SERVER['REQUEST_URI'], 'work/work_list_all.php') |
| 1257 | - != false ) |
|
| 1257 | + != false) |
|
| 1258 | 1258 | ) { |
| 1259 | 1259 | $json_encode = str_replace('"function () { compilatioInit() }"', |
| 1260 | 1260 | 'function () { compilatioInit() }', |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | 1265 | // Creating the jqgrid element. |
| 1266 | - $json .= '$("#' . $div_id . '").jqGrid({'; |
|
| 1266 | + $json .= '$("#'.$div_id.'").jqGrid({'; |
|
| 1267 | 1267 | //$json .= $beforeSelectRow; |
| 1268 | 1268 | |
| 1269 | 1269 | $json .= $json_encode; |
@@ -1275,22 +1275,22 @@ discard block |
||
| 1275 | 1275 | $groups = ''; |
| 1276 | 1276 | foreach ($extra_params['groupHeaders'] as $group) { |
| 1277 | 1277 | //{ "startColumnName" : "courses", "numberOfColumns" : 1, "titleText" : "Order Info" }, |
| 1278 | - $groups .= '{ "startColumnName" : "' . $group['startColumnName'] . '", "numberOfColumns" : ' . $group['numberOfColumns'] . ', "titleText" : "' . $group['titleText'] . '" },'; |
|
| 1278 | + $groups .= '{ "startColumnName" : "'.$group['startColumnName'].'", "numberOfColumns" : '.$group['numberOfColumns'].', "titleText" : "'.$group['titleText'].'" },'; |
|
| 1279 | 1279 | |
| 1280 | 1280 | } |
| 1281 | 1281 | $json .= '$("#'.$div_id.'").jqGrid("setGroupHeaders", { |
| 1282 | 1282 | "useColSpanStyle" : false, |
| 1283 | 1283 | "groupHeaders" : [ |
| 1284 | - ' . $groups . ' |
|
| 1284 | + ' . $groups.' |
|
| 1285 | 1285 | ] |
| 1286 | 1286 | });'; |
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | $all_text = addslashes(get_lang('All')); |
| 1290 | 1290 | $json .= '$("'.$obj->pager.' option[value='.$all_value.']").text("'.$all_text.'");'; |
| 1291 | - $json.= "\n"; |
|
| 1291 | + $json .= "\n"; |
|
| 1292 | 1292 | // Adding edit/delete icons. |
| 1293 | - $json.= $formatter; |
|
| 1293 | + $json .= $formatter; |
|
| 1294 | 1294 | |
| 1295 | 1295 | return $json; |
| 1296 | 1296 | } |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | if (!empty($rows)) { |
| 1324 | - foreach($rows as $content) { |
|
| 1324 | + foreach ($rows as $content) { |
|
| 1325 | 1325 | $table->setCellContents($row, $column, $content); |
| 1326 | 1326 | $row++; |
| 1327 | 1327 | } |
@@ -1483,7 +1483,7 @@ discard block |
||
| 1483 | 1483 | |
| 1484 | 1484 | // Show all tool icons where there is something new. |
| 1485 | 1485 | $return = ' '; |
| 1486 | - foreach($notifications as $notification) { |
|
| 1486 | + foreach ($notifications as $notification) { |
|
| 1487 | 1487 | $lastDate = date('d/m/Y H:i', convert_sql_date($notification['lastedit_date'])); |
| 1488 | 1488 | $type = $notification['lastedit_type']; |
| 1489 | 1489 | $label = get_lang('TitleNotification').": ".get_lang($type)." ($lastDate)"; |
@@ -1526,9 +1526,9 @@ discard block |
||
| 1526 | 1526 | $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
| 1527 | 1527 | $active = false; |
| 1528 | 1528 | // Request for the name of the general coach |
| 1529 | - $sql ='SELECT tu.lastname, tu.firstname, ts.* |
|
| 1529 | + $sql = 'SELECT tu.lastname, tu.firstname, ts.* |
|
| 1530 | 1530 | FROM '.$tbl_session.' ts |
| 1531 | - LEFT JOIN '.$main_user_table .' tu |
|
| 1531 | + LEFT JOIN '.$main_user_table.' tu |
|
| 1532 | 1532 | ON ts.id_coach = tu.user_id |
| 1533 | 1533 | WHERE ts.id = '.intval($session_id); |
| 1534 | 1534 | $rs = Database::query($sql); |
@@ -1538,7 +1538,7 @@ discard block |
||
| 1538 | 1538 | $session = array(); |
| 1539 | 1539 | $session['title'] = $session_info['name']; |
| 1540 | 1540 | $session['coach'] = ''; |
| 1541 | - $session['dates'] = ''; |
|
| 1541 | + $session['dates'] = ''; |
|
| 1542 | 1542 | |
| 1543 | 1543 | if ( |
| 1544 | 1544 | ( |
@@ -1620,8 +1620,8 @@ discard block |
||
| 1620 | 1620 | ); |
| 1621 | 1621 | } |
| 1622 | 1622 | |
| 1623 | - if ( api_get_setting('show_session_coach') === 'true' ) { |
|
| 1624 | - $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name( |
|
| 1623 | + if (api_get_setting('show_session_coach') === 'true') { |
|
| 1624 | + $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name( |
|
| 1625 | 1625 | $session_info['firstname'], |
| 1626 | 1626 | $session_info['lastname'] |
| 1627 | 1627 | ); |
@@ -1673,9 +1673,9 @@ discard block |
||
| 1673 | 1673 | $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0; |
| 1674 | 1674 | |
| 1675 | 1675 | if (!empty($percentage)) { |
| 1676 | - $percentage = $percentage*125/100; |
|
| 1676 | + $percentage = $percentage * 125 / 100; |
|
| 1677 | 1677 | } |
| 1678 | - $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
| 1678 | + $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
| 1679 | 1679 | |
| 1680 | 1680 | $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']); |
| 1681 | 1681 | |
@@ -1690,19 +1690,19 @@ discard block |
||
| 1690 | 1690 | |
| 1691 | 1691 | $labels = array(); |
| 1692 | 1692 | |
| 1693 | - $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
| 1694 | - $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
| 1693 | + $labels[] = $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
| 1694 | + $labels[] = $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
| 1695 | 1695 | if (!empty($number_of_users_who_voted)) { |
| 1696 | - $labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5'; |
|
| 1696 | + $labels[] = get_lang('Average').' '.$point_info['point_average_star'].'/5'; |
|
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | - $labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] '; |
|
| 1699 | + $labels[] = $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote').' [?] '; |
|
| 1700 | 1700 | |
| 1701 | 1701 | if (!$add_div_wrapper && api_is_anonymous()) { |
| 1702 | - $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
| 1702 | + $labels[] = Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | - $html .= Display::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
|
| 1705 | + $html .= Display::div(implode(' | ', $labels), array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
|
| 1706 | 1706 | $html .= ' '.Display::span(' ', array('id' => 'vote_label2_'.$id)); |
| 1707 | 1707 | |
| 1708 | 1708 | if ($add_div_wrapper) { |
@@ -1780,8 +1780,8 @@ discard block |
||
| 1780 | 1780 | if (!empty($list)) { |
| 1781 | 1781 | $html = '<dl class="dl-horizontal">'; |
| 1782 | 1782 | foreach ($list as $item) { |
| 1783 | - $html .= '<dt>' . $item['title'] . '</dt>'; |
|
| 1784 | - $html .= '<dd>' . $item['content'] . '</dd>'; |
|
| 1783 | + $html .= '<dt>'.$item['title'].'</dt>'; |
|
| 1784 | + $html .= '<dd>'.$item['content'].'</dd>'; |
|
| 1785 | 1785 | } |
| 1786 | 1786 | $html .= '</dl>'; |
| 1787 | 1787 | } |
@@ -1823,7 +1823,7 @@ discard block |
||
| 1823 | 1823 | * @param string $type |
| 1824 | 1824 | * @return null|string |
| 1825 | 1825 | */ |
| 1826 | - public static function badge($count, $type ="warning") |
|
| 1826 | + public static function badge($count, $type = "warning") |
|
| 1827 | 1827 | { |
| 1828 | 1828 | $class = ''; |
| 1829 | 1829 | |
@@ -1899,7 +1899,7 @@ discard block |
||
| 1899 | 1899 | if (!empty($content)) { |
| 1900 | 1900 | $html = '<span class="label '.$class.'">'; |
| 1901 | 1901 | $html .= $content; |
| 1902 | - $html .='</span>'; |
|
| 1902 | + $html .= '</span>'; |
|
| 1903 | 1903 | } |
| 1904 | 1904 | |
| 1905 | 1905 | return $html; |
@@ -1920,7 +1920,7 @@ discard block |
||
| 1920 | 1920 | $class = 'class ="active"'; |
| 1921 | 1921 | } |
| 1922 | 1922 | |
| 1923 | - if (basename($_SERVER['REQUEST_URI']) == basename($value['url']) ) { |
|
| 1923 | + if (basename($_SERVER['REQUEST_URI']) == basename($value['url'])) { |
|
| 1924 | 1924 | $class = 'class ="active"'; |
| 1925 | 1925 | } |
| 1926 | 1926 | $html .= "<li $class >"; |
@@ -2171,7 +2171,7 @@ discard block |
||
| 2171 | 2171 | } |
| 2172 | 2172 | $label = $nextValue + $localCounter + 1; |
| 2173 | 2173 | if ($isMedia) { |
| 2174 | - $label = ($fixedValue + 1) .' '.chr(97 + $localCounter); |
|
| 2174 | + $label = ($fixedValue + 1).' '.chr(97 + $localCounter); |
|
| 2175 | 2175 | $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId; |
| 2176 | 2176 | } |
| 2177 | 2177 | $link = Display::url($label.' ', $link_to_show, $linkAttributes); |
@@ -2283,7 +2283,7 @@ discard block |
||
| 2283 | 2283 | */ |
| 2284 | 2284 | public static function getVCardUserLink($userId) |
| 2285 | 2285 | { |
| 2286 | - $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId);; |
|
| 2286 | + $vCardUrl = api_get_path(WEB_PATH).'main/social/vcard_export.php?userId='.intval($userId); ; |
|
| 2287 | 2287 | |
| 2288 | 2288 | return $vCardUrl; |
| 2289 | 2289 | } |
@@ -2301,7 +2301,7 @@ discard block |
||
| 2301 | 2301 | { |
| 2302 | 2302 | $title = !empty($title) ? '<div class="panel-heading"><h3 class="panel-title">'.$title.'</h3>'.$extra.'</div>' : ''; |
| 2303 | 2303 | $footer = !empty($footer) ? '<div class="panel-footer ">'.$footer.'</div>' : ''; |
| 2304 | - $styles = ['primary','success','info','warning','danger']; |
|
| 2304 | + $styles = ['primary', 'success', 'info', 'warning', 'danger']; |
|
| 2305 | 2305 | $style = !in_array($style, $styles) ? 'default' : $style; |
| 2306 | 2306 | |
| 2307 | 2307 | return ' |
@@ -2346,7 +2346,7 @@ discard block |
||
| 2346 | 2346 | $attributes['class'] = isset($attributes['class']) ? "$buttonClass {$attributes['class']}" : $buttonClass; |
| 2347 | 2347 | |
| 2348 | 2348 | if (!$includeText) { |
| 2349 | - $text = '<span class="sr-only">' . $text . '</span>'; |
|
| 2349 | + $text = '<span class="sr-only">'.$text.'</span>'; |
|
| 2350 | 2350 | } |
| 2351 | 2351 | |
| 2352 | 2352 | return self::url("$icon $text", $url, $attributes); |
@@ -2361,16 +2361,16 @@ discard block |
||
| 2361 | 2361 | */ |
| 2362 | 2362 | public static function toolbarAction($id, $content = array(), $col = 2, $right = true) |
| 2363 | 2363 | { |
| 2364 | - $columns = 12/$col; |
|
| 2364 | + $columns = 12 / $col; |
|
| 2365 | 2365 | $html = ''; |
| 2366 | - $html .= '<div id="' . $id . '" class="actions">'; |
|
| 2366 | + $html .= '<div id="'.$id.'" class="actions">'; |
|
| 2367 | 2367 | $html .= '<div class="row">'; |
| 2368 | 2368 | if ($col > 4) { |
| 2369 | 2369 | $html = '<div class="alert alert-warning" role="alert">Action toolbar design does not work when exceeding four columns - check Display::toolbarAction()</div>'; |
| 2370 | 2370 | } else { |
| 2371 | - for ( $i = 0; $i < $col; $i++ ) { |
|
| 2372 | - $html .= '<div class="col-md-' . $columns . '">'; |
|
| 2373 | - if ( $col == 2 && $i == 1 ) { |
|
| 2371 | + for ($i = 0; $i < $col; $i++) { |
|
| 2372 | + $html .= '<div class="col-md-'.$columns.'">'; |
|
| 2373 | + if ($col == 2 && $i == 1) { |
|
| 2374 | 2374 | if ($right === true) { |
| 2375 | 2375 | $html .= '<div class="pull-right">'; |
| 2376 | 2376 | $html .= (isset($content[$i]) ? $content[$i] : ''); |
@@ -2485,9 +2485,9 @@ discard block |
||
| 2485 | 2485 | $params['class'] = 'panel panel-default'; |
| 2486 | 2486 | $html = null; |
| 2487 | 2487 | if (!empty($title)) { |
| 2488 | - $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL; |
|
| 2488 | + $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL; |
|
| 2489 | 2489 | } |
| 2490 | - $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL; |
|
| 2490 | + $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL; |
|
| 2491 | 2491 | $html = Display::div($html, $params); |
| 2492 | 2492 | } |
| 2493 | 2493 | return $html; |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | use ChamiloSession as Session; |
| 5 | 5 | |
| 6 | 6 | require_once '../inc/global.inc.php'; |
| 7 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 7 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 8 | 8 | |
| 9 | 9 | api_protect_course_script(true); |
| 10 | 10 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $user_id = api_get_user_id(); |
| 45 | 45 | |
| 46 | 46 | if (!empty($group_id)) { |
| 47 | - $group_properties = GroupManager :: get_group_properties($group_id); |
|
| 47 | + $group_properties = GroupManager :: get_group_properties($group_id); |
|
| 48 | 48 | $show_work = false; |
| 49 | 49 | |
| 50 | 50 | if (api_is_allowed_to_edit(false, true)) { |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_document.php?'.api_get_cidreq().'&id='.$workId.'">'; |
| 162 | 162 | $actionsLeft .= Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 163 | 163 | |
| 164 | - $actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_user.php?'.api_get_cidreq().'&id='.$workId.'">'; |
|
| 164 | + $actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_user.php?'.api_get_cidreq().'&id='.$workId.'">'; |
|
| 165 | 165 | $actionsLeft .= Display::return_icon('addworkuser.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 166 | 166 | |
| 167 | 167 | $actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=export_pdf">'; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $plagiarismListJqgridLine = array(); |
| 191 | 191 | if (plagiarismActive()) { |
| 192 | 192 | if (plagiarismTool() == TOOL_COMPILATIO) { |
| 193 | - require_once(api_get_path(SYS_CODE_PATH) . "/plagiarism/compilatio/config.php"); |
|
| 193 | + require_once(api_get_path(SYS_CODE_PATH)."/plagiarism/compilatio/config.php"); |
|
| 194 | 194 | $plagiarismTable = Database :: get_course_table(TABLE_COMPILATIO); |
| 195 | 195 | $plagiarismListJqgridColumn = array('Compilatio'); |
| 196 | 196 | $plagiarismListJqgridLine = array( |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | . "gbox_results" |
| 450 | 450 | . '&' |
| 451 | 451 | . 'selectall=1" onclick="javascript: setCheckbox(true, \'' |
| 452 | - . "gbox_results". '\'); return false;">' |
|
| 452 | + . "gbox_results".'\'); return false;">' |
|
| 453 | 453 | . get_lang('SelectAll') |
| 454 | 454 | . '</a>'; |
| 455 | 455 | $html .= '<a class="btn btn-default" href="?' |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | // $html .= '<li><a data-action ="' . $action . '" href="#" onclick="javascript:action_click(this, \'' . "gbox_results" . '\');">' . $label . '</a></li>'; |
| 473 | 473 | // } |
| 474 | 474 | /*fin original*/ |
| 475 | - foreach ($form_action as $action ) { |
|
| 475 | + foreach ($form_action as $action) { |
|
| 476 | 476 | $html .= '<li><a data-action ="' |
| 477 | 477 | . $action["data-action"] |
| 478 | 478 | . '" href="#" ' |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | . '</a></li>'; |
| 483 | 483 | } |
| 484 | 484 | $html .= '</ul>'; |
| 485 | - $html .= '</div>';//btn-group |
|
| 485 | + $html .= '</div>'; //btn-group |
|
| 486 | 486 | $html .= '</div>'; //toolbar |
| 487 | 487 | } |
| 488 | 488 | echo $html; |
@@ -491,19 +491,19 @@ discard block |
||
| 491 | 491 | $compTable = Database::get_course_table("plagiarism_compilatio_docs"); |
| 492 | 492 | |
| 493 | 493 | $listCompilatioDocId = array(); |
| 494 | - $compilatioQuery = "SELECT * FROM " . $compTable . " WHERE c_id= " . $courseId; |
|
| 494 | + $compilatioQuery = "SELECT * FROM ".$compTable." WHERE c_id= ".$courseId; |
|
| 495 | 495 | $compilatioResult = Database::query($compilatioQuery); |
| 496 | 496 | while ($compilatioData = Database::fetch_array($compilatioResult)) { |
| 497 | 497 | array_push($listCompilatioDocId, $compilatioData['id_doc']); |
| 498 | 498 | } |
| 499 | 499 | $javascriptWorkId = ""; |
| 500 | - $sql = "SELECT * FROM " . $workTable . " WHERE c_id= " . $courseId . " AND parent_id= ". $workId. " AND active=1"; |
|
| 500 | + $sql = "SELECT * FROM ".$workTable." WHERE c_id= ".$courseId." AND parent_id= ".$workId." AND active=1"; |
|
| 501 | 501 | file_put_contents("/tmp/aaaSql", print_r($sql, 1)); // IDZ |
| 502 | 502 | $res = Database::query($sql); |
| 503 | 503 | |
| 504 | 504 | while ($data = Database::fetch_array($res)) { |
| 505 | 505 | if (in_array($data['id'], $listCompilatioDocId)) { |
| 506 | - $javascriptWorkId .= $data['id'] . "a"; |
|
| 506 | + $javascriptWorkId .= $data['id']."a"; |
|
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | } |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | var refreshDelaisAfter = 30000; |
| 528 | 528 | var allWorkId = "<?php echo $javascriptWorkId?>"; |
| 529 | 529 | var workFolderId = "<?php echo $workId; ?>"; |
| 530 | - var compilationWebUrl = "<?php echo api_get_path(WEB_CODE_PATH) . 'plagiarism/compilatio/' ?>"; |
|
| 530 | + var compilationWebUrl = "<?php echo api_get_path(WEB_CODE_PATH).'plagiarism/compilatio/' ?>"; |
|
| 531 | 531 | var divExisteTimer = null; |
| 532 | 532 | var msgWaitJS = '<?php echo Display::display_confirmation_message(get_lang('PleaseWaitThisCouldTakeAWhile')); ?>'; |
| 533 | 533 | var div = document.createElement('div'); |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | type: "get", |
| 657 | 657 | dataType: "html", |
| 658 | 658 | error: function(){ |
| 659 | - showData("<?php echo get_lang('compilatioComunicationAjaxImpossible');?>"); |
|
| 659 | + showData("<?php echo get_lang('compilatioComunicationAjaxImpossible'); ?>"); |
|
| 660 | 660 | }, |
| 661 | 661 | success: function( strData ){ |
| 662 | 662 | showData( strData ); |
@@ -35,27 +35,27 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | if (!empty($id)) { |
| 37 | 37 | $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&id='.$my_back_id.'">'. |
| 38 | - Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 38 | + Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') { |
| 42 | 42 | // Create dir |
| 43 | 43 | if (empty($id)) { |
| 44 | 44 | $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir&origin='.$origin.'&gradebook='.$gradebook.'">'; |
| 45 | - $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 45 | + $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 46 | 46 | } |
| 47 | 47 | if (empty($id)) { |
| 48 | 48 | // Options |
| 49 | 49 | $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings&origin='.$origin.'&gradebook='.$gradebook.'">'; |
| 50 | - $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 50 | + $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 51 | 51 | } |
| 52 | - $display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('ViewStudents'),'',ICON_SIZE_MEDIUM) . '</a>'; |
|
| 52 | + $display_output .= '<a id="open-view-list" href="#">'.Display::return_icon('listwork.png', get_lang('ViewStudents'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 53 | 53 | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath' && api_is_allowed_to_session_edit(false, true)) { |
| 57 | 57 | // Delete all files |
| 58 | - if (api_get_setting('permanently_remove_deleted_files') == 'true'){ |
|
| 58 | + if (api_get_setting('permanently_remove_deleted_files') == 'true') { |
|
| 59 | 59 | $message = get_lang('ConfirmYourChoiceDeleteAllfiles'); |
| 60 | 60 | } else { |
| 61 | 61 | $message = get_lang('ConfirmYourChoice'); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | function two_digits($number) |
| 114 | 114 | { |
| 115 | - $number = (int)$number; |
|
| 115 | + $number = (int) $number; |
|
| 116 | 116 | return ($number < 10) ? '0'.$number : $number; |
| 117 | 117 | } |
| 118 | 118 | |
@@ -547,11 +547,11 @@ discard block |
||
| 547 | 547 | ); |
| 548 | 548 | |
| 549 | 549 | $columnModel = array( |
| 550 | - array('name'=>'type', 'index'=>'type', 'width'=>'30', 'align'=>'center', 'sortable' => 'false'), |
|
| 551 | - array('name'=>'title', 'index'=>'title', 'width'=>'250', 'align'=>'left'), |
|
| 552 | - array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'), |
|
| 553 | - array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80', 'align'=>'center'), |
|
| 554 | - array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125', 'align'=>'center'), |
|
| 550 | + array('name'=>'type', 'index'=>'type', 'width'=>'30', 'align'=>'center', 'sortable' => 'false'), |
|
| 551 | + array('name'=>'title', 'index'=>'title', 'width'=>'250', 'align'=>'left'), |
|
| 552 | + array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'), |
|
| 553 | + array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80', 'align'=>'center'), |
|
| 554 | + array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125', 'align'=>'center'), |
|
| 555 | 555 | ); |
| 556 | 556 | |
| 557 | 557 | if ($courseInfo['show_score'] == 0) { |
@@ -588,10 +588,10 @@ discard block |
||
| 588 | 588 | { |
| 589 | 589 | $columnModel = array( |
| 590 | 590 | array('name'=>'type', 'index'=>'type', 'width'=>'35', 'align'=>'center', 'sortable' => 'false'), |
| 591 | - array('name'=>'title', 'index'=>'title', 'width'=>'300', 'align'=>'left', 'wrap_cell' => "true"), |
|
| 592 | - array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125', 'align'=>'center'), |
|
| 593 | - array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125', 'align'=>'center'), |
|
| 594 | - array('name'=>'amount', 'index'=>'end_on', 'width'=>'110', 'align'=>'center'), |
|
| 591 | + array('name'=>'title', 'index'=>'title', 'width'=>'300', 'align'=>'left', 'wrap_cell' => "true"), |
|
| 592 | + array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125', 'align'=>'center'), |
|
| 593 | + array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125', 'align'=>'center'), |
|
| 594 | + array('name'=>'amount', 'index'=>'end_on', 'width'=>'110', 'align'=>'center'), |
|
| 595 | 595 | array('name'=>'actions', 'index'=>'actions', 'width'=>'110', 'align'=>'left', 'sortable'=>'false') |
| 596 | 596 | ); |
| 597 | 597 | |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | return false; |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | - $base_work_dir = api_get_path(SYS_COURSE_PATH) .$_course['path'].'/work'; |
|
| 796 | + $base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/work'; |
|
| 797 | 797 | $work_data_url = $base_work_dir.$work_data['url']; |
| 798 | 798 | $check = Security::check_abs_path($work_data_url.'/', $base_work_dir.'/'); |
| 799 | 799 | |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | function get_work_path($id) |
| 864 | 864 | { |
| 865 | 865 | $table = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
| 866 | - $course_id = api_get_course_int_id(); |
|
| 866 | + $course_id = api_get_course_int_id(); |
|
| 867 | 867 | $sql = 'SELECT url FROM '.$table.' |
| 868 | 868 | WHERE c_id = '.$course_id.' AND id='.intval($id); |
| 869 | 869 | $res = Database::query($sql); |
@@ -984,9 +984,9 @@ discard block |
||
| 984 | 984 | if ($handle = @opendir($directory)) { |
| 985 | 985 | while (false !== ($file = readdir($handle))) { |
| 986 | 986 | if ($file != '.' && $file != '..') { |
| 987 | - if (is_dir($directory. '/' . $file)) { |
|
| 988 | - $array_items = array_merge($array_items, directory_to_array($directory. '/' . $file)); |
|
| 989 | - $file = $directory . '/' . $file; |
|
| 987 | + if (is_dir($directory.'/'.$file)) { |
|
| 988 | + $array_items = array_merge($array_items, directory_to_array($directory.'/'.$file)); |
|
| 989 | + $file = $directory.'/'.$file; |
|
| 990 | 990 | $array_items[] = preg_replace("/\/\//si", '/', $file); |
| 991 | 991 | } |
| 992 | 992 | } |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | |
| 1019 | 1019 | $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
| 1020 | 1020 | |
| 1021 | - for($i = 0; $i < count($only_dir); $i++) { |
|
| 1021 | + for ($i = 0; $i < count($only_dir); $i++) { |
|
| 1022 | 1022 | $url = $only_dir[$i]; |
| 1023 | 1023 | |
| 1024 | 1024 | $params = [ |
@@ -1058,7 +1058,7 @@ discard block |
||
| 1058 | 1058 | if (is_dir($path_dir.'/'.$entry)) { |
| 1059 | 1059 | $count_dir++; |
| 1060 | 1060 | if ($recurse) { |
| 1061 | - $count += count_dir($path_dir . '/' . $entry, $recurse); |
|
| 1061 | + $count += count_dir($path_dir.'/'.$entry, $recurse); |
|
| 1062 | 1062 | } |
| 1063 | 1063 | } else { |
| 1064 | 1064 | $count++; |
@@ -1323,11 +1323,11 @@ discard block |
||
| 1323 | 1323 | $courseInfo |
| 1324 | 1324 | ); |
| 1325 | 1325 | |
| 1326 | - if (!in_array($direction, array('asc','desc'))) { |
|
| 1326 | + if (!in_array($direction, array('asc', 'desc'))) { |
|
| 1327 | 1327 | $direction = 'desc'; |
| 1328 | 1328 | } |
| 1329 | 1329 | if (!empty($where_condition)) { |
| 1330 | - $where_condition = ' AND ' . $where_condition; |
|
| 1330 | + $where_condition = ' AND '.$where_condition; |
|
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | $column = !empty($column) ? Database::escape_string($column) : 'sent_date'; |
@@ -1470,7 +1470,7 @@ discard block |
||
| 1470 | 1470 | $direction = 'desc'; |
| 1471 | 1471 | } |
| 1472 | 1472 | if (!empty($where_condition)) { |
| 1473 | - $where_condition = ' AND ' . $where_condition; |
|
| 1473 | + $where_condition = ' AND '.$where_condition; |
|
| 1474 | 1474 | } |
| 1475 | 1475 | |
| 1476 | 1476 | $column = !empty($column) ? Database::escape_string($column) : 'sent_date'; |
@@ -1528,7 +1528,7 @@ discard block |
||
| 1528 | 1528 | ); |
| 1529 | 1529 | |
| 1530 | 1530 | $work['amount'] = Display::label( |
| 1531 | - $countUniqueAttempts . '/' . |
|
| 1531 | + $countUniqueAttempts.'/'. |
|
| 1532 | 1532 | $totalUsers, |
| 1533 | 1533 | 'success' |
| 1534 | 1534 | ); |
@@ -1577,7 +1577,7 @@ discard block |
||
| 1577 | 1577 | array(), |
| 1578 | 1578 | ICON_SIZE_SMALL |
| 1579 | 1579 | ), |
| 1580 | - api_get_path(WEB_CODE_PATH) . 'work/downloadfolder.inc.php?id=' . $workId . '&' . api_get_cidreq() |
|
| 1580 | + api_get_path(WEB_CODE_PATH).'work/downloadfolder.inc.php?id='.$workId.'&'.api_get_cidreq() |
|
| 1581 | 1581 | ); |
| 1582 | 1582 | } else { |
| 1583 | 1583 | $downloadLink = Display::url( |
@@ -1661,7 +1661,7 @@ discard block |
||
| 1661 | 1661 | $userCondition = " AND u.user_id = $studentId "; |
| 1662 | 1662 | $sessionCondition = " AND w.session_id = $sessionId "; |
| 1663 | 1663 | $workCondition = " AND w_rel.work_id = $workId"; |
| 1664 | - $workParentCondition = " AND w.parent_id = $workId"; |
|
| 1664 | + $workParentCondition = " AND w.parent_id = $workId"; |
|
| 1665 | 1665 | |
| 1666 | 1666 | $sql = "( |
| 1667 | 1667 | $select1 FROM $userTable u |
@@ -1769,7 +1769,7 @@ discard block |
||
| 1769 | 1769 | } |
| 1770 | 1770 | |
| 1771 | 1771 | if ($allowEdition && !empty($itemId)) { |
| 1772 | - $deleteLink = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId); |
|
| 1772 | + $deleteLink = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId); |
|
| 1773 | 1773 | } else { |
| 1774 | 1774 | $deleteLink = null; |
| 1775 | 1775 | } |
@@ -1851,8 +1851,8 @@ discard block |
||
| 1851 | 1851 | $limit = intval($limit); |
| 1852 | 1852 | |
| 1853 | 1853 | /*Call Compilatio's API*/ |
| 1854 | - require_once(api_get_path(SYS_CODE_PATH) . 'plagiarism/compilatio/config.php'); |
|
| 1855 | - require_once(api_get_path(SYS_CODE_PATH) . 'plagiarism/compilatio/compilatio.class.php'); |
|
| 1854 | + require_once(api_get_path(SYS_CODE_PATH).'plagiarism/compilatio/config.php'); |
|
| 1855 | + require_once(api_get_path(SYS_CODE_PATH).'plagiarism/compilatio/compilatio.class.php'); |
|
| 1856 | 1856 | |
| 1857 | 1857 | $compilatio_web_folder = api_get_path(WEB_CODE_PATH).'plagiarism/compilatio/'; |
| 1858 | 1858 | $compilatio = new compilatio( |
@@ -1863,7 +1863,7 @@ discard block |
||
| 1863 | 1863 | ); |
| 1864 | 1864 | |
| 1865 | 1865 | |
| 1866 | - if (!in_array($direction, array('asc','desc'))) { |
|
| 1866 | + if (!in_array($direction, array('asc', 'desc'))) { |
|
| 1867 | 1867 | $direction = 'desc'; |
| 1868 | 1868 | } |
| 1869 | 1869 | |
@@ -1931,13 +1931,13 @@ discard block |
||
| 1931 | 1931 | $work_assignment = get_work_assignment_by_id($work_id); |
| 1932 | 1932 | |
| 1933 | 1933 | if (!empty($studentId)) { |
| 1934 | - $where_condition.= " AND u.user_id = ".intval($studentId); |
|
| 1934 | + $where_condition .= " AND u.user_id = ".intval($studentId); |
|
| 1935 | 1935 | } |
| 1936 | 1936 | |
| 1937 | 1937 | $sql = " $select |
| 1938 | 1938 | FROM $work_condition $user_condition |
| 1939 | 1939 | WHERE $extra_conditions $where_condition $condition_session |
| 1940 | - AND u.status != " . INVITEE . " |
|
| 1940 | + AND u.status != ".INVITEE." |
|
| 1941 | 1941 | ORDER BY $column $direction"; |
| 1942 | 1942 | |
| 1943 | 1943 | if (!empty($start) && !empty($limit)) { |
@@ -1995,7 +1995,7 @@ discard block |
||
| 1995 | 1995 | $qualification_string = Display::label('-'); |
| 1996 | 1996 | } else { |
| 1997 | 1997 | $label = 'info'; |
| 1998 | - $relativeScore = $work['qualification']/$work_data['qualification']; |
|
| 1998 | + $relativeScore = $work['qualification'] / $work_data['qualification']; |
|
| 1999 | 1999 | if ($relativeScore < 0.5) { |
| 2000 | 2000 | $label = 'important'; |
| 2001 | 2001 | } elseif ($relativeScore < 0.75) { |
@@ -2051,10 +2051,10 @@ discard block |
||
| 2051 | 2051 | // If URL is present then there's a file to download keep BC. |
| 2052 | 2052 | if ($work['contains_file'] || !empty($work['url'])) { |
| 2053 | 2053 | $link_to_download = '<a href="'.$url.'download.php?id='.$item_id.'&'.api_get_cidreq().'">'. |
| 2054 | - Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> '; |
|
| 2054 | + Display::return_icon('save.png', get_lang('Save'), array(), ICON_SIZE_SMALL).'</a> '; |
|
| 2055 | 2055 | } |
| 2056 | 2056 | |
| 2057 | - $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;')); |
|
| 2057 | + $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;')); |
|
| 2058 | 2058 | |
| 2059 | 2059 | $feedback = null; |
| 2060 | 2060 | $count = getWorkCommentCount($item_id, $course_info); |
@@ -2073,7 +2073,7 @@ discard block |
||
| 2073 | 2073 | $work_date = api_convert_and_format_date($work['sent_date']); |
| 2074 | 2074 | |
| 2075 | 2075 | $work['sent_date_from_db'] = $work['sent_date']; |
| 2076 | - $work['sent_date'] = '<div class="date-time">' . date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . ' ' . $work_date . '</div>'; |
|
| 2076 | + $work['sent_date'] = '<div class="date-time">'.date_to_str_ago(api_get_local_time($work['sent_date'])).' '.$add_string.' '.$work_date.'</div>'; |
|
| 2077 | 2077 | |
| 2078 | 2078 | // Actions. |
| 2079 | 2079 | $correction = ''; |
@@ -2091,8 +2091,8 @@ discard block |
||
| 2091 | 2091 | Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a> '; |
| 2092 | 2092 | |
| 2093 | 2093 | if ($unoconv && empty($work['contains_file'])) { |
| 2094 | - $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'. |
|
| 2095 | - Display::return_icon('export_doc.png', get_lang('ExportToDoc'),array(), ICON_SIZE_SMALL).'</a> '; |
|
| 2094 | + $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'. |
|
| 2095 | + Display::return_icon('export_doc.png', get_lang('ExportToDoc'), array(), ICON_SIZE_SMALL).'</a> '; |
|
| 2096 | 2096 | } |
| 2097 | 2097 | |
| 2098 | 2098 | $correction = ' |
@@ -2144,9 +2144,9 @@ discard block |
||
| 2144 | 2144 | |
| 2145 | 2145 | if ($locked) { |
| 2146 | 2146 | if ($qualification_exists) { |
| 2147 | - $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL); |
|
| 2147 | + $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'), array(), ICON_SIZE_SMALL); |
|
| 2148 | 2148 | } else { |
| 2149 | - $action .= Display::return_icon('edit_na.png', get_lang('Comment'),array(), ICON_SIZE_SMALL); |
|
| 2149 | + $action .= Display::return_icon('edit_na.png', get_lang('Comment'), array(), ICON_SIZE_SMALL); |
|
| 2150 | 2150 | } |
| 2151 | 2151 | } else { |
| 2152 | 2152 | if ($qualification_exists) { |
@@ -2160,45 +2160,45 @@ discard block |
||
| 2160 | 2160 | |
| 2161 | 2161 | if ($work['contains_file']) { |
| 2162 | 2162 | if ($locked) { |
| 2163 | - $action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL); |
|
| 2163 | + $action .= Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL); |
|
| 2164 | 2164 | } else { |
| 2165 | 2165 | $action .= '<a href="'.$url.'work.php?'.api_get_cidreq().'&action=move&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Move').'">'. |
| 2166 | - Display::return_icon('move.png', get_lang('Move'),array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2166 | + Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2167 | 2167 | } |
| 2168 | 2168 | } |
| 2169 | 2169 | |
| 2170 | 2170 | if ($work['accepted'] == '1') { |
| 2171 | 2171 | $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_invisible&item_id='.$item_id.'" title="'.get_lang('Invisible').'" >'. |
| 2172 | - Display::return_icon('visible.png', get_lang('Invisible'),array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2172 | + Display::return_icon('visible.png', get_lang('Invisible'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2173 | 2173 | } else { |
| 2174 | 2174 | $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_visible&item_id='.$item_id.'" title="'.get_lang('Visible').'" >'. |
| 2175 | - Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).'</a> '; |
|
| 2175 | + Display::return_icon('invisible.png', get_lang('Visible'), array(), ICON_SIZE_SMALL).'</a> '; |
|
| 2176 | 2176 | } |
| 2177 | 2177 | |
| 2178 | 2178 | if ($locked) { |
| 2179 | 2179 | $action .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
| 2180 | 2180 | } else { |
| 2181 | - $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'. |
|
| 2182 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
| 2181 | + $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'. |
|
| 2182 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
| 2183 | 2183 | } |
| 2184 | 2184 | } elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) { |
| 2185 | 2185 | $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'. |
| 2186 | - Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2186 | + Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2187 | 2187 | |
| 2188 | 2188 | if (api_get_course_setting('student_delete_own_publication') == 1) { |
| 2189 | 2189 | if (api_is_allowed_to_session_edit(false, true)) { |
| 2190 | 2190 | $action .= '<a href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Modify').'">'. |
| 2191 | - Display::return_icon('edit.png', get_lang('Comment'),array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2191 | + Display::return_icon('edit.png', get_lang('Comment'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2192 | 2192 | } |
| 2193 | - $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'. |
|
| 2194 | - Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
| 2193 | + $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'. |
|
| 2194 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
| 2195 | 2195 | } else { |
| 2196 | - $action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL); |
|
| 2196 | + $action .= Display::return_icon('edit_na.png', get_lang('Modify'), array(), ICON_SIZE_SMALL); |
|
| 2197 | 2197 | } |
| 2198 | 2198 | } else { |
| 2199 | 2199 | $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'. |
| 2200 | - Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2201 | - $action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL); |
|
| 2200 | + Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 2201 | + $action .= Display::return_icon('edit_na.png', get_lang('Modify'), array(), ICON_SIZE_SMALL); |
|
| 2202 | 2202 | } |
| 2203 | 2203 | |
| 2204 | 2204 | // Status. |
@@ -2220,7 +2220,7 @@ discard block |
||
| 2220 | 2220 | . $course_id; |
| 2221 | 2221 | $compiSqlResult = Database::query($compilatioQuery); |
| 2222 | 2222 | $compi = Database::fetch_object($compiSqlResult); |
| 2223 | - $workDirectory = api_get_path(SYS_COURSE_PATH) . $course_info['directory']; |
|
| 2223 | + $workDirectory = api_get_path(SYS_COURSE_PATH).$course_info['directory']; |
|
| 2224 | 2224 | if (isset($compi->compilatio_id)) { |
| 2225 | 2225 | $actionCompilatio = "<div id='id_avancement" |
| 2226 | 2226 | . $item_id |
@@ -2235,8 +2235,8 @@ discard block |
||
| 2235 | 2235 | $actionCompilatio = "<div style='font-style:italic'>" |
| 2236 | 2236 | . get_lang('compilatioFileisnotsupported') |
| 2237 | 2237 | ."</div>"; |
| 2238 | - } elseif (filesize($workDirectory . "/" . $work['url']) > $compilatioParameter['max_filesize']) { |
|
| 2239 | - $sizeFile = round(filesize($workDirectory . "/" . $work['url']) / 1000000); |
|
| 2238 | + } elseif (filesize($workDirectory."/".$work['url']) > $compilatioParameter['max_filesize']) { |
|
| 2239 | + $sizeFile = round(filesize($workDirectory."/".$work['url']) / 1000000); |
|
| 2240 | 2240 | $status = "BAD_FILESIZE"; |
| 2241 | 2241 | $actionCompilatio = "<div style='font-style:italic'>" |
| 2242 | 2242 | .get_lang('compilatioTooHeavyDocument') |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | $_course = api_get_course_info(); |
| 2278 | 2278 | $task_id = $task_data['id']; |
| 2279 | 2279 | $task_title = !empty($task_data['title']) ? $task_data['title'] : basename($task_data['url']); |
| 2280 | - $subject = '[' . api_get_setting('siteName') . '] '; |
|
| 2280 | + $subject = '['.api_get_setting('siteName').'] '; |
|
| 2281 | 2281 | |
| 2282 | 2282 | // The body can be as long as you wish, and any combination of text and variables |
| 2283 | 2283 | $content = get_lang('ReminderToSubmitPendingTask')."\n".get_lang('CourseName').' : '.$_course['name']."\n"; |
@@ -2288,7 +2288,7 @@ discard block |
||
| 2288 | 2288 | $mails_sent_to = array(); |
| 2289 | 2289 | foreach ($list_users as $user) { |
| 2290 | 2290 | $name_user = api_get_person_name($user[1], $user[0], null, PERSON_NAME_EMAIL_ADDRESS); |
| 2291 | - $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]) .", \n\n"; |
|
| 2291 | + $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]).", \n\n"; |
|
| 2292 | 2292 | $body = $dear_line.$content; |
| 2293 | 2293 | MessageManager::send_message($user[3], $subject, $body); |
| 2294 | 2294 | $mails_sent_to[] = $name_user; |
@@ -2317,22 +2317,22 @@ discard block |
||
| 2317 | 2317 | } else { |
| 2318 | 2318 | $students = CourseManager::get_student_list_from_course_code($courseCode, true, $sessionId); |
| 2319 | 2319 | } |
| 2320 | - $emailsubject = '[' . api_get_setting('siteName') . '] '.get_lang('HomeworkCreated'); |
|
| 2320 | + $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('HomeworkCreated'); |
|
| 2321 | 2321 | $currentUser = api_get_user_info(api_get_user_id()); |
| 2322 | 2322 | if (!empty($students)) { |
| 2323 | - foreach($students as $student) { |
|
| 2323 | + foreach ($students as $student) { |
|
| 2324 | 2324 | $user_info = api_get_user_info($student["user_id"]); |
| 2325 | - if(!empty($user_info["mail"])) { |
|
| 2325 | + if (!empty($user_info["mail"])) { |
|
| 2326 | 2326 | $name_user = api_get_person_name( |
| 2327 | 2327 | $user_info["firstname"], |
| 2328 | 2328 | $user_info["lastname"], |
| 2329 | 2329 | null, |
| 2330 | 2330 | PERSON_NAME_EMAIL_ADDRESS |
| 2331 | 2331 | ); |
| 2332 | - $link = api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $workId; |
|
| 2332 | + $link = api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId; |
|
| 2333 | 2333 | $emailbody = get_lang('Dear')." ".$name_user.",\n\n"; |
| 2334 | 2334 | $emailbody .= get_lang('HomeworkHasBeenCreatedForTheCourse')." ".$courseCode.". "."\n\n". |
| 2335 | - '<a href="'. $link . '">' . get_lang('PleaseCheckHomeworkPage') . '</a>'; |
|
| 2335 | + '<a href="'.$link.'">'.get_lang('PleaseCheckHomeworkPage').'</a>'; |
|
| 2336 | 2336 | $emailbody .= "\n\n".api_get_person_name($currentUser["firstname"], $currentUser["lastname"]); |
| 2337 | 2337 | |
| 2338 | 2338 | $additionalParameters = array( |
@@ -2374,7 +2374,7 @@ discard block |
||
| 2374 | 2374 | $url = Database::escape_string($url); |
| 2375 | 2375 | $sql = "SELECT id FROM $work_table WHERE url='$url'"; |
| 2376 | 2376 | $result = Database::query($sql); |
| 2377 | - if (Database::num_rows($result)> 0) { |
|
| 2377 | + if (Database::num_rows($result) > 0) { |
|
| 2378 | 2378 | $row = Database::fetch_row($result); |
| 2379 | 2379 | if (empty($row)) { |
| 2380 | 2380 | return false; |
@@ -2396,7 +2396,7 @@ discard block |
||
| 2396 | 2396 | { |
| 2397 | 2397 | $output = '<select name="'.$name.'" id="'.$name.'">'; |
| 2398 | 2398 | foreach ($values as $key => $value) { |
| 2399 | - $output .= '<option value="'.$key.'" '.(($checked==$key) ? 'selected="selected"' : '').'>'.$value.'</option>'; |
|
| 2399 | + $output .= '<option value="'.$key.'" '.(($checked == $key) ? 'selected="selected"' : '').'>'.$value.'</option>'; |
|
| 2400 | 2400 | } |
| 2401 | 2401 | $output .= '</select>'; |
| 2402 | 2402 | return $output; |
@@ -2410,9 +2410,9 @@ discard block |
||
| 2410 | 2410 | */ |
| 2411 | 2411 | function make_checkbox($name, $checked = '', $label = null) |
| 2412 | 2412 | { |
| 2413 | - $check = '<input id ="'.$name.'" type="checkbox" value="1" name="'.$name.'" '.((!empty($checked))?'checked="checked"':'').'/>'; |
|
| 2413 | + $check = '<input id ="'.$name.'" type="checkbox" value="1" name="'.$name.'" '.((!empty($checked)) ? 'checked="checked"' : '').'/>'; |
|
| 2414 | 2414 | if (!empty($label)) { |
| 2415 | - $check .="<label for ='$name'>$label</label>"; |
|
| 2415 | + $check .= "<label for ='$name'>$label</label>"; |
|
| 2416 | 2416 | } |
| 2417 | 2417 | return $check; |
| 2418 | 2418 | } |
@@ -2566,7 +2566,7 @@ discard block |
||
| 2566 | 2566 | } |
| 2567 | 2567 | |
| 2568 | 2568 | if (!empty($studentId)) { |
| 2569 | - $sql_users.= " AND u.user_id = ".intval($studentId); |
|
| 2569 | + $sql_users .= " AND u.user_id = ".intval($studentId); |
|
| 2570 | 2570 | } |
| 2571 | 2571 | |
| 2572 | 2572 | $group_id = api_get_group_id(); |
@@ -2576,7 +2576,7 @@ discard block |
||
| 2576 | 2576 | if ($group_id) { |
| 2577 | 2577 | $group_user_list = GroupManager::get_subscribed_users($group_id); |
| 2578 | 2578 | if (!empty($group_user_list)) { |
| 2579 | - foreach($group_user_list as $group_user) { |
|
| 2579 | + foreach ($group_user_list as $group_user) { |
|
| 2580 | 2580 | $new_group_user_list[] = $group_user['user_id']; |
| 2581 | 2581 | } |
| 2582 | 2582 | } |
@@ -2997,7 +2997,7 @@ discard block |
||
| 2997 | 2997 | function getWorkComments($work) |
| 2998 | 2998 | { |
| 2999 | 2999 | $commentTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT_COMMENT); |
| 3000 | - $userTable= Database::get_main_table(TABLE_MAIN_USER); |
|
| 3000 | + $userTable = Database::get_main_table(TABLE_MAIN_USER); |
|
| 3001 | 3001 | |
| 3002 | 3002 | $courseId = intval($work['c_id']); |
| 3003 | 3003 | $workId = intval($work['id']); |
@@ -3680,7 +3680,7 @@ discard block |
||
| 3680 | 3680 | null, |
| 3681 | 3681 | PERSON_NAME_EMAIL_ADDRESS |
| 3682 | 3682 | ); |
| 3683 | - $subject = "[" . api_get_setting('siteName') . "] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']." "; |
|
| 3683 | + $subject = "[".api_get_setting('siteName')."] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']." "; |
|
| 3684 | 3684 | foreach ($user_list as $user_data) { |
| 3685 | 3685 | $to_user_id = $user_data['user_id']; |
| 3686 | 3686 | $user_info = api_get_user_info($to_user_id); |
@@ -3729,7 +3729,7 @@ discard block |
||
| 3729 | 3729 | |
| 3730 | 3730 | $title = $values['title']; |
| 3731 | 3731 | $description = $values['description']; |
| 3732 | - $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']): 0; |
|
| 3732 | + $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']) : 0; |
|
| 3733 | 3733 | |
| 3734 | 3734 | $saveWork = true; |
| 3735 | 3735 | $message = null; |
@@ -4103,8 +4103,8 @@ discard block |
||
| 4103 | 4103 | LINK_STUDENTPUBLICATION, |
| 4104 | 4104 | $workId, |
| 4105 | 4105 | $params['new_dir'], |
| 4106 | - (float)$params['weight'], |
|
| 4107 | - (float)$params['qualification'], |
|
| 4106 | + (float) $params['weight'], |
|
| 4107 | + (float) $params['qualification'], |
|
| 4108 | 4108 | $params['description'], |
| 4109 | 4109 | 1, |
| 4110 | 4110 | api_get_session_id() |
@@ -4364,15 +4364,15 @@ discard block |
||
| 4364 | 4364 | // changing the tool setting: is a student allowed to delete his/her own document |
| 4365 | 4365 | |
| 4366 | 4366 | // counting the number of occurrences of this setting (if 0 => add, if 1 => update) |
| 4367 | - $query = "SELECT * FROM " . $table_course_setting . " |
|
| 4367 | + $query = "SELECT * FROM ".$table_course_setting." |
|
| 4368 | 4368 | WHERE c_id = $courseId AND variable = 'student_delete_own_publication'"; |
| 4369 | 4369 | |
| 4370 | 4370 | $result = Database::query($query); |
| 4371 | 4371 | $number_of_setting = Database::num_rows($result); |
| 4372 | 4372 | |
| 4373 | 4373 | if ($number_of_setting == 1) { |
| 4374 | - $query = "UPDATE " . $table_course_setting . " SET |
|
| 4375 | - value='" . Database::escape_string($studentDeleteOwnPublication) . "' |
|
| 4374 | + $query = "UPDATE ".$table_course_setting." SET |
|
| 4375 | + value='" . Database::escape_string($studentDeleteOwnPublication)."' |
|
| 4376 | 4376 | WHERE variable = 'student_delete_own_publication' AND c_id = $courseId"; |
| 4377 | 4377 | Database::query($query); |
| 4378 | 4378 | } else { |
@@ -4411,9 +4411,9 @@ discard block |
||
| 4411 | 4411 | $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
| 4412 | 4412 | $item_id = intval($item_id); |
| 4413 | 4413 | $course_id = $course_info['real_id']; |
| 4414 | - $sql = "UPDATE " . $work_table . " |
|
| 4414 | + $sql = "UPDATE ".$work_table." |
|
| 4415 | 4415 | SET accepted = 0 |
| 4416 | - WHERE c_id = $course_id AND id = '" . $item_id . "'"; |
|
| 4416 | + WHERE c_id = $course_id AND id = '".$item_id."'"; |
|
| 4417 | 4417 | Database::query($sql); |
| 4418 | 4418 | api_item_property_update( |
| 4419 | 4419 | $course_info, |
@@ -4557,7 +4557,7 @@ discard block |
||
| 4557 | 4557 | $courseCode, |
| 4558 | 4558 | $sessionId, |
| 4559 | 4559 | $limitString, |
| 4560 | - $orderBy , |
|
| 4560 | + $orderBy, |
|
| 4561 | 4561 | STUDENT, |
| 4562 | 4562 | $getCount |
| 4563 | 4563 | ); |
@@ -4894,8 +4894,8 @@ discard block |
||
| 4894 | 4894 | if (!empty($sessionId)) { |
| 4895 | 4895 | $sessionInfo = api_get_session_info($sessionId); |
| 4896 | 4896 | if (!empty($sessionInfo)) { |
| 4897 | - $header .= ' - ' . $sessionInfo['name']; |
|
| 4898 | - $header .= '<br />' . $sessionInfo['description']; |
|
| 4897 | + $header .= ' - '.$sessionInfo['name']; |
|
| 4898 | + $header .= '<br />'.$sessionInfo['description']; |
|
| 4899 | 4899 | $teachers = SessionManager::getCoachesByCourseSessionToString( |
| 4900 | 4900 | $sessionId, |
| 4901 | 4901 | $courseInfo['real_id'] |
@@ -4911,12 +4911,12 @@ discard block |
||
| 4911 | 4911 | $expiresOn = null; |
| 4912 | 4912 | |
| 4913 | 4913 | if (!empty($assignment) && isset($assignment['expires_on'])) { |
| 4914 | - $content .= '<br /><strong>' . get_lang('ExpirationDate') . '</strong>: ' . api_get_local_time($assignment['expires_on']); |
|
| 4914 | + $content .= '<br /><strong>'.get_lang('ExpirationDate').'</strong>: '.api_get_local_time($assignment['expires_on']); |
|
| 4915 | 4915 | $expiresOn = api_get_local_time($assignment['expires_on']); |
| 4916 | 4916 | } |
| 4917 | 4917 | |
| 4918 | 4918 | if (!empty($workData['description'])) { |
| 4919 | - $content .= '<br /><strong>' . get_lang('Description') . '</strong>: ' . $workData['description']; |
|
| 4919 | + $content .= '<br /><strong>'.get_lang('Description').'</strong>: '.$workData['description']; |
|
| 4920 | 4920 | } |
| 4921 | 4921 | |
| 4922 | 4922 | $workList = get_work_user_list(null, null, null, null, $workId); |
@@ -4937,7 +4937,7 @@ discard block |
||
| 4937 | 4937 | ); |
| 4938 | 4938 | |
| 4939 | 4939 | $column = 0; |
| 4940 | - foreach($headers as $header) { |
|
| 4940 | + foreach ($headers as $header) { |
|
| 4941 | 4941 | $table->setHeaderContents(0, $column, $header); |
| 4942 | 4942 | $column++; |
| 4943 | 4943 | } |
@@ -4985,7 +4985,7 @@ discard block |
||
| 4985 | 4985 | |
| 4986 | 4986 | if (!empty($content)) { |
| 4987 | 4987 | $params = array( |
| 4988 | - 'filename' => $workData['title'] . '_' . api_get_local_time(), |
|
| 4988 | + 'filename' => $workData['title'].'_'.api_get_local_time(), |
|
| 4989 | 4989 | 'pdf_title' => api_replace_dangerous_char($workData['title']), |
| 4990 | 4990 | 'course_code' => $courseInfo['code'], |
| 4991 | 4991 | 'add_signatures' => false |
@@ -5016,7 +5016,7 @@ discard block |
||
| 5016 | 5016 | $tempZipFile = api_get_path(SYS_ARCHIVE_PATH).api_get_unique_id().".zip"; |
| 5017 | 5017 | $coursePath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/work/'; |
| 5018 | 5018 | |
| 5019 | - $zip = new PclZip($tempZipFile); |
|
| 5019 | + $zip = new PclZip($tempZipFile); |
|
| 5020 | 5020 | |
| 5021 | 5021 | $workPerUser = getWorkPerUser($userId); |
| 5022 | 5022 | |
@@ -5180,8 +5180,8 @@ discard block |
||
| 5180 | 5180 | */ |
| 5181 | 5181 | function compilatioDeleteDoc($courseId, $itemId) |
| 5182 | 5182 | { |
| 5183 | - $plagiarism_table = Database :: get_course_table(TABLE_COMPILATIO); |
|
| 5184 | - $queryString4 = "DELETE FROM " |
|
| 5183 | + $plagiarism_table = Database :: get_course_table(TABLE_COMPILATIO); |
|
| 5184 | + $queryString4 = "DELETE FROM " |
|
| 5185 | 5185 | . $plagiarism_table |
| 5186 | 5186 | . " WHERE c_id = " |
| 5187 | 5187 | . $courseId |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | use ChamiloSession as Session; |
| 9 | 9 | |
| 10 | 10 | require_once '../inc/global.inc.php'; |
| 11 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 11 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 12 | 12 | |
| 13 | 13 | api_protect_course_script(true); |
| 14 | 14 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $item_id = isset($_REQUEST['item_id']) ? intval($_REQUEST['item_id']) : null; |
| 40 | 40 | $origin = isset($_REQUEST['origin']) ? Security::remove_XSS($_REQUEST['origin']) : ''; |
| 41 | 41 | $course_dir = api_get_path(SYS_COURSE_PATH).$_course['path']; |
| 42 | -$base_work_dir = $course_dir . '/work'; |
|
| 42 | +$base_work_dir = $course_dir.'/work'; |
|
| 43 | 43 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'list'; |
| 44 | 44 | |
| 45 | 45 | //Download folder |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), |
| 77 | 77 | 'name' => get_lang('StudentPublications'), |
| 78 | 78 | ); |
| 79 | - $url_dir = api_get_path(WEB_CODE_PATH).'work/work.php?&id=' . $work_id.'&'.api_get_cidreq(); |
|
| 79 | + $url_dir = api_get_path(WEB_CODE_PATH).'work/work.php?&id='.$work_id.'&'.api_get_cidreq(); |
|
| 80 | 80 | if (!empty($my_folder_data)) { |
| 81 | 81 | $interbreadcrumb[] = array('url' => $url_dir, 'name' => $my_folder_data['title']); |
| 82 | 82 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditToolOptions')); |
| 120 | 120 | } |
| 121 | 121 | if ($action == 'create_dir') { |
| 122 | - $interbreadcrumb[] = array('url' => '#','name' => get_lang('CreateAssignment')); |
|
| 122 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('CreateAssignment')); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $form = new FormValidator( |
| 171 | 171 | 'form1', |
| 172 | 172 | 'post', |
| 173 | - api_get_path(WEB_CODE_PATH) . 'work/work.php?action=create_dir&' . api_get_cidreq() |
|
| 173 | + api_get_path(WEB_CODE_PATH).'work/work.php?action=create_dir&'.api_get_cidreq() |
|
| 174 | 174 | ); |
| 175 | 175 | $form->addElement('header', get_lang('CreateAssignment')); |
| 176 | 176 | $form->addElement('hidden', 'action', 'add'); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $result = deleteDirWork($_REQUEST['id']); |
| 208 | 208 | if ($result) { |
| 209 | 209 | $message = Display::return_message( |
| 210 | - get_lang('DirDeleted') . ': ' . $work_to_delete['title'], |
|
| 210 | + get_lang('DirDeleted').': '.$work_to_delete['title'], |
|
| 211 | 211 | 'success' |
| 212 | 212 | ); |
| 213 | 213 | Session::write('message', $message); |
@@ -235,19 +235,19 @@ discard block |
||
| 235 | 235 | if ($is_allowed_to_edit) { |
| 236 | 236 | $move_to_path = get_work_path($_REQUEST['move_to_id']); |
| 237 | 237 | |
| 238 | - if ($move_to_path==-1) { |
|
| 238 | + if ($move_to_path == -1) { |
|
| 239 | 239 | $move_to_path = '/'; |
| 240 | 240 | } elseif (substr($move_to_path, -1, 1) != '/') { |
| 241 | - $move_to_path = $move_to_path .'/'; |
|
| 241 | + $move_to_path = $move_to_path.'/'; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // Security fix: make sure they can't move files that are not in the document table |
| 245 | 245 | if ($path = get_work_path($item_id)) { |
| 246 | - if (move($course_dir.'/'.$path, $base_work_dir . $move_to_path)) { |
|
| 246 | + if (move($course_dir.'/'.$path, $base_work_dir.$move_to_path)) { |
|
| 247 | 247 | // Update db |
| 248 | 248 | updateWorkUrl( |
| 249 | 249 | $item_id, |
| 250 | - 'work' . $move_to_path, |
|
| 250 | + 'work'.$move_to_path, |
|
| 251 | 251 | $_REQUEST['move_to_id'] |
| 252 | 252 | ); |
| 253 | 253 | |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | $content .= '</div>'; |
| 346 | 346 | $content .= '</div>'; |
| 347 | 347 | $content .= '<div id="student-list-work" style="display: none" class="table-responsive">'; |
| 348 | - $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> ' .get_lang('Close'). '</a></div>'; |
|
| 348 | + $content .= '<div class="toolbar"><a id="closed-view-list" href="#"><em class="fa fa-times-circle"></em> '.get_lang('Close').'</a></div>'; |
|
| 349 | 349 | $content .= showStudentList($work_id); |
| 350 | 350 | $content .= '</div>'; |
| 351 | 351 | } else { |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | var refreshDelaisAfter = 30000; // en ms pour chercher le % avancement de la detection |
| 391 | 391 | var allWorkId = "<?php echo $javascriptWorkId?>"; // list of workid to check 1a5a6a7a8a9a10a11 |
| 392 | 392 | var workFolderId = "<?php echo $workId; ?>"; |
| 393 | - var compilationWebUrl = "<?php echo api_get_path(WEB_CODE_PATH) . 'plagiarism/compilatio/' ?>"; |
|
| 393 | + var compilationWebUrl = "<?php echo api_get_path(WEB_CODE_PATH).'plagiarism/compilatio/' ?>"; |
|
| 394 | 394 | var divExisteTimer = null; |
| 395 | 395 | |
| 396 | 396 | function compilatioInit() { |
@@ -4,11 +4,11 @@ discard block |
||
| 4 | 4 | * Edition of extensions configuration |
| 5 | 5 | * @package chamilo.admin |
| 6 | 6 | */ |
| 7 | -$cidReset=true; |
|
| 7 | +$cidReset = true; |
|
| 8 | 8 | require_once '../inc/global.inc.php'; |
| 9 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
| 9 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
| 10 | 10 | api_protect_admin_script(); |
| 11 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
| 11 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
| 12 | 12 | // Database Table Definitions |
| 13 | 13 | $tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
| 14 | 14 | $message = ''; |
@@ -21,16 +21,16 @@ discard block |
||
| 21 | 21 | WHERE variable="service_visio" |
| 22 | 22 | AND subkey="active"'; |
| 23 | 23 | $rs = Database::query($sql); |
| 24 | - if (Database::affected_rows($rs)>0) { |
|
| 24 | + if (Database::affected_rows($rs) > 0) { |
|
| 25 | 25 | // select all the courses and insert the tool inside |
| 26 | 26 | $sql = 'SELECT id FROM '.Database::get_main_table(TABLE_MAIN_COURSE); |
| 27 | 27 | $rs = Database::query($sql); |
| 28 | - while($row = Database::fetch_array($rs)){ |
|
| 29 | - if(!empty($_POST['visio_host'])) { |
|
| 28 | + while ($row = Database::fetch_array($rs)) { |
|
| 29 | + if (!empty($_POST['visio_host'])) { |
|
| 30 | 30 | $tool_table = Database::get_course_table(TABLE_TOOL_LIST); |
| 31 | 31 | $select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CONFERENCE."'"; |
| 32 | 32 | $selectres = Database::query($select); |
| 33 | - if (Database::num_rows($selectres)<1) { |
|
| 33 | + if (Database::num_rows($selectres) < 1) { |
|
| 34 | 34 | $sql = 'INSERT INTO '.$tool_table.' SET |
| 35 | 35 | c_id = '.$row['id'].', |
| 36 | 36 | name="'.TOOL_VISIO_CONFERENCE.'", |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | $select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CLASSROOM."'"; |
| 47 | 47 | $selectres = Database::query($select); |
| 48 | - if(Database::num_rows($selectres)<1) { |
|
| 48 | + if (Database::num_rows($selectres) < 1) { |
|
| 49 | 49 | $sql = 'INSERT INTO '.$tool_table.' SET |
| 50 | 50 | c_id = '.$row['id'].', |
| 51 | 51 | name="'.TOOL_VISIO_CLASSROOM.'", |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | $rs = Database::query($sql); |
| 83 | 83 | |
| 84 | 84 | $sql = 'UPDATE '.$tbl_settings_current.' SET |
| 85 | - selected_value="'.($_POST['visio_use_rtmpt']=='true'?'true':'false').'" |
|
| 85 | + selected_value="'.($_POST['visio_use_rtmpt'] == 'true' ? 'true' : 'false').'" |
|
| 86 | 86 | WHERE variable="service_visio" |
| 87 | 87 | AND subkey="visio_use_rtmpt"'; |
| 88 | 88 | $rs = Database::query($sql); |
| 89 | 89 | |
| 90 | - if(empty($message)) { |
|
| 90 | + if (empty($message)) { |
|
| 91 | 91 | $message = get_lang('ServiceReconfigured'); |
| 92 | 92 | } |
| 93 | 93 | break; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $rs = Database::query($sql); |
| 102 | 102 | |
| 103 | - if (Database::affected_rows($rs)>0){ |
|
| 103 | + if (Database::affected_rows($rs) > 0) { |
|
| 104 | 104 | $message = get_lang('ServiceActivated'); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -153,20 +153,20 @@ discard block |
||
| 153 | 153 | WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"'; |
| 154 | 154 | |
| 155 | 155 | $rs = Database::query($sql); |
| 156 | -while($row = Database::fetch_array($rs)){ |
|
| 156 | +while ($row = Database::fetch_array($rs)) { |
|
| 157 | 157 | $listActiveServices[] = $row['variable']; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | // javascript to handle accordion behaviour |
| 161 | 161 | $javascript_message = ''; |
| 162 | -if(!empty($message)){ |
|
| 162 | +if (!empty($message)) { |
|
| 163 | 163 | $javascript_message = |
| 164 | 164 | ' |
| 165 | 165 | document.getElementById("message").style.display = "block"; |
| 166 | 166 | var timer = setTimeout(hideMessage,5000); |
| 167 | 167 | '; |
| 168 | 168 | } |
| 169 | -$htmlHeadXtra[]= ' |
|
| 169 | +$htmlHeadXtra[] = ' |
|
| 170 | 170 | <script type="text/javascript"> |
| 171 | 171 | var listeDiv; |
| 172 | 172 | var extensionsHeader = new Array(); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | ?> |
| 216 | 216 | <div id="message" style="display: none"> |
| 217 | 217 | <?php |
| 218 | - if(!empty($message)) |
|
| 218 | + if (!empty($message)) |
|
| 219 | 219 | Display::display_normal_message($message) |
| 220 | 220 | ?> |
| 221 | 221 | </div> |
@@ -330,13 +330,13 @@ discard block |
||
| 330 | 330 | $renderer = $form -> defaultRenderer(); |
| 331 | 331 | $renderer -> setElementTemplate('<div style="text-align:left">{label}</div><div style="text-align:left">{element}</div>'); |
| 332 | 332 | //$form -> addElement('html','<br /><br />'); |
| 333 | - if(in_array('service_ppt2lp',$listActiveServices)) |
|
| 333 | + if (in_array('service_ppt2lp', $listActiveServices)) |
|
| 334 | 334 | { |
| 335 | 335 | $sql = 'SELECT subkey, selected_value FROM '.$tbl_settings_current.' |
| 336 | 336 | WHERE variable = "service_ppt2lp" |
| 337 | 337 | AND subkey <> "active"'; |
| 338 | 338 | $rs = Database::query($sql); |
| 339 | - while($row = Database::fetch_array($rs,'ASSOC')) |
|
| 339 | + while ($row = Database::fetch_array($rs, 'ASSOC')) |
|
| 340 | 340 | { |
| 341 | 341 | $defaults[$row['subkey']] = $row['selected_value']; |
| 342 | 342 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | <!-- COMPILATIO --> |
| 503 | 503 | <div id="main_compilatio"> |
| 504 | 504 | <div id="extension_header_compilatio" class="accordion_header"> |
| 505 | - <a href="#"><?php echo get_lang('compilatioPlagiarismDetector');?></a> |
|
| 505 | + <a href="#"><?php echo get_lang('compilatioPlagiarismDetector'); ?></a> |
|
| 506 | 506 | </div> |
| 507 | 507 | <div id="extension_content_compilatio" style="display:none;padding:0;width:780px;" class="accordion_content"> |
| 508 | 508 | <table width="100%" cellpadding="0" cellspacing="0"> |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | session_cache_limiter('public');
|
| 14 | 14 | require_once '../inc/global.inc.php'; |
| 15 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 15 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 16 | 16 | |
| 17 | 17 | $this_section = SECTION_COURSES; |
| 18 | 18 | |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | $compilatioParameter['proxy_host'], |
| 20 | 20 | $compilatioParameter['proxy_port'] |
| 21 | 21 | ); |
| 22 | - $use_space = number_format($quotas->usedSpace/1000000, 2); |
|
| 23 | - $total_space=$quotas->space/1000000; |
|
| 22 | + $use_space = number_format($quotas->usedSpace / 1000000, 2); |
|
| 23 | + $total_space = $quotas->space / 1000000; |
|
| 24 | 24 | |
| 25 | - echo "<h3>" . get_lang('compilatioDescription') . "</h3>";
|
|
| 25 | + echo "<h3>".get_lang('compilatioDescription')."</h3>";
|
|
| 26 | 26 | |
| 27 | 27 | echo "<b>" |
| 28 | 28 | . get_lang('compilatioQuota')
|
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ?> |
| 38 | 38 | <br><br> |
| 39 | 39 | <? |
| 40 | - if(!isset($_GET['action'])) |
|
| 40 | + if (!isset($_GET['action'])) |
|
| 41 | 41 | {
|
| 42 | 42 | ?> |
| 43 | 43 | <body style="margin:0px;padding:0px"> |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | {
|
| 60 | 60 | echo get_lang('compilatioConnectionAccomplished')."<br>";
|
| 61 | 61 | echo "2) ".get_lang('compilatioSendTextToServer')."<br>";
|
| 62 | - $text = get_lang('compilatioTestSendText'). $compilatioParameter['key'];
|
|
| 62 | + $text = get_lang('compilatioTestSendText').$compilatioParameter['key'];
|
|
| 63 | 63 | $id_compi = $compilatio->SendDoc( |
| 64 | 64 | 'Doc de test', |
| 65 | 65 | 'test', |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(api_get_path(LIBRARY_PATH) . "api.lib.php"); |
|
| 3 | +require_once(api_get_path(LIBRARY_PATH)."api.lib.php"); |
|
| 4 | 4 | |
| 5 | 5 | /*Compilatio's key*/ |
| 6 | 6 | $compilatioParameter['key'] = api_get_setting("compilatioParamKey");
|
@@ -27,5 +27,5 @@ discard block |
||
| 27 | 27 | $compilatioParameter['wget_password'] = ""; |
| 28 | 28 | |
| 29 | 29 | /*Document's maximum size*/ |
| 30 | -$compilatioParameter['max_filesize'] = 10000000; // 10Mo |
|
| 30 | +$compilatioParameter['max_filesize'] = 10000000; // 10Mo |
|
| 31 | 31 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | class compilatio |
| 12 | 12 | { |
| 13 | 13 | /*Identification key for the Compilatio account*/ |
| 14 | - var $key = null; |
|
| 14 | + var $key = null; |
|
| 15 | 15 | /*Webservice connection*/ |
| 16 | 16 | var $soapcli; |
| 17 | 17 | |
@@ -26,34 +26,34 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | try |
| 28 | 28 | { |
| 29 | - if(!empty($key)){ |
|
| 29 | + if (!empty($key)) { |
|
| 30 | 30 | $this->key = $key; |
| 31 | - if(!empty($urlsoap)){ |
|
| 32 | - if(!empty($proxyHost)) { |
|
| 31 | + if (!empty($urlsoap)) { |
|
| 32 | + if (!empty($proxyHost)) { |
|
| 33 | 33 | $param = array('trace' => false, |
| 34 | 34 | 'soap_version' => SOAP_1_2, |
| 35 | 35 | 'exceptions' => true, |
| 36 | - 'proxy_host' => '"' . $proxyHost . '"', |
|
| 36 | + 'proxy_host' => '"'.$proxyHost.'"', |
|
| 37 | 37 | 'proxy_port' => $proxyPort); |
| 38 | 38 | } else { |
| 39 | 39 | $param = array('trace' => false, |
| 40 | 40 | 'soap_version' => SOAP_1_2, |
| 41 | 41 | 'exceptions' => true); |
| 42 | 42 | } |
| 43 | - $this->soapcli = new SoapClient($urlsoap,$param); |
|
| 44 | - }else{ |
|
| 45 | - $this->soapcli = 'WS urlsoap not available' ; |
|
| 43 | + $this->soapcli = new SoapClient($urlsoap, $param); |
|
| 44 | + } else { |
|
| 45 | + $this->soapcli = 'WS urlsoap not available'; |
|
| 46 | 46 | } |
| 47 | - }else{ |
|
| 48 | - $this->soapcli ='API key not available'; |
|
| 47 | + } else { |
|
| 48 | + $this->soapcli = 'API key not available'; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | catch (SoapFault $fault) |
| 52 | 52 | { |
| 53 | - $this->soapcli = "Error constructor compilatio " . $fault->faultcode ." " .$fault->faultstring ; |
|
| 53 | + $this->soapcli = "Error constructor compilatio ".$fault->faultcode." ".$fault->faultstring; |
|
| 54 | 54 | } |
| 55 | 55 | catch (Exception $e) { |
| 56 | - $this->soapcli = "Error constructor compilatio with urlsoap" . $urlsoap; |
|
| 56 | + $this->soapcli = "Error constructor compilatio with urlsoap".$urlsoap; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | try |
| 74 | 74 | { |
| 75 | 75 | if (!is_object($this->soapcli)) |
| 76 | - return("Error in constructor compilatio() " . $this->soapcli); |
|
| 76 | + return("Error in constructor compilatio() ".$this->soapcli); |
|
| 77 | 77 | $idDocument = $this->soapcli->__call('addDocumentBase64', |
| 78 | 78 | array( |
| 79 | 79 | $this->key, |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | catch (SoapFault $fault) |
| 90 | 90 | { |
| 91 | - return("Erreur sendDoc()" . $fault->faultcode ." " .$fault->faultstring); |
|
| 91 | + return("Erreur sendDoc()".$fault->faultcode." ".$fault->faultstring); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | try |
| 104 | 104 | { |
| 105 | - if (!is_object($this->soapcli)){ |
|
| 106 | - return("Error in constructor compilatio() " . $this->soapcli); |
|
| 105 | + if (!is_object($this->soapcli)) { |
|
| 106 | + return("Error in constructor compilatio() ".$this->soapcli); |
|
| 107 | 107 | } |
| 108 | 108 | $param = array($this->key, $compiHash); |
| 109 | 109 | $idDocument = $this->soapcli->__call('getDocument', $param); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | catch (SoapFault $fault) |
| 113 | 113 | { |
| 114 | - return("Erreur getDoc()" . $fault->faultcode . " " .$fault->faultstring); |
|
| 114 | + return("Erreur getDoc()".$fault->faultcode." ".$fault->faultstring); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
@@ -124,16 +124,16 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | try |
| 126 | 126 | { |
| 127 | - if (!is_object($this->soapcli)){ |
|
| 128 | - return("Error in constructor compilatio() " . $this->soapcli); |
|
| 127 | + if (!is_object($this->soapcli)) { |
|
| 128 | + return("Error in constructor compilatio() ".$this->soapcli); |
|
| 129 | 129 | } |
| 130 | - $param = array($this->key,$compiHash); |
|
| 130 | + $param = array($this->key, $compiHash); |
|
| 131 | 131 | $idDocument = $this->soapcli->__call('getDocumentReportUrl', $param); |
| 132 | 132 | return $idDocument; |
| 133 | 133 | } |
| 134 | 134 | catch (SoapFault $fault) |
| 135 | 135 | { |
| 136 | - return("Erreur getReportUrl()" . $fault->faultcode ." " .$fault->faultstring); |
|
| 136 | + return("Erreur getReportUrl()".$fault->faultcode." ".$fault->faultstring); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -146,15 +146,15 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | try |
| 148 | 148 | { |
| 149 | - if (!is_object($this->soapcli)){ |
|
| 150 | - return("Error in constructor compilatio() " . $this->soapcli); |
|
| 149 | + if (!is_object($this->soapcli)) { |
|
| 150 | + return("Error in constructor compilatio() ".$this->soapcli); |
|
| 151 | 151 | } |
| 152 | - $param = array($this->key,$compiHash); |
|
| 152 | + $param = array($this->key, $compiHash); |
|
| 153 | 153 | $this->soapcli->__call('deleteDocument', $param); |
| 154 | 154 | } |
| 155 | 155 | catch (SoapFault $fault) |
| 156 | 156 | { |
| 157 | - return("Erreur deldoc()" . $fault->faultcode . " " .$fault->faultstring); |
|
| 157 | + return("Erreur deldoc()".$fault->faultcode." ".$fault->faultstring); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
@@ -167,15 +167,15 @@ discard block |
||
| 167 | 167 | { |
| 168 | 168 | try |
| 169 | 169 | { |
| 170 | - if (!is_object($this->soapcli)){ |
|
| 171 | - return("Error in constructor compilatio() " . $this->soapcli); |
|
| 170 | + if (!is_object($this->soapcli)) { |
|
| 171 | + return("Error in constructor compilatio() ".$this->soapcli); |
|
| 172 | 172 | } |
| 173 | - $param = array($this->key,$compiHash); |
|
| 173 | + $param = array($this->key, $compiHash); |
|
| 174 | 174 | $this->soapcli->__call('startDocumentAnalyse', $param); |
| 175 | 175 | } |
| 176 | 176 | catch (SoapFault $fault) |
| 177 | 177 | { |
| 178 | - return("Erreur startAnalyse()" . $fault->faultcode ." " .$fault->faultstring); |
|
| 178 | + return("Erreur startAnalyse()".$fault->faultcode." ".$fault->faultstring); |
|
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
@@ -187,16 +187,16 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | try |
| 189 | 189 | { |
| 190 | - if (!is_object($this->soapcli)){ |
|
| 191 | - return("Error in constructor compilatio() " . $this->soapcli); |
|
| 190 | + if (!is_object($this->soapcli)) { |
|
| 191 | + return("Error in constructor compilatio() ".$this->soapcli); |
|
| 192 | 192 | } |
| 193 | - $param=array($this->key); |
|
| 194 | - $resultat=$this->soapcli->__call('getAccountQuotas', $param); |
|
| 193 | + $param = array($this->key); |
|
| 194 | + $resultat = $this->soapcli->__call('getAccountQuotas', $param); |
|
| 195 | 195 | return $resultat; |
| 196 | 196 | } |
| 197 | 197 | catch (SoapFault $fault) |
| 198 | 198 | { |
| 199 | - return("Erreur getQuotas()" . $fault->faultcode ." " .$fault->faultstring); |
|
| 199 | + return("Erreur getQuotas()".$fault->faultcode." ".$fault->faultstring); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | function verifiFileType($filename) |
| 211 | 211 | { |
| 212 | - $types = array("doc","docx", "rtf", "xls", "xlsx", "ppt", "pptx", "odt", "pdf", "txt", "htm", "html"); |
|
| 213 | - $extension = substr($filename, strrpos($filename, ".")+1); |
|
| 212 | + $types = array("doc", "docx", "rtf", "xls", "xlsx", "ppt", "pptx", "odt", "pdf", "txt", "htm", "html"); |
|
| 213 | + $extension = substr($filename, strrpos($filename, ".") + 1); |
|
| 214 | 214 | $extension = strtolower($extension); |
| 215 | 215 | if (in_array($extension, $types)) { |
| 216 | 216 | return true; |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | .$refreshReturn |
| 250 | 250 | ."</td>"; |
| 251 | 251 | $finretour = "</td></tr></table>"; |
| 252 | - if($status == "ANALYSE_IN_QUEUE" ){ |
|
| 253 | - return $startReturn . "<span style='font-size:11px'>" . $text['analysisinqueue'] . "</span>" . $finretour; |
|
| 252 | + if ($status == "ANALYSE_IN_QUEUE") { |
|
| 253 | + return $startReturn."<span style='font-size:11px'>".$text['analysisinqueue']."</span>".$finretour; |
|
| 254 | 254 | } |
| 255 | - if($status == "ANALYSE_PROCESSING" ){ |
|
| 256 | - if($pour == 100){ |
|
| 255 | + if ($status == "ANALYSE_PROCESSING") { |
|
| 256 | + if ($pour == 100) { |
|
| 257 | 257 | return $startReturn |
| 258 | 258 | . "<span style='font-size:11px'>" |
| 259 | 259 | . $text['analysisinfinalization'] |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | . "background:transparent url(" |
| 271 | 271 | . $imagesPath |
| 272 | 272 | . "mini-jauge_gris.png) no-repeat scroll 0;height:12px;width:" |
| 273 | - . $pour/2 |
|
| 273 | + . $pour / 2 |
|
| 274 | 274 | . "px;\"></div></div>" |
| 275 | 275 | . $finretour; |
| 276 | 276 | } |
@@ -287,15 +287,15 @@ discard block |
||
| 287 | 287 | * @param $text : array includes the extract from the text |
| 288 | 288 | * @return unknown_type |
| 289 | 289 | */ |
| 290 | - function getPomprankBarv31($pourcentagePompage, $weakThreshold, $highThreshold, $chemin_images='',$texte='') { |
|
| 290 | + function getPomprankBarv31($pourcentagePompage, $weakThreshold, $highThreshold, $chemin_images = '', $texte = '') { |
|
| 291 | 291 | |
| 292 | 292 | $pourcentagePompage = round($pourcentagePompage); |
| 293 | - $pour = round((50*$pourcentagePompage)/100); |
|
| 293 | + $pour = round((50 * $pourcentagePompage) / 100); |
|
| 294 | 294 | $return = ""; |
| 295 | 295 | $couleur = ""; |
| 296 | - if($pourcentagePompage < $weakThreshold) { |
|
| 296 | + if ($pourcentagePompage < $weakThreshold) { |
|
| 297 | 297 | $couleur = "vert"; |
| 298 | - } else if($pourcentagePompage >= $weakThreshold && $pourcentagePompage < $highThreshold) { |
|
| 298 | + } else if ($pourcentagePompage >= $weakThreshold && $pourcentagePompage < $highThreshold) { |
|
| 299 | 299 | $couleur = "orange"; |
| 300 | 300 | } else { |
| 301 | 301 | $couleur = "rouge"; |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | function isMd5($hash) |
| 330 | 330 | { |
| 331 | - if(preg_match('`^[a-f0-9]{32}$`', $hash)) { |
|
| 331 | + if (preg_match('`^[a-f0-9]{32}$`', $hash)) { |
|
| 332 | 332 | return true; |
| 333 | 333 | } else { |
| 334 | 334 | return false; |
@@ -340,19 +340,19 @@ discard block |
||
| 340 | 340 | */ |
| 341 | 341 | function typeMime($filename) |
| 342 | 342 | { |
| 343 | - if (preg_match("@Opera(/| )([0-9].[0-9]{1,2})@", $_SERVER['HTTP_USER_AGENT'], $resultats)){ |
|
| 343 | + if (preg_match("@Opera(/| )([0-9].[0-9]{1,2})@", $_SERVER['HTTP_USER_AGENT'], $resultats)) { |
|
| 344 | 344 | $navigateur = "Opera"; |
| 345 | - } elseif (preg_match("@MSIE ([0-9].[0-9]{1,2})@", $_SERVER['HTTP_USER_AGENT'], $resultats)){ |
|
| 345 | + } elseif (preg_match("@MSIE ([0-9].[0-9]{1,2})@", $_SERVER['HTTP_USER_AGENT'], $resultats)) { |
|
| 346 | 346 | $navigateur = "Internet Explorer"; |
| 347 | 347 | } else { |
| 348 | 348 | $navigateur = "Mozilla"; |
| 349 | 349 | $mime = parse_ini_file("mime.ini"); |
| 350 | - $extension = substr($filename, strrpos($filename, ".")+1); |
|
| 350 | + $extension = substr($filename, strrpos($filename, ".") + 1); |
|
| 351 | 351 | } |
| 352 | - if(array_key_exists($extension, $mime)) { |
|
| 352 | + if (array_key_exists($extension, $mime)) { |
|
| 353 | 353 | $type = $mime[$extension]; |
| 354 | 354 | } else { |
| 355 | - $type = ($navigateur!="Mozilla") ? 'application/octetstream' : 'application/octet-stream'; |
|
| 355 | + $type = ($navigateur != "Mozilla") ? 'application/octetstream' : 'application/octet-stream'; |
|
| 356 | 356 | } |
| 357 | 357 | return $type; |
| 358 | 358 | } |