parent
							
								
									28e3726acc
								
							
						
					
					
						commit
						001b1a078a
					
				@ -0,0 +1,47 @@ | 
				
			||||
<?php | 
				
			||||
/* For license terms, see /license.txt */ | 
				
			||||
/** | 
				
			||||
 * A script to render all mails templates | 
				
			||||
 * @package chamilo.plugin.advanced_subscription | 
				
			||||
 */ | 
				
			||||
 | 
				
			||||
require_once __DIR__ . '/../config.php'; | 
				
			||||
 | 
				
			||||
// Protect test | 
				
			||||
api_protect_admin_script(); | 
				
			||||
 | 
				
			||||
$data['action'] = 'confirm'; | 
				
			||||
$data['currentUserId'] = 1; | 
				
			||||
$data['queueId'] = 0; | 
				
			||||
$data['is_connected'] = true; | 
				
			||||
$data['profile_completed'] = 90.0; | 
				
			||||
$data['sessionId'] = intval($_REQUEST['s']); | 
				
			||||
$data['studentUserId'] = intval($_REQUEST['u']); | 
				
			||||
$data['student'] = UserManager::get_user_info_by_id($data['studentUserId']); | 
				
			||||
$data['session'] = api_get_session_info($data['sessionId']); | 
				
			||||
 | 
				
			||||
if (!empty($data['sessionId']) && !empty($data['studentUserId'])) { | 
				
			||||
    $plugin = AdvancedSubscriptionPlugin::create(); | 
				
			||||
 | 
				
			||||
    if (api_get_plugin_setting('courselegal', 'tool_enable')) { | 
				
			||||
        $courseLegal = CourseLegalPlugin::create(); | 
				
			||||
        $courses = SessionManager::get_course_list_by_session_id($data['sessionId']); | 
				
			||||
        $course = current($courses); | 
				
			||||
        $data['courseId'] = $course['id']; | 
				
			||||
        $data['course'] = api_get_course_info_by_id($data['courseId']); | 
				
			||||
        $termsAndConditions = $courseLegal->getData($data['courseId'], $data['sessionId']); | 
				
			||||
        $termsAndConditions = $termsAndConditions['content']; | 
				
			||||
        $termsAndConditions = $plugin->renderTemplateString($termsAndConditions, $data); | 
				
			||||
        $tpl = new Template($plugin->get_lang('Terms')); | 
				
			||||
        $tpl->assign('session', $data['session']); | 
				
			||||
        $tpl->assign('student', $data['student']); | 
				
			||||
        $tpl->assign('sessionId', $data['sessionId']); | 
				
			||||
        $tpl->assign('termsContent', $termsAndConditions); | 
				
			||||
        $termsAndConditions = $tpl->fetch('/advanced_subscription/views/terms_and_conditions_to_pdf.tpl'); | 
				
			||||
        $pdf = new PDF(); | 
				
			||||
        $filename = 'terms' . sha1(rand(0,99999)); | 
				
			||||
        $pdf->content_to_pdf($termsAndConditions, null, $filename, null, 'F'); | 
				
			||||
        $fileDir = api_get_path(WEB_ARCHIVE_PATH) . $filename . '.pdf'; | 
				
			||||
        echo '<pre>', print_r($fileDir, 1), '</pre>'; | 
				
			||||
    } | 
				
			||||
} | 
				
			||||
@ -0,0 +1,23 @@ | 
				
			||||
{# start copy from head.tpl #} | 
				
			||||
<meta charset="{{ system_charset }}" /> | 
				
			||||
<link href="http://www.chamilo.org/documentation.php" rel="help" /> | 
				
			||||
<link href="http://www.chamilo.org/team.php" rel="author" /> | 
				
			||||
<link href="http://www.chamilo.org" rel="copyright" /> | 
				
			||||
{{ prefetch }} | 
				
			||||
{{ favico }} | 
				
			||||
{{ browser_specific_head }} | 
				
			||||
<link rel="apple-touch-icon" href="{{ _p.web }}apple-touch-icon.png" /> | 
				
			||||
<link href="{{ _p.web_plugin }}advanced_subscription/views/css/style.css" rel="stylesheet" type="text/css"> | 
				
			||||
<meta name="apple-mobile-web-app-capable" content="yes" /> | 
				
			||||
<meta name="Generator" content="{{ _s.software_name }} {{ _s.system_version|slice(0,1) }}" /> | 
				
			||||
{#  Use the latest engine in ie8/ie9 or use google chrome engine if available  #} | 
				
			||||
{#  Improve usability in portal devices #} | 
				
			||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | 
				
			||||
<title>{{ title_string }}</title> | 
				
			||||
{{ css_file_to_string }} | 
				
			||||
{{ css_style_print }} | 
				
			||||
{{ js_file_to_string }} | 
				
			||||
{# end copy from head.tpl #} | 
				
			||||
<div class="legal-terms-popup"> | 
				
			||||
    {{ termsContent }} | 
				
			||||
</div> | 
				
			||||
					Loading…
					
					
				
		Reference in new issue