summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-07-01 13:27:34 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-07-01 13:27:34 +0200
commit3f8531c4cdc3b4caf157a1b1e954e160be82064b (patch)
tree69e4ab5add04cfe1c63f515c80a37651bd5b54e8 /inc
parent148205530159f4b6ce26df1c56dd8c461ec1f769 (diff)
parent19cd38771326eea15b458a160845dfa200c5f9e6 (diff)
downloadrpg-3f8531c4cdc3b4caf157a1b1e954e160be82064b.tar.gz
rpg-3f8531c4cdc3b4caf157a1b1e954e160be82064b.tar.bz2
Merge pull request #1215 from splitbrain/wikisyntaxpage
Wiki syntax page and minor
Diffstat (limited to 'inc')
-rw-r--r--inc/changelog.php13
-rw-r--r--inc/pageutils.php26
-rw-r--r--inc/parserutils.php19
3 files changed, 37 insertions, 21 deletions
diff --git a/inc/changelog.php b/inc/changelog.php
index d1ef7973e..f4731021c 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -849,18 +849,17 @@ abstract class ChangeLog {
public function isCurrentRevision($rev) {
return $rev == @filemtime($this->getFilename());
}
-
+
/**
- * Return an existing revision for a specific date which is
+ * Return an existing revision for a specific date which is
* the current one or younger or equal then the date
*
- * @param string $id
* @param number $date_at timestamp
* @return string revision ('' for current)
*/
function getLastRevisionAt($date_at){
//requested date_at(timestamp) younger or equal then modified_time($this->id) => load current
- if($date_at >= @filemtime($this->getFilename())) {
+ if($date_at >= @filemtime($this->getFilename())) {
return '';
} else if ($rev = $this->getRelativeRevision($date_at+1, -1)) { //+1 to get also the requested date revision
return $rev;
@@ -1049,6 +1048,12 @@ class MediaChangelog extends ChangeLog {
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id
+ * @param int $rev
+ * @param int $chunk_size
+ * @param bool $media
+ * @return array|bool
*/
function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
dbg_deprecated('class PageChangeLog or class MediaChangelog');
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 375712661..a5bf039d5 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -243,7 +243,6 @@ function sectionID($title,&$check) {
return $title;
}
-
/**
* Wiki page existence check
*
@@ -251,9 +250,10 @@ function sectionID($title,&$check) {
*
* @author Chris Smith <chris@jalakai.co.uk>
*
- * @param string $id page id
- * @param string|int $rev empty or revision timestamp
- * @param bool $clean flag indicating that $id should be cleaned (see wikiFN as well)
+ * @param string $id page id
+ * @param string|int $rev empty or revision timestamp
+ * @param bool $clean flag indicating that $id should be cleaned (see wikiFN as well)
+ * @param bool $date_at
* @return bool exists?
*/
function page_exists($id,$rev='',$clean=true, $date_at=false) {
@@ -489,9 +489,11 @@ function resolve_id($ns,$id,$clean=true){
*
* @author Andreas Gohr <andi@splitbrain.org>
*
- * @param string $ns namespace which is context of id
- * @param string &$page (reference) relative media id, updated to resolved id
- * @param bool &$exists (reference) updated with existance of media
+ * @param string $ns namespace which is context of id
+ * @param string &$page (reference) relative media id, updated to resolved id
+ * @param bool &$exists (reference) updated with existance of media
+ * @param int|string $rev
+ * @param bool $date_at
*/
function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
$page = resolve_id($ns,$page);
@@ -502,7 +504,7 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
$rev = $medialog_rev;
}
}
-
+
$file = mediaFN($page,$rev);
$exists = file_exists($file);
}
@@ -512,9 +514,11 @@ function resolve_mediaid($ns,&$page,&$exists,$rev='',$date_at=false){
*
* @author Andreas Gohr <andi@splitbrain.org>
*
- * @param string $ns namespace which is context of id
- * @param string &$page (reference) relative page id, updated to resolved id
- * @param bool &$exists (reference) updated with existance of media
+ * @param string $ns namespace which is context of id
+ * @param string &$page (reference) relative page id, updated to resolved id
+ * @param bool &$exists (reference) updated with existance of media
+ * @param string $rev
+ * @param bool $date_at
*/
function resolve_pageid($ns,&$page,&$exists,$rev='',$date_at=false ){
global $conf;
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 8650f974f..5b96d39fe 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -121,15 +121,21 @@ function p_cached_output($file, $format='xhtml', $id='') {
$cache = new cache_renderer($id, $file, $format);
if ($cache->useCache()) {
$parsed = $cache->retrieveCache(false);
- if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- cachefile {$cache->cache} used -->\n";
+ if($conf['allowdebug'] && $format=='xhtml') {
+ $parsed .= "\n<!-- cachefile {$cache->cache} used -->\n";
+ }
} else {
$parsed = p_render($format, p_cached_instructions($file,false,$id), $info);
if ($info['cache'] && $cache->storeCache($parsed)) { // storeCache() attempts to save cachefile
- if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- no cachefile used, but created {$cache->cache} -->\n";
+ if($conf['allowdebug'] && $format=='xhtml') {
+ $parsed .= "\n<!-- no cachefile used, but created {$cache->cache} -->\n";
+ }
}else{
$cache->removeCache(); //try to delete cachefile
- if($conf['allowdebug'] && $format=='xhtml') $parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
+ if($conf['allowdebug'] && $format=='xhtml') {
+ $parsed .= "\n<!-- no cachefile used, caching forbidden -->\n";
+ }
}
}
@@ -616,8 +622,9 @@ function p_sort_modes($a, $b){
* @author Andreas Gohr <andi@splitbrain.org>
*
* @param string $mode
- * @param array|null|false $instructions
- * @param array $info returns render info like enabled toc and cache
+ * @param array|null|false $instructions
+ * @param array $info returns render info like enabled toc and cache
+ * @param string $date_at
* @return null|string rendered output
*/
function p_render($mode,$instructions,&$info,$date_at=''){
@@ -632,7 +639,7 @@ function p_render($mode,$instructions,&$info,$date_at=''){
if($date_at) {
$Renderer->date_at = $date_at;
}
-
+
$Renderer->smileys = getSmileys();
$Renderer->entities = getEntities();
$Renderer->acronyms = getAcronyms();