Add terms page and link from personal_data.php see #2553

pull/2624/head
Julio Montoya 7 years ago
parent 979186807e
commit 0483dcf95f
  1. 8
      main/social/personal_data.php
  2. 54
      main/social/terms.php
  3. 13
      main/template/default/macro/macro.tpl
  4. 5
      main/template/default/social/personal_data.tpl
  5. 18
      main/template/default/social/terms.tpl

@ -11,6 +11,7 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users();
if (!api_get_configuration_value('enable_gdpr')) {
api_not_allowed(true);
}
@ -160,6 +161,12 @@ if ($actions) {
$tpl->assign('actions', Display::toolbarAction('toolbar', [$actions]));
}
$termLink = '';
if (api_get_setting('allow_terms_conditions') === 'true') {
$url = api_get_path(WEB_CODE_PATH).'social/terms.php';
$termLink = Display::url($url, $url);
}
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'messages');
if (api_get_setting('allow_social_tool') === 'true') {
@ -170,5 +177,6 @@ if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('personal_data_block', $personalDataContent);
}
$tpl->assign('term_link', $termLink);
$socialLayout = $tpl->get_template('social/personal_data.tpl');
$tpl->display($socialLayout);

@ -0,0 +1,54 @@
<?php
/* For licensing terms, see /license.txt */
$cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
if (api_get_setting('allow_terms_conditions') !== 'true') {
api_not_allowed(true);
}
api_block_anonymous_users();
$language = api_get_interface_language();
$language = api_get_language_id($language);
$term = LegalManager::get_last_condition($language);
if (!$term) {
// look for the default language
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$term = LegalManager::get_last_condition($language);
}
$socialMenuBlock = '';
$allowSocial = api_get_setting('allow_social_tool') === 'true';
if ($allowSocial) {
// Block Social Menu
$socialMenuBlock = SocialManager::show_social_menu('personal-data');
}
$tpl = new Template(null);
$actions = Display::url(
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'social/personal_data.php'
);
$tpl->assign('actions', Display::toolbarAction('toolbar', [$actions]));
// Block Social Avatar
SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'messages');
if (api_get_setting('allow_social_tool') === 'true') {
$tpl->assign('social_menu_block', $socialMenuBlock);
} else {
$tpl->assign('social_menu_block', '');
}
$tpl->assign('term', $term);
$socialLayout = $tpl->get_template('social/terms.tpl');
$tpl->display($socialLayout);

@ -90,4 +90,17 @@
</div>
</div>
</div>
{% endmacro %}
{% macro panel(name, content, footer = '') %}
<div class="panel panel-default">
<div class="panel-heading"> {{ name }}</div>
<div class="panel-body">
{{ content }}
</div>
{% if footer %}
<div class="panel-footer">{{ footer }}</div>
{% endif %}
</div>
{% endmacro %}

@ -1,4 +1,5 @@
{% extends 'layout/layout_1_col.tpl'|get_template %}
{% import 'macro/macro.tpl'|get_template as display %}
{% block content %}
<div class="row">
@ -74,6 +75,10 @@
</div>
</div>
{% endif %}
{% if term_link %}
{{ display.panel('TermsAndConditions'|get_lang, term_link ) }}
{% endif %}
</div>
</div>
{% endblock %}

@ -0,0 +1,18 @@
{% extends 'layout/layout_1_col.tpl'|get_template %}
{% import 'macro/macro.tpl'|get_template as display %}
{% block content %}
<div class="row">
<div class="col-md-3">
<div class="social-network-menu">
{{ social_avatar_block }}
{{ social_menu_block }}
</div>
</div>
<div class="col-md-9">
{% if term %}
{{ display.panel('TermsAndConditions'|get_lang, term.content, term.date | api_get_local_time ) }}
{% endif %}
</div>
</div>
{% endblock %}
Loading…
Cancel
Save