aboutsummaryrefslogtreecommitdiff
path: root/public/w/home.php
blob: 4966c624b143954a9a6d42a9333b9ed64111e4d0 (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
55
56
57
<?php


$aff->header();

echo '<section class="home">';


if ($app->session() >= $app::EDITOR) {

    $app->bddinit($config);
    $opt = new Opt(Art::classvarlist());

    if(!empty($_GET)) {
    
            $_SESSION['opt'] = $_GET;
            $opt->hydrate($_GET);

    }
    if(isset($_GET['submit']) && $_GET['submit'] == 'reset') {
        $opt = new Opt(Art::classvarlist());
    } else {
        $opt->hydrate($_SESSION['opt']);

    }

    $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure']);
    $table = $app->getlisteropt($opt);
    $app->listcalclien($table);
    $opt->settaglist($table);
    $opt->setcol(['id', 'tag', 'lien', 'contenu', 'intro', 'titre', 'datemodif', 'datecreation', 'secure', 'liento']);

    $aff->option($app, $opt);

    $filtertagfilter = $app->filtertagfilter($table, $opt->tagfilter(), $opt->tagcompare());
    $filtersecure = $app->filtersecure($table, $opt->secure());

    $filter = array_intersect($filtertagfilter, $filtersecure);
    $table2 = [];
    foreach ($table as $art) {
        if (in_array($art->id(), $filter)) {
            $table2[] = $art;
        }
    }

    $app->artlistsort($table2, $opt->sortby(), $opt->order());



    $aff->home2table($app, $table2);
}



echo '</section>';

?>