From 90304116277fa1df2f1ab5ed26bfd1bd30a0cb76 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 2 Apr 2012 11:38:30 +0200 Subject: [PATCH 1/3] Fixing teacher names in userportal.php --- main/inc/lib/course.lib.php | 42 +++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 6ed194006b..a2413ae2b0 100644 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -97,18 +97,21 @@ define('NOT_VISIBLE_SUBSCRIPTION_ALLOWED', 1); define('VISIBLE_SUBSCRIPTION_ALLOWED', 2); define('VISIBLE_NO_SUBSCRIPTION_ALLOWED', 3); +define('TEACHER_SEPARATOR_STRING', '|'); //Use to show teacher names in userportal.php + /** * Variables */ - +/* $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE); $TABLECOURSDOMAIN = Database::get_main_table(TABLE_MAIN_CATEGORY); $TABLEUSER = Database::get_main_table(TABLE_MAIN_USER); $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); $TABLEANNOUNCEMENTS = 'announcement'; $coursesRepositories = $_configuration['root_sys']; +*/ /** * CourseManager Class @@ -1374,7 +1377,7 @@ class CourseManager { $list[]= api_get_person_name($teacher['firstname'], $teacher['lastname']); } if (!empty($list)) { - $teacher_string = implode($separator.' ', $list); + $teacher_string = implode(' '.$separator.' ', $list); } } return $teacher_string; @@ -2713,7 +2716,8 @@ class CourseManager { return self::course_code_exists($wanted_course_code); } - /* Builds the course block + /** + * Builds the course block in userportal.php * @todo use smarty */ public function course_item_html($params, $is_sub_content = false) { @@ -2829,7 +2833,7 @@ class CourseManager { $course_title .= $course_info['visual_code']; } if (api_get_setting('display_teacher_in_courselist') == 'true') { - $params['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($course['code']); + $params['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($course['code'], TEACHER_SEPARATOR_STRING); } $course_title .= ' '; $course_title .= Display::return_icon('klipper.png', get_lang('CourseAutoRegister')); @@ -2971,7 +2975,7 @@ class CourseManager { $course_title .= $course_info['visual_code']; } if (api_get_setting('display_teacher_in_courselist') == 'true') { - $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']); + $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code'], TEACHER_SEPARATOR_STRING); } $params['icon'] = $status_icon; @@ -3145,7 +3149,7 @@ class CourseManager { if (api_get_setting('display_teacher_in_courselist') == 'true') { if (api_get_setting('use_session_mode') == 'true' && !$nosession) { - $teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_info['code']); + $teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_info['code'], TEACHER_SEPARATOR_STRING); $coachs_course = api_get_coachs_from_course($course_info['id_session'], $course['code']); $course_coachs = array(); @@ -3286,7 +3290,7 @@ class CourseManager { /** - * Creates a new course code based in given code + * Creates a new course code based in a given code * * @param string wanted code * $wanted_code = 'curse' if there are in the DB codes like curse1 curse2 the function will return: course3 @@ -3317,7 +3321,14 @@ class CourseManager { } - + /** + * Gets the status of the users agreement in a course course-session + * + * @param int user id + * @param string course code + * @param int session id + * @return boolean + */ function is_user_accepted_legal($user_id, $course_code, $session_id = null) { $user_id = intval($user_id); $course_code = Database::escape_string($course_code); @@ -3350,6 +3361,12 @@ class CourseManager { return false; } + /** + * Saves the user-course legal agreement + * @param int user id + * @param string course code + * @param int session id + */ function save_user_legal($user_id, $course_code, $session_id = null) { $user_id = intval($user_id); @@ -3501,7 +3518,7 @@ class CourseManager { * @param int vote [1..5] * @param int course id * @param int session id - * @param int url id + * @param int url id (access_url_id) * @return mixed 'added', 'updated' or 'nothing' * */ @@ -3579,8 +3596,11 @@ class CourseManager { } } - //Stats functions - + /** + * Returns an array with the hottest courses + * @param int number of days + * @param int number of hottest courses + */ function return_hot_courses($days = 30, $limit = 5) { $limit = intval($limit); $table_course_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS); From 6812a5086495b738b9877d91c32cdbd979dd18a3 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 2 Apr 2012 11:50:20 +0200 Subject: [PATCH 2/3] Fixing missing icons see BT#4131 --- main/work/work.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 87ff35c31f..674e081f3b 100644 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -35,17 +35,17 @@ function display_action_links($id, $cur_dir_path, $show_tool_options, $display_u $display_output = ''; $origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : ''; - if (!empty($cur_dir_path)) { + if (!empty($id)) { $display_output .= ''.Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).''; } if ($show_tool_options && api_is_allowed_to_edit(null, true) && $origin != 'learnpath') { // Create dir - if (empty($cur_dir_path)) { + if (empty($id)) { $display_output .= ''; $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).''; } - if (empty($cur_dir_path)) { + if (empty($id)) { // Options $display_output .= ''; $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).''; @@ -69,7 +69,7 @@ function display_action_links($id, $cur_dir_path, $show_tool_options, $display_u if (api_is_allowed_to_edit(null, true)) { global $token; - if (!empty($cur_dir_path)) { + if (!empty($id)) { if (empty($_GET['list']) or Security::remove_XSS($_GET['list']) == 'with') { $display_output .= ''. Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'),'',ICON_SIZE_MEDIUM)."\n"; From 06b08d52faf77bef14c3a1e096a20f5664fad2dd Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 2 Apr 2012 11:51:37 +0200 Subject: [PATCH 3/3] Changes in the skills trees (currently not working) --- main/admin/skills_profile.php | 9 +- main/inc/lib/javascript/skills.js | 490 +++++++++++---------- main/inc/lib/skill.visualizer.lib.php | 12 +- main/template/default/skill/profile.tpl | 10 +- main/template/default/skill/skill_tree.tpl | 214 ++++++--- 5 files changed, 426 insertions(+), 309 deletions(-) diff --git a/main/admin/skills_profile.php b/main/admin/skills_profile.php index 1acb5d7869..0eea83fa2f 100644 --- a/main/admin/skills_profile.php +++ b/main/admin/skills_profile.php @@ -30,7 +30,6 @@ $tpl = new Template(get_lang('Skills')); $form = new FormValidator('profile_search'); - $form->addElement('header', get_lang('SearchSkills')); $form->addElement('select', 'skills', null, null, array('id'=>'skills')); $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="btn"'); @@ -56,10 +55,10 @@ if ($form->validate()) { $_SESSION['skills'] = $skills; } else { - $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: null ; + $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: array(); } } else { - $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: null ; + $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: array(); } $user_list = array(); @@ -96,8 +95,6 @@ if (!empty($users)) { } } - - //$tpl->assign('user_list', $user_list); $tpl->assign('order_user_list', $ordered_user_list); $tpl->assign('total_search_skills', $count_skills); @@ -125,7 +122,7 @@ $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; switch ($action) { case 'remove_skill': $new_skill = array(); - foreach($skills as $skill_id) { + foreach ($skills as $skill_id) { if ($id != $skill_id) { $new_skill[] = $skill_id; } diff --git a/main/inc/lib/javascript/skills.js b/main/inc/lib/javascript/skills.js index 6ba55c4a9b..be3d31af9d 100644 --- a/main/inc/lib/javascript/skills.js +++ b/main/inc/lib/javascript/skills.js @@ -1,253 +1,261 @@ // Arrow settings - var exampleDropOptions = { - tolerance:'touch', - hoverClass:'dropHover', - activeClass:'dragActive' - }; +var debug = 1; - var connectorPaintStyle = { +var exampleDropOptions = { + tolerance:'touch', + hoverClass:'dropHover', + activeClass:'dragActive' +}; + +var connectorPaintStyle = { + lineWidth:5, + strokeStyle:"#deea18", + joinstyle:"round" +}; +// .. and this is the hover style. +var connectorHoverStyle = { + lineWidth:7, + strokeStyle:"#2e2aF8" +}; + +//Admin arrows +var edit_arrow_color = '#ccc'; + +var editEndpoint = { + //connectorStyle:connectorPaintStyle, + connector:[ "Flowchart", { stub:28 } ], + hoverPaintStyle:connectorHoverStyle, + connectorHoverStyle:connectorHoverStyle, + anchors: ['BottomCenter','TopCenter'], + endpoint:"Rectangle", + paintStyle:{ width:10, height:10, fillStyle:edit_arrow_color }, + isSource:true, + scope:'blue rectangle', + maxConnections:10, + connectorStyle : { + gradient:{ + stops:[[0, edit_arrow_color], [0.5, edit_arrow_color], [1, edit_arrow_color]] + }, //gradient stuff + lineWidth:2, + strokeStyle: edit_arrow_color + }, + isTarget:true, + dropOptions : exampleDropOptions +}; + + +//Student arrows + +//If user does not completed the skill +var default_arrow_color = '#ccc'; //gray +var defaultEndpoint = { + connector:[ "Flowchart", { stub:28 } ], + anchors: ['BottomCenter','TopCenter'], + endpoint:"Rectangle", + paintStyle:{ width:1, height:1, fillStyle:default_arrow_color }, + isSource:false, + scope:'blue rectangle', + maxConnections:10, + connectorStyle : { + gradient:{ stops:[[0, default_arrow_color], [0.5, default_arrow_color], [1, default_arrow_color]] }, lineWidth:5, - strokeStyle:"#deea18", - joinstyle:"round" - }; - // .. and this is the hover style. - var connectorHoverStyle = { - lineWidth:7, - strokeStyle:"#2e2aF8" - }; - - - //Admin arrows - var edit_arrow_color = '#ccc'; - - var editEndpoint = { - //connectorStyle:connectorPaintStyle, - connector:[ "Flowchart", { stub:28 } ], - hoverPaintStyle:connectorHoverStyle, - connectorHoverStyle:connectorHoverStyle, - anchors: ['BottomCenter','TopCenter'], - endpoint:"Rectangle", - paintStyle:{ width:10, height:10, fillStyle:edit_arrow_color }, - isSource:true, - scope:'blue rectangle', - maxConnections:10, - connectorStyle : { - gradient:{ - stops:[[0, edit_arrow_color], [0.5, edit_arrow_color], [1, edit_arrow_color]] - }, //gradient stuff - lineWidth:2, - strokeStyle: edit_arrow_color - }, - isTarget:true, - dropOptions : exampleDropOptions - }; - - - //Student arrows - - //If user does not completed the skill - var default_arrow_color = '#ccc'; //gray - var defaultEndpoint = { - connector:[ "Flowchart", { stub:28 } ], - anchors: ['BottomCenter','TopCenter'], - endpoint:"Rectangle", - paintStyle:{ width:1, height:1, fillStyle:default_arrow_color }, - isSource:false, - scope:'blue rectangle', - maxConnections:10, - connectorStyle : { - gradient:{ stops:[[0, default_arrow_color], [0.5, default_arrow_color], [1, default_arrow_color]] }, - lineWidth:5, - strokeStyle:default_arrow_color - }, - isTarget:false, - setDraggableByDefault : false, - }; - - // If user completed the skill - var done_arrow_color = '#73982C'; //green - var doneEndpoint = { - connector:[ "Flowchart", { stub:28 } ], - anchors: ['BottomCenter','TopCenter'], - endpoint:"Rectangle", - paintStyle:{ width:1, height:1, fillStyle:done_arrow_color}, - isSource:false, - scope:'blue rectangle', - maxConnections:10, - connectorStyle : { - gradient:{ stops:[[0, done_arrow_color], [0.5, done_arrow_color], [1, done_arrow_color]] }, - lineWidth:5, - strokeStyle:done_arrow_color - }, - isTarget:false, - setDraggableByDefault : false, - }; - - - - - //Functions - + strokeStyle:default_arrow_color + }, + isTarget:false, + setDraggableByDefault : false, +}; - /* Clean window block classes*/ - function cleanclass(obj) { - obj.removeClass('first_window'); - obj.removeClass('second_window'); - obj.removeClass('third_window'); - } - - /* When clicking the red block */ - function open_parent(parent_id, id) { - console.log("open_parent call : id " + id + " parent_id:" + parent_id); - var numeric_parent_id = parent_id.split('_')[1]; - var numeric_id = id.split('_')[1]; - load_parent(numeric_parent_id, numeric_id); - } - - /* When clicking a children block - @param string block id i.e "block_1" - * */ +// If user completed the skill +var done_arrow_color = '#73982C'; //green +var doneEndpoint = { + connector:[ "Flowchart", { stub:28 } ], + anchors: ['BottomCenter','TopCenter'], + endpoint:"Rectangle", + paintStyle:{ width:1, height:1, fillStyle:done_arrow_color}, + isSource:false, + scope:'blue rectangle', + maxConnections:10, + connectorStyle : { + gradient:{ stops:[[0, done_arrow_color], [0.5, done_arrow_color], [1, done_arrow_color]] }, + lineWidth:5, + strokeStyle:done_arrow_color + }, + isTarget:false, + setDraggableByDefault : false, +}; + +//Functions + +/* Clean window block classes*/ +function cleanclass(obj) { + obj.removeClass('first_window'); + obj.removeClass('second_window'); + obj.removeClass('third_window'); +} + +/* When clicking the red block */ +function open_parent(parent_id, id) { + if (debug) console.log("open_parent call : id " + id + " parent_id:" + parent_id); + var numeric_parent_id = parent_id.split('_')[1]; + var numeric_id = id.split('_')[1]; + load_parent(numeric_parent_id, numeric_id); +} + +/* + * + * When clicking a children block + @param string block id i.e "block_1" + @param int load user data or not - function open_block(id, load_user_data) { - console.log("open_block id : " + id); - var numeric_id = id.split('_')[1]; - for (var i = 0; i < skills.length; i++) { - //Remove everything except parents - if (jQuery.inArray(skills[i].element, parents) == -1) { - //console.log('deleting this'+ skills[i].element); - jsPlumb.deleteEndpoint(skills[i].endp); - $("#"+skills[i].element).remove(); - } - } - - //Modifying current block position - pos = $('#'+id).position(); - left_value = center_x; - - if (parents.length == 2) { - top_value = space_between_blocks_y + offset_y; - } else { - top_value = 100; - } - jsPlumb.animate(id, { left: left_value, top:top_value }, { duration:duration_value }); - - //Modifying root block position - pos_parent = $('#'+parents[0]).position(); - jsPlumb.animate(parents[0], { left: center_x, top:offset_y }, { duration:duration_value }); - - top_value = 2*space_between_blocks_y +offset_y ; - load_children(numeric_id, top_value, load_user_data); - } +*/ + +function open_block(id, load_user_data) { + if (debug) console.log("open_block id : " + id+" load_user_data: " +load_user_data); + var numeric_id = id.split('_')[1]; - function open_block_student(id) { - open_block(id, 1) - } + for (var i = 0; i < skills.length; i++) { + //Remove everything except parents + if (jQuery.inArray(skills[i].element, parents) == -1) { + if (debug) console.log('deleting this skill '+ skills[i].element + " id: " + i); + jsPlumb.deleteEndpoint(skills[i].endp); + $("#"+skills[i].element).remove(); + } + } + + //Modifying current block position + pos = $('#'+id).position(); + left_value = center_x; + + if (parents.length == 2) { + top_value = space_between_blocks_y + offset_y; + } else { + top_value = 100; + } - /* Loads parent blocks */ - function load_parent(parent_id, id) { - console.log("load_parent call : id " + id + " parent_id:" + parent_id); - var ix= 0; - $.ajax({ - url: url+'&a=load_direct_parents&id='+id, - async: false, - success: function(json) { - var json = jQuery.parseJSON(json); - - $.each(json,function(i,item) { - left_value = center_x + space_between_blocks_x * ix; - top_value = offset_y; - - $('body').append('
'+item.name+'
'); - var es = prepare("block_" + item.id, editEndpoint); - var es2 = prepare("block_" + id, editEndpoint); - - jsPlumb.connect({ - source: es, target:es2 - }); - jsPlumb.animate("block_" + item.id, { left: left_value, top : top_value }, { duration : duration_value}); - - if (item.parent_id) { - console.log('setting hidden_parent '+item.parent_id); - hidden_parent = "block_" + item.parent_id; - } else { - console.log('setting NO--- hidden_parent '); - } - ix++; - }); - } - }); - } + jsPlumb.animate(id, { left: left_value, top:top_value }, { duration:duration_value }); + + //Modifying root block position + pos_parent = $('#'+parents[0]).position(); + jsPlumb.animate(parents[0], { left: center_x, top:offset_y }, { duration:duration_value }); + + top_value = 2*space_between_blocks_y +offset_y ; + load_children(numeric_id, top_value, load_user_data); +} + +function open_block_student(id) { + open_block(id, 1) +} + +function load_children(my_id, top_value, load_user_data) { + if (debug) console.log("load_children : my_id " + my_id + ", top_value:" + top_value +", load_user_data: "+load_user_data); + + //Loading children + var ix = 0; - function load_children(my_id, top_value, load_user_data) { - console.log("load_children call : my_id " + my_id + " top_value:" + top_value); - - //Loading children - var ix = 0; - $.getJSON(url+'&a=load_children&load_user_data='+load_user_data+'&id='+my_id, {}, - function(json) { - $.each(json,function(i,item) { - console.log('Loading children: #' + item.id + " " +item.name); - left_value = ix*space_between_blocks_x + center_x/2 - block_size / 2; - //top_value = 300; - //Display::url($skill['name'], '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block')) - item.name = ''+item.name+''; - - var status_class = ' '; - my_edit_point = editEndpoint; - - if (item.passed == 1) { - my_edit_point = doneEndpoint; - status_class = 'done_window'; - } - - $('body').append('
'+item.name+'
'); - - $('#block_'+item.id).css( { - position: 'absolute', - zIndex: 5000, - left: '10', - top: '10' - } ); - - - //console.log('append div id = block_'+item.id); - //console.log('preparing = '+item.id); - - var es = prepare("block_" + item.id, my_edit_point); - - //console.log('preparing = '+my_id); - - var e2 = prepare("block_" + my_id, my_edit_point); - - jsPlumb.connect({source: es, target:e2}); - //console.log('connect sources'); - - jsPlumb.animate("block_" + item.id, { - left: left_value, top : top_value - }, { duration : duration_value }); - ix++; + $.getJSON(url+'&a=load_children&load_user_data='+load_user_data+'&id='+my_id, {}, + function(json) { + console.log('getJSON reponse: ' + json) + $.each(json,function(i, item) { + if (debug) console.log('Loading children: #' + item.id + " " +item.name); + left_value = ix*space_between_blocks_x + center_x/2 - block_size / 2; + //top_value = 300; + //Display::url($skill['name'], '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block')) + item.name = ''+item.name+''; + + var status_class = ' '; + my_edit_point = editEndpoint; + + if (item.passed == 1) { + my_edit_point = doneEndpoint; + status_class = 'done_window'; + } + + $('body').append('
'+item.name+'
'); + if (debug) console.log('Append block: '+item.id); + + $('#block_'+item.id).css({ + position: 'absolute', + zIndex: 5000, + left: '10', + top: '10' }); - } - ); - } - - function checkLength( o, n, min, max ) { - if ( o.val().length > max || o.val().length < min ) { - o.addClass( "ui-state-error" ); - updateTips( "Length of " + n + " must be between " +min + " and " + max + "." ); - return false; - } else { - return true; + + + //console.log('append div id = block_'+item.id); + //console.log('preparing = '+item.id); + + var es = prepare("block_" + item.id, my_edit_point); + + //console.log('preparing = '+my_id); + + var e2 = prepare("block_" + my_id, my_edit_point); + + jsPlumb.connect({source: es, target:e2}); + //console.log('connect sources'); + + jsPlumb.animate("block_" + item.id, { + left: left_value, top : top_value + }, { duration : duration_value }); + ix++; + }); } + ); +} + +/* Loads parent blocks */ +function load_parent(parent_id, id) { + if (debug) console.log("load_parent call : id " + id + " parent_id:" + parent_id); + var ix= 0; + $.ajax({ + url: url+'&a=load_direct_parents&id='+id, + async: false, + success: function(json) { + var json = jQuery.parseJSON(json); + + $.each(json,function(i,item) { + left_value = center_x + space_between_blocks_x * ix; + top_value = offset_y; + + $('body').append('
'+item.name+'
'); + var es = prepare("block_" + item.id, editEndpoint); + var es2 = prepare("block_" + id, editEndpoint); + + jsPlumb.connect({ + source: es, target:es2 + }); + jsPlumb.animate("block_" + item.id, { left: left_value, top : top_value }, { duration : duration_value}); + + if (item.parent_id) { + if (debug) console.log('setting hidden_parent '+item.parent_id); + hidden_parent = "block_" + item.parent_id; + } else { + if (debug) console.log('setting NO--- hidden_parent '); + } + ix++; + }); + } + }); +} + + + +function checkLength( o, n, min, max ) { + if ( o.val().length > max || o.val().length < min ) { + o.addClass( "ui-state-error" ); + updateTips( "Length of " + n + " must be between " +min + " and " + max + "." ); + return false; + } else { + return true; } - - function updateTips( t ) { - tips = $( ".validateTips" ) - tips - .text( t ) - .addClass( "ui-state-highlight" ); - setTimeout(function() { - tips.removeClass( "ui-state-highlight", 1500 ); - }, 500 ); - } \ No newline at end of file +} + +function updateTips( t ) { + tips = $( ".validateTips" ) + tips + .text( t ) + .addClass( "ui-state-highlight" ); + setTimeout(function() { + tips.removeClass( "ui-state-highlight", 1500 ); + }, 500 ); +} \ No newline at end of file diff --git a/main/inc/lib/skill.visualizer.lib.php b/main/inc/lib/skill.visualizer.lib.php index ed795d8f32..7763d28d5c 100644 --- a/main/inc/lib/skill.visualizer.lib.php +++ b/main/inc/lib/skill.visualizer.lib.php @@ -7,7 +7,7 @@ class SkillVisualizer { - public $block_size = 80; //see CSS window class + public $block_size = 120; //see CSS window class public $canvas_x = 1024; public $canvas_y = 800; @@ -37,7 +37,7 @@ $extra_class = 'second_window'; } - $this->html .= '
'; + $this->html .= '
'; /*$gradebook_string = ''; if (!empty($skill['gradebooks'])) { foreach ($skill['gradebooks'] as $gradebook) { @@ -45,9 +45,13 @@ $gradebook_string .= Display::span($gradebook['name'], array('class'=>'label_tag gradebook','style'=>'width:50px')).'
'; } } */ - $skill['name'] = Display::url($skill['name'], '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block')); + $content = $skill['name']; + $content .= '
'; + $content .= Display::url(get_lang('Edit'), '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn')); + $content .= Display::url('+', '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn')); + $content .= '
'; - $this->html .= $skill['name'].' '.$gradebook_string; + $this->html .= $content.' '.$gradebook_string; if ($this->type == 'edit' && $skill['parent_id'] != 0) { //$this->html .= Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), '#', array('id'=>'edit_block_'.$block_id,'class'=>'edit_block')); diff --git a/main/template/default/skill/profile.tpl b/main/template/default/skill/profile.tpl index 91b81a9d08..593cddb9c3 100644 --- a/main/template/default/skill/profile.tpl +++ b/main/template/default/skill/profile.tpl @@ -126,7 +126,6 @@ function checkLength( o, n, min, max ) {
{/if} - {if !empty($order_user_list) }
{foreach $order_user_list as $count => $user_list} @@ -151,7 +150,7 @@ function checkLength( o, n, min, max ) { {if $skill_data.found} *{"IHaveThisSkill"|get_lang}* {/if} - + {/foreach}
@@ -159,8 +158,11 @@ function checkLength( o, n, min, max ) { {/foreach} {/foreach}
-{else} -
{"NoResults"|get_lang}
+{else} + {if !empty($search_skill_list) } +
{"NoResults"|get_lang}
+ {/if} + {/if}