本文整理汇总了PHP中wikiFN函数的典型用法代码示例。如果您正苦于以下问题:PHP wikiFN函数的具体用法?PHP wikiFN怎么用?PHP wikiFN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wikiFN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: handle_ajax_call
public function handle_ajax_call()
{
global $INPUT;
header('Content-Type: text/plain');
$langCode = $INPUT->str('lang');
$text = $INPUT->str('text');
$dir = DOKU_CONF . 'lang/' . $langCode;
$file = $dir . '/register.txt';
// make sure the directory exists
if (!file_exists($dir)) {
if (mkdir($dir, 0755) === false) {
echo $this->getLang('makeDirError');
return;
}
}
// save the file
if (file_put_contents($file, $text) === false) {
echo $this->getLang('saveFileError');
return;
}
// set file permissions
chmod($file, 0644);
// log the change
$timestamp = time();
$id = $langCode . ':register';
addLogEntry($timestamp, $id);
// save this revision in the attic
$atticFile = wikiFN($id, $timestamp, true);
io_saveFile($atticFile, $text, false);
// send OK to the browser
echo 'OK';
}
开发者ID:richmahn,项目名称:Door43,代码行数:32,代码来源:RegisterEdit.php
示例2: pagefromtemplate
function pagefromtemplate(&$event, $param)
{
if (strlen(trim($_REQUEST['newpagetemplate'])) > 0) {
global $conf;
global $INFO;
global $ID;
$tpl = io_readFile(wikiFN($_REQUEST['newpagetemplate']));
if ($this->getConf('userreplace')) {
$stringvars = array_map(create_function('$v', 'return explode(",",$v,2);'), explode(';', $_REQUEST['newpagevars']));
foreach ($stringvars as $value) {
$tpl = str_replace(trim($value[0]), trim($value[1]), $tpl);
}
}
if ($this->getConf('standardreplace')) {
// replace placeholders
$file = noNS($ID);
$page = strtr($file, '_', ' ');
$tpl = str_replace(array('@ID@', '@NS@', '@FILE@', '@!FILE@', '@!FILE!@', '@PAGE@', '@!PAGE@', '@!!PAGE@', '@!PAGE!@', '@USER@', '@NAME@', '@MAIL@', '@DATE@'), array($ID, getNS($ID), $file, utf8_ucfirst($file), utf8_strtoupper($file), $page, utf8_ucfirst($page), utf8_ucwords($page), utf8_strtoupper($page), $_SERVER['REMOTE_USER'], $INFO['userinfo']['name'], $INFO['userinfo']['mail'], $conf['dformat']), $tpl);
// we need the callback to work around strftime's char limit
$tpl = preg_replace_callback('/%./', create_function('$m', 'return strftime($m[0]);'), $tpl);
}
$event->result = $tpl;
$event->preventDefault();
}
}
开发者ID:jasongrout,项目名称:dokuwiki-newpagetemplate,代码行数:25,代码来源:action.php
示例3: _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;
}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:28,代码来源:tpl_functions.php
示例4: action_randompage
function action_randompage(&$event, $args)
{
global $conf;
global $ID;
$data = array();
$dir = $conf['savedir'];
$data = file($dir . '/index/page.idx');
//We loops through ten random page...
$i = 1;
while ($i <= 10 & $i != "ok") {
//echo $i;
$i++;
$id = rtrim($data[array_rand($data, 1)]);
$testACL = auth_aclcheck($id, $_SERVER['REMOTE_USER'], $USERINFO['grps']);
if ($testACL > 1 and file_exists(wikiFN($id))) {
$i = "ok";
//echo $id;
}
}
if ($testACL < 1) {
$id = $ID;
}
header("Location: " . wl($id, '', true));
//echo wl($page,'',true);
exit;
}
开发者ID:raster,项目名称:DokuWiki-randompage,代码行数:26,代码来源:action.php
示例5: document_start
function document_start()
{
global $ID;
if (!@file_exists(wikiFN($ID))) {
$this->persistent['date']['created'] = time();
}
parent::document_start();
}
开发者ID:virk,项目名称:dokuwiki-strata,代码行数:8,代码来源:renderer.php
示例6: getAllPages
function getAllPages()
{
$namespace = $this->getConf("translationns");
$dir = dirname(wikiFN("{$namespace}:foo"));
$pages = array();
search($pages, $dir, 'search_allpages', array());
return $pages;
}
开发者ID:splitbrain,项目名称:dokuwiki-plugin-translation,代码行数:8,代码来源:admin.php
示例7: get_epub
function get_epub($event, $param)
{
global $ID;
global $USERINFO;
if (!isset($USERINFO)) {
return;
}
$user = $USERINFO['name'];
global $ACT;
global $INFO;
if ($ACT != 'show') {
return;
}
if (!$this->helper) {
$this->helper = $this->loadHelper('epub', true);
}
if (!$this->helper->is_inCache($INFO['id'])) {
return;
}
//cache set in syntax.php
if (strpos($INFO['id'], 'epub') === false) {
return;
}
$wiki_file = wikiFN($INFO['id']);
if (!@file_exists($wiki_file)) {
return;
}
$epub_group = $this->getConf('group');
$groups = $USERINFO['grps'];
$auth = auth_quickaclcheck('epub:*');
if ($auth < 8 && !in_array($epub_group, $groups)) {
return;
}
$auth = auth_quickaclcheck($INFO['id']);
if ($auth < 4) {
return;
}
$client = $INFO['client'];
$button_name = $this->getLang('button_start');
//"Start"; //$this->getLang('btn_generate');
$button = "<form class='button'>";
$button .= "<div class='no' id='show_throbberbutton'><input type='button' value='{$button_name}' class='button' title='start' onclick=\"_epub_show_throbber('{$user}','{$client}');\"/>";
$button .= " ";
$button .= $this->getLang('label_start');
//"Click the Start Button to Create your eBook";
$button .= "</div></form>";
echo $button;
$id = $INFO['id'];
$button_name = $this->getLang('button_remove');
$button = "<p><form class='button'>";
$button .= "<div class='no' id='epub_remove_button'><input type='button' value='{$button_name}' class='button' title='start' onclick=\"epub_remove_creator('{$id}');\"/></div></form>";
$button .= '</br>' . $this->locale_xhtml('remove') . '</p>';
echo $button;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:54,代码来源:action.php
示例8: test_futurerev
/**
* test a future revision
*
*/
function test_futurerev()
{
$rev = 1385051947;
$revsexpected = '';
//set a known timestamp
touch(wikiFN($this->pageid), $rev);
$rev += 1;
$pagelog = new PageChangeLog($this->pageid, $chunk_size = 8192);
$revs = $pagelog->getLastRevisionAt($rev);
$this->assertEquals($revsexpected, $revs);
}
开发者ID:richmahn,项目名称:Door43,代码行数:15,代码来源:changelog_getlastrevisionat.test.php
示例9: cleanPage
protected function cleanPage($pageId)
{
$filename = wikiFN($pageId);
if (!file_exists($filename)) {
throw new \Exception('Cannot delete page. It does not exist');
}
$this->logger('delete', $filename);
unlink($filename);
$this->logger('sweepNS', '[datadir]');
io_sweepNS($pageId, 'datadir');
}
开发者ID:yurii-github,项目名称:dokuwiki-plugin-yktools,代码行数:11,代码来源:Edit.php
示例10: test_rename_to_new_page
function test_rename_to_new_page()
{
$newid = 'new_id_1';
$oldpid = $this->indexer->getPID($this->old_id);
$this->assertTrue($this->indexer->renamePage($this->old_id, $newid), 'Renaming the page to a new id failed');
io_rename(wikiFN($this->old_id), wikiFN($newid));
$this->assertNotEquals($this->indexer->getPID($this->old_id), $oldpid, 'PID for the old page unchanged after rename.');
$this->assertEquals($this->indexer->getPID($newid), $oldpid, 'New page has not the old pid.');
$query = array('old');
$this->assertEquals(array('old' => array($newid => 1)), $this->indexer->lookup($query), '"Old" doesn\'t find the new page');
}
开发者ID:richmahn,项目名称:Door43,代码行数:11,代码来源:indexer_rename.test.php
示例11: get_template
/**
* Handler to load page template.
*
* @param Doku_Event $event event object by reference
* @param mixed $param [the parameters passed as fifth argument to register_hook() when this
* handler was registered]
* @return void
*/
public function get_template(Doku_Event &$event, $param)
{
if (strlen($_REQUEST['copyfrom']) > 0) {
$template_id = $_REQUEST['copyfrom'];
if (auth_quickaclcheck($template_id) >= AUTH_READ) {
$tpl = io_readFile(wikiFN($template_id));
$event->data['tpl'] = $tpl;
$event->preventDefault();
}
}
}
开发者ID:Grahack,项目名称:dokuwiki-copypage-plugin,代码行数:19,代码来源:action.php
示例12: indexmenu_search_index
function indexmenu_search_index(&$data, $base, $file, $type, $lvl, $opts)
{
global $conf;
$ret = true;
$item = array();
if ($type == 'f' && !preg_match('#\\.txt$#', $file)) {
// don't add
return false;
}
// get page id by filename
$id = pathID($file);
// check hiddens
if ($type == 'f' && isHiddenPage($id)) {
return false;
}
// bugfix for the
// /ns/
// /<ns>.txt
// case, need to force the 'directory' type
if ($type == 'f' && file_exists(dirname(wikiFN($id . ":" . noNS($id))))) {
$type = 'd';
}
// page target id = global id
$target = $id;
if ($type == 'd') {
// this will check 3 kinds of headpage:
// 1. /<ns>/<ns>.txt
// 2. /<ns>/
// /<ns>.txt
// 3. /<ns>/
// /<ns>/<start_page>
$nsa = array($id . ":" . noNS($id), $id, $id . ":" . $conf['start']);
$nspage = false;
foreach ($nsa as $nsp) {
if (@file_exists(wikiFN($nsp)) && auth_quickaclcheck($nsp) >= AUTH_READ) {
$nspage = $nsp;
break;
}
}
//headpage exists
if ($nspage) {
$target = $nspage;
} else {
// open namespace index, if headpage does not exists
$target = $target . ':';
}
}
$data[] = array('id' => $id, 'date' => @filectime(wikiFN($target)), 'type' => $type, 'target' => $target, 'title' => $conf['useheading'] && ($title = p_get_first_heading($target)) ? $title : $id, 'level' => $lvl);
if (substr_count($id, ":") > 2) {
$ret = 0;
}
return $ret;
}
开发者ID:jacobbates,项目名称:Help-Desk-Wiki-Theme,代码行数:53,代码来源:generate_index.php
示例13: after_action
/**
* Executed after performing the action hooks
*
* Increases counter and purge cache
*/
public function after_action()
{
if ($this->autoinc) {
global $ID;
p_set_metadata($ID, array('bureaucracy' => array($this->get_key() => $this->opt['value'] + 1)));
// Force rerendering by removing the instructions cache file
$cache_fn = getCacheName(wikiFN($ID) . $_SERVER['HTTP_HOST'] . $_SERVER['SERVER_PORT'], '.' . 'i');
if (file_exists($cache_fn)) {
unlink($cache_fn);
}
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:17,代码来源:number.php
示例14: handle_dokuwiki_started
public function handle_dokuwiki_started(&$event, $param)
{
global $ID, $ACT, $REV;
if ($ACT != 'show' && $ACT != '' || $REV) {
return;
}
$page = p_get_metadata($ID, 'relation isreplacedby');
// return if no redirection data
if (empty($page)) {
return;
}
if (isset($_GET['redirect'])) {
// return if redirection is temporarily disabled,
// or we have been redirected 5 times in a row
if ($_GET['redirect'] == 'no' || $_GET['redirect'] > 4) {
return;
} elseif ($_GET['redirect'] > 0) {
$redirect = $_GET['redirect'] + 1;
} else {
$redirect = 1;
}
} else {
$redirect = 1;
}
// verify metadata currency
if (@filemtime(metaFN($ID, '.meta')) < @filemtime(wikiFN($ID))) {
return;
}
// preserve #section from $page
list($page, $section) = explode('#', $page, 2);
if (isset($section)) {
$section = '#' . $section;
} else {
$section = '';
}
// prepare link for internal redirects, keep external targets
if (!preg_match('#^https?://#i', $page)) {
$page = wl($page, array('redirect' => $redirect), TRUE, '&');
if (!headers_sent() && $this->getConf('show_note')) {
// remember to show note about being redirected from another page
session_start();
$_SESSION[DOKU_COOKIE]['redirect'] = $ID;
}
}
// redirect
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $page . $section . $_SERVER['QUERY_STRING']);
exit;
}
开发者ID:phillip-hopper,项目名称:dokuwiki-plugin-pageredirect,代码行数:49,代码来源:action.php
示例15: label_document
function label_document()
{
//For links
if (isset($this->info['current_file_id'])) {
$cleanid = $this->info['current_file_id'];
} else {
$cleanid = noNS(cleanID($this->info['current_id'], TRUE));
}
$this->putcmd("label{" . md5($cleanid) . "}");
if (isset($this->info['current_file_id'])) {
$this->putnl("%%Start: " . $cleanid . ' => ' . $this->info['current_file_id']);
} else {
$this->putnl("%%Start: " . $cleanid . ' => ' . wikiFN($cleanid));
}
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:15,代码来源:latex.php
示例16: call
protected function call($params)
{
$id = cleanID($params['id']);
if (!file_exists(wikiFN($id))) {
// return an error and exit;
$this->error(404);
}
$range = $params['range'];
if (!isset($range['from']) || !isset($range['to'])) {
// an error with a specific message, and exit
$this->error(400, "range must have a from proterty and a to property");
}
// return the slice
return rawWikiSlices($range['from'] . '-' . $range['to'], $id)[1];
}
开发者ID:roverrobot,项目名称:components,代码行数:15,代码来源:example.php
示例17: getSidebarFN
function getSidebarFN($ns, $file)
{
// check for wiki page = $ns:$file (or $file where no namespace)
$nsFile = $ns ? "{$ns}:{$file}" : $file;
if (file_exists(wikiFN($nsFile)) && auth_quickaclcheck($nsFile)) {
return $nsFile;
}
// remove deepest namespace level and call function recursively
// no namespace left, exit with no file found
if (!$ns) {
return '';
}
$i = strrpos($ns, ":");
$ns = $i ? substr($ns, 0, $i) : false;
return getSidebarFN($ns, $file);
}
开发者ID:pietersartain,项目名称:dokuwiki-template-pq,代码行数:16,代码来源:tplfn_sidebar.php
示例18: setUp
function setUp()
{
global $ID, $conf;
parent::setUp();
$ID = 'cached';
$file = wikiFN($ID);
$conf['cachetime'] = 0;
// ensure the value is not -1, which disables caching
saveWikiText($ID, 'Content', 'Created');
$this->cache = new cache_renderer($ID, $file, 'xhtml');
$this->cache->storeCache('Test');
// set the modification times explicitly (overcome Issue #694)
$time = time();
touch($file, $time - 1);
touch($this->cache->cache, $time);
}
开发者ID:richmahn,项目名称:Door43,代码行数:16,代码来源:cache_use.test.php
示例19: 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;
}
开发者ID:TorMec,项目名称:Dokuwiki-Nav-Overlay,代码行数:47,代码来源:action.php
示例20: clearLock
function clearLock($WIKI_ID)
{
global $USERNAME;
if (!file_exists(wikiFN($WIKI_ID))) {
fwrite(STDERR, "{$WIKI_ID} does not yet exist\n");
}
$_SERVER['REMOTE_USER'] = $USERNAME;
if (checklock($WIKI_ID)) {
fwrite(STDERR, "Page {$WIKI_ID} is locked by another user\n");
exit(1);
}
unlock($WIKI_ID);
if (file_exists(wikiLockFN($WIKI_ID))) {
fwrite(STDERR, "Unable to clear lock for {$WIKI_ID}\n");
exit(1);
}
}
开发者ID:stretchyboy,项目名称:dokuwiki,代码行数:17,代码来源:dwpage.php
注:本文中的wikiFN函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论