Add terms page and link from personal_data.php see #2553
	
		
	
				
					
				
			
							parent
							
								
									979186807e
								
							
						
					
					
						commit
						0483dcf95f
					
				@ -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); | 
				
			||||
@ -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…
					
					
				
		Reference in new issue