Overview
SHA1:313fc97f1eb6939117c70bdfcc3c2c02bf79b551
Date: 2017-09-25 23:22:55
User: bohwaz
Comment:Afficher le bon lien selon si rubrique/article
Timelines: family | ancestors | descendants | both | dev
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2017-10-02
00:48
[9211225bb1] Correction recherche de membre (user: bohwaz, tags: dev)
2017-09-25
23:22
[313fc97f1e] Afficher le bon lien selon si rubrique/article (user: bohwaz, tags: dev)
23:18
[46450d34f2] rubrique = page wiki avec 1 ou plus pages enfant qui sont lisibles sur le site article = page wiki avec zéro page enfant lisible sur le site (user: bohwaz, tags: dev)
Changes

Modified src/include/lib/Garradin/Wiki.php from [a7fb957d19] to [ea67414504].

373
374
375
376
377
378
379







380
381
382
383
384
385
386
                strftime(\'%%s\', date_creation) AS date_creation,
                strftime(\'%%s\', date_modification) AS date_modification
                FROM wiki_pages
                WHERE parent = ? AND %s ORDER BY %s LIMIT 500;', $this->_getLectureClause(), $order);

        return DB::getInstance()->get($query, (int) $parent);
    }








    public function getById($id)
    {
        $db = DB::getInstance();
        $page = $db->first('SELECT *,
            strftime(\'%s\', date_creation) AS date_creation,
            strftime(\'%s\', date_modification) AS date_modification







>
>
>
>
>
>
>







373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
                strftime(\'%%s\', date_creation) AS date_creation,
                strftime(\'%%s\', date_modification) AS date_modification
                FROM wiki_pages
                WHERE parent = ? AND %s ORDER BY %s LIMIT 500;', $this->_getLectureClause(), $order);

        return DB::getInstance()->get($query, (int) $parent);
    }

    public function hasChildren($parent, $public_only = false)
    {
        $db = DB::getInstance();
        $public = !$public_only ? '' : ' AND ' . $db->where('droit_lecture', self::LECTURE_PUBLIC);
        return $db->test('wiki_pages', $db->where('parent', (int)$parent) . $public);
    }

    public function getById($id)
    {
        $db = DB::getInstance();
        $page = $db->first('SELECT *,
            strftime(\'%s\', date_creation) AS date_creation,
            strftime(\'%s\', date_modification) AS date_modification

Modified src/templates/admin/wiki/page.tpl from [0a5fd04f4f] to [022471442d].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    {/if}
    {if $can_edit}
        <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li>
    {/if}
    {if $can_read && $page && $page.contenu}
        <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id}">Historique</a>
        {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC}
            <li><a href="{$www_url}{$page.uri}{if !empty($children)}/{/if}">Voir sur le site</a>
        {/if}
    {/if}
    {if $session->canAccess('wiki', Garradin\Membres::DROIT_ADMIN)}
        <li><a href="{$www_url}admin/wiki/supprimer.php?id={$page.id}">Supprimer</a></li>
    {/if}
</ul>








|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    {/if}
    {if $can_edit}
        <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li>
    {/if}
    {if $can_read && $page && $page.contenu}
        <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id}">Historique</a>
        {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC}
            <li><a href="{$www_url}{$page.uri}{if $has_public_children}/{/if}">Voir sur le site</a>
        {/if}
    {/if}
    {if $session->canAccess('wiki', Garradin\Membres::DROIT_ADMIN)}
        <li><a href="{$www_url}admin/wiki/supprimer.php?id={$page.id}">Supprimer</a></li>
    {/if}
</ul>

Modified src/www/admin/wiki/index.php from [1316e9394d] to [7b7629afa4].

22
23
24
25
26
27
28

29
30
31
32
33
34
35
}
else
{
    $membres = new Membres;
    $tpl->assign('can_read', $wiki->canReadPage($page->droit_lecture));
    $tpl->assign('can_edit', $wiki->canWritePage($page->droit_ecriture));
    $tpl->assign('children', $wiki->getList($page_uri == '' ? 0 : $page->id, true));

    $tpl->assign('breadcrumbs', $wiki->listBackBreadCrumbs($page->id));
    $tpl->assign('auteur', $page->contenu ? $membres->getNom($page->contenu->id_auteur) : null);

    $images = Fichiers::listLinkedFiles(Fichiers::LIEN_WIKI, $page->id, true);

    if ($images && !$page->contenu->chiffrement)
    {







>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
}
else
{
    $membres = new Membres;
    $tpl->assign('can_read', $wiki->canReadPage($page->droit_lecture));
    $tpl->assign('can_edit', $wiki->canWritePage($page->droit_ecriture));
    $tpl->assign('children', $wiki->getList($page_uri == '' ? 0 : $page->id, true));
    $tpl->assign('has_public_children', $wiki->hasChildren($page_uri == '' ? 0 : $page->id, true));
    $tpl->assign('breadcrumbs', $wiki->listBackBreadCrumbs($page->id));
    $tpl->assign('auteur', $page->contenu ? $membres->getNom($page->contenu->id_auteur) : null);

    $images = Fichiers::listLinkedFiles(Fichiers::LIEN_WIKI, $page->id, true);

    if ($images && !$page->contenu->chiffrement)
    {