Skip to content

Commit

Permalink
add btn suscriber in about course - refs BT#7683
Browse files Browse the repository at this point in the history
  • Loading branch information
aragonc committed Jun 13, 2018
1 parent ff1c3f5 commit 5cf8168
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion main/course_info/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
require_once __DIR__.'/../inc/global.inc.php';

$courseId = isset($_GET['course_id']) ? intval($_GET['course_id']) : 0;

$token = Security::get_existing_token();
$em = Database::getManager();
//userID
$user_id = api_get_user_id();
Expand Down Expand Up @@ -163,6 +163,7 @@
$essence = Essence\Essence::instance();
$template->assign('essence', $essence);
$template->assign('is_premium', $courseIsPremium);
$template->assign('token', $token);
$template->assign('url', $urlCourse);
$layout = $template->get_template('course_home/about.tpl');
$content = $template->fetch($layout);
Expand Down
19 changes: 14 additions & 5 deletions main/template/default/course_home/about.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,20 @@
<div class="panel panel-default">
<div class="panel-body">
{% if is_premium == false %}
{% if course.subscription %}
<div class="buy-box">
<a href="{{ _p.web }}courses/{{ course.code }}/index.php?id_session=0" class="btn btn-lg btn-success btn-block">{{ 'SignInCourse'|get_lang }}</a>
</div>
{% endif %}
<h5>{{ 'CourseSubscription'|get_lang }}</h5>
<div class="session-subscribe">
{% if _u.logged == 0 %}
{% if 'allow_registration'|api_get_setting != 'false' %}
<a href="{{ _p.web_main ~ 'auth/inscription.php' ~ redirect_to_session }}" class="btn btn-success btn-block btn-lg">
<i class="fa fa-pencil" aria-hidden="true"></i> {{ 'SignUp'|get_lang }}
</a>
{% endif %}
{% elseif course.subscription %}
<a href="{{ _p.web }}courses/{{ course.code }}/index.php?id_session=0" class="btn btn-lg btn-success btn-block">{{ 'CourseHomepage'|get_lang }}</a>
{% else %}
<a href="{{ _p.web }}courses/{{ course.code }}/index.php?action=subscribe&sec_token={{ token }}" class="btn btn-lg btn-success btn-block">{{ 'Subscribe'|get_lang }}</a>
{% endif %}
</div>
{% else %}
<div class="session-price">
<div class="sale-price">
Expand Down

0 comments on commit 5cf8168

Please sign in to comment.