三歩あるけば物も忘れる

お腹のお肉がメタボックル

ユーザ用ツール

サイト用ツール


dokuwiki:Setting:AddTopBar

9.TopBarの追加

topbarの追加

下記サイトを参考に、topbarを追加した
https://www.dokuwiki.org/ja:tips:topbar

メモ

dokuwiki/inc/template.php

そのままだと名前空間の大文字利用ができないため、ハイライト行を書き換える

変更前

function tpl_include_page($pageid, $print = true, $propagate = false, $useacl = true)
{
    if ($propagate) {
        $pageid = page_findnearest($pageid, $useacl);
    } elseif ($useacl && auth_quickaclcheck($pageid) == AUTH_NONE) {
        return false;
    }
    if (!$pageid) return false;

    global $TOC;
    $oldtoc = $TOC;
    $html = p_wiki_xhtml($pageid, '', false);
    $TOC = $oldtoc;

    if ($print) echo $html;
    return $html;
}

変更後

function tpl_include_page($pageid, $print = true, $propagate = false, $useacl = true)
{
    if ($propagate) {
        $pageid = page_findnearest($pageid, $useacl);
    } elseif ($useacl && auth_quickaclcheck($pageid) == AUTH_NONE) {
        return false;
    }
    if (!$pageid) return false;

    global $TOC;
    $oldtoc = $TOC;
    $pagefile = wikiFN($pageid);
    if (file_exists($pagefile)) {
        $content = io_readFile($pagefile);
        $html = p_render('xhtml', p_get_instructions($content), $info);
    } else {
        $html = '';
    }
    $TOC = $oldtoc;

    if ($print) echo $html;
    return $html;
}

dokuwiki/Setting/AddTopBar.txt · 最終更新: by admin