parent
a6bd78ab8a
commit
0ffec357ed
@ -1,302 +1,369 @@ |
||||
.buy-courses-tabs { |
||||
margin-bottom: 15px; |
||||
margin-bottom: 15px; |
||||
} |
||||
|
||||
.buy-courses-page-header { |
||||
padding-bottom: 9px; |
||||
margin: 40px 0 20px; |
||||
border-bottom: 1px solid #eee; |
||||
padding-bottom: 9px; |
||||
margin: 40px 0 20px; |
||||
border-bottom: 1px solid #eee; |
||||
} |
||||
|
||||
.buy-courses-block-button { |
||||
display: block; |
||||
width: 100%; |
||||
height: 50px; |
||||
line-height: 35px; |
||||
font-size: 16px; |
||||
display: block; |
||||
width: 100%; |
||||
height: 50px; |
||||
line-height: 35px; |
||||
font-size: 16px; |
||||
} |
||||
|
||||
.buy-courses-cross-out { |
||||
text-decoration:line-through; |
||||
text-decoration: line-through; |
||||
} |
||||
|
||||
.buy-courses-title-color { |
||||
color: #5DC3E1; |
||||
padding-bottom: 10px; |
||||
color: #5DC3E1; |
||||
padding-bottom: 10px; |
||||
} |
||||
|
||||
.buy-courses-description-service { |
||||
text-align: justify; |
||||
font-size: 18px; |
||||
line-height: 1.42857; |
||||
text-align: justify; |
||||
font-size: 18px; |
||||
line-height: 1.42857; |
||||
} |
||||
|
||||
/* PROCESS BUY */ |
||||
.buy-info .price, .service-buy .price { |
||||
font-size: 24px; |
||||
line-height: 32px; |
||||
font-weight: bold; |
||||
padding-bottom: 10px; |
||||
padding-top: 10px; |
||||
letter-spacing: -0.020em; |
||||
} |
||||
|
||||
.buy-info .buy-item .title { |
||||
margin-top: 5px; |
||||
font-weight: bold; |
||||
line-height: 24px; |
||||
font-size: 18px; |
||||
} |
||||
|
||||
.buy-info .buy-item .description, .buy-info .buy-item .coaches { |
||||
margin-bottom: 20px; |
||||
color: #666666; |
||||
} |
||||
|
||||
.buy-info .buy-item .list-description { |
||||
color: #666666; |
||||
} |
||||
|
||||
.buy-info .buy-item .date { |
||||
margin-bottom: 10px; |
||||
color: #666666; |
||||
} |
||||
|
||||
.buy-summary { |
||||
margin-top: 10px; |
||||
border-top: 1px solid #CCCCCC; |
||||
} |
||||
|
||||
.panel-box-buy { |
||||
box-shadow: 0 15px 30px rgba(0, 0, 0, .1); |
||||
padding: 20px; |
||||
} |
||||
|
||||
.buy-summary .alert-info { |
||||
color: #31708f; |
||||
background-color: #e8f2f8; |
||||
border-color: #bce8f1; |
||||
} |
||||
|
||||
@-moz-keyframes wobblebar-loader { |
||||
0% { |
||||
left: 4px; |
||||
} |
||||
3% { |
||||
left: 204px; |
||||
} |
||||
6% { |
||||
left: 4px; |
||||
} |
||||
9% { |
||||
left: 204px; |
||||
} |
||||
12% { |
||||
left: 4px; |
||||
} |
||||
15% { |
||||
left: 204px; |
||||
} |
||||
18% { |
||||
left: 32px; |
||||
} |
||||
27% { |
||||
left: 32px; |
||||
} |
||||
30% { |
||||
left: 204px; |
||||
} |
||||
33% { |
||||
left: 4px; |
||||
} |
||||
36% { |
||||
left: 204px; |
||||
} |
||||
39% { |
||||
left: 4px; |
||||
} |
||||
42% { |
||||
left: 204px; |
||||
} |
||||
45% { |
||||
left: 4px; |
||||
} |
||||
48% { |
||||
left: 204px; |
||||
} |
||||
51% { |
||||
left: 152px; |
||||
} |
||||
63% { |
||||
left: 152px; |
||||
} |
||||
66% { |
||||
left: 4px; |
||||
} |
||||
69% { |
||||
left: 204px; |
||||
} |
||||
72% { |
||||
left: 4px; |
||||
} |
||||
75% { |
||||
left: 204px; |
||||
} |
||||
78% { |
||||
left: 4px; |
||||
} |
||||
81% { |
||||
left: 204px; |
||||
} |
||||
84% { |
||||
left: 72px; |
||||
} |
||||
94% { |
||||
left: 72px; |
||||
} |
||||
97% { |
||||
left: 204px; |
||||
} |
||||
0% { |
||||
left: 4px; |
||||
} |
||||
3% { |
||||
left: 204px; |
||||
} |
||||
6% { |
||||
left: 4px; |
||||
} |
||||
9% { |
||||
left: 204px; |
||||
} |
||||
12% { |
||||
left: 4px; |
||||
} |
||||
15% { |
||||
left: 204px; |
||||
} |
||||
18% { |
||||
left: 32px; |
||||
} |
||||
27% { |
||||
left: 32px; |
||||
} |
||||
30% { |
||||
left: 204px; |
||||
} |
||||
33% { |
||||
left: 4px; |
||||
} |
||||
36% { |
||||
left: 204px; |
||||
} |
||||
39% { |
||||
left: 4px; |
||||
} |
||||
42% { |
||||
left: 204px; |
||||
} |
||||
45% { |
||||
left: 4px; |
||||
} |
||||
48% { |
||||
left: 204px; |
||||
} |
||||
51% { |
||||
left: 152px; |
||||
} |
||||
63% { |
||||
left: 152px; |
||||
} |
||||
66% { |
||||
left: 4px; |
||||
} |
||||
69% { |
||||
left: 204px; |
||||
} |
||||
72% { |
||||
left: 4px; |
||||
} |
||||
75% { |
||||
left: 204px; |
||||
} |
||||
78% { |
||||
left: 4px; |
||||
} |
||||
81% { |
||||
left: 204px; |
||||
} |
||||
84% { |
||||
left: 72px; |
||||
} |
||||
94% { |
||||
left: 72px; |
||||
} |
||||
97% { |
||||
left: 204px; |
||||
} |
||||
} |
||||
|
||||
@-webkit-keyframes wobblebar-loader { |
||||
0% { |
||||
left: 4px; |
||||
} |
||||
3% { |
||||
left: 204px; |
||||
} |
||||
6% { |
||||
left: 4px; |
||||
} |
||||
9% { |
||||
left: 204px; |
||||
} |
||||
12% { |
||||
left: 4px; |
||||
} |
||||
15% { |
||||
left: 204px; |
||||
} |
||||
18% { |
||||
left: 32px; |
||||
} |
||||
27% { |
||||
left: 32px; |
||||
} |
||||
30% { |
||||
left: 204px; |
||||
} |
||||
33% { |
||||
left: 4px; |
||||
} |
||||
36% { |
||||
left: 204px; |
||||
} |
||||
39% { |
||||
left: 4px; |
||||
} |
||||
42% { |
||||
left: 204px; |
||||
} |
||||
45% { |
||||
left: 4px; |
||||
} |
||||
48% { |
||||
left: 204px; |
||||
} |
||||
51% { |
||||
left: 152px; |
||||
} |
||||
63% { |
||||
left: 152px; |
||||
} |
||||
66% { |
||||
left: 4px; |
||||
} |
||||
69% { |
||||
left: 204px; |
||||
} |
||||
72% { |
||||
left: 4px; |
||||
} |
||||
75% { |
||||
left: 204px; |
||||
} |
||||
78% { |
||||
left: 4px; |
||||
} |
||||
81% { |
||||
left: 204px; |
||||
} |
||||
84% { |
||||
left: 72px; |
||||
} |
||||
94% { |
||||
left: 72px; |
||||
} |
||||
97% { |
||||
left: 204px; |
||||
} |
||||
0% { |
||||
left: 4px; |
||||
} |
||||
3% { |
||||
left: 204px; |
||||
} |
||||
6% { |
||||
left: 4px; |
||||
} |
||||
9% { |
||||
left: 204px; |
||||
} |
||||
12% { |
||||
left: 4px; |
||||
} |
||||
15% { |
||||
left: 204px; |
||||
} |
||||
18% { |
||||
left: 32px; |
||||
} |
||||
27% { |
||||
left: 32px; |
||||
} |
||||
30% { |
||||
left: 204px; |
||||
} |
||||
33% { |
||||
left: 4px; |
||||
} |
||||
36% { |
||||
left: 204px; |
||||
} |
||||
39% { |
||||
left: 4px; |
||||
} |
||||
42% { |
||||
left: 204px; |
||||
} |
||||
45% { |
||||
left: 4px; |
||||
} |
||||
48% { |
||||
left: 204px; |
||||
} |
||||
51% { |
||||
left: 152px; |
||||
} |
||||
63% { |
||||
left: 152px; |
||||
} |
||||
66% { |
||||
left: 4px; |
||||
} |
||||
69% { |
||||
left: 204px; |
||||
} |
||||
72% { |
||||
left: 4px; |
||||
} |
||||
75% { |
||||
left: 204px; |
||||
} |
||||
78% { |
||||
left: 4px; |
||||
} |
||||
81% { |
||||
left: 204px; |
||||
} |
||||
84% { |
||||
left: 72px; |
||||
} |
||||
94% { |
||||
left: 72px; |
||||
} |
||||
97% { |
||||
left: 204px; |
||||
} |
||||
} |
||||
|
||||
@keyframes wobblebar-loader { |
||||
0% { |
||||
left: 4px; |
||||
} |
||||
3% { |
||||
left: 204px; |
||||
} |
||||
6% { |
||||
left: 4px; |
||||
} |
||||
9% { |
||||
left: 204px; |
||||
} |
||||
12% { |
||||
left: 4px; |
||||
} |
||||
15% { |
||||
left: 204px; |
||||
} |
||||
18% { |
||||
left: 32px; |
||||
} |
||||
27% { |
||||
left: 32px; |
||||
} |
||||
30% { |
||||
left: 204px; |
||||
} |
||||
33% { |
||||
left: 4px; |
||||
} |
||||
36% { |
||||
left: 204px; |
||||
} |
||||
39% { |
||||
left: 4px; |
||||
} |
||||
42% { |
||||
left: 204px; |
||||
} |
||||
45% { |
||||
left: 4px; |
||||
} |
||||
48% { |
||||
left: 204px; |
||||
} |
||||
51% { |
||||
left: 152px; |
||||
} |
||||
63% { |
||||
left: 152px; |
||||
} |
||||
66% { |
||||
left: 4px; |
||||
} |
||||
69% { |
||||
left: 204px; |
||||
} |
||||
72% { |
||||
left: 4px; |
||||
} |
||||
75% { |
||||
left: 204px; |
||||
} |
||||
78% { |
||||
left: 4px; |
||||
} |
||||
81% { |
||||
left: 204px; |
||||
} |
||||
84% { |
||||
left: 72px; |
||||
} |
||||
94% { |
||||
left: 72px; |
||||
} |
||||
97% { |
||||
left: 204px; |
||||
} |
||||
0% { |
||||
left: 4px; |
||||
} |
||||
3% { |
||||
left: 204px; |
||||
} |
||||
6% { |
||||
left: 4px; |
||||
} |
||||
9% { |
||||
left: 204px; |
||||
} |
||||
12% { |
||||
left: 4px; |
||||
} |
||||
15% { |
||||
left: 204px; |
||||
} |
||||
18% { |
||||
left: 32px; |
||||
} |
||||
27% { |
||||
left: 32px; |
||||
} |
||||
30% { |
||||
left: 204px; |
||||
} |
||||
33% { |
||||
left: 4px; |
||||
} |
||||
36% { |
||||
left: 204px; |
||||
} |
||||
39% { |
||||
left: 4px; |
||||
} |
||||
42% { |
||||
left: 204px; |
||||
} |
||||
45% { |
||||
left: 4px; |
||||
} |
||||
48% { |
||||
left: 204px; |
||||
} |
||||
51% { |
||||
left: 152px; |
||||
} |
||||
63% { |
||||
left: 152px; |
||||
} |
||||
66% { |
||||
left: 4px; |
||||
} |
||||
69% { |
||||
left: 204px; |
||||
} |
||||
72% { |
||||
left: 4px; |
||||
} |
||||
75% { |
||||
left: 204px; |
||||
} |
||||
78% { |
||||
left: 4px; |
||||
} |
||||
81% { |
||||
left: 204px; |
||||
} |
||||
84% { |
||||
left: 72px; |
||||
} |
||||
94% { |
||||
left: 72px; |
||||
} |
||||
97% { |
||||
left: 204px; |
||||
} |
||||
} |
||||
|
||||
/* Landscape phones and down */ |
||||
@media (max-width: 480px) { |
||||
.panel-box-buy { |
||||
padding: 0; |
||||
} |
||||
|
||||
.buy-summary .pull-right { |
||||
float: left !important; |
||||
} |
||||
|
||||
.buy-summary .btn-success { |
||||
width: 100%; |
||||
} |
||||
} |
||||
|
||||
/* :not(:required) hides this rule from IE9 and below */ |
||||
.wobblebar-loader:not(:required) { |
||||
background: #2E6DA4; |
||||
-moz-border-radius: 10.66667px; |
||||
-webkit-border-radius: 10.66667px; |
||||
border-radius: 10.66667px; |
||||
display: inline-block; |
||||
overflow: hidden; |
||||
text-indent: -9999px; |
||||
width: 228px; |
||||
height: 21.33333px; |
||||
position: relative; |
||||
background: #2E6DA4; |
||||
-moz-border-radius: 10.66667px; |
||||
-webkit-border-radius: 10.66667px; |
||||
border-radius: 10.66667px; |
||||
display: inline-block; |
||||
overflow: hidden; |
||||
text-indent: -9999px; |
||||
width: 228px; |
||||
height: 21.33333px; |
||||
position: relative; |
||||
} |
||||
|
||||
.wobblebar-loader:not(:required)::after { |
||||
-moz-animation: wobblebar-loader 15000ms infinite ease; |
||||
-webkit-animation: wobblebar-loader 15000ms infinite ease; |
||||
animation: wobblebar-loader 15000ms infinite ease; |
||||
background: white; |
||||
display: block; |
||||
-moz-border-radius: 7.11111px; |
||||
-webkit-border-radius: 7.11111px; |
||||
border-radius: 7.11111px; |
||||
content: ''; |
||||
position: absolute; |
||||
top: 3.55556px; |
||||
left: 4px; |
||||
width: 21.33333px; |
||||
height: 14.22222px; |
||||
-moz-animation: wobblebar-loader 15000ms infinite ease; |
||||
-webkit-animation: wobblebar-loader 15000ms infinite ease; |
||||
animation: wobblebar-loader 15000ms infinite ease; |
||||
background: white; |
||||
display: block; |
||||
-moz-border-radius: 7.11111px; |
||||
-webkit-border-radius: 7.11111px; |
||||
border-radius: 7.11111px; |
||||
content: ''; |
||||
position: absolute; |
||||
top: 3.55556px; |
||||
left: 4px; |
||||
width: 21.33333px; |
||||
height: 14.22222px; |
||||
} |
||||
|
||||
|
@ -1,119 +1,221 @@ |
||||
<h2 class="page-header">{{ 'PurchaseData'|get_plugin_lang('BuyCoursesPlugin') }}</h2> |
||||
<div class="actions"> |
||||
<a href="{{ _p.web }}main/auth/courses.php" title="{{ "Back"|get_lang }}"> |
||||
<img src="{{ "back.png"|icon(32) }}" width="32" height="32" alt="{{ "Back"|get_lang }}" |
||||
title="{{ "Back"|get_lang }}"/> |
||||
</a> |
||||
</div> |
||||
<div class="page-header"> |
||||
<h3>{{ 'PurchaseData'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-md-5"> |
||||
<div class="thumbnail"> |
||||
{% if buying_course %} |
||||
<a class="ajax" data-title="{{ course.title }}" |
||||
href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}"> |
||||
<img alt="{{ course.title }}" class="img-responsive" style="width: 100%;" |
||||
src="{{ course.course_img ? course.course_img : 'session_default.png'|icon() }}"> |
||||
</a> |
||||
<div class="caption"> |
||||
<h3> |
||||
<a class="ajax" data-title="{{ course.title }}" |
||||
href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}">{{ course.title }}</a> |
||||
</h3> |
||||
<ul class="fa-ul"> |
||||
{% for teacher in course.teachers %} |
||||
<li><em class="fa-li fa fa-user" aria-hidden="true"></em>{{ teacher }}</li> |
||||
{% endfor %} |
||||
</ul> |
||||
<p id="n-price" class="lead text-right" style="color: white;"> |
||||
<span class="label label-primary">{{ course.currency == 'BRL' ? 'R$' : course.currency }} {{ course.price }}</span> |
||||
</p> |
||||
<p id="s-price" class="lead text-right"></p> |
||||
</div> |
||||
{% elseif buying_session %} |
||||
<img alt="{{ session.name }}" class="img-ressponsive" style="width: 100%;" |
||||
src="{{ session.image ? session.image : 'session_default.png'|icon() }}"> |
||||
<div class="caption"> |
||||
<h3>{{ session.name }}</h3> |
||||
<ul class="fa-ul"> |
||||
<li> |
||||
<em class="fa-li fa fa-calendar" aria-hidden="true"></em>{{ session.dates.display }} |
||||
</li> |
||||
</ul> |
||||
<ul class="fa-ul"> |
||||
{% for course in session.courses %} |
||||
<li> |
||||
<em class="fa-li fa fa-book" aria-hidden="true"></em> |
||||
{{ course.title }} |
||||
{% if course.coaches|length %} |
||||
<ul class="fa-ul"> |
||||
{% for coach in course.coaches %} |
||||
<li><em class="fa-li fa fa-user" aria-hidden="true"></em>{{ coach }}</li> |
||||
<div class="col-md-12"> |
||||
<div class="panel panel-default panel-box-buy"> |
||||
<div class="panel-body"> |
||||
<div class="buy-info"> |
||||
{% if buying_course %} |
||||
<div class="row"> |
||||
<div class="col-md-3"> |
||||
<a class="ajax" data-title="{{ course.title }}" |
||||
href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}"> |
||||
<img alt="{{ course.title }}" class="img-rounded img-responsive" |
||||
src="{{ course.course_img ? course.course_img : 'session_default.png'|icon() }}"> |
||||
</a> |
||||
<div class="price"> |
||||
{{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{{ course.currency == 'BRL' ? 'R$' : course.currency }} {{ course.price }} |
||||
</div> |
||||
</div> |
||||
<div class="col-md-9"> |
||||
<div class="buy-item"> |
||||
<h3 class="title"> |
||||
<a class="ajax" data-title="{{ course.title }}" |
||||
href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}"> |
||||
{{ course.title }} |
||||
</a> |
||||
</h3> |
||||
{% if course.description %} |
||||
<div class="description"> |
||||
{{ course.description }} |
||||
</div> |
||||
{% endif %} |
||||
<div class="coaches"> |
||||
<p> |
||||
{{ 'Teachers'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{% for teacher in course.teachers %} |
||||
<em class="fa fa-user" aria-hidden="true"></em> |
||||
<a href="{{ _p.web }}main/social/profile.php?u={{ teacher.id }}" |
||||
class="teacher-item"> {{ teacher.name }}</a>, |
||||
{% endfor %} |
||||
</ul> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% elseif buying_session %} |
||||
<div class="row"> |
||||
<div class="col-md-3"> |
||||
<img alt="{{ session.name }}" class="img-rounded img-responsive"" |
||||
src="{{ session.image ? session.image : 'session_default.png'|icon() }}"> |
||||
<div class="price"> |
||||
{{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{{ session.currency == 'BRL' ? 'R$' : session.currency }} {{ session.price }} |
||||
</div> |
||||
</div> |
||||
<div class="col-md-9"> |
||||
<div class="buy-item"> |
||||
<h3 class="title">{{ session.name }}</h3> |
||||
{% if session.description %} |
||||
<div class="description"> |
||||
{{ session.description }} |
||||
</div> |
||||
{% endif %} |
||||
</li> |
||||
{% endfor %} |
||||
</ul> |
||||
<p id="n-price" class="lead text-right" style="color: white;"> |
||||
<span class="label label-primary">{{ session.currency == 'BRL' ? 'R$' : session.currency }} {{ session.price }}</span> |
||||
</p> |
||||
<p id="s-price" class="lead text-right"></p> |
||||
<div class="date"> |
||||
<em class="fa fa-calendar" aria-hidden="true"></em> {{ session.dates.display }} |
||||
</div> |
||||
<div class="coaches"> |
||||
{% for course in session.courses %} |
||||
<p class="course"><em class="fa fa-book" aria-hidden="true"></em> {{ course.title }} |
||||
</p> |
||||
<p> |
||||
{{ 'Teachers'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{% if course.coaches|length %} |
||||
{% for coach in course.coaches %} |
||||
<em class="fa fa-user" aria-hidden="true"></em> |
||||
<a href="{{ _p.web }}main/social/profile.php?u={{ coach.id }}" |
||||
class="teacher-item"> {{ coach.name }}</a>, |
||||
{% endfor %} |
||||
{% endif %} |
||||
</p> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
{% elseif buying_service %} |
||||
<a href='{{ _p.web }}service/{{ service.id }}'> |
||||
<img alt="{{ service.name }}" class="img-responsive" |
||||
src="{{ service.image ? _p.web ~ 'plugin/buycourses/uploads/services/images/' ~ service.image : 'session_default.png'|icon() }}"> |
||||
</a> |
||||
<div class="caption"> |
||||
<h3> |
||||
<a href='{{ _p.web }}service/{{ service.id }}'>{{ service.name }}</a> |
||||
</h3> |
||||
<ul class="fa-ul"> |
||||
{% if service.applies_to %} |
||||
<li> |
||||
<em class="fa-li fa fa-hand-o-right" aria-hidden="true"></em> |
||||
{% if service.applies_to == 0 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'None'|get_lang }} |
||||
{% elseif service.applies_to == 1 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'User'|get_lang }} |
||||
{% elseif service.applies_to == 2 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'Course'|get_lang }} |
||||
{% elseif service.applies_to == 3 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'Session'|get_lang }} |
||||
{% elseif service.applies_to == 4 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'TemplateTitleCertificate'|get_lang }} |
||||
{% endif %} |
||||
</li> |
||||
{% endif %} |
||||
<li> |
||||
<em class="fa-li fa fa-money" aria-hidden="true"></em> |
||||
{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }} |
||||
: {{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }} |
||||
/ {{ service.duration_days == 0 ? 'NoLimit'|get_lang : service.duration_days ~ ' ' ~ 'Days'|get_lang }} |
||||
</li> |
||||
<li><em class="fa-li fa fa-user" aria-hidden="true"></em> {{ service.owner_name }}</li> |
||||
<li><em class="fa-li fa fa-align-justify" aria-hidden="true"></em> {{ service.description }}</li> |
||||
</ul> |
||||
<p id="n-price" class="lead text-right" style="color: white;"> |
||||
<span class="label label-primary">{{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }}</span> |
||||
</p> |
||||
<p id="s-price" class="lead text-right"></p> |
||||
<div class="buy-summary"> |
||||
<h3>{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
{{ form }} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-6 col-md-offset-1"> |
||||
<div class="panel panel-default buycourse-panel-default"> |
||||
<div class="panel-heading"> |
||||
<h3 class="panel-title">{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
$(document).ready(function () { |
||||
$("label").removeClass('control-label'); |
||||
$('.form_required').remove(); |
||||
$("small").remove(); |
||||
$("label[for=submit]").remove(); |
||||
}); |
||||
</script><div class="actions"> |
||||
<a href="{{ _p.web }}main/auth/courses.php" title="{{ "Back"|get_lang }}"> |
||||
<img src="{{ "back.png"|icon(32) }}" width="32" height="32" alt="{{ "Back"|get_lang }}" |
||||
title="{{ "Back"|get_lang }}"/> |
||||
</a> |
||||
</div> |
||||
<div class="page-header"> |
||||
<h3>{{ 'PurchaseData'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<div class="panel panel-default panel-box-buy"> |
||||
<div class="panel-body"> |
||||
{{ form }} |
||||
<div class="buy-info"> |
||||
{% if buying_course %} |
||||
<div class="row"> |
||||
<div class="col-md-3"> |
||||
<a class="ajax" data-title="{{ course.title }}" |
||||
href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}"> |
||||
<img alt="{{ course.title }}" class="img-rounded img-responsive" |
||||
src="{{ course.course_img ? course.course_img : 'session_default.png'|icon() }}"> |
||||
</a> |
||||
<div class="price"> |
||||
{{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{{ course.currency == 'BRL' ? 'R$' : course.currency }} {{ course.price }} |
||||
</div> |
||||
</div> |
||||
<div class="col-md-9"> |
||||
<div class="buy-item"> |
||||
<h3 class="title"> |
||||
<a class="ajax" data-title="{{ course.title }}" |
||||
href="{{ _p.web_ajax ~ 'course_home.ajax.php?' ~ {'a': 'show_course_information', 'code': course.code}|url_encode() }}"> |
||||
{{ course.title }} |
||||
</a> |
||||
</h3> |
||||
{% if course.description %} |
||||
<div class="description"> |
||||
{{ course.description }} |
||||
</div> |
||||
{% endif %} |
||||
<div class="coaches"> |
||||
<p> |
||||
{{ 'Teachers'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{% for teacher in course.teachers %} |
||||
<em class="fa fa-user" aria-hidden="true"></em> |
||||
<a href="{{ _p.web }}main/social/profile.php?u={{ teacher.id }}" |
||||
class="teacher-item"> {{ teacher.name }}</a>, |
||||
{% endfor %} |
||||
</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% elseif buying_session %} |
||||
<div class="row"> |
||||
<div class="col-md-3"> |
||||
<img alt="{{ session.name }}" class="img-rounded img-responsive"" |
||||
src="{{ session.image ? session.image : 'session_default.png'|icon() }}"> |
||||
<div class="price"> |
||||
{{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{{ session.currency == 'BRL' ? 'R$' : session.currency }} {{ session.price }} |
||||
</div> |
||||
</div> |
||||
<div class="col-md-9"> |
||||
<div class="buy-item"> |
||||
<h3 class="title">{{ session.name }}</h3> |
||||
{% if session.description %} |
||||
<div class="description"> |
||||
{{ session.description }} |
||||
</div> |
||||
{% endif %} |
||||
<div class="date"> |
||||
<em class="fa fa-calendar" aria-hidden="true"></em> {{ session.dates.display }} |
||||
</div> |
||||
<div class="coaches"> |
||||
{% for course in session.courses %} |
||||
<p class="course"><em class="fa fa-book" aria-hidden="true"></em> {{ course.title }} |
||||
</p> |
||||
<p> |
||||
{{ 'Teachers'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{% if course.coaches|length %} |
||||
{% for coach in course.coaches %} |
||||
<em class="fa fa-user" aria-hidden="true"></em> |
||||
<a href="{{ _p.web }}main/social/profile.php?u={{ coach.id }}" |
||||
class="teacher-item"> {{ coach.name }}</a>, |
||||
{% endfor %} |
||||
{% endif %} |
||||
</p> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
<div class="buy-summary"> |
||||
<h3>{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
{{ form }} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
$(document).ready(function () { |
||||
|
||||
$("label").removeClass('control-label'); |
||||
$('.form_required').remove(); |
||||
$("small").remove(); |
||||
$("label[for=submit]").remove(); |
||||
|
||||
}); |
||||
</script> |
||||
|
@ -0,0 +1,83 @@ |
||||
<div class="actions"> |
||||
<a href="{{ _p.web }}main/auth/courses.php" title="{{ "Back"|get_lang }}"> |
||||
<img src="{{ "back.png"|icon(32) }}" width="32" height="32" alt="{{ "Back"|get_lang }}" |
||||
title="{{ "Back"|get_lang }}"/> |
||||
</a> |
||||
</div> |
||||
<div class="page-header"> |
||||
<h3>{{ 'PurchaseData'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
</div> |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<div class="panel panel-default panel-box-buy"> |
||||
<div class="panel-body"> |
||||
<div class="buy-info"> |
||||
{% if buying_service %} |
||||
<div class="row"> |
||||
<div class="col-md-3"> |
||||
<a href='{{ _p.web }}service/{{ service.id }}'> |
||||
<img alt="{{ service.name }}" class="img-rounded img-responsive" |
||||
src="{{ service.image ? service.image : 'session_default.png'|icon() }}"> |
||||
</a> |
||||
<div class="price"> |
||||
{{ 'Total'|get_plugin_lang('BuyCoursesPlugin')}} : |
||||
{{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }} |
||||
</div> |
||||
</div> |
||||
<div class="col-md-9"> |
||||
<div class="buy-item"> |
||||
<h3 class="title"> |
||||
<a href='{{ _p.web }}service/{{ service.id }}'>{{ service.name }}</a> |
||||
</h3> |
||||
{% if service.description %} |
||||
<div class="description"> |
||||
{{ service.description }} |
||||
</div> |
||||
{% endif %} |
||||
<ul class="fa-ul list-description"> |
||||
{% if service.applies_to %} |
||||
<li> |
||||
<em class="fa-li fa fa-hand-o-right" aria-hidden="true"></em> |
||||
{% if service.applies_to == 0 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'None'|get_lang }} |
||||
{% elseif service.applies_to == 1 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'User'|get_lang }} |
||||
{% elseif service.applies_to == 2 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'Course'|get_lang }} |
||||
{% elseif service.applies_to == 3 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'Session'|get_lang }} |
||||
{% elseif service.applies_to == 4 %} |
||||
{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') ~ ' ' ~ 'TemplateTitleCertificate'|get_lang }} |
||||
{% endif %} |
||||
</li> |
||||
{% endif %} |
||||
<li> |
||||
<em class="fa-li fa fa-money" aria-hidden="true"></em> |
||||
{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }} |
||||
: {{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }} |
||||
/ {{ service.duration_days == 0 ? 'NoLimit'|get_lang : service.duration_days ~ ' ' ~ 'Days'|get_lang }} |
||||
</li> |
||||
<li><em class="fa-li fa fa-user" aria-hidden="true"></em> {{ service.owner_name }}</li> |
||||
|
||||
</ul> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
<div class="buy-summary"> |
||||
<h3>{{ 'PaymentMethods'|get_plugin_lang('BuyCoursesPlugin') }}</h3> |
||||
{{ form }} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<script> |
||||
$(document).ready(function () { |
||||
$("label").removeClass('control-label'); |
||||
$('.form_required').remove(); |
||||
$("small").remove(); |
||||
$("label[for=submit]").remove(); |
||||
}); |
||||
</script> |
@ -0,0 +1,55 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Class DictionaryPlugin. |
||||
*/ |
||||
class DictionaryPlugin extends Plugin |
||||
{ |
||||
/** |
||||
* DictionaryPlugin constructor. |
||||
*/ |
||||
protected function __construct() |
||||
{ |
||||
parent::__construct( |
||||
'1.0', |
||||
'Julio Montoya', |
||||
[ |
||||
'enable_plugin_dictionary' => 'boolean', |
||||
] |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* @return DictionaryPlugin|null |
||||
*/ |
||||
public static function create() |
||||
{ |
||||
static $result = null; |
||||
|
||||
return $result ? $result : $result = new self(); |
||||
} |
||||
|
||||
/** |
||||
* Installation process. |
||||
*/ |
||||
public function install() |
||||
{ |
||||
$sql = "CREATE TABLE IF NOT EXISTS plugin_dictionary ( |
||||
id INT NOT NULL AUTO_INCREMENT, |
||||
term VARCHAR(255) NOT NULL, |
||||
definition LONGTEXT NOT NULL, |
||||
PRIMARY KEY (id)); |
||||
"; |
||||
Database::query($sql); |
||||
} |
||||
|
||||
/** |
||||
* Uninstall process. |
||||
*/ |
||||
public function uninstall() |
||||
{ |
||||
$sql = "DROP TABLE IF EXISTS plugin_dictionary"; |
||||
Database::query($sql); |
||||
} |
||||
} |
@ -0,0 +1,2 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
@ -0,0 +1,7 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
if (!api_is_platform_admin()) { |
||||
die('You must have admin permissions to install plugins'); |
||||
} |
||||
DictionaryPlugin::create()->install(); |
@ -0,0 +1,7 @@ |
||||
<?php |
||||
$strings['plugin_title'] = "Extensible Dictionary"; |
||||
$strings['plugin_comment'] = "This plugin allows the admins to add terms and definitions."; |
||||
$strings['enable_plugin_dictionary'] = "Enable plugin"; |
||||
|
||||
$strings['Term'] = "Term"; |
||||
$strings['Definition'] = "Definition"; |
@ -0,0 +1,4 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
$plugin_info = DictionaryPlugin::create()->get_info(); |
@ -0,0 +1,85 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
require_once __DIR__.'/../../main/inc/global.inc.php'; |
||||
|
||||
api_protect_admin_script(); |
||||
|
||||
$plugin = DictionaryPlugin::create(); |
||||
|
||||
$table = 'plugin_dictionary'; |
||||
$sql = "SELECT * FROM $table ORDER BY TERM"; |
||||
$result = Database::query($sql); |
||||
$terms = Database::store_result($result, 'ASSOC'); |
||||
|
||||
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'add'; |
||||
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
||||
|
||||
$term = null; |
||||
if (!empty($id)) { |
||||
$sql = "SELECT * FROM $table WHERE id = $id"; |
||||
$result = Database::query($sql); |
||||
$term = Database::fetch_array($result, 'ASSOC'); |
||||
if (empty($term)) { |
||||
api_not_allowed(true); |
||||
} |
||||
} |
||||
|
||||
$form = new FormValidator('dictionary', 'post', api_get_self().'?action='.$action.'&id='.$id); |
||||
$form->addText('term', $plugin->get_lang('Term'), true); |
||||
$form->addTextarea('definition', $plugin->get_lang('Definition'), [], true); |
||||
//$form->addHtmlEditor('definition', get_lang('Definition'), true); |
||||
$form->addButtonSave(get_lang('Save')); |
||||
|
||||
switch ($action) { |
||||
case 'add': |
||||
if ($form->validate()) { |
||||
$values = $form->getSubmitValues(); |
||||
$params = [ |
||||
'term' => $values['term'], |
||||
'definition' => $values['definition'], |
||||
]; |
||||
$result = Database::insert($table, $params); |
||||
if ($result) { |
||||
Display::addFlash(Display::return_message(get_lang('Added'))); |
||||
} |
||||
header('Location: '.api_get_self()); |
||||
exit; |
||||
} |
||||
break; |
||||
case 'edit': |
||||
$form->setDefaults($term); |
||||
if ($form->validate()) { |
||||
$values = $form->getSubmitValues(); |
||||
$params = [ |
||||
'term' => $values['term'], |
||||
'definition' => $values['definition'], |
||||
]; |
||||
Database::update($table, $params, ['id = ?' => $id]); |
||||
Display::addFlash(Display::return_message(get_lang('Updated'))); |
||||
|
||||
header('Location: '.api_get_self()); |
||||
exit; |
||||
} |
||||
break; |
||||
case 'delete': |
||||
if (!empty($term)) { |
||||
Database::delete($table, ['id = ?' => $id]); |
||||
Display::addFlash(Display::return_message(get_lang('Deleted'))); |
||||
header('Location: '.api_get_self()); |
||||
exit; |
||||
} |
||||
break; |
||||
} |
||||
|
||||
$tpl = new Template($plugin->get_lang('plugin_title')); |
||||
$tpl->assign('terms', $terms); |
||||
$tpl->assign('form', $form->returnForm()); |
||||
|
||||
//$url = api_get_path(WEB_PLUGIN_PATH).'studentfollowup/posts.php?'; |
||||
//$tpl->assign('post_url', $url); |
||||
$content = $tpl->fetch('/'.$plugin->get_name().'/view/terms.html.twig'); |
||||
// Assign into content |
||||
$tpl->assign('content', $content); |
||||
// Display |
||||
$tpl->display_one_col_template(); |
@ -0,0 +1,34 @@ |
||||
|
||||
{{ form }} |
||||
|
||||
<table class="data_table"> |
||||
<tr> |
||||
<th> |
||||
{{ 'Term' | get_plugin_lang('DictionaryPlugin') }} |
||||
</th> |
||||
<th> |
||||
{{ 'Definition' | get_plugin_lang('DictionaryPlugin') }} |
||||
</th> |
||||
<th> |
||||
{{ 'Actions' | get_lang }} |
||||
</th> |
||||
</tr> |
||||
{% for term in terms %} |
||||
<tr> |
||||
<td> |
||||
{{ term.term }} |
||||
</td> |
||||
<td> |
||||
{{ term.definition }} |
||||
</td> |
||||
<td> |
||||
<a href="{{ _p.web_plugin }}dictionary/terms.php?action=edit&{{ {'id': term.id}|url_encode() }}" class="btn btn-success"> |
||||
<span class="fa fa-edit fa-fw" aria-hidden="true"></span> {{ 'Edit'|get_lang }} |
||||
</a> |
||||
<a href="{{ _p.web_plugin }}dictionary/terms.php?action=delete&{{ {'id': term.id}|url_encode() }}" class="btn btn-danger"> |
||||
<span class="fa fa-times fa-fw" aria-hidden="true"></span> {{ 'Delete'|get_lang }} |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</table> |
@ -1,12 +1,13 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Uninstall the MSI/LTI Plugin |
||||
* @package chamilo.plugin.ims_lti |
||||
*/ |
||||
|
||||
if (!api_is_platform_admin()) { |
||||
die ('You must have admin permissions to uninstall plugins'); |
||||
die('You must have admin permissions to uninstall plugins'); |
||||
} |
||||
|
||||
ImsLtiPlugin::create()->uninstall(); |
||||
|
@ -0,0 +1,20 @@ |
||||
Este plugin da la posibilidad a los profesores de un curso escribir en un bloc de notas compartido. |
||||
|
||||
Los estudiantes no tienen acceso a las notas compartidas de los profesores. |
||||
|
||||
**Instrucciones de puesta en funcionamiento** |
||||
|
||||
- Subir la carpeta **notebookteacher** a la carpeta plugin de chamilo. |
||||
|
||||
- Habilitar el plugin en la administración de Chamilo. |
||||
- El icono de la herramienta aparecerá en pantalla de los cursos con el resto de herramientas |
||||
- Si no se visualiza el icono en el cursos correctamente y sale el icono de plugin genérico: |
||||
- Copiar los iconos de la carpeta resources/img/64 dentro de /main/img/icons/64 |
||||
- Copiar el icono de la carpeta resources/img/22 dentro de /main/img |
||||
|
||||
**Solo si ya tiene instalado el plugin previamente:** |
||||
|
||||
Para actualizar la base de datos del plugin con los últimos cambios de la estructura deberá poner en su |
||||
navegador la siguiente dirección cambiando el nombre del dominio con el que proceda en su caso. |
||||
|
||||
http://*sudominio.com*/**plugin/notebookteacher/update.php** |
@ -0,0 +1,10 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Config the plugin. |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
* |
||||
* @author Jose Angel Ruiz <desarrollo@nosolored.com> |
||||
*/ |
||||
require_once __DIR__.'/../../main/inc/global.inc.php'; |
@ -0,0 +1,46 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Plugin database installation script. Can only be executed if included |
||||
* inside another script loading global.inc.php. |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
*/ |
||||
/** |
||||
* Check if script can be called. |
||||
*/ |
||||
if (!function_exists('api_get_path')) { |
||||
die('This script must be loaded through the Chamilo plugin installer sequence'); |
||||
} |
||||
|
||||
$entityManager = Database::getManager(); |
||||
$pluginSchema = new \Doctrine\DBAL\Schema\Schema(); |
||||
$connection = $entityManager->getConnection(); |
||||
$platform = $connection->getDatabasePlatform(); |
||||
|
||||
if ($pluginSchema->hasTable(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER)) { |
||||
return; |
||||
} |
||||
|
||||
//Create tables |
||||
$notebookTable = $pluginSchema->createTable(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER); |
||||
$notebookTable->addColumn('id', \Doctrine\DBAL\Types\Type::INTEGER, ['autoincrement' => true, 'unsigned' => true]); |
||||
$notebookTable->addColumn('c_id', \Doctrine\DBAL\Types\Type::INTEGER, ['unsigned' => true]); |
||||
$notebookTable->addColumn('session_id', \Doctrine\DBAL\Types\Type::INTEGER, ['unsigned' => true]); |
||||
$notebookTable->addColumn('user_id', \Doctrine\DBAL\Types\Type::INTEGER, ['unsigned' => true]); |
||||
$notebookTable->addColumn('student_id', \Doctrine\DBAL\Types\Type::INTEGER, ['unsigned' => true]); |
||||
$notebookTable->addColumn('course', \Doctrine\DBAL\Types\Type::STRING); |
||||
$notebookTable->addColumn('title', \Doctrine\DBAL\Types\Type::STRING); |
||||
$notebookTable->addColumn('description', \Doctrine\DBAL\Types\Type::TEXT); |
||||
$notebookTable->addColumn('creation_date', \Doctrine\DBAL\Types\Type::DATETIME); |
||||
$notebookTable->addColumn('update_date', \Doctrine\DBAL\Types\Type::DATETIME); |
||||
$notebookTable->addColumn('status', \Doctrine\DBAL\Types\Type::INTEGER, ['unsigned' => true]); |
||||
$notebookTable->addIndex(['c_id']); |
||||
$notebookTable->setPrimaryKey(['id']); |
||||
|
||||
$queries = $pluginSchema->toSql($platform); |
||||
|
||||
foreach ($queries as $query) { |
||||
Database::query($query); |
||||
} |
@ -0,0 +1,3 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
require_once 'config.php'; |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
/** |
||||
* This script is included by main/admin/settings.lib.php and generally |
||||
* includes things to execute in the main database (settings_current table). |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
*/ |
||||
require_once __DIR__.'/config.php'; |
||||
if (!api_is_platform_admin()) { |
||||
die('You must have admin permissions to install plugins'); |
||||
} |
||||
NotebookTeacherPlugin::create()->install(); |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
$strings['plugin_title'] = "Teacher notes"; |
||||
$strings['plugin_comment'] = "This plugin allows the teachers of a course to have a shared notebook. |
||||
Students do not have access."; |
||||
$strings['NotebookTeacher'] = "Teacher notes"; |
||||
$strings['enable_plugin_notebookteacher'] = "Enable plugin"; |
||||
$strings['ToolDisabled'] = "The tool is disabled from the administration"; |
||||
$strings['ToolForTeacher'] = "Exclusive tool for teachers"; |
||||
$strings['AllStudent'] = "All students"; |
||||
$strings['StudentFilter'] = "Student filter"; |
||||
$strings['NoNotebookFilter'] = "No notes created with the current filter"; |
||||
$strings['NoNotebook'] = "No notes created in the system"; |
||||
$strings['NoNotebookUser'] = "No notes for this student"; |
||||
$strings['NotebookNoStudentAssigned'] = "Notes without assigned students"; |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
$strings['plugin_title'] = "Notas profesores"; |
||||
$strings['plugin_comment'] = "Este plugin permite a los profesores de un curso tener un bloc de notas compartido. |
||||
Alumnos no tienen acceso."; |
||||
$strings['NotebookTeacher'] = "Notas profesores"; |
||||
$strings['enable_plugin_notebookteacher'] = "Activar plugin"; |
||||
$strings['ToolDisabled'] = "La herramienta está deshabilitada desde la administración"; |
||||
$strings['ToolForTeacher'] = "Herramienta exclusiva para profesores"; |
||||
$strings['AllStudent'] = "Todos los estudiantes"; |
||||
$strings['StudentFilter'] = "Filtro estudiantes"; |
||||
$strings['NoNotebookFilter'] = "No hay notas creadas con el filtro actual"; |
||||
$strings['NoNotebook'] = "No hay notas creadas en el sistema"; |
||||
$strings['NoNotebookUser'] = "No hay notas para este alumno"; |
||||
$strings['NotebookNoStudentAssigned'] = "Notas sin estudiantes asignados"; |
@ -0,0 +1,16 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
/** |
||||
* This script is a configuration file for the date plugin. |
||||
* You can use it as a master for other platform plugins (course plugins are slightly different). |
||||
* These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins). |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
*/ |
||||
|
||||
/** |
||||
* Plugin details (must be present). |
||||
*/ |
||||
require_once __DIR__.'/config.php'; |
||||
$plugin_info = NotebookTeacherPlugin::create()->get_info(); |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,520 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
use ChamiloSession as Session; |
||||
|
||||
require_once __DIR__.'/../config.php'; |
||||
|
||||
/** |
||||
* This class provides methods for the notebook management. |
||||
* Include/require it in your code to use its features. |
||||
* |
||||
* @author Carlos Vargas <litox84@gmail.com>, move code of main/notebook up here |
||||
* @author Jose Angel Ruiz <desarrollo@nosolored.com>, adaptation for the plugin |
||||
* |
||||
* @package chamilo.library |
||||
*/ |
||||
class NotebookTeacher |
||||
{ |
||||
/** |
||||
* Constructor. |
||||
*/ |
||||
public function __construct() |
||||
{ |
||||
} |
||||
|
||||
/** |
||||
* a little bit of javascript to display a prettier warning when deleting a note. |
||||
* |
||||
* @author Patrick Cool <patrick.cool@ugent.be>, Ghent University, Belgium |
||||
* |
||||
* @version januari 2009, dokeos 1.8.6 |
||||
* |
||||
* @return string |
||||
*/ |
||||
public static function javascriptNotebook() |
||||
{ |
||||
return "<script> |
||||
function confirmation (name) |
||||
{ |
||||
if (confirm(\" ".get_lang("NoteConfirmDelete")." \"+ name + \" ?\")) |
||||
{return true;} |
||||
else |
||||
{return false;} |
||||
} |
||||
</script>"; |
||||
} |
||||
|
||||
/** |
||||
* This functions stores the note in the database. |
||||
* |
||||
* @param array $values |
||||
* @param int $userId Optional. The user ID |
||||
* @param int $courseId Optional. The course ID |
||||
* @param int $sessionId Optional. The session ID |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function saveNote($values, $userId = 0, $courseId = 0, $sessionId = 0) |
||||
{ |
||||
if (!is_array($values) || empty($values['note_title'])) { |
||||
return false; |
||||
} |
||||
|
||||
// Database table definition |
||||
$table = Database::get_main_table(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER); |
||||
$userId = $userId ?: api_get_user_id(); |
||||
$courseId = $courseId ?: api_get_course_int_id(); |
||||
$courseInfo = api_get_course_info_by_id($courseId); |
||||
$courseCode = $courseInfo['code']; |
||||
$sessionId = $sessionId ?: api_get_session_id(); |
||||
$now = api_get_utc_datetime(); |
||||
$params = [ |
||||
'c_id' => $courseId, |
||||
'session_id' => $sessionId, |
||||
'user_id' => $userId, |
||||
'student_id' => intval($values['student_id']), |
||||
'course' => $courseCode, |
||||
'title' => $values['note_title'], |
||||
'description' => $values['note_comment'], |
||||
'creation_date' => $now, |
||||
'update_date' => $now, |
||||
'status' => 0, |
||||
]; |
||||
$id = Database::insert($table, $params); |
||||
|
||||
if ($id > 0) { |
||||
return $id; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* @param int $notebookId |
||||
* |
||||
* @return array|mixed |
||||
*/ |
||||
public static function getNoteInformation($notebookId) |
||||
{ |
||||
if (empty($notebookId)) { |
||||
return []; |
||||
} |
||||
|
||||
// Database table definition |
||||
$tableNotebook = Database::get_main_table(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER); |
||||
$courseId = api_get_course_int_id(); |
||||
|
||||
$sql = "SELECT |
||||
id AS notebook_id, |
||||
title AS note_title, |
||||
description AS note_comment, |
||||
session_id AS session_id, |
||||
student_id AS student_id |
||||
FROM $tableNotebook |
||||
WHERE c_id = $courseId AND id = '".intval($notebookId)."' "; |
||||
$result = Database::query($sql); |
||||
if (Database::num_rows($result) != 1) { |
||||
return []; |
||||
} |
||||
|
||||
return Database::fetch_array($result); |
||||
} |
||||
|
||||
/** |
||||
* This functions updates the note in the database. |
||||
* |
||||
* @param array $values |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function updateNote($values) |
||||
{ |
||||
if (!is_array($values) or empty($values['note_title'])) { |
||||
return false; |
||||
} |
||||
// Database table definition |
||||
$table = Database::get_main_table(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER); |
||||
|
||||
$courseId = api_get_course_int_id(); |
||||
$sessionId = api_get_session_id(); |
||||
|
||||
$params = [ |
||||
'user_id' => api_get_user_id(), |
||||
'student_id' => intval($values['student_id']), |
||||
'course' => api_get_course_id(), |
||||
'session_id' => $sessionId, |
||||
'title' => $values['note_title'], |
||||
'description' => $values['note_comment'], |
||||
'update_date' => api_get_utc_datetime(), |
||||
]; |
||||
|
||||
Database::update( |
||||
$table, |
||||
$params, |
||||
[ |
||||
'c_id = ? AND id = ?' => [ |
||||
$courseId, |
||||
$values['notebook_id'], |
||||
], |
||||
] |
||||
); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* @param int $notebookId |
||||
* |
||||
* @return bool |
||||
*/ |
||||
public static function deleteNote($notebookId) |
||||
{ |
||||
if (empty($notebookId) || $notebookId != strval(intval($notebookId))) { |
||||
return false; |
||||
} |
||||
|
||||
// Database table definition |
||||
$tableNotebook = Database::get_main_table(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER); |
||||
|
||||
$courseId = api_get_course_int_id(); |
||||
|
||||
$sql = "DELETE FROM $tableNotebook |
||||
WHERE |
||||
c_id = $courseId AND |
||||
id = '".intval($notebookId)."' AND |
||||
user_id = '".api_get_user_id()."'"; |
||||
$result = Database::query($sql); |
||||
|
||||
if (Database::affected_rows($result) != 1) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* Display notes. |
||||
*/ |
||||
public static function displayNotes() |
||||
{ |
||||
$plugin = NotebookTeacherPlugin::create(); |
||||
$userInfo = api_get_user_info(); |
||||
if (!isset($_GET['direction'])) { |
||||
$sortDirection = 'ASC'; |
||||
$linkSortDirection = 'DESC'; |
||||
} elseif ($_GET['direction'] == 'ASC') { |
||||
$sortDirection = 'ASC'; |
||||
$linkSortDirection = 'DESC'; |
||||
} else { |
||||
$sortDirection = 'DESC'; |
||||
$linkSortDirection = 'ASC'; |
||||
} |
||||
|
||||
$studentId = isset($_GET['student_id']) ? $_GET['student_id'] : null; |
||||
$sessionId = api_get_session_id(); |
||||
$courseCode = api_get_course_id(); |
||||
$active = isset($_GET['active']) ? $_GET['active'] : null; |
||||
$status = STUDENT; |
||||
$courseInfo = api_get_course_info(); |
||||
$courseId = $courseInfo['real_id']; |
||||
$currentAccessUrlId = api_get_current_access_url_id(); |
||||
$sortByfirstName = api_sort_by_first_name(); |
||||
$type = isset($_REQUEST['type']) ? intval($_REQUEST['type']) : STUDENT; |
||||
|
||||
if (!empty($sessionId)) { |
||||
$tableSessionCourseUser = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
||||
$tableUsers = Database::get_main_table(TABLE_MAIN_USER); |
||||
$isWesternNameOrder = api_is_western_name_order(); |
||||
$sql = "SELECT DISTINCT |
||||
user.user_id, ".($isWesternNameOrder |
||||
? "user.firstname, user.lastname" |
||||
: "user.lastname, user.firstname")." |
||||
FROM $tableSessionCourseUser as session_course_user, |
||||
$tableUsers as user "; |
||||
if (api_is_multiple_url_enabled()) { |
||||
$sql .= ' , '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).' au '; |
||||
} |
||||
$sql .= " WHERE c_id = '$courseId' AND session_course_user.user_id = user.user_id "; |
||||
$sql .= ' AND session_id = '.$sessionId; |
||||
|
||||
if (api_is_multiple_url_enabled()) { |
||||
$sql .= " AND user.user_id = au.user_id AND access_url_id = $currentAccessUrlId "; |
||||
} |
||||
|
||||
// only users no coaches/teachers |
||||
if ($type == COURSEMANAGER) { |
||||
$sql .= " AND session_course_user.status = 2 "; |
||||
} else { |
||||
$sql .= " AND session_course_user.status = 0 "; |
||||
} |
||||
$sql .= $sortByfirstName |
||||
? ' ORDER BY user.firstname, user.lastname' |
||||
: ' ORDER BY user.lastname, user.firstname'; |
||||
|
||||
$rs = Database::query($sql); |
||||
|
||||
$courseUsersList = []; |
||||
while ($row = Database::fetch_assoc($rs)) { |
||||
$courseUsersList[$row['user_id']] = $row; |
||||
} |
||||
} else { |
||||
$courseUsersList = CourseManager::get_user_list_from_course_code( |
||||
$courseCode, |
||||
0, |
||||
null, |
||||
null, |
||||
$status, |
||||
null, |
||||
false, |
||||
false, |
||||
null, |
||||
null, |
||||
null, |
||||
$active |
||||
); |
||||
} |
||||
|
||||
$form = new FormValidator('search_student'); |
||||
|
||||
// Status |
||||
$students = []; |
||||
$students[] = $plugin->get_lang('AllStudent'); |
||||
foreach ($courseUsersList as $key => $userItem) { |
||||
$students[$key] = $userItem['firstname'].' '.$userItem['lastname']; |
||||
} |
||||
|
||||
$form->addElement( |
||||
'select', |
||||
'student_filter', |
||||
$plugin->get_lang('StudentFilter'), |
||||
$students, |
||||
[ |
||||
'id' => 'student_filter', |
||||
'onchange' => 'javascript: filter_student();', |
||||
] |
||||
); |
||||
$user_data = ['student_filter' => $studentId]; |
||||
$form->setDefaults($user_data); |
||||
|
||||
$selectStudent = $form->returnForm(); |
||||
|
||||
// action links |
||||
echo '<div class="actions">'; |
||||
if (!api_is_drh()) { |
||||
if (!api_is_anonymous()) { |
||||
if (api_get_session_id() == 0) { |
||||
echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'. |
||||
Display::return_icon( |
||||
'new_note.png', |
||||
get_lang('NoteAddNew'), |
||||
'', |
||||
'32' |
||||
).'</a>'; |
||||
} elseif (api_is_allowed_to_session_edit(false, true)) { |
||||
echo '<a href="index.php?'.api_get_cidreq().'&action=addnote">'. |
||||
Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>'; |
||||
} |
||||
} else { |
||||
echo '<a href="javascript:void(0)">'. |
||||
Display::return_icon('new_note.png', get_lang('NoteAddNew'), '', '32').'</a>'; |
||||
} |
||||
} |
||||
|
||||
echo '<a href="index.php?'. |
||||
api_get_cidreq(). |
||||
'&action=changeview&view=creation_date&direction='.$linkSortDirection.'&student_id='.$studentId.'">'. |
||||
Display::return_icon('notes_order_by_date_new.png', get_lang('OrderByCreationDate'), '', '32').'</a>'; |
||||
echo '<a href="index.php?'. |
||||
api_get_cidreq(). |
||||
'&action=changeview&view=update_date&direction='.$linkSortDirection.'&student_id='.$studentId.'">'. |
||||
Display::return_icon('notes_order_by_date_mod.png', get_lang('OrderByModificationDate'), '', '32').'</a>'; |
||||
echo '<a href="index.php?'. |
||||
api_get_cidreq(). |
||||
'&action=changeview&view=title&direction='.$linkSortDirection.'&student_id='.$studentId.'">'. |
||||
Display::return_icon('notes_order_by_title.png', get_lang('OrderByTitle'), '', '32').'</a>'; |
||||
|
||||
echo '</div>'; |
||||
echo '<div class="row">'.$selectStudent.'</div>'; |
||||
|
||||
$view = Session::read('notebook_view'); |
||||
if (!isset($view) || |
||||
!in_array($view, ['creation_date', 'update_date', 'title']) |
||||
) { |
||||
Session::write('notebook_view', 'creation_date'); |
||||
} |
||||
|
||||
$view = Session::read('notebook_view'); |
||||
|
||||
// Database table definition |
||||
$tableNotebook = Database::get_main_table(NotebookTeacherPlugin::TABLE_NOTEBOOKTEACHER); |
||||
if ($view == 'creation_date' || $view == 'update_date') { |
||||
$orderBy = " ORDER BY $view $sortDirection "; |
||||
} else { |
||||
$orderBy = " ORDER BY $view $sortDirection "; |
||||
} |
||||
|
||||
//condition for the session |
||||
$session_id = api_get_session_id(); |
||||
$conditionSession = api_get_session_condition($session_id); |
||||
|
||||
$condExtra = $view == 'update_date' ? " AND update_date <> ''" : " "; |
||||
$courseId = api_get_course_int_id(); |
||||
|
||||
if ($studentId > 0) { |
||||
// Only one student |
||||
$conditionStudent = " AND student_id = $studentId"; |
||||
|
||||
$sql = "SELECT * FROM $tableNotebook |
||||
WHERE |
||||
c_id = $courseId |
||||
$conditionSession |
||||
$conditionStudent |
||||
$condExtra $orderBy |
||||
"; |
||||
$first = true; |
||||
$result = Database::query($sql); |
||||
if (Database::num_rows($result) > 0) { |
||||
while ($row = Database::fetch_array($result)) { |
||||
if ($first) { |
||||
$studentText = ''; |
||||
if ($row['student_id'] > 0) { |
||||
$studentInfo = api_get_user_info($row['student_id']); |
||||
$studentText = $studentInfo['complete_name']; |
||||
} |
||||
echo Display::page_subheader($studentText); |
||||
$first = false; |
||||
} |
||||
// Validation when belongs to a session |
||||
$sessionImg = api_get_session_image($row['session_id'], $userInfo['status']); |
||||
$updateValue = ''; |
||||
if ($row['update_date'] != $row['creation_date']) { |
||||
$updateValue = ', '.get_lang('UpdateDate').': '. |
||||
Display::dateToStringAgoAndLongDate($row['update_date']); |
||||
} |
||||
$userInfo = api_get_user_info($row['user_id']); |
||||
$author = ', '.get_lang('Teacher').': '.$userInfo['complete_name']; |
||||
$actions = ''; |
||||
if (intval($row['user_id']) == api_get_user_id()) { |
||||
$actions = '<a href="'. |
||||
api_get_self().'?'. |
||||
api_get_cidreq().'action=editnote¬ebook_id='.$row['id'].'">'. |
||||
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
||||
$actions .= '<a href="'. |
||||
api_get_self(). |
||||
'?action=deletenote¬ebook_id='.$row['id']. |
||||
'" onclick="return confirmation(\''.$row['title'].'\');">'. |
||||
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
||||
} |
||||
echo Display::panel( |
||||
$row['description'], |
||||
$row['title'].$sessionImg.' <div class="pull-right">'.$actions.'</div>', |
||||
get_lang('CreationDate').': '. |
||||
Display::dateToStringAgoAndLongDate($row['creation_date']).$updateValue.$author |
||||
); |
||||
} |
||||
} else { |
||||
echo Display::return_message($plugin->get_lang('NoNotebookUser'), 'warning'); |
||||
} |
||||
} else { |
||||
// All students |
||||
foreach ($courseUsersList as $key => $userItem) { |
||||
$studentId = $key; |
||||
$studentText = $userItem['firstname'].' '.$userItem['lastname']; |
||||
$conditionStudent = " AND student_id = $studentId"; |
||||
|
||||
$sql = "SELECT * FROM $tableNotebook |
||||
WHERE |
||||
c_id = $courseId |
||||
$conditionSession |
||||
$conditionStudent |
||||
$condExtra $orderBy |
||||
"; |
||||
|
||||
$result = Database::query($sql); |
||||
if (Database::num_rows($result) > 0) { |
||||
echo Display::page_subheader($studentText); |
||||
while ($row = Database::fetch_array($result)) { |
||||
// Validation when belongs to a session |
||||
$sessionImg = api_get_session_image($row['session_id'], $userInfo['status']); |
||||
$updateValue = ''; |
||||
|
||||
if ($row['update_date'] != $row['creation_date']) { |
||||
$updateValue = ', '.get_lang('UpdateDate').': '. |
||||
Display::dateToStringAgoAndLongDate($row['update_date']); |
||||
} |
||||
|
||||
$userInfo = api_get_user_info($row['user_id']); |
||||
$author = ', '.get_lang('Teacher').': '.$userInfo['complete_name']; |
||||
|
||||
if (intval($row['user_id']) == api_get_user_id()) { |
||||
$actions = '<a href="'.api_get_self(). |
||||
'?action=editnote¬ebook_id='.$row['id'].'&'.api_get_cidreq().'">'. |
||||
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
||||
$actions .= '<a href="'.api_get_self(). |
||||
'?action=deletenote¬ebook_id='.$row['id']. |
||||
'" onclick="return confirmation(\''.$row['title'].'\');">'. |
||||
Display::return_icon( |
||||
'delete.png', |
||||
get_lang('Delete'), |
||||
'', |
||||
ICON_SIZE_SMALL |
||||
).'</a>'; |
||||
} else { |
||||
$actions = ''; |
||||
} |
||||
|
||||
echo Display::panel( |
||||
$row['description'], |
||||
$row['title'].$sessionImg.' <div class="pull-right">'.$actions.'</div>', |
||||
get_lang('CreationDate').': '. |
||||
Display::dateToStringAgoAndLongDate($row['creation_date']).$updateValue.$author |
||||
); |
||||
} |
||||
} |
||||
} |
||||
|
||||
$conditionStudent = " AND student_id = 0"; |
||||
|
||||
$sql = "SELECT * FROM $tableNotebook |
||||
WHERE |
||||
c_id = $courseId |
||||
$conditionSession |
||||
$conditionStudent |
||||
$condExtra $orderBy |
||||
"; |
||||
|
||||
$result = Database::query($sql); |
||||
if (Database::num_rows($result) > 0) { |
||||
echo Display::page_subheader($plugin->get_lang('NotebookNoStudentAssigned')); |
||||
while ($row = Database::fetch_array($result)) { |
||||
// Validation when belongs to a session |
||||
$sessionImg = api_get_session_image($row['session_id'], $userInfo['status']); |
||||
$updateValue = ''; |
||||
|
||||
if ($row['update_date'] != $row['creation_date']) { |
||||
$updateValue = ', '.get_lang('UpdateDate').': '. |
||||
Display::dateToStringAgoAndLongDate($row['update_date']); |
||||
} |
||||
|
||||
$userInfo = api_get_user_info($row['user_id']); |
||||
$author = ', '.get_lang('Teacher').': '.$userInfo['complete_name']; |
||||
$actions = ''; |
||||
if (intval($row['user_id']) == api_get_user_id()) { |
||||
$actions = '<a href="'.api_get_self(). |
||||
'?action=editnote¬ebook_id='.$row['id'].'&'.api_get_cidreq().'">'. |
||||
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
||||
$actions .= '<a href="'.api_get_self(). |
||||
'?action=deletenote¬ebook_id='.$row['id']. |
||||
'" onclick="return confirmation(\''.$row['title'].'\');">'. |
||||
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
||||
} |
||||
echo Display::panel( |
||||
$row['description'], |
||||
$row['title'].$sessionImg.' <div class="pull-right">'.$actions.'</div>', |
||||
get_lang('CreationDate').': '. |
||||
Display::dateToStringAgoAndLongDate($row['creation_date']).$updateValue.$author |
||||
); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,118 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Plugin class for the NotebookTeacher plugin. |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
* |
||||
* @author Jose Angel Ruiz <desarrollo@nosolored.com> |
||||
*/ |
||||
class NotebookTeacherPlugin extends Plugin |
||||
{ |
||||
const TABLE_NOTEBOOKTEACHER = 'plugin_notebook_teacher'; |
||||
public $isCoursePlugin = true; |
||||
|
||||
protected function __construct() |
||||
{ |
||||
parent::__construct( |
||||
'1.1', |
||||
'Jose Angel Ruiz - NoSoloRed (original author), Julio Montoya', |
||||
[ |
||||
'enable_plugin_notebookteacher' => 'boolean', |
||||
] |
||||
); |
||||
|
||||
$this->isAdminPlugin = true; |
||||
} |
||||
|
||||
/** |
||||
* @return NotebookTeacherPlugin |
||||
*/ |
||||
public static function create() |
||||
{ |
||||
static $result = null; |
||||
|
||||
return $result ? $result : $result = new self(); |
||||
} |
||||
|
||||
/** |
||||
* This method creates the tables required to this plugin. |
||||
*/ |
||||
public function install() |
||||
{ |
||||
//Installing course settings |
||||
$this->install_course_fields_in_all_courses(); |
||||
|
||||
$tablesToBeCompared = [self::TABLE_NOTEBOOKTEACHER]; |
||||
$em = Database::getManager(); |
||||
$cn = $em->getConnection(); |
||||
$sm = $cn->getSchemaManager(); |
||||
$tables = $sm->tablesExist($tablesToBeCompared); |
||||
|
||||
if ($tables) { |
||||
return false; |
||||
} |
||||
|
||||
$srcfile1 = __DIR__.'/../resources/img/64/notebookteacher.png'; |
||||
$srcfile2 = __DIR__.'/../resources/img/64/notebookteacher_na.png'; |
||||
$srcfile3 = __DIR__.'/../resources/img/32/notebookteacher.png'; |
||||
$srcfile4 = __DIR__.'/../resources/img/22/notebookteacher.png'; |
||||
$dstfile1 = __DIR__.'/../../../main/img/icons/64/notebookteacher.png'; |
||||
$dstfile2 = __DIR__.'/../../../main/img/icons/64/notebookteacher_na.png'; |
||||
$dstfile3 = __DIR__.'/../../../main/img/icons/32/notebookteacher.png'; |
||||
$dstfile4 = __DIR__.'/../../../main/img/notebookteacher.png'; |
||||
copy($srcfile1, $dstfile1); |
||||
copy($srcfile2, $dstfile2); |
||||
copy($srcfile3, $dstfile3); |
||||
copy($srcfile4, $dstfile4); |
||||
|
||||
require_once api_get_path(SYS_PLUGIN_PATH).'notebookteacher/database.php'; |
||||
} |
||||
|
||||
/** |
||||
* This method drops the plugin tables. |
||||
*/ |
||||
public function uninstall() |
||||
{ |
||||
// Deleting course settings. |
||||
$this->uninstall_course_fields_in_all_courses($this->course_settings); |
||||
|
||||
$tablesToBeDeleted = [self::TABLE_NOTEBOOKTEACHER]; |
||||
foreach ($tablesToBeDeleted as $tableToBeDeleted) { |
||||
$table = Database::get_main_table($tableToBeDeleted); |
||||
$sql = "DROP TABLE IF EXISTS $table"; |
||||
Database::query($sql); |
||||
} |
||||
$this->manageTab(false); |
||||
} |
||||
|
||||
public function update() |
||||
{ |
||||
$tableNotebookTeacher = self::TABLE_NOTEBOOKTEACHER; |
||||
|
||||
$sql = 'SHOW COLUMNS FROM '.$tableNotebookTeacher.' WHERE Field = "student_id"'; |
||||
$rs = Database::query($sql); |
||||
if (Database::num_rows($rs) === 0) { |
||||
$sql = "ALTER TABLE ".$tableNotebookTeacher." ADD student_id INT( 10 ) UNSIGNED NOT NULL AFTER user_id"; |
||||
Database::query($sql); |
||||
} |
||||
|
||||
$srcfile1 = __DIR__.'/../resources/img/64/notebookteacher.png'; |
||||
$srcfile2 = __DIR__.'/../resources/img/64/notebookteacher_na.png'; |
||||
$srcfile3 = __DIR__.'/../resources/img/32/notebookteacher.png'; |
||||
$srcfile4 = __DIR__.'/../resources/img/22/notebookteacher.png'; |
||||
$dstfile1 = __DIR__.'/../../../main/img/icons/64/notebookteacher.png'; |
||||
$dstfile2 = __DIR__.'/../../../main/img/icons/64/notebookteacher_na.png'; |
||||
$dstfile3 = __DIR__.'/../../../main/img/icons/32/notebookteacher.png'; |
||||
$dstfile4 = __DIR__.'/../../../main/img/notebookteacher.png'; |
||||
copy($srcfile1, $dstfile1); |
||||
copy($srcfile2, $dstfile2); |
||||
copy($srcfile3, $dstfile3); |
||||
copy($srcfile4, $dstfile4); |
||||
|
||||
Display::display_header(get_lang(ucfirst(self::TABLE_NOTEBOOKTEACHER))); |
||||
echo 'Plugin actualizado'; |
||||
Display::display_footer(); |
||||
} |
||||
} |
@ -0,0 +1,394 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
use ChamiloSession as Session; |
||||
|
||||
$course_plugin = 'notebookteacher'; |
||||
require_once __DIR__.'/../config.php'; |
||||
|
||||
$_setting['student_view_enabled'] = 'false'; |
||||
|
||||
$plugin = NotebookTeacherPlugin::create(); |
||||
$current_course_tool = $plugin->get_lang('NotebookTeacher'); |
||||
$enable = $plugin->get('enable_plugin_notebookteacher') == 'true'; |
||||
|
||||
if ($enable) { |
||||
if (api_is_teacher() || api_is_drh()) { |
||||
// The section (tabs) |
||||
$this_section = SECTION_COURSES; |
||||
|
||||
// Notice for unauthorized people. |
||||
api_protect_course_script(true); |
||||
$location = 'index.php?'.api_get_cidreq(); |
||||
|
||||
// Additional javascript |
||||
$htmlHeadXtra[] = NotebookTeacher::javascriptNotebook(); |
||||
$htmlHeadXtra[] = '<script> |
||||
function setFocus(){ |
||||
$("#note_title").focus(); |
||||
} |
||||
$(document).ready(function () { |
||||
setFocus(); |
||||
}); |
||||
|
||||
function filter_student() { |
||||
var student_id = $("#student_filter").val(); |
||||
location.href ="'.$location.'&student_id="+student_id; |
||||
} |
||||
</script>'; |
||||
|
||||
// Setting the tool constants |
||||
$tool = $plugin->get_lang('NotebookTeacher'); |
||||
|
||||
// Tracking |
||||
Event::event_access_tool('notebookteacher'); |
||||
|
||||
$action = isset($_GET['action']) ? $_GET['action'] : ''; |
||||
|
||||
// Tool name |
||||
if ($action === 'addnote') { |
||||
$tool = 'NoteAddNew'; |
||||
$interbreadcrumb[] = [ |
||||
'url' => 'index.php?'.api_get_cidreq(), |
||||
'name' => $plugin->get_lang('NotebookTeacher'), |
||||
]; |
||||
} |
||||
if ($action === 'editnote') { |
||||
$tool = 'ModifyNote'; |
||||
$interbreadcrumb[] = [ |
||||
'url' => 'index.php?'.api_get_cidreq(), |
||||
'name' => $plugin->get_lang('NotebookTeacher'), |
||||
]; |
||||
} |
||||
|
||||
// Displaying the header |
||||
Display::display_header(get_lang(ucfirst($tool))); |
||||
|
||||
// Tool introduction |
||||
Display::display_introduction_section($plugin->get_lang('NotebookTeacher')); |
||||
|
||||
// Action handling: Adding a note |
||||
if ($action === 'addnote') { |
||||
if ((api_get_session_id() != 0 && |
||||
!api_is_allowed_to_session_edit(false, true) || api_is_drh())) { |
||||
api_not_allowed(); |
||||
} |
||||
Session::write('notebook_view', 'creation_date'); |
||||
|
||||
$form = new FormValidator( |
||||
'note', |
||||
'post', |
||||
api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&'.api_get_cidreq() |
||||
); |
||||
// Setting the form elements |
||||
$form->addElement('header', '', get_lang('NoteAddNew')); |
||||
$form->addElement('text', 'note_title', get_lang('NoteTitle'), ['id' => 'note_title']); |
||||
|
||||
$student_id = isset($_GET['student_id']) ? $_GET['student_id'] : null; |
||||
$sessionId = api_get_session_id(); |
||||
$courseCode = api_get_course_id(); |
||||
$active = isset($_GET['active']) ? $_GET['active'] : null; |
||||
$status = STUDENT; |
||||
$course_info = api_get_course_info(); |
||||
$courseId = $course_info['real_id']; |
||||
$current_access_url_id = api_get_current_access_url_id(); |
||||
$sort_by_first_name = api_sort_by_first_name(); |
||||
|
||||
if (!empty($sessionId)) { |
||||
$table_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
||||
$table_users = Database::get_main_table(TABLE_MAIN_USER); |
||||
$sql = "SELECT DISTINCT |
||||
user.user_id, ".($is_western_name_order |
||||
? "user.firstname, user.lastname" |
||||
: "user.lastname, user.firstname")." |
||||
FROM $table_session_course_user as session_course_user, |
||||
$table_users as user "; |
||||
if (api_is_multiple_url_enabled()) { |
||||
$sql .= ' , '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).' au '; |
||||
} |
||||
$sql .= " WHERE c_id = '$courseId' AND session_course_user.user_id = user.user_id "; |
||||
$sql .= ' AND session_id = '.$sessionId; |
||||
|
||||
if (api_is_multiple_url_enabled()) { |
||||
$sql .= " AND user.user_id = au.user_id AND access_url_id = $current_access_url_id "; |
||||
} |
||||
|
||||
// only users no coaches/teachers |
||||
if ($type == COURSEMANAGER) { |
||||
$sql .= " AND session_course_user.status = 2 "; |
||||
} else { |
||||
$sql .= " AND session_course_user.status = 0 "; |
||||
} |
||||
$sql .= $sort_by_first_name |
||||
? ' ORDER BY user.firstname, user.lastname' |
||||
: ' ORDER BY user.lastname, user.firstname'; |
||||
|
||||
$rs = Database::query($sql); |
||||
|
||||
$a_course_users = []; |
||||
while ($row = Database::fetch_assoc($rs)) { |
||||
$a_course_users[$row['user_id']] = $row; |
||||
} |
||||
} else { |
||||
$a_course_users = CourseManager::get_user_list_from_course_code( |
||||
$courseCode, |
||||
0, |
||||
null, |
||||
null, |
||||
$status, |
||||
null, |
||||
false, |
||||
false, |
||||
null, |
||||
null, |
||||
null, |
||||
$active |
||||
); |
||||
} |
||||
|
||||
$studentList = []; |
||||
$studentList[0] = ''; |
||||
foreach ($a_course_users as $key => $user_item) { |
||||
$studentList[$key] = $user_item['firstname'].' '.$user_item['lastname']; |
||||
} |
||||
|
||||
$form->addElement( |
||||
'select', |
||||
'student_id', |
||||
get_lang('Student'), |
||||
$studentList, |
||||
[ |
||||
'id' => 'student_id', |
||||
] |
||||
); |
||||
|
||||
$form->addElement( |
||||
'html_editor', |
||||
'note_comment', |
||||
get_lang('NoteComment'), |
||||
null, |
||||
api_is_allowed_to_edit() |
||||
? ['ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300'] |
||||
: ['ToolbarSet' => 'NotebookStudent', 'Width' => '100%', 'Height' => '300', 'UserStatus' => 'student'] |
||||
); |
||||
$form->addButtonCreate(get_lang('AddNote'), 'SubmitNote'); |
||||
|
||||
// Setting the rules |
||||
$form->addRule('note_title', get_lang('ThisFieldIsRequired'), 'required'); |
||||
|
||||
// The validation or display |
||||
if ($form->validate()) { |
||||
$check = Security::check_token('post'); |
||||
if ($check) { |
||||
$values = $form->exportValues(); |
||||
$res = NotebookTeacher::saveNote($values); |
||||
if ($res) { |
||||
echo Display::return_message(get_lang('NoteAdded'), 'confirmation'); |
||||
} |
||||
} |
||||
Security::clear_token(); |
||||
NotebookTeacher::displayNotes(); |
||||
} else { |
||||
echo '<div class="actions">'; |
||||
echo '<a href="index.php">'. |
||||
Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM). |
||||
'</a>'; |
||||
echo '</div>'; |
||||
$token = Security::get_token(); |
||||
$form->addElement('hidden', 'sec_token'); |
||||
$form->setConstants(['sec_token' => $token]); |
||||
$form->display(); |
||||
} |
||||
} elseif ($action === 'editnote' && is_numeric($_GET['notebook_id'])) { |
||||
// Action handling: Editing a note |
||||
if (!empty($_GET['isStudentView']) || api_is_drh()) { |
||||
NotebookTeacher::displayNotes(); |
||||
exit; |
||||
} |
||||
|
||||
// Initialize the object |
||||
$form = new FormValidator( |
||||
'note', |
||||
'post', |
||||
api_get_self().'?action='.Security::remove_XSS($_GET['action']). |
||||
'¬ebook_id='.intval($_GET['notebook_id']).'&'.api_get_cidreq() |
||||
); |
||||
// Setting the form elements |
||||
$form->addElement('header', '', get_lang('ModifyNote')); |
||||
$form->addElement('hidden', 'notebook_id'); |
||||
$form->addElement('text', 'note_title', get_lang('NoteTitle'), ['size' => '100']); |
||||
|
||||
$sessionId = api_get_session_id(); |
||||
$courseCode = api_get_course_id(); |
||||
$active = isset($_GET['active']) ? $_GET['active'] : null; |
||||
$status = STUDENT; |
||||
$student_id = isset($_GET['student_id']) ? $_GET['student_id'] : null; |
||||
$course_info = api_get_course_info(); |
||||
$courseId = $course_info['real_id']; |
||||
$current_access_url_id = api_get_current_access_url_id(); |
||||
$sort_by_first_name = api_sort_by_first_name(); |
||||
|
||||
if (!empty($sessionId)) { |
||||
$table_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
||||
$table_users = Database::get_main_table(TABLE_MAIN_USER); |
||||
$sql = "SELECT DISTINCT |
||||
user.user_id, ".($is_western_name_order |
||||
? "user.firstname, user.lastname" |
||||
: "user.lastname, user.firstname")." |
||||
FROM $table_session_course_user as session_course_user, |
||||
$table_users as user "; |
||||
if (api_is_multiple_url_enabled()) { |
||||
$sql .= ' , '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).' au '; |
||||
} |
||||
$sql .= " WHERE c_id = '$courseId' AND session_course_user.user_id = user.user_id "; |
||||
$sql .= ' AND session_id = '.$sessionId; |
||||
|
||||
if (api_is_multiple_url_enabled()) { |
||||
$sql .= " AND user.user_id = au.user_id AND access_url_id = $current_access_url_id "; |
||||
} |
||||
|
||||
// only users no coaches/teachers |
||||
if ($type == COURSEMANAGER) { |
||||
$sql .= " AND session_course_user.status = 2 "; |
||||
} else { |
||||
$sql .= " AND session_course_user.status = 0 "; |
||||
} |
||||
$sql .= $sort_by_first_name |
||||
? ' ORDER BY user.firstname, user.lastname' |
||||
: ' ORDER BY user.lastname, user.firstname'; |
||||
|
||||
$rs = Database::query($sql); |
||||
|
||||
$a_course_users = []; |
||||
while ($row = Database::fetch_assoc($rs)) { |
||||
$a_course_users[$row['user_id']] = $row; |
||||
} |
||||
} else { |
||||
$a_course_users = CourseManager::get_user_list_from_course_code( |
||||
$courseCode, |
||||
0, |
||||
null, |
||||
null, |
||||
$status, |
||||
null, |
||||
false, |
||||
false, |
||||
null, |
||||
null, |
||||
null, |
||||
$active |
||||
); |
||||
} |
||||
|
||||
$studentList = []; |
||||
$studentList[0] = ''; |
||||
foreach ($a_course_users as $key => $user_item) { |
||||
$studentList[$key] = $user_item['firstname'].' '.$user_item['lastname']; |
||||
} |
||||
|
||||
$form->addElement( |
||||
'select', |
||||
'student_id', |
||||
get_lang('Student'), |
||||
$studentList, |
||||
[ |
||||
'id' => 'student_id', |
||||
] |
||||
); |
||||
|
||||
$form->addElement( |
||||
'html_editor', |
||||
'note_comment', |
||||
get_lang('NoteComment'), |
||||
null, |
||||
api_is_allowed_to_edit() |
||||
? ['ToolbarSet' => 'Notebook', 'Width' => '100%', 'Height' => '300'] |
||||
: ['ToolbarSet' => 'NotebookStudent', 'Width' => '100%', 'Height' => '300', 'UserStatus' => 'student'] |
||||
); |
||||
$form->addButtonUpdate(get_lang('ModifyNote'), 'SubmitNote'); |
||||
|
||||
// Setting the defaults |
||||
$defaults = NotebookTeacher::getNoteInformation(Security::remove_XSS($_GET['notebook_id'])); |
||||
$form->setDefaults($defaults); |
||||
|
||||
// Setting the rules |
||||
$form->addRule('note_title', get_lang('ThisFieldIsRequired'), 'required'); |
||||
|
||||
// The validation or display |
||||
if ($form->validate()) { |
||||
$check = Security::check_token('post'); |
||||
if ($check) { |
||||
$values = $form->exportValues(); |
||||
$res = NotebookTeacher::updateNote($values); |
||||
if ($res) { |
||||
echo Display::return_message(get_lang('NoteUpdated'), 'confirmation'); |
||||
} |
||||
} |
||||
Security::clear_token(); |
||||
NotebookTeacher::displayNotes(); |
||||
} else { |
||||
echo '<div class="actions">'; |
||||
echo '<a href="index.php">'. |
||||
Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
||||
echo '</div>'; |
||||
$token = Security::get_token(); |
||||
$form->addElement('hidden', 'sec_token'); |
||||
$form->setConstants(['sec_token' => $token]); |
||||
$form->display(); |
||||
} |
||||
} elseif ($action === 'deletenote' && is_numeric($_GET['notebook_id'])) { |
||||
// Action handling: deleting a note |
||||
$res = NotebookTeacher::deleteNote($_GET['notebook_id']); |
||||
if ($res) { |
||||
echo Display::return_message(get_lang('NoteDeleted'), 'confirmation'); |
||||
} |
||||
|
||||
NotebookTeacher::displayNotes(); |
||||
} elseif ($action === 'changeview' && in_array($_GET['view'], ['creation_date', 'update_date', 'title'])) { |
||||
// Action handling: changing the view (sorting order) |
||||
switch ($_GET['view']) { |
||||
case 'creation_date': |
||||
if (!$_GET['direction'] || $_GET['direction'] == 'ASC') { |
||||
echo Display::return_message(get_lang('NotesSortedByCreationDateAsc'), 'confirmation'); |
||||
} else { |
||||
echo Display::return_message(get_lang('NotesSortedByCreationDateDESC'), 'confirmation'); |
||||
} |
||||
break; |
||||
case 'update_date': |
||||
if (!$_GET['direction'] || $_GET['direction'] == 'ASC') { |
||||
echo Display::return_message(get_lang('NotesSortedByUpdateDateAsc'), 'confirmation'); |
||||
} else { |
||||
echo Display::return_message(get_lang('NotesSortedByUpdateDateDESC'), 'confirmation'); |
||||
} |
||||
break; |
||||
case 'title': |
||||
if (!$_GET['direction'] || $_GET['direction'] == 'ASC') { |
||||
echo Display::return_message(get_lang('NotesSortedByTitleAsc'), 'confirmation'); |
||||
} else { |
||||
echo Display::return_message(get_lang('NotesSortedByTitleDESC'), 'confirmation'); |
||||
} |
||||
break; |
||||
} |
||||
Session::write('notebook_view', Security::remove_XSS($_GET['view'])); |
||||
NotebookTeacher::displayNotes(); |
||||
} else { |
||||
NotebookTeacher::displayNotes(); |
||||
} |
||||
|
||||
Display::display_footer(); |
||||
} else { |
||||
$session = api_get_session_entity(api_get_session_id()); |
||||
$_course = api_get_course_info(); |
||||
$web_course_path = api_get_path(WEB_COURSE_PATH); |
||||
$url = $web_course_path.$_course['path'].'/index.php'.($session ? '?id_session='.$session->getId() : ''); |
||||
|
||||
Display::addFlash( |
||||
Display::return_message($plugin->get_lang('ToolForTeacher')) |
||||
); |
||||
|
||||
header('Location: '.$url); |
||||
exit; |
||||
} |
||||
} else { |
||||
echo $plugin->get_lang('ToolDisabled'); |
||||
} |
@ -0,0 +1,33 @@ |
||||
<?php |
||||
/** |
||||
* This script initiates a notebookteacher plugin. |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
*/ |
||||
$course_plugin = 'notebookteacher'; |
||||
require_once __DIR__.'/config.php'; |
||||
|
||||
$plugin = NotebookTeacherPlugin::create(); |
||||
$enable = $plugin->get('enable_plugin_notebookteacher') == 'true'; |
||||
|
||||
if ($enable) { |
||||
if (api_is_teacher() || api_is_drh()) { |
||||
$url = 'src/index.php?'.api_get_cidreq(); |
||||
header('Location: '.$url); |
||||
exit; |
||||
} else { |
||||
$session = api_get_session_entity(api_get_session_id()); |
||||
$_course = api_get_course_info(); |
||||
$webCoursePath = api_get_path(WEB_COURSE_PATH); |
||||
$url = $webCoursePath.$_course['path'].'/index.php'.($session ? '?id_session='.$session->getId() : ''); |
||||
|
||||
Display::addFlash( |
||||
Display::return_message($plugin->get_lang('ToolForTeacher')) |
||||
); |
||||
|
||||
header('Location: '.$url); |
||||
exit; |
||||
} |
||||
} else { |
||||
api_not_allowed(true, $plugin->get_lang('ToolDisabled')); |
||||
} |
@ -0,0 +1,12 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
|
||||
/** |
||||
* This script is included by main/admin/settings.lib.php when unselecting a plugin |
||||
* and is meant to remove things installed by the install.php script in both |
||||
* the global database and the courses tables. |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
*/ |
||||
require_once __DIR__.'/config.php'; |
||||
NotebookTeacherPlugin::create()->uninstall(); |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
/* For license terms, see /license.txt */ |
||||
/** |
||||
* This script is included by main/admin/settings.lib.php and generally |
||||
* includes things to execute in the main database (settings_current table). |
||||
* |
||||
* @package chamilo.plugin.notebookteacher |
||||
*/ |
||||
require_once __DIR__.'/config.php'; |
||||
|
||||
if (!api_is_platform_admin()) { |
||||
die('You must have admin permissions to install plugins'); |
||||
} |
||||
NotebookTeacherPlugin::create()->update(); |
@ -0,0 +1,26 @@ |
||||
v2.1 - 2018-04-05 |
||||
================= |
||||
- Fix: SEPE plugin foreign key constraint fails [#2461](https://github.com/chamilo/chamilo-lms/issues/2461) |
||||
|
||||
##### Database changes |
||||
You need execute these SQL queries in your database. |
||||
|
||||
```sql |
||||
ALTER TABLE plugin_sepe_participants MODIFY company_tutor_id INT( 10 ) UNSIGNED NULL; |
||||
ALTER TABLE plugin_sepe_participants MODIFY training_tutor_id INT( 10 ) UNSIGNED NULL; |
||||
``` |
||||
|
||||
v2.0 - 2017-05-23 |
||||
================= |
||||
This version has been fixed and improved for Chamilo LMS 1.11.x. |
||||
|
||||
Upgrade procedure |
||||
----------------- |
||||
If you are working with this plugin since earlier versions, you will have to |
||||
look at the installer to *fix* your plugin tables (add a few fields). |
||||
|
||||
http://*yourdominio.com*/**plugin/sepe/update.php** |
||||
|
||||
v1.0 - 2016-11-14 |
||||
================= |
||||
This is the first release of the plugin, valid for Chamilo LMS 1.10.x |
@ -1,20 +1,25 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
require_once __DIR__.'/../../../main/inc/global.inc.php'; |
||||
|
||||
api_protect_admin_script(); |
||||
|
||||
$action = isset($_GET['what']) ? $_GET['what'] : ''; |
||||
define('CHAMILO_INTERNAL', true); |
||||
|
||||
$plugin = VChamiloPlugin::create(); |
||||
$thisurl = api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php'; |
||||
|
||||
api_protect_admin_script(); |
||||
|
||||
if ($action === 'syncthis') { |
||||
$res = include_once api_get_path(SYS_PLUGIN_PATH).'vchamilo/views/syncparams.controller.php'; |
||||
if (!$res) { |
||||
echo '<span class="label label-success">Success</span>'; |
||||
} else { |
||||
echo '<span class="label label-danger">Failure<br/>'.$errors.'</span>'; |
||||
} |
||||
switch ($action) { |
||||
case 'syncthis': |
||||
$res = include_once api_get_path(SYS_PLUGIN_PATH).'vchamilo/views/syncparams.controller.php'; |
||||
if (!$res) { |
||||
echo '<span class="label label-success">Success</span>'; |
||||
} else { |
||||
echo '<span class="label label-danger">Failure<br/>'.$errors.'</span>'; |
||||
} |
||||
break; |
||||
} |
||||
|
||||
exit; |
||||
|
Loading…
Reference in new issue