summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/HTTPClient.php4
-rw-r--r--inc/Input.class.php20
-rw-r--r--inc/TarLib.class.php2
-rw-r--r--inc/cache.php27
-rw-r--r--inc/changelog.php49
-rw-r--r--inc/cli.php647
-rw-r--r--inc/cliopts.php1
-rw-r--r--inc/common.php179
-rw-r--r--inc/form.php10
-rw-r--r--inc/html.php4
-rw-r--r--inc/indexer.php15
-rw-r--r--inc/infoutils.php36
-rw-r--r--inc/lang/bg/lang.php30
-rw-r--r--inc/lang/bg/register.txt2
-rw-r--r--inc/lang/bg/resendpwd.txt2
-rw-r--r--inc/lang/cs/lang.php5
-rw-r--r--inc/lang/de/lang.php5
-rw-r--r--inc/lang/en/lang.php1
-rw-r--r--inc/lang/eo/denied.txt2
-rw-r--r--inc/lang/eo/lang.php9
-rw-r--r--inc/lang/es/jquery.ui.datepicker.js4
-rw-r--r--inc/lang/es/lang.php25
-rw-r--r--inc/lang/fr/lang.php26
-rw-r--r--inc/lang/fr/subscr_form.txt2
-rw-r--r--inc/lang/he/lang.php2
-rw-r--r--inc/lang/hu/lang.php9
-rw-r--r--inc/lang/id/lang.php110
-rw-r--r--inc/lang/id/resetpwd.txt3
-rw-r--r--inc/lang/id/subscr_digest.txt17
-rw-r--r--inc/lang/it/lang.php12
-rw-r--r--inc/lang/ja/lang.php10
-rw-r--r--inc/lang/ka/admin.txt4
-rw-r--r--inc/lang/ka/adminplugins.txt1
-rw-r--r--inc/lang/ka/backlinks.txt4
-rw-r--r--inc/lang/ka/conflict.txt5
-rw-r--r--inc/lang/ka/denied.txt3
-rw-r--r--inc/lang/ka/diff.txt3
-rw-r--r--inc/lang/ka/draft.txt3
-rw-r--r--inc/lang/ka/edit.txt2
-rw-r--r--inc/lang/ka/editrev.txt2
-rw-r--r--inc/lang/ka/index.txt1
-rw-r--r--inc/lang/ka/lang.php326
-rw-r--r--inc/lang/ko/lang.php46
-rw-r--r--inc/lang/ko/searchpage.txt2
-rw-r--r--inc/lang/ko/subscr_digest.txt2
-rw-r--r--inc/lang/ko/updateprofile.txt2
-rw-r--r--inc/lang/nl/lang.php7
-rw-r--r--inc/lang/no/lang.php11
-rw-r--r--inc/lang/no/resetpwd.txt3
-rw-r--r--inc/lang/pl/lang.php8
-rw-r--r--inc/lang/ru/lang.php1
-rw-r--r--inc/lang/sl/lang.php11
-rw-r--r--inc/lang/tr/lang.php11
-rw-r--r--inc/lang/tr/subscr_form.txt3
-rw-r--r--inc/lang/zh/lang.php10
-rw-r--r--inc/load.php4
-rw-r--r--inc/media.php18
-rw-r--r--inc/pageutils.php73
-rw-r--r--inc/parser/code.php12
-rw-r--r--inc/parser/handler.php73
-rw-r--r--inc/parser/metadata.php575
-rw-r--r--inc/parser/renderer.php763
-rw-r--r--inc/parser/xhtml.php1040
-rw-r--r--inc/parserutils.php8
-rw-r--r--inc/plugin.php3
-rw-r--r--inc/search.php36
-rw-r--r--inc/subscription.php9
-rw-r--r--inc/template.php24
68 files changed, 3518 insertions, 861 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index 53f3c9a78..b5956a7f8 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -343,7 +343,7 @@ class HTTPClient {
try {
//set non-blocking
- stream_set_blocking($socket, false);
+ stream_set_blocking($socket, 0);
// build request
$request = "$method $request_url HTTP/".$this->http.HTTP_NL;
@@ -552,7 +552,7 @@ class HTTPClient {
$request = "CONNECT {$requestinfo['host']}:{$requestinfo['port']} HTTP/1.0".HTTP_NL;
$request .= "Host: {$requestinfo['host']}".HTTP_NL;
if($this->proxy_user) {
- $request .= 'Proxy-Authorization Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass).HTTP_NL;
+ $request .= 'Proxy-Authorization: Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass).HTTP_NL;
}
$request .= HTTP_NL;
diff --git a/inc/Input.class.php b/inc/Input.class.php
index de8bf5b97..e7eef1c29 100644
--- a/inc/Input.class.php
+++ b/inc/Input.class.php
@@ -144,6 +144,26 @@ class Input {
}
/**
+ * Access a request parameter and make sure it is has a valid value
+ *
+ * Please note that comparisons to the valid values are not done typesafe (request vars
+ * are always strings) however the function will return the correct type from the $valids
+ * array when an match was found.
+ *
+ * @param string $name Parameter name
+ * @param array $valids Array of valid values
+ * @param mixed $default Default to return if parameter isn't set or not valid
+ * @return null|mixed
+ */
+ public function valid($name, $valids, $default = null) {
+ if(!isset($this->access[$name])) return $default;
+ if(is_array($this->access[$name])) return $default; // we don't allow arrays
+ $found = array_search($this->access[$name], $valids);
+ if($found !== false) return $valids[$found]; // return the valid value for type safety
+ return $default;
+ }
+
+ /**
* Access a request parameter as bool
*
* Note: $nonempty is here for interface consistency and makes not much sense for booleans
diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php
index ae08039ec..dd319a79a 100644
--- a/inc/TarLib.class.php
+++ b/inc/TarLib.class.php
@@ -26,6 +26,8 @@ class TarLib {
public $_result = true;
function __construct($file, $comptype = TarLib::COMPRESS_AUTO, $complevel = 9) {
+ dbg_deprecated('class Tar');
+
if(!$file) $this->error('__construct', '$file');
$this->file = $file;
diff --git a/inc/cache.php b/inc/cache.php
index 56c5b65f2..6817e771b 100644
--- a/inc/cache.php
+++ b/inc/cache.php
@@ -16,10 +16,11 @@ class cache {
public $ext = ''; // file ext for cache data, secondary identifier for this item
public $cache = ''; // cache file name
public $depends = array(); // array containing cache dependency information,
- // used by _useCache to determine cache validity
+ // used by _useCache to determine cache validity
var $_event = ''; // event to be triggered during useCache
var $_time;
+ var $_nocache = false; // if set to true, cache will not be used or stored
/**
* @param string $key primary identifier
@@ -34,7 +35,7 @@ class cache {
/**
* public method to determine whether the cache can be used
*
- * to assist in cetralisation of event triggering and calculation of cache statistics,
+ * to assist in centralisation of event triggering and calculation of cache statistics,
* don't override this function override _useCache()
*
* @param array $depends array of cache dependencies, support dependecies:
@@ -71,6 +72,7 @@ class cache {
*/
public function _useCache() {
+ if ($this->_nocache) return false; // caching turned off
if (!empty($this->depends['purge'])) return false; // purge requested?
if (!($this->_time = @filemtime($this->cache))) return false; // cache exists?
@@ -115,6 +117,8 @@ class cache {
* @return bool true on success, false otherwise
*/
public function storeCache($data) {
+ if ($this->_nocache) return false;
+
return io_savefile($this->cache, $data);
}
@@ -174,6 +178,7 @@ class cache_parser extends cache {
public $file = ''; // source file for cache
public $mode = ''; // input mode (represents the processing the input file will undergo)
+ public $page = '';
var $_event = 'PARSER_CACHE_USE';
@@ -203,10 +208,6 @@ class cache_parser extends cache {
}
protected function _addDependencies() {
- global $conf;
-
- $this->depends['age'] = isset($this->depends['age']) ?
- min($this->depends['age'],$conf['cachetime']) : $conf['cachetime'];
// parser cache file dependencies ...
$files = array($this->file, // ... source
@@ -265,6 +266,18 @@ class cache_renderer extends cache_parser {
}
protected function _addDependencies() {
+ global $conf;
+
+ // default renderer cache file 'age' is dependent on 'cachetime' setting, two special values:
+ // -1 : do not cache (should not be overridden)
+ // 0 : cache never expires (can be overridden) - no need to set depends['age']
+ if ($conf['cachetime'] == -1) {
+ $this->_nocache = true;
+ return;
+ } elseif ($conf['cachetime'] > 0) {
+ $this->depends['age'] = isset($this->depends['age']) ?
+ min($this->depends['age'],$conf['cachetime']) : $conf['cachetime'];
+ }
// renderer cache file dependencies ...
$files = array(
@@ -317,6 +330,8 @@ class cache_instructions extends cache_parser {
* @return bool true on success, false otherwise
*/
public function storeCache($instructions) {
+ if ($this->_nocache) return false;
+
return io_savefile($this->cache,serialize($instructions));
}
}
diff --git a/inc/changelog.php b/inc/changelog.php
index de06c9683..8c14f21b0 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -18,6 +18,9 @@ define('DOKU_CHANGE_TYPE_REVERT', 'R');
* parses a changelog line into it's components
*
* @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $line changelog line
+ * @return array|bool parsed line or false
*/
function parseChangelogLine($line) {
$tmp = explode("\t", $line);
@@ -43,7 +46,7 @@ function parseChangelogLine($line) {
* @param String $summary Summary of the change
* @param mixed $extra In case of a revert the revision (timestmp) of the reverted page
* @param array $flags Additional flags in a key value array.
- * Availible flags:
+ * Available flags:
* - ExternalEdit - mark as an external edit.
*
* @author Andreas Gohr <andi@splitbrain.org>
@@ -116,6 +119,15 @@ function addLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extr
* @author Andreas Gohr <andi@splitbrain.org>
* @author Esther Brunner <wikidesign@gmail.com>
* @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param int $date Timestamp of the change
+ * @param String $id Name of the affected page
+ * @param String $type Type of the change see DOKU_CHANGE_TYPE_*
+ * @param String $summary Summary of the change
+ * @param mixed $extra In case of a revert the revision (timestmp) of the reverted page
+ * @param array $flags Additional flags in a key value array.
+ * Available flags:
+ * - (none, so far)
*/
function addMediaLogEntry($date, $id, $type=DOKU_CHANGE_TYPE_EDIT, $summary='', $extra='', $flags=null){
global $conf;
@@ -294,6 +306,12 @@ function getRecentsSince($from,$to=null,$ns='',$flags=0){
* @see getRecents()
* @author Andreas Gohr <andi@splitbrain.org>
* @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $line changelog line
+ * @param string $ns restrict to given namespace
+ * @param int $flags flags to control which changes are included
+ * @param array $seen listing of seen pages
+ * @return array|bool false or array with info about a change
*/
function _handleRecent($line,$ns,$flags,&$seen){
if(empty($line)) return false; //skip empty lines
@@ -778,9 +796,9 @@ abstract class ChangeLog {
* Read chunk and return array with lines of given chunck.
* Has no check if $head and $tail are really at a new line
*
- * @param $fp resource filepointer
- * @param $head int start point chunck
- * @param $tail int end point chunck
+ * @param resource $fp resource filepointer
+ * @param int $head start point chunck
+ * @param int $tail end point chunck
* @return array lines read from chunck
*/
protected function readChunk($fp, $head, $tail) {
@@ -804,8 +822,8 @@ abstract class ChangeLog {
/**
* Set pointer to first new line after $finger and return its position
*
- * @param resource $fp filepointer
- * @param $finger int a pointer
+ * @param resource $fp filepointer
+ * @param int $finger a pointer
* @return int pointer
*/
protected function getNewlinepointer($fp, $finger) {
@@ -886,7 +904,7 @@ abstract class ChangeLog {
*/
protected function retrieveRevisionsAround($rev, $max) {
//get lines from changelog
- list($fp, $lines, $starthead, $starttail, $eof) = $this->readloglines($rev);
+ list($fp, $lines, $starthead, $starttail, /* $eof */) = $this->readloglines($rev);
if(empty($lines)) return false;
//parse chunk containing $rev, and read forward more chunks until $max/2 is reached
@@ -1004,12 +1022,13 @@ class MediaChangelog extends ChangeLog {
* changelog files, only the chunk containing the
* requested changelog line is read.
*
- * @deprecated 20-11-2013
+ * @deprecated 2013-11-20
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
*/
function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
+ dbg_deprecated('class PageChangeLog or class MediaChangelog');
if($media) {
$changelog = new MediaChangeLog($id, $chunk_size);
} else {
@@ -1024,10 +1043,6 @@ function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
* only that a line with the date exists in the changelog.
* By default the current revision is skipped.
*
- * id: the page of interest
- * first: skip the first n changelog lines
- * num: number of revisions to return
- *
* The current revision is automatically skipped when the page exists.
* See $INFO['meta']['last_change'] for the current revision.
*
@@ -1036,12 +1051,20 @@ function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) {
* backwards in chunks until the requested number of changelog
* lines are recieved.
*
- * @deprecated 20-11-2013
+ * @deprecated 2013-11-20
*
* @author Ben Coburn <btcoburn@silicodon.net>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id the page of interest
+ * @param int $first skip the first n changelog lines
+ * @param int $num number of revisions to return
+ * @param int $chunk_size
+ * @param bool $media
+ * @return array
*/
function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) {
+ dbg_deprecated('class PageChangeLog or class MediaChangelog');
if($media) {
$changelog = new MediaChangeLog($id, $chunk_size);
} else {
diff --git a/inc/cli.php b/inc/cli.php
new file mode 100644
index 000000000..25bfddf7d
--- /dev/null
+++ b/inc/cli.php
@@ -0,0 +1,647 @@
+<?php
+
+/**
+ * Class DokuCLI
+ *
+ * All DokuWiki commandline scripts should inherit from this class and implement the abstract methods.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+abstract class DokuCLI {
+ /** @var string the executed script itself */
+ protected $bin;
+ /** @var DokuCLI_Options the option parser */
+ protected $options;
+ /** @var DokuCLI_Colors */
+ public $colors;
+
+ /**
+ * constructor
+ *
+ * Initialize the arguments, set up helper classes and set up the CLI environment
+ */
+ public function __construct() {
+ set_exception_handler(array($this, 'fatal'));
+
+ $this->options = new DokuCLI_Options();
+ $this->colors = new DokuCLI_Colors();
+ }
+
+ /**
+ * Register options and arguments on the given $options object
+ *
+ * @param DokuCLI_Options $options
+ * @return void
+ */
+ abstract protected function setup(DokuCLI_Options $options);
+
+ /**
+ * Your main program
+ *
+ * Arguments and options have been parsed when this is run
+ *
+ * @param DokuCLI_Options $options
+ * @return void
+ */
+ abstract protected function main(DokuCLI_Options $options);
+
+ /**
+ * Execute the CLI program
+ *
+ * Executes the setup() routine, adds default options, initiate the options parsing and argument checking
+ * and finally executes main()
+ */
+ public function run() {
+ if('cli' != php_sapi_name()) throw new DokuCLI_Exception('This has to be run from the command line');
+
+ // setup
+ $this->setup($this->options);
+ $this->options->registerOption(
+ 'no-colors',
+ 'Do not use any colors in output. Useful when piping output to other tools or files.'
+ );
+ $this->options->registerOption(
+ 'help',
+ 'Display this help screen and exit immeadiately.',
+ 'h'
+ );
+
+ // parse
+ $this->options->parseOptions();
+
+ // handle defaults
+ if($this->options->getOpt('no-colors')) {
+ $this->colors->disable();
+ }
+ if($this->options->getOpt('help')) {
+ echo $this->options->help();
+ exit(0);
+ }
+
+ // check arguments
+ $this->options->checkArguments();
+
+ // execute
+ $this->main($this->options);
+
+ exit(0);
+ }
+
+ /**
+ * Exits the program on a fatal error
+ *
+ * @param Exception|string $error either an exception or an error message
+ */
+ public function fatal($error) {
+ $code = 0;
+ if(is_object($error) && is_a($error, 'Exception')) {
+ /** @var Exception $error */
+ $code = $error->getCode();
+ $error = $error->getMessage();
+ }
+ if(!$code) $code = DokuCLI_Exception::E_ANY;
+
+ $this->error($error);
+ exit($code);
+ }
+
+ /**
+ * Print an error message
+ *
+ * @param $string
+ */
+ public function error($string) {
+ $this->colors->ptln("E: $string", 'red', STDERR);
+ }
+
+ /**
+ * Print a success message
+ *
+ * @param $string
+ */
+ public function success($string) {
+ $this->colors->ptln("S: $string", 'green', STDERR);
+ }
+
+ /**
+ * Print an info message
+ *
+ * @param $string
+ */
+ public function info($string) {
+ $this->colors->ptln("I: $string", 'cyan', STDERR);
+ }
+
+}
+
+/**
+ * Class DokuCLI_Colors
+ *
+ * Handles color output on (Linux) terminals
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+class DokuCLI_Colors {
+ /** @var array known color names */
+ protected $colors = array(
+ 'reset' => "\33[0m",
+ 'black' => "\33[0;30m",
+ 'darkgray' => "\33[1;30m",
+ 'blue' => "\33[0;34m",
+ 'lightblue' => "\33[1;34m",
+ 'green' => "\33[0;32m",
+ 'lightgreen' => "\33[1;32m",
+ 'cyan' => "\33[0;36m",
+ 'lightcyan' => "\33[1;36m",
+ 'red' => "\33[0;31m",
+ 'lightred' => "\33[1;31m",
+ 'purple' => "\33[0;35m",
+ 'lightpurple' => "\33[1;35m",
+ 'brown' => "\33[0;33m",
+ 'yellow' => "\33[1;33m",
+ 'lightgray' => "\33[0;37m",
+ 'white' => "\33[1;37m",
+ );
+
+ /** @var bool should colors be used? */
+ protected $enabled = true;
+
+ /**
+ * Constructor
+ *
+ * Tries to disable colors for non-terminals
+ */
+ public function __construct() {
+ if(function_exists('posix_isatty') && !posix_isatty(STDOUT)) {
+ $this->enabled = false;
+ return;
+ }
+ if(!getenv('TERM')) {
+ $this->enabled = false;
+ return;
+ }
+ }
+
+ /**
+ * enable color output
+ */
+ public function enable() {
+ $this->enabled = true;
+ }
+
+ /**
+ * disable color output
+ */
+ public function disable() {
+ $this->enabled = false;
+ }
+
+ /**
+ * Convenience function to print a line in a given color
+ *
+ * @param $line
+ * @param $color
+ * @param resource $channel
+ */
+ public function ptln($line, $color, $channel = STDOUT) {
+ $this->set($color);
+ fwrite($channel, rtrim($line)."\n");
+ $this->reset();
+ }
+
+ /**
+ * Set the given color for consecutive output
+ *
+ * @param string $color one of the supported color names
+ * @throws DokuCLI_Exception
+ */
+ public function set($color) {
+ if(!$this->enabled) return;
+ if(!isset($this->colors[$color])) throw new DokuCLI_Exception("No such color $color");
+ echo $this->colors[$color];
+ }
+
+ /**
+ * reset the terminal color
+ */
+ public function reset() {
+ $this->set('reset');
+ }
+}
+
+/**
+ * Class DokuCLI_Options
+ *
+ * Parses command line options passed to the CLI script. Allows CLI scripts to easily register all accepted options and
+ * commands and even generates a help text from this setup.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+class DokuCLI_Options {
+ /** @var array keeps the list of options to parse */
+ protected $setup;
+
+ /** @var array store parsed options */
+ protected $options = array();
+
+ /** @var string current parsed command if any */
+ protected $command = '';
+
+ /** @var array passed non-option arguments */
+ public $args = array();
+
+ /** @var string the executed script */
+ protected $bin;
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ $this->setup = array(
+ '' => array(
+ 'opts' => array(),
+ 'args' => array(),
+ 'help' => ''
+ )
+ ); // default command
+
+ $this->args = $this->readPHPArgv();
+ $this->bin = basename(array_shift($this->args));
+
+ $this->options = array();
+ }
+
+ /**
+ * Sets the help text for the tool itself
+ *
+ * @param string $help
+ */
+ public function setHelp($help) {
+ $this->setup['']['help'] = $help;
+ }
+
+ /**
+ * Register the names of arguments for help generation and number checking
+ *
+ * This has to be called in the order arguments are expected
+ *
+ * @param string $arg argument name (just for help)
+ * @param string $help help text
+ * @param bool $required is this a required argument
+ * @param string $command if theses apply to a sub command only
+ * @throws DokuCLI_Exception
+ */
+ public function registerArgument($arg, $help, $required = true, $command = '') {
+ if(!isset($this->setup[$command])) throw new DokuCLI_Exception("Command $command not registered");
+
+ $this->setup[$command]['args'][] = array(
+ 'name' => $arg,
+ 'help' => $help,
+ 'required' => $required
+ );
+ }
+
+ /**
+ * This registers a sub command
+ *
+ * Sub commands have their own options and use their own function (not main()).
+ *
+ * @param string $command
+ * @param string $help
+ * @throws DokuCLI_Exception
+ */
+ public function registerCommand($command, $help) {
+ if(isset($this->setup[$command])) throw new DokuCLI_Exception("Command $command already registered");
+
+ $this->setup[$command] = array(
+ 'opts' => array(),
+ 'args' => array(),
+ 'help' => $help
+ );
+
+ }
+
+ /**
+ * Register an option for option parsing and help generation
+ *
+ * @param string $long multi character option (specified with --)
+ * @param string $help help text for this option
+ * @param string|null $short one character option (specified with -)
+ * @param bool|string $needsarg does this option require an argument? give it a name here
+ * @param string $command what command does this option apply to
+ * @throws DokuCLI_Exception
+ */
+ public function registerOption($long, $help, $short = null, $needsarg = false, $command = '') {
+ if(!isset($this->setup[$command])) throw new DokuCLI_Exception("Command $command not registered");
+
+ $this->setup[$command]['opts'][$long] = array(
+ 'needsarg' => $needsarg,
+ 'help' => $help,
+ 'short' => $short
+ );
+
+ if($short) {
+ if(strlen($short) > 1) throw new DokuCLI_Exception("Short options should be exactly one ASCII character");
+
+ $this->setup[$command]['short'][$short] = $long;
+ }
+ }
+
+ /**
+ * Checks the actual number of arguments against the required number
+ *
+ * Throws an exception if arguments are missing. Called from parseOptions()
+ *
+ * @throws DokuCLI_Exception
+ */
+ public function checkArguments() {
+ $argc = count($this->args);
+
+ $req = 0;
+ foreach($this->setup[$this->command]['args'] as $arg) {
+ if(!$arg['required']) break; // last required arguments seen
+ $req++;
+ }
+
+ if($req > $argc) throw new DokuCLI_Exception("Not enough arguments", DokuCLI_Exception::E_OPT_ARG_REQUIRED);
+ }
+
+ /**
+ * Parses the given arguments for known options and command
+ *
+ * The given $args array should NOT contain the executed file as first item anymore! The $args
+ * array is stripped from any options and possible command. All found otions can be accessed via the
+ * getOpt() function
+ *
+ * Note that command options will overwrite any global options with the same name
+ *
+ * @throws DokuCLI_Exception
+ */
+ public function parseOptions() {
+ $non_opts = array();
+
+ $argc = count($this->args);
+ for($i = 0; $i < $argc; $i++) {
+ $arg = $this->args[$i];
+
+ // The special element '--' means explicit end of options. Treat the rest of the arguments as non-options
+ // and end the loop.
+ if($arg == '--') {
+ $non_opts = array_merge($non_opts, array_slice($this->args, $i + 1));
+ break;
+ }
+
+ // '-' is stdin - a normal argument
+ if($arg == '-') {
+ $non_opts = array_merge($non_opts, array_slice($this->args, $i));
+ break;
+ }
+
+ // first non-option
+ if($arg{0} != '-') {
+ $non_opts = array_merge($non_opts, array_slice($this->args, $i));
+ break;
+ }
+
+ // long option
+ if(strlen($arg) > 1 && $arg{1} == '-') {
+ list($opt, $val) = explode('=', substr($arg, 2), 2);
+
+ if(!isset($this->setup[$this->command]['opts'][$opt])) {
+ throw new DokuCLI_Exception("No such option $arg", DokuCLI_Exception::E_UNKNOWN_OPT);
+ }
+
+ // argument required?
+ if($this->setup[$this->command]['opts'][$opt]['needsarg']) {
+ if(is_null($val) && $i + 1 < $argc && !preg_match('/^--?[\w]/', $this->args[$i + 1])) {
+ $val = $this->args[++$i];
+ }
+ if(is_null($val)) {
+ throw new DokuCLI_Exception("Option $arg requires an argument", DokuCLI_Exception::E_OPT_ARG_REQUIRED);
+ }
+ $this->options[$opt] = $val;
+ } else {
+ $this->options[$opt] = true;
+ }
+
+ continue;
+ }
+
+ // short option
+ $opt = substr($arg, 1);
+ if(!isset($this->setup[$this->command]['short'][$opt])) {
+ throw new DokuCLI_Exception("No such option $arg", DokuCLI_Exception::E_UNKNOWN_OPT);
+ } else {
+ $opt = $this->setup[$this->command]['short'][$opt]; // store it under long name
+ }
+
+ // argument required?
+ if($this->setup[$this->command]['opts'][$opt]['needsarg']) {
+ $val = null;
+ if($i + 1 < $argc && !preg_match('/^--?[\w]/', $this->args[$i + 1])) {
+ $val = $this->args[++$i];
+ }
+ if(is_null($val)) {
+ throw new DokuCLI_Exception("Option $arg requires an argument", DokuCLI_Exception::E_OPT_ARG_REQUIRED);
+ }
+ $this->options[$opt] = $val;
+ } else {
+ $this->options[$opt] = true;
+ }
+ }
+
+ // parsing is now done, update args array
+ $this->args = $non_opts;
+
+ // if not done yet, check if first argument is a command and reexecute argument parsing if it is
+ if(!$this->command && $this->args && isset($this->setup[$this->args[0]])) {
+ // it is a command!
+ $this->command = array_shift($this->args);
+ $this->parseOptions(); // second pass
+ }
+ }
+
+ /**
+ * Get the value of the given option
+ *
+ * Please note that all options are accessed by their long option names regardless of how they were
+ * specified on commandline.
+ *
+ * Can only be used after parseOptions() has been run
+ *
+ * @param string $option
+ * @param mixed $default what to return if the option was not set
+ * @return mixed
+ */
+ public function getOpt($option, $default = false) {
+ if(isset($this->options[$option])) return $this->options[$option];
+ return $default;
+ }
+
+ /**
+ * Return the found command if any
+ *
+ * @return string
+ */
+ public function getCmd() {
+ return $this->command;
+ }
+
+ /**
+ * Builds a help screen from the available options. You may want to call it from -h or on error
+ *
+ * @return string
+ */
+ public function help() {
+ $text = '';
+
+ $hascommands = (count($this->setup) > 1);
+ foreach($this->setup as $command => $config) {
+ $hasopts = (bool) $this->setup[$command]['opts'];
+ $hasargs = (bool) $this->setup[$command]['args'];
+
+ if(!$command) {
+ $text .= 'USAGE: '.$this->bin;
+ } else {
+ $text .= "\n$command";
+ }
+
+ if($hasopts) $text .= ' <OPTIONS>';
+
+ foreach($this->setup[$command]['args'] as $arg) {
+ if($arg['required']) {
+ $text .= ' <'.$arg['name'].'>';
+ } else {
+ $text .= ' [<'.$arg['name'].'>]';
+ }
+ }
+ $text .= "\n";
+
+ if($this->setup[$command]['help']) {
+ $text .= "\n";
+ $text .= $this->tableFormat(
+ array(2, 72),
+ array('', $this->setup[$command]['help']."\n")
+ );
+ }
+
+ if($hasopts) {
+ $text .= "\n OPTIONS\n\n";
+ foreach($this->setup[$command]['opts'] as $long => $opt) {
+
+ $name = '';
+ if($opt['short']) {
+ $name .= '-'.$opt['short'];
+ if($opt['needsarg']) $name .= ' <'.$opt['needsarg'].'>';
+ $name .= ', ';
+ }
+ $name .= "--$long";
+ if($opt['needsarg']) $name .= ' <'.$opt['needsarg'].'>';
+
+ $text .= $this->tableFormat(
+ array(2, 20, 52),
+ array('', $name, $opt['help'])
+ );
+ $text .= "\n";
+ }
+ }
+
+ if($hasargs) {
+ $text .= "\n";
+ foreach($this->setup[$command]['args'] as $arg) {
+ $name = '<'.$arg['name'].'>';
+
+ $text .= $this->tableFormat(
+ array(2, 20, 52),
+ array('', $name, $arg['help'])
+ );
+ }
+ }
+
+ if($command == '' && $hascommands) {
+ $text .= "\nThis tool accepts a command as first parameter as outlined below:\n";
+ }
+ }
+
+ return $text;
+ }
+
+ /**
+ * Safely read the $argv PHP array across different PHP configurations.
+ * Will take care on register_globals and register_argc_argv ini directives
+ *
+ * @throws DokuCLI_Exception
+ * @return array the $argv PHP array or PEAR error if not registered
+ */
+ private function readPHPArgv() {
+ global $argv;
+ if(!is_array($argv)) {
+ if(!@is_array($_SERVER['argv'])) {
+ if(!@is_array($GLOBALS['HTTP_SERVER_VARS']['argv'])) {
+ throw new DokuCLI_Exception(
+ "Could not read cmd args (register_argc_argv=Off?)",
+ DOKU_CLI_OPTS_ARG_READ
+ );
+ }
+ return $GLOBALS['HTTP_SERVER_VARS']['argv'];
+ }
+ return $_SERVER['argv'];
+ }
+ return $argv;
+ }
+
+ /**
+ * Displays text in multiple word wrapped columns
+ *
+ * @param array $widths list of column widths (in characters)
+ * @param array $texts list of texts for each column
+ * @return string
+ */
+ private function tableFormat($widths, $texts) {
+ $wrapped = array();
+ $maxlen = 0;
+
+ foreach($widths as $col => $width) {
+ $wrapped[$col] = explode("\n", wordwrap($texts[$col], $width - 1, "\n", true)); // -1 char border
+ $len = count($wrapped[$col]);
+ if($len > $maxlen) $maxlen = $len;
+
+ }
+
+ $out = '';
+ for($i = 0; $i < $maxlen; $i++) {
+ foreach($widths as $col => $width) {
+ if(isset($wrapped[$col][$i])) {
+ $val = $wrapped[$col][$i];
+ } else {
+ $val = '';
+ }
+ $out .= sprintf('%-'.$width.'s', $val);
+ }
+ $out .= "\n";
+ }
+ return $out;
+ }
+}
+
+/**
+ * Class DokuCLI_Exception
+ *
+ * The code is used as exit code for the CLI tool. This should probably be extended. Many cases just fall back to the
+ * E_ANY code.
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+class DokuCLI_Exception extends Exception {
+ const E_ANY = -1; // no error code specified
+ const E_UNKNOWN_OPT = 1; //Unrecognized option
+ const E_OPT_ARG_REQUIRED = 2; //Option requires argument
+ const E_OPT_ARG_DENIED = 3; //Option not allowed argument
+ const E_OPT_ABIGUOUS = 4; //Option abiguous
+ const E_ARG_READ = 5; //Could not read argv
+
+ public function __construct($message = "", $code = 0, Exception $previous = null) {
+ if(!$code) $code = DokuCLI_Exception::E_ANY;
+ parent::__construct($message, $code, $previous);
+ }
+}
diff --git a/inc/cliopts.php b/inc/cliopts.php
index 3eac72e5b..c75a5a93b 100644
--- a/inc/cliopts.php
+++ b/inc/cliopts.php
@@ -68,6 +68,7 @@ define('DOKU_CLI_OPTS_ARG_READ',5);//Could not read argv
*
* @author Andrei Zmievski <andrei@php.net>
*
+ * @deprecated 2014-05-16
*/
class Doku_Cli_Opts {
diff --git a/inc/common.php b/inc/common.php
index 5960d414e..0fe33c5b1 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -22,6 +22,9 @@ define('RECENTS_MEDIA_PAGES_MIXED', 32);
*
* @author Andreas Gohr <andi@splitbrain.org>
* @see htmlspecialchars()
+ *
+ * @param string $string the string being converted
+ * @return string converted string
*/
function hsc($string) {
return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
@@ -33,6 +36,9 @@ function hsc($string) {
* You can give an indention as optional parameter
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string line of text
+ * @param int $indent number of spaces indention
*/
function ptln($string, $indent = 0) {
echo str_repeat(' ', $indent)."$string\n";
@@ -42,6 +48,9 @@ function ptln($string, $indent = 0) {
* strips control characters (<32) from the given string
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param $string string being stripped
+ * @return string
*/
function stripctl($string) {
return preg_replace('/[\x00-\x1F]+/s', '', $string);
@@ -63,6 +72,9 @@ function getSecurityToken() {
/**
* Check the secret CSRF token
+ *
+ * @param null|string $token security token or null to read it from request variable
+ * @return bool success if the token matched
*/
function checkSecurityToken($token = null) {
/** @var Input $INPUT */
@@ -81,6 +93,9 @@ function checkSecurityToken($token = null) {
* Print a hidden form field with a secret CSRF token
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param bool $print if true print the field, otherwise html of the field is returned
+ * @return void|string html of hidden form field
*/
function formSecurityToken($print = true) {
$ret = '<div class="no"><input type="hidden" name="sectok" value="'.getSecurityToken().'" /></div>'."\n";
@@ -93,6 +108,11 @@ function formSecurityToken($print = true) {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Chris Smith <chris@jalakai.co.uk>
+ *
+ * @param string $id pageid
+ * @param bool $htmlClient add info about whether is mobile browser
+ * @return array with info for a request of $id
+ *
*/
function basicinfo($id, $htmlClient=true){
global $USERINFO;
@@ -139,6 +159,8 @@ function basicinfo($id, $htmlClient=true){
* array.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return array with info about current document
*/
function pageinfo() {
global $ID;
@@ -246,6 +268,8 @@ function pageinfo() {
/**
* Return information about the current media item as an associative array.
+ *
+ * @return array with info about current media item
*/
function mediainfo(){
global $NS;
@@ -261,6 +285,10 @@ function mediainfo(){
* Build an string of URL parameters
*
* @author Andreas Gohr
+ *
+ * @param array $params array with key-value pairs
+ * @param string $sep series of pairs are separated by this character
+ * @return string query string
*/
function buildURLparams($params, $sep = '&amp;') {
$url = '';
@@ -281,6 +309,10 @@ function buildURLparams($params, $sep = '&amp;') {
* Skips keys starting with '_', values get HTML encoded
*
* @author Andreas Gohr
+ *
+ * @param array $params array with (attribute name-attribute value) pairs
+ * @param bool $skipempty skip empty string values?
+ * @return string
*/
function buildAttributes($params, $skipempty = false) {
$url = '';
@@ -302,6 +334,8 @@ function buildAttributes($params, $skipempty = false) {
* This builds the breadcrumb trail and returns it as array
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return array(pageid=>name, ... )
*/
function breadcrumbs() {
// we prepare the breadcrumbs early for quick session closing
@@ -361,6 +395,10 @@ function breadcrumbs() {
* Urlencoding is ommitted when the second parameter is false
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id pageid being filtered
+ * @param bool $ue apply urlencoding?
+ * @return string
*/
function idfilter($id, $ue = true) {
global $conf;
@@ -386,10 +424,15 @@ function idfilter($id, $ue = true) {
/**
* This builds a link to a wikipage
*
- * It handles URL rewriting and adds additional parameter if
- * given in $more
+ * It handles URL rewriting and adds additional parameters
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id, defaults to start page
+ * @param string|array $urlParameters URL parameters, associative array recommended
+ * @param bool $absolute request an absolute URL instead of relative
+ * @param string $separator parameter separator
+ * @return string
*/
function wl($id = '', $urlParameters = '', $absolute = false, $separator = '&amp;') {
global $conf;
@@ -431,13 +474,19 @@ function wl($id = '', $urlParameters = '', $absolute = false, $separator = '&amp
* Handles URL rewriting if enabled. Follows the style of wl().
*
* @author Ben Coburn <btcoburn@silicodon.net>
+ * @param string $id page id, defaults to start page
+ * @param string $format the export renderer to use
+ * @param string|array $urlParameters URL parameters, associative array recommended
+ * @param bool $abs request an absolute URL instead of relative
+ * @param string $sep parameter separator
+ * @return string
*/
-function exportlink($id = '', $format = 'raw', $more = '', $abs = false, $sep = '&amp;') {
+function exportlink($id = '', $format = 'raw', $urlParameters = '', $abs = false, $sep = '&amp;') {
global $conf;
- if(is_array($more)) {
- $more = buildURLparams($more, $sep);
+ if(is_array($urlParameters)) {
+ $urlParameters = buildURLparams($urlParameters, $sep);
} else {
- $more = str_replace(',', $sep, $more);
+ $urlParameters = str_replace(',', $sep, $urlParameters);
}
$format = rawurlencode($format);
@@ -450,13 +499,13 @@ function exportlink($id = '', $format = 'raw', $more = '', $abs = false, $sep =
if($conf['userewrite'] == 2) {
$xlink .= DOKU_SCRIPT.'/'.$id.'?do=export_'.$format;
- if($more) $xlink .= $sep.$more;
+ if($urlParameters) $xlink .= $sep.$urlParameters;
} elseif($conf['userewrite'] == 1) {
$xlink .= '_export/'.$format.'/'.$id;
- if($more) $xlink .= '?'.$more;
+ if($urlParameters) $xlink .= '?'.$urlParameters;
} else {
$xlink .= DOKU_SCRIPT.'?do=export_'.$format.$sep.'id='.$id;
- if($more) $xlink .= $sep.$more;
+ if($urlParameters) $xlink .= $sep.$urlParameters;
}
return $xlink;
@@ -563,6 +612,8 @@ function ml($id = '', $more = '', $direct = true, $sep = '&amp;', $abs = false)
* Consider using wl() instead, unless you absoutely need the doku.php endpoint
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return string
*/
function script() {
return DOKU_BASE.DOKU_SCRIPT;
@@ -589,6 +640,7 @@ function script() {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Michael Klier <chi@chimeric.de>
+ *
* @param string $text - optional text to check, if not given the globals are used
* @return bool - true if a spam word was found
*/
@@ -657,6 +709,7 @@ function checkwordblock($text = '') {
* headers
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param boolean $single If set only a single IP is returned
* @return string
*/
@@ -728,6 +781,8 @@ function clientIP($single = false) {
* Adapted from the example code at url below
*
* @link http://www.brainhandles.com/2007/10/15/detecting-mobile-browsers/#code
+ *
+ * @return bool if true, client is mobile browser; otherwise false
*/
function clientismobile() {
/* @var Input $INPUT */
@@ -752,6 +807,7 @@ function clientismobile() {
* If $conf['dnslookups'] is disabled it simply returns the input string
*
* @author Glen Harris <astfgl@iamnota.org>
+ *
* @param string $ips comma separated list of IP addresses
* @return string a comma separated list of hostnames
*/
@@ -778,6 +834,9 @@ function gethostsbyaddrs($ips) {
* removes stale lockfiles
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @return bool page is locked?
*/
function checklock($id) {
global $conf;
@@ -797,7 +856,7 @@ function checklock($id) {
//my own lock
@list($ip, $session) = explode("\n", io_readFile($lock));
- if($ip == $INPUT->server->str('REMOTE_USER') || $ip == clientIP() || $session == session_id()) {
+ if($ip == $INPUT->server->str('REMOTE_USER') || $ip == clientIP() || (session_id() && $session == session_id())) {
return false;
}
@@ -808,6 +867,8 @@ function checklock($id) {
* Lock a page for editing
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id to lock
*/
function lock($id) {
global $conf;
@@ -830,6 +891,7 @@ function lock($id) {
* Unlock a page if it was locked by the user
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $id page id to unlock
* @return bool true if a lock was removed
*/
@@ -855,6 +917,9 @@ function unlock($id) {
*
* @see formText() for 2crlf conversion
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $text
+ * @return string
*/
function cleanText($text) {
$text = preg_replace("/(\015\012)|(\015)/", "\012", $text);
@@ -874,6 +939,9 @@ function cleanText($text) {
*
* @see cleanText() for 2unix conversion
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $text
+ * @return string
*/
function formText($text) {
$text = str_replace("\012", "\015\012", $text);
@@ -884,6 +952,10 @@ function formText($text) {
* Returns the specified local text in raw format
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @param string $ext extension of file being read, default 'txt'
+ * @return string
*/
function rawLocale($id, $ext = 'txt') {
return io_readFile(localeFN($id, $ext));
@@ -893,6 +965,10 @@ function rawLocale($id, $ext = 'txt') {
* Returns the raw WikiText
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @param string $rev timestamp when a revision of wikitext is desired
+ * @return string
*/
function rawWiki($id, $rev = '') {
return io_readWikiPage(wikiFN($id, $rev), $id, $rev);
@@ -903,6 +979,9 @@ function rawWiki($id, $rev = '') {
*
* @triggers COMMON_PAGETPL_LOAD
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id the id of the page to be created
+ * @return string parsed pagetemplate content
*/
function pageTemplate($id) {
global $conf;
@@ -954,6 +1033,9 @@ function pageTemplate($id) {
* This works on data from COMMON_PAGETPL_LOAD
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data array with event data
+ * @return string
*/
function parsePageTemplate(&$data) {
/**
@@ -1021,6 +1103,11 @@ function parsePageTemplate(&$data) {
* The returned order is prefix, section and suffix.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $range in form "from-to"
+ * @param string $id page id
+ * @param string $rev optional, the revision timestamp
+ * @return array with three slices
*/
function rawWikiSlices($range, $id, $rev = '') {
$text = io_readWikiPage(wikiFN($id, $rev), $id, $rev);
@@ -1045,6 +1132,12 @@ function rawWikiSlices($range, $id, $rev = '') {
* lines between sections if needed (used on saving).
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $pre prefix
+ * @param string $text text in the middle
+ * @param string $suf suffix
+ * @param bool $pretty add additional empty lines between sections
+ * @return string
*/
function con($pre, $text, $suf, $pretty = false) {
if($pretty) {
@@ -1069,6 +1162,11 @@ function con($pre, $text, $suf, $pretty = false) {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $id page id
+ * @param string $text wikitext being saved
+ * @param string $summary summary of text update
+ * @param bool $minor mark this saved version as minor update
*/
function saveWikiText($id, $text, $summary, $minor = false) {
/* Note to developers:
@@ -1173,6 +1271,9 @@ function saveWikiText($id, $text, $summary, $minor = false) {
* revision date
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id page id
+ * @return int|string revision timestamp
*/
function saveOldRevision($id) {
$oldf = wikiFN($id);
@@ -1192,8 +1293,8 @@ function saveOldRevision($id) {
* @param string $summary What changed
* @param boolean $minor Is this a minor edit?
* @param array $replace Additional string substitutions, @KEY@ to be replaced by value
- *
* @return bool
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace = array()) {
@@ -1209,7 +1310,7 @@ function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace =
} elseif($who == 'subscribers') {
if(!actionOK('subscribe')) return false; //subscribers enabled?
if($conf['useacl'] && $INPUT->server->str('REMOTE_USER') && $minor) return false; //skip minors
- $data = array('id' => $id, 'addresslist' => '', 'self' => false);
+ $data = array('id' => $id, 'addresslist' => '', 'self' => false, 'replacements' => $replace);
trigger_event(
'COMMON_NOTIFY_ADDRESSLIST', $data,
array(new Subscription(), 'notifyaddresses')
@@ -1231,6 +1332,8 @@ function notify($id, $who, $rev = '', $summary = '', $minor = false, $replace =
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Todd Augsburger <todd@rollerorgans.com>
+ *
+ * @return array|string
*/
function getGoogleQuery() {
/* @var Input $INPUT */
@@ -1272,6 +1375,7 @@ function getGoogleQuery() {
* @param int $size A file size
* @param int $dec A number of decimal places
* @return string human readable size
+ *
* @author Martin Benjamin <b.martin@cybernet.ch>
* @author Aidan Lister <aidan@php.net>
* @version 1.0.0
@@ -1293,6 +1397,9 @@ function filesize_h($size, $dec = 1) {
* Return the given timestamp as human readable, fuzzy age
*
* @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param int $dt timestamp
+ * @return string
*/
function datetime_h($dt) {
global $lang;
@@ -1327,6 +1434,10 @@ function datetime_h($dt) {
*
* @see datetime_h
* @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param int|null $dt timestamp when given, null will take current timestamp
+ * @param string $format empty default to $conf['dformat'], or provide format as recognized by strftime()
+ * @return string
*/
function dformat($dt = null, $format = '') {
global $conf;
@@ -1344,6 +1455,7 @@ function dformat($dt = null, $format = '') {
*
* @author <ungu at terong dot com>
* @link http://www.php.net/manual/en/function.date.php#54072
+ *
* @param int $int_date: current date in UNIX timestamp
* @return string
*/
@@ -1360,6 +1472,9 @@ function date_iso8601($int_date) {
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @author Christopher Smith <chris@jalakai.co.uk>
+ *
+ * @param string $email email address
+ * @return string
*/
function obfuscate($email) {
global $conf;
@@ -1387,6 +1502,10 @@ function obfuscate($email) {
* Removes quoting backslashes
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string
+ * @param string $char backslashed character
+ * @return string
*/
function unslash($string, $char = "'") {
return str_replace('\\'.$char, $char, $string);
@@ -1397,6 +1516,9 @@ function unslash($string, $char = "'") {
*
* @author <gilthans dot NO dot SPAM at gmail dot com>
* @link http://de3.php.net/manual/en/ini.core.php#79564
+ *
+ * @param string $v shorthands
+ * @return int|string
*/
function php_to_byte($v) {
$l = substr($v, -1);
@@ -1414,6 +1536,7 @@ function php_to_byte($v) {
/** @noinspection PhpMissingBreakStatementInspection */
case 'M':
$ret *= 1024;
+ /** @noinspection PhpMissingBreakStatementInspection */
case 'K':
$ret *= 1024;
break;
@@ -1426,6 +1549,9 @@ function php_to_byte($v) {
/**
* Wrapper around preg_quote adding the default delimiter
+ *
+ * @param string $string
+ * @return string
*/
function preg_quote_cb($string) {
return preg_quote($string, '/');
@@ -1459,7 +1585,7 @@ function shorten($keep, $short, $max, $min = 9, $char = '…') {
* Return the users realname or e-mail address for use
* in page footer and recent changes pages
*
- * @param string|bool $username or false when currently logged-in user should be used
+ * @param string|null $username or null when currently logged-in user should be used
* @param bool $textonly true returns only plain text, true allows returning html
* @return string html or plain text(not escaped) of formatted user name
*
@@ -1472,7 +1598,7 @@ function editorinfo($username, $textonly = false) {
/**
* Returns users realname w/o link
*
- * @param string|bool $username or false when currently logged-in user should be used
+ * @param string|null $username or null when currently logged-in user should be used
* @param bool $textonly true returns only plain text, true allows returning html
* @return string html or plain text(not escaped) of formatted user name
*
@@ -1595,6 +1721,7 @@ function userlink($username = null, $textonly = false) {
* When no image exists, returns an empty string
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $type - type of image 'badge' or 'button'
* @return string
*/
@@ -1603,7 +1730,6 @@ function license_img($type) {
global $conf;
if(!$conf['license']) return '';
if(!is_array($license[$conf['license']])) return '';
- $lic = $license[$conf['license']];
$try = array();
$try[] = 'lib/images/license/'.$type.'/'.$conf['license'].'.png';
$try[] = 'lib/images/license/'.$type.'/'.$conf['license'].'.gif';
@@ -1625,9 +1751,8 @@ function license_img($type) {
* @author Filip Oscadal <webmaster@illusionsoftworks.cz>
* @author Andreas Gohr <andi@splitbrain.org>
*
- * @param int $mem Size of memory you want to allocate in bytes
- * @param int $bytes
- * @internal param int $used already allocated memory (see above)
+ * @param int $mem Size of memory you want to allocate in bytes
+ * @param int $bytes already allocated memory (see above)
* @return bool
*/
function is_mem_available($mem, $bytes = 1048576) {
@@ -1658,6 +1783,8 @@ function is_mem_available($mem, $bytes = 1048576) {
*
* @link http://support.microsoft.com/kb/q176113/
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $url url being directed to
*/
function send_redirect($url) {
/* @var Input $INPUT */
@@ -1729,6 +1856,10 @@ function valid_input_set($param, $valid_values, $array, $exc = '') {
/**
* Read a preference from the DokuWiki cookie
* (remembering both keys & values are urlencoded)
+ *
+ * @param string $pref preference key
+ * @param mixed $default value returned when preference not found
+ * @return string preference value
*/
function get_doku_pref($pref, $default) {
$enc_pref = urlencode($pref);
@@ -1747,6 +1878,9 @@ function get_doku_pref($pref, $default) {
/**
* Add a preference to the DokuWiki cookie
* (remembering $_COOKIE['DOKU_PREFS'] is urlencoded)
+ *
+ * @param string $pref preference key
+ * @param string $val preference value
*/
function set_doku_pref($pref, $val) {
global $conf;
@@ -1775,4 +1909,13 @@ function set_doku_pref($pref, $val) {
}
}
+/**
+ * Strips source mapping declarations from given text #601
+ *
+ * @param &string $text reference to the CSS or JavaScript code to clean
+ */
+function stripsourcemaps(&$text){
+ $text = preg_replace('/^(\/\/|\/\*)[@#]\s+sourceMappingURL=.*?(\*\/)?$/im', '\\1\\2', $text);
+}
+
//Setup VIM: ex: et ts=2 :
diff --git a/inc/form.php b/inc/form.php
index 9cd0491e0..fadc71d3e 100644
--- a/inc/form.php
+++ b/inc/form.php
@@ -131,7 +131,7 @@ class Doku_Form {
* The element can be either a pseudo-tag or string.
* If string, it is printed without escaping special chars. *
*
- * @param string $elem Pseudo-tag or string to add to the form.
+ * @param string|array $elem Pseudo-tag or string to add to the form.
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function addElement($elem) {
@@ -143,8 +143,8 @@ class Doku_Form {
*
* Inserts a content element at a position.
*
- * @param string $pos 0-based index where the element will be inserted.
- * @param string $elem Pseudo-tag or string to add to the form.
+ * @param string $pos 0-based index where the element will be inserted.
+ * @param string|array $elem Pseudo-tag or string to add to the form.
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function insertElement($pos, $elem) {
@@ -156,8 +156,8 @@ class Doku_Form {
*
* Replace with NULL to remove an element.
*
- * @param int $pos 0-based index the element will be placed at.
- * @param string $elem Pseudo-tag or string to add to the form.
+ * @param int $pos 0-based index the element will be placed at.
+ * @param string|array $elem Pseudo-tag or string to add to the form.
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function replaceElement($pos, $elem) {
diff --git a/inc/html.php b/inc/html.php
index 57a22b880..be7afae0c 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1335,7 +1335,7 @@ function html_diff_navigation($pagelog, $type, $l_rev, $r_rev) {
$info = $pagelog->getRevisionInfo($rev);
$l_revisions[$rev] = array(
$rev,
- dformat($info['date']) . ' ' . editorinfo($info['user']) . ' ' . $info['sum'],
+ dformat($info['date']) . ' ' . editorinfo($info['user'], true) . ' ' . $info['sum'],
$r_rev ? $rev >= $r_rev : false //disable?
);
}
@@ -1347,7 +1347,7 @@ function html_diff_navigation($pagelog, $type, $l_rev, $r_rev) {
$info = $pagelog->getRevisionInfo($rev);
$r_revisions[$rev] = array(
$rev,
- dformat($info['date']) . ' ' . editorinfo($info['user']) . ' ' . $info['sum'],
+ dformat($info['date']) . ' ' . editorinfo($info['user'], true) . ' ' . $info['sum'],
$rev <= $l_rev //disable?
);
}
diff --git a/inc/indexer.php b/inc/indexer.php
index a167db47f..5ca2f0bb1 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1218,19 +1218,18 @@ class Doku_Indexer {
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
protected function updateTuple($line, $id, $count) {
- $newLine = $line;
- if ($newLine !== ''){
- $newLine = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $newLine);
+ if ($line != ''){
+ $line = preg_replace('/(^|:)'.preg_quote($id,'/').'\*\d*/', '', $line);
}
- $newLine = trim($newLine, ':');
+ $line = trim($line, ':');
if ($count) {
- if (strlen($newLine) > 0) {
- return "$id*$count:".$newLine;
+ if ($line) {
+ return "$id*$count:".$line;
} else {
- return "$id*$count".$newLine;
+ return "$id*$count";
}
}
- return $newLine;
+ return $line;
}
/**
diff --git a/inc/infoutils.php b/inc/infoutils.php
index 0992040d9..db856141f 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -280,6 +280,15 @@ define('MSG_USERS_ONLY', 1);
define('MSG_MANAGERS_ONLY',2);
define('MSG_ADMINS_ONLY',4);
+/**
+ * Display a message to the user
+ *
+ * @param string $message
+ * @param int $lvl -1 = error, 0 = info, 1 = success, 2 = notify
+ * @param string $line line number
+ * @param string $file file number
+ * @param int $allow who's allowed to see the message, see MSG_* constants
+ */
function msg($message,$lvl=0,$line='',$file='',$allow=MSG_PUBLIC){
global $MSG, $MSG_shown;
$errors[-1] = 'error';
@@ -309,6 +318,7 @@ function msg($message,$lvl=0,$line='',$file='',$allow=MSG_PUBLIC){
* lvl => int, level of the message (see msg() function)
* allow => int, flag used to determine who is allowed to see the message
* see MSG_* constants
+ * @return bool
*/
function info_msg_allowed($msg){
global $INFO, $auth;
@@ -384,6 +394,32 @@ function dbglog($msg,$header=''){
}
/**
+ * Log accesses to deprecated fucntions to the debug log
+ *
+ * @param string $alternative The function or method that should be used instead
+ */
+function dbg_deprecated($alternative = '') {
+ global $conf;
+ if(!$conf['allowdebug']) return;
+
+ $backtrace = debug_backtrace();
+ array_shift($backtrace);
+ $self = array_shift($backtrace);
+ $call = array_shift($backtrace);
+
+ $called = trim($self['class'].'::'.$self['function'].'()', ':');
+ $caller = trim($call['class'].'::'.$call['function'].'()', ':');
+
+ $msg = $called.' is deprecated. It was called from ';
+ $msg .= $caller.' in '.$call['file'].':'.$call['line'];
+ if($alternative) {
+ $msg .= ' '.$alternative.' should be used instead!';
+ }
+
+ dbglog($msg);
+}
+
+/**
* Print a reversed, prettyprinted backtrace
*
* @author Gary Owen <gary_owen@bigfoot.com>
diff --git a/inc/lang/bg/lang.php b/inc/lang/bg/lang.php
index dcf66955f..77117154f 100644
--- a/inc/lang/bg/lang.php
+++ b/inc/lang/bg/lang.php
@@ -50,7 +50,7 @@ $lang['btn_revert'] = 'Възстановяване';
$lang['btn_register'] = 'Регистриране';
$lang['btn_apply'] = 'Прилагане';
$lang['btn_media'] = 'Диспечер на файлове';
-$lang['btn_deleteuser'] = 'Изтрий профила ми';
+$lang['btn_deleteuser'] = 'Изтриване на профила';
$lang['loggedinas'] = 'Вписани сте като';
$lang['user'] = 'Потребител';
$lang['pass'] = 'Парола';
@@ -62,7 +62,7 @@ $lang['fullname'] = 'Истинско име';
$lang['email'] = 'Електронна поща';
$lang['profile'] = 'Потребителски профил';
$lang['badlogin'] = 'Грешно потребителско име или парола.';
-$lang['badpassconfirm'] = 'Съжаляваме, паролата е грешна';
+$lang['badpassconfirm'] = 'За съжаление паролата е грешна';
$lang['minoredit'] = 'Промените са незначителни';
$lang['draftdate'] = 'Черновата е автоматично записана на';
$lang['nosecedit'] = 'Страницата бе междувременно променена, презареждане на страницата поради неактуална информация.';
@@ -77,13 +77,13 @@ $lang['regpwmail'] = 'Паролата ви за DokuWiki';
$lang['reghere'] = 'Все още нямате профил? Направете си';
$lang['profna'] = 'Wiki-то не поддържа промяна на профила';
$lang['profnochange'] = 'Няма промени.';
-$lang['profnoempty'] = 'Въвеждането на име и ел. поща е задължително';
+$lang['profnoempty'] = 'Въвеждането на име и имейл е задължително';
$lang['profchanged'] = 'Потребителският профил е обновен успешно.';
-$lang['profnodelete'] = 'Не е възможно изтриване на потребители в това wiki ';
-$lang['profdeleteuser'] = 'Изтрий профила ми';
+$lang['profnodelete'] = 'Изтриването на потребители в това wiki не е възможно';
+$lang['profdeleteuser'] = 'Изтриване на профила';
$lang['profdeleted'] = 'Вашият профил е премахнат от това wiki ';
-$lang['profconfdelete'] = 'Искам да изтрия профила си от това wiki. <br/> Веднъж изтрит, профила не може да бъде възстановен!';
-$lang['profconfdeletemissing'] = 'Не и маркирана опцията за потвърждение';
+$lang['profconfdelete'] = 'Искам да изтрия профила си от това wiki. <br/> Веднъж изтрит, профилът не може да бъде възстановен!';
+$lang['profconfdeletemissing'] = 'Не сте поставили отметка в кутията потвърждение';
$lang['pwdforget'] = 'Забравили сте паролата си? Получете нова';
$lang['resendna'] = 'Wiki-то не поддържа повторно пращане на паролата.';
$lang['resendpwd'] = 'Задаване на нова парола за';
@@ -140,7 +140,7 @@ $lang['js']['media_diff_portions'] = 'По половинка';
$lang['js']['media_select'] = 'Изберете файлове...';
$lang['js']['media_upload_btn'] = 'Качване';
$lang['js']['media_done_btn'] = 'Готово';
-$lang['js']['media_drop'] = 'Влачете и пуснете файливе тук, за да бъдат качени';
+$lang['js']['media_drop'] = 'Влачете и пуснете файлове тук, за да бъдат качени';
$lang['js']['media_cancel'] = 'премахване';
$lang['js']['media_overwrt'] = 'Презапиши съществуващите файлове';
$lang['rssfailed'] = 'Възникна грешка при получаването на емисията: ';
@@ -164,7 +164,7 @@ $lang['accessdenied'] = 'Нямате необходимите прав
$lang['mediausage'] = 'Ползвайте следния синтаксис, за да упоменете файла:';
$lang['mediaview'] = 'Преглед на оригиналния файл';
$lang['mediaroot'] = 'root';
-$lang['mediaupload'] = 'Качете файл в текущото именно пространство. За създаване на подимено пространство, добавете име преди това на файла като ги разделите с двоеточие в полето "Качи като"';
+$lang['mediaupload'] = 'Качете файл в текущото именно пространство. За създаване на подименно пространство, добавете име преди това на файла като ги разделите с двоеточие в полето "Качи като"';
$lang['mediaextchange'] = 'Разширението на файла е сменено от .%s на .%s!';
$lang['reference'] = 'Връзки за';
$lang['ref_inuse'] = 'Файлът не може да бъде изтрит, защото все още се ползва от следните страници:';
@@ -252,7 +252,7 @@ $lang['img_height'] = 'Височина';
$lang['btn_mediaManager'] = 'Преглед в диспечера на файлове';
$lang['subscr_subscribe_success'] = '%s е добавен към списъка с абониралите се за %s';
$lang['subscr_subscribe_error'] = 'Грешка при добавянето на %s към списъка с абониралите се за %s';
-$lang['subscr_subscribe_noaddress'] = 'Добавянето ви към списъка с абонати не е възможно поради липсата на свързан адрес (на ел. поща) с профила ви.';
+$lang['subscr_subscribe_noaddress'] = 'Добавянето ви към списъка с абонати не е възможно поради липсата на свързан адрес (имейл) с профила ви.';
$lang['subscr_unsubscribe_success'] = '%s е премахнат от списъка с абониралите се за %s';
$lang['subscr_unsubscribe_error'] = 'Грешка при премахването на %s от списъка с абониралите се за %s';
$lang['subscr_already_subscribed'] = '%s е вече абониран за %s';
@@ -263,12 +263,12 @@ $lang['subscr_m_current_header'] = 'Текущи абонаменти';
$lang['subscr_m_unsubscribe'] = 'Прекратяване на абонамента';
$lang['subscr_m_subscribe'] = 'Абониране';
$lang['subscr_m_receive'] = 'Получаване';
-$lang['subscr_style_every'] = 'на ел. писмо при всяка промяна';
-$lang['subscr_style_digest'] = 'на ел. писмо с обобщение на промените във всяка страница (всеки %.2f дни)';
-$lang['subscr_style_list'] = 'на списък с променените страници от последното ел. писмо (всеки %.2f дни)';
+$lang['subscr_style_every'] = 'на имейл при всяка промяна';
+$lang['subscr_style_digest'] = 'на имейл с обобщение на промените във всяка страница (всеки %.2f дни)';
+$lang['subscr_style_list'] = 'на списък с променените страници от последния имейл (всеки %.2f дни)';
$lang['authtempfail'] = 'Удостоверяването на потребители не е възможно за момента. Ако продължи дълго, моля уведомете администратора на Wiki страницата.';
-$lang['authpwdexpire'] = 'Срока на паролата ви ще изтече след %d дни. Препорачително е да я смените по-скоро.';
-$lang['i_chooselang'] = 'Изберете вашия изик';
+$lang['authpwdexpire'] = 'Срока на паролата ви ще изтече след %d дни. Препоръчително е да я смените по-скоро.';
+$lang['i_chooselang'] = 'Изберете вашия език';
$lang['i_installer'] = 'Инсталатор на DokuWiki';
$lang['i_wikiname'] = 'Име на Wiki-то';
$lang['i_enableacl'] = 'Ползване на списък за достъп (ACL) [препоръчително]';
diff --git a/inc/lang/bg/register.txt b/inc/lang/bg/register.txt
index 51fbb83fe..333428005 100644
--- a/inc/lang/bg/register.txt
+++ b/inc/lang/bg/register.txt
@@ -1,4 +1,4 @@
====== Регистриране като нов потребител ======
-Моля, попълнете всичките полета отдолу, за да бъде създаден нов профил. Уверете се, че въведеният **адрес на ел. поща е правилен**. Ако няма поле за парола, ще ви бъде изпратена такава на въведения адрес. Потребителското име трябва да бъде валидно [[doku>pagename|име на страница]].
+Моля, попълнете всичките полета отдолу, за да бъде създаден нов профил. Уверете се, че въведеният **имейл адрес е правилен**. Ако няма поле за парола, ще ви бъде изпратена такава на въведения адрес. Потребителското име трябва да бъде валидно [[doku>pagename|име на страница]].
diff --git a/inc/lang/bg/resendpwd.txt b/inc/lang/bg/resendpwd.txt
index 38e2d1fe4..19dffc070 100644
--- a/inc/lang/bg/resendpwd.txt
+++ b/inc/lang/bg/resendpwd.txt
@@ -1,3 +1,3 @@
====== Пращане на нова парола ======
-Моля, въведете потребителското си име във формата по-долу, ако желаете да получите нова парола. По ел. поща ще получите линк, с който да потвърдите.
+Моля, въведете потребителското си име във формата по-долу, ако желаете да получите нова парола. Чрез имейл ще получите линк, с който да потвърдите.
diff --git a/inc/lang/cs/lang.php b/inc/lang/cs/lang.php
index a491c1533..061f1f063 100644
--- a/inc/lang/cs/lang.php
+++ b/inc/lang/cs/lang.php
@@ -17,6 +17,7 @@
* @author Zbyněk Křivka <krivka@fit.vutbr.cz>
* @author Gerrit Uitslag <klapinklapin@gmail.com>
* @author Petr Klíma <qaxi@seznam.cz>
+ * @author Radovan Buroň <radovan@buron.cz>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -61,6 +62,8 @@ $lang['btn_register'] = 'Registrovat';
$lang['btn_apply'] = 'Použít';
$lang['btn_media'] = 'Správa médií';
$lang['btn_deleteuser'] = 'Odstranit můj účet';
+$lang['btn_img_backto'] = 'Zpět na %s';
+$lang['btn_mediaManager'] = 'Zobrazit ve správě médií';
$lang['loggedinas'] = 'Přihlášen(a) jako';
$lang['user'] = 'Uživatelské jméno';
$lang['pass'] = 'Heslo';
@@ -248,7 +251,6 @@ $lang['admin_register'] = 'Přidat nového uživatele';
$lang['metaedit'] = 'Upravit Metadata';
$lang['metasaveerr'] = 'Chyba při zápisu metadat';
$lang['metasaveok'] = 'Metadata uložena';
-$lang['btn_img_backto'] = 'Zpět na %s';
$lang['img_title'] = 'Titulek';
$lang['img_caption'] = 'Popis';
$lang['img_date'] = 'Datum';
@@ -261,7 +263,6 @@ $lang['img_camera'] = 'Typ fotoaparátu';
$lang['img_keywords'] = 'Klíčová slova';
$lang['img_width'] = 'Šířka';
$lang['img_height'] = 'Výška';
-$lang['btn_mediaManager'] = 'Zobrazit ve správě médií';
$lang['subscr_subscribe_success'] = '%s byl přihlášen do seznamu odběratelů %s';
$lang['subscr_subscribe_error'] = 'Došlo k chybě při přihlašování %s do seznamu odběratelů %s';
$lang['subscr_subscribe_noaddress'] = 'K Vašemu loginu neexistuje žádná adresa, nemohl jste být přihlášen do seznamu odběratelů.';
diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php
index c6f11abc9..762a55e53 100644
--- a/inc/lang/de/lang.php
+++ b/inc/lang/de/lang.php
@@ -25,6 +25,7 @@
* @author Benedikt Fey <spam@lifeisgoooood.de>
* @author Joerg <scooter22@gmx.de>
* @author Simon <st103267@stud.uni-stuttgart.de>
+ * @author Hoisl <hoisl@gmx.at>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -95,7 +96,6 @@ $lang['regbadmail'] = 'Die angegebene E-Mail-Adresse scheint ungülti
$lang['regbadpass'] = 'Die beiden eingegeben Passwörter stimmen nicht überein. Bitte versuchen Sie es noch einmal.';
$lang['regpwmail'] = 'Ihr DokuWiki-Passwort';
$lang['reghere'] = 'Sie haben noch keinen Zugang? Hier registrieren';
-$lang['notloggedin'] = 'Haben Sie vergessen sich einzuloggen?';
$lang['profna'] = 'Änderung des Benutzerprofils in diesem Wiki nicht möglich.';
$lang['profnochange'] = 'Keine Änderungen, nichts zu tun.';
$lang['profnoempty'] = 'Es muss ein Name und eine E-Mail-Adresse angegeben werden.';
@@ -201,6 +201,9 @@ $lang['difflink'] = 'Link zu dieser Vergleichsansicht';
$lang['diff_type'] = 'Unterschiede anzeigen:';
$lang['diff_inline'] = 'Inline';
$lang['diff_side'] = 'Side by Side';
+$lang['diffprevrev'] = 'Vorhergehende Überarbeitung';
+$lang['diffnextrev'] = 'Nächste Überarbeitung';
+$lang['difflastrev'] = 'Letzte Überarbeitung';
$lang['line'] = 'Zeile';
$lang['breadcrumb'] = 'Zuletzt angesehen';
$lang['youarehere'] = 'Sie befinden sich hier';
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 592289185..203c206a8 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -307,6 +307,7 @@ $lang['i_modified'] = 'For security reasons this script will only wor
<a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
$lang['i_phpver'] = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
+$lang['i_mbfuncoverload'] = 'mbstring.func_overload must be disabled in php.ini to run DokuWiki.';
$lang['i_permfail'] = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
$lang['i_confexists'] = '<code>%s</code> already exists';
$lang['i_writeerr'] = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
diff --git a/inc/lang/eo/denied.txt b/inc/lang/eo/denied.txt
index 0be6a2e84..e0abba12c 100644
--- a/inc/lang/eo/denied.txt
+++ b/inc/lang/eo/denied.txt
@@ -1,4 +1,4 @@
====== Aliro malpermesita ======
-Vi ne havas sufiĉajn rajtojn rigardi ĉi tiujn paĝojn.
+Vi ne havas sufiĉajn rajtojn daŭrigi.
diff --git a/inc/lang/eo/lang.php b/inc/lang/eo/lang.php
index b3c19b601..4a4a52cac 100644
--- a/inc/lang/eo/lang.php
+++ b/inc/lang/eo/lang.php
@@ -54,6 +54,8 @@ $lang['btn_register'] = 'Registriĝi';
$lang['btn_apply'] = 'Apliki';
$lang['btn_media'] = 'Medio-administrilo';
$lang['btn_deleteuser'] = 'Forigi mian konton';
+$lang['btn_img_backto'] = 'Iri reen al %s';
+$lang['btn_mediaManager'] = 'Rigardi en aŭdvidaĵ-administrilo';
$lang['loggedinas'] = 'Ensalutinta kiel';
$lang['user'] = 'Uzant-nomo';
$lang['pass'] = 'Pasvorto';
@@ -184,6 +186,11 @@ $lang['difflink'] = 'Ligilo al kompara rigardo';
$lang['diff_type'] = 'Rigardi malsamojn:';
$lang['diff_inline'] = 'Samlinie';
$lang['diff_side'] = 'Apude';
+$lang['diffprevrev'] = 'Antaŭa revizio';
+$lang['diffnextrev'] = 'Sekva revizio';
+$lang['difflastrev'] = 'Lasta revizio';
+$lang['diffbothprevrev'] = 'Sur ambaŭ flankoj antaŭa revizio';
+$lang['diffbothnextrev'] = 'Sur ambaŭ flankoj sekva revizio';
$lang['line'] = 'Linio';
$lang['breadcrumb'] = 'Paŝoj';
$lang['youarehere'] = 'Vi estas ĉi tie';
@@ -240,7 +247,6 @@ $lang['admin_register'] = 'Aldoni novan uzanton';
$lang['metaedit'] = 'Redakti metadatumaron';
$lang['metasaveerr'] = 'La konservo de metadatumaro malsukcesis';
$lang['metasaveok'] = 'La metadatumaro konserviĝis';
-$lang['btn_img_backto'] = 'Iri reen al %s';
$lang['img_title'] = 'Titolo';
$lang['img_caption'] = 'Priskribo';
$lang['img_date'] = 'Dato';
@@ -253,7 +259,6 @@ $lang['img_camera'] = 'Kamerao';
$lang['img_keywords'] = 'Ŝlosilvortoj';
$lang['img_width'] = 'Larĝeco';
$lang['img_height'] = 'Alteco';
-$lang['btn_mediaManager'] = 'Rigardi en aŭdvidaĵ-administrilo';
$lang['subscr_subscribe_success'] = 'Aldonis %s al la abonlisto por %s';
$lang['subscr_subscribe_error'] = 'Eraro dum aldono de %s al la abonlisto por %s';
$lang['subscr_subscribe_noaddress'] = 'Ne estas adreso ligita al via ensaluto, ne eblas aldoni vin al la abonlisto';
diff --git a/inc/lang/es/jquery.ui.datepicker.js b/inc/lang/es/jquery.ui.datepicker.js
index ae32124e7..763d4cedd 100644
--- a/inc/lang/es/jquery.ui.datepicker.js
+++ b/inc/lang/es/jquery.ui.datepicker.js
@@ -9,9 +9,9 @@ jQuery(function($){
monthNames: ['enero','febrero','marzo','abril','mayo','junio',
'julio','agosto','septiembre','octubre','noviembre','diciembre'],
monthNamesShort: ['ene','feb','mar','abr','may','jun',
- 'jul','ago','sep','oct','nov','dic'],
+ 'jul','ogo','sep','oct','nov','dic'],
dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'],
- dayNamesShort: ['dom','lun','mar','mié','jue','vie','sáb'],
+ dayNamesShort: ['dom','lun','mar','mié','juv','vie','sáb'],
dayNamesMin: ['D','L','M','X','J','V','S'],
weekHeader: 'Sm',
dateFormat: 'dd/mm/yy',
diff --git a/inc/lang/es/lang.php b/inc/lang/es/lang.php
index 336e60089..9525a4c08 100644
--- a/inc/lang/es/lang.php
+++ b/inc/lang/es/lang.php
@@ -32,6 +32,8 @@
* @author monica <may.dorado@gmail.com>
* @author Antonio Bueno <atnbueno@gmail.com>
* @author Juan De La Cruz <juann.dlc@gmail.com>
+ * @author Fernando <fdiezala@gmail.com>
+ * @author Eloy <ej.perezgomez@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -76,6 +78,8 @@ $lang['btn_register'] = 'Registrarse';
$lang['btn_apply'] = 'Aplicar';
$lang['btn_media'] = 'Gestor de ficheros';
$lang['btn_deleteuser'] = 'Elimina Mi Cuenta';
+$lang['btn_img_backto'] = 'Volver a %s';
+$lang['btn_mediaManager'] = 'Ver en el Administrador de medios';
$lang['loggedinas'] = 'Conectado como ';
$lang['user'] = 'Usuario';
$lang['pass'] = 'Contraseña';
@@ -207,6 +211,11 @@ $lang['difflink'] = 'Enlace a la vista de comparación';
$lang['diff_type'] = 'Ver diferencias';
$lang['diff_inline'] = 'En línea';
$lang['diff_side'] = 'Lado a lado';
+$lang['diffprevrev'] = 'Revisión previa';
+$lang['diffnextrev'] = 'Próxima revisión';
+$lang['difflastrev'] = 'Última revisión';
+$lang['diffbothprevrev'] = 'Ambos lados, revisión anterior';
+$lang['diffbothnextrev'] = 'Ambos lados, revisión siguiente';
$lang['line'] = 'Línea';
$lang['breadcrumb'] = 'Traza';
$lang['youarehere'] = 'Estás aquí';
@@ -263,7 +272,6 @@ $lang['admin_register'] = 'Añadir nuevo usuario';
$lang['metaedit'] = 'Editar metadatos';
$lang['metasaveerr'] = 'La escritura de los metadatos ha fallado';
$lang['metasaveok'] = 'Los metadatos han sido guardados';
-$lang['btn_img_backto'] = 'Volver a %s';
$lang['img_title'] = 'Título';
$lang['img_caption'] = 'Epígrafe';
$lang['img_date'] = 'Fecha';
@@ -276,7 +284,6 @@ $lang['img_camera'] = 'Cámara';
$lang['img_keywords'] = 'Palabras claves';
$lang['img_width'] = 'Ancho';
$lang['img_height'] = 'Alto';
-$lang['btn_mediaManager'] = 'Ver en el Administrador de medios';
$lang['subscr_subscribe_success'] = 'Se agregó %s a las listas de suscripción para %s';
$lang['subscr_subscribe_error'] = 'Error al agregar %s a las listas de suscripción para %s';
$lang['subscr_subscribe_noaddress'] = 'No hay dirección asociada con tu registro, no se puede agregarte a la lista de suscripción';
@@ -322,13 +329,13 @@ $lang['i_license_none'] = 'No mostrar ninguna información sobre licencia
$lang['i_pop_field'] = 'Por favor, ayúdanos a mejorar la experiencia de DokuWiki:';
$lang['i_pop_label'] = 'Una vez al mes, enviar información anónima de uso de datos a los desarrolladores de DokuWiki';
$lang['recent_global'] = 'Actualmente estás viendo los cambios dentro del namespace <b>%s</b>. También puedes <a href="%s">ver los cambios recientes en el wiki completo</a>.';
-$lang['years'] = '%d años atrás';
-$lang['months'] = '%d meses atrás';
-$lang['weeks'] = '%d semanas atrás';
-$lang['days'] = '%d días atrás';
-$lang['hours'] = '%d horas atrás';
-$lang['minutes'] = '%d minutos atrás';
-$lang['seconds'] = '%d segundos atrás';
+$lang['years'] = 'hace %d años';
+$lang['months'] = 'hace %d meses';
+$lang['weeks'] = 'hace %d semanas';
+$lang['days'] = 'hace %d días';
+$lang['hours'] = 'hace %d horas';
+$lang['minutes'] = 'hace %d minutos';
+$lang['seconds'] = 'hace %d segundos';
$lang['wordblock'] = 'Sus cambios no se han guardado porque contienen textos bloqueados (spam).';
$lang['media_uploadtab'] = 'Cargar';
$lang['media_searchtab'] = 'Buscar';
diff --git a/inc/lang/fr/lang.php b/inc/lang/fr/lang.php
index 40bc25d10..c5407afa0 100644
--- a/inc/lang/fr/lang.php
+++ b/inc/lang/fr/lang.php
@@ -30,6 +30,9 @@
* @author Emmanuel <seedfloyd@gmail.com>
* @author Jérôme Brandt <jeromebrandt@gmail.com>
* @author Wild <wild.dagger@free.fr>
+ * @author ggallon <gwenael.gallon@mac.com>
+ * @author David VANTYGHEM <david.vantyghem@free.fr>
+ * @author Caillot <remicaillot5@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -50,7 +53,7 @@ $lang['btn_newer'] = '<< Plus récent';
$lang['btn_older'] = 'Moins récent >>';
$lang['btn_revs'] = 'Anciennes révisions';
$lang['btn_recent'] = 'Derniers changements';
-$lang['btn_upload'] = 'Envoyer';
+$lang['btn_upload'] = 'Téléverser';
$lang['btn_cancel'] = 'Annuler';
$lang['btn_index'] = 'Plan du site';
$lang['btn_secedit'] = 'Modifier';
@@ -60,9 +63,9 @@ $lang['btn_admin'] = 'Administrer';
$lang['btn_update'] = 'Mettre à jour';
$lang['btn_delete'] = 'Effacer';
$lang['btn_back'] = 'Retour';
-$lang['btn_backlink'] = 'Liens vers cette page';
+$lang['btn_backlink'] = 'Liens de retour';
$lang['btn_backtomedia'] = 'Retour à la sélection du fichier média';
-$lang['btn_subscribe'] = 'S\'abonner à la page';
+$lang['btn_subscribe'] = 'S\'abonner à cette page';
$lang['btn_profile'] = 'Mettre à jour le profil';
$lang['btn_reset'] = 'Réinitialiser';
$lang['btn_resendpwd'] = 'Définir un nouveau mot de passe';
@@ -74,6 +77,8 @@ $lang['btn_register'] = 'Créer un compte';
$lang['btn_apply'] = 'Appliquer';
$lang['btn_media'] = 'Gestionnaire de médias';
$lang['btn_deleteuser'] = 'Supprimer mon compte';
+$lang['btn_img_backto'] = 'Retour vers %s';
+$lang['btn_mediaManager'] = 'Voir dans le gestionnaire de médias';
$lang['loggedinas'] = 'Connecté en tant que ';
$lang['user'] = 'Utilisateur';
$lang['pass'] = 'Mot de passe';
@@ -84,20 +89,20 @@ $lang['remember'] = 'Mémoriser';
$lang['fullname'] = 'Nom';
$lang['email'] = 'Adresse de courriel';
$lang['profile'] = 'Profil utilisateur';
-$lang['badlogin'] = 'L\'utilisateur ou le mot de passe est incorrect.';
+$lang['badlogin'] = 'Le nom d\'utilisateur ou le mot de passe est incorrect.';
$lang['badpassconfirm'] = 'Désolé, le mot de passe est erroné';
$lang['minoredit'] = 'Modification mineure';
-$lang['draftdate'] = 'Brouillon enregistré de manière automatique le';
+$lang['draftdate'] = 'Brouillon enregistré automatiquement le';
$lang['nosecedit'] = 'La page a changé entre temps, les informations de la section sont obsolètes ; la page complète a été chargée à la place.';
$lang['regmissing'] = 'Désolé, vous devez remplir tous les champs.';
-$lang['reguexists'] = 'Désolé, ce nom d\'utilisateur est déjà utilisé.';
+$lang['reguexists'] = 'Désolé, ce nom d\'utilisateur est déjà pris.';
$lang['regsuccess'] = 'L\'utilisateur a été créé. Le mot de passe a été expédié par courriel.';
$lang['regsuccess2'] = 'L\'utilisateur a été créé.';
-$lang['regmailfail'] = 'Il semble y avoir un problème à l\'envoi du courriel. Contactez l\'administrateur.';
+$lang['regmailfail'] = 'On dirait qu\'il y a eu une erreur lors de l\'envoi du mot de passe de messagerie. Veuillez contacter l\'administrateur !';
$lang['regbadmail'] = 'L\'adresse de courriel semble incorrecte. Si vous pensez que c\'est une erreur, contactez l\'administrateur.';
$lang['regbadpass'] = 'Les deux mots de passe fournis sont différents, veuillez recommencez.';
$lang['regpwmail'] = 'Votre mot de passe DokuWiki';
-$lang['reghere'] = 'Vous n\'avez pas encore de compte ? Enregistrez-vous ici ';
+$lang['reghere'] = 'Vous n\'avez pas encore de compte ? Inscrivez-vous';
$lang['profna'] = 'Ce wiki ne permet pas de modifier les profils';
$lang['profnochange'] = 'Pas de modification, rien à faire.';
$lang['profnoempty'] = 'Un nom ou une adresse de courriel vide n\'est pas permis.';
@@ -203,6 +208,9 @@ $lang['difflink'] = 'Lien vers cette vue comparative';
$lang['diff_type'] = 'Voir les différences :';
$lang['diff_inline'] = 'Sur une seule ligne';
$lang['diff_side'] = 'Côte à côte';
+$lang['diffprevrev'] = 'Révision précédente';
+$lang['diffnextrev'] = 'Prochaine révision';
+$lang['difflastrev'] = 'Dernière révision';
$lang['line'] = 'Ligne';
$lang['breadcrumb'] = 'Piste';
$lang['youarehere'] = 'Vous êtes ici';
@@ -259,7 +267,6 @@ $lang['admin_register'] = 'Ajouter un nouvel utilisateur';
$lang['metaedit'] = 'Modifier les métadonnées';
$lang['metasaveerr'] = 'Erreur lors de l\'enregistrement des métadonnées';
$lang['metasaveok'] = 'Métadonnées enregistrées';
-$lang['btn_img_backto'] = 'Retour à %s';
$lang['img_title'] = 'Titre';
$lang['img_caption'] = 'Légende';
$lang['img_date'] = 'Date';
@@ -272,7 +279,6 @@ $lang['img_camera'] = 'Appareil photo';
$lang['img_keywords'] = 'Mots-clés';
$lang['img_width'] = 'Largeur';
$lang['img_height'] = 'Hauteur';
-$lang['btn_mediaManager'] = 'Voir dans le gestionnaire de médias';
$lang['subscr_subscribe_success'] = '%s a été ajouté à la liste de souscription de %s';
$lang['subscr_subscribe_error'] = 'Erreur à l\'ajout de %s à la liste de souscription de %s';
$lang['subscr_subscribe_noaddress'] = 'Il n\'y a pas d\'adresse associée à votre identifiant, vous ne pouvez pas être ajouté à la liste de souscription';
diff --git a/inc/lang/fr/subscr_form.txt b/inc/lang/fr/subscr_form.txt
index 49c0cf443..94e70afbd 100644
--- a/inc/lang/fr/subscr_form.txt
+++ b/inc/lang/fr/subscr_form.txt
@@ -1,3 +1,3 @@
====== Gestion de l'abonnement ======
-Cette page vous permet de gérer vos abonnements à la page et à la catégorie courantes \ No newline at end of file
+Cette page vous permet de gérer vos abonnements à la page et à la catégorie courantes. \ No newline at end of file
diff --git a/inc/lang/he/lang.php b/inc/lang/he/lang.php
index 5339d1802..c9a01a193 100644
--- a/inc/lang/he/lang.php
+++ b/inc/lang/he/lang.php
@@ -285,7 +285,7 @@ $lang['i_modified'] = 'משיקולי אבטחה סקריפט זה י
עליך לחלץ שנית את הקבצים מהחבילה שהורדה או להיעזר בדף
<a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
$lang['i_funcna'] = 'פונקציית ה-PHP&rlm; <code>%s</code> אינה זמינה. יתכן כי מארח האתר חסם אותה מסיבה כלשהי?';
-$lang['i_phpver'] = 'גרסת PHP שלך <code>%s</code> נמוכה מ <code>%s</ code> הצורך. אתה צריך לשדרג PHP שלך להתקין.';
+$lang['i_phpver'] = 'גרסת PHP שלך <code>%s</code> נמוכה מ <code>%s</code> הצורך. אתה צריך לשדרג PHP שלך להתקין.';
$lang['i_permfail'] = '<code>%s</code> אינה ניתנת לכתיבה על ידי DokuWiki. עליך לשנות הרשאות תיקייה זו!';
$lang['i_confexists'] = '<code>%s</code> כבר קיים';
$lang['i_writeerr'] = 'אין אפשרות ליצור את <code>%s</code>. נא לבדוק את הרשאות הקובץ/תיקייה וליצור את הקובץ ידנית.';
diff --git a/inc/lang/hu/lang.php b/inc/lang/hu/lang.php
index ad70438d9..6efccad39 100644
--- a/inc/lang/hu/lang.php
+++ b/inc/lang/hu/lang.php
@@ -57,6 +57,8 @@ $lang['btn_register'] = 'Regisztráció';
$lang['btn_apply'] = 'Alkalmaz';
$lang['btn_media'] = 'Médiakezelő';
$lang['btn_deleteuser'] = 'Felhasználói fiókom eltávolítása';
+$lang['btn_img_backto'] = 'Vissza %s';
+$lang['btn_mediaManager'] = 'Megtekintés a médiakezelőben';
$lang['loggedinas'] = 'Belépett felhasználó: ';
$lang['user'] = 'Azonosító';
$lang['pass'] = 'Jelszó';
@@ -187,6 +189,11 @@ $lang['difflink'] = 'Összehasonlító nézet linkje';
$lang['diff_type'] = 'Összehasonlítás módja:';
$lang['diff_inline'] = 'Sorok között';
$lang['diff_side'] = 'Egymás mellett';
+$lang['diffprevrev'] = 'Előző változat';
+$lang['diffnextrev'] = 'Következő változat';
+$lang['difflastrev'] = 'Utolsó változat';
+$lang['diffbothprevrev'] = 'Előző változat mindkét oldalon';
+$lang['diffbothnextrev'] = 'Következő változat mindkét oldalon';
$lang['line'] = 'Sor';
$lang['breadcrumb'] = 'Nyomvonal';
$lang['youarehere'] = 'Itt vagy';
@@ -243,7 +250,6 @@ $lang['admin_register'] = 'Új felhasználó';
$lang['metaedit'] = 'Metaadatok szerkesztése';
$lang['metasaveerr'] = 'A metaadatok írása nem sikerült';
$lang['metasaveok'] = 'Metaadatok elmentve';
-$lang['btn_img_backto'] = 'Vissza %s';
$lang['img_title'] = 'Cím';
$lang['img_caption'] = 'Képaláírás';
$lang['img_date'] = 'Dátum';
@@ -256,7 +262,6 @@ $lang['img_camera'] = 'Fényképezőgép típusa';
$lang['img_keywords'] = 'Kulcsszavak';
$lang['img_width'] = 'Szélesség';
$lang['img_height'] = 'Magasság';
-$lang['btn_mediaManager'] = 'Megtekintés a médiakezelőben';
$lang['subscr_subscribe_success'] = '%s hozzáadva az értesítési listához: %s';
$lang['subscr_subscribe_error'] = 'Hiba történt %s hozzáadásakor az értesítési listához: %s';
$lang['subscr_subscribe_noaddress'] = 'Nincs e-mail cím megadva az adataidnál, így a rendszer nem tudott hozzáadni az értesítési listához';
diff --git a/inc/lang/id/lang.php b/inc/lang/id/lang.php
index 648aad865..481ff2fbd 100644
--- a/inc/lang/id/lang.php
+++ b/inc/lang/id/lang.php
@@ -8,6 +8,7 @@
* @author Yustinus Waruwu <juswaruwu@gmail.com>
* @author zamroni <therons@ymail.com>
* @author umriya afini <bigdream.power@gmail.com>
+ * @author Arif Budiman <me@kangarif.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -50,7 +51,10 @@ $lang['btn_draftdel'] = 'Hapus draft';
$lang['btn_revert'] = 'Kembalikan';
$lang['btn_register'] = 'Daftar';
$lang['btn_apply'] = 'Terapkan';
+$lang['btn_media'] = 'Pengelola Media';
$lang['btn_deleteuser'] = 'Hapus Akun Saya';
+$lang['btn_img_backto'] = 'Kembali ke %s';
+$lang['btn_mediaManager'] = 'Tampilkan di pengelola media';
$lang['loggedinas'] = 'Login sebagai ';
$lang['user'] = 'Username';
$lang['pass'] = 'Password';
@@ -78,6 +82,7 @@ $lang['profna'] = 'Wiki ini tidak mengijinkan perubahan profil.';
$lang['profnochange'] = 'Tidak ada perubahan.';
$lang['profnoempty'] = 'Mohon mengisikan nama atau alamat email.';
$lang['profchanged'] = 'Profil User berhasil diubah.';
+$lang['profnodelete'] = 'Wiki ini tidak mendukung penghapusan pengguna';
$lang['profdeleteuser'] = 'Hapus Akun';
$lang['profdeleted'] = 'Akun anda telah dihapus dari wiki ini';
$lang['profconfdelete'] = 'Saya berharap menghapus akun saya dari wiki ini.
@@ -91,10 +96,14 @@ $lang['resendpwdnouser'] = 'Maaf, user ini tidak ditemukan.';
$lang['resendpwdbadauth'] = 'Maaf, kode autentikasi tidak valid. Pastikan Anda menggunakan keseluruhan link konfirmasi.';
$lang['resendpwdconfirm'] = 'Link konfirmasi telah dikirim melalui email.';
$lang['resendpwdsuccess'] = 'Password baru Anda telah dikirim melalui email.';
+$lang['license'] = 'Kecuali jika dinyatakan lain, konten pada wiki ini dilisensikan dibawah lisensi berikut:';
+$lang['licenseok'] = 'Catatan: Dengan menyunting halaman ini, Anda setuju untuk melisensikan konten Anda dibawah lisensi berikut:';
$lang['searchmedia'] = 'Cari nama file:';
+$lang['searchmedia_in'] = 'Cari di %s';
$lang['txt_upload'] = 'File yang akan diupload';
$lang['txt_filename'] = 'Masukkan nama wiki (opsional)';
$lang['txt_overwrt'] = 'File yang telah ada akan ditindih';
+$lang['maxuploadsize'] = 'Unggah maks. %s per berkas';
$lang['lockedby'] = 'Sedang dikunci oleh';
$lang['lockexpire'] = 'Penguncian artikel sampai dengan';
$lang['js']['willexpire'] = 'Halaman yang sedang Anda kunci akan berakhir dalam waktu kurang lebih satu menit.\nUntuk menghindari konflik, gunakan tombol Preview untuk me-reset timer pengunci.';
@@ -103,18 +112,41 @@ $lang['js']['searchmedia'] = 'Cari file';
$lang['js']['keepopen'] = 'Biarkan window terbuka dalam pemilihan';
$lang['js']['hidedetails'] = 'Sembunyikan detil';
$lang['js']['mediatitle'] = 'Pengaturan Link';
+$lang['js']['mediadisplay'] = 'Jenis tautan';
+$lang['js']['mediaalign'] = 'Perataan';
$lang['js']['mediasize'] = 'Ukuran gambar';
+$lang['js']['mediatarget'] = 'Tautan tujuan';
$lang['js']['mediaclose'] = 'Tutup';
+$lang['js']['mediainsert'] = 'Sisip';
$lang['js']['mediadisplayimg'] = 'Lihat gambar';
$lang['js']['mediadisplaylnk'] = 'Lihat hanya link';
+$lang['js']['mediasmall'] = 'Versi kecil';
+$lang['js']['mediamedium'] = 'Versi sedang';
+$lang['js']['medialarge'] = 'Versi besar';
+$lang['js']['mediaoriginal'] = 'Versi asli';
+$lang['js']['medialnk'] = 'Tautan ke halaman rincian';
+$lang['js']['mediadirect'] = 'Tautan langsung ke aslinya';
+$lang['js']['medianolnk'] = 'Tanpa tautan';
+$lang['js']['medianolink'] = 'Jangan tautkan gambar';
+$lang['js']['medialeft'] = 'Rata gambar sebelah kiri';
+$lang['js']['mediaright'] = 'Rata gambar sebelah kanan';
+$lang['js']['mediacenter'] = 'Rata gambar di tengah';
+$lang['js']['medianoalign'] = 'Jangan gunakan perataan';
$lang['js']['nosmblinks'] = 'Link ke share Windows hanya bekerja di Microsoft Internet Explorer.
Anda masih dapat mengcopy and paste linknya.';
+$lang['js']['linkwiz'] = 'Wizard Tautan';
+$lang['js']['linkto'] = 'Tautkan ke:';
$lang['js']['del_confirm'] = 'Hapus tulisan ini?';
+$lang['js']['restore_confirm'] = 'Benar-benar ingin mengembalikan versi ini?';
+$lang['js']['media_diff'] = 'Lihat perbedaan:';
+$lang['js']['media_diff_both'] = 'Berdampingan';
+$lang['js']['media_diff_opacity'] = 'Mencolok';
$lang['js']['media_select'] = 'Pilih file...';
$lang['js']['media_upload_btn'] = 'Unggah';
$lang['js']['media_done_btn'] = 'Selesai';
$lang['js']['media_drop'] = 'Tarik file disini untuk mengunggah';
$lang['js']['media_cancel'] = 'Buang';
+$lang['js']['media_overwrt'] = 'Timpa berkas yang ada';
$lang['rssfailed'] = 'Error terjadi saat mengambil feed: ';
$lang['nothingfound'] = 'Tidak menemukan samasekali.';
$lang['mediaselect'] = 'Pilihan Mediafile';
@@ -148,6 +180,13 @@ $lang['current'] = 'sekarang';
$lang['yours'] = 'Versi Anda';
$lang['diff'] = 'Tampilkan perbedaan dengan versi sekarang';
$lang['diff2'] = 'Tampilkan perbedaan diantara revisi terpilih';
+$lang['difflink'] = 'Tautan ke tampilan pembanding ini';
+$lang['diff_type'] = 'Tampilkan perbedaan:';
+$lang['diff_inline'] = 'Sebaris';
+$lang['diff_side'] = 'Berdampingan';
+$lang['diffprevrev'] = 'Revisi sebelumnya';
+$lang['diffnextrev'] = 'Revisi selanjutnya';
+$lang['difflastrev'] = 'Revisi terakhir';
$lang['line'] = 'Baris';
$lang['breadcrumb'] = 'Jejak';
$lang['youarehere'] = 'Anda disini';
@@ -158,11 +197,23 @@ $lang['created'] = 'dibuat';
$lang['restored'] = 'revisi lama ditampilkan kembali (%s)';
$lang['external_edit'] = 'Perubahan eksternal';
$lang['summary'] = 'Edit summary';
+$lang['noflash'] = '<a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> diperlukan untuk menampilkan konten ini.';
+$lang['download'] = 'Unduh Cuplikan';
+$lang['tools'] = 'Alat';
+$lang['user_tools'] = 'Alat Pengguna';
+$lang['site_tools'] = 'Alat Situs';
+$lang['page_tools'] = 'Alat Halaman';
+$lang['skip_to_content'] = 'lewati ke konten';
+$lang['sidebar'] = 'Bilah Sisi';
$lang['mail_newpage'] = 'Halaman ditambahkan:';
$lang['mail_changed'] = 'Halaman diubah:';
+$lang['mail_subscribe_list'] = 'halaman diubah dalam namespace:';
$lang['mail_new_user'] = 'User baru:';
$lang['mail_upload'] = 'Berkas di-upload:';
+$lang['changes_type'] = 'Tampilkan perubahan';
$lang['pages_changes'] = 'Halaman';
+$lang['media_changes'] = 'Berkas media';
+$lang['both_changes'] = 'Baik halaman dan berkas media';
$lang['qb_bold'] = 'Tebal';
$lang['qb_italic'] = 'Miring';
$lang['qb_underl'] = 'Garis Bawah';
@@ -173,6 +224,10 @@ $lang['qb_h2'] = 'Level 2 Headline';
$lang['qb_h3'] = 'Level 3 Headline';
$lang['qb_h4'] = 'Level 4 Headline';
$lang['qb_h5'] = 'Level 5 Headline';
+$lang['qb_hs'] = 'Pilih Judul';
+$lang['qb_hplus'] = 'Judul Lebih Atas';
+$lang['qb_hminus'] = 'Judul Lebih Bawah';
+$lang['qb_hequal'] = 'Tingkat Judul yang Sama';
$lang['qb_link'] = 'Link Internal';
$lang['qb_extlink'] = 'Link External';
$lang['qb_hr'] = 'Garis Horisontal';
@@ -182,11 +237,11 @@ $lang['qb_media'] = 'Tambahkan gambar atau file lain';
$lang['qb_sig'] = 'Sisipkan tanda tangan';
$lang['qb_smileys'] = 'Smileys';
$lang['qb_chars'] = 'Karakter Khusus';
+$lang['upperns'] = 'lompat ke namespace induk';
$lang['admin_register'] = 'Tambah user baru';
$lang['metaedit'] = 'Edit Metadata';
$lang['metasaveerr'] = 'Gagal menulis metadata';
$lang['metasaveok'] = 'Metadata tersimpan';
-$lang['btn_img_backto'] = 'Kembali ke %s';
$lang['img_title'] = 'Judul';
$lang['img_caption'] = 'Label';
$lang['img_date'] = 'Tanggal';
@@ -197,6 +252,22 @@ $lang['img_copyr'] = 'Hakcipta';
$lang['img_format'] = 'Format';
$lang['img_camera'] = 'Kamera';
$lang['img_keywords'] = 'Katakunci';
+$lang['img_width'] = 'Lebar';
+$lang['img_height'] = 'Tinggi';
+$lang['subscr_subscribe_success'] = 'Menambah %s ke senarai langganan untuk %s';
+$lang['subscr_subscribe_error'] = 'Kesalahan menambahkan %s ke senarai langganan untuk %s';
+$lang['subscr_subscribe_noaddress'] = 'Tidak ada alamat yang terkait dengan login Anda, Anda tidak dapat ditambahkan ke senarai langganan';
+$lang['subscr_unsubscribe_success'] = 'Menghapus %s dari senarai langganan untuk %s';
+$lang['subscr_unsubscribe_error'] = 'Kesalahan menghapus %s dari senarai langganan untuk %s';
+$lang['subscr_already_subscribed'] = '%s sudah dilanggankan ke %s';
+$lang['subscr_not_subscribed'] = '%s tidak dilanggankan ke %s';
+$lang['subscr_m_not_subscribed'] = 'Saat ini Anda tidak berlangganan halaman dan namespace saat ini.';
+$lang['subscr_m_new_header'] = 'Tambahkan langganan';
+$lang['subscr_m_current_header'] = 'Langganan saat ini';
+$lang['subscr_m_unsubscribe'] = 'Berhenti berlangganan';
+$lang['subscr_m_subscribe'] = 'Berlangganan';
+$lang['subscr_m_receive'] = 'Menerima';
+$lang['subscr_style_every'] = 'email setiap diubah';
$lang['authtempfail'] = 'Autentikasi user saat ini sedang tidak dapat digunakan. Jika kejadian ini berlanjut, Harap informasikan admin Wiki Anda.';
$lang['i_chooselang'] = 'Pilih bahasa';
$lang['i_installer'] = 'Instalasi DokuWiki';
@@ -217,4 +288,41 @@ $lang['i_policy'] = 'Policy ACL awal';
$lang['i_pol0'] = 'Wiki Terbuka (baca, tulis, upload untuk semua orang)';
$lang['i_pol1'] = 'Wiki Publik (baca untuk semua orang, tulis dan upload untuk pengguna terdaftar)';
$lang['i_pol2'] = 'Wiki Privat (baca, tulis dan upload hanya untuk pengguna terdaftar)';
+$lang['i_allowreg'] = 'Ijinkan pengguna mendaftar sendiri';
$lang['i_retry'] = 'Coba Lagi';
+$lang['i_license'] = 'Silakan pilih lisensi untuk konten Anda:';
+$lang['i_license_none'] = 'Jangan tampilkan semua informasi lisensi';
+$lang['i_pop_field'] = 'Tolong, bantu kami meningkatkan pengalaman DokuWiki:';
+$lang['i_pop_label'] = 'Setiap bulan mengirimkan penggunaan data anonim ke pengembang DokuWiki';
+$lang['years'] = '%d tahun yang lalu';
+$lang['months'] = '%d bulan yang lalu';
+$lang['weeks'] = '%d minggu yang lalu';
+$lang['days'] = '%d hari yang lalu';
+$lang['hours'] = '%d jam yang lalu';
+$lang['minutes'] = '%d menit yang lalu';
+$lang['seconds'] = '%d detik yang lalu';
+$lang['wordblock'] = 'Pengubahan Anda tidak disimpan karena berisi teks yang diblokir (spam).';
+$lang['media_uploadtab'] = 'Unggah';
+$lang['media_searchtab'] = 'Cari';
+$lang['media_file'] = 'Berkas';
+$lang['media_viewtab'] = 'Lihat';
+$lang['media_edittab'] = 'Sunting';
+$lang['media_historytab'] = 'Riwayat';
+$lang['media_list_rows'] = 'Kolom';
+$lang['media_sort_name'] = 'Nama';
+$lang['media_sort_date'] = 'Tanggal';
+$lang['media_namespaces'] = 'Pilih namespace';
+$lang['media_upload'] = 'Unggah ke %s';
+$lang['media_search'] = 'Cari di %s';
+$lang['media_view'] = '%s';
+$lang['media_viewold'] = '%s di %s';
+$lang['media_edit'] = 'Sunting %s';
+$lang['media_history'] = 'Riwayat %s';
+$lang['media_meta_edited'] = 'metadata disunting';
+$lang['media_perm_read'] = 'Maaf, Anda tidak memiliki izin untuk membaca berkas.';
+$lang['media_perm_upload'] = 'Maaf, Anda tidak memiliki izin untuk mengunggah berkas.';
+$lang['media_update'] = 'Unggah versi baru';
+$lang['media_restore'] = 'Kembalikan versi ini';
+$lang['currentns'] = 'Namespace saat ini';
+$lang['searchresult'] = 'Hasil Pencarian';
+$lang['wikimarkup'] = 'Markah Wiki';
diff --git a/inc/lang/id/resetpwd.txt b/inc/lang/id/resetpwd.txt
new file mode 100644
index 000000000..6ab26c866
--- /dev/null
+++ b/inc/lang/id/resetpwd.txt
@@ -0,0 +1,3 @@
+====== Atur sandi baru ======
+
+Silakan masukkan sandi baru untuk akun Anda di wiki ini. \ No newline at end of file
diff --git a/inc/lang/id/subscr_digest.txt b/inc/lang/id/subscr_digest.txt
new file mode 100644
index 000000000..5e1041c04
--- /dev/null
+++ b/inc/lang/id/subscr_digest.txt
@@ -0,0 +1,17 @@
+Hei!
+
+Halaman @PAGE@ di wiki @TITLE@ telah disunting.
+Berikut perubahannya:
+
+--------------------------------------------------------
+@DIFF@
+--------------------------------------------------------
+
+Revisi lama: @OLDPAGE@
+
+Revisi baru: @NEWPAGE@
+
+Untuk menonaktifkan pemberitahuan ini, masuk ke wiki di @DOKUWIKIURL@ kemudian kunjungi @SUBSCRIBE@ dan halaman batal berlangganan dan/atau namespace yang diubah.
+
+--
+Email ini dibuat oleh DokuWiki di @DOKUWIKIURL@ \ No newline at end of file
diff --git a/inc/lang/it/lang.php b/inc/lang/it/lang.php
index eefcec9db..668920903 100644
--- a/inc/lang/it/lang.php
+++ b/inc/lang/it/lang.php
@@ -17,6 +17,8 @@
* @author snarchio@gmail.com
* @author Edmondo Di Tucci <snarchio@gmail.com>
* @author Claudio Lanconelli <lancos@libero.it>
+ * @author Mirko <malisan.mirko@gmail.com>
+ * @author Francesco <francesco.cavalli@hotmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -61,6 +63,8 @@ $lang['btn_register'] = 'Registrazione';
$lang['btn_apply'] = 'Applica';
$lang['btn_media'] = 'Gestore Media';
$lang['btn_deleteuser'] = 'Rimuovi il mio account';
+$lang['btn_img_backto'] = 'Torna a %s';
+$lang['btn_mediaManager'] = 'Guarda nel gestore media';
$lang['loggedinas'] = 'Collegato come';
$lang['user'] = 'Nome utente';
$lang['pass'] = 'Password';
@@ -146,6 +150,7 @@ $lang['js']['del_confirm'] = 'Eliminare veramente questa voce?';
$lang['js']['restore_confirm'] = 'Vuoi davvero ripristinare questa versione?';
$lang['js']['media_diff'] = 'Guarda le differenze:';
$lang['js']['media_diff_both'] = 'Fianco a Fianco';
+$lang['js']['media_diff_portions'] = 'rubare';
$lang['js']['media_select'] = 'Seleziona files..';
$lang['js']['media_upload_btn'] = 'Upload';
$lang['js']['media_done_btn'] = 'Fatto';
@@ -189,6 +194,9 @@ $lang['difflink'] = 'Link a questa pagina di confronto';
$lang['diff_type'] = 'Guarda le differenze:';
$lang['diff_inline'] = 'In linea';
$lang['diff_side'] = 'Fianco a Fianco';
+$lang['diffprevrev'] = 'Revisione precedente';
+$lang['diffnextrev'] = 'Prossima revisione';
+$lang['difflastrev'] = 'Ultima revisione';
$lang['line'] = 'Linea';
$lang['breadcrumb'] = 'Traccia';
$lang['youarehere'] = 'Ti trovi qui';
@@ -245,7 +253,6 @@ $lang['admin_register'] = 'Aggiungi un nuovo utente';
$lang['metaedit'] = 'Modifica metadati';
$lang['metasaveerr'] = 'Scrittura metadati fallita';
$lang['metasaveok'] = 'Metadati salvati';
-$lang['btn_img_backto'] = 'Torna a %s';
$lang['img_title'] = 'Titolo';
$lang['img_caption'] = 'Descrizione';
$lang['img_date'] = 'Data';
@@ -258,7 +265,6 @@ $lang['img_camera'] = 'Camera';
$lang['img_keywords'] = 'Parole chiave';
$lang['img_width'] = 'Larghezza';
$lang['img_height'] = 'Altezza';
-$lang['btn_mediaManager'] = 'Guarda nel gestore media';
$lang['subscr_subscribe_success'] = 'Aggiunto %s alla lista di sottoscrizioni %s';
$lang['subscr_subscribe_error'] = 'Impossibile aggiungere %s alla lista di sottoscrizioni %s';
$lang['subscr_subscribe_noaddress'] = 'Non esiste alcun indirizzo associato al tuo account, non puoi essere aggiunto alla lista di sottoscrizioni';
@@ -337,4 +343,6 @@ $lang['media_perm_read'] = 'Spiacente, non hai abbastanza privilegi per le
$lang['media_perm_upload'] = 'Spiacente, non hai abbastanza privilegi per caricare files.';
$lang['media_update'] = 'Carica nuova versione';
$lang['media_restore'] = 'Ripristina questa versione';
+$lang['currentns'] = 'Namespace corrente';
$lang['searchresult'] = 'Risultati della ricerca';
+$lang['plainhtml'] = 'HTML';
diff --git a/inc/lang/ja/lang.php b/inc/lang/ja/lang.php
index 782689fa3..a8bbe807b 100644
--- a/inc/lang/ja/lang.php
+++ b/inc/lang/ja/lang.php
@@ -11,6 +11,7 @@
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
* @author Hideaki SAWADA <chuno@live.jp>
* @author Hideaki SAWADA <sawadakun@live.jp>
+ * @author PzF_X <jp_minecraft@yahoo.co.jp>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -55,6 +56,8 @@ $lang['btn_register'] = 'ユーザー登録';
$lang['btn_apply'] = '適用';
$lang['btn_media'] = 'メディアマネージャー';
$lang['btn_deleteuser'] = '自分のアカウントの抹消';
+$lang['btn_img_backto'] = '戻る %s';
+$lang['btn_mediaManager'] = 'メディアマネージャーで閲覧';
$lang['loggedinas'] = 'ようこそ';
$lang['user'] = 'ユーザー名';
$lang['pass'] = 'パスワード';
@@ -184,6 +187,11 @@ $lang['difflink'] = 'この比較画面にリンクする';
$lang['diff_type'] = '差分の表示方法:';
$lang['diff_inline'] = 'インライン';
$lang['diff_side'] = '横に並べる';
+$lang['diffprevrev'] = '前のリビジョン';
+$lang['diffnextrev'] = '次のリビジョン';
+$lang['difflastrev'] = '最新リビジョン';
+$lang['diffbothprevrev'] = '両方とも前のリビジョン';
+$lang['diffbothnextrev'] = '両方とも次のリビジョン';
$lang['line'] = 'ライン';
$lang['breadcrumb'] = 'トレース';
$lang['youarehere'] = '現在位置';
@@ -240,7 +248,6 @@ $lang['admin_register'] = '新規ユーザー作成';
$lang['metaedit'] = 'メタデータ編集';
$lang['metasaveerr'] = 'メタデータの書き込みに失敗しました';
$lang['metasaveok'] = 'メタデータは保存されました';
-$lang['btn_img_backto'] = '戻る %s';
$lang['img_title'] = 'タイトル';
$lang['img_caption'] = '見出し';
$lang['img_date'] = '日付';
@@ -253,7 +260,6 @@ $lang['img_camera'] = '使用カメラ';
$lang['img_keywords'] = 'キーワード';
$lang['img_width'] = '幅';
$lang['img_height'] = '高さ';
-$lang['btn_mediaManager'] = 'メディアマネージャーで閲覧';
$lang['subscr_subscribe_success'] = '%sが%sの購読リストに登録されました。';
$lang['subscr_subscribe_error'] = '%sを%sの購読リストへの追加に失敗しました。';
$lang['subscr_subscribe_noaddress'] = 'あなたのログインに対応するアドレスがないため、購読リストへ追加することができません。';
diff --git a/inc/lang/ka/admin.txt b/inc/lang/ka/admin.txt
new file mode 100644
index 000000000..97072a449
--- /dev/null
+++ b/inc/lang/ka/admin.txt
@@ -0,0 +1,4 @@
+====== მართვა ======
+
+ქვემოთ თქვენ ხედავთ ადმინისტრაციული ოპერაციების სიას «დოკუვიკიში».
+
diff --git a/inc/lang/ka/adminplugins.txt b/inc/lang/ka/adminplugins.txt
new file mode 100644
index 000000000..011bfeb62
--- /dev/null
+++ b/inc/lang/ka/adminplugins.txt
@@ -0,0 +1 @@
+===== დამატებითი პლაგინები ===== \ No newline at end of file
diff --git a/inc/lang/ka/backlinks.txt b/inc/lang/ka/backlinks.txt
new file mode 100644
index 000000000..7b54797c7
--- /dev/null
+++ b/inc/lang/ka/backlinks.txt
@@ -0,0 +1,4 @@
+====== გადმომისამართება ======
+
+გვერდები რომლებიც ანიშნებენ ამ გვერდზე.
+
diff --git a/inc/lang/ka/conflict.txt b/inc/lang/ka/conflict.txt
new file mode 100644
index 000000000..1b1eb0482
--- /dev/null
+++ b/inc/lang/ka/conflict.txt
@@ -0,0 +1,5 @@
+====== გამოვიდა უფრო ახალი ვერსია ======
+
+არსებობს დოკუმენტის უფრო ახალი ვერსია, რომელიც თქვენ დაარედაქტირეთ. ეს ხდება მაშინ, როდესაც სხვა მომხმარებელი არედაქტირებს დოკუმენტს, სანამ თქვენ აკეთებდით იგივეს.
+
+ყურადღებით დააკვირდით ქვემოთ მოყვანილ განსხვავებებს, და გადაწყვიტეთ რომელი ვერსია სჯობს. თუ შენახვას დააჭერთ, თქვენი ვერსია შეინახება. \ No newline at end of file
diff --git a/inc/lang/ka/denied.txt b/inc/lang/ka/denied.txt
new file mode 100644
index 000000000..bb8910472
--- /dev/null
+++ b/inc/lang/ka/denied.txt
@@ -0,0 +1,3 @@
+====== მიუწვდომელია ======
+
+თქვენ არ გაქვთ საკმარისი უფლებები. იქნებ ავტორიზაცია დაგავიწყდათ?
diff --git a/inc/lang/ka/diff.txt b/inc/lang/ka/diff.txt
new file mode 100644
index 000000000..c635e45f4
--- /dev/null
+++ b/inc/lang/ka/diff.txt
@@ -0,0 +1,3 @@
+====== განსხვავებები ======
+ქვემოთ მოყვანილაი განსხვავებები მსგავს გვერდებს შორის.
+
diff --git a/inc/lang/ka/draft.txt b/inc/lang/ka/draft.txt
new file mode 100644
index 000000000..f3356ddb5
--- /dev/null
+++ b/inc/lang/ka/draft.txt
@@ -0,0 +1,3 @@
+====== ნაპოვნია ჩანაწერი ======
+
+გვერდის რედაქტირება არ იყო დამთავრებული. \ No newline at end of file
diff --git a/inc/lang/ka/edit.txt b/inc/lang/ka/edit.txt
new file mode 100644
index 000000000..3fffceb0c
--- /dev/null
+++ b/inc/lang/ka/edit.txt
@@ -0,0 +1,2 @@
+დაარედაქტირეთ გვერდი და დააჭირეთ «შენახვას». წაიკითხეთ [[wiki:syntax|FAQ]] ვიკის სინტაქსისთან გასაცნობად. დაარედაქტირეთ გვერდი მხოლოდ იმ შემთხვევაში თუ აპირებთ გვერდის გაუმჯობესებას. თუ თქვენ რამის დატესტვა გინდათ, გამოიყენეთ სპეციალური გვერდი.
+
diff --git a/inc/lang/ka/editrev.txt b/inc/lang/ka/editrev.txt
new file mode 100644
index 000000000..17ccff57f
--- /dev/null
+++ b/inc/lang/ka/editrev.txt
@@ -0,0 +1,2 @@
+**თქვენ ატვირთეთ დოკუმენტის ძველი ვერსია** მისი შენახვით თქვენ შექმნით ახალ ვერსიას იგივე შიგთავსით.
+----
diff --git a/inc/lang/ka/index.txt b/inc/lang/ka/index.txt
new file mode 100644
index 000000000..7daef7fb6
--- /dev/null
+++ b/inc/lang/ka/index.txt
@@ -0,0 +1 @@
+====== სტატიები ====== აქ ნაჩვენებია ყველა სტატია \ No newline at end of file
diff --git a/inc/lang/ka/lang.php b/inc/lang/ka/lang.php
new file mode 100644
index 000000000..cba38cf6b
--- /dev/null
+++ b/inc/lang/ka/lang.php
@@ -0,0 +1,326 @@
+<?php
+
+/**
+ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
+ *
+ * @author Luka Lejava <luka.lejava@gmail.com>
+ */
+$lang['encoding'] = 'utf-8';
+$lang['direction'] = 'ltr';
+$lang['doublequoteopening'] = '“';
+$lang['doublequoteclosing'] = '”';
+$lang['singlequoteopening'] = '‘';
+$lang['singlequoteclosing'] = '’';
+$lang['apostrophe'] = '’';
+$lang['btn_edit'] = 'დაარედაქტირეთ ეს გვერდი';
+$lang['btn_source'] = 'მაჩვენე გვერდის კოდი';
+$lang['btn_show'] = 'გვერდის ჩვენება';
+$lang['btn_create'] = 'გვერდის შექმნა';
+$lang['btn_search'] = 'ძიება';
+$lang['btn_save'] = 'შენახვა';
+$lang['btn_preview'] = 'ჩვენება';
+$lang['btn_top'] = 'მაღლა';
+$lang['btn_newer'] = '<< მეტი ';
+$lang['btn_older'] = 'ნაკლები >>';
+$lang['btn_revs'] = 'ძველი ვერსიები';
+$lang['btn_recent'] = 'ბოლო ცვლილებები';
+$lang['btn_upload'] = 'ატვირთვა';
+$lang['btn_cancel'] = 'შეწყვეტა';
+$lang['btn_index'] = 'სტატიები';
+$lang['btn_secedit'] = 'რედაქტირება';
+$lang['btn_login'] = 'შესვლა';
+$lang['btn_logout'] = 'გამოსვლა';
+$lang['btn_admin'] = 'ადმინი';
+$lang['btn_update'] = 'განახლება';
+$lang['btn_delete'] = 'წაშლა';
+$lang['btn_back'] = 'უკან';
+$lang['btn_backlink'] = 'გადმომისამართებული ბმულები';
+$lang['btn_backtomedia'] = 'მედიაფაილების არჩევა';
+$lang['btn_subscribe'] = 'Manage Subscriptions';
+$lang['btn_profile'] = 'პროფილის განახლება';
+$lang['btn_reset'] = 'წაშლა';
+$lang['btn_resendpwd'] = 'ახალი პაროლის დაყენება';
+$lang['btn_draft'] = 'ჩანაწერის წაშლა';
+$lang['btn_recover'] = 'ჩანაწერის აღდგენა';
+$lang['btn_draftdel'] = 'ჩანაწერის წაშლა';
+$lang['btn_revert'] = 'აღდგენა';
+$lang['btn_register'] = 'რეგისტრაცია';
+$lang['btn_apply'] = 'ცადე';
+$lang['btn_media'] = 'მედია ფაილების მართვა';
+$lang['btn_deleteuser'] = 'ჩემი ექაუნთის წაშლა';
+$lang['btn_img_backto'] = 'უკან %';
+$lang['btn_mediaManager'] = 'მედია ფაილების მმართველში გახსნა';
+$lang['loggedinas'] = 'შესული ხართ როგორც';
+$lang['user'] = 'ლოგინი';
+$lang['pass'] = 'პაროლი';
+$lang['newpass'] = 'ახალი პაროლი';
+$lang['oldpass'] = 'დაადასტურეთ პაროლი';
+$lang['passchk'] = 'კიდევ ერთხელ';
+$lang['remember'] = 'დამიმახსოვრე';
+$lang['fullname'] = 'ნამდვილი სახელი';
+$lang['email'] = 'ფოსტა';
+$lang['profile'] = 'მომხმარებლის პროფილი';
+$lang['badlogin'] = 'ლოგინი ან პაროლი არასწორია';
+$lang['badpassconfirm'] = 'პაროლი არასწორია';
+$lang['minoredit'] = 'ცვლილებები';
+$lang['draftdate'] = 'ჩანაწერების ავტომატური შენახვა ჩართულია';
+$lang['nosecedit'] = 'გვერდს ვადა გაუვიდა';
+$lang['regmissing'] = 'ყველა ველი შეავსეთ';
+$lang['reguexists'] = 'მსგავსი ლოგინი უკვე არსებობს';
+$lang['regsuccess'] = 'მომხმარებელი შექმნილია, პაროლი გამოგზავნილია';
+$lang['regsuccess2'] = 'მომხმარებელი შექმნილია';
+$lang['regmailfail'] = 'დაფიქსირდა შეცდომა';
+$lang['regbadmail'] = 'ფოსტა არასწორია';
+$lang['regbadpass'] = 'პაროლი განსხვავებულია';
+$lang['regpwmail'] = 'თვენი DokuWiki პაროლი';
+$lang['reghere'] = 'დარეგისტრირდი';
+$lang['profna'] = 'არ შეგიძლიათ პროფილის რედაქტირება';
+$lang['profnochange'] = 'ცვლილებები არ არის';
+$lang['profnoempty'] = 'ცარიელი სახელი ან ფოსტა დაუშვებელია';
+$lang['profchanged'] = 'პროფილი განახლდა';
+$lang['profnodelete'] = 'მომხმარებლის წაშლა შეუძლებელია';
+$lang['profdeleteuser'] = 'პროფილის წაშლა';
+$lang['profdeleted'] = 'პროფილი წაიშალა';
+$lang['profconfdelete'] = 'მე მსურს პროფილის წაშლა. <br/> თქვენ აღარ გექნებათ საშუალება აღადგინოთ პროფილი.';
+$lang['profconfdeletemissing'] = 'დადასტურების ველი ცარიელია';
+$lang['pwdforget'] = 'დაგავიწყდა პაროლი? აღადგინე';
+$lang['resendna'] = 'პაროლის აღდგენა შეუძლებელია';
+$lang['resendpwd'] = 'ახალი პაროლი';
+$lang['resendpwdmissing'] = 'უნდა შეავსოთ ყველა ველი';
+$lang['resendpwdnouser'] = 'მსგავსი ლოგინი დარეგისტრირებული არ არის';
+$lang['resendpwdbadauth'] = 'კოდი არასწორია';
+$lang['resendpwdconfirm'] = 'აღსადგენი ბმული გამოგზავნილია';
+$lang['resendpwdsuccess'] = 'ახალი პაროლი გამოგზავნილია';
+$lang['license'] = 'ვიკი ლიცენზირებულია: ';
+$lang['licenseok'] = 'ამ გვერდის რედაქტირებით თვენ ეთანხმებით ლიცენზიას:';
+$lang['searchmedia'] = 'საძებო სახელი:';
+$lang['searchmedia_in'] = 'ძებნა %-ში';
+$lang['txt_upload'] = 'აირჩიეთ ასატვირთი ფაილი';
+$lang['txt_filename'] = 'ატვირთვა როგორც (არჩევითი)';
+$lang['txt_overwrt'] = 'გადაწერა ზემოდან';
+$lang['maxuploadsize'] = 'მაქსიმალური ზომა %';
+$lang['lockedby'] = 'დაბლოკილია';
+$lang['lockexpire'] = 'განიბლოკება';
+$lang['js']['willexpire'] = 'გვერდი განიბლოკება 1 წუთში';
+$lang['js']['notsavedyet'] = 'შეუნახავი მონაცემები წაიშლება';
+$lang['js']['searchmedia'] = 'ძებნა';
+$lang['js']['keepopen'] = 'დატოვეთ ღია';
+$lang['js']['hidedetails'] = 'დეტალების დამალვა';
+$lang['js']['mediatitle'] = 'ინსტრუმენტები';
+$lang['js']['mediadisplay'] = 'ბმულის ტიპი';
+$lang['js']['mediaalign'] = 'Alignment';
+$lang['js']['mediasize'] = 'სურათის ზომა';
+$lang['js']['mediatarget'] = 'მიზნის ბმული';
+$lang['js']['mediaclose'] = 'დახურვა';
+$lang['js']['mediainsert'] = 'ჩასმა';
+$lang['js']['mediadisplayimg'] = 'სურათის ნახვა';
+$lang['js']['mediadisplaylnk'] = 'მაჩვენე მხოლოდ ბმული';
+$lang['js']['mediasmall'] = 'მცირე ვერსია';
+$lang['js']['mediamedium'] = 'საშუალო ვერსია';
+$lang['js']['medialarge'] = 'ვრცელი ვერსია';
+$lang['js']['mediaoriginal'] = 'ორიგინალი ვერსია';
+$lang['js']['medialnk'] = 'დაწვრილებით';
+$lang['js']['mediadirect'] = 'ორიგინალი';
+$lang['js']['medianolnk'] = 'ბმული არ არის';
+$lang['js']['medianolink'] = 'არ დალინკოთ სურათი';
+$lang['js']['medialeft'] = 'მარცხვნივ განათავსეთ სურათი';
+$lang['js']['mediaright'] = 'მარჯვნივ განათავსეთ სურათი';
+$lang['js']['mediacenter'] = 'შუაში განათავსეთ სურათი';
+$lang['js']['medianoalign'] = 'Use no align.';
+$lang['js']['nosmblinks'] = 'ეს ფუქნცია მუშაობს მხოლოდ Internet Explorer-ზე';
+$lang['js']['linkwiz'] = 'ბმული';
+$lang['js']['linkto'] = 'ბმული';
+$lang['js']['del_confirm'] = 'დარწმუნებული ხართ რომ წაშლა გინდათ?';
+$lang['js']['restore_confirm'] = 'დარწმუნებული ხართ რომ აღდგენა გინდათ?';
+$lang['js']['media_diff'] = 'განსხვავებების ჩვენება';
+$lang['js']['media_diff_both'] = 'გვერდიგვერდ';
+$lang['js']['media_diff_opacity'] = 'Shine-through';
+$lang['js']['media_diff_portions'] = 'Swipe
+';
+$lang['js']['media_select'] = 'არჩეული ფაილები';
+$lang['js']['media_upload_btn'] = 'ატვირთვა';
+$lang['js']['media_done_btn'] = 'მზადაა';
+$lang['js']['media_drop'] = 'ჩაყარეთ ასატვირთი ფაილები';
+$lang['js']['media_cancel'] = 'წაშლა';
+$lang['js']['media_overwrt'] = 'გადაწერა ზემოდან';
+$lang['rssfailed'] = 'დაფიქსირდა შეცდომა:';
+$lang['nothingfound'] = 'ნაპოვნი არ არის';
+$lang['mediaselect'] = 'მედია ფაილები';
+$lang['fileupload'] = 'მედია ფაილების ატვირთვა';
+$lang['uploadsucc'] = 'ატვირთვა დასრულებულია';
+$lang['uploadfail'] = 'შეფერხება ატვირთვისას';
+$lang['uploadwrong'] = 'ატვირთვა შეუძლებელია';
+$lang['uploadexist'] = 'ფაილი უკვე არსებობს';
+$lang['uploadbadcontent'] = 'ატვირთული ფაილები არ ემთხვევა ';
+$lang['uploadspam'] = 'ატვირთვა დაბლოკილია სპამბლოკერის მიერ';
+$lang['uploadxss'] = 'ატვირთვა დაბლოკილია';
+$lang['uploadsize'] = 'ასატვირთი ფაილი ზედმეტად დიდია';
+$lang['deletesucc'] = '% ფაილები წაიშალა';
+$lang['deletefail'] = '% ვერ მოიძებნა';
+$lang['mediainuse'] = 'ფაილის % ვერ წაიშალა, რადგან გამოყენებაშია';
+$lang['namespaces'] = 'Namespaces';
+$lang['mediafiles'] = 'არსებული ფაილები';
+$lang['accessdenied'] = 'თქვენ არ შეგიძლიათ გვერდის ნახვა';
+$lang['mediausage'] = 'Use the following syntax to reference this file:';
+$lang['mediaview'] = 'ორიგინალი ფაილის ჩვენება';
+$lang['mediaroot'] = 'root';
+$lang['mediaupload'] = 'Upload a file to the current namespace here. To create subnamespaces, prepend them to your filename separated by colons after you selected the files. Files can also be selected by drag and drop.';
+$lang['mediaextchange'] = 'Filextension changed from .%s to .%s!';
+$lang['reference'] = 'References for';
+$lang['ref_inuse'] = 'ფაილი წაშლა შეუძლებელია, გამოიყენება აქ:';
+$lang['ref_hidden'] = 'ზოგიერთი ბლოკის წაკითხვის უფლება არ გაქვთ';
+$lang['hits'] = 'Hits';
+$lang['quickhits'] = 'მსგავსი სახელები';
+$lang['toc'] = 'Table of Contents';
+$lang['current'] = 'ახლანდელი';
+$lang['yours'] = 'თვენი ვერსია';
+$lang['diff'] = 'ვერსიების განსხვავება';
+$lang['diff2'] = 'განსხვავებები';
+$lang['difflink'] = 'Link to this comparison view';
+$lang['diff_type'] = 'განსხვავებების ჩვენება';
+$lang['diff_inline'] = 'Inline';
+$lang['diff_side'] = 'გვერდიგვერდ';
+$lang['diffprevrev'] = 'წინა ვერსია';
+$lang['diffnextrev'] = 'შემდეგი ვერსია';
+$lang['difflastrev'] = 'ბოლო ვერსია';
+$lang['diffbothprevrev'] = 'Both sides previous revision';
+$lang['diffbothnextrev'] = 'Both sides next revision';
+$lang['line'] = 'ზოლი';
+$lang['breadcrumb'] = 'Trace';
+$lang['youarehere'] = 'თვენ ხართ აქ';
+$lang['lastmod'] = 'ბოლოს მოდიფიცირებული';
+$lang['deleted'] = 'წაშლილია';
+$lang['created'] = 'შექმნილია';
+$lang['restored'] = 'ძველი ვერსია აღდგენილია %';
+$lang['external_edit'] = 'რედაქტირება';
+$lang['summary'] = 'Edit summary';
+$lang['noflash'] = '<a href="http://www.adobe.com/products/flashplayer/">საჭიროა Adobe Flash Plugin</a>';
+$lang['download'] = 'Snippet-ის გადმოწერა';
+$lang['tools'] = 'ინსტრუმენტები';
+$lang['user_tools'] = 'მომხმარებლის ინსტრუმენტები';
+$lang['site_tools'] = 'საიტის ინსტრუმენტები';
+$lang['page_tools'] = 'გვერდის ინსტრუმენტები';
+$lang['skip_to_content'] = 'მასალა';
+$lang['sidebar'] = 'გვერდითი პანელი';
+$lang['mail_newpage'] = 'გვერდი დამატებულია:';
+$lang['mail_changed'] = 'გვერდი შეცვლილია:';
+$lang['mail_subscribe_list'] = 'გვერდში შეცვლილია namespace-ები:';
+$lang['mail_new_user'] = 'ახალი მომხმარებელი';
+$lang['mail_upload'] = 'ფაილი ატვირთულია';
+$lang['changes_type'] = 'ცვლილებები';
+$lang['pages_changes'] = 'გვერდები';
+$lang['media_changes'] = 'მედია ფაილები';
+$lang['both_changes'] = 'გვერდები და მედია ფაილები';
+$lang['qb_bold'] = 'Bold Text';
+$lang['qb_italic'] = 'Italic Text';
+$lang['qb_underl'] = 'Underlined Text';
+$lang['qb_code'] = 'Monospaced Text';
+$lang['qb_strike'] = 'Strike-through Text';
+$lang['qb_h1'] = 'Level 1 სათაური';
+$lang['qb_h2'] = 'Level 2 სათაური';
+$lang['qb_h3'] = 'Level 3 სათაური';
+$lang['qb_h4'] = 'Level 4 სათაური';
+$lang['qb_h5'] = 'Level 5 სათაური';
+$lang['qb_h'] = 'სათაური';
+$lang['qb_hs'] = 'სათაურის არჩევა';
+$lang['qb_hplus'] = 'Higher სათაური';
+$lang['qb_hminus'] = 'Lower სათაური';
+$lang['qb_hequal'] = 'Same Level სათაური';
+$lang['qb_link'] = 'Internal Link';
+$lang['qb_extlink'] = 'External Link';
+$lang['qb_hr'] = 'Horizontal Rule';
+$lang['qb_ol'] = 'შეკვეთილი ბოლო მასალა';
+$lang['qb_ul'] = 'Unordered List Item';
+$lang['qb_media'] = 'ნახატების და სხვა ფაიელბის დამატება';
+$lang['qb_sig'] = 'ხელმოწერა';
+$lang['qb_smileys'] = 'სმაილები';
+$lang['qb_chars'] = 'Special Chars';
+$lang['upperns'] = 'jump to parent namespace';
+$lang['admin_register'] = 'ახალი მომხმარებლის დამატება';
+$lang['metaedit'] = 'Edit Metadata';
+$lang['metasaveerr'] = 'Writing metadata failed';
+$lang['metasaveok'] = 'Metadata saved';
+$lang['img_title'] = 'სათაური';
+$lang['img_caption'] = 'Caption';
+$lang['img_date'] = 'თარიღი';
+$lang['img_fname'] = 'ფაილის სახელი';
+$lang['img_fsize'] = 'ზომა';
+$lang['img_artist'] = 'ფოტოგრაფი';
+$lang['img_copyr'] = 'Copyright';
+$lang['img_format'] = 'ფორმატი';
+$lang['img_camera'] = 'კამერა';
+$lang['img_keywords'] = 'Keywords';
+$lang['img_width'] = 'სიგანე';
+$lang['img_height'] = 'სიმაღლე';
+$lang['subscr_subscribe_success'] = 'Added %s to subscription list for %s';
+$lang['subscr_subscribe_error'] = 'Error adding %s to subscription list for %s';
+$lang['subscr_subscribe_noaddress'] = 'There is no address associated with your login, you cannot be added to the subscription list';
+$lang['subscr_unsubscribe_success'] = 'Removed %s from subscription list for %s';
+$lang['subscr_unsubscribe_error'] = 'Error removing %s from subscription list for %s';
+$lang['subscr_already_subscribed'] = '%s is already subscribed to %s';
+$lang['subscr_not_subscribed'] = '%s is not subscribed to %s';
+$lang['subscr_m_not_subscribed'] = 'You are currently not subscribed to the current page or namespace.';
+$lang['subscr_m_new_header'] = 'Add subscription';
+$lang['subscr_m_current_header'] = 'Current subscriptions';
+$lang['subscr_m_unsubscribe'] = 'Unsubscribe';
+$lang['subscr_m_subscribe'] = 'Subscribe';
+$lang['subscr_m_receive'] = 'მიღება';
+$lang['subscr_style_every'] = 'ფოსტა ყოველ ცვლილებაზე';
+$lang['subscr_style_digest'] = 'ფოსტა ყოველი გვერდის შეცვლაზე ';
+$lang['subscr_style_list'] = 'ფოსტა ყოველი გვერდის შეცვლაზე ';
+$lang['authtempfail'] = 'User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.';
+$lang['authpwdexpire'] = 'თქვენს პაროლს ვადა გაუვა %d დღეში, მალე შეცვლა მოგიწევთ.';
+$lang['i_chooselang'] = 'ენსი არჩევა';
+$lang['i_installer'] = 'DokuWiki დამყენებელი';
+$lang['i_wikiname'] = 'Wiki სახელი';
+$lang['i_enableacl'] = 'Enable ACL (recommended)';
+$lang['i_superuser'] = 'ადმინი';
+$lang['i_problems'] = 'შეასწორეთ შეცდომები';
+$lang['i_modified'] = 'For security reasons this script will only work with a new and unmodified Dokuwiki installation. You should either re-extract the files from the downloaded package or consult the complete <a href="http://dokuwiki.org/install">Dokuwiki installation instructions</a>';
+$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
+$lang['i_phpver'] = 'Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.';
+$lang['i_permfail'] = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
+$lang['i_confexists'] = '<code>%s</code> already exists';
+$lang['i_writeerr'] = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
+$lang['i_badhash'] = 'unrecognised or modified dokuwiki.php (hash=<code>%s</code>)';
+$lang['i_badval'] = '<code>%s</code> - illegal or empty value';
+$lang['i_failure'] = 'Some errors occurred while writing the configuration files. You may need to fix them manually before you can use <a href="doku.php?id=wiki:welcome">your new DokuWiki</a>.';
+$lang['i_policy'] = 'Initial ACL policy';
+$lang['i_pol0'] = 'ღია ვიკი (წაკითხვა, დაწერა და ატვირთვა შეუძლია ნებისმიერს)';
+$lang['i_pol1'] = 'თავისუფალი ვიკი (წაკითხვა შეუძლია ყველას, დაწერა და ატვირთვა - რეგისტრირებულს)';
+$lang['i_pol2'] = 'დახურული ვიკი (წაკითხვა, დაწერა და ატვირთვა შეუძლიათ მხოლოდ რეგისტრირებულებს)';
+$lang['i_allowreg'] = 'რეგისტრაციის გახსნა';
+$lang['i_retry'] = 'თავიდან ცდა';
+$lang['i_license'] = 'აირჩიეთ ლიცენზია';
+$lang['i_license_none'] = 'არ აჩვენოთ ლიცენზიის ინფორმაცია';
+$lang['i_pop_field'] = 'დაგვეხმარეთ DokuWiki-ს აგუმჯობესებაში';
+$lang['i_pop_label'] = 'თვეში ერთელ ინფორმაციის DokuWiki-ის ადმინისტრაციისთვის გაგზავნა';
+$lang['recent_global'] = 'You\'re currently watching the changes inside the <b>%s</b> namespace. You can also <a href="%s">view the recent changes of the whole wiki</a>.';
+$lang['years'] = '%d წლის უკან';
+$lang['months'] = '%d თვის უკან';
+$lang['weeks'] = '%d კვირის უკან';
+$lang['days'] = '%d დღის წინ';
+$lang['hours'] = '%d საათის წინ';
+$lang['minutes'] = '%d წუთის წინ';
+$lang['seconds'] = '%d წამის წინ';
+$lang['wordblock'] = 'თქვენი ცვლილებები არ შეინახა, რადგან შეიცავს სპამს';
+$lang['media_uploadtab'] = 'ატვირთვა';
+$lang['media_searchtab'] = 'ძებნა';
+$lang['media_file'] = 'ფაილი';
+$lang['media_viewtab'] = 'ჩვენება';
+$lang['media_edittab'] = 'რედაქტირება';
+$lang['media_historytab'] = 'ისტორია';
+$lang['media_list_thumbs'] = 'Thumbnails';
+$lang['media_list_rows'] = 'Rows';
+$lang['media_sort_name'] = 'სახელი';
+$lang['media_sort_date'] = 'თარიღი';
+$lang['media_namespaces'] = 'Choose namespace';
+$lang['media_files'] = 'ფაილები %s';
+$lang['media_upload'] = 'ატვირთვა %s';
+$lang['media_search'] = 'ძებნა %s';
+$lang['media_view'] = '%s';
+$lang['media_viewold'] = '%s at %s';
+$lang['media_edit'] = 'რედაქტირება %s';
+$lang['media_history'] = 'ისტორია %s';
+$lang['media_meta_edited'] = 'metadata edited';
+$lang['media_perm_read'] = 'თვენ არ გაქვთ უფლება წაიკითხოთ ეს მასალა';
diff --git a/inc/lang/ko/lang.php b/inc/lang/ko/lang.php
index 3a49dda7a..592b953b9 100644
--- a/inc/lang/ko/lang.php
+++ b/inc/lang/ko/lang.php
@@ -12,6 +12,7 @@
* @author Myeongjin <aranet100@gmail.com>
* @author Gerrit Uitslag <klapinklapin@gmail.com>
* @author Garam <rowain8@gmail.com>
+ * @author Young gon Cha <garmede@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -45,7 +46,7 @@ $lang['btn_back'] = '뒤로';
$lang['btn_backlink'] = '백링크';
$lang['btn_backtomedia'] = '미디어 파일 선택으로 돌아가기';
$lang['btn_subscribe'] = '구독 관리';
-$lang['btn_profile'] = '개인 정보 바꾸기';
+$lang['btn_profile'] = '프로필 바꾸기';
$lang['btn_reset'] = '재설정';
$lang['btn_resendpwd'] = '새 비밀번호 설정';
$lang['btn_draft'] = '초안 편집';
@@ -54,18 +55,20 @@ $lang['btn_draftdel'] = '초안 삭제';
$lang['btn_revert'] = '되돌리기';
$lang['btn_register'] = '등록';
$lang['btn_apply'] = '적용';
-$lang['btn_media'] = '미디어 관리';
+$lang['btn_media'] = '미디어 관리자';
$lang['btn_deleteuser'] = '내 계정 제거';
+$lang['btn_img_backto'] = '%s(으)로 돌아가기';
+$lang['btn_mediaManager'] = '미디어 관리자에서 보기';
$lang['loggedinas'] = '로그인한 사용자';
$lang['user'] = '사용자 이름';
$lang['pass'] = '비밀번호';
$lang['newpass'] = '새 비밀번호';
$lang['oldpass'] = '현재 비밀번호 확인';
-$lang['passchk'] = '비밀번호 다시 확인';
+$lang['passchk'] = '다시 확인';
$lang['remember'] = '기억하기';
$lang['fullname'] = '실명';
$lang['email'] = '이메일';
-$lang['profile'] = '개인 정보';
+$lang['profile'] = '사용자 프로필';
$lang['badlogin'] = '죄송하지만 사용자 이름이나 비밀번호가 잘못되었습니다.';
$lang['badpassconfirm'] = '죄송하지만 비밀번호가 잘못되었습니다';
$lang['minoredit'] = '사소한 바뀜';
@@ -75,21 +78,21 @@ $lang['regmissing'] = '죄송하지만 모든 필드를 채워야 합
$lang['reguexists'] = '죄송하지만 같은 이름을 사용하는 사용자가 있습니다.';
$lang['regsuccess'] = '사용자를 만들었으며 비밀번호는 이메일로 보냈습니다.';
$lang['regsuccess2'] = '사용자를 만들었습니다.';
-$lang['regmailfail'] = '비밀번호를 이메일로 보내는 동안 오류가 발생했습니다. 관리자에게 문의하세요!';
-$lang['regbadmail'] = '주어진 이메일 주소가 잘못되었습니다 - 오류라고 생각하면 관리자에게 문의하세요';
-$lang['regbadpass'] = '새 비밀번호가 같지 않습니다. 다시 입력하세요.';
+$lang['regmailfail'] = '비밀번호를 이메일로 보내는 동안 오류가 발생했습니다. 관리자에게 문의해주세요!';
+$lang['regbadmail'] = '주어진 이메일 주소가 잘못되었습니다 - 오류라고 생각하면 관리자에게 문의해주세요';
+$lang['regbadpass'] = '두 주어진 비밀번호가 같지 않습니다. 다시 입력하세요.';
$lang['regpwmail'] = '도쿠위키 비밀번호';
-$lang['reghere'] = '계정이 없나요? 계정을 등록할 수 있습니다';
-$lang['profna'] = '이 위키는 개인 정보 수정을 할 수 없습니다';
+$lang['reghere'] = '계정이 없나요? 계정을 등록하세요';
+$lang['profna'] = '이 위키는 프로필 수정을 할 수 없습니다';
$lang['profnochange'] = '바뀐 내용이 없습니다.';
-$lang['profnoempty'] = '이름이나 이메일 주소가 비었습니다.';
-$lang['profchanged'] = '개인 정보가 성공적으로 바뀌었습니다.';
+$lang['profnoempty'] = '빈 이름이나 이메일 주소는 허용하지 않습니다.';
+$lang['profchanged'] = '프로필이 성공적으로 바뀌었습니다.';
$lang['profnodelete'] = '이 위키는 사용자 삭제를 지원하지 않습니다';
$lang['profdeleteuser'] = '계정 삭제';
$lang['profdeleted'] = '당신의 사용자 계정이 이 위키에서 삭제되었습니다';
$lang['profconfdelete'] = '이 위키에서 내 계정을 제거하고 싶습니다. <br/> 이 행동은 되돌릴 수 없습니다.';
$lang['profconfdeletemissing'] = '선택하지 않은 확인 상자를 확인';
-$lang['pwdforget'] = '비밀번호를 잊으셨나요? 비밀번호를 재설정할 수 있습니다';
+$lang['pwdforget'] = '비밀번호를 잊으셨나요? 비밀번호를 재설정하세요';
$lang['resendna'] = '이 위키는 비밀번호 재설정을 지원하지 않습니다.';
$lang['resendpwd'] = '다음으로 새 비밀번호 보내기';
$lang['resendpwdmissing'] = '죄송하지만 모든 필드를 채워야 합니다.';
@@ -110,10 +113,10 @@ $lang['lockexpire'] = '잠금 해제 시간';
$lang['js']['willexpire'] = '잠시 후 편집 잠금이 해제됩니다.\n편집 충돌을 피하려면 미리 보기를 눌러 잠금 시간을 다시 설정하세요.';
$lang['js']['notsavedyet'] = '저장하지 않은 바뀜이 사라집니다.';
$lang['js']['searchmedia'] = '파일 검색';
-$lang['js']['keepopen'] = '선택할 때 창을 열어 놓기';
+$lang['js']['keepopen'] = '선택할 때 열어 놓은 창을 유지하기';
$lang['js']['hidedetails'] = '자세한 정보 숨기기';
$lang['js']['mediatitle'] = '링크 설정';
-$lang['js']['mediadisplay'] = '링크 형태';
+$lang['js']['mediadisplay'] = '링크 유형';
$lang['js']['mediaalign'] = '배치';
$lang['js']['mediasize'] = '그림 크기';
$lang['js']['mediatarget'] = '링크 목표';
@@ -171,7 +174,7 @@ $lang['mediaview'] = '원본 파일 보기';
$lang['mediaroot'] = '루트';
$lang['mediaupload'] = '파일을 현재 이름공간으로 올립니다. 하위 이름공간으로 만들려면 선택한 파일 이름 앞에 쌍점(:)으로 구분되는 이름을 붙이면 됩니다. 파일을 드래그 앤 드롭해 선택할 수 있습니다.';
$lang['mediaextchange'] = '파일 확장자가 .%s에서 .%s(으)로 바뀌었습니다!';
-$lang['reference'] = '참고';
+$lang['reference'] = '다음을 참조';
$lang['ref_inuse'] = '다음 문서에서 아직 사용 중이므로 파일을 삭제할 수 없습니다:';
$lang['ref_hidden'] = '문서의 일부 참고는 읽을 수 있는 권한이 없습니다';
$lang['hits'] = '조회 수';
@@ -185,13 +188,18 @@ $lang['difflink'] = '차이 보기로 링크';
$lang['diff_type'] = '차이 보기:';
$lang['diff_inline'] = '직렬 방식';
$lang['diff_side'] = '다중 창 방식';
+$lang['diffprevrev'] = '이전 판';
+$lang['diffnextrev'] = '다음 판';
+$lang['difflastrev'] = '마지막 판';
+$lang['diffbothprevrev'] = '양쪽 이전 판';
+$lang['diffbothnextrev'] = '양쪽 다음 판';
$lang['line'] = '줄';
$lang['breadcrumb'] = '추적';
$lang['youarehere'] = '현재 위치';
$lang['lastmod'] = '마지막으로 수정됨';
$lang['by'] = '저자';
$lang['deleted'] = '제거됨';
-$lang['created'] = '새로 만듦';
+$lang['created'] = '만듦';
$lang['restored'] = '이전 판으로 되돌림 (%s)';
$lang['external_edit'] = '바깥 편집';
$lang['summary'] = '편집 요약';
@@ -232,7 +240,7 @@ $lang['qb_extlink'] = '바깥 링크';
$lang['qb_hr'] = '가로줄';
$lang['qb_ol'] = '순서 있는 목록';
$lang['qb_ul'] = '순서 없는 목록';
-$lang['qb_media'] = '그림과 기타 파일 추가 (새 창에서 열림)';
+$lang['qb_media'] = '그림과 다른 파일 추가 (새 창에서 열림)';
$lang['qb_sig'] = '서명 넣기';
$lang['qb_smileys'] = '이모티콘';
$lang['qb_chars'] = '특수 문자';
@@ -241,7 +249,6 @@ $lang['admin_register'] = '새 사용자 추가';
$lang['metaedit'] = '메타데이터 편집';
$lang['metasaveerr'] = '메타데이터 쓰기 실패';
$lang['metasaveok'] = '메타데이터 저장됨';
-$lang['btn_img_backto'] = '뒤로 %s';
$lang['img_title'] = '제목';
$lang['img_caption'] = '설명';
$lang['img_date'] = '날짜';
@@ -254,7 +261,6 @@ $lang['img_camera'] = '카메라';
$lang['img_keywords'] = '키워드';
$lang['img_width'] = '너비';
$lang['img_height'] = '높이';
-$lang['btn_mediaManager'] = '미디어 관리자에서 보기';
$lang['subscr_subscribe_success'] = '%s 사용자가 %s 구독 목록에 추가했습니다';
$lang['subscr_subscribe_error'] = '%s 사용자가 %s 구독 목록에 추가하는데 실패했습니다';
$lang['subscr_subscribe_noaddress'] = '로그인으로 연결된 주소가 없기 때문에 구독 목록에 추가할 수 없습니다';
@@ -302,7 +308,7 @@ $lang['i_pop_field'] = '도쿠위키 경험을 개선하는 데 도움
$lang['i_pop_label'] = '한 달에 한 번씩, 도쿠위키 개발자에게 익명의 사용 데이터를 보냅니다';
$lang['recent_global'] = '현재 <b>%s</b> 이름공간을 구독 중입니다. <a href="%s">전체 위키의 최근 바뀜도 볼 수</a> 있습니다.';
$lang['years'] = '%d년 전';
-$lang['months'] = '%d달 전';
+$lang['months'] = '%d개월 전';
$lang['weeks'] = '%d주 전';
$lang['days'] = '%d일 전';
$lang['hours'] = '%d시간 전';
diff --git a/inc/lang/ko/searchpage.txt b/inc/lang/ko/searchpage.txt
index 2313f0bb0..53faa04c6 100644
--- a/inc/lang/ko/searchpage.txt
+++ b/inc/lang/ko/searchpage.txt
@@ -1,5 +1,5 @@
====== 검색 ======
-아래에서 검색 결과를 찾을 수 있습니다. 만약 원하는 문서를 찾지 못했다면, "문서 만들기"나 "문서 편집"을 사용해 검색어와 같은 이름의 문서를 만들거나 편집할 수 있습니다.
+아래에서 검색 결과를 찾을 수 있습니다. 만약 원하는 문서를 찾지 못했다면, ''문서 만들기''나 ''문서 편집''을 사용해 검색어와 같은 이름의 문서를 만들거나 편집할 수 있습니다.
===== 결과 ===== \ No newline at end of file
diff --git a/inc/lang/ko/subscr_digest.txt b/inc/lang/ko/subscr_digest.txt
index 0f03e51a3..d1f2d4b99 100644
--- a/inc/lang/ko/subscr_digest.txt
+++ b/inc/lang/ko/subscr_digest.txt
@@ -11,7 +11,7 @@
새 판: @NEWPAGE@
-문서의 알림을 취소하려면, @DOKUWIKIURL@에 로그인한 뒤
+문서 알림을 취소하려면, @DOKUWIKIURL@에 로그인한 뒤
@SUBSCRIBE@ 문서를 방문해 문서나 이름공간의 구독을 취소하세요.
--
diff --git a/inc/lang/ko/updateprofile.txt b/inc/lang/ko/updateprofile.txt
index 80545e9bf..055272e9d 100644
--- a/inc/lang/ko/updateprofile.txt
+++ b/inc/lang/ko/updateprofile.txt
@@ -1,3 +1,3 @@
-====== 개인 정보 바꾸기 ======
+====== 계정 프로필 바꾸기 ======
바꾸고 싶은 항목을 입력하세요. 사용자 이름은 바꿀 수 없습니다. \ No newline at end of file
diff --git a/inc/lang/nl/lang.php b/inc/lang/nl/lang.php
index b6cf11968..beefc8eb3 100644
--- a/inc/lang/nl/lang.php
+++ b/inc/lang/nl/lang.php
@@ -23,14 +23,15 @@
* @author Remon <no@email.local>
* @author gicalle <gicalle@hotmail.com>
* @author Rene <wllywlnt@yahoo.com>
+ * @author Johan Vervloet <johan.vervloet@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
-$lang['doublequoteopening'] = '„';
+$lang['doublequoteopening'] = '“';
$lang['doublequoteclosing'] = '”';
-$lang['singlequoteopening'] = '‚';
+$lang['singlequoteopening'] = '‘';
$lang['singlequoteclosing'] = '’';
-$lang['apostrophe'] = '\'';
+$lang['apostrophe'] = '’';
$lang['btn_edit'] = 'Pagina aanpassen';
$lang['btn_source'] = 'Toon broncode';
$lang['btn_show'] = 'Toon pagina';
diff --git a/inc/lang/no/lang.php b/inc/lang/no/lang.php
index cdf0effcc..8b3c4937f 100644
--- a/inc/lang/no/lang.php
+++ b/inc/lang/no/lang.php
@@ -20,6 +20,7 @@
* @author Egil Hansen <egil@rosetta.no>
* @author Thomas Juberg <Thomas.Juberg@Gmail.com>
* @author Boris <boris@newton-media.no>
+ * @author Christopher Schive <chschive@frisurf.no>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -64,6 +65,8 @@ $lang['btn_register'] = 'Registrer deg';
$lang['btn_apply'] = 'Bruk';
$lang['btn_media'] = 'Mediefiler';
$lang['btn_deleteuser'] = 'Fjern min konto';
+$lang['btn_img_backto'] = 'Tilbake til %s';
+$lang['btn_mediaManager'] = 'Vis i mediefilbehandler';
$lang['loggedinas'] = 'Innlogget som';
$lang['user'] = 'Brukernavn';
$lang['pass'] = 'Passord';
@@ -195,6 +198,11 @@ $lang['difflink'] = 'Lenk til denne sammenligningen';
$lang['diff_type'] = 'Vis forskjeller:';
$lang['diff_inline'] = 'I teksten';
$lang['diff_side'] = 'Side ved side';
+$lang['diffprevrev'] = 'Forrige revisjon';
+$lang['diffnextrev'] = 'Neste revisjon';
+$lang['difflastrev'] = 'Siste revisjon';
+$lang['diffbothprevrev'] = 'Begge sider forrige revisjon';
+$lang['diffbothnextrev'] = 'Begge sider neste revisjon';
$lang['line'] = 'Linje';
$lang['breadcrumb'] = 'Spor';
$lang['youarehere'] = 'Du er her';
@@ -251,7 +259,6 @@ $lang['admin_register'] = 'Legg til ny bruker';
$lang['metaedit'] = 'Rediger metadata';
$lang['metasaveerr'] = 'Skriving av metadata feilet';
$lang['metasaveok'] = 'Metadata lagret';
-$lang['btn_img_backto'] = 'Tilbake til %s';
$lang['img_title'] = 'Tittel';
$lang['img_caption'] = 'Bildetekst';
$lang['img_date'] = 'Dato';
@@ -264,7 +271,6 @@ $lang['img_camera'] = 'Kamera';
$lang['img_keywords'] = 'Nøkkelord';
$lang['img_width'] = 'Bredde';
$lang['img_height'] = 'Høyde';
-$lang['btn_mediaManager'] = 'Vis i mediefilbehandler';
$lang['subscr_subscribe_success'] = 'La til %s som abonnent på %s';
$lang['subscr_subscribe_error'] = 'Klarte ikke å legge til %s som abonnent på %s';
$lang['subscr_subscribe_noaddress'] = 'Brukeren din er ikke registrert med noen adresse. Du kan derfor ikke legges til som abonnent.';
@@ -348,3 +354,4 @@ $lang['media_restore'] = 'Gjenopprett denne versjonen';
$lang['currentns'] = 'gjeldende navnemellomrom';
$lang['searchresult'] = 'Søk i resultat';
$lang['plainhtml'] = 'Enkel HTML';
+$lang['wikimarkup'] = 'wiki-format';
diff --git a/inc/lang/no/resetpwd.txt b/inc/lang/no/resetpwd.txt
new file mode 100644
index 000000000..2da717021
--- /dev/null
+++ b/inc/lang/no/resetpwd.txt
@@ -0,0 +1,3 @@
+====== Sett nytt passord ======
+
+Vennligst skriv inn et nytt passord for din konto i denne wikien. \ No newline at end of file
diff --git a/inc/lang/pl/lang.php b/inc/lang/pl/lang.php
index e65866761..e635cb995 100644
--- a/inc/lang/pl/lang.php
+++ b/inc/lang/pl/lang.php
@@ -16,6 +16,7 @@
* @author Aoi Karasu <aoikarasu@gmail.com>
* @author Tomasz Bosak <bosak.tomasz@gmail.com>
* @author Paweł Jan Czochański <czochanski@gmail.com>
+ * @author Mati <mackosa@wp.pl>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -60,6 +61,8 @@ $lang['btn_register'] = 'Zarejestruj się!';
$lang['btn_apply'] = 'Zastosuj';
$lang['btn_media'] = 'Menadżer multimediów';
$lang['btn_deleteuser'] = 'Usuń moje konto';
+$lang['btn_img_backto'] = 'Wróć do %s';
+$lang['btn_mediaManager'] = 'Zobacz w menadżerze multimediów';
$lang['loggedinas'] = 'Zalogowany jako';
$lang['user'] = 'Użytkownik';
$lang['pass'] = 'Hasło';
@@ -191,6 +194,9 @@ $lang['difflink'] = 'Odnośnik do tego porównania';
$lang['diff_type'] = 'Zobacz różnice:';
$lang['diff_inline'] = 'W linii';
$lang['diff_side'] = 'Jeden obok drugiego';
+$lang['diffprevrev'] = 'Poprzednia wersja';
+$lang['diffnextrev'] = 'Nowa wersja';
+$lang['difflastrev'] = 'Ostatnia wersja';
$lang['line'] = 'Linia';
$lang['breadcrumb'] = 'Ślad';
$lang['youarehere'] = 'Jesteś tutaj';
@@ -247,7 +253,6 @@ $lang['admin_register'] = 'Dodawanie użytkownika';
$lang['metaedit'] = 'Edytuj metadane';
$lang['metasaveerr'] = 'Zapis metadanych nie powiódł się';
$lang['metasaveok'] = 'Metadane zapisano';
-$lang['btn_img_backto'] = 'Wróć do %s';
$lang['img_title'] = 'Tytuł';
$lang['img_caption'] = 'Nagłówek';
$lang['img_date'] = 'Data';
@@ -260,7 +265,6 @@ $lang['img_camera'] = 'Aparat';
$lang['img_keywords'] = 'Słowa kluczowe';
$lang['img_width'] = 'Szerokość';
$lang['img_height'] = 'Wysokość';
-$lang['btn_mediaManager'] = 'Zobacz w menadżerze multimediów';
$lang['subscr_subscribe_success'] = 'Dodano %s do listy subskrypcji %s';
$lang['subscr_subscribe_error'] = 'Błąd podczas dodawania %s do listy subskrypcji %s';
$lang['subscr_subscribe_noaddress'] = 'Brak adresu skojarzonego z twoim loginem, nie możesz zostać dodany(a) do listy subskrypcji';
diff --git a/inc/lang/ru/lang.php b/inc/lang/ru/lang.php
index deeb01616..4cd3e5f0b 100644
--- a/inc/lang/ru/lang.php
+++ b/inc/lang/ru/lang.php
@@ -25,6 +25,7 @@
* @author Artur <ncuxxx@gmail.com>
* @author Erli Moen <evseev.jr@gmail.com>
* @author Aleksandr Selivanov <alexgearbox@yandex.ru>
+ * @author Владимир <id37736@yandex.ru>
*/
$lang['encoding'] = ' utf-8';
$lang['direction'] = 'ltr';
diff --git a/inc/lang/sl/lang.php b/inc/lang/sl/lang.php
index 6de260092..c834611dc 100644
--- a/inc/lang/sl/lang.php
+++ b/inc/lang/sl/lang.php
@@ -10,6 +10,7 @@
* @author Matej Urbančič (mateju@svn.gnome.org)
* @author Matej Urbančič <mateju@svn.gnome.org>
* @author matej <mateju@svn.gnome.org>
+ * @author Jernej Vidmar <jernej.vidmar@vidmarboehm.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -54,6 +55,8 @@ $lang['btn_register'] = 'Prijava';
$lang['btn_apply'] = 'Uveljavi';
$lang['btn_media'] = 'Urejevalnik predstavnih vsebin';
$lang['btn_deleteuser'] = 'Odstrani račun';
+$lang['btn_img_backto'] = 'Nazaj na %s';
+$lang['btn_mediaManager'] = 'Poglej v urejevalniku predstavnih vsebin';
$lang['loggedinas'] = 'Prijava kot';
$lang['user'] = 'Uporabniško ime';
$lang['pass'] = 'Geslo';
@@ -85,6 +88,7 @@ $lang['profchanged'] = 'Uporabniški profil je uspešno posodobljen.';
$lang['profnodelete'] = 'Ni omogočena podpora za brisanje uporabnikov.';
$lang['profdeleteuser'] = 'Izbriši račun';
$lang['profdeleted'] = 'Uporabniški račun je izbrisan.';
+$lang['profconfdeletemissing'] = 'Potrditveno okno ni označeno';
$lang['pwdforget'] = 'Ali ste pozabili geslo? Pridobite si novo geslo.';
$lang['resendna'] = 'DokuWiki ne podpira možnosti ponovnega pošiljanja gesel.';
$lang['resendpwd'] = 'Nastavi novo geslo za';
@@ -179,6 +183,9 @@ $lang['difflink'] = 'Poveži s tem pogledom primerjave.';
$lang['diff_type'] = 'Razlike:';
$lang['diff_inline'] = 'V besedilu';
$lang['diff_side'] = 'Eno ob drugem';
+$lang['diffprevrev'] = 'Prejšnja revizija';
+$lang['diffnextrev'] = 'Naslednja revizija';
+$lang['difflastrev'] = 'Zadnja revizija';
$lang['line'] = 'Vrstica';
$lang['breadcrumb'] = 'Sled';
$lang['youarehere'] = 'Trenutno dejavna stran';
@@ -235,7 +242,6 @@ $lang['admin_register'] = 'Dodaj novega uporabnika';
$lang['metaedit'] = 'Uredi metapodatke';
$lang['metasaveerr'] = 'Zapisovanje metapodatkov je spodletelo';
$lang['metasaveok'] = 'Metapodatki so shranjeni';
-$lang['btn_img_backto'] = 'Nazaj na %s';
$lang['img_title'] = 'Naslov';
$lang['img_caption'] = 'Opis';
$lang['img_date'] = 'Datum';
@@ -248,7 +254,6 @@ $lang['img_camera'] = 'Fotoaparat';
$lang['img_keywords'] = 'Ključne besede';
$lang['img_width'] = 'Širina';
$lang['img_height'] = 'Višina';
-$lang['btn_mediaManager'] = 'Poglej v urejevalniku predstavnih vsebin';
$lang['subscr_subscribe_success'] = 'Uporabniški račun %s je dodan na seznam naročnin na %s';
$lang['subscr_subscribe_error'] = 'Napaka med dodajanjem %s na seznam naročnin na %s';
$lang['subscr_subscribe_noaddress'] = 'S trenutnimi prijavnimi podatki ni povezanega elektronskega naslova, zato uporabniškega računa ni mogoče dodati na seznam naročnikov.';
@@ -291,6 +296,8 @@ $lang['i_allowreg'] = 'Dovoli uporabnikom vpis';
$lang['i_retry'] = 'Ponovni poskus';
$lang['i_license'] = 'Izbor dovoljenja objave vsebine:';
$lang['i_license_none'] = 'Ne pokaži podrobnosti dovoljenja.';
+$lang['i_pop_field'] = 'Prosimo pomagajte nam izboljšati DokuWiki izkušnjo:';
+$lang['i_pop_label'] = 'Enkrat na mesec pošlji anonimne uporabniške podatke DokuWiki razvijalcem';
$lang['recent_global'] = 'Trenutno so prikazane spremembe znotraj imenskega prostora <b>%s</b>. Mogoče si je ogledati tudi spremembe <a href="%s">celotnega sistema Wiki</a>.';
$lang['years'] = '%d let nazaj';
$lang['months'] = '%d mesecev nazaj';
diff --git a/inc/lang/tr/lang.php b/inc/lang/tr/lang.php
index 2af17fe27..c314eb8aa 100644
--- a/inc/lang/tr/lang.php
+++ b/inc/lang/tr/lang.php
@@ -11,6 +11,7 @@
* @author farukerdemoncel@gmail.com
* @author Mustafa Aslan <maslan@hotmail.com>
* @author huseyin can <huseyincan73@gmail.com>
+ * @author ilker rifat kapaç <irifat@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -55,6 +56,8 @@ $lang['btn_register'] = 'Kayıt ol';
$lang['btn_apply'] = 'Uygula';
$lang['btn_media'] = 'Çokluortam Yöneticisi';
$lang['btn_deleteuser'] = 'Hesabımı Sil';
+$lang['btn_img_backto'] = 'Şuna dön: %s';
+$lang['btn_mediaManager'] = 'Ortam oynatıcısında göster';
$lang['loggedinas'] = 'Giriş ismi';
$lang['user'] = 'Kullanıcı ismi';
$lang['pass'] = 'Parola';
@@ -233,7 +236,6 @@ $lang['admin_register'] = 'Yeni kullanıcı ekle...';
$lang['metaedit'] = 'Metaverileri Değiştir';
$lang['metasaveerr'] = 'Metaveri yazma başarısız ';
$lang['metasaveok'] = 'Metaveri kaydedildi';
-$lang['btn_img_backto'] = 'Şuna dön: %s';
$lang['img_title'] = 'Başlık';
$lang['img_caption'] = 'Serlevha';
$lang['img_date'] = 'Tarih';
@@ -246,7 +248,6 @@ $lang['img_camera'] = 'Fotoğraf Makinası';
$lang['img_keywords'] = 'Anahtar Sözcükler';
$lang['img_width'] = 'Genişlik';
$lang['img_height'] = 'Yükseklik';
-$lang['btn_mediaManager'] = 'Ortam oynatıcısında göster';
$lang['subscr_m_new_header'] = 'Üyelik ekle';
$lang['subscr_m_current_header'] = 'Üyeliğini onayla';
$lang['subscr_m_unsubscribe'] = 'Üyelik iptali';
@@ -301,6 +302,12 @@ $lang['media_search'] = '%s dizininde ara';
$lang['media_view'] = '%s';
$lang['media_edit'] = 'Düzenle %s';
$lang['media_history'] = 'Geçmiş %s';
+$lang['media_meta_edited'] = 'üstveri düzenlendi';
+$lang['media_perm_read'] = 'Özür dileriz, dosyaları okumak için yeterli haklara sahip değilsiniz.';
$lang['media_perm_upload'] = 'Üzgünüm, karşıya dosya yükleme yetkiniz yok.';
$lang['media_update'] = 'Yeni versiyonu yükleyin';
$lang['media_restore'] = 'Bu sürümü eski haline getir';
+$lang['currentns'] = 'Geçerli isimalanı';
+$lang['searchresult'] = 'Arama Sonucu';
+$lang['plainhtml'] = 'Yalın HTML';
+$lang['wikimarkup'] = 'Wiki Biçimlendirmesi';
diff --git a/inc/lang/tr/subscr_form.txt b/inc/lang/tr/subscr_form.txt
new file mode 100644
index 000000000..21a8fbaeb
--- /dev/null
+++ b/inc/lang/tr/subscr_form.txt
@@ -0,0 +1,3 @@
+====== Abonelik Yönetimi ======
+
+Bu sayfa, geçerli isimalanı ve sayfa için aboneliklerinizi düzenlemenize olanak sağlar. \ No newline at end of file
diff --git a/inc/lang/zh/lang.php b/inc/lang/zh/lang.php
index 86c2ac20c..cc4888396 100644
--- a/inc/lang/zh/lang.php
+++ b/inc/lang/zh/lang.php
@@ -22,6 +22,7 @@
* @author oott123 <ip.192.168.1.1@qq.com>
* @author Cupen <Cupenoruler@foxmail.com>
* @author xiqingongzi <Xiqingongzi@Gmail.com>
+ * @author qinghao <qingxianhao@gmail.com>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
@@ -66,6 +67,8 @@ $lang['btn_register'] = '注册';
$lang['btn_apply'] = '应用';
$lang['btn_media'] = '媒体管理器';
$lang['btn_deleteuser'] = '移除我的账户';
+$lang['btn_img_backto'] = '返回到 %s';
+$lang['btn_mediaManager'] = '在媒体管理器中查看';
$lang['loggedinas'] = '登录为';
$lang['user'] = '用户名';
$lang['pass'] = '密码';
@@ -197,6 +200,11 @@ $lang['difflink'] = '到此差别页面的链接';
$lang['diff_type'] = '查看差异:';
$lang['diff_inline'] = '行内显示';
$lang['diff_side'] = '并排显示';
+$lang['diffprevrev'] = '前一修订版';
+$lang['diffnextrev'] = '后一修订版';
+$lang['difflastrev'] = '上一修订版';
+$lang['diffbothprevrev'] = '两侧同时换到之前的修订记录';
+$lang['diffbothnextrev'] = '两侧同时换到之后的修订记录';
$lang['line'] = '行';
$lang['breadcrumb'] = '您的足迹';
$lang['youarehere'] = '您在这里';
@@ -253,7 +261,6 @@ $lang['admin_register'] = '添加新用户';
$lang['metaedit'] = '编辑元数据';
$lang['metasaveerr'] = '写入元数据失败';
$lang['metasaveok'] = '元数据已保存';
-$lang['btn_img_backto'] = '返回到 %s';
$lang['img_title'] = '标题';
$lang['img_caption'] = '说明';
$lang['img_date'] = '日期';
@@ -266,7 +273,6 @@ $lang['img_camera'] = '相机';
$lang['img_keywords'] = '关键字';
$lang['img_width'] = '宽度';
$lang['img_height'] = '高度';
-$lang['btn_mediaManager'] = '在媒体管理器中查看';
$lang['subscr_subscribe_success'] = '添加 %s 到 %s 的订阅列表';
$lang['subscr_subscribe_error'] = '添加 %s 到 %s 的订阅列表中出现错误';
$lang['subscr_subscribe_noaddress'] = '没有与您登录信息相关联的地址,您无法被添加到订阅列表';
diff --git a/inc/load.php b/inc/load.php
index f1deffe19..ac2812a0b 100644
--- a/inc/load.php
+++ b/inc/load.php
@@ -102,6 +102,10 @@ function load_autoload($name){
'Doku_Renderer_xhtmlsummary' => DOKU_INC.'inc/parser/xhtmlsummary.php',
'Doku_Renderer_metadata' => DOKU_INC.'inc/parser/metadata.php',
+ 'DokuCLI' => DOKU_INC.'inc/cli.php',
+ 'DokuCLI_Options' => DOKU_INC.'inc/cli.php',
+ 'DokuCLI_Colors' => DOKU_INC.'inc/cli.php',
+
);
if(isset($classes[$name])){
diff --git a/inc/media.php b/inc/media.php
index 2c1a3e8eb..b5347d145 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -1448,17 +1448,23 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){
echo '</div>'.NL;
}
-function media_printicon($filename){
+/**
+ * Display a media icon
+ *
+ * @param $filename
+ * @param string $size the size subfolder, if not specified 16x16 is used
+ * @return string
+ */
+function media_printicon($filename, $size=''){
list($ext) = mimetype(mediaFN($filename),false);
- if (@file_exists(DOKU_INC.'lib/images/fileicons/32x32/'.$ext.'.png')) {
- $icon = DOKU_BASE.'lib/images/fileicons/32x32/'.$ext.'.png';
+ if (@file_exists(DOKU_INC.'lib/images/fileicons/'.$size.'/'.$ext.'.png')) {
+ $icon = DOKU_BASE.'lib/images/fileicons/'.$size.'/'.$ext.'.png';
} else {
- $icon = DOKU_BASE.'lib/images/fileicons/32x32/file.png';
+ $icon = DOKU_BASE.'lib/images/fileicons/'.$size.'/file.png';
}
return '<img src="'.$icon.'" alt="'.$filename.'" class="icon" />';
-
}
/**
@@ -1482,7 +1488,7 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false
echo '<a id="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'.
media_managerURL(array('image' => hsc($item['id']), 'ns' => getNS($item['id']),
'tab_details' => 'view')).'">';
- echo media_printicon($item['id']);
+ echo media_printicon($item['id'], '32x32');
echo '</a>';
}
echo '</dt>'.NL;
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 8474c5697..5f62926e4 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -17,6 +17,10 @@
* If the second parameter is true (default) the ID is cleaned.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $param the $_REQUEST variable name, default 'id'
+ * @param bool $clean if true, ID is cleaned
+ * @return mixed|string
*/
function getID($param='id',$clean=true){
/** @var Input $INPUT */
@@ -146,6 +150,9 @@ function cleanID($raw_id,$ascii=false){
* Return namespacepart of a wiki ID
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id
+ * @return string|bool the namespace part or false if the given ID has no namespace (root)
*/
function getNS($id){
$pos = strrpos((string)$id,':');
@@ -159,6 +166,9 @@ function getNS($id){
* Returns the ID without the namespace
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $id
+ * @return string
*/
function noNS($id) {
$pos = strrpos($id, ':');
@@ -173,6 +183,9 @@ function noNS($id) {
* Returns the current namespace
*
* @author Nathan Fritz <fritzn@crown.edu>
+ *
+ * @param string $id
+ * @return string
*/
function curNS($id) {
return noNS(getNS($id));
@@ -182,6 +195,9 @@ function curNS($id) {
* Returns the ID without the namespace or current namespace for 'start' pages
*
* @author Nathan Fritz <fritzn@crown.edu>
+ *
+ * @param string $id
+ * @return string
*/
function noNSorNS($id) {
global $conf;
@@ -202,6 +218,7 @@ function noNSorNS($id) {
* @param string $title The headline title
* @param array|bool $check Existing IDs (title => number)
* @return string the title
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function sectionID($title,&$check) {
@@ -232,6 +249,11 @@ function sectionID($title,&$check) {
* parameters as for wikiFN
*
* @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)
+ * @return bool exists?
*/
function page_exists($id,$rev='',$clean=true) {
return @file_exists(wikiFN($id,$rev,$clean));
@@ -290,6 +312,9 @@ function wikiFN($raw_id,$rev='',$clean=true){
* Returns the full path to the file for locking the page while editing.
*
* @author Ben Coburn <btcoburn@silicodon.net>
+ *
+ * @param string $id page id
+ * @return string full path
*/
function wikiLockFN($id) {
global $conf;
@@ -301,6 +326,10 @@ function wikiLockFN($id) {
* returns the full path to the meta file specified by ID and extension
*
* @author Steven Danz <steven-danz@kc.rr.com>
+ *
+ * @param string $id page id
+ * @param string $ext file extension
+ * @return string full path
*/
function metaFN($id,$ext){
global $conf;
@@ -314,6 +343,10 @@ function metaFN($id,$ext){
* returns the full path to the media's meta file specified by ID and extension
*
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id media id
+ * @param string $ext extension of media
+ * @return string
*/
function mediaMetaFN($id,$ext){
global $conf;
@@ -328,6 +361,9 @@ function mediaMetaFN($id,$ext){
*
* @author Esther Brunner <esther@kaffeehaus.ch>
* @author Michael Hamann <michael@content-space.de>
+ *
+ * @param string $id page id
+ * @return array
*/
function metaFiles($id){
$basename = metaFN($id, '');
@@ -343,6 +379,10 @@ function metaFiles($id){
*
* @author Andreas Gohr <andi@splitbrain.org>
* @author Kate Arzamastseva <pshns@ukr.net>
+ *
+ * @param string $id media id
+ * @param string|int $rev empty string or revision timestamp
+ * @return string full path
*/
function mediaFN($id, $rev=''){
global $conf;
@@ -365,6 +405,7 @@ function mediaFN($id, $rev=''){
* @param string $id The id of the local file
* @param string $ext The file extension (usually txt)
* @return string full filepath to localized file
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function localeFN($id,$ext='txt'){
@@ -390,6 +431,11 @@ function localeFN($id,$ext='txt'){
* http://www.php.net/manual/en/function.realpath.php#57016
*
* @author <bart at mediawave dot nl>
+ *
+ * @param string $ns namespace which is context of id
+ * @param string $id relative id
+ * @param bool $clean flag indicating that id should be cleaned
+ * @return mixed|string
*/
function resolve_id($ns,$id,$clean=true){
global $conf;
@@ -435,6 +481,10 @@ function resolve_id($ns,$id,$clean=true){
* Returns a full media id
*
* @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
*/
function resolve_mediaid($ns,&$page,&$exists){
$page = resolve_id($ns,$page);
@@ -446,6 +496,10 @@ function resolve_mediaid($ns,&$page,&$exists){
* Returns a full page id
*
* @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
*/
function resolve_pageid($ns,&$page,&$exists){
global $conf;
@@ -537,6 +591,9 @@ function getCacheName($data,$ext=''){
* Checks a pageid against $conf['hidepages']
*
* @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param string $id page id
+ * @return bool
*/
function isHiddenPage($id){
$data = array(
@@ -550,7 +607,7 @@ function isHiddenPage($id){
/**
* callback checks if page is hidden
*
- * @param array $data event data see isHiddenPage()
+ * @param array $data event data - see isHiddenPage()
*/
function _isHiddenPage(&$data) {
global $conf;
@@ -569,6 +626,9 @@ function _isHiddenPage(&$data) {
* Reverse of isHiddenPage
*
* @author Andreas Gohr <gohr@cosmocode.de>
+ *
+ * @param string $id page id
+ * @return bool
*/
function isVisiblePage($id){
return !isHiddenPage($id);
@@ -581,8 +641,10 @@ function isVisiblePage($id){
* “*”. Output is escaped.
*
* @author Adrian Lang <lang@cosmocode.de>
+ *
+ * @param string $id page id
+ * @return string
*/
-
function prettyprint_id($id) {
if (!$id || $id === ':') {
return '*';
@@ -605,6 +667,10 @@ function prettyprint_id($id) {
*
* @author Andreas Gohr <andi@splitbrain.org>
* @see urlencode
+ *
+ * @param string $file file name
+ * @param bool $safe if true, only encoded when non ASCII characters detected
+ * @return string
*/
function utf8_encodeFN($file,$safe=true){
global $conf;
@@ -630,6 +696,9 @@ function utf8_encodeFN($file,$safe=true){
*
* @author Andreas Gohr <andi@splitbrain.org>
* @see urldecode
+ *
+ * @param string $file file name
+ * @return string
*/
function utf8_decodeFN($file){
global $conf;
diff --git a/inc/parser/code.php b/inc/parser/code.php
index d77ffd1aa..00b956c27 100644
--- a/inc/parser/code.php
+++ b/inc/parser/code.php
@@ -7,25 +7,25 @@
if(!defined('DOKU_INC')) die('meh.');
class Doku_Renderer_code extends Doku_Renderer {
- var $_codeblock=0;
+ var $_codeblock = 0;
/**
* Send the wanted code block to the browser
*
* When the correct block was found it exits the script.
*/
- function code($text, $language = null, $filename='' ) {
+ function code($text, $language = null, $filename = '') {
global $INPUT;
if(!$language) $language = 'txt';
if(!$filename) $filename = 'snippet.'.$language;
$filename = utf8_basename($filename);
$filename = utf8_stripspecials($filename, '_');
- if($this->_codeblock == $INPUT->str('codeblock')){
+ if($this->_codeblock == $INPUT->str('codeblock')) {
header("Content-Type: text/plain; charset=utf-8");
header("Content-Disposition: attachment; filename=$filename");
header("X-Robots-Tag: noindex");
- echo trim($text,"\r\n");
+ echo trim($text, "\r\n");
exit;
}
@@ -35,7 +35,7 @@ class Doku_Renderer_code extends Doku_Renderer {
/**
* Wraps around code()
*/
- function file($text, $language = null, $filename='') {
+ function file($text, $language = null, $filename = '') {
$this->code($text, $language, $filename);
}
@@ -53,7 +53,7 @@ class Doku_Renderer_code extends Doku_Renderer {
*
* @returns string 'code'
*/
- function getFormat(){
+ function getFormat() {
return 'code';
}
}
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 8ae991209..a1040d12e 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -12,6 +12,7 @@ class Doku_Handler {
var $status = array(
'section' => false,
+ 'doublequote' => 0,
);
var $rewriteBlocks = true;
@@ -401,11 +402,17 @@ class Doku_Handler {
function doublequoteopening($match, $state, $pos) {
$this->_addCall('doublequoteopening',array(), $pos);
+ $this->status['doublequote']++;
return true;
}
function doublequoteclosing($match, $state, $pos) {
- $this->_addCall('doublequoteclosing',array(), $pos);
+ if ($this->status['doublequote'] <= 0) {
+ $this->doublequoteopening($match, $state, $pos);
+ } else {
+ $this->_addCall('doublequoteclosing',array(), $pos);
+ $this->status['doublequote'] = max(0, --$this->status['doublequote']);
+ }
return true;
}
@@ -1149,6 +1156,9 @@ class Doku_Handler_Table {
var $currentCols = 0;
var $firstCell = false;
var $lastCellType = 'tablecell';
+ var $inTableHead = true;
+ var $currentRow = array('tableheader' => 0, 'tablecell' => 0);
+ var $countTableHeadRows = 0;
function Doku_Handler_Table(& $CallWriter) {
$this->CallWriter = & $CallWriter;
@@ -1216,15 +1226,24 @@ class Doku_Handler_Table {
$this->firstCell = true;
$this->lastCellType = 'tablecell';
$this->maxRows++;
+ if ($this->inTableHead) {
+ $this->currentRow = array('tablecell' => 0, 'tableheader' => 0);
+ }
}
function tableRowClose($call) {
+ if ($this->inTableHead && ($this->inTableHead = $this->isTableHeadRow())) {
+ $this->countTableHeadRows++;
+ }
// Strip off final cell opening and anything after it
while ( $discard = array_pop($this->tableCalls ) ) {
if ( $discard[0] == 'tablecell_open' || $discard[0] == 'tableheader_open') {
break;
}
+ if (!empty($this->currentRow[$discard[0]])) {
+ $this->currentRow[$discard[0]]--;
+ }
}
$this->tableCalls[] = array('tablerow_close', array(), $call[2]);
@@ -1233,7 +1252,20 @@ class Doku_Handler_Table {
}
}
+ function isTableHeadRow() {
+ $td = $this->currentRow['tablecell'];
+ $th = $this->currentRow['tableheader'];
+
+ if (!$th || $td > 2) return false;
+ if (2*$td > $th) return false;
+
+ return true;
+ }
+
function tableCell($call) {
+ if ($this->inTableHead) {
+ $this->currentRow[$call[0]]++;
+ }
if ( !$this->firstCell ) {
// Increase the span
@@ -1281,6 +1313,13 @@ class Doku_Handler_Table {
$cellKey = array();
$toDelete = array();
+ // if still in tableheader, then there can be no table header
+ // as all rows can't be within <THEAD>
+ if ($this->inTableHead) {
+ $this->inTableHead = false;
+ $this->countTableHeadRows = 0;
+ }
+
// Look for the colspan elements and increment the colspan on the
// previous non-empty opening cell. Once done, delete all the cells
// that contain colspans
@@ -1288,6 +1327,14 @@ class Doku_Handler_Table {
$call = $this->tableCalls[$key];
switch ($call[0]) {
+ case 'table_open' :
+ if($this->countTableHeadRows) {
+ array_splice($this->tableCalls, $key+1, 0, array(
+ array('tablethead_open', array(), $call[2]))
+ );
+ }
+ break;
+
case 'tablerow_open':
$lastRow++;
@@ -1357,15 +1404,19 @@ class Doku_Handler_Table {
} else {
$spanning_cell = null;
- for($i = $lastRow-1; $i > 0; $i--) {
- if ( $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tablecell_open' || $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tableheader_open' ) {
+ // can't cross thead/tbody boundary
+ if (!$this->countTableHeadRows || ($lastRow-1 != $this->countTableHeadRows)) {
+ for($i = $lastRow-1; $i > 0; $i--) {
- if ($this->tableCalls[$cellKey[$i][$lastCell]][1][2] >= $lastRow - $i) {
- $spanning_cell = $i;
- break;
- }
+ if ( $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tablecell_open' || $this->tableCalls[$cellKey[$i][$lastCell]][0] == 'tableheader_open' ) {
+
+ if ($this->tableCalls[$cellKey[$i][$lastCell]][1][2] >= $lastRow - $i) {
+ $spanning_cell = $i;
+ break;
+ }
+ }
}
}
if (is_null($spanning_cell)) {
@@ -1396,6 +1447,10 @@ class Doku_Handler_Table {
$key += 3;
}
+ if($this->countTableHeadRows == $lastRow) {
+ array_splice($this->tableCalls, $key+1, 0, array(
+ array('tablethead_close', array(), $call[2])));
+ }
break;
}
@@ -1438,7 +1493,7 @@ class Doku_Handler_Block {
var $blockOpen = array(
'header',
'listu_open','listo_open','listitem_open','listcontent_open',
- 'table_open','tablerow_open','tablecell_open','tableheader_open',
+ 'table_open','tablerow_open','tablecell_open','tableheader_open','tablethead_open',
'quote_open',
'code','file','hr','preformatted','rss',
'htmlblock','phpblock',
@@ -1448,7 +1503,7 @@ class Doku_Handler_Block {
var $blockClose = array(
'header',
'listu_close','listo_close','listitem_close','listcontent_close',
- 'table_close','tablerow_close','tablecell_close','tableheader_close',
+ 'table_close','tablerow_close','tablecell_close','tableheader_close','tablethead_close',
'quote_close',
'code','file','hr','preformatted','rss',
'htmlblock','phpblock',
diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php
index 82a268fd6..9552fedff 100644
--- a/inc/parser/metadata.php
+++ b/inc/parser/metadata.php
@@ -6,129 +6,198 @@
*/
if(!defined('DOKU_INC')) die('meh.');
-if ( !defined('DOKU_LF') ) {
+if(!defined('DOKU_LF')) {
// Some whitespace to help View > Source
- define ('DOKU_LF',"\n");
+ define ('DOKU_LF', "\n");
}
-if ( !defined('DOKU_TAB') ) {
+if(!defined('DOKU_TAB')) {
// Some whitespace to help View > Source
- define ('DOKU_TAB',"\t");
+ define ('DOKU_TAB', "\t");
}
/**
- * The Renderer
+ * The MetaData Renderer
+ *
+ * Metadata is additional information about a DokuWiki page that gets extracted mainly from the page's content
+ * but also it's own filesystem data (like the creation time). All metadata is stored in the fields $meta and
+ * $persistent.
+ *
+ * Some simplified rendering to $doc is done to gather the page's (text-only) abstract.
*/
class Doku_Renderer_metadata extends Doku_Renderer {
+ /** the approximate byte lenght to capture for the abstract */
+ const ABSTRACT_LEN = 250;
+
+ /** the maximum UTF8 character length for the abstract */
+ const ABSTRACT_MAX = 500;
+
+ /** @var array transient meta data, will be reset on each rendering */
+ public $meta = array();
+
+ /** @var array persistent meta data, will be kept until explicitly deleted */
+ public $persistent = array();
- var $doc = '';
- var $meta = array();
- var $persistent = array();
+ /** @var array the list of headers used to create unique link ids */
+ protected $headers = array();
- var $headers = array();
- var $capture = true;
- var $store = '';
- var $firstimage = '';
+ /** @var string temporary $doc store */
+ protected $store = '';
- function getFormat(){
+ /** @var string keeps the first image reference */
+ protected $firstimage = '';
+
+ /** @var bool determines if enough data for the abstract was collected, yet */
+ protected $capture = true;
+
+ /** @var int number of bytes captured for abstract */
+ protected $captured = 0;
+
+ /**
+ * Returns the format produced by this renderer.
+ *
+ * @return string always 'metadata'
+ */
+ function getFormat() {
return 'metadata';
}
- function document_start(){
+ /**
+ * Initialize the document
+ *
+ * Sets up some of the persistent info about the page if it doesn't exist, yet.
+ */
+ function document_start() {
global $ID;
$this->headers = array();
// external pages are missing create date
- if(!$this->persistent['date']['created']){
+ if(!$this->persistent['date']['created']) {
$this->persistent['date']['created'] = filectime(wikiFN($ID));
}
- if(!isset($this->persistent['user'])){
+ if(!isset($this->persistent['user'])) {
$this->persistent['user'] = '';
}
- if(!isset($this->persistent['creator'])){
+ if(!isset($this->persistent['creator'])) {
$this->persistent['creator'] = '';
}
// reset metadata to persistent values
$this->meta = $this->persistent;
}
- function document_end(){
+ /**
+ * Finalize the document
+ *
+ * Stores collected data in the metadata
+ */
+ function document_end() {
global $ID;
// store internal info in metadata (notoc,nocache)
$this->meta['internal'] = $this->info;
- if (!isset($this->meta['description']['abstract'])){
+ if(!isset($this->meta['description']['abstract'])) {
// cut off too long abstracts
$this->doc = trim($this->doc);
- if (strlen($this->doc) > 500)
- $this->doc = utf8_substr($this->doc, 0, 500).'…';
+ if(strlen($this->doc) > self::ABSTRACT_MAX) {
+ $this->doc = utf8_substr($this->doc, 0, self::ABSTRACT_MAX).'…';
+ }
$this->meta['description']['abstract'] = $this->doc;
}
$this->meta['relation']['firstimage'] = $this->firstimage;
- if(!isset($this->meta['date']['modified'])){
+ if(!isset($this->meta['date']['modified'])) {
$this->meta['date']['modified'] = filemtime(wikiFN($ID));
}
}
+ /**
+ * Render plain text data
+ *
+ * This function takes care of the amount captured data and will stop capturing when
+ * enough abstract data is available
+ *
+ * @param $text
+ */
+ function cdata($text) {
+ if(!$this->capture) return;
+
+ $this->doc .= $text;
+
+ $this->captured += strlen($text);
+ if($this->captured > self::ABSTRACT_LEN) $this->capture = false;
+ }
+
+ /**
+ * Add an item to the TOC
+ *
+ * @param string $id the hash link
+ * @param string $text the text to display
+ * @param int $level the nesting level
+ */
function toc_additem($id, $text, $level) {
global $conf;
//only add items within configured levels
- if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
+ if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']) {
// the TOC is one of our standard ul list arrays ;-)
$this->meta['description']['tableofcontents'][] = array(
- 'hid' => $id,
- 'title' => $text,
- 'type' => 'ul',
- 'level' => $level-$conf['toptoclevel']+1
+ 'hid' => $id,
+ 'title' => $text,
+ 'type' => 'ul',
+ 'level' => $level - $conf['toptoclevel'] + 1
);
}
}
+ /**
+ * Render a heading
+ *
+ * @param string $text the text to display
+ * @param int $level header level
+ * @param int $pos byte position in the original source
+ */
function header($text, $level, $pos) {
- if (!isset($this->meta['title'])) $this->meta['title'] = $text;
+ if(!isset($this->meta['title'])) $this->meta['title'] = $text;
// add the header to the TOC
- $hid = $this->_headerToLink($text,'true');
+ $hid = $this->_headerToLink($text, 'true');
$this->toc_additem($hid, $text, $level);
// add to summary
- if ($this->capture && ($level > 1)) $this->doc .= DOKU_LF.$text.DOKU_LF;
+ $this->cdata(DOKU_LF.$text.DOKU_LF);
}
- function section_open($level){}
- function section_close(){}
-
- function cdata($text){
- if ($this->capture) $this->doc .= $text;
- }
-
- function p_open(){
- if ($this->capture) $this->doc .= DOKU_LF;
+ /**
+ * Open a paragraph
+ */
+ function p_open() {
+ $this->cdata(DOKU_LF);
}
- function p_close(){
- if ($this->capture){
- if (strlen($this->doc) > 250) $this->capture = false;
- else $this->doc .= DOKU_LF;
- }
+ /**
+ * Close a paragraph
+ */
+ function p_close() {
+ $this->cdata(DOKU_LF);
}
- function linebreak(){
- if ($this->capture) $this->doc .= DOKU_LF;
+ /**
+ * Create a line break
+ */
+ function linebreak() {
+ $this->cdata(DOKU_LF);
}
- function hr(){
- if ($this->capture){
- if (strlen($this->doc) > 250) $this->capture = false;
- else $this->doc .= DOKU_LF.'----------'.DOKU_LF;
- }
+ /**
+ * Create a horizontal line
+ */
+ function hr() {
+ $this->cdata(DOKU_LF.'----------'.DOKU_LF);
}
/**
@@ -141,7 +210,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
* @author Andreas Gohr <andi@splitbrain.org>
*/
function footnote_open() {
- if ($this->capture){
+ if($this->capture) {
// move current content to store and record footnote
$this->store = $this->doc;
$this->doc = '';
@@ -157,141 +226,214 @@ class Doku_Renderer_metadata extends Doku_Renderer {
* @author Andreas Gohr
*/
function footnote_close() {
- if ($this->capture){
+ if($this->capture) {
// restore old content
- $this->doc = $this->store;
+ $this->doc = $this->store;
$this->store = '';
}
}
- function listu_open(){
- if ($this->capture) $this->doc .= DOKU_LF;
- }
-
- function listu_close(){
- if ($this->capture && (strlen($this->doc) > 250)) $this->capture = false;
- }
-
- function listo_open(){
- if ($this->capture) $this->doc .= DOKU_LF;
- }
-
- function listo_close(){
- if ($this->capture && (strlen($this->doc) > 250)) $this->capture = false;
+ /**
+ * Open an unordered list
+ */
+ function listu_open() {
+ $this->cdata(DOKU_LF);
}
- function listitem_open($level){
- if ($this->capture) $this->doc .= str_repeat(DOKU_TAB, $level).'* ';
+ /**
+ * Open an ordered list
+ */
+ function listo_open() {
+ $this->cdata(DOKU_LF);
}
- function listitem_close(){
- if ($this->capture) $this->doc .= DOKU_LF;
+ /**
+ * Open a list item
+ *
+ * @param int $level the nesting level
+ */
+ function listitem_open($level) {
+ $this->cdata(str_repeat(DOKU_TAB, $level).'* ');
}
- function listcontent_open(){}
- function listcontent_close(){}
-
- function unformatted($text){
- if ($this->capture) $this->doc .= $text;
+ /**
+ * Close a list item
+ */
+ function listitem_close() {
+ $this->cdata(DOKU_LF);
}
- function preformatted($text){
- if ($this->capture) $this->doc .= $text;
+ /**
+ * Output preformatted text
+ *
+ * @param string $text
+ */
+ function preformatted($text) {
+ $this->cdata($text);
}
- function file($text, $lang = null, $file = null){
- if ($this->capture){
- $this->doc .= DOKU_LF.$text;
- if (strlen($this->doc) > 250) $this->capture = false;
- else $this->doc .= DOKU_LF;
- }
+ /**
+ * Start a block quote
+ */
+ function quote_open() {
+ $this->cdata(DOKU_LF.DOKU_TAB.'"');
}
- function quote_open(){
- if ($this->capture) $this->doc .= DOKU_LF.DOKU_TAB.'"';
+ /**
+ * Stop a block quote
+ */
+ function quote_close() {
+ $this->cdata('"'.DOKU_LF);
}
- function quote_close(){
- if ($this->capture){
- $this->doc .= '"';
- if (strlen($this->doc) > 250) $this->capture = false;
- else $this->doc .= DOKU_LF;
- }
+ /**
+ * Display text as file content, optionally syntax highlighted
+ *
+ * @param string $text text to show
+ * @param string $lang programming language to use for syntax highlighting
+ * @param string $file file path label
+ */
+ function file($text, $lang = null, $file = null) {
+ $this->cdata(DOKU_LF.$text.DOKU_LF);
}
- function code($text, $language = null, $file = null){
- if ($this->capture){
- $this->doc .= DOKU_LF.$text;
- if (strlen($this->doc) > 250) $this->capture = false;
- else $this->doc .= DOKU_LF;
- }
+ /**
+ * Display text as code content, optionally syntax highlighted
+ *
+ * @param string $text text to show
+ * @param string $language programming language to use for syntax highlighting
+ * @param string $file file path label
+ */
+ function code($text, $language = null, $file = null) {
+ $this->cdata(DOKU_LF.$text.DOKU_LF);
}
- function acronym($acronym){
- if ($this->capture) $this->doc .= $acronym;
+ /**
+ * Format an acronym
+ *
+ * Uses $this->acronyms
+ *
+ * @param string $acronym
+ */
+ function acronym($acronym) {
+ $this->cdata($acronym);
}
- function smiley($smiley){
- if ($this->capture) $this->doc .= $smiley;
+ /**
+ * Format a smiley
+ *
+ * Uses $this->smiley
+ *
+ * @param string $smiley
+ */
+ function smiley($smiley) {
+ $this->cdata($smiley);
}
- function entity($entity){
- if ($this->capture) $this->doc .= $entity;
+ /**
+ * Format an entity
+ *
+ * Entities are basically small text replacements
+ *
+ * Uses $this->entities
+ *
+ * @param string $entity
+ */
+ function entity($entity) {
+ $this->cdata($entity);
}
- function multiplyentity($x, $y){
- if ($this->capture) $this->doc .= $x.'×'.$y;
+ /**
+ * Typographically format a multiply sign
+ *
+ * Example: ($x=640, $y=480) should result in "640×480"
+ *
+ * @param string|int $x first value
+ * @param string|int $y second value
+ */
+ function multiplyentity($x, $y) {
+ $this->cdata($x.'×'.$y);
}
- function singlequoteopening(){
+ /**
+ * Render an opening single quote char (language specific)
+ */
+ function singlequoteopening() {
global $lang;
- if ($this->capture) $this->doc .= $lang['singlequoteopening'];
+ $this->cdata($lang['singlequoteopening']);
}
- function singlequoteclosing(){
+ /**
+ * Render a closing single quote char (language specific)
+ */
+ function singlequoteclosing() {
global $lang;
- if ($this->capture) $this->doc .= $lang['singlequoteclosing'];
+ $this->cdata($lang['singlequoteclosing']);
}
+ /**
+ * Render an apostrophe char (language specific)
+ */
function apostrophe() {
global $lang;
- if ($this->capture) $this->doc .= $lang['apostrophe'];
+ $this->cdata($lang['apostrophe']);
}
- function doublequoteopening(){
+ /**
+ * Render an opening double quote char (language specific)
+ */
+ function doublequoteopening() {
global $lang;
- if ($this->capture) $this->doc .= $lang['doublequoteopening'];
+ $this->cdata($lang['doublequoteopening']);
}
- function doublequoteclosing(){
+ /**
+ * Render an closinging double quote char (language specific)
+ */
+ function doublequoteclosing() {
global $lang;
- if ($this->capture) $this->doc .= $lang['doublequoteclosing'];
+ $this->cdata($lang['doublequoteclosing']);
}
+ /**
+ * Render a CamelCase link
+ *
+ * @param string $link The link name
+ * @see http://en.wikipedia.org/wiki/CamelCase
+ */
function camelcaselink($link) {
$this->internallink($link, $link);
}
- function locallink($hash, $name = null){
+ /**
+ * Render a page local link
+ *
+ * @param string $hash hash link identifier
+ * @param string $name name for the link
+ */
+ function locallink($hash, $name = null) {
if(is_array($name)) {
$this->_firstimage($name['src']);
- if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+ if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
}
/**
* keep track of internal links in $this->meta['relation']['references']
+ *
+ * @param string $id page ID to link to. eg. 'wiki:syntax'
+ * @param string|array $name name for the link, array for media file
*/
- function internallink($id, $name = null){
+ function internallink($id, $name = null) {
global $ID;
if(is_array($name)) {
$this->_firstimage($name['src']);
- if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+ if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
$parts = explode('?', $id, 2);
- if (count($parts) === 2) {
+ if(count($parts) === 2) {
$id = $parts[0];
}
@@ -299,7 +441,7 @@ class Doku_Renderer_metadata extends Doku_Renderer {
// first resolve and clean up the $id
resolve_pageid(getNS($ID), $id, $exists);
- @list($page, $hash) = explode('#', $id, 2);
+ @list($page) = explode('#', $id, 2);
// set metadata
$this->meta['relation']['references'][$page] = $exists;
@@ -307,84 +449,141 @@ class Doku_Renderer_metadata extends Doku_Renderer {
// p_set_metadata($id, $data);
// add link title to summary
- if ($this->capture){
+ if($this->capture) {
$name = $this->_getLinkTitle($name, $default, $id);
$this->doc .= $name;
}
}
- function externallink($url, $name = null){
+ /**
+ * Render an external link
+ *
+ * @param string $url full URL with scheme
+ * @param string|array $name name for the link, array for media file
+ */
+ function externallink($url, $name = null) {
if(is_array($name)) {
$this->_firstimage($name['src']);
- if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+ if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
- if ($this->capture){
- $this->doc .= $this->_getLinkTitle($name, '<' . $url . '>');
+ if($this->capture) {
+ $this->doc .= $this->_getLinkTitle($name, '<'.$url.'>');
}
}
- function interwikilink($match, $name = null, $wikiName, $wikiUri){
+ /**
+ * Render an interwiki link
+ *
+ * You may want to use $this->_resolveInterWiki() here
+ *
+ * @param string $match original link - probably not much use
+ * @param string|array $name name for the link, array for media file
+ * @param string $wikiName indentifier (shortcut) for the remote wiki
+ * @param string $wikiUri the fragment parsed from the original link
+ */
+ function interwikilink($match, $name = null, $wikiName, $wikiUri) {
if(is_array($name)) {
$this->_firstimage($name['src']);
- if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+ if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
- if ($this->capture){
- list($wikiUri, $hash) = explode('#', $wikiUri, 2);
+ if($this->capture) {
+ list($wikiUri) = explode('#', $wikiUri, 2);
$name = $this->_getLinkTitle($name, $wikiUri);
$this->doc .= $name;
}
}
- function windowssharelink($url, $name = null){
+ /**
+ * Link to windows share
+ *
+ * @param string $url the link
+ * @param string|array $name name for the link, array for media file
+ */
+ function windowssharelink($url, $name = null) {
if(is_array($name)) {
$this->_firstimage($name['src']);
- if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+ if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
- if ($this->capture){
- if ($name) $this->doc .= $name;
+ if($this->capture) {
+ if($name) $this->doc .= $name;
else $this->doc .= '<'.$url.'>';
}
}
- function emaillink($address, $name = null){
+ /**
+ * Render a linked E-Mail Address
+ *
+ * Should honor $conf['mailguard'] setting
+ *
+ * @param string $address Email-Address
+ * @param string|array $name name for the link, array for media file
+ */
+ function emaillink($address, $name = null) {
if(is_array($name)) {
$this->_firstimage($name['src']);
- if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
+ if($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
- if ($this->capture){
- if ($name) $this->doc .= $name;
+ if($this->capture) {
+ if($name) $this->doc .= $name;
else $this->doc .= '<'.$address.'>';
}
}
- function internalmedia($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $linking=null){
- if ($this->capture && $title) $this->doc .= '['.$title.']';
+ /**
+ * Render an internal media file
+ *
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param string $linking linkonly|detail|nolink
+ */
+ function internalmedia($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $linking = null) {
+ if($this->capture && $title) $this->doc .= '['.$title.']';
$this->_firstimage($src);
$this->_recordMediaUsage($src);
}
- function externalmedia($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $linking=null){
- if ($this->capture && $title) $this->doc .= '['.$title.']';
+ /**
+ * Render an external media file
+ *
+ * @param string $src full media URL
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param string $linking linkonly|detail|nolink
+ */
+ function externalmedia($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $linking = null) {
+ if($this->capture && $title) $this->doc .= '['.$title.']';
$this->_firstimage($src);
}
- function rss($url,$params) {
+ /**
+ * Render the output of an RSS feed
+ *
+ * @param string $url URL of the feed
+ * @param array $params Finetuning of the output
+ */
+ function rss($url, $params) {
$this->meta['relation']['haspart'][$url] = true;
$this->meta['date']['valid']['age'] =
- isset($this->meta['date']['valid']['age']) ?
- min($this->meta['date']['valid']['age'],$params['refresh']) :
- $params['refresh'];
+ isset($this->meta['date']['valid']['age']) ?
+ min($this->meta['date']['valid']['age'], $params['refresh']) :
+ $params['refresh'];
}
- //----------------------------------------------------------
- // Utils
+ #region Utils
/**
* Removes any Namespace from the given name but keeps
@@ -392,35 +591,36 @@ class Doku_Renderer_metadata extends Doku_Renderer {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function _simpleTitle($name){
+ function _simpleTitle($name) {
global $conf;
if(is_array($name)) return '';
- if($conf['useslash']){
+ if($conf['useslash']) {
$nssep = '[:;/]';
- }else{
+ } else {
$nssep = '[:;]';
}
- $name = preg_replace('!.*'.$nssep.'!','',$name);
+ $name = preg_replace('!.*'.$nssep.'!', '', $name);
//if there is a hash we use the anchor name only
- $name = preg_replace('!.*#!','',$name);
+ $name = preg_replace('!.*#!', '', $name);
return $name;
}
/**
* Creates a linkid from a headline
*
+ * @author Andreas Gohr <andi@splitbrain.org>
* @param string $title The headline title
* @param boolean $create Create a new unique ID?
- * @author Andreas Gohr <andi@splitbrain.org>
+ * @return string
*/
- function _headerToLink($title, $create=false) {
- if($create){
- return sectionID($title,$this->headers);
- }else{
+ function _headerToLink($title, $create = false) {
+ if($create) {
+ return sectionID($title, $this->headers);
+ } else {
$check = false;
- return sectionID($title,$check);
+ return sectionID($title, $check);
}
}
@@ -428,17 +628,22 @@ class Doku_Renderer_metadata extends Doku_Renderer {
* Construct a title and handle images in titles
*
* @author Harry Fuecks <hfuecks@gmail.com>
+ * @param string|array $title either string title or media array
+ * @param string $default default title if nothing else is found
+ * @param null|string $id linked page id (used to extract title from first heading)
+ * @return string title text
*/
- function _getLinkTitle($title, $default, $id=null) {
- global $conf;
-
- $isImage = false;
- if (is_array($title)){
- if($title['title']) return '['.$title['title'].']';
- } else if (is_null($title) || trim($title)==''){
- if (useHeading('content') && $id){
- $heading = p_get_first_heading($id,METADATA_DONT_RENDER);
- if ($heading) return $heading;
+ function _getLinkTitle($title, $default, $id = null) {
+ if(is_array($title)) {
+ if($title['title']) {
+ return '['.$title['title'].']';
+ } else {
+ return $default;
+ }
+ } else if(is_null($title) || trim($title) == '') {
+ if(useHeading('content') && $id) {
+ $heading = p_get_first_heading($id, METADATA_DONT_RENDER);
+ if($heading) return $heading;
}
return $default;
} else {
@@ -446,27 +651,39 @@ class Doku_Renderer_metadata extends Doku_Renderer {
}
}
- function _firstimage($src){
+ /**
+ * Remember first image
+ *
+ * @param string $src image URL or ID
+ */
+ function _firstimage($src) {
if($this->firstimage) return;
global $ID;
- list($src,$hash) = explode('#',$src,2);
- if(!media_isexternal($src)){
- resolve_mediaid(getNS($ID),$src, $exists);
+ list($src) = explode('#', $src, 2);
+ if(!media_isexternal($src)) {
+ resolve_mediaid(getNS($ID), $src, $exists);
}
- if(preg_match('/.(jpe?g|gif|png)$/i',$src)){
+ if(preg_match('/.(jpe?g|gif|png)$/i', $src)) {
$this->firstimage = $src;
}
}
+ /**
+ * Store list of used media files in metadata
+ *
+ * @param string $src media ID
+ */
function _recordMediaUsage($src) {
global $ID;
- list ($src, $hash) = explode('#', $src, 2);
- if (media_isexternal($src)) return;
+ list ($src) = explode('#', $src, 2);
+ if(media_isexternal($src)) return;
resolve_mediaid(getNS($ID), $src, $exists);
$this->meta['relation']['media'][$src] = $exists;
}
+
+ #endregion
}
//Setup VIM: ex: et ts=4 :
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 0c3c56c56..09294539e 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -11,259 +11,748 @@ if(!defined('DOKU_INC')) die('meh.');
* An empty renderer, produces no output
*
* Inherits from DokuWiki_Plugin for giving additional functions to render plugins
+ *
+ * The renderer transforms the syntax instructions created by the parser and handler into the
+ * desired output format. For each instruction a corresponding method defined in this class will
+ * be called. That method needs to produce the desired output for the instruction and add it to the
+ * $doc field. When all instructions are processed, the $doc field contents will be cached by
+ * DokuWiki and sent to the user.
*/
class Doku_Renderer extends DokuWiki_Plugin {
- var $info = array(
+ /** @var array Settings, control the behavior of the renderer */
+ public $info = array(
'cache' => true, // may the rendered result cached?
'toc' => true, // render the TOC?
);
- var $doc = '';
+ /** @var array contains the smiley configuration, set in p_render() */
+ public $smileys = array();
+ /** @var array contains the entity configuration, set in p_render() */
+ public $entities = array();
+ /** @var array contains the acronym configuration, set in p_render() */
+ public $acronyms = array();
+ /** @var array contains the interwiki configuration, set in p_render() */
+ public $interwiki = array();
- // keep some config options
- var $acronyms = array();
- var $smileys = array();
- var $badwords = array();
- var $entities = array();
- var $interwiki = array();
+ /**
+ * @var string the rendered document, this will be cached after the renderer ran through
+ */
+ public $doc = '';
- // allows renderer to be used again, clean out any per-use values
+ /**
+ * clean out any per-use values
+ *
+ * This is called before each use of the renderer object and should be used to
+ * completely reset the state of the renderer to be reused for a new document
+ */
function reset() {
}
- function nocache() {
- $this->info['cache'] = false;
- }
-
- function notoc() {
- $this->info['toc'] = false;
+ /**
+ * Allow the plugin to prevent DokuWiki from reusing an instance
+ *
+ * Since most renderer plugins fail to implement Doku_Renderer::reset() we default
+ * to reinstantiating the renderer here
+ *
+ * @return bool false if the plugin has to be instantiated
+ */
+ function isSingleton() {
+ return false;
}
/**
* Returns the format produced by this renderer.
*
- * Has to be overidden by decendend classes
+ * Has to be overidden by sub classes
+ *
+ * @return string
*/
- function getFormat(){
+ function getFormat() {
trigger_error('getFormat() not implemented in '.get_class($this), E_USER_WARNING);
+ return '';
}
/**
- * Allow the plugin to prevent DokuWiki from reusing an instance
+ * Disable caching of this renderer's output
+ */
+ function nocache() {
+ $this->info['cache'] = false;
+ }
+
+ /**
+ * Disable TOC generation for this renderer's output
*
- * @return bool false if the plugin has to be instantiated
+ * This might not be used for certain sub renderer
*/
- function isSingleton() {
- return false;
+ function notoc() {
+ $this->info['toc'] = false;
}
/**
- * handle plugin rendering
+ * Handle plugin rendering
+ *
+ * Most likely this needs NOT to be overwritten by sub classes
*
- * @param string $name Plugin name
- * @param mixed $data custom data set by handler
+ * @param string $name Plugin name
+ * @param mixed $data custom data set by handler
* @param string $state matched state if any
* @param string $match raw matched syntax
*/
- function plugin($name,$data,$state='',$match=''){
- $plugin = plugin_load('syntax',$name);
- if($plugin != null){
- $plugin->render($this->getFormat(),$this,$data);
+ function plugin($name, $data, $state = '', $match = '') {
+ /** @var DokuWiki_Syntax_Plugin $plugin */
+ $plugin = plugin_load('syntax', $name);
+ if($plugin != null) {
+ $plugin->render($this->getFormat(), $this, $data);
}
}
/**
* handle nested render instructions
* this method (and nest_close method) should not be overloaded in actual renderer output classes
+ *
+ * @param array $instructions
*/
function nest($instructions) {
-
- foreach ( $instructions as $instruction ) {
+ foreach($instructions as $instruction) {
// execute the callback against ourself
- if (method_exists($this,$instruction[0])) {
+ if(method_exists($this, $instruction[0])) {
call_user_func_array(array($this, $instruction[0]), $instruction[1] ? $instruction[1] : array());
}
}
}
- // dummy closing instruction issued by Doku_Handler_Nest, normally the syntax mode should
- // override this instruction when instantiating Doku_Handler_Nest - however plugins will not
- // be able to - as their instructions require data.
- function nest_close() {}
+ /**
+ * dummy closing instruction issued by Doku_Handler_Nest
+ *
+ * normally the syntax mode should override this instruction when instantiating Doku_Handler_Nest -
+ * however plugins will not be able to - as their instructions require data.
+ */
+ function nest_close() {
+ }
- function document_start() {}
+ #region Syntax modes - sub classes will need to implement them to fill $doc
- function document_end() {}
+ /**
+ * Initialize the document
+ */
+ function document_start() {
+ }
- function render_TOC() { return ''; }
+ /**
+ * Finalize the document
+ */
+ function document_end() {
+ }
- function toc_additem($id, $text, $level) {}
+ /**
+ * Render the Table of Contents
+ *
+ * @return string
+ */
+ function render_TOC() {
+ return '';
+ }
- function header($text, $level, $pos) {}
+ /**
+ * Add an item to the TOC
+ *
+ * @param string $id the hash link
+ * @param string $text the text to display
+ * @param int $level the nesting level
+ */
+ function toc_additem($id, $text, $level) {
+ }
- function section_open($level) {}
+ /**
+ * Render a heading
+ *
+ * @param string $text the text to display
+ * @param int $level header level
+ * @param int $pos byte position in the original source
+ */
+ function header($text, $level, $pos) {
+ }
- function section_close() {}
+ /**
+ * Open a new section
+ *
+ * @param int $level section level (as determined by the previous header)
+ */
+ function section_open($level) {
+ }
- function cdata($text) {}
+ /**
+ * Close the current section
+ */
+ function section_close() {
+ }
- function p_open() {}
+ /**
+ * Render plain text data
+ *
+ * @param $text
+ */
+ function cdata($text) {
+ }
- function p_close() {}
+ /**
+ * Open a paragraph
+ */
+ function p_open() {
+ }
- function linebreak() {}
+ /**
+ * Close a paragraph
+ */
+ function p_close() {
+ }
- function hr() {}
+ /**
+ * Create a line break
+ */
+ function linebreak() {
+ }
- function strong_open() {}
+ /**
+ * Create a horizontal line
+ */
+ function hr() {
+ }
- function strong_close() {}
+ /**
+ * Start strong (bold) formatting
+ */
+ function strong_open() {
+ }
- function emphasis_open() {}
+ /**
+ * Stop strong (bold) formatting
+ */
+ function strong_close() {
+ }
- function emphasis_close() {}
+ /**
+ * Start emphasis (italics) formatting
+ */
+ function emphasis_open() {
+ }
- function underline_open() {}
+ /**
+ * Stop emphasis (italics) formatting
+ */
+ function emphasis_close() {
+ }
- function underline_close() {}
+ /**
+ * Start underline formatting
+ */
+ function underline_open() {
+ }
- function monospace_open() {}
+ /**
+ * Stop underline formatting
+ */
+ function underline_close() {
+ }
- function monospace_close() {}
+ /**
+ * Start monospace formatting
+ */
+ function monospace_open() {
+ }
- function subscript_open() {}
+ /**
+ * Stop monospace formatting
+ */
+ function monospace_close() {
+ }
- function subscript_close() {}
+ /**
+ * Start a subscript
+ */
+ function subscript_open() {
+ }
- function superscript_open() {}
+ /**
+ * Stop a subscript
+ */
+ function subscript_close() {
+ }
- function superscript_close() {}
+ /**
+ * Start a superscript
+ */
+ function superscript_open() {
+ }
- function deleted_open() {}
+ /**
+ * Stop a superscript
+ */
+ function superscript_close() {
+ }
- function deleted_close() {}
+ /**
+ * Start deleted (strike-through) formatting
+ */
+ function deleted_open() {
+ }
- function footnote_open() {}
+ /**
+ * Stop deleted (strike-through) formatting
+ */
+ function deleted_close() {
+ }
- function footnote_close() {}
+ /**
+ * Start a footnote
+ */
+ function footnote_open() {
+ }
- function listu_open() {}
+ /**
+ * Stop a footnote
+ */
+ function footnote_close() {
+ }
- function listu_close() {}
+ /**
+ * Open an unordered list
+ */
+ function listu_open() {
+ }
- function listo_open() {}
+ /**
+ * Close an unordered list
+ */
+ function listu_close() {
+ }
- function listo_close() {}
+ /**
+ * Open an ordered list
+ */
+ function listo_open() {
+ }
- function listitem_open($level) {}
+ /**
+ * Close an ordered list
+ */
+ function listo_close() {
+ }
- function listitem_close() {}
+ /**
+ * Open a list item
+ *
+ * @param int $level the nesting level
+ */
+ function listitem_open($level) {
+ }
- function listcontent_open() {}
+ /**
+ * Close a list item
+ */
+ function listitem_close() {
+ }
- function listcontent_close() {}
+ /**
+ * Start the content of a list item
+ */
+ function listcontent_open() {
+ }
- function unformatted($text) {}
+ /**
+ * Stop the content of a list item
+ */
+ function listcontent_close() {
+ }
- function php($text) {}
+ /**
+ * Output unformatted $text
+ *
+ * Defaults to $this->cdata()
+ *
+ * @param string $text
+ */
+ function unformatted($text) {
+ $this->cdata($text);
+ }
- function phpblock($text) {}
+ /**
+ * Output inline PHP code
+ *
+ * If $conf['phpok'] is true this should evaluate the given code and append the result
+ * to $doc
+ *
+ * @param string $text The PHP code
+ */
+ function php($text) {
+ }
- function html($text) {}
+ /**
+ * Output block level PHP code
+ *
+ * If $conf['phpok'] is true this should evaluate the given code and append the result
+ * to $doc
+ *
+ * @param string $text The PHP code
+ */
+ function phpblock($text) {
+ }
- function htmlblock($text) {}
+ /**
+ * Output raw inline HTML
+ *
+ * If $conf['htmlok'] is true this should add the code as is to $doc
+ *
+ * @param string $text The HTML
+ */
+ function html($text) {
+ }
- function preformatted($text) {}
+ /**
+ * Output raw block-level HTML
+ *
+ * If $conf['htmlok'] is true this should add the code as is to $doc
+ *
+ * @param string $text The HTML
+ */
+ function htmlblock($text) {
+ }
- function quote_open() {}
+ /**
+ * Output preformatted text
+ *
+ * @param string $text
+ */
+ function preformatted($text) {
+ }
- function quote_close() {}
+ /**
+ * Start a block quote
+ */
+ function quote_open() {
+ }
- function file($text, $lang = null, $file = null ) {}
+ /**
+ * Stop a block quote
+ */
+ function quote_close() {
+ }
- function code($text, $lang = null, $file = null ) {}
+ /**
+ * Display text as file content, optionally syntax highlighted
+ *
+ * @param string $text text to show
+ * @param string $lang programming language to use for syntax highlighting
+ * @param string $file file path label
+ */
+ function file($text, $lang = null, $file = null) {
+ }
- function acronym($acronym) {}
+ /**
+ * Display text as code content, optionally syntax highlighted
+ *
+ * @param string $text text to show
+ * @param string $lang programming language to use for syntax highlighting
+ * @param string $file file path label
+ */
+ function code($text, $lang = null, $file = null) {
+ }
- function smiley($smiley) {}
+ /**
+ * Format an acronym
+ *
+ * Uses $this->acronyms
+ *
+ * @param string $acronym
+ */
+ function acronym($acronym) {
+ }
- function wordblock($word) {}
+ /**
+ * Format a smiley
+ *
+ * Uses $this->smiley
+ *
+ * @param string $smiley
+ */
+ function smiley($smiley) {
+ }
- function entity($entity) {}
+ /**
+ * Format an entity
+ *
+ * Entities are basically small text replacements
+ *
+ * Uses $this->entities
+ *
+ * @param string $entity
+ */
+ function entity($entity) {
+ }
- // 640x480 ($x=640, $y=480)
- function multiplyentity($x, $y) {}
+ /**
+ * Typographically format a multiply sign
+ *
+ * Example: ($x=640, $y=480) should result in "640×480"
+ *
+ * @param string|int $x first value
+ * @param string|int $y second value
+ */
+ function multiplyentity($x, $y) {
+ }
- function singlequoteopening() {}
+ /**
+ * Render an opening single quote char (language specific)
+ */
+ function singlequoteopening() {
+ }
- function singlequoteclosing() {}
+ /**
+ * Render a closing single quote char (language specific)
+ */
+ function singlequoteclosing() {
+ }
- function apostrophe() {}
+ /**
+ * Render an apostrophe char (language specific)
+ */
+ function apostrophe() {
+ }
- function doublequoteopening() {}
+ /**
+ * Render an opening double quote char (language specific)
+ */
+ function doublequoteopening() {
+ }
- function doublequoteclosing() {}
+ /**
+ * Render an closinging double quote char (language specific)
+ */
+ function doublequoteclosing() {
+ }
- // $link like 'SomePage'
- function camelcaselink($link) {}
+ /**
+ * Render a CamelCase link
+ *
+ * @param string $link The link name
+ * @see http://en.wikipedia.org/wiki/CamelCase
+ */
+ function camelcaselink($link) {
+ }
- function locallink($hash, $name = null) {}
+ /**
+ * Render a page local link
+ *
+ * @param string $hash hash link identifier
+ * @param string $name name for the link
+ */
+ function locallink($hash, $name = null) {
+ }
- // $link like 'wiki:syntax', $title could be an array (media)
- function internallink($link, $title = null) {}
+ /**
+ * Render a wiki internal link
+ *
+ * @param string $link page ID to link to. eg. 'wiki:syntax'
+ * @param string|array $title name for the link, array for media file
+ */
+ function internallink($link, $title = null) {
+ }
+
+ /**
+ * Render an external link
+ *
+ * @param string $link full URL with scheme
+ * @param string|array $title name for the link, array for media file
+ */
+ function externallink($link, $title = null) {
+ }
- // $link is full URL with scheme, $title could be an array (media)
- function externallink($link, $title = null) {}
+ /**
+ * Render the output of an RSS feed
+ *
+ * @param string $url URL of the feed
+ * @param array $params Finetuning of the output
+ */
+ function rss($url, $params) {
+ }
- function rss ($url,$params) {}
+ /**
+ * Render an interwiki link
+ *
+ * You may want to use $this->_resolveInterWiki() here
+ *
+ * @param string $link original link - probably not much use
+ * @param string|array $title name for the link, array for media file
+ * @param string $wikiName indentifier (shortcut) for the remote wiki
+ * @param string $wikiUri the fragment parsed from the original link
+ */
+ function interwikilink($link, $title = null, $wikiName, $wikiUri) {
+ }
- // $link is the original link - probably not much use
- // $wikiName is an indentifier for the wiki
- // $wikiUri is the URL fragment to append to some known URL
- function interwikilink($link, $title = null, $wikiName, $wikiUri) {}
+ /**
+ * Link to file on users OS
+ *
+ * @param string $link the link
+ * @param string|array $title name for the link, array for media file
+ */
+ function filelink($link, $title = null) {
+ }
- // Link to file on users OS, $title could be an array (media)
- function filelink($link, $title = null) {}
+ /**
+ * Link to windows share
+ *
+ * @param string $link the link
+ * @param string|array $title name for the link, array for media file
+ */
+ function windowssharelink($link, $title = null) {
+ }
- // Link to a Windows share, , $title could be an array (media)
- function windowssharelink($link, $title = null) {}
+ /**
+ * Render a linked E-Mail Address
+ *
+ * Should honor $conf['mailguard'] setting
+ *
+ * @param string $address Email-Address
+ * @param string|array $name name for the link, array for media file
+ */
+ function emaillink($address, $name = null) {
+ }
-// function email($address, $title = null) {}
- function emaillink($address, $name = null) {}
+ /**
+ * Render an internal media file
+ *
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param string $linking linkonly|detail|nolink
+ */
+ function internalmedia($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $linking = null) {
+ }
- function internalmedia ($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $linking=null) {}
+ /**
+ * Render an external media file
+ *
+ * @param string $src full media URL
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param string $linking linkonly|detail|nolink
+ */
+ function externalmedia($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $linking = null) {
+ }
- function externalmedia ($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $linking=null) {}
+ /**
+ * Render a link to an internal media file
+ *
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ */
+ function internalmedialink($src, $title = null, $align = null,
+ $width = null, $height = null, $cache = null) {
+ }
- function internalmedialink (
- $src,$title=null,$align=null,$width=null,$height=null,$cache=null
- ) {}
+ /**
+ * Render a link to an external media file
+ *
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ */
+ function externalmedialink($src, $title = null, $align = null,
+ $width = null, $height = null, $cache = null) {
+ }
- function externalmedialink(
- $src,$title=null,$align=null,$width=null,$height=null,$cache=null
- ) {}
+ /**
+ * Start a table
+ *
+ * @param int $maxcols maximum number of columns
+ * @param int $numrows NOT IMPLEMENTED
+ * @param int $pos byte position in the original source
+ */
+ function table_open($maxcols = null, $numrows = null, $pos = null) {
+ }
- function table_open($maxcols = null, $numrows = null, $pos = null){}
+ /**
+ * Close a table
+ *
+ * @param int $pos byte position in the original source
+ */
+ function table_close($pos = null) {
+ }
- function table_close($pos = null){}
+ /**
+ * Open a table header
+ */
+ function tablethead_open() {
+ }
- function tablerow_open(){}
+ /**
+ * Close a table header
+ */
+ function tablethead_close() {
+ }
- function tablerow_close(){}
+ /**
+ * Open a table row
+ */
+ function tablerow_open() {
+ }
- function tableheader_open($colspan = 1, $align = null, $rowspan = 1){}
+ /**
+ * Close a table row
+ */
+ function tablerow_close() {
+ }
- function tableheader_close(){}
+ /**
+ * Open a table header cell
+ *
+ * @param int $colspan
+ * @param string $align left|center|right
+ * @param int $rowspan
+ */
+ function tableheader_open($colspan = 1, $align = null, $rowspan = 1) {
+ }
- function tablecell_open($colspan = 1, $align = null, $rowspan = 1){}
+ /**
+ * Close a table header cell
+ */
+ function tableheader_close() {
+ }
- function tablecell_close(){}
+ /**
+ * Open a table cell
+ *
+ * @param int $colspan
+ * @param string $align left|center|right
+ * @param int $rowspan
+ */
+ function tablecell_open($colspan = 1, $align = null, $rowspan = 1) {
+ }
+ /**
+ * Close a table cell
+ */
+ function tablecell_close() {
+ }
- // util functions follow, you probably won't need to reimplement them
+ #endregion
+ #region util functions, you probably won't need to reimplement them
/**
* Removes any Namespace from the given name but keeps
@@ -290,13 +779,13 @@ class Doku_Renderer extends DokuWiki_Plugin {
/**
* Resolve an interwikilink
*/
- function _resolveInterWiki(&$shortcut, $reference, &$exists=null) {
+ function _resolveInterWiki(&$shortcut, $reference, &$exists = null) {
//get interwiki URL
if(isset($this->interwiki[$shortcut])) {
$url = $this->interwiki[$shortcut];
} else {
// Default to Google I'm feeling lucky
- $url = 'http://www.google.com/search?q={URL}&amp;btnI=lucky';
+ $url = 'http://www.google.com/search?q={URL}&amp;btnI=lucky';
$shortcut = 'go';
}
@@ -306,8 +795,8 @@ class Doku_Renderer extends DokuWiki_Plugin {
//replace placeholder
if(preg_match('#\{(URL|NAME|SCHEME|HOST|PORT|PATH|QUERY)\}#', $url)) {
//use placeholders
- $url = str_replace('{URL}', rawurlencode($reference), $url);
- $url = str_replace('{NAME}', $reference, $url);
+ $url = str_replace('{URL}', rawurlencode($reference), $url);
+ $url = str_replace('{NAME}', $reference, $url);
$parsed = parse_url($reference);
if(!$parsed['port']) $parsed['port'] = 80;
$url = str_replace('{SCHEME}', $parsed['scheme'], $url);
@@ -317,18 +806,20 @@ class Doku_Renderer extends DokuWiki_Plugin {
$url = str_replace('{QUERY}', $parsed['query'], $url);
} else {
//default
- $url = $url . rawurlencode($reference);
+ $url = $url.rawurlencode($reference);
}
//handle as wiki links
if($url{0} === ':') {
list($id, $urlparam) = explode('?', $url, 2);
- $url = wl(cleanID($id), $urlparam);
+ $url = wl(cleanID($id), $urlparam);
$exists = page_exists($id);
}
- if($hash) $url .= '#' . rawurlencode($hash);
+ if($hash) $url .= '#'.rawurlencode($hash);
return $url;
}
+
+ #endregion
}
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index e3f9a4187..5c0353688 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -7,37 +7,53 @@
*/
if(!defined('DOKU_INC')) die('meh.');
-if ( !defined('DOKU_LF') ) {
+if(!defined('DOKU_LF')) {
// Some whitespace to help View > Source
- define ('DOKU_LF',"\n");
+ define ('DOKU_LF', "\n");
}
-if ( !defined('DOKU_TAB') ) {
+if(!defined('DOKU_TAB')) {
// Some whitespace to help View > Source
- define ('DOKU_TAB',"\t");
+ define ('DOKU_TAB', "\t");
}
/**
- * The Renderer
+ * The XHTML Renderer
+ *
+ * This is DokuWiki's main renderer used to display page content in the wiki
*/
class Doku_Renderer_xhtml extends Doku_Renderer {
+ /** @var array store the table of contents */
+ public $toc = array();
+
+ /** @var array A stack of section edit data */
+ protected $sectionedits = array();
- // @access public
- var $doc = ''; // will contain the whole document
- var $toc = array(); // will contain the Table of Contents
+ /** @var int last section edit id, used by startSectionEdit */
+ protected $lastsecid = 0;
- var $sectionedits = array(); // A stack of section edit data
- private $lastsecid = 0; // last section edit id, used by startSectionEdit
+ /** @var array the list of headers used to create unique link ids */
+ protected $headers = array();
- var $headers = array();
/** @var array a list of footnotes, list starts at 1! */
- var $footnotes = array();
- var $lastlevel = 0;
- var $node = array(0,0,0,0,0);
- var $store = '';
+ protected $footnotes = array();
+
+ /** @var int current section level */
+ protected $lastlevel = 0;
+ /** @var array section node tracker */
+ protected $node = array(0, 0, 0, 0, 0);
+
+ /** @var string temporary $doc store */
+ protected $store = '';
- var $_counter = array(); // used as global counter, introduced for table classes
- var $_codeblock = 0; // counts the code and file blocks, used to provide download links
+ /** @var array global counter, for table classes etc. */
+ protected $_counter = array(); //
+
+ /** @var int counts the code and file blocks, used to provide download links */
+ protected $_codeblock = 0;
+
+ /** @var array list of allowed URL schemes */
+ protected $schemes = null;
/**
* Register a new edit section range
@@ -50,43 +66,53 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*/
public function startSectionEdit($start, $type, $title = null) {
$this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title);
- return 'sectionedit' . $this->lastsecid;
+ return 'sectionedit'.$this->lastsecid;
}
/**
* Finish an edit section range
*
- * @param $end int The byte position for the edit end; null for the rest of
+ * @param $end int The byte position for the edit end; null for the rest of
* the page
* @author Adrian Lang <lang@cosmocode.de>
*/
public function finishSectionEdit($end = null) {
list($id, $start, $type, $title) = array_pop($this->sectionedits);
- if (!is_null($end) && $end <= $start) {
+ if(!is_null($end) && $end <= $start) {
return;
}
- $this->doc .= "<!-- EDIT$id " . strtoupper($type) . ' ';
- if (!is_null($title)) {
- $this->doc .= '"' . str_replace('"', '', $title) . '" ';
+ $this->doc .= "<!-- EDIT$id ".strtoupper($type).' ';
+ if(!is_null($title)) {
+ $this->doc .= '"'.str_replace('"', '', $title).'" ';
}
- $this->doc .= "[$start-" . (is_null($end) ? '' : $end) . '] -->';
+ $this->doc .= "[$start-".(is_null($end) ? '' : $end).'] -->';
}
- function getFormat(){
+ /**
+ * Returns the format produced by this renderer.
+ *
+ * @return string always 'xhtml'
+ */
+ function getFormat() {
return 'xhtml';
}
-
+ /**
+ * Initialize the document
+ */
function document_start() {
//reset some internals
$this->toc = array();
$this->headers = array();
}
+ /**
+ * Finalize the document
+ */
function document_end() {
// Finish open section edits.
- while (count($this->sectionedits) > 0) {
- if ($this->sectionedits[count($this->sectionedits) - 1][1] <= 1) {
+ while(count($this->sectionedits) > 0) {
+ if($this->sectionedits[count($this->sectionedits) - 1][1] <= 1) {
// If there is only one section, do not write a section edit
// marker.
array_pop($this->sectionedits);
@@ -95,12 +121,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
}
- if ( count ($this->footnotes) > 0 ) {
+ if(count($this->footnotes) > 0) {
$this->doc .= '<div class="footnotes">'.DOKU_LF;
- foreach ( $this->footnotes as $id => $footnote ) {
+ foreach($this->footnotes as $id => $footnote) {
// check its not a placeholder that indicates actual footnote text is elsewhere
- if (substr($footnote, 0, 5) != "@@FNT") {
+ if(substr($footnote, 0, 5) != "@@FNT") {
// open the footnote and set the anchor and backlink
$this->doc .= '<div class="fn">';
@@ -110,8 +136,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// get any other footnotes that use the same markup
$alt = array_keys($this->footnotes, "@@FNT$id");
- if (count($alt)) {
- foreach ($alt as $ref) {
+ if(count($alt)) {
+ foreach($alt as $ref) {
// set anchor and backlink for the other footnotes
$this->doc .= ', <sup><a href="#fnt__'.($ref).'" id="fn__'.($ref).'" class="fn_bot">';
$this->doc .= ($ref).')</a></sup> '.DOKU_LF;
@@ -120,7 +146,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// add footnote markup and close this footnote
$this->doc .= $footnote;
- $this->doc .= '</div>' . DOKU_LF;
+ $this->doc .= '</div>'.DOKU_LF;
}
}
$this->doc .= '</div>'.DOKU_LF;
@@ -128,139 +154,221 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// Prepare the TOC
global $conf;
- if($this->info['toc'] && is_array($this->toc) && $conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']){
+ if($this->info['toc'] && is_array($this->toc) && $conf['tocminheads'] && count($this->toc) >= $conf['tocminheads']) {
global $TOC;
$TOC = $this->toc;
}
// make sure there are no empty paragraphs
- $this->doc = preg_replace('#<p>\s*</p>#','',$this->doc);
+ $this->doc = preg_replace('#<p>\s*</p>#', '', $this->doc);
}
+ /**
+ * Add an item to the TOC
+ *
+ * @param string $id the hash link
+ * @param string $text the text to display
+ * @param int $level the nesting level
+ */
function toc_additem($id, $text, $level) {
global $conf;
//handle TOC
- if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']){
- $this->toc[] = html_mktocitem($id, $text, $level-$conf['toptoclevel']+1);
+ if($level >= $conf['toptoclevel'] && $level <= $conf['maxtoclevel']) {
+ $this->toc[] = html_mktocitem($id, $text, $level - $conf['toptoclevel'] + 1);
}
}
+ /**
+ * Render a heading
+ *
+ * @param string $text the text to display
+ * @param int $level header level
+ * @param int $pos byte position in the original source
+ */
function header($text, $level, $pos) {
global $conf;
if(!$text) return; //skip empty headlines
- $hid = $this->_headerToLink($text,true);
+ $hid = $this->_headerToLink($text, true);
//only add items within configured levels
$this->toc_additem($hid, $text, $level);
// adjust $node to reflect hierarchy of levels
- $this->node[$level-1]++;
- if ($level < $this->lastlevel) {
- for ($i = 0; $i < $this->lastlevel-$level; $i++) {
- $this->node[$this->lastlevel-$i-1] = 0;
+ $this->node[$level - 1]++;
+ if($level < $this->lastlevel) {
+ for($i = 0; $i < $this->lastlevel - $level; $i++) {
+ $this->node[$this->lastlevel - $i - 1] = 0;
}
}
$this->lastlevel = $level;
- if ($level <= $conf['maxseclevel'] &&
+ if($level <= $conf['maxseclevel'] &&
count($this->sectionedits) > 0 &&
- $this->sectionedits[count($this->sectionedits) - 1][2] === 'section') {
+ $this->sectionedits[count($this->sectionedits) - 1][2] === 'section'
+ ) {
$this->finishSectionEdit($pos - 1);
}
// write the header
$this->doc .= DOKU_LF.'<h'.$level;
- if ($level <= $conf['maxseclevel']) {
- $this->doc .= ' class="' . $this->startSectionEdit($pos, 'section', $text) . '"';
+ if($level <= $conf['maxseclevel']) {
+ $this->doc .= ' class="'.$this->startSectionEdit($pos, 'section', $text).'"';
}
$this->doc .= ' id="'.$hid.'">';
$this->doc .= $this->_xmlEntities($text);
$this->doc .= "</h$level>".DOKU_LF;
}
+ /**
+ * Open a new section
+ *
+ * @param int $level section level (as determined by the previous header)
+ */
function section_open($level) {
- $this->doc .= '<div class="level' . $level . '">' . DOKU_LF;
+ $this->doc .= '<div class="level'.$level.'">'.DOKU_LF;
}
+ /**
+ * Close the current section
+ */
function section_close() {
$this->doc .= DOKU_LF.'</div>'.DOKU_LF;
}
+ /**
+ * Render plain text data
+ *
+ * @param $text
+ */
function cdata($text) {
$this->doc .= $this->_xmlEntities($text);
}
+ /**
+ * Open a paragraph
+ */
function p_open() {
$this->doc .= DOKU_LF.'<p>'.DOKU_LF;
}
+ /**
+ * Close a paragraph
+ */
function p_close() {
$this->doc .= DOKU_LF.'</p>'.DOKU_LF;
}
+ /**
+ * Create a line break
+ */
function linebreak() {
$this->doc .= '<br/>'.DOKU_LF;
}
+ /**
+ * Create a horizontal line
+ */
function hr() {
$this->doc .= '<hr />'.DOKU_LF;
}
+ /**
+ * Start strong (bold) formatting
+ */
function strong_open() {
$this->doc .= '<strong>';
}
+ /**
+ * Stop strong (bold) formatting
+ */
function strong_close() {
$this->doc .= '</strong>';
}
+ /**
+ * Start emphasis (italics) formatting
+ */
function emphasis_open() {
$this->doc .= '<em>';
}
+ /**
+ * Stop emphasis (italics) formatting
+ */
function emphasis_close() {
$this->doc .= '</em>';
}
+ /**
+ * Start underline formatting
+ */
function underline_open() {
$this->doc .= '<em class="u">';
}
+ /**
+ * Stop underline formatting
+ */
function underline_close() {
$this->doc .= '</em>';
}
+ /**
+ * Start monospace formatting
+ */
function monospace_open() {
$this->doc .= '<code>';
}
+ /**
+ * Stop monospace formatting
+ */
function monospace_close() {
$this->doc .= '</code>';
}
+ /**
+ * Start a subscript
+ */
function subscript_open() {
$this->doc .= '<sub>';
}
+ /**
+ * Stop a subscript
+ */
function subscript_close() {
$this->doc .= '</sub>';
}
+ /**
+ * Start a superscript
+ */
function superscript_open() {
$this->doc .= '<sup>';
}
+ /**
+ * Stop a superscript
+ */
function superscript_close() {
$this->doc .= '</sup>';
}
+ /**
+ * Start deleted (strike-through) formatting
+ */
function deleted_open() {
$this->doc .= '<del>';
}
+ /**
+ * Stop deleted (strike-through) formatting
+ */
function deleted_close() {
$this->doc .= '</del>';
}
@@ -296,14 +404,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$fnid++;
// recover footnote into the stack and restore old content
- $footnote = $this->doc;
- $this->doc = $this->store;
+ $footnote = $this->doc;
+ $this->doc = $this->store;
$this->store = '';
// check to see if this footnote has been seen before
$i = array_search($footnote, $this->footnotes);
- if ($i === false) {
+ if($i === false) {
// its a new footnote, add it to the $footnotes array
$this->footnotes[$fnid] = $footnote;
} else {
@@ -315,38 +423,71 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '<sup><a href="#fn__'.$fnid.'" id="fnt__'.$fnid.'" class="fn_top">'.$fnid.')</a></sup>';
}
+ /**
+ * Open an unordered list
+ */
function listu_open() {
$this->doc .= '<ul>'.DOKU_LF;
}
+ /**
+ * Close an unordered list
+ */
function listu_close() {
$this->doc .= '</ul>'.DOKU_LF;
}
+ /**
+ * Open an ordered list
+ */
function listo_open() {
$this->doc .= '<ol>'.DOKU_LF;
}
+ /**
+ * Close an ordered list
+ */
function listo_close() {
$this->doc .= '</ol>'.DOKU_LF;
}
+ /**
+ * Open a list item
+ *
+ * @param int $level the nesting level
+ */
function listitem_open($level) {
$this->doc .= '<li class="level'.$level.'">';
}
+ /**
+ * Close a list item
+ */
function listitem_close() {
$this->doc .= '</li>'.DOKU_LF;
}
+ /**
+ * Start the content of a list item
+ */
function listcontent_open() {
$this->doc .= '<div class="li">';
}
+ /**
+ * Stop the content of a list item
+ */
function listcontent_close() {
$this->doc .= '</div>'.DOKU_LF;
}
+ /**
+ * Output unformatted $text
+ *
+ * Defaults to $this->cdata()
+ *
+ * @param string $text
+ */
function unformatted($text) {
$this->doc .= $this->_xmlEntities($text);
}
@@ -354,15 +495,15 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
/**
* Execute PHP code if allowed
*
- * @param string $text PHP code that is either executed or printed
- * @param string $wrapper html element to wrap result if $conf['phpok'] is okff
+ * @param string $text PHP code that is either executed or printed
+ * @param string $wrapper html element to wrap result if $conf['phpok'] is okff
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function php($text, $wrapper='code') {
+ function php($text, $wrapper = 'code') {
global $conf;
- if($conf['phpok']){
+ if($conf['phpok']) {
ob_start();
eval($text);
$this->doc .= ob_get_contents();
@@ -372,6 +513,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
}
+ /**
+ * Output block level PHP code
+ *
+ * If $conf['phpok'] is true this should evaluate the given code and append the result
+ * to $doc
+ *
+ * @param string $text The PHP code
+ */
function phpblock($text) {
$this->php($text, 'pre');
}
@@ -379,75 +528,110 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
/**
* Insert HTML if allowed
*
- * @param string $text html text
- * @param string $wrapper html element to wrap result if $conf['htmlok'] is okff
+ * @param string $text html text
+ * @param string $wrapper html element to wrap result if $conf['htmlok'] is okff
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function html($text, $wrapper='code') {
+ function html($text, $wrapper = 'code') {
global $conf;
- if($conf['htmlok']){
+ if($conf['htmlok']) {
$this->doc .= $text;
} else {
$this->doc .= p_xhtml_cached_geshi($text, 'html4strict', $wrapper);
}
}
+ /**
+ * Output raw block-level HTML
+ *
+ * If $conf['htmlok'] is true this should add the code as is to $doc
+ *
+ * @param string $text The HTML
+ */
function htmlblock($text) {
$this->html($text, 'pre');
}
+ /**
+ * Start a block quote
+ */
function quote_open() {
$this->doc .= '<blockquote><div class="no">'.DOKU_LF;
}
+ /**
+ * Stop a block quote
+ */
function quote_close() {
$this->doc .= '</div></blockquote>'.DOKU_LF;
}
+ /**
+ * Output preformatted text
+ *
+ * @param string $text
+ */
function preformatted($text) {
- $this->doc .= '<pre class="code">' . trim($this->_xmlEntities($text),"\n\r") . '</pre>'. DOKU_LF;
+ $this->doc .= '<pre class="code">'.trim($this->_xmlEntities($text), "\n\r").'</pre>'.DOKU_LF;
}
- function file($text, $language=null, $filename=null) {
- $this->_highlight('file',$text,$language,$filename);
+ /**
+ * Display text as file content, optionally syntax highlighted
+ *
+ * @param string $text text to show
+ * @param string $language programming language to use for syntax highlighting
+ * @param string $filename file path label
+ */
+ function file($text, $language = null, $filename = null) {
+ $this->_highlight('file', $text, $language, $filename);
}
- function code($text, $language=null, $filename=null) {
- $this->_highlight('code',$text,$language,$filename);
+ /**
+ * Display text as code content, optionally syntax highlighted
+ *
+ * @param string $text text to show
+ * @param string $language programming language to use for syntax highlighting
+ * @param string $filename file path label
+ */
+ function code($text, $language = null, $filename = null) {
+ $this->_highlight('code', $text, $language, $filename);
}
/**
* Use GeSHi to highlight language syntax in code and file blocks
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @param string $type code|file
+ * @param string $text text to show
+ * @param string $language programming language to use for syntax highlighting
+ * @param string $filename file path label
*/
- function _highlight($type, $text, $language=null, $filename=null) {
- global $conf;
+ function _highlight($type, $text, $language = null, $filename = null) {
global $ID;
global $lang;
- if($filename){
+ if($filename) {
// add icon
- list($ext) = mimetype($filename,false);
- $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+ list($ext) = mimetype($filename, false);
+ $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
$class = 'mediafile mf_'.$class;
$this->doc .= '<dl class="'.$type.'">'.DOKU_LF;
- $this->doc .= '<dt><a href="'.exportlink($ID,'code',array('codeblock'=>$this->_codeblock)).'" title="'.$lang['download'].'" class="'.$class.'">';
+ $this->doc .= '<dt><a href="'.exportlink($ID, 'code', array('codeblock' => $this->_codeblock)).'" title="'.$lang['download'].'" class="'.$class.'">';
$this->doc .= hsc($filename);
$this->doc .= '</a></dt>'.DOKU_LF.'<dd>';
}
- if ($text{0} == "\n") {
+ if($text{0} == "\n") {
$text = substr($text, 1);
}
- if (substr($text, -1) == "\n") {
+ if(substr($text, -1) == "\n") {
$text = substr($text, 0, -1);
}
- if ( is_null($language) ) {
+ if(is_null($language)) {
$this->doc .= '<pre class="'.$type.'">'.$this->_xmlEntities($text).'</pre>'.DOKU_LF;
} else {
$class = 'code'; //we always need the code class to make the syntax highlighting apply
@@ -456,16 +640,23 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= "<pre class=\"$class $language\">".p_xhtml_cached_geshi($text, $language, '').'</pre>'.DOKU_LF;
}
- if($filename){
+ if($filename) {
$this->doc .= '</dd></dl>'.DOKU_LF;
}
$this->_codeblock++;
}
+ /**
+ * Format an acronym
+ *
+ * Uses $this->acronyms
+ *
+ * @param string $acronym
+ */
function acronym($acronym) {
- if ( array_key_exists($acronym, $this->acronyms) ) {
+ if(array_key_exists($acronym, $this->acronyms)) {
$title = $this->_xmlEntities($this->acronyms[$acronym]);
@@ -477,73 +668,109 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
}
+ /**
+ * Format a smiley
+ *
+ * Uses $this->smiley
+ *
+ * @param string $smiley
+ */
function smiley($smiley) {
- if ( array_key_exists($smiley, $this->smileys) ) {
- $title = $this->_xmlEntities($this->smileys[$smiley]);
+ if(array_key_exists($smiley, $this->smileys)) {
$this->doc .= '<img src="'.DOKU_BASE.'lib/images/smileys/'.$this->smileys[$smiley].
'" class="icon" alt="'.
- $this->_xmlEntities($smiley).'" />';
+ $this->_xmlEntities($smiley).'" />';
} else {
$this->doc .= $this->_xmlEntities($smiley);
}
}
- /*
- * not used
- function wordblock($word) {
- if ( array_key_exists($word, $this->badwords) ) {
- $this->doc .= '** BLEEP **';
- } else {
- $this->doc .= $this->_xmlEntities($word);
- }
- }
- */
-
+ /**
+ * Format an entity
+ *
+ * Entities are basically small text replacements
+ *
+ * Uses $this->entities
+ *
+ * @param string $entity
+ */
function entity($entity) {
- if ( array_key_exists($entity, $this->entities) ) {
+ if(array_key_exists($entity, $this->entities)) {
$this->doc .= $this->entities[$entity];
} else {
$this->doc .= $this->_xmlEntities($entity);
}
}
+ /**
+ * Typographically format a multiply sign
+ *
+ * Example: ($x=640, $y=480) should result in "640×480"
+ *
+ * @param string|int $x first value
+ * @param string|int $y second value
+ */
function multiplyentity($x, $y) {
$this->doc .= "$x&times;$y";
}
+ /**
+ * Render an opening single quote char (language specific)
+ */
function singlequoteopening() {
global $lang;
$this->doc .= $lang['singlequoteopening'];
}
+ /**
+ * Render a closing single quote char (language specific)
+ */
function singlequoteclosing() {
global $lang;
$this->doc .= $lang['singlequoteclosing'];
}
+ /**
+ * Render an apostrophe char (language specific)
+ */
function apostrophe() {
global $lang;
$this->doc .= $lang['apostrophe'];
}
+ /**
+ * Render an opening double quote char (language specific)
+ */
function doublequoteopening() {
global $lang;
$this->doc .= $lang['doublequoteopening'];
}
+ /**
+ * Render an closinging double quote char (language specific)
+ */
function doublequoteclosing() {
global $lang;
$this->doc .= $lang['doublequoteclosing'];
}
/**
+ * Render a CamelCase link
+ *
+ * @param string $link The link name
+ * @see http://en.wikipedia.org/wiki/CamelCase
*/
function camelcaselink($link) {
- $this->internallink($link,$link);
+ $this->internallink($link, $link);
}
-
- function locallink($hash, $name = null){
+ /**
+ * Render a page local link
+ *
+ * @param string $hash hash link identifier
+ * @param string $name name for the link
+ */
+ function locallink($hash, $name = null) {
global $ID;
$name = $this->_getLinkTitle($name, $hash, $isImage);
$hash = $this->_headerToLink($hash);
@@ -559,23 +786,23 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* $search,$returnonly & $linktype are not for the renderer but are used
* elsewhere - no need to implement them in other renderers
*
- * @param string $id pageid
- * @param string|null $name link name
- * @param string|null $search adds search url param
- * @param bool $returnonly whether to return html or write to doc attribute
- * @param string $linktype type to set use of headings
- * @return void|string writes to doc attribute or returns html depends on $returnonly
* @author Andreas Gohr <andi@splitbrain.org>
+ * @param string $id pageid
+ * @param string|null $name link name
+ * @param string|null $search adds search url param
+ * @param bool $returnonly whether to return html or write to doc attribute
+ * @param string $linktype type to set use of headings
+ * @return void|string writes to doc attribute or returns html depends on $returnonly
*/
- function internallink($id, $name = null, $search=null,$returnonly=false,$linktype='content') {
+ function internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content') {
global $conf;
global $ID;
global $INFO;
$params = '';
- $parts = explode('?', $id, 2);
- if (count($parts) === 2) {
- $id = $parts[0];
+ $parts = explode('?', $id, 2);
+ if(count($parts) === 2) {
+ $id = $parts[0];
$params = $parts[1];
}
@@ -583,7 +810,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// We need this check because _simpleTitle needs
// correct $id and resolve_pageid() use cleanID($id)
// (some things could be lost)
- if ($id === '') {
+ if($id === '') {
$id = $ID;
}
@@ -591,22 +818,22 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$default = $this->_simpleTitle($id);
// now first resolve and clean up the $id
- resolve_pageid(getNS($ID),$id,$exists);
+ resolve_pageid(getNS($ID), $id, $exists);
$name = $this->_getLinkTitle($name, $default, $isImage, $id, $linktype);
- if ( !$isImage ) {
- if ( $exists ) {
- $class='wikilink1';
+ if(!$isImage) {
+ if($exists) {
+ $class = 'wikilink1';
} else {
- $class='wikilink2';
- $link['rel']='nofollow';
+ $class = 'wikilink2';
+ $link['rel'] = 'nofollow';
}
} else {
- $class='media';
+ $class = 'media';
}
//keep hash anchor
- @list($id,$hash) = explode('#',$id,2);
+ @list($id, $hash) = explode('#', $id, 2);
if(!empty($hash)) $hash = $this->_headerToLink($hash);
//prepare for formating
@@ -615,37 +842,43 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['pre'] = '';
$link['suf'] = '';
// highlight link to current page
- if ($id == $INFO['id']) {
- $link['pre'] = '<span class="curid">';
- $link['suf'] = '</span>';
+ if($id == $INFO['id']) {
+ $link['pre'] = '<span class="curid">';
+ $link['suf'] = '</span>';
}
- $link['more'] = '';
- $link['class'] = $class;
- $link['url'] = wl($id, $params);
- $link['name'] = $name;
- $link['title'] = $id;
+ $link['more'] = '';
+ $link['class'] = $class;
+ $link['url'] = wl($id, $params);
+ $link['name'] = $name;
+ $link['title'] = $id;
//add search string
- if($search){
- ($conf['userewrite']) ? $link['url'].='?' : $link['url'].='&amp;';
- if(is_array($search)){
- $search = array_map('rawurlencode',$search);
- $link['url'] .= 's[]='.join('&amp;s[]=',$search);
- }else{
+ if($search) {
+ ($conf['userewrite']) ? $link['url'] .= '?' : $link['url'] .= '&amp;';
+ if(is_array($search)) {
+ $search = array_map('rawurlencode', $search);
+ $link['url'] .= 's[]='.join('&amp;s[]=', $search);
+ } else {
$link['url'] .= 's='.rawurlencode($search);
}
}
//keep hash
- if($hash) $link['url'].='#'.$hash;
+ if($hash) $link['url'] .= '#'.$hash;
//output formatted
- if($returnonly){
+ if($returnonly) {
return $this->_formatLink($link);
- }else{
+ } else {
$this->doc .= $this->_formatLink($link);
}
}
+ /**
+ * Render an external link
+ *
+ * @param string $url full URL with scheme
+ * @param string|array $name name for the link, array for media file
+ */
function externallink($url, $name = null) {
global $conf;
@@ -653,21 +886,21 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// url might be an attack vector, only allow registered protocols
if(is_null($this->schemes)) $this->schemes = getSchemes();
- list($scheme) = explode('://',$url);
+ list($scheme) = explode('://', $url);
$scheme = strtolower($scheme);
- if(!in_array($scheme,$this->schemes)) $url = '';
+ if(!in_array($scheme, $this->schemes)) $url = '';
// is there still an URL?
- if(!$url){
+ if(!$url) {
$this->doc .= $name;
return;
}
// set class
- if ( !$isImage ) {
- $class='urlextern';
+ if(!$isImage) {
+ $class = 'urlextern';
} else {
- $class='media';
+ $class = 'media';
}
//prepare for formating
@@ -679,8 +912,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['class'] = $class;
$link['url'] = $url;
- $link['name'] = $name;
- $link['title'] = $this->_xmlEntities($url);
+ $link['name'] = $name;
+ $link['title'] = $this->_xmlEntities($url);
if($conf['relnofollow']) $link['more'] .= ' rel="nofollow"';
//output formatted
@@ -688,11 +921,19 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
/**
+ * Render an interwiki link
+ *
+ * You may want to use $this->_resolveInterWiki() here
+ *
+ * @param string $match original link - probably not much use
+ * @param string|array $name name for the link, array for media file
+ * @param string $wikiName indentifier (shortcut) for the remote wiki
+ * @param string $wikiUri the fragment parsed from the original link
*/
function interwikilink($match, $name = null, $wikiName, $wikiUri) {
global $conf;
- $link = array();
+ $link = array();
$link['target'] = $conf['target']['interwiki'];
$link['pre'] = '';
$link['suf'] = '';
@@ -701,10 +942,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//get interwiki URL
$exists = null;
- $url = $this->_resolveInterWiki($wikiName, $wikiUri, $exists);
+ $url = $this->_resolveInterWiki($wikiName, $wikiUri, $exists);
if(!$isImage) {
- $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $wikiName);
+ $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $wikiName);
$link['class'] = "interwiki iw_$class";
} else {
$link['class'] = 'media';
@@ -723,7 +964,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
}
- $link['url'] = $url;
+ $link['url'] = $url;
$link['title'] = htmlspecialchars($link['url']);
//output formatted
@@ -731,54 +972,66 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
/**
+ * Link to windows share
+ *
+ * @param string $url the link
+ * @param string|array $name name for the link, array for media file
*/
function windowssharelink($url, $name = null) {
global $conf;
- global $lang;
+
//simple setup
$link['target'] = $conf['target']['windows'];
$link['pre'] = '';
- $link['suf'] = '';
+ $link['suf'] = '';
$link['style'] = '';
$link['name'] = $this->_getLinkTitle($name, $url, $isImage);
- if ( !$isImage ) {
+ if(!$isImage) {
$link['class'] = 'windows';
} else {
$link['class'] = 'media';
}
$link['title'] = $this->_xmlEntities($url);
- $url = str_replace('\\','/',$url);
- $url = 'file:///'.$url;
- $link['url'] = $url;
+ $url = str_replace('\\', '/', $url);
+ $url = 'file:///'.$url;
+ $link['url'] = $url;
//output formatted
$this->doc .= $this->_formatLink($link);
}
+ /**
+ * Render a linked E-Mail Address
+ *
+ * Honors $conf['mailguard'] setting
+ *
+ * @param string $address Email-Address
+ * @param string|array $name name for the link, array for media file
+ */
function emaillink($address, $name = null) {
global $conf;
//simple setup
- $link = array();
+ $link = array();
$link['target'] = '';
$link['pre'] = '';
- $link['suf'] = '';
+ $link['suf'] = '';
$link['style'] = '';
$link['more'] = '';
$name = $this->_getLinkTitle($name, '', $isImage);
- if ( !$isImage ) {
- $link['class']='mail';
+ if(!$isImage) {
+ $link['class'] = 'mail';
} else {
- $link['class']='media';
+ $link['class'] = 'media';
}
$address = $this->_xmlEntities($address);
$address = obfuscate($address);
$title = $address;
- if(empty($name)){
+ if(empty($name)) {
$name = $address;
}
@@ -792,73 +1045,97 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= $this->_formatLink($link);
}
- function internalmedia ($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $linking=null, $return=NULL) {
+ /**
+ * Render an internal media file
+ *
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param string $linking linkonly|detail|nolink
+ * @param bool $return return HTML instead of adding to $doc
+ * @return void|string
+ */
+ function internalmedia($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $linking = null, $return = false) {
global $ID;
- list($src,$hash) = explode('#',$src,2);
- resolve_mediaid(getNS($ID),$src, $exists);
+ list($src, $hash) = explode('#', $src, 2);
+ resolve_mediaid(getNS($ID), $src, $exists);
$noLink = false;
$render = ($linking == 'linkonly') ? false : true;
- $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
+ $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
- list($ext,$mime,$dl) = mimetype($src,false);
- if(substr($mime,0,5) == 'image' && $render){
- $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),($linking=='direct'));
- }elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render){
+ list($ext, $mime) = mimetype($src, false);
+ if(substr($mime, 0, 5) == 'image' && $render) {
+ $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache), ($linking == 'direct'));
+ } elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render) {
// don't link movies
$noLink = true;
- }else{
+ } else {
// add file icons
- $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+ $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
$link['class'] .= ' mediafile mf_'.$class;
- $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),true);
- if ($exists) $link['title'] .= ' (' . filesize_h(filesize(mediaFN($src))).')';
+ $link['url'] = ml($src, array('id' => $ID, 'cache' => $cache), true);
+ if($exists) $link['title'] .= ' ('.filesize_h(filesize(mediaFN($src))).')';
}
if($hash) $link['url'] .= '#'.$hash;
//markup non existing files
- if (!$exists) {
+ if(!$exists) {
$link['class'] .= ' wikilink2';
}
//output formatted
- if ($return) {
- if ($linking == 'nolink' || $noLink) return $link['name'];
+ if($return) {
+ if($linking == 'nolink' || $noLink) return $link['name'];
else return $this->_formatLink($link);
} else {
- if ($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
+ if($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
else $this->doc .= $this->_formatLink($link);
}
}
- function externalmedia ($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $linking=null) {
- list($src,$hash) = explode('#',$src,2);
+ /**
+ * Render an external media file
+ *
+ * @param string $src full media URL
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param string $linking linkonly|detail|nolink
+ */
+ function externalmedia($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $linking = null) {
+ list($src, $hash) = explode('#', $src, 2);
$noLink = false;
$render = ($linking == 'linkonly') ? false : true;
- $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
+ $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
- $link['url'] = ml($src,array('cache'=>$cache));
+ $link['url'] = ml($src, array('cache' => $cache));
- list($ext,$mime,$dl) = mimetype($src,false);
- if(substr($mime,0,5) == 'image' && $render){
+ list($ext, $mime) = mimetype($src, false);
+ if(substr($mime, 0, 5) == 'image' && $render) {
// link only jpeg images
// if ($ext != 'jpg' && $ext != 'jpeg') $noLink = true;
- }elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render){
+ } elseif(($mime == 'application/x-shockwave-flash' || media_supportedav($mime)) && $render) {
// don't link movies
$noLink = true;
- }else{
+ } else {
// add file icons
- $class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
+ $class = preg_replace('/[^_\-a-z0-9]+/i', '_', $ext);
$link['class'] .= ' mediafile mf_'.$class;
}
if($hash) $link['url'] .= '#'.$hash;
//output formatted
- if ($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
+ if($linking == 'nolink' || $noLink) $this->doc .= $link['name'];
else $this->doc .= $this->_formatLink($link);
}
@@ -867,7 +1144,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function rss ($url,$params){
+ function rss($url, $params) {
global $lang;
global $conf;
@@ -876,17 +1153,21 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$feed->set_feed_url($url);
//disable warning while fetching
- if (!defined('DOKU_E_LEVEL')) { $elvl = error_reporting(E_ERROR); }
+ if(!defined('DOKU_E_LEVEL')) {
+ $elvl = error_reporting(E_ERROR);
+ }
$rc = $feed->init();
- if (!defined('DOKU_E_LEVEL')) { error_reporting($elvl); }
+ if(isset($elvl)) {
+ error_reporting($elvl);
+ }
//decide on start and end
- if($params['reverse']){
- $mod = -1;
- $start = $feed->get_item_quantity()-1;
+ if($params['reverse']) {
+ $mod = -1;
+ $start = $feed->get_item_quantity() - 1;
$end = $start - ($params['max']);
$end = ($end < -1) ? -1 : $end;
- }else{
+ } else {
$mod = 1;
$start = 0;
$end = $feed->get_item_quantity();
@@ -894,36 +1175,38 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
$this->doc .= '<ul class="rss">';
- if($rc){
- for ($x = $start; $x != $end; $x += $mod) {
+ if($rc) {
+ for($x = $start; $x != $end; $x += $mod) {
$item = $feed->get_item($x);
$this->doc .= '<li><div class="li">';
// support feeds without links
$lnkurl = $item->get_permalink();
- if($lnkurl){
+ if($lnkurl) {
// title is escaped by SimplePie, we unescape here because it
// is escaped again in externallink() FS#1705
- $this->externallink($item->get_permalink(),
- html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8'));
- }else{
+ $this->externallink(
+ $item->get_permalink(),
+ html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8')
+ );
+ } else {
$this->doc .= ' '.$item->get_title();
}
- if($params['author']){
+ if($params['author']) {
$author = $item->get_author(0);
- if($author){
+ if($author) {
$name = $author->get_name();
if(!$name) $name = $author->get_email();
if($name) $this->doc .= ' '.$lang['by'].' '.$name;
}
}
- if($params['date']){
+ if($params['date']) {
$this->doc .= ' ('.$item->get_local_date($conf['dformat']).')';
}
- if($params['details']){
+ if($params['details']) {
$this->doc .= '<div class="detail">';
- if($conf['htmlok']){
+ if($conf['htmlok']) {
$this->doc .= $item->get_description();
- }else{
+ } else {
$this->doc .= strip_tags($item->get_description());
}
$this->doc .= '</div>';
@@ -931,11 +1214,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '</div></li>';
}
- }else{
+ } else {
$this->doc .= '<li><div class="li">';
$this->doc .= '<em>'.$lang['rssfailed'].'</em>';
$this->externallink($url);
- if($conf['allowdebug']){
+ if($conf['allowdebug']) {
$this->doc .= '<!--'.hsc($feed->error).'-->';
}
$this->doc .= '</div></li>';
@@ -943,81 +1226,130 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$this->doc .= '</ul>';
}
- // $numrows not yet implemented
- function table_open($maxcols = null, $numrows = null, $pos = null){
- global $lang;
+ /**
+ * Start a table
+ *
+ * @param int $maxcols maximum number of columns
+ * @param int $numrows NOT IMPLEMENTED
+ * @param int $pos byte position in the original source
+ */
+ function table_open($maxcols = null, $numrows = null, $pos = null) {
// initialize the row counter used for classes
$this->_counter['row_counter'] = 0;
- $class = 'table';
- if ($pos !== null) {
- $class .= ' ' . $this->startSectionEdit($pos, 'table');
+ $class = 'table';
+ if($pos !== null) {
+ $class .= ' '.$this->startSectionEdit($pos, 'table');
}
- $this->doc .= '<div class="' . $class . '"><table class="inline">' .
- DOKU_LF;
+ $this->doc .= '<div class="'.$class.'"><table class="inline">'.
+ DOKU_LF;
}
- function table_close($pos = null){
+ /**
+ * Close a table
+ *
+ * @param int $pos byte position in the original source
+ */
+ function table_close($pos = null) {
$this->doc .= '</table></div>'.DOKU_LF;
- if ($pos !== null) {
+ if($pos !== null) {
$this->finishSectionEdit($pos);
}
}
- function tablerow_open(){
+ /**
+ * Open a table header
+ */
+ function tablethead_open() {
+ $this->doc .= DOKU_TAB.'<thead>'.DOKU_LF;
+ }
+
+ /**
+ * Close a table header
+ */
+ function tablethead_close() {
+ $this->doc .= DOKU_TAB.'</thead>'.DOKU_LF;
+ }
+
+ /**
+ * Open a table row
+ */
+ function tablerow_open() {
// initialize the cell counter used for classes
$this->_counter['cell_counter'] = 0;
- $class = 'row' . $this->_counter['row_counter']++;
- $this->doc .= DOKU_TAB . '<tr class="'.$class.'">' . DOKU_LF . DOKU_TAB . DOKU_TAB;
+ $class = 'row'.$this->_counter['row_counter']++;
+ $this->doc .= DOKU_TAB.'<tr class="'.$class.'">'.DOKU_LF.DOKU_TAB.DOKU_TAB;
}
- function tablerow_close(){
- $this->doc .= DOKU_LF . DOKU_TAB . '</tr>' . DOKU_LF;
+ /**
+ * Close a table row
+ */
+ function tablerow_close() {
+ $this->doc .= DOKU_LF.DOKU_TAB.'</tr>'.DOKU_LF;
}
- function tableheader_open($colspan = 1, $align = null, $rowspan = 1){
- $class = 'class="col' . $this->_counter['cell_counter']++;
- if ( !is_null($align) ) {
+ /**
+ * Open a table header cell
+ *
+ * @param int $colspan
+ * @param string $align left|center|right
+ * @param int $rowspan
+ */
+ function tableheader_open($colspan = 1, $align = null, $rowspan = 1) {
+ $class = 'class="col'.$this->_counter['cell_counter']++;
+ if(!is_null($align)) {
$class .= ' '.$align.'align';
}
$class .= '"';
- $this->doc .= '<th ' . $class;
- if ( $colspan > 1 ) {
- $this->_counter['cell_counter'] += $colspan-1;
+ $this->doc .= '<th '.$class;
+ if($colspan > 1) {
+ $this->_counter['cell_counter'] += $colspan - 1;
$this->doc .= ' colspan="'.$colspan.'"';
}
- if ( $rowspan > 1 ) {
+ if($rowspan > 1) {
$this->doc .= ' rowspan="'.$rowspan.'"';
}
$this->doc .= '>';
}
- function tableheader_close(){
+ /**
+ * Close a table header cell
+ */
+ function tableheader_close() {
$this->doc .= '</th>';
}
- function tablecell_open($colspan = 1, $align = null, $rowspan = 1){
- $class = 'class="col' . $this->_counter['cell_counter']++;
- if ( !is_null($align) ) {
+ /**
+ * Open a table cell
+ *
+ * @param int $colspan
+ * @param string $align left|center|right
+ * @param int $rowspan
+ */
+ function tablecell_open($colspan = 1, $align = null, $rowspan = 1) {
+ $class = 'class="col'.$this->_counter['cell_counter']++;
+ if(!is_null($align)) {
$class .= ' '.$align.'align';
}
$class .= '"';
$this->doc .= '<td '.$class;
- if ( $colspan > 1 ) {
- $this->_counter['cell_counter'] += $colspan-1;
+ if($colspan > 1) {
+ $this->_counter['cell_counter'] += $colspan - 1;
$this->doc .= ' colspan="'.$colspan.'"';
}
- if ( $rowspan > 1 ) {
+ if($rowspan > 1) {
$this->doc .= ' rowspan="'.$rowspan.'"';
}
$this->doc .= '>';
}
- function tablecell_close(){
+ /**
+ * Close a table cell
+ */
+ function tablecell_close() {
$this->doc .= '</td>';
}
- //----------------------------------------------------------
- // Utils
+ #region Utility functions
/**
* Build a link
@@ -1026,29 +1358,29 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
- function _formatLink($link){
+ function _formatLink($link) {
//make sure the url is XHTML compliant (skip mailto)
- if(substr($link['url'],0,7) != 'mailto:'){
- $link['url'] = str_replace('&','&amp;',$link['url']);
- $link['url'] = str_replace('&amp;amp;','&amp;',$link['url']);
+ if(substr($link['url'], 0, 7) != 'mailto:') {
+ $link['url'] = str_replace('&', '&amp;', $link['url']);
+ $link['url'] = str_replace('&amp;amp;', '&amp;', $link['url']);
}
//remove double encodings in titles
- $link['title'] = str_replace('&amp;amp;','&amp;',$link['title']);
+ $link['title'] = str_replace('&amp;amp;', '&amp;', $link['title']);
// be sure there are no bad chars in url or title
// (we can't do this for name because it can contain an img tag)
- $link['url'] = strtr($link['url'],array('>'=>'%3E','<'=>'%3C','"'=>'%22'));
- $link['title'] = strtr($link['title'],array('>'=>'&gt;','<'=>'&lt;','"'=>'&quot;'));
+ $link['url'] = strtr($link['url'], array('>' => '%3E', '<' => '%3C', '"' => '%22'));
+ $link['title'] = strtr($link['title'], array('>' => '&gt;', '<' => '&lt;', '"' => '&quot;'));
- $ret = '';
+ $ret = '';
$ret .= $link['pre'];
$ret .= '<a href="'.$link['url'].'"';
- if(!empty($link['class'])) $ret .= ' class="'.$link['class'].'"';
+ if(!empty($link['class'])) $ret .= ' class="'.$link['class'].'"';
if(!empty($link['target'])) $ret .= ' target="'.$link['target'].'"';
- if(!empty($link['title'])) $ret .= ' title="'.$link['title'].'"';
- if(!empty($link['style'])) $ret .= ' style="'.$link['style'].'"';
- if(!empty($link['rel'])) $ret .= ' rel="'.$link['rel'].'"';
- if(!empty($link['more'])) $ret .= ' '.$link['more'];
+ if(!empty($link['title'])) $ret .= ' title="'.$link['title'].'"';
+ if(!empty($link['style'])) $ret .= ' style="'.$link['style'].'"';
+ if(!empty($link['rel'])) $ret .= ' rel="'.$link['rel'].'"';
+ if(!empty($link['more'])) $ret .= ' '.$link['more'];
$ret .= '>';
$ret .= $link['name'];
$ret .= '</a>';
@@ -1060,102 +1392,112 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* Renders internal and external media
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param bool $render should the media be embedded inline or just linked
+ * @return string
*/
- function _media ($src, $title=null, $align=null, $width=null,
- $height=null, $cache=null, $render = true) {
+ function _media($src, $title = null, $align = null, $width = null,
+ $height = null, $cache = null, $render = true) {
$ret = '';
- list($ext,$mime,$dl) = mimetype($src);
- if(substr($mime,0,5) == 'image'){
+ list($ext, $mime) = mimetype($src);
+ if(substr($mime, 0, 5) == 'image') {
// first get the $title
- if (!is_null($title)) {
- $title = $this->_xmlEntities($title);
- }elseif($ext == 'jpg' || $ext == 'jpeg'){
+ if(!is_null($title)) {
+ $title = $this->_xmlEntities($title);
+ } elseif($ext == 'jpg' || $ext == 'jpeg') {
//try to use the caption from IPTC/EXIF
require_once(DOKU_INC.'inc/JpegMeta.php');
- $jpeg =new JpegMeta(mediaFN($src));
+ $jpeg = new JpegMeta(mediaFN($src));
if($jpeg !== false) $cap = $jpeg->getTitle();
- if($cap){
+ if(!empty($cap)) {
$title = $this->_xmlEntities($cap);
}
}
- if (!$render) {
+ if(!$render) {
// if the picture is not supposed to be rendered
// return the title of the picture
- if (!$title) {
+ if(!$title) {
// just show the sourcename
$title = $this->_xmlEntities(utf8_basename(noNS($src)));
}
return $title;
}
//add image tag
- $ret .= '<img src="'.ml($src,array('w'=>$width,'h'=>$height,'cache'=>$cache)).'"';
+ $ret .= '<img src="'.ml($src, array('w' => $width, 'h' => $height, 'cache' => $cache)).'"';
$ret .= ' class="media'.$align.'"';
- if ($title) {
- $ret .= ' title="' . $title . '"';
- $ret .= ' alt="' . $title .'"';
- }else{
+ if($title) {
+ $ret .= ' title="'.$title.'"';
+ $ret .= ' alt="'.$title.'"';
+ } else {
$ret .= ' alt=""';
}
- if ( !is_null($width) )
+ if(!is_null($width))
$ret .= ' width="'.$this->_xmlEntities($width).'"';
- if ( !is_null($height) )
+ if(!is_null($height))
$ret .= ' height="'.$this->_xmlEntities($height).'"';
$ret .= ' />';
- }elseif(media_supportedav($mime, 'video') || media_supportedav($mime, 'audio')){
+ } elseif(media_supportedav($mime, 'video') || media_supportedav($mime, 'audio')) {
// first get the $title
$title = !is_null($title) ? $this->_xmlEntities($title) : false;
- if (!$render) {
+ if(!$render) {
// if the file is not supposed to be rendered
// return the title of the file (just the sourcename if there is no title)
return $title ? $title : $this->_xmlEntities(utf8_basename(noNS($src)));
}
- $att = array();
+ $att = array();
$att['class'] = "media$align";
- if ($title) {
+ if($title) {
$att['title'] = $title;
}
- if (media_supportedav($mime, 'video')) {
+ if(media_supportedav($mime, 'video')) {
//add video
$ret .= $this->_video($src, $width, $height, $att);
}
- if (media_supportedav($mime, 'audio')) {
+ if(media_supportedav($mime, 'audio')) {
//add audio
$ret .= $this->_audio($src, $att);
}
- }elseif($mime == 'application/x-shockwave-flash'){
- if (!$render) {
+ } elseif($mime == 'application/x-shockwave-flash') {
+ if(!$render) {
// if the flash is not supposed to be rendered
// return the title of the flash
- if (!$title) {
+ if(!$title) {
// just show the sourcename
$title = utf8_basename(noNS($src));
}
return $this->_xmlEntities($title);
}
- $att = array();
+ $att = array();
$att['class'] = "media$align";
if($align == 'right') $att['align'] = 'right';
- if($align == 'left') $att['align'] = 'left';
- $ret .= html_flashobject(ml($src,array('cache'=>$cache),true,'&'),$width,$height,
- array('quality' => 'high'),
- null,
- $att,
- $this->_xmlEntities($title));
- }elseif($title){
+ if($align == 'left') $att['align'] = 'left';
+ $ret .= html_flashobject(
+ ml($src, array('cache' => $cache), true, '&'), $width, $height,
+ array('quality' => 'high'),
+ null,
+ $att,
+ $this->_xmlEntities($title)
+ );
+ } elseif($title) {
// well at least we have a title to display
$ret .= $this->_xmlEntities($title);
- }else{
+ } else {
// just show the sourcename
$ret .= $this->_xmlEntities(utf8_basename(noNS($src)));
}
@@ -1163,23 +1505,30 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
return $ret;
}
+ /**
+ * Escape string for output
+ *
+ * @param $string
+ * @return string
+ */
function _xmlEntities($string) {
- return htmlspecialchars($string,ENT_QUOTES,'UTF-8');
+ return htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
}
/**
* Creates a linkid from a headline
*
+ * @author Andreas Gohr <andi@splitbrain.org>
* @param string $title The headline title
* @param boolean $create Create a new unique ID?
- * @author Andreas Gohr <andi@splitbrain.org>
+ * @return string
*/
- function _headerToLink($title,$create=false) {
- if($create){
- return sectionID($title,$this->headers);
- }else{
+ function _headerToLink($title, $create = false) {
+ if($create) {
+ return sectionID($title, $this->headers);
+ } else {
$check = false;
- return sectionID($title,$check);
+ return sectionID($title, $check);
}
}
@@ -1187,18 +1536,22 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
* Construct a title and handle images in titles
*
* @author Harry Fuecks <hfuecks@gmail.com>
+ * @param string|array $title either string title or media array
+ * @param string $default default title if nothing else is found
+ * @param bool $isImage will be set to true if it's a media file
+ * @param null|string $id linked page id (used to extract title from first heading)
+ * @param string $linktype content|navigation
+ * @return string HTML of the title, might be full image tag or just escaped text
*/
- function _getLinkTitle($title, $default, & $isImage, $id=null, $linktype='content') {
- global $conf;
-
+ function _getLinkTitle($title, $default, &$isImage, $id = null, $linktype = 'content') {
$isImage = false;
- if ( is_array($title) ) {
+ if(is_array($title)) {
$isImage = true;
return $this->_imageTitle($title);
- } elseif ( is_null($title) || trim($title)=='') {
- if (useHeading($linktype) && $id) {
+ } elseif(is_null($title) || trim($title) == '') {
+ if(useHeading($linktype) && $id) {
$heading = p_get_first_heading($id);
- if ($heading) {
+ if($heading) {
return $this->_xmlEntities($heading);
}
}
@@ -1209,48 +1562,51 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
/**
- * Returns an HTML code for images used in link titles
+ * Returns HTML code for images used in link titles
*
- * @todo Resolve namespace on internal images
* @author Andreas Gohr <andi@splitbrain.org>
+ * @param string $img
+ * @return string HTML img tag or similar
*/
function _imageTitle($img) {
global $ID;
// some fixes on $img['src']
// see internalmedia() and externalmedia()
- list($img['src'],$hash) = explode('#',$img['src'],2);
- if ($img['type'] == 'internalmedia') {
- resolve_mediaid(getNS($ID),$img['src'],$exists);
+ list($img['src']) = explode('#', $img['src'], 2);
+ if($img['type'] == 'internalmedia') {
+ resolve_mediaid(getNS($ID), $img['src'], $exists);
}
- return $this->_media($img['src'],
- $img['title'],
- $img['align'],
- $img['width'],
- $img['height'],
- $img['cache']);
+ return $this->_media(
+ $img['src'],
+ $img['title'],
+ $img['align'],
+ $img['width'],
+ $img['height'],
+ $img['cache']
+ );
}
/**
- * _getMediaLinkConf is a helperfunction to internalmedia() and externalmedia()
- * which returns a basic link to a media.
+ * helperfunction to return a basic link to a media
+ *
+ * used in internalmedia() and externalmedia()
*
- * @author Pierre Spring <pierre.spring@liip.ch>
- * @param string $src
- * @param string $title
- * @param string $align
- * @param string $width
- * @param string $height
- * @param string $cache
- * @param string $render
- * @access protected
- * @return array
+ * @author Pierre Spring <pierre.spring@liip.ch>
+ * @param string $src media ID
+ * @param string $title descriptive text
+ * @param string $align left|center|right
+ * @param int $width width of media in pixel
+ * @param int $height height of media in pixel
+ * @param string $cache cache|recache|nocache
+ * @param bool $render should the media be embedded inline or just linked
+ * @return array associative array with link config
*/
function _getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render) {
global $conf;
- $link = array();
+ $link = array();
$link['class'] = 'media';
$link['style'] = '';
$link['pre'] = '';
@@ -1263,50 +1619,49 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
return $link;
}
-
/**
* Embed video(s) in HTML
*
* @author Anika Henke <anika@selfthinker.org>
*
- * @param string $src - ID of video to embed
- * @param int $width - width of the video in pixels
- * @param int $height - height of the video in pixels
- * @param array $atts - additional attributes for the <video> tag
+ * @param string $src - ID of video to embed
+ * @param int $width - width of the video in pixels
+ * @param int $height - height of the video in pixels
+ * @param array $atts - additional attributes for the <video> tag
* @return string
*/
- function _video($src,$width,$height,$atts=null){
+ function _video($src, $width, $height, $atts = null) {
// prepare width and height
if(is_null($atts)) $atts = array();
$atts['width'] = (int) $width;
$atts['height'] = (int) $height;
- if(!$atts['width']) $atts['width'] = 320;
+ if(!$atts['width']) $atts['width'] = 320;
if(!$atts['height']) $atts['height'] = 240;
// prepare alternative formats
- $extensions = array('webm', 'ogv', 'mp4');
+ $extensions = array('webm', 'ogv', 'mp4');
$alternatives = media_alternativefiles($src, $extensions);
- $poster = media_alternativefiles($src, array('jpg', 'png'), true);
- $posterUrl = '';
- if (!empty($poster)) {
- $posterUrl = ml(reset($poster),array('cache'=>$cache),true,'&');
+ $poster = media_alternativefiles($src, array('jpg', 'png'), true);
+ $posterUrl = '';
+ if(!empty($poster)) {
+ $posterUrl = ml(reset($poster), '', true, '&');
}
$out = '';
// open video tag
$out .= '<video '.buildAttributes($atts).' controls="controls"';
- if ($posterUrl) $out .= ' poster="'.hsc($posterUrl).'"';
+ if($posterUrl) $out .= ' poster="'.hsc($posterUrl).'"';
$out .= '>'.NL;
$fallback = '';
// output source for each alternative video format
foreach($alternatives as $mime => $file) {
- $url = ml($file,array('cache'=>$cache),true,'&');
+ $url = ml($file, '', true, '&');
$title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
// alternative content (just a link to the file)
- $fallback .= $this->internalmedia($file, $title, NULL, NULL, NULL, $cache=NULL, $linking='linkonly', $return=true);
+ $fallback .= $this->internalmedia($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);
}
// finish
@@ -1320,14 +1675,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
*
* @author Anika Henke <anika@selfthinker.org>
*
- * @param string $src - ID of audio to embed
- * @param array $atts - additional attributes for the <audio> tag
+ * @param string $src - ID of audio to embed
+ * @param array $atts - additional attributes for the <audio> tag
* @return string
*/
- function _audio($src,$atts=null){
+ function _audio($src, $atts = null) {
// prepare alternative formats
- $extensions = array('ogg', 'mp3', 'wav');
+ $extensions = array('ogg', 'mp3', 'wav');
$alternatives = media_alternativefiles($src, $extensions);
$out = '';
@@ -1337,12 +1692,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
// output source for each alternative audio format
foreach($alternatives as $mime => $file) {
- $url = ml($file,array('cache'=>$cache),true,'&');
+ $url = ml($file, '', true, '&');
$title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));
$out .= '<source src="'.hsc($url).'" type="'.$mime.'" />'.NL;
// alternative content (just a link to the file)
- $fallback .= $this->internalmedia($file, $title, NULL, NULL, NULL, $cache=NULL, $linking='linkonly', $return=true);
+ $fallback .= $this->internalmedia($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);
}
// finish
@@ -1351,6 +1706,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
return $out;
}
+ #endregion
}
//Setup VIM: ex: et ts=4 :
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 06bd6dbb8..9c2a0b570 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -112,8 +112,7 @@ function p_cached_output($file, $format='xhtml', $id='') {
} else {
$parsed = p_render($format, p_cached_instructions($file,false,$id), $info);
- if ($info['cache']) {
- $cache->storeCache($parsed); //save cachefile
+ 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";
}else{
$cache->removeCache(); //try to delete cachefile
@@ -636,9 +635,9 @@ function p_get_renderer($mode) {
return $Renderer;
}
- // not bundled, see if its an enabled plugin for rendering $mode
+ // not bundled, see if its an enabled renderer plugin & when $mode is 'xhtml', the renderer can supply that format.
$Renderer = $plugin_controller->load('renderer',$rname);
- if ($Renderer && is_a($Renderer, 'Doku_Renderer') && ($mode == $Renderer->getFormat())) {
+ if ($Renderer && is_a($Renderer, 'Doku_Renderer') && ($mode != 'xhtml' || $mode == $Renderer->getFormat())) {
return $Renderer;
}
@@ -660,7 +659,6 @@ function p_get_renderer($mode) {
}
// fallback failed, alert the world
- trigger_error("Unable to resolve render class $rclass",E_USER_WARNING);
msg("No renderer '$rname' found for mode '$mode'",-1);
return null;
}
diff --git a/inc/plugin.php b/inc/plugin.php
index 95bdaee2b..e0112ef56 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -252,10 +252,11 @@ class DokuWiki_Plugin {
*/
function __call($name, $arguments) {
if($name == 'render'){
+ dbg_deprecated('render_text()');
if(!isset($arguments[1])) $arguments[1] = 'xhtml';
return $this->render_text($arguments[0], $arguments[1]);
}
- trigger_error("no such method $name", E_ERROR);
+ trigger_error("no such method $name", E_USER_ERROR);
return null;
}
diff --git a/inc/search.php b/inc/search.php
index be4710237..5489dc2c0 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -317,25 +317,25 @@ function pathID($path,$keeptxt=false){
* How the function behaves, depends on the options passed in the $opts
* array, where the following settings can be used.
*
- * depth int recursion depth. 0 for unlimited
- * keeptxt bool keep .txt extension for IDs
- * listfiles bool include files in listing
- * listdirs bool include namespaces in listing
- * pagesonly bool restrict files to pages
- * skipacl bool do not check for READ permission
- * sneakyacl bool don't recurse into nonreadable dirs
- * hash bool create MD5 hash for files
- * meta bool return file metadata
- * filematch string match files against this regexp
- * idmatch string match full ID against this regexp
- * dirmatch string match directory against this regexp when adding
- * nsmatch string match namespace against this regexp when adding
- * recmatch string match directory against this regexp when recursing
- * showmsg bool warn about non-ID files
- * showhidden bool show hidden files too
- * firsthead bool return first heading for pages
+ * depth int recursion depth. 0 for unlimited (default: 0)
+ * keeptxt bool keep .txt extension for IDs (default: false)
+ * listfiles bool include files in listing (default: false)
+ * listdirs bool include namespaces in listing (default: false)
+ * pagesonly bool restrict files to pages (default: false)
+ * skipacl bool do not check for READ permission (default: false)
+ * sneakyacl bool don't recurse into nonreadable dirs (default: false)
+ * hash bool create MD5 hash for files (default: false)
+ * meta bool return file metadata (default: false)
+ * filematch string match files against this regexp (default: '', so accept everything)
+ * idmatch string match full ID against this regexp (default: '', so accept everything)
+ * dirmatch string match directory against this regexp when adding (default: '', so accept everything)
+ * nsmatch string match namespace against this regexp when adding (default: '', so accept everything)
+ * recmatch string match directory against this regexp when recursing (default: '', so accept everything)
+ * showmsg bool warn about non-ID files (default: false)
+ * showhidden bool show hidden files(e.g. by hidepages config) too (default: false)
+ * firsthead bool return first heading for pages (default: false)
*
- * @param array &$data - Reference to the result data structure
+ * @param array &$data - Reference to the result data structure
* @param string $base - Base usually $conf['datadir']
* @param string $file - current file or directory relative to $base
* @param string $type - Type either 'd' for directory or 'f' for file
diff --git a/inc/subscription.php b/inc/subscription.php
index 298e7c12b..aab6de926 100644
--- a/inc/subscription.php
+++ b/inc/subscription.php
@@ -650,9 +650,11 @@ class Subscription {
* @todo move the whole functionality into this class, trigger SUBSCRIPTION_NOTIFY_ADDRESSLIST instead,
* use an array for the addresses within it
*
- * @param array &$data Containing $id (the page id), $self (whether the author
- * should be notified, $addresslist (current email address
- * list)
+ * @param array &$data Containing the entries:
+ * - $id (the page id),
+ * - $self (whether the author should be notified,
+ * - $addresslist (current email address list)
+ * - $replacements (array of additional string substitutions, @KEY@ to be replaced by value)
*/
public function notifyaddresses(&$data) {
if(!$this->isenabled()) return;
@@ -700,6 +702,7 @@ class Subscription {
* @deprecated 2012-12-07
*/
function subscription_addresslist(&$data) {
+ dbg_deprecated('class Subscription');
$sub = new Subscription();
$sub->notifyaddresses($data);
}
diff --git a/inc/template.php b/inc/template.php
index 8bd3234cc..35b54b4c3 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -318,15 +318,17 @@ function tpl_metaheaders($alt = true) {
}
if($alt) {
- $head['link'][] = array(
- 'rel' => 'alternate', 'type'=> 'application/rss+xml',
- 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php'
- );
- $head['link'][] = array(
- 'rel' => 'alternate', 'type'=> 'application/rss+xml',
- 'title'=> $lang['currentns'],
- 'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']
- );
+ if(actionOK('rss')) {
+ $head['link'][] = array(
+ 'rel' => 'alternate', 'type'=> 'application/rss+xml',
+ 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php'
+ );
+ $head['link'][] = array(
+ 'rel' => 'alternate', 'type'=> 'application/rss+xml',
+ 'title'=> $lang['currentns'],
+ 'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']
+ );
+ }
if(($ACT == 'show' || $ACT == 'search') && $INFO['writable']) {
$head['link'][] = array(
'rel' => 'edit',
@@ -335,7 +337,7 @@ function tpl_metaheaders($alt = true) {
);
}
- if($ACT == 'search') {
+ if(actionOK('rss') && $ACT == 'search') {
$head['link'][] = array(
'rel' => 'alternate', 'type'=> 'application/rss+xml',
'title'=> $lang['searchresult'],
@@ -1042,7 +1044,7 @@ function tpl_img_getTag($tags, $alt = '', $src = null) {
static $meta = null;
if(is_null($meta)) $meta = new JpegMeta($src);
if($meta === false) return $alt;
- $info = $meta->getField($tags);
+ $info = cleanText($meta->getField($tags));
if($info == false) return $alt;
return $info;
}