From: <var...@us...> - 2009-10-17 15:45:30
|
Revision: 7217 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7217&view=rev Author: vargenau Date: 2009-10-17 15:45:24 +0000 (Sat, 17 Oct 2009) Log Message: ----------- Remove unused xml plugin syntax (better use Wikicreole plugin syntax) Modified Paths: -------------- trunk/TODO trunk/config/config-default.ini trunk/config/config-dist.ini trunk/lib/IniConfig.php trunk/lib/InlineParser.php Modified: trunk/TODO =================================================================== --- trunk/TODO 2009-10-17 15:19:39 UTC (rev 7216) +++ trunk/TODO 2009-10-17 15:45:24 UTC (rev 7217) @@ -27,10 +27,6 @@ TODO for 1.4.0: architecture: * Optimization: try template_lite or try simple regex replacements as before. -* Evaluate some xml syntax for plugins (as in MediaWiki): - <IncludePages pages=<plugin-list BackLinks/> /> - <BackLink include_self=false /> - And/or fix PLUGIN_MARKUP_MAP aliases which break the InlineParser. * Fix postgresql stored procedures. * Move serialized data from page_data / version_data to seperate SQL columns. * WikiDB hooks. (?) Modified: trunk/config/config-default.ini =================================================================== --- trunk/config/config-default.ini 2009-10-17 15:19:39 UTC (rev 7216) +++ trunk/config/config-default.ini 2009-10-17 15:45:24 UTC (rev 7217) @@ -154,7 +154,6 @@ ENABLE_MARKUP_COLOR = true DISABLE_MARKUP_WIKIWORD = false ENABLE_MARKUP_DIVSPAN = false -PLUGIN_MARKUP_MAP = "" ; these not: ; DBAUTH_AUTH_DSN = Modified: trunk/config/config-dist.ini =================================================================== --- trunk/config/config-dist.ini 2009-10-17 15:19:39 UTC (rev 7216) +++ trunk/config/config-dist.ini 2009-10-17 15:45:24 UTC (rev 7217) @@ -1047,11 +1047,6 @@ ; Enable <div> and <span> HTML blocks and attributes. Experimental. Not yet working. ;ENABLE_MARKUP_DIVSPAN = true -; Plugin shortcuts: Enable <xml> syntax mapped to a plugin invocation. (as in mediawiki) -; <name arg=value>body</name> or <name /> => <?plugin pluginname arg=value body ?> -; This breaks the InlineParser. -;PLUGIN_MARKUP_MAP = "html:RawHtml dot:GraphViz toc:CreateToc amath:AsciiMath richtable:RichTable include:IncludePage tex:TexToPng" - ;========================================================================== ; Part Six: URL options. ;========================================================================== Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2009-10-17 15:19:39 UTC (rev 7216) +++ trunk/lib/IniConfig.php 2009-10-17 15:45:24 UTC (rev 7217) @@ -155,7 +155,7 @@ 'PLUGIN_CACHED_DATABASE', 'PLUGIN_CACHED_FILENAME_PREFIX', 'PLUGIN_CACHED_HIGHWATER', 'PLUGIN_CACHED_LOWWATER', 'PLUGIN_CACHED_MAXLIFETIME', 'PLUGIN_CACHED_MAXARGLEN', 'PLUGIN_CACHED_IMGTYPES', - 'WYSIWYG_BACKEND', 'PLUGIN_MARKUP_MAP', + 'WYSIWYG_BACKEND', // extra logic: 'SERVER_NAME','SERVER_PORT','SCRIPT_NAME', 'DATA_PATH', 'PHPWIKI_DIR', 'VIRTUAL_PATH', 'EXTERNAL_HTML2PDF_PAGELIST', 'PLUGIN_CACHED_CACHE_DIR' @@ -423,18 +423,6 @@ in_array(DATABASE_TYPE, array('SQL','ADODB','PDO')) ? 2 : 0); } - global $PLUGIN_MARKUP_MAP; - $PLUGIN_MARKUP_MAP = array(); - if (defined('PLUGIN_MARKUP_MAP') and trim(PLUGIN_MARKUP_MAP) != "") { - $_map = preg_split('/\s+/', PLUGIN_MARKUP_MAP); - foreach ($_map as $v) { - list($xml,$plugin) = split(':', $v); - if (!empty($xml) and !empty($plugin)) - $PLUGIN_MARKUP_MAP[$xml] = $plugin; - } - unset($_map); unset($xml); unset($plugin); unset($v); - } - if (empty($rs['TEMP_DIR'])) { $rs['TEMP_DIR'] = "/tmp"; if (getenv("TEMP")) Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-10-17 15:19:39 UTC (rev 7216) +++ trunk/lib/InlineParser.php 2009-10-17 15:45:24 UTC (rev 7217) @@ -937,43 +937,6 @@ } } -// Special version for plugins in xml syntax -// <name arg=value>body</name> or <name /> => < ? plugin pluginname arg=value body ? > -// PLUGIN_MARKUP_MAP = "html:RawHtml dot:GraphViz toc:CreateToc amath:AsciiMath richtable:RichTable include:IncludePage tex:TexToPng" -class Markup_xml_plugin extends BalancedMarkup -{ - //var $_start_regexp = "<(?: ".join('|',PLUGIN_MARKUP_MAP)." )(?: \s[^>]*)>"; - - function getStartRegexp () { - global $PLUGIN_MARKUP_MAP; - static $_start_regexp; - if ($_start_regexp) return $_start_regexp; - if (empty($PLUGIN_MARKUP_MAP)) - return ''; - //"<(?: html|dot|toc|amath|richtable|include|tex )(?: \s[^>]*)>" - $_start_regexp = "<(?: ".join('|',array_keys($PLUGIN_MARKUP_MAP))." )(?: \s[^>]* | / )>"; - return $_start_regexp; - } - function getEndRegexp ($match) { - return "<\\/" . $match . '>'; - } - function markup ($match, $body) { - global $PLUGIN_MARKUP_MAP; - $name = substr($match,2,-2); - $vars = ''; - if (preg_match('/^(\S+)\|(.*)$/', $name, $_m)) { - $name = $_m[1]; - $vars = $_m[2]; //str_replace(' ', '&', $_m[2]); - } - if (!isset($PLUGIN_MARKUP_MAP[$name])) { - trigger_error("No plugin for $name $vars defined.", E_USER_WARNING); - return ""; - } - $plugin = $PLUGIN_MARKUP_MAP[$name]; - return new Cached_PluginInvocation("<"."?plugin $plugin $vars $body ?".">"); - } -} - /** * Mediawiki <nowiki> * <nowiki>...</nowiki> @@ -1198,9 +1161,6 @@ // Markup_wikicreole_preformatted must be before Markup_template_plugin $this->_addMarkup(new Markup_wikicreole_preformatted); $this->_addMarkup(new Markup_template_plugin); - // This does not work yet - if (0 and PLUGIN_MARKUP_MAP and !$non_default) - $this->_addMarkup(new Markup_xml_plugin); } function _addMarkup ($markup) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |