summaryrefslogtreecommitdiff
path: root/public/app/views/components/lessons_list.php
blob: a778d5932269c083a8f6fe1b7a765f6e1819bfa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php 
/** lessons list
 * -----------------------------------------------------------------------------
 * 
 * imported variables:
 * ---
 * @param $lessons : array of lessons
 * @param $fieldset : array of optional fields to show [category, intro, date]
 * 
 * example call:
 * ---
 * Render::template("sections/articles_list.php",[
 *      'articles' => $category_tree,
 *      'fieldset' => ['date', 'intro']
 * ])
 * -----------------------------------------------------------------------------
 */
?>


<?php foreach($lessons as $post) : ?>

    <!-- <div class="col-xl-4 col-lg-6"> -->
        <div class="post-card">

            <?php if (in_array('date', $fieldset)) : ?>
                <?=$post['date']?>
            <?php endif; ?>

            <div class="post-card--content">

                <h3>
                    <a href="/lesson/<?=$post['id']?>"><?=$post['title']?></a>
                </h3>

                <?php if (in_array('level', $fieldset)) : ?>
                    <p class="getegory">(επίπεδο πρόσβασης <?=$post['privilege_id']?>)</p>
                <?php endif; ?>

                <?php if (in_array('category', $fieldset)) : ?>
                    <p class="category"><?=$post['course_id']?></p>
                <?php endif; ?>

                <?php if (in_array('intro', $fieldset) && $post['intro']) : ?>
                    <p class="intro"><?=$post['intro']?></p>
                <?php endif; ?>

            </div>

        </div>               
    <!-- </div> -->

<?php endforeach; ?>