diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-02 21:00:08 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-02 21:00:08 +0000 |
commit | f327a5f0a9ef72e6dd79d9d200f81c330aa4903c (patch) | |
tree | 2d2a398218964e3bee0876385f9c8786a3baf8de /inc | |
parent | 446b5b5934799f1f906ea8903b1e96c981f1c1b2 (diff) | |
parent | 709fd92548efedbd4b4e5693097165d1dff072e4 (diff) | |
download | rpg-f327a5f0a9ef72e6dd79d9d200f81c330aa4903c.tar.gz rpg-f327a5f0a9ef72e6dd79d9d200f81c330aa4903c.tar.bz2 |
Merge branch 'master' into FS#2388
Diffstat (limited to 'inc')
41 files changed, 463 insertions, 245 deletions
diff --git a/inc/EmailAddressValidator.php b/inc/EmailAddressValidator.php index bb4ef0ca9..fd6f3275b 100644 --- a/inc/EmailAddressValidator.php +++ b/inc/EmailAddressValidator.php @@ -15,8 +15,8 @@ class EmailAddressValidator { /** * Check email address validity - * @param strEmailAddress Email address to be checked - * @return True if email is valid, false if not + * @param string $strEmailAddress Email address to be checked + * @return bool True if email is valid, false if not */ public function check_email_address($strEmailAddress) { @@ -82,8 +82,8 @@ class EmailAddressValidator { /** * Checks email section before "@" symbol for validity - * @param strLocalPortion Text to be checked - * @return True if local portion is valid, false if not + * @param string $strLocalPortion Text to be checked + * @return bool True if local portion is valid, false if not */ protected function check_local_portion($strLocalPortion) { // Local portion can only be from 1 to 64 characters, inclusive. @@ -113,8 +113,8 @@ class EmailAddressValidator { /** * Checks email section after "@" symbol for validity - * @param strDomainPortion Text to be checked - * @return True if domain portion is valid, false if not + * @param string $strDomainPortion Text to be checked + * @return bool True if domain portion is valid, false if not */ protected function check_domain_portion($strDomainPortion) { // Total domain can only be from 1 to 255 characters, inclusive @@ -172,10 +172,10 @@ class EmailAddressValidator { /** * Check given text length is between defined bounds - * @param strText Text to be checked - * @param intMinimum Minimum acceptable length - * @param intMaximum Maximum acceptable length - * @return True if string is within bounds (inclusive), false if not + * @param string $strText Text to be checked + * @param int $intMinimum Minimum acceptable length + * @param int $intMaximum Maximum acceptable length + * @return bool True if string is within bounds (inclusive), false if not */ protected function check_text_length($strText, $intMinimum, $intMaximum) { // Minimum and maximum are both inclusive diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php index de3a16830..53f3c9a78 100644 --- a/inc/HTTPClient.php +++ b/inc/HTTPClient.php @@ -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) { - '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/Mailer.class.php b/inc/Mailer.class.php index 2ac2c1d60..e32178bba 100644 --- a/inc/Mailer.class.php +++ b/inc/Mailer.class.php @@ -277,7 +277,7 @@ class Mailer { /** * Add the To: recipients * - * @see setAddress + * @see cleanAddress * @param string|array $address Multiple adresses separated by commas or as array */ public function to($address) { @@ -287,7 +287,7 @@ class Mailer { /** * Add the Cc: recipients * - * @see setAddress + * @see cleanAddress * @param string|array $address Multiple adresses separated by commas or as array */ public function cc($address) { @@ -297,7 +297,7 @@ class Mailer { /** * Add the Bcc: recipients * - * @see setAddress + * @see cleanAddress * @param string|array $address Multiple adresses separated by commas or as array */ public function bcc($address) { @@ -310,7 +310,7 @@ class Mailer { * This is set to $conf['mailfrom'] when not specified so you shouldn't need * to call this function * - * @see setAddress + * @see cleanAddress * @param string $address from address */ public function from($address) { @@ -333,9 +333,9 @@ class Mailer { * for headers. Addresses may not contain Non-ASCII data! * * Example: - * setAddress("föö <foo@bar.com>, me@somewhere.com","TBcc"); + * cc("föö <foo@bar.com>, me@somewhere.com","TBcc"); * - * @param string|array $address Multiple adresses separated by commas or as array + * @param string|array $addresses Multiple adresses separated by commas or as array * @return bool|string the prepared header (can contain multiple lines) */ public function cleanAddress($addresses) { @@ -522,7 +522,7 @@ class Mailer { // clean up addresses if(empty($this->headers['From'])) $this->from($conf['mailfrom']); - $addrs = array('To', 'From', 'Cc', 'Bcc'); + $addrs = array('To', 'From', 'Cc', 'Bcc', 'Reply-To', 'Sender'); foreach($addrs as $addr) { if(isset($this->headers[$addr])) { $this->headers[$addr] = $this->cleanAddress($this->headers[$addr]); diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php index bf89a311c..6332746a6 100644 --- a/inc/Sitemapper.php +++ b/inc/Sitemapper.php @@ -131,9 +131,9 @@ class Sitemapper { $encoded_sitemap_url = urlencode(wl('', array('do' => 'sitemap'), true, '&')); $ping_urls = array( - 'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap='.$encoded_sitemap_url, - 'yahoo' => 'http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=dokuwiki&url='.$encoded_sitemap_url, + 'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap='.$encoded_sitemap_url, 'microsoft' => 'http://www.bing.com/webmaster/ping.aspx?siteMap='.$encoded_sitemap_url, + 'yandex' => 'http://blogs.yandex.ru/pings/?status=success&url='.$encoded_sitemap_url ); $data = array('ping_urls' => $ping_urls, diff --git a/inc/auth.php b/inc/auth.php index 6000ea6d7..8fde129aa 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -845,6 +845,12 @@ function auth_nameencode($name, $skip_group = false) { return $cache[$name][$skip_group]; } +/** + * callback encodes the matches + * + * @param array $matches first complete match, next matching subpatterms + * @return string + */ function auth_nameencode_callback($matches) { return '%'.dechex(ord(substr($matches[1],-1))); } @@ -1075,6 +1081,11 @@ function updateprofile() { return false; } +/** + * Delete the current logged-in user + * + * @return bool true on success, false on any error + */ function auth_deleteprofile(){ global $conf; global $lang; diff --git a/inc/cache.php b/inc/cache.php index 5eac94934..5f54a34a9 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -8,16 +8,24 @@ if(!defined('DOKU_INC')) die('meh.'); +/** + * Generic handling of caching + */ class cache { - var $key = ''; // primary identifier for this item - var $ext = ''; // file ext for cache data, secondary identifier for this item - var $cache = ''; // cache file name - var $depends = array(); // array containing cache dependency information, + public $key = ''; // primary identifier for this item + 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 var $_event = ''; // event to be triggered during useCache + var $_time; - function cache($key,$ext) { + /** + * @param string $key primary identifier + * @param string $ext file extension + */ + public function cache($key,$ext) { $this->key = $key; $this->ext = $ext; $this->cache = getCacheName($key,$ext); @@ -36,7 +44,7 @@ class cache { * * @return bool true if cache can be used, false otherwise */ - function useCache($depends=array()) { + public function useCache($depends=array()) { $this->depends = $depends; $this->_addDependencies(); @@ -59,7 +67,7 @@ class cache { * * @return bool see useCache() */ - function _useCache() { + protected function _useCache() { if (!empty($this->depends['purge'])) return false; // purge requested? if (!($this->_time = @filemtime($this->cache))) return false; // cache exists? @@ -83,7 +91,7 @@ class cache { * it should not remove any existing dependencies and * it should only overwrite a dependency when the new value is more stringent than the old */ - function _addDependencies() { + protected function _addDependencies() { global $INPUT; if ($INPUT->has('purge')) $this->depends['purge'] = true; // purge requested } @@ -94,7 +102,7 @@ class cache { * @param bool $clean true to clean line endings, false to leave line endings alone * @return string cache contents */ - function retrieveCache($clean=true) { + public function retrieveCache($clean=true) { return io_readFile($this->cache, $clean); } @@ -104,14 +112,14 @@ class cache { * @param string $data the data to be cached * @return bool true on success, false otherwise */ - function storeCache($data) { + public function storeCache($data) { return io_savefile($this->cache, $data); } /** * remove any cached data associated with this cache instance */ - function removeCache() { + public function removeCache() { @unlink($this->cache); } @@ -122,7 +130,7 @@ class cache { * @param bool $success result of this cache use attempt * @return bool pass-thru $success value */ - function _stats($success) { + protected function _stats($success) { global $conf; static $stats = null; static $file; @@ -157,14 +165,23 @@ class cache { } } +/** + * Parser caching + */ class cache_parser extends cache { - var $file = ''; // source file for cache - var $mode = ''; // input mode (represents the processing the input file will undergo) + public $file = ''; // source file for cache + public $mode = ''; // input mode (represents the processing the input file will undergo) var $_event = 'PARSER_CACHE_USE'; - function cache_parser($id, $file, $mode) { + /** + * + * @param string $id page id + * @param string $file source file for cache + * @param string $mode input mode + */ + public function cache_parser($id, $file, $mode) { if ($id) $this->page = $id; $this->file = $file; $this->mode = $mode; @@ -172,24 +189,29 @@ class cache_parser extends cache { parent::cache($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode); } - function _useCache() { + /** + * method contains cache use decision logic + * + * @return bool see useCache() + */ + protected function _useCache() { if (!@file_exists($this->file)) return false; // source exists? return parent::_useCache(); } - function _addDependencies() { - global $conf, $config_cascade; + 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 + $files = array($this->file, // ... source DOKU_INC.'inc/parser/parser.php', // ... parser DOKU_INC.'inc/parser/handler.php', // ... handler ); - $files = array_merge($files, getConfigFiles('main')); // ... wiki settings + $files = array_merge($files, getConfigFiles('main')); // ... wiki settings $this->depends['files'] = !empty($this->depends['files']) ? array_merge($files, $this->depends['files']) : $files; parent::_addDependencies(); @@ -197,8 +219,17 @@ class cache_parser extends cache { } +/** + * Caching of data of renderer + */ class cache_renderer extends cache_parser { - function _useCache() { + + /** + * method contains cache use decision logic + * + * @return bool see useCache() + */ + protected function _useCache() { global $conf; if (!parent::_useCache()) return false; @@ -231,7 +262,7 @@ class cache_renderer extends cache_parser { return true; } - function _addDependencies() { + protected function _addDependencies() { // renderer cache file dependencies ... $files = array( @@ -253,18 +284,37 @@ class cache_renderer extends cache_parser { } } +/** + * Caching of parser instructions + */ class cache_instructions extends cache_parser { - function cache_instructions($id, $file) { + /** + * @param string $id page id + * @param string $file source file for cache + */ + public function cache_instructions($id, $file) { parent::cache_parser($id, $file, 'i'); } - function retrieveCache($clean=true) { + /** + * retrieve the cached data + * + * @param bool $clean true to clean line endings, false to leave line endings alone + * @return string cache contents + */ + public function retrieveCache($clean=true) { $contents = io_readFile($this->cache, false); return !empty($contents) ? unserialize($contents) : array(); } - function storeCache($instructions) { + /** + * cache $instructions + * + * @param string $instructions the instruction to be cached + * @return bool true on success, false otherwise + */ + public function storeCache($instructions) { return io_savefile($this->cache,serialize($instructions)); } } diff --git a/inc/cliopts.php b/inc/cliopts.php index 9cea686a2..3eac72e5b 100644 --- a/inc/cliopts.php +++ b/inc/cliopts.php @@ -74,9 +74,9 @@ class Doku_Cli_Opts { /** * <?php ?> * @see http://www.sitepoint.com/article/php-command-line-1/3 - * @param string executing file name - this MUST be passed the __FILE__ constant - * @param string short options - * @param array (optional) long options + * @param string $bin_file executing file name - this MUST be passed the __FILE__ constant + * @param string $short_options short options + * @param array $long_options (optional) long options * @return Doku_Cli_Opts_Container or Doku_Cli_Opts_Error */ function & getOptions($bin_file, $short_options, $long_options = null) { @@ -233,12 +233,12 @@ class Doku_Cli_Opts { * Parse short option * * @param string $arg Argument - * @param string[] $short_options Available short options + * @param string $short_options Available short options * @param string[][] &$opts * @param string[] &$args * * @access private - * @return void + * @return void|Doku_Cli_Opts_Error */ function _parseShortOption($arg, $short_options, &$opts, &$args) { $len = strlen($arg); @@ -324,7 +324,7 @@ class Doku_Cli_Opts { * @param string[] &$args * * @access private - * @return void|PEAR_Error + * @return void|Doku_Cli_Opts_Error */ function _parseLongOption($arg, $long_options, &$opts, &$args) { @list($opt, $opt_arg) = explode('=', $arg, 2); @@ -402,7 +402,7 @@ class Doku_Cli_Opts { * Will take care on register_globals and register_argc_argv ini directives * * @access public - * @return mixed the $argv PHP array or PEAR error if not registered + * @return array|Doku_Cli_Opts_Error the $argv PHP array or PEAR error if not registered */ function readPHPArgv() { global $argv; @@ -421,10 +421,19 @@ class Doku_Cli_Opts { return $argv; } + /** + * @param $code + * @param $msg + * @return Doku_Cli_Opts_Error + */ function raiseError($code, $msg) { return new Doku_Cli_Opts_Error($code, $msg); } + /** + * @param $obj + * @return bool + */ function isError($obj) { return is_a($obj, 'Doku_Cli_Opts_Error'); } diff --git a/inc/common.php b/inc/common.php index 32771285b..9a53ee526 100644 --- a/inc/common.php +++ b/inc/common.php @@ -155,12 +155,13 @@ function pageinfo() { $info['subscribed'] = false; } - $info['locked'] = checklock($ID); - $info['filepath'] = fullpath(wikiFN($ID)); - $info['exists'] = @file_exists($info['filepath']); + $info['locked'] = checklock($ID); + $info['filepath'] = fullpath(wikiFN($ID)); + $info['exists'] = @file_exists($info['filepath']); + $info['currentrev'] = @filemtime($info['filepath']); if($REV) { //check if current revision was meant - if($info['exists'] && (@filemtime($info['filepath']) == $REV)) { + if($info['exists'] && ($info['currentrev'] == $REV)) { $REV = ''; } elseif($RANGE) { //section editing does not work with old revisions! @@ -1140,7 +1141,6 @@ function saveWikiText($id, $text, $summary, $minor = false) { * @author Andreas Gohr <andi@splitbrain.org> */ function saveOldRevision($id) { - global $conf; $oldf = wikiFN($id); if(!@file_exists($oldf)) return ''; $date = filemtime($oldf); @@ -1230,8 +1230,9 @@ function getGoogleQuery() { /** * Return the human readable size of a file * - * @param int $size A file size - * @param int $dec A number of decimal places + * @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 @@ -1362,12 +1363,16 @@ function php_to_byte($v) { $l = substr($v, -1); $ret = substr($v, 0, -1); switch(strtoupper($l)) { + /** @noinspection PhpMissingBreakStatementInspection */ case 'P': $ret *= 1024; + /** @noinspection PhpMissingBreakStatementInspection */ case 'T': $ret *= 1024; + /** @noinspection PhpMissingBreakStatementInspection */ case 'G': $ret *= 1024; + /** @noinspection PhpMissingBreakStatementInspection */ case 'M': $ret *= 1024; case 'K': diff --git a/inc/confutils.php b/inc/confutils.php index 0ac003b72..31371d41f 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -237,13 +237,14 @@ function getConfigFiles($type) { * check if the given action was disabled in config * * @author Andreas Gohr <andi@splitbrain.org> + * @param string $action * @returns boolean true if enabled, false if disabled */ function actionOK($action){ static $disabled = null; if(is_null($disabled) || defined('SIMPLE_TEST')){ global $conf; - /** @var auth_basic $auth */ + /** @var DokuWiki_Auth_Plugin $auth */ global $auth; // prepare disabled actions array and handle legacy options diff --git a/inc/events.php b/inc/events.php index f7b1a7a16..7f9824f60 100644 --- a/inc/events.php +++ b/inc/events.php @@ -8,15 +8,18 @@ if(!defined('DOKU_INC')) die('meh.'); +/** + * The event + */ class Doku_Event { // public properties - var $name = ''; // READONLY event name, objects must register against this name to see the event - var $data = null; // READWRITE data relevant to the event, no standardised format (YET!) - var $result = null; // READWRITE the results of the event action, only relevant in "_AFTER" advise + public $name = ''; // READONLY event name, objects must register against this name to see the event + public $data = null; // READWRITE data relevant to the event, no standardised format (YET!) + public $result = null; // READWRITE the results of the event action, only relevant in "_AFTER" advise // event handlers may modify this if they are preventing the default action // to provide the after event handlers with event results - var $canPreventDefault = true; // READONLY if true, event handlers can prevent the events default action + public $canPreventDefault = true; // READONLY if true, event handlers can prevent the events default action // private properties, event handlers can effect these through the provided methods var $_default = true; // whether or not to carry out the default action associated with the event @@ -33,6 +36,13 @@ class Doku_Event { } /** + * @return string + */ + function __toString() { + return $this->name; + } + + /** * advise functions * * advise all registered handlers of this event @@ -47,7 +57,8 @@ class Doku_Event { * $evt->advise_after(); * unset($evt); * - * @return results of processing the event, usually $this->_default + * @param bool $enablePreventDefault + * @return bool results of processing the event, usually $this->_default */ function advise_before($enablePreventDefault=true) { global $EVENT_HANDLER; @@ -73,7 +84,9 @@ class Doku_Event { * $this->_default, all of which may have been modified by the event handlers. * - advise all registered (<event>_AFTER) handlers that the event has taken place * - * @return $event->results + * @param null|callable $action + * @param bool $enablePrevent + * @return mixed $event->results * the value set by any <event>_before or <event> handlers if the default action is prevented * or the results of the default action (as modified by <event>_after handlers) * or NULL no action took place and no handler modified the value @@ -112,12 +125,15 @@ class Doku_Event { function preventDefault() { $this->_default = false; } } +/** + * Controls the registration and execution of all events, + */ class Doku_Event_Handler { // public properties: none // private properties - var $_hooks = array(); // array of events and their registered handlers + protected $_hooks = array(); // array of events and their registered handlers /** * event_handler @@ -128,6 +144,7 @@ class Doku_Event_Handler { function Doku_Event_Handler() { // load action plugins + /** @var DokuWiki_Action_Plugin $plugin */ $plugin = null; $pluginlist = plugin_list('action'); @@ -143,34 +160,47 @@ class Doku_Event_Handler { * * register a hook for an event * - * @param $event (string) name used by the event, (incl '_before' or '_after' for triggers) - * @param $obj (obj) object in whose scope method is to be executed, + * @param $event string name used by the event, (incl '_before' or '_after' for triggers) + * @param $advise string + * @param $obj object object in whose scope method is to be executed, * if NULL, method is assumed to be a globally available function - * @param $method (function) event handler function - * @param $param (mixed) data passed to the event handler + * @param $method string event handler function + * @param $param mixed data passed to the event handler + * @param $seq int sequence number for ordering hook execution (ascending) */ - function register_hook($event, $advise, $obj, $method, $param=null) { - $this->_hooks[$event.'_'.$advise][] = array($obj, $method, $param); + function register_hook($event, $advise, $obj, $method, $param=null, $seq=0) { + $seq = (int)$seq; + $doSort = !isset($this->_hooks[$event.'_'.$advise][$seq]); + $this->_hooks[$event.'_'.$advise][$seq][] = array($obj, $method, $param); + + if ($doSort) { + ksort($this->_hooks[$event.'_'.$advise]); + } } - function process_event(&$event,$advise='') { + /** + * process the before/after event + * + * @param Doku_Event $event + * @param string $advise BEFORE or AFTER + */ + function process_event($event,$advise='') { $evt_name = $event->name . ($advise ? '_'.$advise : '_BEFORE'); if (!empty($this->_hooks[$evt_name])) { - foreach ($this->_hooks[$evt_name] as $hook) { - // list($obj, $method, $param) = $hook; - $obj =& $hook[0]; - $method = $hook[1]; - $param = $hook[2]; - - if (is_null($obj)) { - $method($event, $param); - } else { - $obj->$method($event, $param); - } + foreach ($this->_hooks[$evt_name] as $sequenced_hooks) { + foreach ($sequenced_hooks as $hook) { + list($obj, $method, $param) = $hook; - if (!$event->_continue) break; + if (is_null($obj)) { + $method($event, $param); + } else { + $obj->$method($event, $param); + } + + if (!$event->_continue) return; + } } } } @@ -181,12 +211,12 @@ class Doku_Event_Handler { * * function wrapper to process (create, trigger and destroy) an event * - * @param $name (string) name for the event - * @param $data (mixed) event data - * @param $action (callback) (optional, default=NULL) default action, a php callback function - * @param $canPreventDefault (bool) (optional, default=true) can hooks prevent the default action + * @param $name string name for the event + * @param $data mixed event data + * @param $action callback (optional, default=NULL) default action, a php callback function + * @param $canPreventDefault bool (optional, default=true) can hooks prevent the default action * - * @return (mixed) the event results value after all event processing is complete + * @return mixed the event results value after all event processing is complete * by default this is the return value of the default action however * it can be set or modified by event handler hooks */ diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php index 670a1bc29..b90da5724 100644 --- a/inc/feedcreator.class.php +++ b/inc/feedcreator.class.php @@ -185,6 +185,8 @@ class HtmlDescribable { */ var $descriptionTruncSize; + var $description; + /** * Returns a formatted description field, depending on descriptionHtmlSyndicated and * $descriptionTruncSize properties @@ -222,7 +224,7 @@ class FeedHtmlField { /** * Creates a new instance of FeedHtmlField. - * @param $string: if given, sets the rawFieldContent property + * @param string $parFieldContent: if given, sets the rawFieldContent property */ function FeedHtmlField($parFieldContent) { if ($parFieldContent) { @@ -267,8 +269,14 @@ class FeedHtmlField { * @author Kai Blankenhorn <kaib@bitfolge.de> */ class UniversalFeedCreator extends FeedCreator { + /** @var FeedCreator */ var $_feed; + /** + * Sets format + * + * @param string $format + */ function _setFormat($format) { switch (strtoupper($format)) { @@ -344,7 +352,7 @@ class UniversalFeedCreator extends FeedCreator { * Creates a syndication feed based on the items previously added. * * @see FeedCreator::addItem() - * @param string format format the feed should comply to. Valid values are: + * @param string $format format the feed should comply to. Valid values are: * "PIE0.1", "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3", "HTML", "JS" * @return string the contents of the feed. */ @@ -358,10 +366,10 @@ class UniversalFeedCreator extends FeedCreator { * header may be sent to redirect the use to the newly created file. * @since 1.4 * - * @param string format format the feed should comply to. Valid values are: + * @param string $format format the feed should comply to. Valid values are: * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM", "ATOM0.3", "HTML", "JS" - * @param string filename optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). - * @param boolean displayContents optional send the content of the file or not. If true, the file will be sent in the body of the response. + * @param string $filename optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param boolean $displayContents optional send the content of the file or not. If true, the file will be sent in the body of the response. */ function saveFeed($format="RSS0.91", $filename="", $displayContents=true) { $this->_setFormat($format); @@ -376,10 +384,10 @@ class UniversalFeedCreator extends FeedCreator { * before anything else, especially before you do the time consuming task to build the feed * (web fetching, for example). * - * @param string format format the feed should comply to. Valid values are: + * @param string $format format the feed should comply to. Valid values are: * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3". - * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). - * @param timeout int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour) + * @param string $filename optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param int $timeout optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour) */ function useCached($format="RSS0.91", $filename="", $timeout=3600) { $this->_setFormat($format); @@ -390,7 +398,7 @@ class UniversalFeedCreator extends FeedCreator { /** * Outputs feed to the browser - needed for on-the-fly feed generation (like it is done in WordPress, etc.) * - * @param format string format the feed should comply to. Valid values are: + * @param $format string format the feed should comply to. Valid values are: * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3". */ function outputFeed($format='RSS0.91') { @@ -422,7 +430,13 @@ class FeedCreator extends HtmlDescribable { /** * Optional attributes of a feed. */ - var $syndicationURL, $image, $language, $copyright, $pubDate, $lastBuildDate, $editor, $editorEmail, $webmaster, $category, $docs, $ttl, $rating, $skipHours, $skipDays; + var $syndicationURL, $language, $copyright, $pubDate, $lastBuildDate, $editor, $editorEmail, $webmaster, $category, $docs, $ttl, $rating, $skipHours, $skipDays; + /** + * Optional attribute of a feed + * + * @var FeedImage + */ + var $image = null; /** * The url of the external xsl stylesheet used to format the naked rss feed. @@ -430,13 +444,18 @@ class FeedCreator extends HtmlDescribable { */ var $xslStyleSheet = ""; + /** + * Style sheet for rss feed + */ + var $cssStyleSheet = ""; + /** * @access private + * @var FeedItem[] */ var $items = Array(); - /** * This feed's MIME content type. * @since 1.4 @@ -466,7 +485,7 @@ class FeedCreator extends HtmlDescribable { /** * Adds an FeedItem to the feed. * - * @param object FeedItem $item The FeedItem to add to the feed. + * @param FeedItem $item The FeedItem to add to the feed. * @access public */ function addItem($item) { @@ -482,8 +501,8 @@ class FeedCreator extends HtmlDescribable { * If the string is already shorter than $length, it is returned unchanged. * * @static - * @param string string A string to be truncated. - * @param int length the maximum length the string should be truncated to + * @param string $string A string to be truncated. + * @param int $length the maximum length the string should be truncated to * @return string the truncated string */ function iTrunc($string, $length) { @@ -527,8 +546,8 @@ class FeedCreator extends HtmlDescribable { /** * Creates a string containing all additional elements specified in * $additionalElements. - * @param elements array an associative array containing key => value pairs - * @param indentString string a string that will be inserted before every generated line + * @param $elements array an associative array containing key => value pairs + * @param $indentString string a string that will be inserted before every generated line * @return string the XML tags corresponding to $additionalElements */ function _createAdditionalElements($elements, $indentString="") { @@ -541,6 +560,9 @@ class FeedCreator extends HtmlDescribable { return $ae; } + /** + * Create elements for stylesheets + */ function _createStylesheetReferences() { $xml = ""; if ($this->cssStyleSheet) $xml .= "<?xml-stylesheet href=\"".$this->cssStyleSheet."\" type=\"text/css\"?>\n"; @@ -610,8 +632,8 @@ class FeedCreator extends HtmlDescribable { * before anything else, especially before you do the time consuming task to build the feed * (web fetching, for example). * @since 1.4 - * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). - * @param timeout int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour) + * @param $filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param $timeout int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour) */ function useCached($filename="", $timeout=3600) { $this->_timeout = $timeout; @@ -629,8 +651,8 @@ class FeedCreator extends HtmlDescribable { * header may be sent to redirect the user to the newly created file. * @since 1.4 * - * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). - * @param redirect boolean optional send an HTTP redirect header or not. If true, the user will be automatically redirected to the created file. + * @param $filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param $displayContents boolean optional send an HTTP redirect header or not. If true, the user will be automatically redirected to the created file. */ function saveFeed($filename="", $displayContents=true) { if ($filename=="") { @@ -667,6 +689,7 @@ class FeedCreator extends HtmlDescribable { * Usually, you won't need to use this. */ class FeedDate { + /** @var int */ var $unix; /** @@ -726,7 +749,7 @@ class FeedDate { /** * Gets the date stored in this FeedDate as an RFC 822 date. * - * @return a date in RFC 822 format + * @return string a date in RFC 822 format */ function rfc822() { //return gmdate("r",$this->unix); @@ -738,7 +761,7 @@ class FeedDate { /** * Gets the date stored in this FeedDate as an ISO 8601 date. * - * @return a date in ISO 8601 (RFC 3339) format + * @return string a date in ISO 8601 (RFC 3339) format */ function iso8601() { $date = gmdate("Y-m-d\TH:i:sO",$this->unix); @@ -751,7 +774,7 @@ class FeedDate { /** * Gets the date stored in this FeedDate as unix time stamp. * - * @return a date as a unix time stamp + * @return int a date as a unix time stamp */ function unix() { return $this->unix; @@ -777,7 +800,7 @@ class RSSCreator10 extends FeedCreator { $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; $feed.= $this->_createGeneratorComment(); if ($this->cssStyleSheet=="") { - $cssStyleSheet = "http://www.w3.org/2000/08/w3c-synd/style.css"; + $this->cssStyleSheet = "http://www.w3.org/2000/08/w3c-synd/style.css"; } $feed.= $this->_createStylesheetReferences(); $feed.= "<rdf:RDF\n"; @@ -1032,12 +1055,16 @@ class PIECreator01 extends FeedCreator { $this->encoding = "utf-8"; } + /** + * Build content + * @return string + */ function createFeed() { $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; $feed.= $this->_createStylesheetReferences(); $feed.= "<feed version=\"0.1\" xmlns=\"http://example.com/newformat#\">\n"; $feed.= " <title>".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."</title>\n"; - $this->truncSize = 500; + $this->descriptionTruncSize = 500; $feed.= " <subtitle>".$this->getDescription()."</subtitle>\n"; $feed.= " <link>".$this->link."</link>\n"; $icnt = count($this->items); @@ -1091,6 +1118,10 @@ class AtomCreator10 extends FeedCreator { $this->encoding = "utf-8"; } + /** + * Build content + * @return string + */ function createFeed() { $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; $feed.= $this->_createGeneratorComment(); @@ -1174,6 +1205,10 @@ class AtomCreator03 extends FeedCreator { $this->encoding = "utf-8"; } + /** + * Build content + * @return string + */ function createFeed() { $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; $feed.= $this->_createGeneratorComment(); @@ -1281,6 +1316,7 @@ class MBOXCreator extends FeedCreator { */ function createFeed() { $icnt = count($this->items); + $feed = ""; for ($i=0; $i<$icnt; $i++) { if ($this->items[$i]->author!="") { $from = $this->items[$i]->author; @@ -1331,6 +1367,10 @@ class OPMLCreator extends FeedCreator { $this->encoding = "utf-8"; } + /** + * Build content + * @return string + */ function createFeed() { $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; $feed.= $this->_createGeneratorComment(); @@ -1441,6 +1481,7 @@ class HTMLCreator extends FeedCreator { } //set an openInNewWindow_token_to be inserted or not + $targetInsert = ""; if ($this->openInNewWindow) { $targetInsert = " target='_blank'"; } @@ -1568,6 +1609,14 @@ class JSCreator extends HTMLCreator { * @author Andreas Gohr <andi@splitbrain.org> */ class DokuWikiFeedCreator extends UniversalFeedCreator{ + + /** + * Build content + * + * @param string $format + * @param string $encoding + * @return string + */ function createFeed($format = "RSS0.91",$encoding='iso-8859-15') { $this->_setFormat($format); $this->_feed->encoding = $encoding; diff --git a/inc/form.php b/inc/form.php index 312c42b60..610f50200 100644 --- a/inc/form.php +++ b/inc/form.php @@ -47,15 +47,11 @@ class Doku_Form { * with up to four parameters is deprecated, instead the first parameter * should be an array with parameters. * - * @param mixed $params Parameters for the HTML form element; Using the - * deprecated calling convention this is the ID - * attribute of the form - * @param string $action (optional, deprecated) submit URL, defaults to - * current page - * @param string $method (optional, deprecated) 'POST' or 'GET', default - * is POST - * @param string $enctype (optional, deprecated) Encoding type of the - * data + * @param mixed $params Parameters for the HTML form element; Using the deprecated + * calling convention this is the ID attribute of the form + * @param bool|string $action (optional, deprecated) submit URL, defaults to current page + * @param bool|string $method (optional, deprecated) 'POST' or 'GET', default is POST + * @param bool|string $enctype (optional, deprecated) Encoding type of the data * @author Tom N Harris <tnharris@whoopdedo.org> */ function Doku_Form($params, $action=false, $method=false, $enctype=false) { @@ -230,7 +226,7 @@ class Doku_Form { * first (underflow) or last (overflow) element. * * @param int $pos 0-based index - * @return arrayreference pseudo-element + * @return array reference pseudo-element * @author Tom N Harris <tnharris@whoopdedo.org> */ function &getElementAt($pos) { diff --git a/inc/fulltext.php b/inc/fulltext.php index bd8e6b866..dd918f214 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -72,8 +72,20 @@ function _ft_pageSearch(&$data) { $pages = end($stack); $pages_matched = array(); foreach(array_keys($pages) as $id){ - $text = utf8_strtolower(rawWiki($id)); - if (strpos($text, $phrase) !== false) { + $evdata = array( + 'id' => $id, + 'phrase' => $phrase, + 'text' => rawWiki($id) + ); + $evt = new Doku_Event('FULLTEXT_PHRASE_MATCH',$evdata); + if ($evt->advise_before() && $evt->result !== true) { + $text = utf8_strtolower($evdata['text']); + if (strpos($text, $phrase) !== false) { + $evt->result = true; + } + } + $evt->advise_after(); + if ($evt->result === true) { $pages_matched[$id] = 0; // phrase: always 0 hit } } @@ -333,7 +345,7 @@ function ft_snippet($id,$highlight){ $pre = min($pre,100-$post); } else if ($post>50) { $post = min($post, 100-$pre); - } else { + } else if ($offset == 0) { // both are less than 50, means the context is the whole string // make it so and break out of this loop - there is no need for the // complex snippet calculations @@ -354,12 +366,12 @@ function ft_snippet($id,$highlight){ } // set $offset for next match attempt - // substract strlen to avoid splitting a potential search success, - // this is an approximation as the search pattern may match strings - // of varying length and it will fail if the context snippet - // boundary breaks a matching string longer than the current match - $utf8_offset = $utf8_idx + $post; - $offset = $idx + strlen(utf8_substr($text,$utf8_idx,$post)); + // continue matching after the current match + // if the current match is not the longest possible match starting at the current offset + // this prevents further matching of this snippet but for possible matches of length + // smaller than match length + context (at least 50 characters) this match is part of the context + $utf8_offset = $utf8_idx + $utf8_len; + $offset = $idx + strlen(utf8_substr($text,$utf8_idx,$utf8_len)); $offset = utf8_correctIdx($text,$offset); } diff --git a/inc/html.php b/inc/html.php index 928991ae2..fcec29670 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1189,7 +1189,7 @@ function html_diff($text='',$intro=true,$type=null){ $diffurl = wl($ID, array( 'do' => 'diff', 'rev2[0]' => $l_rev, - 'rev2[1]' => $r_rev, + 'rev2[1]' => $r_rev ? $r_rev : $INFO['currentrev'], // link to exactly this view FS#2835 'difftype' => $type, )); ptln('<p><a class="wikilink1" href="'.$diffurl.'">'.$lang['difflink'].'</a></p>'); diff --git a/inc/httputils.php b/inc/httputils.php index d6532720f..efeb2a56c 100644 --- a/inc/httputils.php +++ b/inc/httputils.php @@ -65,7 +65,7 @@ function http_conditionalRequest($timestamp){ * * @author Chris Smith <chris@jalakai.co.uk> * @param string $file absolute path of file to send - * @returns void or exits with previously header() commands executed + * @returns void or exits with previous header() commands executed */ function http_sendfile($file) { global $conf; @@ -93,7 +93,7 @@ function http_sendfile($file) { * * This function exits the running script * - * @param ressource $fh - file handle for an already open file + * @param resource $fh - file handle for an already open file * @param int $size - size of the whole file * @param int $mime - MIME type of the file * @@ -205,7 +205,7 @@ function http_gzip_valid($uncompressed_file) { * * This function handles output of cacheable resource files. It ses the needed * HTTP headers. If a useable cache is present, it is passed to the web server - * and the scrpt is terminated. + * and the script is terminated. */ function http_cached($cache, $cache_ok) { global $conf; diff --git a/inc/infoutils.php b/inc/infoutils.php index 7358955a0..3636d86a1 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -105,12 +105,16 @@ function check(){ if ($INFO['isadmin'] || $INFO['ismanager']){ msg('DokuWiki version: '.getVersion(),1); - } - if(version_compare(phpversion(),'5.2.0','<')){ - msg('Your PHP version is too old ('.phpversion().' vs. 5.2.0+ needed)',-1); - }else{ - msg('PHP version '.phpversion(),1); + if(version_compare(phpversion(),'5.2.0','<')){ + msg('Your PHP version is too old ('.phpversion().' vs. 5.2.0+ needed)',-1); + }else{ + msg('PHP version '.phpversion(),1); + } + } else { + if(version_compare(phpversion(),'5.2.0','<')){ + msg('Your PHP version is too old',-1); + } } $mem = (int) php_to_byte(ini_get('memory_limit')); diff --git a/inc/init.php b/inc/init.php index a937b934d..3e422453d 100644 --- a/inc/init.php +++ b/inc/init.php @@ -183,11 +183,6 @@ if($conf['compression'] == 'gz' && !function_exists('gzopen')){ $conf['compression'] = 0; } -// fix dateformat for upgraders -if(strpos($conf['dformat'],'%') === false){ - $conf['dformat'] = '%Y/%m/%d %H:%M'; -} - // precalculate file creation modes init_creationmodes(); diff --git a/inc/io.php b/inc/io.php index c5225a2e0..27a34b045 100644 --- a/inc/io.php +++ b/inc/io.php @@ -367,8 +367,6 @@ function io_createNamespace($id, $ns_type='pages') { * @author Andreas Gohr <andi@splitbrain.org> */ function io_makeFileDir($file){ - global $conf; - $dir = dirname($file); if(!@is_dir($dir)){ io_mkdir_p($dir) || msg("Creating directory $dir failed",-1); diff --git a/inc/lang/bn/lang.php b/inc/lang/bn/lang.php index 94a3fbb12..230f3ef80 100644 --- a/inc/lang/bn/lang.php +++ b/inc/lang/bn/lang.php @@ -5,6 +5,7 @@ * * @author Foysol <ragebot1125@gmail.com> * @author ninetailz <ninetailz1125@gmail.com> + * @author Khan M. B. Asad <muhammad2017@gmail.com> */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'itr'; @@ -127,3 +128,33 @@ $lang['js']['medialeft'] = 'বাম দিকে ইমেজ সার $lang['js']['mediaright'] = 'ডান দিকে ইমেজ সারিবদ্ধ কর'; $lang['js']['mediacenter'] = 'মাঝখানে ইমেজ সারিবদ্ধ কর'; $lang['js']['medianoalign'] = 'কোনো সারিবদ্ধ করা প্রয়োজন নেই'; +$lang['js']['nosmblinks'] = 'উইন্ডোস শেয়ার এর সাথে সংযোগ সাধন কেবল মাইক্রোসফ্ট ইন্টারনেট এক্সপ্লোরারেই সম্ভব।\nতবে আপনি লিংকটি কপি পেস্ট করতেই পারেন।'; +$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'] = 'শাইন-থ্রু'; +$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_cancel'] = 'অপসারণ'; +$lang['js']['media_overwrt'] = 'বর্তমান ফাইল ওভাররাইট করুন'; +$lang['rssfailed'] = 'ফিডটি জোগাড় করতে গিয়ে একটি ত্রুটি ঘটেছে:'; +$lang['nothingfound'] = 'কিছু পাওয়া যায়নি।'; +$lang['mediaselect'] = 'মিডিয়া ফাইল'; +$lang['fileupload'] = 'মিডিয়া ফাইল আপলোড'; +$lang['uploadsucc'] = 'আপলোড সফল'; +$lang['uploadfail'] = 'আপলোড ব্যর্থ। অনুমতি জনিত ত্রুটি কী?'; +$lang['uploadwrong'] = 'আপলোড প্রত্যাখ্যাত। এই ফাইল এক্সটেনশন অননুমোদিত।'; +$lang['uploadexist'] = 'ফাইল ইতিমধ্যেই বিরাজমান। কিছু করা হয়নি।'; +$lang['uploadbadcontent'] = 'আপলোডকৃত সামগ্রী %s ফাইল এক্সটেনশন এর সাথে মিলেনি।'; +$lang['uploadspam'] = 'স্প্যাম ব্ল্যাকলিস্ট আপলোড আটকে দিয়েছে।'; +$lang['uploadxss'] = 'সামগ্রীটি ক্ষতিকর ভেবে আপলোড আটকে দেয়া হয়েছে।'; +$lang['uploadsize'] = 'আপলোডকৃত ফাইলটি বেশি বড়ো। (সর্বোচ্চ %s)'; +$lang['deletesucc'] = '"%s" ফাইলটি মুছে ফেলা হয়েছে।'; +$lang['deletefail'] = '"%s" ডিলিট করা যায়নি - অনুমতি আছে কি না দেখুন।'; +$lang['mediainuse'] = '"%s" ফাইলটি মোছা হয়নি - এটি এখনো ব্যবহৃত হচ্ছে।'; diff --git a/inc/lang/eo/admin.txt b/inc/lang/eo/admin.txt index 4b0cf7909..4b3cf0c2a 100644 --- a/inc/lang/eo/admin.txt +++ b/inc/lang/eo/admin.txt @@ -1,3 +1,3 @@ ====== Administrado ====== -Sube vi povas trovi liston de administraj taskoj disponeblaj en DokuWiki. +Sube vi trovas liston de administraj taskoj haveblaj en DokuWiki. diff --git a/inc/lang/eo/adminplugins.txt b/inc/lang/eo/adminplugins.txt index 769a8c538..bb7e7829b 100644 --- a/inc/lang/eo/adminplugins.txt +++ b/inc/lang/eo/adminplugins.txt @@ -1 +1 @@ -===== Eksteraj kromaĵoj =====
\ No newline at end of file +===== Aldonaj kromaĵoj =====
\ No newline at end of file diff --git a/inc/lang/eo/diff.txt b/inc/lang/eo/diff.txt index 5829a7db1..3c9db61c8 100644 --- a/inc/lang/eo/diff.txt +++ b/inc/lang/eo/diff.txt @@ -1,4 +1,4 @@ ====== Diferencoj ====== -Ĉi tie vi povas vidi diferencojn inter la aktuala versio kaj la elektita revizio de la paĝo. +Tio montras diferencojn inter du versioj de la paĝo. diff --git a/inc/lang/eo/draft.txt b/inc/lang/eo/draft.txt index 32ddc83f6..57526f3b5 100644 --- a/inc/lang/eo/draft.txt +++ b/inc/lang/eo/draft.txt @@ -1,5 +1,5 @@ ====== Skiza dosiero troviĝis ====== -Via lasta sekcio de redakto en tiu ĉi paĝo ne korekte kompletiĝis. DokuWiki aŭtomate konservis skizon dum vi laboris, kiun vi nun povas uzi por daŭrigi vian redaktadon. Sube vi povas vidi la datumaron, kiu konserviĝis el via lasta sekcio. +Via lasta redaktosesio en tiu ĉi paĝo ne ĝuste kompletiĝis. DokuWiki aŭtomate konservis skizon dum vi laboris, kiun vi nun povas uzi por daŭrigi vian redaktadon. Sube vi povas vidi la datumaron, kiu konserviĝis el via lasta sesio. Bonvolu decidi ĉu vi volas //restarigi// vian perditan redakton, //forigi// la aŭtomate konservitan skizon aŭ //rezigni// pri la redakta procezo. diff --git a/inc/lang/eo/edit.txt b/inc/lang/eo/edit.txt index 29b3382c5..ccc8a613d 100644 --- a/inc/lang/eo/edit.txt +++ b/inc/lang/eo/edit.txt @@ -1 +1 @@ -Redaktu paĝon kaj poste premu butonon titolitan '"Konservi'". Bonvolu tralegi la [[wiki:syntax|vikian sintakson]] por kompreni kiel vi povas krei paĝojn. Bonvolu redakti nur se vi planas **plibonigi** la enhavon de la paĝo. Se vi volas nur testi ion, bonvolu uzi specialan paĝon: [[wiki:playground|ludejo]]. +Redaktu paĝon kaj poste premu butonon titolitan '"Konservi'". Bonvolu tralegi la [[wiki:syntax|vikian sintakson]] pri la formatigo. Bonvolu redakti **nur**, se vi povas **plibonigi** la enhavon de la paĝo. Se vi volas nur testi ion, bonvolu uzi specialan paĝon: [[playground:playground|sablokesto]]. diff --git a/inc/lang/eo/editrev.txt b/inc/lang/eo/editrev.txt index 1640baa91..2e1406b0f 100644 --- a/inc/lang/eo/editrev.txt +++ b/inc/lang/eo/editrev.txt @@ -1,2 +1,2 @@ -**Vi laboras kun malnova revizio de la dokumento!** Se vi konservos ĝin, kreiĝos nova kuranta versio kun la sama enhavo. +**Vi laboras kun malnova revizio de la dokumento!** Se vi konservos ĝin, kreiĝos nova kuranta versio kun tiu enhavo. ---- diff --git a/inc/lang/eo/lang.php b/inc/lang/eo/lang.php index a543b2571..97231bdce 100644 --- a/inc/lang/eo/lang.php +++ b/inc/lang/eo/lang.php @@ -37,13 +37,13 @@ $lang['btn_secedit'] = 'Redakti'; $lang['btn_login'] = 'Ensaluti'; $lang['btn_logout'] = 'Elsaluti'; $lang['btn_admin'] = 'Administri'; -$lang['btn_update'] = 'Ĝisdatigi'; +$lang['btn_update'] = 'Aktualigi'; $lang['btn_delete'] = 'Forigi'; $lang['btn_back'] = 'Retroiri'; $lang['btn_backlink'] = 'Retroligoj'; $lang['btn_backtomedia'] = 'Retroiri al elekto de dosiero'; $lang['btn_subscribe'] = 'Aliĝi al paĝaj modifoj'; -$lang['btn_profile'] = 'Ĝisdatigi profilon'; +$lang['btn_profile'] = 'Aktualigi profilon'; $lang['btn_reset'] = 'Rekomenci'; $lang['btn_resendpwd'] = 'Sendi novan pasvorton'; $lang['btn_draft'] = 'Redakti skizon'; @@ -53,7 +53,7 @@ $lang['btn_revert'] = 'Restarigi'; $lang['btn_register'] = 'Registriĝi'; $lang['btn_apply'] = 'Apliki'; $lang['btn_media'] = 'Medio-administrilo'; -$lang['btn_deleteuser'] = 'Forigi mian aliĝon'; +$lang['btn_deleteuser'] = 'Forigi mian konton'; $lang['loggedinas'] = 'Ensalutinta kiel'; $lang['user'] = 'Uzant-nomo'; $lang['pass'] = 'Pasvorto'; @@ -81,7 +81,7 @@ $lang['reghere'] = 'Se vi ne havas konton, vi povas akiri ĝin'; $lang['profna'] = 'Tiu ĉi vikio ne ebligas modifon en la profiloj.'; $lang['profnochange'] = 'Neniu ŝanĝo, nenio farinda.'; $lang['profnoempty'] = 'Malplena nomo aŭ retadreso ne estas permesata.'; -$lang['profchanged'] = 'La profilo de la uzanto sukcese ĝisdatiĝis.'; +$lang['profchanged'] = 'La profilo de la uzanto sukcese aktualiĝis.'; $lang['profnodelete'] = 'Tiu ĉi vikio ne subtenas forigo de uzantoj'; $lang['profdeleteuser'] = 'Forigi aliĝon'; $lang['profdeleted'] = 'Via uzant-aliĝo estis forigata de tiu ĉi vikio'; @@ -104,7 +104,7 @@ $lang['txt_filename'] = 'Alŝuti kiel (laŭvole)'; $lang['txt_overwrt'] = 'Anstataŭigi ekzistantan dosieron'; $lang['maxuploadsize'] = 'Alŝuto maks. %s po dosiero.'; $lang['lockedby'] = 'Nune ŝlosita de'; -$lang['lockexpire'] = 'Ŝlosado ĉesos en'; +$lang['lockexpire'] = 'Ŝlosado ĉesos je'; $lang['js']['willexpire'] = 'Vi povos redakti ĉi tiun paĝon post unu minuto.\nSe vi volas nuligi tempokontrolon de la ŝlosado, premu la butonon "Antaŭrigardi".'; $lang['js']['notsavedyet'] = 'Ne konservitaj modifoj perdiĝos. Ĉu vi certe volas daŭrigi la procezon?'; @@ -293,6 +293,7 @@ $lang['i_policy'] = 'Komenca ACL-a agordo'; $lang['i_pol0'] = 'Malferma Vikio (legi, skribi, alŝuti povas ĉiuj)'; $lang['i_pol1'] = 'Publika Vikio (legi povas ĉiuj, skribi kaj alŝuti povas registritaj uzantoj)'; $lang['i_pol2'] = 'Ferma Vikio (legi, skribi, alŝuti nur povas registritaj uzantoj)'; +$lang['i_allowreg'] = 'Permesi al uzantoj registri sin mem'; $lang['i_retry'] = 'Reprovi'; $lang['i_license'] = 'Bonvolu elekti la permesilon, sub kiun vi volas meti vian enhavon:'; $lang['i_license_none'] = 'Ne montri licencinformojn'; diff --git a/inc/lang/fr/denied.txt b/inc/lang/fr/denied.txt index 20d4d6755..56c59a7c2 100644 --- a/inc/lang/fr/denied.txt +++ b/inc/lang/fr/denied.txt @@ -1,3 +1,3 @@ ====== Autorisation refusée ====== -Désolé, vous n'avez pas les droits pour continuer. Peut-être avez-vous oublié de vous identifier ? +Désolé, vous n'avez pas suffisement d'autorisations pour poursuivre votre demande. Peut-être avez-vous oublié de vous identifier ? diff --git a/inc/lang/fr/lang.php b/inc/lang/fr/lang.php index 49f617323..32e3055f7 100644 --- a/inc/lang/fr/lang.php +++ b/inc/lang/fr/lang.php @@ -29,6 +29,7 @@ * @author Bruno Veilleux <bruno.vey@gmail.com> * @author Emmanuel <seedfloyd@gmail.com> * @author Jérôme Brandt <jeromebrandt@gmail.com> + * @author Wild <wild.dagger@free.fr> */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -51,10 +52,10 @@ $lang['btn_revs'] = 'Anciennes révisions'; $lang['btn_recent'] = 'Derniers changements'; $lang['btn_upload'] = 'Envoyer'; $lang['btn_cancel'] = 'Annuler'; -$lang['btn_index'] = 'Index'; +$lang['btn_index'] = 'Plan du site'; $lang['btn_secedit'] = 'Modifier'; -$lang['btn_login'] = 'Connexion'; -$lang['btn_logout'] = 'Déconnexion'; +$lang['btn_login'] = 'S\'identifier'; +$lang['btn_logout'] = 'Se déconnecter'; $lang['btn_admin'] = 'Administrer'; $lang['btn_update'] = 'Mettre à jour'; $lang['btn_delete'] = 'Effacer'; @@ -69,7 +70,7 @@ $lang['btn_draft'] = 'Modifier le brouillon'; $lang['btn_recover'] = 'Récupérer le brouillon'; $lang['btn_draftdel'] = 'Effacer le brouillon'; $lang['btn_revert'] = 'Restaurer'; -$lang['btn_register'] = 'S\'enregistrer'; +$lang['btn_register'] = 'Créer un compte'; $lang['btn_apply'] = 'Appliquer'; $lang['btn_media'] = 'Gestionnaire de médias'; $lang['btn_deleteuser'] = 'Supprimer mon compte'; diff --git a/inc/lang/hu/lang.php b/inc/lang/hu/lang.php index 5113e1cc8..a0aef9447 100644 --- a/inc/lang/hu/lang.php +++ b/inc/lang/hu/lang.php @@ -337,4 +337,4 @@ $lang['media_restore'] = 'Ezen verzió visszaállítása'; $lang['currentns'] = 'Aktuális névtér'; $lang['searchresult'] = 'Keresés eredménye'; $lang['plainhtml'] = 'Sima HTML'; -$lang['wikimarkup'] = 'Wiki-jelölő nyelv'; +$lang['wikimarkup'] = 'Wiki-jelölőnyelv'; diff --git a/inc/lang/nl/lang.php b/inc/lang/nl/lang.php index e5e3e3c76..e22aa9fff 100644 --- a/inc/lang/nl/lang.php +++ b/inc/lang/nl/lang.php @@ -22,6 +22,7 @@ * @author Klap-in <klapinklapin@gmail.com> * @author Remon <no@email.local> * @author gicalle <gicalle@hotmail.com> + * @author Rene <wllywlnt@yahoo.com> */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; diff --git a/inc/load.php b/inc/load.php index 497dd6921..f1deffe19 100644 --- a/inc/load.php +++ b/inc/load.php @@ -96,6 +96,12 @@ function load_autoload($name){ 'DokuWiki_Remote_Plugin' => DOKU_PLUGIN.'remote.php', 'DokuWiki_Auth_Plugin' => DOKU_PLUGIN.'auth.php', + 'Doku_Renderer' => DOKU_INC.'inc/parser/renderer.php', + 'Doku_Renderer_xhtml' => DOKU_INC.'inc/parser/xhtml.php', + 'Doku_Renderer_code' => DOKU_INC.'inc/parser/code.php', + 'Doku_Renderer_xhtmlsummary' => DOKU_INC.'inc/parser/xhtmlsummary.php', + 'Doku_Renderer_metadata' => DOKU_INC.'inc/parser/metadata.php', + ); if(isset($classes[$name])){ diff --git a/inc/media.php b/inc/media.php index 960b96e65..4fff95d94 100644 --- a/inc/media.php +++ b/inc/media.php @@ -284,7 +284,7 @@ function media_upload_xhr($ns,$auth){ 'copy' ); unlink($path); - if ($tmp) dir_delete($tmp); + if ($tmp) io_rmdir($tmp, true); if (is_array($res)) { msg($res[0], $res[1]); return false; @@ -704,7 +704,7 @@ function media_tab_files_options(){ if ($checked == $option) { $attrs['checked'] = 'checked'; } - $form->addElement(form_makeRadioField($group, $option, + $form->addElement(form_makeRadioField($group . '_dwmedia', $option, $lang['media_' . $group . '_' . $option], $content[0] . '__' . $option, $option, $attrs)); @@ -728,10 +728,23 @@ function _media_get_sort_type() { return _media_get_display_param('sort', array('default' => 'name', 'date')); } +/** + * Returns type of listing for the list of files in media manager + * + * @author Kate Arzamastseva <pshns@ukr.net> + * @return string - list type + */ function _media_get_list_type() { return _media_get_display_param('list', array('default' => 'thumbs', 'rows')); } +/** + * Get display parameters + * + * @param string $param name of parameter + * @param array $values allowed values, where default value has index key 'default' + * @return string the parameter value + */ function _media_get_display_param($param, $values) { global $INPUT; if (in_array($INPUT->str($param), $values)) { @@ -859,6 +872,10 @@ function media_tab_history($image, $ns, $auth=null) { /** * Prints mediafile details * + * @param string $image media id + * @param $auth + * @param int|bool $rev + * @param JpegMeta|bool $meta * @author Kate Arzamastseva <pshns@ukr.net> */ function media_preview($image, $auth, $rev=false, $meta=false) { @@ -1039,7 +1056,6 @@ function media_details($image, $auth, $rev=false, $meta=false) { * @author Kate Arzamastseva <pshns@ukr.net> */ function media_diff($image, $ns, $auth, $fromajax = false) { - global $lang; global $conf; global $INPUT; @@ -1098,9 +1114,15 @@ function media_diff($image, $ns, $auth, $fromajax = false) { } +/** + * Callback for media file diff + * + * @param $data + * @return bool|void + */ function _media_file_diff($data) { if(is_array($data) && count($data)===6) { - return media_file_diff($data[0], $data[1], $data[2], $data[3], $data[4], $data[5]); + media_file_diff($data[0], $data[1], $data[2], $data[3], $data[4], $data[5]); } else { return false; } @@ -1559,7 +1581,7 @@ function media_printimgdetail($item, $fullscreen=false){ * @param string $amp - separator * @param bool $abs * @param bool $params_array - * @return string - link + * @return string|array - link */ function media_managerURL($params=false, $amp='&', $abs=false, $params_array=false) { global $ID; @@ -1819,7 +1841,7 @@ function media_resize_image($file, $ext, $w, $h=0){ if( $mtime > filemtime($file) || media_resize_imageIM($ext,$file,$info[0],$info[1],$local,$w,$h) || media_resize_imageGD($ext,$file,$info[0],$info[1],$local,$w,$h) ){ - if($conf['fperm']) chmod($local, $conf['fperm']); + if($conf['fperm']) @chmod($local, $conf['fperm']); return $local; } //still here? resizing failed @@ -1880,7 +1902,7 @@ function media_crop_image($file, $ext, $w, $h=0){ if( $mtime > @filemtime($file) || media_crop_imageIM($ext,$file,$info[0],$info[1],$local,$cw,$ch,$cx,$cy) || media_resize_imageGD($ext,$file,$cw,$ch,$local,$cw,$ch,$cx,$cy) ){ - if($conf['fperm']) chmod($local, $conf['fperm']); + if($conf['fperm']) @chmod($local, $conf['fperm']); return media_resize_image($local,$ext, $w, $h); } @@ -2164,7 +2186,7 @@ function media_alternativefiles($src, $exts){ /** * Check if video/audio is supported to be embedded. * - * @param string $src - mimetype of media file + * @param string $mime - mimetype of media file * @param string $type - type of media files to check ('video', 'audio', or none) * @return boolean * diff --git a/inc/pageutils.php b/inc/pageutils.php index c8d3cf4bb..9c2794387 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -94,6 +94,7 @@ function getID($param='id',$clean=true){ * @author Andreas Gohr <andi@splitbrain.org> * @param string $raw_id The pageid to clean * @param boolean $ascii Force ASCII + * @return string cleaned id */ function cleanID($raw_id,$ascii=false){ global $conf; @@ -244,6 +245,7 @@ function page_exists($id,$rev='',$clean=true) { * @param $rev string page revision, empty string for current * @param $clean bool flag indicating that $raw_id should be cleaned. Only set to false * when $id is guaranteed to have been cleaned already. + * @return string full path * * @author Andreas Gohr <andi@splitbrain.org> */ @@ -361,6 +363,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'){ @@ -543,6 +546,11 @@ function isHiddenPage($id){ return $data['hidden']; } +/** + * callback checks if page is hidden + * + * @param array $data event data see isHiddenPage() + */ function _isHiddenPage(&$data) { global $conf; global $ACT; diff --git a/inc/parser/code.php b/inc/parser/code.php index 0b8e3ee02..d77ffd1aa 100644 --- a/inc/parser/code.php +++ b/inc/parser/code.php @@ -5,7 +5,6 @@ * @author Andreas Gohr <andi@splitbrain.org> */ if(!defined('DOKU_INC')) die('meh.'); -require_once DOKU_INC . 'inc/parser/renderer.php'; class Doku_Renderer_code extends Doku_Renderer { var $_codeblock=0; diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 8ba159d62..73bae190f 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -16,8 +16,6 @@ if ( !defined('DOKU_TAB') ) { define ('DOKU_TAB',"\t"); } -require_once DOKU_INC . 'inc/parser/renderer.php'; - /** * The Renderer */ diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index e3401fd48..1f9ad00a2 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -6,8 +6,6 @@ * @author Andreas Gohr <andi@splitbrain.org> */ if(!defined('DOKU_INC')) die('meh.'); -require_once DOKU_INC . 'inc/plugin.php'; -require_once DOKU_INC . 'inc/pluginutils.php'; /** * An empty renderer, produces no output diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 80701cd2e..184e62fe3 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -17,9 +17,6 @@ if ( !defined('DOKU_TAB') ) { define ('DOKU_TAB',"\t"); } -require_once DOKU_INC . 'inc/parser/renderer.php'; -require_once DOKU_INC . 'inc/html.php'; - /** * The Renderer */ @@ -562,6 +559,12 @@ 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> */ function internallink($id, $name = null, $search=null,$returnonly=false,$linktype='content') { @@ -1096,48 +1099,30 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $ret .= ' />'; - }elseif(media_supportedav($mime, 'video')){ + }elseif(media_supportedav($mime, 'video') || media_supportedav($mime, 'audio')){ // first get the $title - if (!is_null($title)) { - $title = $this->_xmlEntities($title); - } - if (!$title) { - // just show the sourcename - $title = $this->_xmlEntities(utf8_basename(noNS($src))); - } + $title = !is_null($title) ? $this->_xmlEntities($title) : false; if (!$render) { - // if the video is not supposed to be rendered - // return the title of the video - return $title; + // 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['class'] = "media$align"; - - //add video(s) - $ret .= $this->_video($src, $width, $height, $att); - - }elseif(media_supportedav($mime, 'audio')){ - // first get the $title - if (!is_null($title)) { - $title = $this->_xmlEntities($title); + if ($title) { + $att['title'] = $title; } - if (!$title) { - // just show the sourcename - $title = $this->_xmlEntities(utf8_basename(noNS($src))); + + if (media_supportedav($mime, 'video')) { + //add video + $ret .= $this->_video($src, $width, $height, $att); } - if (!$render) { - // if the video is not supposed to be rendered - // return the title of the video - return $title; + if (media_supportedav($mime, 'audio')) { + //add audio + $ret .= $this->_audio($src, $att); } - $att = array(); - $att['class'] = "media$align"; - - //add audio - $ret .= $this->_audio($src, $att); - }elseif($mime == 'application/x-shockwave-flash'){ if (!$render) { // if the flash is not supposed to be rendered @@ -1282,7 +1267,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { * @return string */ function _video($src,$width,$height,$atts=null){ - // prepare width and height if(is_null($atts)) $atts = array(); $atts['width'] = (int) $width; @@ -1309,7 +1293,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { // output source for each alternative video format foreach($alternatives as $mime => $file) { $url = ml($file,array('cache'=>$cache),true,'&'); - $title = $this->_xmlEntities(utf8_basename(noNS($file))); + $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) @@ -1345,7 +1329,7 @@ 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,'&'); - $title = $this->_xmlEntities(utf8_basename(noNS($file))); + $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) diff --git a/inc/parser/xhtmlsummary.php b/inc/parser/xhtmlsummary.php index 95f86cbef..867b71f6a 100644 --- a/inc/parser/xhtmlsummary.php +++ b/inc/parser/xhtmlsummary.php @@ -1,6 +1,5 @@ <?php if(!defined('DOKU_INC')) die('meh.'); -require_once DOKU_INC . 'inc/parser/xhtml.php'; /** * The summary XHTML form selects either up to the first two paragraphs diff --git a/inc/parserutils.php b/inc/parserutils.php index 4df273f11..06bd6dbb8 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -430,8 +430,9 @@ function p_render_metadata($id, $orig){ global $ID, $METADATA_RENDERERS; // avoid recursive rendering processes for the same id - if (isset($METADATA_RENDERERS[$id])) + if (isset($METADATA_RENDERERS[$id])) { return $orig; + } // store the original metadata in the global $METADATA_RENDERERS so p_set_metadata can use it $METADATA_RENDERERS[$id] =& $orig; @@ -444,8 +445,6 @@ function p_render_metadata($id, $orig){ $evt = new Doku_Event('PARSER_METADATA_RENDER', $orig); if ($evt->advise_before()) { - require_once DOKU_INC."inc/parser/metadata.php"; - // get instructions $instructions = p_cached_instructions(wikiFN($id),false,$id); if(is_null($instructions)){ @@ -588,7 +587,7 @@ function p_sort_modes($a, $b){ function p_render($mode,$instructions,&$info){ if(is_null($instructions)) return ''; - $Renderer =& p_get_renderer($mode); + $Renderer = p_get_renderer($mode); if (is_null($Renderer)) return null; $Renderer->reset(); @@ -616,43 +615,54 @@ function p_render($mode,$instructions,&$info){ } /** + * Figure out the correct renderer class to use for $mode, + * instantiate and return it + * * @param $mode string Mode of the renderer to get * @return null|Doku_Renderer The renderer + * + * @author Christopher Smith <chris@jalakai.co.uk> */ -function & p_get_renderer($mode) { +function p_get_renderer($mode) { /** @var Doku_Plugin_Controller $plugin_controller */ global $conf, $plugin_controller; $rname = !empty($conf['renderer_'.$mode]) ? $conf['renderer_'.$mode] : $mode; $rclass = "Doku_Renderer_$rname"; + // if requested earlier or a bundled renderer if( class_exists($rclass) ) { $Renderer = new $rclass(); return $Renderer; } - // try default renderer first: - $file = DOKU_INC."inc/parser/$rname.php"; - if(@file_exists($file)){ - require_once $file; + // not bundled, see if its an enabled plugin for rendering $mode + $Renderer = $plugin_controller->load('renderer',$rname); + if ($Renderer && is_a($Renderer, 'Doku_Renderer') && ($mode == $Renderer->getFormat())) { + return $Renderer; + } - if ( !class_exists($rclass) ) { - trigger_error("Unable to resolve render class $rclass",E_USER_WARNING); - msg("Renderer '$rname' for $mode not valid",-1); - return null; + // there is a configuration error! + // not bundled, not a valid enabled plugin, use $mode to try to fallback to a bundled renderer + $rclass = "Doku_Renderer_$mode"; + if ( class_exists($rclass) ) { + // viewers should see renderered output, so restrict the warning to admins only + $msg = "No renderer '$rname' found for mode '$mode', check your plugins"; + if ($mode == 'xhtml') { + $msg .= " and the 'renderer_xhtml' config setting"; } - $Renderer = new $rclass(); - }else{ - // Maybe a plugin/component is available? - $Renderer = $plugin_controller->load('renderer',$rname); + $msg .= ".<br/>Attempting to fallback to the bundled renderer."; + msg($msg,-1,'','',MSG_ADMINS_ONLY); - if(!isset($Renderer) || is_null($Renderer)){ - msg("No renderer '$rname' found for mode '$mode'",-1); - return null; - } + $Renderer = new $rclass; + $Renderer->nocache(); // fallback only (and may include admin alerts), don't cache + return $Renderer; } - return $Renderer; + // 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/pluginutils.php b/inc/pluginutils.php index 894bbefb6..911c4e5c0 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -37,7 +37,7 @@ function plugin_list($type='',$all=false) { * @param $name string name of the plugin to load * @param $new bool true to return a new instance of the plugin, false to use an already loaded instance * @param $disabled bool true to load even disabled plugins - * @return DokuWiki_Plugin|DokuWiki_Syntax_Plugin|null the plugin object or null on failure + * @return DokuWiki_Plugin|null the plugin object or null on failure */ function plugin_load($type,$name,$new=false,$disabled=false) { /** @var $plugin_controller Doku_Plugin_Controller */ diff --git a/inc/subscription.php b/inc/subscription.php index ddf2f39e6..ddf30706b 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -288,7 +288,7 @@ class Subscription { public function send_bulk($page) { if(!$this->isenabled()) return 0; - /** @var auth_basic $auth */ + /** @var DokuWiki_Auth_Plugin $auth */ global $auth; global $conf; global $USERINFO; @@ -651,7 +651,7 @@ class Subscription { public function notifyaddresses(&$data) { if(!$this->isenabled()) return; - /** @var auth_basic $auth */ + /** @var DokuWiki_Auth_Plugin $auth */ global $auth; global $conf; |