• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tpl_toc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tpl_toc函数的典型用法代码示例。如果您正苦于以下问题:PHP tpl_toc函数的具体用法?PHP tpl_toc怎么用?PHP tpl_toc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tpl_toc函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: tpl_sidebar_dispatch


//.........这里部分代码省略.........
                }
            }
            break;
        case 'group':
            if (tpl_getConf('closedwiki') && !isset($_SERVER['REMOTE_USER'])) {
                return;
            }
            $group_ns = tpl_getConf('group_sidebar_namespace');
            if (isset($INFO['userinfo']['name'], $INFO['userinfo']['grps'])) {
                foreach ($INFO['userinfo']['grps'] as $grp) {
                    $group_sb = $group_ns . ':' . $grp . ':' . $pname;
                    if (@page_exists($group_sb) && auth_quickaclcheck(cleanID($group_sb)) >= AUTH_READ) {
                        $subst = array('pattern' => array('/@GROUP@/'), 'replace' => array($grp));
                        print '<div class="group_sidebar sidebar_box">' . DOKU_LF;
                        print p_sidebar_xhtml($group_sb, $pos, $subst) . DOKU_LF;
                        print '</div>' . DOKU_LF;
                    }
                }
            }
            break;
        case 'index':
            if (tpl_getConf('closedwiki') && !isset($_SERVER['REMOTE_USER'])) {
                return;
            }
            print '<div class="index_sidebar sidebar_box">' . DOKU_LF;
            print '  ' . p_index_xhtml($svID, $pos) . DOKU_LF;
            print '</div>' . DOKU_LF;
            break;
        case 'toc':
            if (tpl_getConf('closedwiki') && !isset($_SERVER['REMOTE_USER'])) {
                return;
            }
            if (auth_quickaclcheck($svID) >= AUTH_READ) {
                $toc = tpl_toc(true);
                // replace ids to keep XHTML compliance
                if (!empty($toc)) {
                    $toc = preg_replace('/id="(.*?)"/', 'id="sb__' . $pos . '__\\1"', $toc);
                    print '<div class="toc_sidebar sidebar_box">' . DOKU_LF;
                    print $toc;
                    print '</div>' . DOKU_LF;
                }
            }
            break;
        case 'toolbox':
            if (tpl_getConf('hideactions') && !isset($_SERVER['REMOTE_USER'])) {
                return;
            }
            if (tpl_getConf('closedwiki') && !isset($_SERVER['REMOTE_USER'])) {
                print '<div class="toolbox_sidebar sidebar_box">' . DOKU_LF;
                print '  <div class="level1">' . DOKU_LF;
                print '    <ul>' . DOKU_LF;
                print '      <li><div class="li">';
                tpl_actionlink('login');
                print '      </div></li>' . DOKU_LF;
                print '    </ul>' . DOKU_LF;
                print '  </div>' . DOKU_LF;
                print '</div>' . DOKU_LF;
            } else {
                $actions = array('admin', 'revert', 'edit', 'history', 'recent', 'backlink', 'subscription', 'index', 'login', 'profile', 'top');
                print '<div class="toolbox_sidebar sidebar_box">' . DOKU_LF;
                print '  <div class="level1">' . DOKU_LF;
                print '    <ul>' . DOKU_LF;
                foreach ($actions as $action) {
                    if (!actionOK($action)) {
                        continue;
                    }
开发者ID:RockyRoad29,项目名称:dokuwiki-template-arctic,代码行数:67,代码来源:tpl_functions.php


示例2: tpl_flush

">

              <?php 
tpl_flush();
/* flush the output buffer */
// Page-Header DokuWiki page
tpl_includeFile('pageheader.html');
// Page-Header DokuWiki page
if ($ACT == 'show') {
    tpl_include_page('pageheader', 1, 1);
}
// render the content into buffer for later use
ob_start();
tpl_content(false);
$content = ob_get_clean();
$toc = bootstrap3_toc(tpl_toc(true), true);
$content = '<div class="dw-content">' . $content . '</div>';
// Include Page Tools
require_once 'tpl_page_tools.php';
// Include the TOC layout
if ($toc) {
    require_once 'tpl_toc.php';
} else {
    echo $content;
}
tpl_flush();
// Page-Footer hook
tpl_includeFile('pagefooter.html');
// Page-Footer DokuWiki page
if ($ACT == 'show') {
    tpl_include_page('pagefooter', 1, 1);
开发者ID:ERTurner,项目名称:dokuwiki-template-bootstrap3,代码行数:31,代码来源:main.php


示例3: html_show

/**
 * Show a wiki page
 *
 * @author Andreas Gohr <[email protected]>
 *
 * @param null|string $txt wiki text or null for showing $ID
 */
function html_show($txt = null)
{
    global $ID;
    global $REV;
    global $HIGH;
    global $INFO;
    global $DATE_AT;
    //disable section editing for old revisions or in preview
    if ($txt || $REV) {
        $secedit = false;
    } else {
        $secedit = true;
    }
    if (!is_null($txt)) {
        //PreviewHeader
        echo '<br id="scroll__here" />';
        echo p_locale_xhtml('preview');
        echo '<div class="preview"><div class="pad">';
        $html = html_secedit(p_render('xhtml', p_get_instructions($txt), $info), $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        echo $html;
        echo '<div class="clearer"></div>';
        echo '</div></div>';
    } else {
        if ($REV || $DATE_AT) {
            $data = array('rev' => &$REV, 'date_at' => &$DATE_AT);
            trigger_event('HTML_SHOWREV_OUTPUT', $data, 'html_showrev');
        }
        $html = p_wiki_xhtml($ID, $REV, true, $DATE_AT);
        $html = html_secedit($html, $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        $html = html_hilight($html, $HIGH);
        echo $html;
    }
}
开发者ID:evacomaroski,项目名称:dokuwiki,代码行数:46,代码来源:html.php


示例4: act_export

/**
 * Export a wiki page for various formats
 *
 * Triggers ACTION_EXPORT_POSTPROCESS
 *
 *  Event data:
 *    data['id']      -- page id
 *    data['mode']    -- requested export mode
 *    data['headers'] -- export headers
 *    data['output']  -- export output
 *
 * @author Andreas Gohr <[email protected]>
 * @author Michael Klier <[email protected]>
 */
function act_export($act)
{
    global $ID;
    global $REV;
    global $conf;
    global $lang;
    $pre = '';
    $post = '';
    $output = '';
    $headers = array();
    // search engines: never cache exported docs! (Google only currently)
    $headers['X-Robots-Tag'] = 'noindex';
    $mode = substr($act, 7);
    switch ($mode) {
        case 'raw':
            $headers['Content-Type'] = 'text/plain; charset=utf-8';
            $headers['Content-Disposition'] = 'attachment; filename=' . noNS($ID) . '.txt';
            $output = rawWiki($ID, $REV);
            break;
        case 'xhtml':
            $pre .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' . DOKU_LF;
            $pre .= ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' . DOKU_LF;
            $pre .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $conf['lang'] . '"' . DOKU_LF;
            $pre .= ' lang="' . $conf['lang'] . '" dir="' . $lang['direction'] . '">' . DOKU_LF;
            $pre .= '<head>' . DOKU_LF;
            $pre .= '  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . DOKU_LF;
            $pre .= '  <title>' . $ID . '</title>' . DOKU_LF;
            // get metaheaders
            ob_start();
            tpl_metaheaders();
            $pre .= ob_get_clean();
            $pre .= '</head>' . DOKU_LF;
            $pre .= '<body>' . DOKU_LF;
            $pre .= '<div class="dokuwiki export">' . DOKU_LF;
            // get toc
            $pre .= tpl_toc(true);
            $headers['Content-Type'] = 'text/html; charset=utf-8';
            $output = p_wiki_xhtml($ID, $REV, false);
            $post .= '</div>' . DOKU_LF;
            $post .= '</body>' . DOKU_LF;
            $post .= '</html>' . DOKU_LF;
            break;
        case 'xhtmlbody':
            $headers['Content-Type'] = 'text/html; charset=utf-8';
            $output = p_wiki_xhtml($ID, $REV, false);
            break;
        default:
            $output = p_cached_output(wikiFN($ID, $REV), $mode);
            $headers = p_get_metadata($ID, "format {$mode}");
            break;
    }
    // prepare event data
    $data = array();
    $data['id'] = $ID;
    $data['mode'] = $mode;
    $data['headers'] = $headers;
    $data['output'] =& $output;
    trigger_event('ACTION_EXPORT_POSTPROCESS', $data);
    if (!empty($data['output'])) {
        if (is_array($data['headers'])) {
            foreach ($data['headers'] as $key => $val) {
                header("{$key}: {$val}");
            }
        }
        print $pre . $data['output'] . $post;
        exit;
    }
    return 'show';
}
开发者ID:JeromeS,项目名称:dokuwiki,代码行数:83,代码来源:actions.php


示例5: tpl_admin

/**
 * Handle the admin page contents
 *
 * @author Andreas Gohr <[email protected]>
 */
function tpl_admin()
{
    global $INFO;
    global $TOC;
    $plugin = null;
    if (!empty($_REQUEST['page'])) {
        $pluginlist = plugin_list('admin');
        if (in_array($_REQUEST['page'], $pluginlist)) {
            // attempt to load the plugin
            $plugin =& plugin_load('admin', $_REQUEST['page']);
        }
    }
    if ($plugin !== null) {
        if ($plugin->forAdminOnly() && !$INFO['isadmin']) {
            msg('For admins only', -1);
            html_admin();
        } else {
            if (!is_array($TOC)) {
                $TOC = $plugin->getTOC();
            }
            //if TOC wasn't requested yet
            if ($INFO['prependTOC']) {
                tpl_toc();
            }
            $plugin->html();
        }
    } else {
        html_admin();
    }
    return true;
}
开发者ID:highpictv,项目名称:wiki,代码行数:36,代码来源:template.php


示例6: handle_action

 /**
  * Handle the "partial" action, using the blank template to deliver nothing but the inner page content.
  *
  * @param {Doku_Event} $event - The DokuWiki event object.
  * @param {mixed} $param  - The fifth argument to register_hook().
  */
 public function handle_action(Doku_Event &$event, $param)
 {
     if (!$this->m_inPartial) {
         return;
     }
     global $ACT, $INPUT, $ID;
     // Compare permissions between the current page and the passed-in id.
     $compareid = $INPUT->str('fastwiki_compareid');
     if ($compareid && auth_quickaclcheck($ID) != auth_quickaclcheck($compareid)) {
         echo 'PERMISSION_CHANGE';
     } else {
         if (!$this->m_no_content) {
             if ($ACT == 'show') {
                 tpl_toc();
             }
             // Section save. This won't work, unless I return new "range" inputs for all sections.
             //			$secedit = $ACT == 'show' && $INPUT->str('target') == 'section' && ($INPUT->str('prefix') || $INPUT->str('suffix'));
             //			if ($secedit)
             //				$this->render_text($INPUT->str('wikitext')); //+++ render_text isn't outputting anything.
             //			else
             tpl_content(false);
         }
     }
     // Output error messages.
     html_msgarea();
 }
开发者ID:sawachan,项目名称:dokuwiki_fastwiki,代码行数:32,代码来源:action.php


示例7: dirname

            <?php 
}
?>

            <?php 
@(include dirname(__FILE__) . '/header.html');
?>
            <div class="clearer"></div>
            <hr class="a11y" />
        </div></div><!-- /header -->

		<div class="wrapper">

			<div id="dokuwiki__toc" title="Table of Contents">
				<?php 
tpl_toc();
?>
			</div>

            <!-- ********** CONTENT ********** -->
            <div id="dokuwiki__content"><div class="pad">
                <?php 
tpl_flush();
?>
                <?php 
@(include dirname(__FILE__) . '/pageheader.html');
?>

                <div class="page">
                    <!-- wikipage start -->
                    <?php 
开发者ID:marktsai0316,项目名称:dokuwiki-readability,代码行数:31,代码来源:main.php


示例8: tpl_include_page

         //get the rendered content of the defined wiki article to use as custom navigation
         $interim = tpl_include_page($nav_location, false);
         if ($interim === "" || $interim === false) {
             //creation/edit link if the defined page got no content
             $_monobook_boxes["p-x-navigation"]["xhtml"] = "[&#160;" . html_wikilink($nav_location, hsc($lang["monobook_fillplaceholder"] . " (" . $nav_location . ")")) . "&#160;]<br />";
         } else {
             //the rendered page content
             $_monobook_boxes["p-x-navigation"]["xhtml"] = $interim;
         }
     }
     unset($nav_location);
 }
 //table of contents (TOC) - show outside the article? (this is a dirty hack but often requested)
 if (tpl_getConf("monobook_toc_position") === "sidebar") {
     //check if the current page got a TOC
     $toc = tpl_toc(true);
     if (!empty($toc)) {
         //headline
         $_monobook_boxes["p-toc"]["headline"] = $lang["toc"];
         //language comes from DokuWiki core
         //content
         $_monobook_boxes["p-toc"]["xhtml"] = str_replace(array("<div class=\"tocheader toctoggle\" id=\"toc__header\">" . $lang["toc"] . "</div>", " class=\"toc\"", " id=\"toc__inside\"", " id=\"dw__toc\"", "<h3 class=\"toggle\">" . $lang["toc"] . "</h3>"), "", $toc);
     }
     unset($toc);
 }
 //search
 if (tpl_getConf("monobook_search") && actionOK("search")) {
     //check if action is disabled
     //headline
     $_monobook_boxes["p-search"]["headline"] = $lang["monobook_bar_search"];
     //content
开发者ID:RJWoodhead,项目名称:dokuwiki-template-monobook,代码行数:31,代码来源:boxes.php


示例9: act_export

/**
 * Handle 'edit', 'preview'
 *
 * @author Andreas Gohr <[email protected]>
 */
function act_export($act)
{
    global $ID;
    global $REV;
    // search engines: never cache exported docs! (Google only currently)
    header('X-Robots-Tag: noindex');
    // no renderer for this
    if ($act == 'export_raw') {
        header('Content-Type: text/plain; charset=utf-8');
        print rawWiki($ID, $REV);
        exit;
    }
    // html export #FIXME what about the template's style?
    if ($act == 'export_xhtml') {
        global $conf;
        global $lang;
        header('Content-Type: text/html; charset=utf-8');
        ptln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"');
        ptln(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
        ptln('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $conf['lang'] . '"');
        ptln(' lang="' . $conf['lang'] . '" dir="' . $lang['direction'] . '">');
        ptln('<head>');
        ptln('  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
        ptln('  <title>' . $ID . '</title>');
        tpl_metaheaders();
        ptln('</head>');
        ptln('<body>');
        ptln('<div class="dokuwiki export">');
        $html = p_wiki_xhtml($ID, $REV, false);
        tpl_toc();
        echo $html;
        ptln('</div>');
        ptln('</body>');
        ptln('</html>');
        exit;
    }
    // html body only
    if ($act == 'export_xhtmlbody') {
        $html = p_wiki_xhtml($ID, $REV, false);
        tpl_toc();
        echo $html;
        exit;
    }
    // try to run renderer
    $mode = substr($act, 7);
    $text = p_cached_output(wikiFN($ID, $REV), $mode);
    $headers = p_get_metadata($ID, "format {$mode}");
    if (!is_null($text)) {
        if (is_array($headers)) {
            foreach ($headers as $key => $val) {
                header("{$key}: {$val}");
            }
        }
        print $text;
        exit;
    }
    return 'show';
}
开发者ID:JVS-IS,项目名称:ICONITO-EcoleNumerique,代码行数:63,代码来源:actions.php


示例10: dirname

 * @link     https://github.com/ryanwmoore/dokutwitterbootstrap
 * @author   Ryan Moore <[email protected]>
 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
 */
// error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE); ini_set('display_errors', '1');  // Switch on for error reporting
if (!defined('DOKU_INC')) {
    die;
}
/* must be run from within DokuWiki */
@(require_once dirname(__FILE__) . '/tpl_functions.php');
/* include hook for template functions */
$showTools = !tpl_getConf('hideTools') || tpl_getConf('hideTools') && $_SERVER['REMOTE_USER'];
# calling tpl_toc() here returns null if the toc wouldn't normally be rendered
# so $showTOC will be true if TOC would be rendered, false if not
# this affects our grid layout later ( see 'if ($showTOC)' )
$showTOC = $ACT == "show" && tpl_toc(true);
?>
<!DOCTYPE html>
<html lang="<?php 
echo $conf['lang'];
?>
" dir="<?php 
echo $lang['direction'];
?>
">
<head>
    <meta charset="UTF-8" />
    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]-->
    <title><?php 
tpl_pagetitle();
?>
开发者ID:ofsole,项目名称:dokuwiki,代码行数:31,代码来源:main.php


示例11: tpl_entry

 /**
  * Print the whole entry, reformat it or cut it when needed
  *
  * @param bool   $included   - set true if you want content to be reformated
  * @param string $readmore   - where to cut the entry valid: 'syntax', FIXME
  * @param bool   $inc_level  - FIXME
  * @param bool   $skipheader - Remove the first header
  * @return bool false if a recursion was detected and the entry could not be printed, true otherwise
  */
 function tpl_entry($included = true, $readmore = 'syntax', $inc_level = true, $skipheader = false)
 {
     $content = $this->get_entrycontent($readmore, $inc_level, $skipheader);
     if ($included) {
         $content = $this->_convert_footnotes($content);
         $content .= $this->_edit_button();
     } else {
         $content = tpl_toc(true) . $content;
     }
     echo html_secedit($content, !$included);
     return true;
 }
开发者ID:speed47,项目名称:plugin-blogtng,代码行数:21,代码来源:entry.php


示例12: unset

        echo $html;
    }
}
$evt->advise_after();
unset($data);
unset($evt);
?>
                    </ul>
                </div>
            </div>
        </div><!-- /wrapper -->

<?php 
/*include('tpl_footer.php') */
?>
    </div></div><!-- /site -->

    <div class="no"><?php 
tpl_indexerWebBug();
?>
</div>
    <div id="screen__mode" class="no"></div><?php 
/* helper to detect CSS media query in script.js */
?>
    <!--[if ( lte IE 7 | IE 8 ) ]></div><![endif]-->
</section>

<?php 
$SECONDSCREEN = tpl_toc(true);
$JS = false;
include __DIR__ . "/../../../shared/templates/footer.inc";
开发者ID:learningendless,项目名称:web-wiki,代码行数:31,代码来源:main.php


示例13: _tpl_toc_to_twitter_bootstrap

function _tpl_toc_to_twitter_bootstrap()
{
    //Force generation of TOC, request that the TOC is returned as HTML, but then ignore the returned string. The hook will instead dump out the TOC.
    global $EVENT_HANDLER;
    $EVENT_HANDLER->register_hook('TPL_TOC_RENDER', 'AFTER', NULL, '_tpl_toc_to_twitter_bootstrap_event_hander');
    tpl_toc(true);
}
开发者ID:ofsole,项目名称:dokuwiki,代码行数:7,代码来源:tpl_functions.php


示例14: tpl_includeFile

              <?php 
tpl_includeFile('pageheader.html');
?>
              <?php 
// render the content into buffer for later use
ob_start();
tpl_content(false);
$content = ob_get_clean();
?>

              <div class="toc-affix pull-right hidden-print" data-spy="affix" data-offset-top="150">
                <?php 
#tpl_toc()
?>
                <?php 
bootstrap_toc(tpl_toc(true));
?>
              </div>

              <!-- wikipage start -->
              <?php 
echo $content;
?>
              <!-- wikipage stop -->

              <?php 
tpl_flush();
?>
              <?php 
tpl_includeFile('pagefooter.html');
?>
开发者ID:HavocKKS,项目名称:dokuwiki-template-bootstrap3,代码行数:31,代码来源:main.php


示例15: tpl_admin

/**
 * Handle the admin page contents
 *
 * @author Andreas Gohr <[email protected]>
 */
function tpl_admin()
{
    global $INFO;
    global $TOC;
    global $INPUT;
    $plugin = null;
    $class = $INPUT->str('page');
    if (!empty($class)) {
        $pluginlist = plugin_list('admin');
        if (in_array($class, $pluginlist)) {
            // attempt to load the plugin
            /** @var $plugin DokuWiki_Admin_Plugin */
            $plugin =& plugin_load('admin', $class);
        }
    }
    if ($plugin !== null) {
        if (!is_array($TOC)) {
            $TOC = $plugin->getTOC();
        }
        //if TOC wasn't requested yet
        if ($INFO['prependTOC']) {
            tpl_toc();
        }
        $plugin->html();
    } else {
        html_admin();
    }
    return true;
}
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:34,代码来源:template.php


示例16: document_end

 function document_end()
 {
     // Pump the last doc
     $this->sections[$this->sectionNumber] = array('level' => $this->previousNodeLevel, 'position' => $this->previousNodePosition, 'content' => $this->doc, 'text' => $this->previousSectionTextHeader);
     // Recreate the doc
     $this->doc = '';
     foreach ($this->sections as $sectionNumber => $section) {
         // The content
         $this->doc .= $section['content'];
         // No TOC or bar for an admin page
         global $ACT;
         if ($ACT != 'admin' and $ACT != 'search') {
             // TOC After the content
             if ($this->info['toc'] == true and $section['level'] == 1 and $section['position'] == 1) {
                 global $conf;
                 if (count($this->toc) > $conf['tocminheads']) {
                     global $TOC;
                     $TOC = $this->toc;
                     $this->doc .= tpl_toc($return = true);
                 }
             }
             // Adbar after the content
             // Adbar later
             //                if ($section['level'] == 2 and
             //                    $section['position'] == 1 and
             //                    $ID <> 'adbar12' and
             //                    $ID <> 'start'
             //                ) {
             //
             //                    // $ID <> 'adbar12' to not come in a recursive call
             //                    // as tpl_include_call also the renderer process
             //
             //                    $this->doc .= tpl_include_page('adbar12', $print = false, $propagate = true);
             //
             //                }
         }
     }
     parent::document_end();
 }
开发者ID:gerardnico,项目名称:dokuwiki-renderer-rplus,代码行数:39,代码来源:renderer.php


示例17: html_show

/**
 * show a wiki page
 *
 * @author Andreas Gohr <[email protected]>
 */
function html_show($txt = null)
{
    global $ID;
    global $REV;
    global $HIGH;
    global $INFO;
    //disable section editing for old revisions or in preview
    if ($txt || $REV) {
        $secedit = false;
    } else {
        $secedit = true;
    }
    if (!is_null($txt)) {
        //PreviewHeader
        echo '<br id="scroll__here" />';
        echo p_locale_xhtml('preview');
        echo '<div class="preview">';
        $html = html_secedit(p_render('xhtml', p_get_instructions($txt), $info), $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        echo $html;
        echo '<div class="clearer"></div>';
        echo '</div>';
    } else {
        if ($REV) {
            print p_locale_xhtml('showrev');
        }
        $html = p_wiki_xhtml($ID, $REV, true);
        $html = html_secedit($html, $secedit);
        if ($INFO['prependTOC']) {
            $html = tpl_toc(true) . $html;
        }
        $html = html_hilight($html, $HIGH);
        echo $html;
    }
}
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:42,代码来源:html.php


示例18: tpl_sidebar_dispatch

/**
 * Dispatches the given sidebar type to return the right content
 *
 * @author Michael Klier <[email protected]>
 */
function tpl_sidebar_dispatch($sb, $pos)
{
    global $lang;
    global $conf;
    global $ID;
    global $REV;
    global $INFO;
    $svID = $ID;
    // save current ID
    $svREV = $REV;
    // save current REV
    $pname = tpl_getConf('pagename');
    switch ($sb) {
        case 'main':
            $main_sb = _getTransSb($pname);
            if ($main_sb && auth_quickaclcheck($main_sb) >= AUTH_READ) {
                $always = tpl_getConf('main_sidebar_always');
                if ($always or !$always && !getNS($ID)) {
                    print '<div class="main_sidebar sidebar_box">' . DOKU_LF;
                    print p_sidebar_xhtml($main_sb, $pos) . DOKU_LF;
                    print '</div>' . DOKU_LF;
                }
            }
            break;
        case 'namespace':
            $user_ns = tpl_getConf('user_sidebar_namespace');
            $group_ns = tpl_getConf('group_sidebar_namespace');
            if (!preg_match("/^" . $user_ns . ":.*?\$|^" . $group_ns . ":.*?\$/", $svID)) {
                // skip group/user sidebars and current ID
                $ns_sb = _getNsSb($svID);
                if ($ns_sb && auth_quickaclcheck($ns_sb) >= AUTH_READ) {
                    print '<div class="namespace_sidebar sidebar_box">' . DOKU_LF;
                    print p_sidebar_xhtml($ns_sb, $pos) . DOKU_LF;
                    print '</div>' . DOKU_LF;
                }
            }
            break;
        case 'user':
            $user_ns = tpl_getConf('user_sidebar_namespace');
            if (isset($INFO['userinfo']['name'])) {
                $user = $_SERVER['REMOTE_USER'];
                $user_sb = _getTransSb($user_ns . ':' . $user . ':' . $pname);
                if (@file_exists(wikiFN($user_sb))) {
                    $subst = array('pattern' => array('/@USER@/'), 'replace' => array($user));
                    print '<div class="user_sidebar sidebar_box">' . DOKU_LF;
                    print p_sidebar_xhtml($user_sb, $pos, $subst) . DOKU_LF;
                    print '</div>';
                }
                // check for namespace sidebars in user namespace too
                if (preg_match('/' . $user_ns . ':' . $user . ':.*/', $svID)) {
                    $ns_sb = _getNsSb($svID);
                    if ($ns_sb && $ns_sb != $user_sb && auth_quickaclcheck($ns_sb) >= AUTH_READ) {
                        print '<div class="namespace_sidebar sidebar_box">' . DOKU_LF;
                        print p_sidebar_xhtml($ns_sb, $pos) . DOKU_LF;
                        print '</div>' . DOKU_LF;
                    }
                }
            }
            break;
        case 'group':
            $group_ns = tpl_getConf('group_sidebar_namespace');
            if (isset($INFO['userinfo']['name'], $INFO['userinfo']['grps'])) {
                foreach ($INFO['userinfo']['grps'] as $grp) {
                    $group_sb = $group_ns . ':' . $grp . ':' . $pname;
                    $group_sb = _getTransSb($group_sb);
                    if ($group_sb && auth_quickaclcheck(cleanID($group_sb)) >= AUTH_READ) {
                        $subst = array('pattern' => array('/@GROUP@/'), 'replace' => array($grp));
                        print '<div class="group_sidebar sidebar_box">' . DOKU_LF;
                        print p_sidebar_xhtml($group_sb, $pos, $subst) . DOKU_LF;
                        print '</div>' . DOKU_LF;
                    }
                }
            }
            break;
        case 'index':
            print '<div class="index_sidebar sidebar_box">' . DOKU_LF;
            print '  ' . p_index_xhtml($svID, $pos) . DOKU_LF;
            print '</div>' . DOKU_LF;
            break;
        case 'toc':
            if (auth_quickaclcheck($svID) >= AUTH_READ) {
                $toc = tpl_toc(true);
                // replace ids to keep XHTML compliance
                if (!empty($toc)) {
                    $toc = preg_replace('/id="(.*?)"/', 'id="sb__' . $pos . '__\\1"', $toc);
                    print '<div class="toc_sidebar sidebar_box">' . DOKU_LF;
                    print $toc;
                    print '</div>' . DOKU_LF;
                }
            }
            break;
        case 'toolbox':
            $act_content = explode(',', tpl_getConf('toolbox_content'));
            $act_order = explode(',', tpl_getConf('toolbox_order'));
            print '<div class="toolbox_sidebar sidebar_box">' . DOKU_LF;
//.........这里部分代码省略.........
开发者ID:silentulo,项目名称:dokuwiki-template-kunlaborejo,代码行数:101,代码来源:tpl_functions.php



注:本文中的tpl_toc函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tpl_userinfo函数代码示例发布时间:2022-05-23
下一篇:
PHP tpl_set_var函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap