|
|
|
|
|
/home-new/old/wave/learn-french/course-selector/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/home-new/old/wave/learn-french/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<logic:include page="/af/course-selector/style/" />
<logic:variable as="visible_steps" value="[? \Framework\AF\CourseSelector::getVisibleSteps() ?]" />
<logic:variable as="current_step" value="[? \Framework\AF\CourseSelector::getCurrentStep($visible_steps) ?]" />
<logic:variable as="current_step_entity" value="[? \Framework\AF\CourseSelector::getStepEntity($current_step) ?]" />
<logic:variable as="previous_step" value="[? \Framework\AF\CourseSelector::getPreviousStep($visible_steps) ?]" />
<logic:variable as="previous_step_entity" value="[? \Framework\AF\CourseSelector::getStepEntity($previous_step) ?]" />
[? urlCleanup($current_step) ?]
<div id="course_selector">
<logic:variable as="course_selector_title" value="[? \Components\AF\Courses\CollectiveCourses::configGetValue('course_selector_title') ?]" />
<logic:if test="$course_selector_title">
<h1>[? $course_selector_title ?]</h1>
</logic:if>
<logic:if test="count($visible_steps)">
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('#course_selector_current_step_body div.item:not(.noCourses):not(.noHighLight)').click(function(e) {
if(e.target && e.target.nodeName && e.target.nodeName == 'A') {
return;
}
location.href = $('.itemUrl', $(this)).val();
});
});
})(jQuery);
</script>
<logic:if test="\Framework\AF\CourseSelector::hasClickedLink()">
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('html, body').scrollTop($("#course_selector").offset().top - 40);
});
})(jQuery);
</script>
</logic:if>
<div id="course_selector_header">
<data:repeater as="step" datasource="$visible_steps">
<logic:if test="$step['step_title'] == $current_step['step_title']">
<div class="stepTitle currentStep">
<strong>[? $step['step_title'] ?]</strong><br />
<small>[?? \Framework\AF\CourseSelector::renderStepValue($step) ??]</small>
</div>
</logic:if>
<logic:else>
<logic:if test="$step['step_component'] == 'Components\\AF\\Courses\\Configuration\\Levels' && \Components\AF\Courses\Configuration\Levels::configGetValue('course_selector_use_placement_page')">
<logic:variable as="back_url" value="[? \Framework\AF\CourseSelector::makeBackURL($step, ['level_id']) ?]" />
</logic:if>
<logic:else>
<logic:variable as="back_url" value="[? \Framework\AF\CourseSelector::makeBackURL($step) ?]" />
</logic:else>
<a href="[? $back_url ?]">
<div class="stepTitle">
<strong>[? $step['step_title'] ?]</strong><br />
<small>[?? \Framework\AF\CourseSelector::renderStepValue($step) ??]</small>
</div>
</a>
</logic:else>
</data:repeater>
<logic:if test="\Components\AF\Courses\CollectiveCourses::configGetValue('course_selector_show_next_steps')">
<data:repeater as="step" datasource="getRemainingSteps($visible_steps)">
<div class="stepTitle disabled">
<strong>[? $step['step_title'] ?]</strong>
</div>
</data:repeater>
</logic:if>
<div style="clear: both;"></div>
</div>
<div id="course_selector_body">
<logic:if test="\Framework\AF\CourseSelector::getStepIsRecursing($current_step) && $current_step_entity">
<div id="previous_step_description">
<h2>Your previous selection: [? $current_step_entity['name'] ?]</h2>
<logic:if test="getRealLength($current_step_entity['long_description'])">
<logic:parse text="[? $current_step_entity['long_description'] ?]" />
</logic:if>
<logic:else test="\Components\AF\Courses\CollectiveCourses::configGetValue('course_selector_short_description_fallback') && getRealLength($current_step_entity['short_description'])">
<logic:parse text="[? $current_step_entity['short_description'] ?]" />
</logic:else>
<logic:if test="\Components\AF\Courses\Configuration\Levels::configGetValue('course_selector_show_course_material_below_long_description')">
<logic:if test="$current_step['step_component'] == 'Components\\AF\\Courses\\Configuration\\Levels'">
<logic:variable as="books_required" value="[? \Components\AF\Courses\Configuration\Levels\Books::getAllRequiredForLevel($current_step_entity['id'], true) ?]" />
<logic:variable as="books_recommended" value="[? \Components\AF\Courses\Configuration\Levels\Books::getAllRecommendedForLevel($current_step_entity['id'], true) ?]" />
<logic:if test="count($books_required) || count($books_recommended)">
<div style="margin-top: 10px;">
<logic:if test="count($books_required)">
<strong>Required Course Material</strong>
<ul>
<data:repeater as="book" datasource="$books_required">
<li>
[? $book['product_title'] ?] ([?? formatCurrency($book['product_price_base']) ??])
</li>
</data:repeater>
</ul>
</logic:if>
<logic:if test="count($books_recommended)">
<strong>[? \Components\AF\Courses\CollectiveCourses::configGetValue('recommended_course_material_title') ?]</strong>
<ul>
<data:repeater as="book" datasource="$books_recommended">
<li>
[? $book['product_title'] ?] ([?? formatCurrency($book['product_price_base']) ??])
</li>
</data:repeater>
</ul>
</logic:if>
</div>
</logic:if>
</logic:if>
</logic:if>
<div style="clear: both;"></div>
</div>
</logic:if>
<logic:else test="$previous_step_entity">
<div id="previous_step_description">
<h2>Your previous selection: [? $previous_step_entity['name'] ?]</h2>
<logic:if test="getRealLength($previous_step_entity['long_description'])">
<logic:parse text="[? $previous_step_entity['long_description'] ?]" />
</logic:if>
<logic:else test="\Components\AF\Courses\CollectiveCourses::configGetValue('course_selector_short_description_fallback') && getRealLength($previous_step_entity['short_description'])">
<logic:parse text="[? $previous_step_entity['short_description'] ?]" />
</logic:else>
<logic:if test="\Components\AF\Courses\Configuration\Levels::configGetValue('course_selector_show_course_material_below_long_description')">
<logic:if test="$previous_step && $previous_step['step_component'] == 'Components\\AF\\Courses\\Configuration\\Levels'">
<logic:variable as="books_required" value="[? \Components\AF\Courses\Configuration\Levels\Books::getAllRequiredForLevel($previous_step_entity['id'], true) ?]" />
<logic:variable as="books_recommended" value="[? \Components\AF\Courses\Configuration\Levels\Books::getAllRecommendedForLevel($previous_step_entity['id'], true) ?]" />
<logic:if test="count($books_required) || count($books_recommended)">
<div style="margin-top: 10px;">
<logic:if test="count($books_required)">
<strong>Required Course Material</strong>
<ul>
<data:repeater as="book" datasource="$books_required">
<li>
[? $book['product_title'] ?] ([?? formatCurrency($book['product_price_base']) ??])
</li>
</data:repeater>
</ul>
</logic:if>
<logic:if test="count($books_recommended)">
<strong>[? \Components\AF\Courses\CollectiveCourses::configGetValue('recommended_course_material_title') ?]</strong>
<ul>
<data:repeater as="book" datasource="$books_recommended">
<li>
[? $book['product_title'] ?] ([?? formatCurrency($book['product_price_base']) ??])
</li>
</data:repeater>
</ul>
</logic:if>
</div>
</logic:if>
</logic:if>
</logic:if>
<div style="clear: both;"></div>
</div>
</logic:else>
<div id="course_selector_current_step_body">
<logic:include page="[? $current_step['step_page_id'] ?]" />
</div>
</div>
</logic:if>
<logic:else>
<div id="course_selector_body">
<div class="item noCourses" style="color: red; text-align: center;">
<h3>No course is currently available</h3>
</div>
</div>
</logic:else>
</div>
|
|
/* Header */
#course_selector_header { margin-top: 5px; }
#course_selector_header > a:hover { text-decoration: none; color: #fff; }
#course_selector_header div.stepTitle { color: #333!important; text-decoration: none; background-color: white; padding: 0 10px; border-radius: 5px; margin-right: 5px; margin-top: 5px; height: 50px; border: 1px solid #ccc; float: left; padding: 2px 10px 2px 10px; }
#course_selector_header div.stepTitle:not(.currentStep):hover { }
#course_selector_header div.currentStep { color: #fff!important; background-color: #333!important; border: 1px solid #333;}
#course_selector_header div.stepTitle:not(.currentStep):not(.disabled) {border:1px solid #C6F5F5!important;}
#course_selector_header div.stepTitle:not(.currentStep):not(.disabled):hover {color: #333;background-color:#C6F5F5!important;border:1px solid #C6F5F5!important;}
#course_selector_header div.stepTitle.disabled {color: #4c4d4f;background-color: #C6F5F5!important;border: 1px solid #C6F5F5;}
/* Body / Current Step */
#course_selector_body { padding: 0px; font-size: 20px;margin-bottom: 20px;line-height: 22px;}
#course_selector_current_step_body > a:hover { text-decoration: none; }
.commerceProductsOrderBox a div.item {
color: white !important;
background-color:/*#4c4d4f*/ #ED0972!important;
border-radius: 5px !important;
font-size: 15pt!important;
font-family:bpreplaybolditalics,arial!important;
font-weight: normal!important;
line-height:100%!important;}
#course_selector_body div.commerceProductsOrderBox > a:hover { color: #fff; text-decoration: none; }
#course_selector_body div.item { color: #333!important; text-decoration: none; background-color: white; padding: 25px 10px; border-radius:0; margin-right: 5px; box-shadow: none; margin: 0px; border:0; border-top: 2px solid #C6F5F5!important;}
#course_selector_body div.item:last-child { border-bottom: 2px solid #C6F5F5; }
#course_selector_body div.item:not(.noCourses):not(.noHighlight):hover { cursor: pointer; color: #333;/* color: #fff;*/ background-color: /*#4c4d4f*/ #C6F5F5!important; }
#course_selector_body div.item:not(.noCourses):not(.noHighlight):hover .coursesCount { color:#333!important; }
#course_selector_body div.item:not(.noCourses):not(.noHighlight):hover a { color: /*#fff #ff3399*/ #e21837; text-decoration: underline; }
#course_selector_body div.item.noCourses { background-color: #C6F5F5; }
#course_selector_body div.item div.itemBody.hasPicture { margin-left: 2%;box-sizing: border-box; }
#course_selector_body div.item div.itemBody div.coursesCount { float: right;font-size: 14px; }
#course_selector_body div.item.noCourses div.coursesCount { color: #333!important; }
#course_selector_body div.item div.itemPicture
{
float: left;
background-position-x: 50%;
background-size: [? \Components\Settings\ConfigurationItems::getValue('\Components\AF\Courses\CollectiveCourses', 'course_selector_image_width') ?]px auto;
background-repeat: no-repeat;
border-radius: 75px;
max-width: 150px;
box-sizing: border-box;
width: [? \Components\Settings\ConfigurationItems::getValue('\Components\AF\Courses\CollectiveCourses', 'course_selector_image_width') ?]px;
height: [? \Components\Settings\ConfigurationItems::getValue('\Components\AF\Courses\CollectiveCourses', 'course_selector_image_height') ?]px;
}
/* Selection / Previous Step */
#previous_step_description { padding: 0px; padding-top: 10px; border:0; border-top: 2px solid #C6F5F5; }
#course_selector_current_step_body { margin-top: 20px; padding: 0px; }
/* Schedules Step */
ul.coursesList { padding-left: 0px; display: none; list-style-type: none; }
ul.coursesList li { margin: 0px; }
ul.coursesList li > a:hover { text-decoration: none; }
ul.coursesList div.placesLeft { float: right; color: #ff0099;}
ul.coursesList div.item:not(.noCourses):not(.noHighlight):hover div.placesLeft { color: #fff; }
#course_selector_body ul.coursesList div.item { border: 1px solid #dfdfdf; box-shadow: none; }
#schedules_list div.item { cursor: pointer; }
/* Overrides */
#course_selector h1 { font-family: 'Asap', sans-serif!important;font-weight: 300;font-size:35px;margin:20px 0;text-transform:none;font-style: italic;/* font-size: 15pt; font-family:bpreplaybolditalics,arial; font-weight: normal; line-height:100%;*/ }
#course_description_table { box-shadow:0 0 0 0;}
#course_selector h2 { font-family: 'louis_george_cafebold'!important; font-size: 28px;line-height:32px; margin-bottom:10px;font-style: normal;}
/* Break points screen */
@media screen and (max-width:992px){
.#course_selector_body div.item div.itemPicture{
width: 75px;
}
}
|
|
<?php
set_time_limit(10);
\Framework\Assets\JavaScript::includeJQuery(true);
function getRemainingSteps($arrVisibleSteps)
{
$arrRemainingSteps = [];
foreach(\Framework\AF\CourseSelector::getAvailableSteps() as $arrStep)
{
if(!in_array($arrStep, $arrVisibleSteps))
{
$arrRemainingSteps[] = $arrStep;
}
}
return $arrRemainingSteps;
}
function getRealLength($strVar)
{
// Because of a bug in the HTML Editor inserting the ​ character
return strlen(trim(strip_tags(str_replace('​', '', $strVar))));
}
function urlCleanup($arrCurrentStep)
{
$iInitialCount = count($_GET);
if($iInitialCount)
{
$arrParametersToClean = ['new_student', 'needs_test', 'reenroll'];
if($arrCurrentStep && $arrCurrentStep['step_title'] !== 'Level' && \Components\AF\Courses\Configuration\Levels::configGetValue('course_selector_use_placement_page'))
{
foreach($arrParametersToClean as $strParameter)
{
if(array_key_exists($strParameter, $_GET))
{
unset($_GET[$strParameter]);
}
}
if(count($_GET) !== $iInitialCount)
{
$arrQueryString = [];
foreach($_GET as $strKey => $strValue)
{
$arrQueryString[] = urlencode($strKey) . '=' . urlencode($strValue);
}
$strQueryString = '';
if(count($arrQueryString))
{
$strQueryString = '?' . implode('&', $arrQueryString);
}
\Framework\HTTP\Redirection::redirect(\Components\Website\Pages::currentPageId() . $strQueryString);
}
}
}
}
?>
|
|
|