commit 20fa5174b0fdb49557c4d8e0d3e906e15cfe33d9 Author: Pavol Rusnak Date: Fri Apr 8 17:13:58 2011 +0200 initial commit diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..d1faeee --- /dev/null +++ b/CHANGELOG @@ -0,0 +1 @@ +Please refer to the changelog at http://www.dokuwiki.org/plugin:nextday diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..efadf3a --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Pavol Rusnak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..e92f9be --- /dev/null +++ b/README @@ -0,0 +1 @@ +Please refer to the documentation at http://www.dokuwiki.org/plugin:nextday diff --git a/plugin.info.txt b/plugin.info.txt new file mode 100644 index 0000000..fb26289 --- /dev/null +++ b/plugin.info.txt @@ -0,0 +1,7 @@ +base nextday +author Pavol Rusnak +email stick@gk2.sk +date 2011-04-08 +name Nextday Plugin +desc Display the date of the closest $WEEKDAY +url http://www.dokuwiki.org/plugin:nextday diff --git a/syntax.php b/syntax.php new file mode 100644 index 0000000..f3da9bd --- /dev/null +++ b/syntax.php @@ -0,0 +1,37 @@ + + */ + +if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); +if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); +require_once(DOKU_PLUGIN.'syntax.php'); + +class syntax_plugin_nextday extends DokuWiki_Syntax_Plugin { + + function getType() { return 'substition'; } + + function getPType() { return 'normal'; } + + function getSort() { return 155; } + + function connectTo($mode) { + $this->Lexer->addSpecialPattern('~~NEXTDAY:[^~]*~~',$mode,'plugin_nextday'); + } + + function handle($match, $state, $pos, &$handler) { + $day = strtotime('next friday', strtotime('yesterday')); + return strftime('%d %B %Y', $day); + } + + function render($mode, &$renderer, $data) { + $renderer->doc .= $data; + return true; + } + +} + +?>