当前位置: 首页>>代码示例>>PHP>>正文


PHP tpl_toc函数代码示例

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


在下文中一共展示了tpl_toc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 <andi@splitbrain.org>
 *
 * @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 <andi@splitbrain.org>
 * @author Michael Klier <chi@chimeric.de>
 */
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 <andi@splitbrain.org>
 */
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 <andi@splitbrain.org>
 */
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 <rwmoore07@gmail.com>
 * @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 <andi@splitbrain.org>
 */
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


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