diff --git a/main/inc/ajax/skill.ajax.php b/main/inc/ajax/skill.ajax.php index 96870fd071..d3fb3f7a98 100644 --- a/main/inc/ajax/skill.ajax.php +++ b/main/inc/ajax/skill.ajax.php @@ -36,10 +36,15 @@ switch ($action) { break; case 'profile_matches': $skill_rel_user = new SkillRelUser(); - $skills = $_REQUEST['skills']; + $skills = $_REQUEST['skill_id']; + + $total_skills_to_search = $skills; + $users = $skill_rel_user->get_user_by_skills($skills); - $total_skills_to_search = array(); + $user_list = array(); + + $count_skills = count($skills); if (!empty($users)) { foreach ($users as $user) { @@ -62,7 +67,7 @@ switch ($action) { $user_list[$user['user_id']]['total_found_skills'] = $found_counts; } $ordered_user_list = array(); - foreach($user_list as $user_id => $user_data) { + foreach ($user_list as $user_id => $user_data) { $ordered_user_list[$user_data['total_found_skills']][] = $user_data; } if (!empty($ordered_user_list)) { @@ -70,6 +75,24 @@ switch ($action) { } } + + Display::display_no_header(); + + Display::$global_template->assign('order_user_list', $ordered_user_list); + Display::$global_template->assign('total_search_skills', $count_skills); + + $skill_list = array(); + + if (!empty($total_skills_to_search)) { + $total_skills_to_search = $skill->get_skills_info($total_skills_to_search); + + foreach ($total_skills_to_search as $skill_info) { + $skill_list[$skill_info['id']] = $skill_info; + } + } + + Display::$global_template->assign('skill_list', $skill_list); + echo Display::$global_template->fetch('default/skill/profile.tpl'); break; case 'get_gradebooks': $gradebooks = $gradebook_list = $gradebook->get_all(); diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 0cc79b1431..63252efaee 100644 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -72,6 +72,12 @@ class Display { echo self::$global_template ->show_header_template(); } + public static function display_no_header() { + $disable_js_and_css_files = true; + self::$global_template = new Template($tool_name, false, false, $show_learnpath); + //echo self::$global_template->show_header_template(); + } + /** * Displays the reduced page header (without banner) */ diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index e005b01ea7..e111b1b984 100644 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -477,10 +477,13 @@ class Template { } $js_file_to_string = ''; - + + + foreach ($js_files as $js_file) { $js_file_to_string .= api_get_js($js_file); } + //Extra CSS files @@ -498,10 +501,12 @@ class Template { $css_files[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chat/css/chat.css'; } + $css_file_to_string = ''; foreach ($css_files as $css_file) { $css_file_to_string .= api_get_css($css_file); } + // @todo move this somewhere else. Special fix when using tablets in order to see the text near icons if (SHOW_TEXT_NEAR_ICONS == true) { @@ -532,22 +537,26 @@ class Template { //@todo minify CSS and JS $this->assign('prefetch', $prefetch); - $this->assign('css_file_to_string', $css_file_to_string); - $this->assign('js_file_to_string', $js_file_to_string); - $this->assign('text_direction', api_get_text_direction()); $this->assign('section_name', 'section-' . $this_section); - - //Adding jquery ui by default - $extra_headers = api_get_jquery_ui_js(); - - //$extra_headers = ''; - if (isset($htmlHeadXtra) && $htmlHeadXtra) { - foreach ($htmlHeadXtra as & $this_html_head) { - $extra_headers .= $this_html_head . "\n"; + + global $disable_js_and_css_files; + + if (!$disable_js_and_css_files) { + $this->assign('css_file_to_string', $css_file_to_string); + $this->assign('js_file_to_string', $js_file_to_string); + + //Adding jquery ui by default + $extra_headers = api_get_jquery_ui_js(); + + //$extra_headers = ''; + if (isset($htmlHeadXtra) && $htmlHeadXtra) { + foreach ($htmlHeadXtra as & $this_html_head) { + $extra_headers .= $this_html_head . "\n"; + } } + $this->assign('extra_headers', $extra_headers); } - $this->assign('extra_headers', $extra_headers); $favico = ''; diff --git a/main/newscorm/lp_upload.php b/main/newscorm/lp_upload.php index 0ac0efc998..0e03e13edd 100644 --- a/main/newscorm/lp_upload.php +++ b/main/newscorm/lp_upload.php @@ -133,12 +133,17 @@ if( Request::is_post() && $is_error){ require_once 'learnpath.class.php'; $type = learnpath::get_package_type($s, basename($s)); + $post_max = ini_get('post_max_size'); + $upl_max = ini_get('upload_max_filesize'); + if (filesize($s)>$post_max || filesize($s)>$upl_max ){ + return api_failure::set_failure('upload_file_too_big'); + } switch ($type) { case 'scorm': require_once 'scorm.class.php'; $oScorm = new scorm(); $manifest = $oScorm->import_local_package($s, $current_dir); - if ($manifest === false ) { //if api_set_failure + if ($manifest === false ) { //if ap i_set_failure return api_failure::set_failure(api_failure::get_last_failure()); } if (!empty($manifest)) { @@ -172,6 +177,10 @@ if( Request::is_post() && $is_error){ break; case '': default: + + if (filesize($s)>$post_max || filesize($s)>$upl_max ){ + return api_failure::set_failure('upload_file_too_big'); + } return api_failure::set_failure('not_a_learning_path'); } } \ No newline at end of file diff --git a/main/template/default/skill/profile.tpl b/main/template/default/skill/profile.tpl index 989817cff0..91693788d6 100644 --- a/main/template/default/skill/profile.tpl +++ b/main/template/default/skill/profile.tpl @@ -1,7 +1,7 @@ - -{{form}} +{{ form }} + + {% if search_skill_list is not null %}