parent
674f33c4c6
commit
c27c241e77
@ -1,73 +0,0 @@ |
|||||||
<?php |
|
||||||
/* For licensing terms, see /license.txt */ |
|
||||||
|
|
||||||
/** |
|
||||||
* HOME PAGE FOR EACH COURSE. |
|
||||||
* |
|
||||||
* This page, included in every course's index.php is the home |
|
||||||
* page. To make administration simple, the teacher edits his |
|
||||||
* course from the home page. Only the login detects that the |
|
||||||
* visitor is allowed to activate, deactivate home page links, |
|
||||||
* access to the teachers tools (statistics, edit forums...). |
|
||||||
* |
|
||||||
* @package chamilo.course_home |
|
||||||
*/ |
|
||||||
$id = isset($_GET['id']) ? (int) $_GET['id'] : null; |
|
||||||
$course_id = api_get_course_int_id(); |
|
||||||
$session_id = api_get_session_id(); |
|
||||||
|
|
||||||
// Work with data post askable by admin of course |
|
||||||
if (api_is_platform_admin()) { |
|
||||||
// Show message to confirm that a tool it to be hidden from available tools |
|
||||||
// visibility 0,1->2 |
|
||||||
if (!empty($_GET['askDelete'])) { |
|
||||||
$content .= '<div id="toolhide">'.get_lang('Do you really want to delete this link?').'<br /> |
|
||||||
<a href="'.api_get_self().'">'.get_lang('No').'</a> | |
|
||||||
<a href="'.api_get_self().'?delete=yes&id='.$id.'">'.get_lang('Yes').'</a> |
|
||||||
</div>'; |
|
||||||
} elseif (isset($_GET['delete']) && $_GET['delete']) { |
|
||||||
/* |
|
||||||
* Process hiding a tools from available tools. |
|
||||||
*/ |
|
||||||
Database::query("DELETE FROM $tool_table WHERE c_id = $course_id AND id='$id' AND added_tool=1"); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// Course legal |
|
||||||
$enabled = api_get_plugin_setting('courselegal', 'tool_enable'); |
|
||||||
$pluginExtra = null; |
|
||||||
if ($enabled === 'true') { |
|
||||||
require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php'; |
|
||||||
$plugin = CourseLegalPlugin::create(); |
|
||||||
$pluginExtra = $plugin->getTeacherLink(); |
|
||||||
} |
|
||||||
|
|
||||||
// Start of tools for CourseAdmins (teachers/tutors) |
|
||||||
if ($session_id === 0 && api_is_course_admin() && api_is_allowed_to_edit(null, true)) { |
|
||||||
$content .= '<div class="alert alert-success" style="border:0px; margin-top: 0px;padding:0px;"> |
|
||||||
<div class="normal-message" id="id_normal_message" style="display:none">'; |
|
||||||
$content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/> '; |
|
||||||
$content .= get_lang('Please stand by...'); |
|
||||||
$content .= '</div> |
|
||||||
<div class="alert alert-success" id="id_confirmation_message" style="display:none"></div> |
|
||||||
</div>'; |
|
||||||
$content .= $pluginExtra; |
|
||||||
} elseif (api_is_coach()) { |
|
||||||
$content .= $pluginExtra; |
|
||||||
if (api_get_setting('show_session_data') === 'true' && $session_id > 0) { |
|
||||||
$content .= '<div class="row"> |
|
||||||
<div class="col-xs-12 col-md-12"> |
|
||||||
<span class="viewcaption">'.get_lang('Session\'s data').'</span> |
|
||||||
<table class="course_activity_home">'; |
|
||||||
$content .= CourseHome::show_session_data($session_id); |
|
||||||
$content .= '</table></div></div>'; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
$blocks = CourseHome::getUserBlocks(); |
|
||||||
$activityView = new Template('', false, false, false, false, false, false); |
|
||||||
$activityView->assign('blocks', $blocks); |
|
||||||
|
|
||||||
$content .= $activityView->fetch( |
|
||||||
$activityView->get_template('course_home/activity.tpl') |
|
||||||
); |
|
@ -1,7 +0,0 @@ |
|||||||
<html> |
|
||||||
<head> |
|
||||||
<meta http-equiv="refresh" content="0; url=course_home.php"> |
|
||||||
</head> |
|
||||||
<body> |
|
||||||
</body> |
|
||||||
</html> |
|
@ -0,0 +1,153 @@ |
|||||||
|
{% extends "@ChamiloTheme/Layout/layout_one_col.html.twig" %} |
||||||
|
|
||||||
|
{% block content %} |
||||||
|
{% autoescape false %} |
||||||
|
<script> |
||||||
|
/* option show/hide thematic-block */ |
||||||
|
$(function() { |
||||||
|
$("#thematic-show").click(function(){ |
||||||
|
$(".btn-hide-thematic").hide(); |
||||||
|
$(".btn-show-thematic").show(); //show using class |
||||||
|
$("#pross").fadeToggle(); //Not working collapse for Chrome |
||||||
|
}); |
||||||
|
|
||||||
|
$("#thematic-hide").click(function(){ |
||||||
|
$(".btn-show-thematic").hide(); //show using class |
||||||
|
$(".btn-hide-thematic").show(); |
||||||
|
$("#pross").fadeToggle(); //Not working collapse for Chrome |
||||||
|
}); |
||||||
|
|
||||||
|
$(".make_visible_and_invisible").attr("href", "javascript:void(0);"); |
||||||
|
$(".make_visible_and_invisible > img").click(function () { |
||||||
|
make_visible = "visible.png"; |
||||||
|
make_invisible = "invisible.png"; |
||||||
|
path_name = $(this).attr("src"); |
||||||
|
list_path_name = path_name.split("/"); |
||||||
|
image_link = list_path_name[list_path_name.length - 1]; |
||||||
|
tool_id = $(this).attr("id"); |
||||||
|
tool_info = tool_id.split("_"); |
||||||
|
my_tool_id = tool_info[1]; |
||||||
|
$("#id_normal_message").attr("class", "normal-message alert alert-success"); |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
contentType: "application/x-www-form-urlencoded", |
||||||
|
beforeSend: function(myObject) { |
||||||
|
$(".normal-message").show(); |
||||||
|
$("#id_confirmation_message").hide(); |
||||||
|
}, |
||||||
|
type: "GET", |
||||||
|
url: "'.api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?'.api_get_cidreq().'&a=set_visibility", |
||||||
|
data: "id=" + my_tool_id + "&sent_http_request=1", |
||||||
|
success: function(data) { |
||||||
|
eval("var info=" + data); |
||||||
|
new_current_tool_image = info.image; |
||||||
|
new_current_view = "'.api_get_path('WEB_PUBLIC_PATH').'img/" + info.view; |
||||||
|
//eyes |
||||||
|
$("#" + tool_id).attr("src", new_current_view); |
||||||
|
//tool |
||||||
|
$("#toolimage_" + my_tool_id).attr("src", new_current_tool_image); |
||||||
|
//clase |
||||||
|
$("#tooldesc_" + my_tool_id).attr("class", info.tclass); |
||||||
|
$("#istooldesc_" + my_tool_id).attr("class", info.tclass); |
||||||
|
|
||||||
|
if (image_link == "visible.png") { |
||||||
|
$("#" + tool_id).attr("alt", "'.get_lang('Activate').'"); |
||||||
|
$("#" + tool_id).attr("title", "'.get_lang('Activate').'"); |
||||||
|
} else { |
||||||
|
$("#" + tool_id).attr("alt", "'.get_lang('Deactivate').'"); |
||||||
|
$("#" + tool_id).attr("title", "'.get_lang('Deactivate').'"); |
||||||
|
} |
||||||
|
if (info.message == "is_active") { |
||||||
|
message = "'.get_lang('ToolIsNowVisible').'"; |
||||||
|
} else { |
||||||
|
message = "'.get_lang('ToolIsNowHidden').'"; |
||||||
|
} |
||||||
|
$(".normal-message").hide(); |
||||||
|
$("#id_confirmation_message").html(message); |
||||||
|
$("#id_confirmation_message").show(); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
|
||||||
|
{% if app.user.status != 5 %} <!-- main/template/default/course_home/activity.html.twig --> |
||||||
|
<div class="accordion accordion-b4" id="course-tools"> |
||||||
|
{% for block in blocks %} |
||||||
|
<div class="card"> |
||||||
|
<div class="card-header" id="heading-{{ block.class }}"> |
||||||
|
{% if block.title %} |
||||||
|
<h5 class="card-title"> |
||||||
|
<a class="{{ ( block.title == 'Authoring') ? ' ' : 'collapse' }}" role="button" data-toggle="collapse" data-target="#collapse-{{ block.class }}" aria-expanded="{{ ( block.title == 'Authoring') ? 'true' : 'false' }}" aria-controls="collapse-{{ block.class }}"> |
||||||
|
{{ block.title }} |
||||||
|
</a> |
||||||
|
</h5> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
|
||||||
|
<div id="collapse-{{ block.class }}" class="collapse show" aria-labelledby="heading-{{ block.class }}" data-parent="#course-tools"> |
||||||
|
<div class="grid-tools"> |
||||||
|
{% if 'homepage_view'|api_get_setting == 'activity' %} |
||||||
|
{% for item in block.content %} |
||||||
|
<div class="col-md-4 course-tool"> |
||||||
|
{{ item.extra|raw }} |
||||||
|
{{ item.visibility|raw }} |
||||||
|
{{ item.icon|raw }} |
||||||
|
{{ item.link|raw }} |
||||||
|
</div> |
||||||
|
{% endfor %} |
||||||
|
{% endif %} |
||||||
|
{% if 'homepage_view'|api_get_setting == 'activity_big' %} |
||||||
|
{% for item in block.content %} |
||||||
|
<div class="items-tools "> |
||||||
|
<div class="tools mt-3 mb-3"> |
||||||
|
<div class="big_icon"> |
||||||
|
{{ item.tool.image|raw }} |
||||||
|
</div> |
||||||
|
<div class="content pt-2 pb-2"> |
||||||
|
{{ item.extra|raw }} |
||||||
|
{{ item.link|raw }} |
||||||
|
{% if item.visibility is not empty %} |
||||||
|
<div class="view"> |
||||||
|
{{ item.visibility|raw }} |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{% endfor %} |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{% endfor %} |
||||||
|
</div> |
||||||
|
{% else %} |
||||||
|
<div class="grid-tools"> |
||||||
|
{% for block in blocks %} |
||||||
|
{% if 'homepage_view'|api_get_setting == 'activity_big' %} |
||||||
|
{% for item in block.content %} |
||||||
|
<div class="items-tools"> |
||||||
|
<div class="tools mt-3 mb-3"> |
||||||
|
<div class="big_icon"> |
||||||
|
{{ item.tool.image|raw }} |
||||||
|
</div> |
||||||
|
<div class="content pt-2 pb-2"> |
||||||
|
{{ item.extra|raw }} |
||||||
|
{{ item.link|raw }} |
||||||
|
{% if item.visibility is not empty %} |
||||||
|
<div class="view"> |
||||||
|
{{ item.visibility|raw }} |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{% endfor %} |
||||||
|
{% endif %} |
||||||
|
{% endfor %} |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
|
||||||
|
{% endautoescape %} |
||||||
|
{% endblock %} |
Loading…
Reference in new issue