/action.php |
@@ -5,10 +5,9 @@ |
* Action plugin component, for cache validity determination |
* |
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html) |
* @author Wizardry and Steamworks office@grimore.org |
* original: Christopher Smith <chris@jalakai.co.uk> |
* @author Christopher Smith <chris@jalakai.co.uk> |
*/ |
if(!defined('DOKU_INC')) die(); // no Dokuwiki, no go |
if(!defined('DOKU_INC')) die(); // no DokuWiki, no go |
|
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
require_once(DOKU_PLUGIN.'action.php'); |
@@ -24,17 +23,17 @@ |
*/ |
function getInfo(){ |
return array( |
'author' => 'Wizardry and Steamworks', |
'email' => 'office@grimore.org', |
'date' => '2016-11-19', |
'author' => 'Christopher Smith', |
'email' => 'chris@jalakai.co.uk', |
'date' => '2008-08-13', |
'name' => 'Source Plugin', |
'desc' => 'Include a remote source file', |
'url' => 'http://grimore.org/dokuwiki/plugins/source', |
'url' => 'http://www.dokuwiki.org/plugin:source', |
); |
} |
|
/** |
* plugin should use this method to register its handlers with the dokuwiki's event controller |
* plugin should use this method to register its handlers with the DokuWiki's event controller |
*/ |
function register(Doku_Event_Handler $controller) { |
$controller->register_hook('PARSER_CACHE_USE','BEFORE', $this, '_cache_prepare'); |
@@ -99,4 +98,5 @@ |
|
} |
|
//Setup VIM: ex: et ts=4 enc=utf-8 : |
//Setup VIM: ex: et ts=4 enc=utf-8 : |
|
/syntax.php |
@@ -22,8 +22,7 @@ |
* - this plugin's location, allow & deny settings. |
* |
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html) |
* @author Wizardry and Steamworks office@grimore.org |
* original: Christopher Smith <chris@jalakai.co.uk> |
* @author Christopher Smith <chris@jalakai.co.uk> |
*/ |
if(!defined('DOKU_INC')) die(); // no Dokuwiki, no go |
|
@@ -85,7 +84,7 @@ |
list($attr, $title) = preg_split('/\|/u', $match, 2); //split out title |
|
$attr = trim($attr); |
$pattern = ($attr{0} == '"' || $attr{0} == "'") ? $attr{0} : '\s'; |
$pattern = ($attr[0] == '"' || $attr[0] == "'") ? $attr[0] : '\s'; |
list($file, $prop) = preg_split("/$pattern/u", $attr, 3, PREG_SPLIT_NO_EMPTY); |
|
if (isset($prop) && trim($prop)) { |
@@ -132,7 +131,7 @@ |
$title = ($title) ? "<span>".hsc($title)."</span>" |
: $this->_makeTitle($file, $start, $end); |
|
$renderer->doc .= "<div class='source'><p class='title'>$title</p>"; |
$renderer->doc .= "<div class='source'><p>$title</p>"; |
$renderer->code($source, $lang); |
$renderer->doc .= "</div>"; |
} else { |
@@ -223,7 +222,7 @@ |
$rules = explode("\n",$rules); |
foreach ($rules as $rule) { |
$rule = trim($rule); |
if (!$rule || $rule{0} == ';') continue; |
if (!$rule || $rule[0] == ';') continue; |
|
$match = array(); |
if (!preg_match('/^(allow|deny)\s+(.+)$/i',$rule,$match)) continue; |