Course home: Fix active label BT#17744

pull/3782/head
Julio Montoya 5 years ago
parent bafd097747
commit 6148f98bf6
  1. 31
      main/course_home/course_home.php

@ -34,8 +34,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$js = '<script>'.api_get_language_translate_html().'</script>'; $js = '<script>'.api_get_language_translate_html().'</script>';
$htmlHeadXtra[] = $js; $htmlHeadXtra[] = $js;
$htmlHeadXtra[] = '<script>
$htmlHeadXtra[] = '<script type="text/javascript">
/* show eye for all show/hide*/ /* show eye for all show/hide*/
function buttonForAllShowHide() function buttonForAllShowHide()
{ {
@ -53,7 +52,6 @@ $htmlHeadXtra[] = '<script type="text/javascript">
// if the image has the eye-slash icon, prepare to make visible // if the image has the eye-slash icon, prepare to make visible
tools_visibles.push(image_id) tools_visibles.push(image_id)
} }
}); });
if (tools_visibles.length == 0) { if (tools_visibles.length == 0) {
$(".visible-all").addClass("hidden"); $(".visible-all").addClass("hidden");
@ -62,7 +60,8 @@ $htmlHeadXtra[] = '<script type="text/javascript">
$(".visible-all").removeClass("hidden"); $(".visible-all").removeClass("hidden");
$(".invisible-all").addClass("hidden"); $(".invisible-all").addClass("hidden");
} }
}; }
/* option show/hide thematic-block */ /* option show/hide thematic-block */
$(function() { $(function() {
buttonForAllShowHide(); buttonForAllShowHide();
@ -81,11 +80,11 @@ $htmlHeadXtra[] = '<script type="text/javascript">
tools_visibles.push(image_id) tools_visibles.push(image_id)
} }
}); });
message_invisible = "'.get_lang('ToolIsNowHidden', '').'"; message_invisible = "'.get_lang('ToolIsNowHidden').'";
ids = tools_invisibles; ids = tools_invisibles;
if (tools_invisibles.length == 0) { if (tools_invisibles.length == 0) {
ids = tools_visibles; ids = tools_visibles;
message_invisible = "'.get_lang('ToolIsNowVisible', '').'"; message_invisible = "'.get_lang('ToolIsNowVisible').'";
} }
$.ajax({ $.ajax({
@ -100,7 +99,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
success: function (data) { success: function (data) {
data = JSON.parse(data); data = JSON.parse(data);
$.each(data,function(index,item){ $.each(data,function(index,item){
new_current_view = "'.api_get_path(WEB_IMG_PATH).'" + item.view; new_current_view = "'.api_get_path(WEB_IMG_PATH).'" + item.view;
//eyes //eyes
$("#linktool_"+item.id).attr("class", item.fclass); $("#linktool_"+item.id).attr("class", item.fclass);
//tool //tool
@ -122,6 +121,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
} }
}); });
}); });
$("#thematic-show").click(function(){ $("#thematic-show").click(function(){
$(".btn-hide-thematic").hide(); $(".btn-hide-thematic").hide();
$(".btn-show-thematic").show(); //show using class $(".btn-show-thematic").show(); //show using class
@ -158,10 +158,12 @@ $htmlHeadXtra[] = '<script type="text/javascript">
success: function(data) { success: function(data) {
eval("var info=" + data); eval("var info=" + data);
new_current_tool_image = info.image; new_current_tool_image = info.image;
new_current_view = "'.api_get_path(WEB_IMG_PATH).'" + info.view; new_current_view = "'.api_get_path(WEB_IMG_PATH).'" + info.view;
//eyes //eyes
//$("#" + tool_id).attr("src", new_current_view); //$("#" + tool_id).attr("src", new_current_view);
$("#linktool_"+my_tool_id).attr("class", info.fclass); $("#linktool_"+my_tool_id).attr("class", info.fclass);
$("#linktool_"+my_tool_id).attr("title", info.label);
//tool //tool
$("#toolimage_" + my_tool_id).attr("src", new_current_tool_image); $("#toolimage_" + my_tool_id).attr("src", new_current_tool_image);
//clase //clase
@ -169,15 +171,15 @@ $htmlHeadXtra[] = '<script type="text/javascript">
$("#istooldesc_" + my_tool_id).attr("class", info.tclass); $("#istooldesc_" + my_tool_id).attr("class", info.tclass);
if (info.message == "is_active") { if (info.message == "is_active") {
message = "'.get_lang('ToolIsNowVisible', '').'"; message = "'.get_lang('ToolIsNowVisible').'";
$("#" + tool_id) $("#" + tool_id)
.attr("alt", "'.get_lang('Activate', '').'") .attr("alt", "'.get_lang('Deactivate').'")
.attr("title", "'.get_lang('Activate', '').'"); .attr("title", "'.get_lang('Deactivate').'");
} else { } else {
message = "'.get_lang('ToolIsNowHidden', '').'"; message = "'.get_lang('ToolIsNowHidden').'";
$("#" + tool_id) $("#" + tool_id)
.attr("alt", "'.get_lang('Deactivate', '').'") .attr("alt", "'.get_lang('Activate').'")
.attr("title", "'.get_lang('Deactivate', '').'"); .attr("title", "'.get_lang('Activate').'");
} }
$(".normal-message").hide(); $(".normal-message").hide();
$("#id_confirmation_message").html(message); $("#id_confirmation_message").html(message);
@ -186,7 +188,6 @@ $htmlHeadXtra[] = '<script type="text/javascript">
}); });
}); });
}); });
</script>'; </script>';
// The section for the tabs // The section for the tabs

Loading…
Cancel
Save