Skip to content

Commit

Permalink
cleanup featured courses
Browse files Browse the repository at this point in the history
Signed-off-by: Kipruto <[email protected]>
  • Loading branch information
kelvinkipruto committed Nov 10, 2023
1 parent 42c8f7e commit 8197060
Showing 1 changed file with 2 additions and 188 deletions.
190 changes: 2 additions & 188 deletions wp-content/themes/academyAfrica/includes/widgets/featured_courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function get_name()

public function get_style_depends()
{
return ['academy-africa-featured-courses','academy-africa-learndash-course-grid'];
return ['academy-africa-featured-courses', 'academy-africa-learndash-course-grid'];
}

public function get_script_depends()
Expand All @@ -36,40 +36,6 @@ public function get_categories()
return ['academy-africa'];
}

public function concatenate_with_count($array)
{
$count = count($array);
return $count === 0 ? '' : ($count === 1 ? $array[0] : $array[0] . ' + ' . ($count - 1) . ' more');
}


public function get_courses()
{
return [
[
'title' => 'Introduction to Data Visualisation with Flourish',
'providers' => ['code for africa'],
'students_count' => 75,
'price' => 'Free',
'image' => '/wp-content/plugins/academy-africa/includes/assets/images/user.svg',
],
[
'title' => 'Fact-checking for Social Media',
'providers' => ['pesacheck'],
'students_count' => 75,
'price' => 'Free',
'image' => '/wp-content/plugins/academy-africa/includes/assets/images/user.svg',
],
[
'title' => 'Drone Journalism',
'providers' => ['Sensors Africa', 'pesacheck', 'code for africa'],
'students_count' => 75,
'price' => 'Free',
'image' => '/wp-content/plugins/academy-africa/includes/assets/images/user.svg',
],
];;
}

