本文整理汇总了PHP中p_wiki_xhtml函数的典型用法代码示例。如果您正苦于以下问题:PHP p_wiki_xhtml函数的具体用法?PHP p_wiki_xhtml怎么用?PHP p_wiki_xhtml使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了p_wiki_xhtml函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInnerToOuter
public function testInnerToOuter()
{
$thirdHTML = p_wiki_xhtml('test:plugin_include:nested:third');
$secondHTML = p_wiki_xhtml('test:plugin_include:nested:second');
$mainHTML = p_wiki_xhtml('test:plugin_include:nested:start');
$this->_validateContent($mainHTML, $secondHTML, $thirdHTML);
}
示例2: tpl_sidebar
function tpl_sidebar($user_defined_page_name = "")
{
global $ID, $REV, $conf;
// save globals
$saveID = $ID;
$saveREV = $REV;
// discover file to be displayed in navigation sidebar
$fileSidebar = '';
// damien
$pagename = "";
if ($user_defined_page_name != "") {
$pagename = $user_defined_page_name;
} else {
if (isset($conf['sidebar']['page'])) {
$pagename = $conf['sidebar']['page'];
}
}
if ($pagename != "") {
$fileSidebar = getSidebarFN(getNS($ID), $pagename);
}
// determine what to display
if ($fileSidebar) {
$ID = $fileSidebar;
$REV = '';
print p_wiki_xhtml($ID, $REV, false);
} else {
global $IDX;
html_index($IDX);
}
// restore globals
$ID = $saveID;
$REV = $saveREV;
}
示例3: p_file_xhtml
function p_file_xhtml($id, $excuse = false)
{
if (@file_exists($id)) {
return p_cached_output($id, 'xhtml', $id);
}
return p_wiki_xhtml($id, '', $excuse);
}
示例4: _getMenu
function _getMenu($menu, $edit)
{
global $conf, $ID, $REV, $INFO, $lang;
$currID = false;
// Remember $ID and $REV
$svID = $ID;
$svREV = $REV;
// Parent side ID
$sub = substr($ID, 0, strpos($ID, ":"));
$menuOutput = "";
if (file_exists(wikiFN($ID . "/" . $menu))) {
$menuOutput = p_wiki_xhtml($ID . "/" . $menu, '', false);
$currID = $ID;
$menuID = $currID . ":" . $menu;
} else {
if (file_exists(wikiFN($sub . "/" . $menu))) {
$menuOutput = p_wiki_xhtml($sub . "/" . $menu, '', false);
$currID = $sub;
$menuID = $currID . ":" . $menu;
}
}
if ($INFO['perm'] > AUTH_READ && true == $edit) {
$menuOutput = '<ul><li><a href="?id=' . $menuID . '&do=edit" class="wikilink1" title="Edit Menu"><b>Edit Menu</b></a></li></ul>';
}
$ID = $svID;
$REV = $svREV;
return $menuOutput;
}
示例5: test_basic_weekpicker_syntax
public function test_basic_weekpicker_syntax()
{
global $INFO;
$id = 'test:plugin_datepicker:syntax4';
$INFO['id'] = $id;
saveWikiText($id, '<weekpicker 14/02>' . DOKU_LF . '<weekpicker# 14/02>' . DOKU_LF . '<weekpicker\\ 14/02>' . DOKU_LF, 'test');
$xhtml = p_wiki_xhtml($id);
$doc = phpQuery::newDocument($xhtml);
$mselector = pq("span.weekpicker", $doc);
$this->assertTrue($mselector->length === 3);
$this->assertEquals('14/02', trim($mselector->eq(0)->text()));
$this->assertEquals('14/02', trim($mselector->eq(1)->text()));
$this->assertEquals('14/02', trim($mselector->eq(2)->text()));
}
示例6: _show404
function _show404(&$event, $param)
{
global $ACT;
if ($ACT != 'notfound') {
return false;
}
$event->stopPropagation();
$event->preventDefault();
global $ID;
$oldid = $ID;
$ID = $this->getConf('404page');
echo p_wiki_xhtml($ID, '', false);
$ID = $oldid;
$ACT = 'show';
return true;
}
示例7: print_overlay
function print_overlay(&$event, $param)
{
global $ID;
$overlay = '';
$paths = $this->getConf('nsoverlays');
$namespace = getNS($ID);
$sort_paths = $this->_natsort_ns($paths);
$sort_paths = explode(',', $sort_paths);
$overlays = $this->_get_overlays($sort_paths);
$parent_ns = $this->_get_parent_ns($namespace);
foreach ($overlays as $key => $val) {
// first check if was specified an overlay for a specific namespace
if ($val[1] != '') {
if ($val[1] == ':') {
$overlay = $overlays[$key][0];
} elseif (strpos($namespace, $val[1]) === 0) {
$overlay = $overlays[$key][0];
break;
}
} else {
if ($overlay == '') {
if ('' == $val[1]) {
foreach ($parent_ns as $ns) {
$wikifile = wikiFN($ns . ':' . $val[0]);
if (file_exists($wikifile)) {
$overlay = str_replace('/', ':', $ns) . ':' . $val[0];
break 2;
}
}
}
}
}
}
if (auth_quickaclcheck($ID) >= AUTH_READ) {
$insert = p_wiki_xhtml($overlay);
}
if (!$insert) {
return;
}
$close = trim($this->getLang('close'));
$text = <<<TEXT
<div id='overlay'><div class = "close">
<a href="javascript:jQuery('#overlay').toggle();void(0);" rel="nofollow" title="{$close}">{$close}</a>
</div> {$insert}</div>
TEXT;
echo $text;
}
示例8: test_topic_tag
function test_topic_tag()
{
saveWikiText('tagged_page', '{{tag>mytag test2tag}}', 'Test');
saveWikiText('topic_page', '{{topic>mytag}}' . DOKU_LF . DOKU_LF . '{{tag>topictag mytag}}' . DOKU_LF, 'Test');
idx_addPage('topic_page');
idx_addPage('tagged_page');
$this->assertContains('tag:topictag', p_wiki_xhtml('topic_page'), 'Page with tag syntax doesn\'t contain tag output');
$this->assertNotContains('tag:test2tag', p_wiki_xhtml('topic_page'), 'Page with tag and topic syntax tag which is listed in a page that is listed in the topic syntax but not on the page itself');
$this->assertContains('topic_page', p_wiki_xhtml('topic_page'), 'Page with topic and tag syntax doesn\'t list itself in the topic syntax');
$this->assertContains('tagged_page', p_wiki_xhtml('topic_page'), 'Page with topic syntax doesn\'t list matching page');
$this->assertContains('tag:mytag', p_wiki_xhtml('tagged_page'), 'Page with tag syntax doesn\'t contain tag output');
$this->assertContains('tag:test2tag', p_wiki_xhtml('tagged_page'), 'Page with tag syntax doesn\'t contain tag output');
$this->assertNotContains('tag:topictag', p_wiki_xhtml('tagged_page'), 'Page with tag syntax contains tag from a page in which it is listed in the topic syntax');
saveWikiText('tagged_page', '{{tag>test2tag}}', 'Deleted mytag');
$this->assertNotContains('tagged_page', p_wiki_xhtml('topic_page'), 'Page that no longer contains the tag is still listed in the topic syntax (caching problems?)');
$this->assertNotContains('tag:mytag', p_wiki_xhtml('tagged_page'), 'Removed tag is still listed in XHTML output');
}
示例9: tpl_topbar
/**
* Renders the topbar
*
* @author Michael Klier <chi@chimeric.de>
* @author Louis Wolf <louiswolf@chirripo.nl>
*/
function tpl_topbar()
{
global $ID;
$found = false;
$tbar = '';
$path = explode(':', $ID);
while (!$found && count($path) >= 0) {
$tbar = implode(':', $path) . ':' . 'topbar';
$found = @file_exists(wikiFN($tbar));
array_pop($path);
// check if nothing was found
if (!$found && $tbar == ':topbar') {
return;
}
}
if ($found && auth_quickaclcheck($tbar) >= AUTH_READ) {
$toolbar = p_wiki_xhtml($tbar, '', false);
$lines = explode("\n", $toolbar);
$nr = count($lines);
$open_ul = 0;
$primary_ul = 0;
$positions = array();
for ($i = 0; $i < $nr; $i++) {
if (trim($lines[$i]) == '<ul>') {
$open_ul = $open_ul + 1;
if ($open_ul == 1) {
$primary_ul++;
$lines[$i] = '<ul class="primary">' . "\n";
array_push($positions, $i);
}
} else {
if (strpos($lines[$i], '</ul>') !== false) {
$open_ul = $open_ul - 1;
}
}
}
$first_position = $positions[0];
$last_position = $positions[count($positions) - 1];
$lines[$first_position] = '<ul class="primary start">' . "\n";
$lines[$last_position] = '<ul class="primary end">' . "\n";
$width = $primary_ul * 150;
print '<div id="tpl_simple_navi" style="width:' . $width . 'px;">';
print implode($lines);
print '</div>';
}
}
示例10: template_tpl_include_page
/**
* Includes the rendered HTML of a given page
*
* This function is useful to populate sidebars or similar features in a
* template
*/
function template_tpl_include_page($pageid, $print = true, $propagate = false, $rev = '')
{
if (!$pageid) {
return false;
}
if ($propagate) {
$pageid = page_findnearest($pageid);
}
global $TOC;
$oldtoc = $TOC;
$html = p_wiki_xhtml($pageid, $rev, false);
$TOC = $oldtoc;
if (!$print) {
return $html;
}
echo $html;
return $html;
}
示例11: tpl_navigation
/**
* Prints the navigation
*
* @author Michael Klier <chi@chimeric.de>
*/
function tpl_navigation()
{
global $ID;
global $conf;
$navpage = tpl_getConf('navigation_page');
print '<div class="navigation">' . DOKU_LF;
if (!page_exists($navpage)) {
if (@file_exists(DOKU_TPLINC . 'lang/' . $conf['lang'] . '/nonavigation.txt')) {
$out = p_render('xhtml', p_get_instructions(io_readFile(DOKU_TPLINC . 'lang/' . $conf['lang'] . '/nonavigation.txt')), $info);
} else {
$out = p_render('xhtml', p_get_instructions(io_readFile(DOKU_TPLINC . 'lang/en/nonavigation.txt')), $info);
}
$link = '<a href="' . wl($navpage) . '" class="wikilink2">' . $navpage . '</a>' . DOKU_LF;
print str_replace('LINK', $link, $out);
} else {
print p_wiki_xhtml($navpage);
}
print '</div>';
}
示例12: test_cache_handling
/**
* @group slow
*/
function test_cache_handling()
{
$testid = 'wiki:bar:test';
saveWikiText($testid, '[[wiki:foo:]]', 'Test setup');
idx_addPage($testid);
saveWikiText('wiki:foo:start', 'bar', 'Test setup');
idx_addPage('wiki:foo:start');
sleep(1);
// wait in order to make sure that conditions with < give the right result.
p_wiki_xhtml($testid);
// populate cache
$cache = new cache_renderer($testid, wikiFN($testid), 'xhtml');
$this->assertTrue($cache->useCache());
/** @var helper_plugin_move_op $move */
$move = plugin_load('helper', 'move_op');
$this->assertTrue($move->movePage('wiki:foo:start', 'wiki:foo2:start'));
$cache = new cache_renderer($testid, wikiFN($testid), 'xhtml');
$this->assertFalse($cache->useCache());
}
示例13: alterLoginPageBefore
/**
* Alters login page via HTML_LOGINFORM_OUTPUT event
* @param $event
* @param $param
*/
public function alterLoginPageBefore($event, $param)
{
print '<div class="login container">' . NL;
$helpId = $this->getConf(self::CONF_HELP_PAGE);
global $conf;
if (!empty($conf['lang'])) {
$lang = $conf['lang'];
if (!empty($conf['plugin']['translation']['translations']) && preg_match("/{$lang}/", $conf['plugin']['translation']['translations'])) {
$helpId = ':' . $lang . $helpId;
}
}
if (page_exists($helpId)) {
print '<div class="login help">' . p_wiki_xhtml($helpId) . '</div>' . NL;
}
if (!empty($this->getConf(self::CONF_RENAME_LOCAL))) {
/** @var Doku_Form $form */
$form = $event->data;
$form->_content[0]['_legend'] = $this->getLang('login_local');
}
}
示例14: renderBar
function renderBar($page, $fallbackToIndex = false)
{
global $ID, $REV;
// save globals
$saveID = $ID;
$saveREV = $REV;
$fileSidebar = getBarFN(getNS($ID), $page);
// determine what to display
if ($fileSidebar) {
$ID = $fileSidebar;
$REV = '';
print p_wiki_xhtml($ID, $REV, false);
} elseif ($fallbackToIndex) {
global $IDX;
html_index($IDX);
}
// restore globals
$ID = $saveID;
$REV = $saveREV;
}
示例15: tpl_sidebar
function tpl_sidebar()
{
global $ID, $REV, $conf;
// save globals
$saveID = $ID;
$saveREV = $REV;
// discover file to be displayed in navigation sidebar
$fileSidebar = '';
$sidebar_name = tpl_getConf('btl_sidebar_name');
if (isset($sidebar_name)) {
$fileSidebar = getSidebarFN(getNS($ID), $sidebar_name);
}
// determine what to display
if ($fileSidebar) {
$ID = $fileSidebar;
$REV = '';
$sidebar = p_wiki_xhtml($ID, $REV, false);
$lines = explode("\n", $sidebar);
$open_ul = 0;
for ($i = 0; $i < count($lines); $i++) {
if (trim($lines[$i]) == '<ul>') {
$open_ul = $open_ul + 1;
if ($open_ul == 1) {
$lines[$i] = '<ul class="primary">' . "\n";
}
} else {
if (strpos($lines[$i], '</ul>') != false) {
$open_ul = $open_ul - 1;
}
}
}
print implode($lines);
} else {
global $IDX;
html_index($IDX);
}
// restore globals
$ID = $saveID;
$REV = $saveREV;
}