protected function register_controls()
{
$this->start_controls_section(
Expand Down Expand Up @@ -200,48 +166,12 @@ protected function register_controls()
$this->end_controls_section();
}

public function get_current_user()
{
return [
'first_name' => 'First Name Middle Name',
'last_name' => 'Last Name'
];
}

public function get_academy_head()
{
return [
'name' => 'First Name Middle Name',
'role' => 'Academy Head',
'signature' => '/wp-content/plugins/academy-africa/includes/assets/images/signature.png',
'date' => 'MM/DD/YYYY',
];
}


protected function render()
{
// $course_list = do_shortcode('[ld_course_list array=true]');
// print_r($course_list);

$settings = $this->get_settings_for_display();
$courses = $this->get_courses();
$title = $settings['title'];
$description = $settings['description'];
$courses_link_label = $settings['link_to_courses_label'];
$courses_link_url = $settings['link_to_courses'];
$want_to_learn = $settings['want_to_learn'];
$banner_description = $settings['banner_description'];
$certificate_course = $settings['certificate_course'];
$certificate_description = $settings['certificate_description'];
$presented_to = $settings['presented_to'];
$certificate_type = $settings['certificate_type'];
$certificate_title = $settings['certificate_title'];
$user = $this->get_current_user();
$art_board = "/wp-content/plugins/academy-africa/includes/assets/images/artboard.png";
$company_image = "/wp-content/plugins/academy-africa/includes/assets/images/cfa_bw.png";
$company_name = "academy.Africa";
$academy_head = $this->get_academy_head();
?>
<div class="featured-courses">
<div class="title-description">
Expand All @@ -257,122 +187,6 @@ protected function render()
<?php echo do_shortcode('[learndash_course_grid taxonomies="ld_course_tag:featured" id="featured" columns="3" skin="grid" card="grid-1" per_page="3" filter="false" progress_bar="" pagination="" button="" ]'); ?>

</div>
<!-- Fetch from Learndash -->
<!-- <div class="neutral-bg">
<div class="content">
<?
if (!empty($courses)) {
foreach ($courses as $course) {
$title = $course['title'];
$provider = $this->concatenate_with_count($course['providers']);
$student_count = $course['students_count'];
$price = $course['price'];
?>
<div class="card">
<img alt="course-logo" class="logo" src="/wp-content/plugins/academy-africa/includes/assets/images/course-image.png" />
<div class="card-content">
<div class="card-title">
<p>
<?php echo $title; ?>
</p>
</div>
<p class="provider">
by <?php echo $provider; ?>
</p>
<div class="card-footer">
<div class="student-count">
<img alt="user" src="/wp-content/plugins/academy-africa/includes/assets/images/user.svg" />
<span><?php echo $student_count; ?></span>
</div>
<div class="tag free">
<?php echo $price; ?>
</div>
</div>
</div>
</div>
<?
}
}
?>
</div>
</div> -->
<!-- Fetch from Learndash -->
</div>
<!-- <div class="neutral-bg">
<div class="certificate-showcase">
<div class="certificate">
<div class="certificate-content">
<hr>
</hr>
<div class="flex-items">
<div style="flex: 1">
<p class="certificate-of">
<? echo $certificate_title ?>
</p>
<p class="certificate-type">
<? echo $certificate_type ?>
</p>
<hr>
</hr>
</div>
<div class="cert-logo">
<svg width="90" height="91" viewBox="0 0 90 91" fill="#000" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="0.363281" y="0.257812" width="89.4864" height="89.8571" fill="url(#pattern0)" style="mix-blend-mode:difference" />
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_11038_43255" transform="matrix(0.00850969 0 0 0.00847458 -0.0063263 0)" />
</pattern>
<image id="image0_11038_43255" width="119" height="118" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAAB2CAYAAADyZQwvAAAACXBIWXMAAAsSAAALEgHS3X78AAAT4ElEQVR4nN1d67XjuA3+Jmf/rzqIUkGcCsKtIO4gSgfuYJUK4lQQTQXxVrDaCtbpgFvBeir48oPEkJL5gGTZ1h2cg3OvJT5AAAQBUoI+kcQ3Ag2AQ/QX0e8c3ABc/f92hh8ePn1Q4TYADJzw5O/30f1f/F+LsqBaj8i0cfU4VtrZJXwk4R7hBGkA/NlfiwVg4YTwKBgEoRsAf/XXf/PtX/zf2wZ9PRX2LtxjhN8D+B8Cc8cX0iEW4ogg7J8ADJ6eXcIehdsC6Dz+EU6gAxwT7XtImkCDoHB/A/AFjr4z9kFfAJJ7wQPJgQ4syZ5kuwO6StiQPHl6SXIkaXZAF0juQrjGM4UkryS7HdC0Bo/ROHYh5D+80Wi0cObsZ//7B7i1bXiw3Q7O2SGcmWwz5Rq4dZseuwf7vcCtyz/43z/79s2D7a6Gd6y5DYATgB/hPNATtnNKGjiBxiHNb0ivhS3cmh7DXxDi3kfBAOjhHLDPcON8qYf9auEauJnZwA38vKBu5+s0vo0TQmhkcB+nCnzJ9HNECKnm5SW2lb8nhJk9eDqW0C39n/C4ZdLDi+x/Q/Ls16OL/72kfss8XOkcsc6vc+fo3o3OUcvRdIvKDr5+59u4Fvpcup7G4x9XjH8VvkKwBzpv8kbndKxRjD7B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5Ai/ABhhqMs9+SuLvLlDcAfkI9MYhGubSMvCA/FgNH7zzB2WdFuweE5CVmAT062MoEJHDwpqlXlDUeW043E8T8Npwm/NCY7lFhFmVZqLXV+X4HBm+3Y4jhR99WE42ltjR1Ud3V4U4JnylcMKxDawbQMjgYggKa+M+y7qHKxkKNFsspCC2Doo9Un4Ovr1HS3QoXDI+DLtmmmzOj5z2cWX93phYvS0jVL+z7wnWv0ZgHebE74QqT4tBnzSzOwZVuJnSeefFOUMn7bDi1BoOv3zFsUebAPDD+ccX4V6F8NOpVYBC+rdNjWV7kztdpEDLRGUwTgn6fqJfL7n5EyFs8Lz/P6nZCyMp+RiX9fIJu6f+EF2a2e7VwgZDD8Ue4NHYnbPc5FkmdFwv5N6TT6bW4T7f/p0zZNWDglOCvcJ7zCa/OKPsK85DBltNz06WmLocdg7m1rL+BJ9Bt1L/h1IvebFNiKb5TuClmXDdk8qtRtjtFqObdNL3ro1ExjHAm7C9wa9x/ELKztu8hSQ0tnLm1AP7rr/2AbXNTr4Z3rLk1aOGckA4hW/oAty7b95A0gQbOGTvC7Up9QfhukH0bVQnYo3BjOEYoeZsvuP/S57NBckcfEZKB/4SgdLuEvQs3BklYbRBCmDjzuMU2Ajdw1qP1/4swf0P44shuBRrDRxJuDHGaefkbhz+/+L8WZVPZIqzrqTbi7xOU2tklfFThpkBS8MtfRL9zcEM4ibEz/PDwf3G5NF3FPr3bAAAAAElFTkSuQmCC" />
</defs>
</svg>
</div>

</div>
<div class="course-details">
<div class="student">
<p class="title"><? echo $presented_to ?></p>
<p class="first-name">
<? echo $user['first_name'] ?>
</p>
<p class="last-name"><? echo $user['last_name'] ?></p>
</div>
<div class="course">
<p class="course-description">
<? echo $certificate_description ?>
</p>
<p class="course-name">
<? echo $certificate_course ?>
</p>
</div>
</div>
</div>
<div class="certificate-footer">
<img height="40px" width="40px" alt="logo" src="<? echo $art_board ?>" />
<p class="company-name">
<? echo $company_name ?>
</p>
<img alt="artwork" src="<? echo $company_image ?>" />
<div class="signature">
<img alt="signature" alt="<? echo $academy_head['name'] ?>" src="<? echo $academy_head['signature'] ?>" />
<p class="signee-name"><? echo $academy_head['name'] ?></p>
<p class="signee-role"><? echo $academy_head['role'] ?></p>
<p class="sign-date"><? echo $academy_head['date'] ?></p>
</div>
</div>
</div>
<div class="certificate-showcase-content">
<p class="showcase-text">
<? echo $banner_description ?>
</p>
<p class="course-text">
<? echo $want_to_learn ?>
</p>
<a class="all-courses" href="<?php echo $courses_link_url; ?>">
<? echo $courses_link_label ?>
</a>
</div>
</div>
</div> -->
<?
<?
}
}

0 comments on commit 8197060

Please sign in to comment.