From 7156dec4392a340d472735a6f08d7daf1db547f6 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Sat, 19 Feb 2022 23:55:03 +0100 Subject: [PATCH] More cleanup. --- bundled-libs/Text/BUNDLE_NOTICE | 7 - bundled-libs/Text/Wiki.php | 1271 ----------------- bundled-libs/Text/Wiki/Parse.php | 253 ---- .../Text/Wiki/Parse/Default/Anchor.php | 67 - .../Text/Wiki/Parse/Default/Blockquote.php | 163 --- bundled-libs/Text/Wiki/Parse/Default/Bold.php | 61 - .../Text/Wiki/Parse/Default/Break.php | 54 - .../Text/Wiki/Parse/Default/Center.php | 60 - bundled-libs/Text/Wiki/Parse/Default/Code.php | 81 -- .../Text/Wiki/Parse/Default/Colortext.php | 74 - .../Text/Wiki/Parse/Default/Deflist.php | 104 -- .../Text/Wiki/Parse/Default/Delimiter.php | 62 - .../Text/Wiki/Parse/Default/Embed.php | 88 -- .../Text/Wiki/Parse/Default/Emphasis.php | 67 - .../Text/Wiki/Parse/Default/Freelink.php | 111 -- .../Text/Wiki/Parse/Default/Function.php | 115 -- .../Text/Wiki/Parse/Default/Heading.php | 89 -- .../Text/Wiki/Parse/Default/Horiz.php | 52 - bundled-libs/Text/Wiki/Parse/Default/Html.php | 57 - .../Text/Wiki/Parse/Default/Image.php | 76 - .../Text/Wiki/Parse/Default/Include.php | 84 -- .../Text/Wiki/Parse/Default/Interwiki.php | 120 -- .../Text/Wiki/Parse/Default/Italic.php | 67 - bundled-libs/Text/Wiki/Parse/Default/List.php | 230 --- .../Text/Wiki/Parse/Default/Newline.php | 57 - .../Text/Wiki/Parse/Default/Paragraph.php | 128 -- .../Text/Wiki/Parse/Default/Phplookup.php | 58 - .../Text/Wiki/Parse/Default/Prefilter.php | 62 - bundled-libs/Text/Wiki/Parse/Default/Raw.php | 55 - .../Text/Wiki/Parse/Default/Revise.php | 130 -- .../Text/Wiki/Parse/Default/Strong.php | 67 - .../Text/Wiki/Parse/Default/Superscript.php | 67 - .../Text/Wiki/Parse/Default/Table.php | 208 --- .../Text/Wiki/Parse/Default/Tighten.php | 32 - bundled-libs/Text/Wiki/Parse/Default/Toc.php | 112 -- bundled-libs/Text/Wiki/Parse/Default/Tt.php | 69 - bundled-libs/Text/Wiki/Parse/Default/Url.php | 265 ---- .../Text/Wiki/Parse/Default/Wikilink.php | 158 -- bundled-libs/Text/Wiki/Render.php | 167 --- bundled-libs/Text/Wiki/Render/Latex.php | 90 -- .../Text/Wiki/Render/Latex/Anchor.php | 33 - .../Text/Wiki/Render/Latex/Blockquote.php | 36 - bundled-libs/Text/Wiki/Render/Latex/Bold.php | 4 - bundled-libs/Text/Wiki/Render/Latex/Break.php | 24 - .../Text/Wiki/Render/Latex/Center.php | 33 - bundled-libs/Text/Wiki/Render/Latex/Code.php | 26 - .../Text/Wiki/Render/Latex/Colortext.php | 58 - .../Text/Wiki/Render/Latex/Deflist.php | 53 - .../Text/Wiki/Render/Latex/Delimiter.php | 25 - bundled-libs/Text/Wiki/Render/Latex/Embed.php | 23 - .../Text/Wiki/Render/Latex/Emphasis.php | 29 - .../Text/Wiki/Render/Latex/Freelink.php | 34 - .../Text/Wiki/Render/Latex/Function.php | 23 - .../Text/Wiki/Render/Latex/Heading.php | 33 - bundled-libs/Text/Wiki/Render/Latex/Horiz.php | 23 - bundled-libs/Text/Wiki/Render/Latex/Html.php | 25 - bundled-libs/Text/Wiki/Render/Latex/Image.php | 70 - .../Text/Wiki/Render/Latex/Include.php | 8 - .../Text/Wiki/Render/Latex/Interwiki.php | 60 - .../Text/Wiki/Render/Latex/Italic.php | 5 - bundled-libs/Text/Wiki/Render/Latex/List.php | 57 - .../Text/Wiki/Render/Latex/Newline.php | 12 - .../Text/Wiki/Render/Latex/Paragraph.php | 31 - .../Text/Wiki/Render/Latex/Phplookup.php | 34 - .../Text/Wiki/Render/Latex/Prefilter.php | 40 - bundled-libs/Text/Wiki/Render/Latex/Raw.php | 23 - .../Text/Wiki/Render/Latex/Revise.php | 38 - .../Text/Wiki/Render/Latex/Strong.php | 30 - .../Text/Wiki/Render/Latex/Superscript.php | 31 - bundled-libs/Text/Wiki/Render/Latex/Table.php | 93 -- .../Text/Wiki/Render/Latex/Tighten.php | 9 - bundled-libs/Text/Wiki/Render/Latex/Toc.php | 30 - bundled-libs/Text/Wiki/Render/Latex/Tt.php | 30 - bundled-libs/Text/Wiki/Render/Latex/Url.php | 35 - .../Text/Wiki/Render/Latex/Wikilink.php | 60 - bundled-libs/Text/Wiki/Render/Plain.php | 16 - .../Text/Wiki/Render/Plain/Anchor.php | 23 - .../Text/Wiki/Render/Plain/Blockquote.php | 39 - bundled-libs/Text/Wiki/Render/Plain/Bold.php | 23 - bundled-libs/Text/Wiki/Render/Plain/Break.php | 24 - .../Text/Wiki/Render/Plain/Center.php | 23 - bundled-libs/Text/Wiki/Render/Plain/Code.php | 24 - .../Text/Wiki/Render/Plain/Colortext.php | 23 - .../Text/Wiki/Render/Plain/Deflist.php | 59 - .../Text/Wiki/Render/Plain/Delimiter.php | 23 - bundled-libs/Text/Wiki/Render/Plain/Embed.php | 23 - .../Text/Wiki/Render/Plain/Emphasis.php | 23 - .../Text/Wiki/Render/Plain/Freelink.php | 23 - .../Text/Wiki/Render/Plain/Function.php | 39 - .../Text/Wiki/Render/Plain/Heading.php | 14 - bundled-libs/Text/Wiki/Render/Plain/Horiz.php | 23 - bundled-libs/Text/Wiki/Render/Plain/Html.php | 24 - bundled-libs/Text/Wiki/Render/Plain/Image.php | 22 - .../Text/Wiki/Render/Plain/Include.php | 8 - .../Text/Wiki/Render/Plain/Interwiki.php | 23 - .../Text/Wiki/Render/Plain/Italic.php | 23 - bundled-libs/Text/Wiki/Render/Plain/List.php | 68 - .../Text/Wiki/Render/Plain/Newline.php | 12 - .../Text/Wiki/Render/Plain/Paragraph.php | 31 - .../Text/Wiki/Render/Plain/Phplookup.php | 25 - .../Text/Wiki/Render/Plain/Prefilter.php | 40 - bundled-libs/Text/Wiki/Render/Plain/Raw.php | 23 - .../Text/Wiki/Render/Plain/Revise.php | 24 - .../Text/Wiki/Render/Plain/Strong.php | 24 - .../Text/Wiki/Render/Plain/Superscript.php | 23 - bundled-libs/Text/Wiki/Render/Plain/Table.php | 57 - .../Text/Wiki/Render/Plain/Tighten.php | 10 - bundled-libs/Text/Wiki/Render/Plain/Toc.php | 39 - bundled-libs/Text/Wiki/Render/Plain/Tt.php | 24 - bundled-libs/Text/Wiki/Render/Plain/Url.php | 25 - .../Text/Wiki/Render/Plain/Wikilink.php | 24 - bundled-libs/Text/Wiki/Render/Xhtml.php | 33 - .../Text/Wiki/Render/Xhtml/Anchor.php | 37 - .../Text/Wiki/Render/Xhtml/Blockquote.php | 46 - bundled-libs/Text/Wiki/Render/Xhtml/Bold.php | 34 - bundled-libs/Text/Wiki/Render/Xhtml/Break.php | 29 - .../Text/Wiki/Render/Xhtml/Center.php | 29 - bundled-libs/Text/Wiki/Render/Xhtml/Code.php | 102 -- .../Text/Wiki/Render/Xhtml/Colortext.php | 56 - .../Text/Wiki/Render/Xhtml/Deflist.php | 64 - .../Text/Wiki/Render/Xhtml/Delimiter.php | 23 - bundled-libs/Text/Wiki/Render/Xhtml/Embed.php | 23 - .../Text/Wiki/Render/Xhtml/Emphasis.php | 35 - .../Text/Wiki/Render/Xhtml/Freelink.php | 9 - .../Text/Wiki/Render/Xhtml/Function.php | 87 -- .../Text/Wiki/Render/Xhtml/Heading.php | 29 - bundled-libs/Text/Wiki/Render/Xhtml/Horiz.php | 28 - bundled-libs/Text/Wiki/Render/Xhtml/Html.php | 24 - bundled-libs/Text/Wiki/Render/Xhtml/Image.php | 151 -- .../Text/Wiki/Render/Xhtml/Include.php | 8 - .../Text/Wiki/Render/Xhtml/Interwiki.php | 74 - .../Text/Wiki/Render/Xhtml/Italic.php | 34 - bundled-libs/Text/Wiki/Render/Xhtml/List.php | 142 -- .../Text/Wiki/Render/Xhtml/Newline.php | 12 - .../Text/Wiki/Render/Xhtml/Paragraph.php | 36 - .../Text/Wiki/Render/Xhtml/Phplookup.php | 59 - .../Text/Wiki/Render/Xhtml/Prefilter.php | 40 - bundled-libs/Text/Wiki/Render/Xhtml/Raw.php | 23 - .../Text/Wiki/Render/Xhtml/Revise.php | 45 - .../Text/Wiki/Render/Xhtml/Strong.php | 35 - .../Text/Wiki/Render/Xhtml/Superscript.php | 34 - bundled-libs/Text/Wiki/Render/Xhtml/Table.php | 98 -- .../Text/Wiki/Render/Xhtml/Tighten.php | 10 - bundled-libs/Text/Wiki/Render/Xhtml/Toc.php | 80 -- bundled-libs/Text/Wiki/Render/Xhtml/Tt.php | 35 - bundled-libs/Text/Wiki/Render/Xhtml/Url.php | 91 -- .../Text/Wiki/Render/Xhtml/Wikilink.php | 137 -- bundled-libs/Text/Wiki/Rule.php | 345 ----- bundled-libs/Text/Wiki/Rule/blockquote.php | 209 --- bundled-libs/Text/Wiki/Rule/bold.php | 103 -- bundled-libs/Text/Wiki/Rule/break.php | 90 -- bundled-libs/Text/Wiki/Rule/center.php | 98 -- bundled-libs/Text/Wiki/Rule/code.php | 177 --- bundled-libs/Text/Wiki/Rule/colortext.php | 139 -- bundled-libs/Text/Wiki/Rule/deflist.php | 172 --- bundled-libs/Text/Wiki/Rule/delimiter.php | 95 -- bundled-libs/Text/Wiki/Rule/embed.php | 102 -- bundled-libs/Text/Wiki/Rule/emphasis.php | 103 -- bundled-libs/Text/Wiki/Rule/entities.php | 57 - bundled-libs/Text/Wiki/Rule/freelink.php | 179 --- bundled-libs/Text/Wiki/Rule/heading.php | 119 -- bundled-libs/Text/Wiki/Rule/horiz.php | 88 -- bundled-libs/Text/Wiki/Rule/html.php | 93 -- bundled-libs/Text/Wiki/Rule/image.php | 136 -- bundled-libs/Text/Wiki/Rule/include.php | 80 -- bundled-libs/Text/Wiki/Rule/interwiki.php | 194 --- bundled-libs/Text/Wiki/Rule/italic.php | 103 -- bundled-libs/Text/Wiki/Rule/list.php | 295 ---- bundled-libs/Text/Wiki/Rule/newline.php | 91 -- bundled-libs/Text/Wiki/Rule/paragraph.php | 141 -- bundled-libs/Text/Wiki/Rule/phpcode.php | 133 -- bundled-libs/Text/Wiki/Rule/phplookup.php | 93 -- bundled-libs/Text/Wiki/Rule/prefilter.php | 77 - bundled-libs/Text/Wiki/Rule/raw.php | 91 -- bundled-libs/Text/Wiki/Rule/revise.php | 182 --- bundled-libs/Text/Wiki/Rule/strong.php | 103 -- bundled-libs/Text/Wiki/Rule/superscript.php | 103 -- bundled-libs/Text/Wiki/Rule/table.php | 249 ---- bundled-libs/Text/Wiki/Rule/tighten.php | 50 - bundled-libs/Text/Wiki/Rule/toc.php | 352 ----- bundled-libs/Text/Wiki/Rule/tt.php | 102 -- bundled-libs/Text/Wiki/Rule/url.php | 316 ---- bundled-libs/Text/Wiki/Rule/wikilink.php | 241 ---- bundled-libs/docs/HomePage.wiki.txt | 263 ---- bundled-libs/docs/SamplePage.wiki.txt | 374 ----- bundled-libs/docs/SmashWordsTogether.wiki.txt | 1 - bundled-libs/docs/TextWikiProposal.wiki.txt | 151 -- bundled-libs/docs/TokenRuleKeys.wiki.txt | 57 - bundled-libs/docs/WikiPage.wiki.txt | 1 - .../docs/WordsSmashedTogether.wiki.txt | 1 - bundled-libs/docs/free links.wiki.txt | 1 - bundled-libs/docs/stylesheet.css | 69 - bundled-libs/tests/README | 4 - deployment/archives/.ignore | 0 deployment/comment.php | 9 - deployment/exit.php | 9 - deployment/index.php | 9 - deployment/rss.php | 9 - deployment/serendipity.css.php | 9 - deployment/serendipity_admin.php | 9 - .../serendipity_admin_image_selector.php | 9 - deployment/serendipity_config.inc.php | 11 - deployment/serendipity_xmlrpc.php | 9 - deployment/templates_c/.ignore | 0 deployment/uploads/.ignore | 0 deployment/wfwcomment.php | 9 - 206 files changed, 15434 deletions(-) delete mode 100644 bundled-libs/Text/BUNDLE_NOTICE delete mode 100644 bundled-libs/Text/Wiki.php delete mode 100644 bundled-libs/Text/Wiki/Parse.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Anchor.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Blockquote.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Bold.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Break.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Center.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Code.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Colortext.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Deflist.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Delimiter.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Embed.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Emphasis.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Freelink.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Function.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Heading.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Horiz.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Html.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Image.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Include.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Interwiki.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Italic.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/List.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Newline.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Paragraph.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Phplookup.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Prefilter.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Raw.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Revise.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Strong.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Superscript.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Table.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Tighten.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Toc.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Tt.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Url.php delete mode 100644 bundled-libs/Text/Wiki/Parse/Default/Wikilink.php delete mode 100644 bundled-libs/Text/Wiki/Render.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Anchor.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Blockquote.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Bold.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Break.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Center.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Code.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Colortext.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Deflist.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Delimiter.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Embed.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Emphasis.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Freelink.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Function.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Heading.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Horiz.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Html.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Image.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Include.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Interwiki.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Italic.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/List.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Newline.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Paragraph.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Phplookup.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Prefilter.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Raw.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Revise.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Strong.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Superscript.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Table.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Tighten.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Toc.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Tt.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Url.php delete mode 100644 bundled-libs/Text/Wiki/Render/Latex/Wikilink.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Anchor.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Blockquote.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Bold.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Break.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Center.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Code.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Colortext.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Deflist.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Delimiter.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Embed.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Emphasis.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Freelink.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Function.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Heading.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Horiz.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Html.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Image.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Include.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Interwiki.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Italic.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/List.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Newline.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Paragraph.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Phplookup.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Prefilter.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Raw.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Revise.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Strong.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Superscript.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Table.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Tighten.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Toc.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Tt.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Url.php delete mode 100644 bundled-libs/Text/Wiki/Render/Plain/Wikilink.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Anchor.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Blockquote.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Bold.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Break.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Center.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Code.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Colortext.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Deflist.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Delimiter.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Embed.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Emphasis.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Freelink.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Function.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Heading.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Horiz.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Html.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Image.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Include.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Interwiki.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Italic.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/List.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Newline.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Paragraph.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Phplookup.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Prefilter.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Raw.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Revise.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Strong.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Superscript.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Table.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Tighten.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Toc.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Tt.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Url.php delete mode 100644 bundled-libs/Text/Wiki/Render/Xhtml/Wikilink.php delete mode 100644 bundled-libs/Text/Wiki/Rule.php delete mode 100644 bundled-libs/Text/Wiki/Rule/blockquote.php delete mode 100644 bundled-libs/Text/Wiki/Rule/bold.php delete mode 100644 bundled-libs/Text/Wiki/Rule/break.php delete mode 100644 bundled-libs/Text/Wiki/Rule/center.php delete mode 100644 bundled-libs/Text/Wiki/Rule/code.php delete mode 100644 bundled-libs/Text/Wiki/Rule/colortext.php delete mode 100644 bundled-libs/Text/Wiki/Rule/deflist.php delete mode 100644 bundled-libs/Text/Wiki/Rule/delimiter.php delete mode 100644 bundled-libs/Text/Wiki/Rule/embed.php delete mode 100644 bundled-libs/Text/Wiki/Rule/emphasis.php delete mode 100644 bundled-libs/Text/Wiki/Rule/entities.php delete mode 100644 bundled-libs/Text/Wiki/Rule/freelink.php delete mode 100644 bundled-libs/Text/Wiki/Rule/heading.php delete mode 100644 bundled-libs/Text/Wiki/Rule/horiz.php delete mode 100644 bundled-libs/Text/Wiki/Rule/html.php delete mode 100644 bundled-libs/Text/Wiki/Rule/image.php delete mode 100644 bundled-libs/Text/Wiki/Rule/include.php delete mode 100644 bundled-libs/Text/Wiki/Rule/interwiki.php delete mode 100644 bundled-libs/Text/Wiki/Rule/italic.php delete mode 100644 bundled-libs/Text/Wiki/Rule/list.php delete mode 100644 bundled-libs/Text/Wiki/Rule/newline.php delete mode 100644 bundled-libs/Text/Wiki/Rule/paragraph.php delete mode 100644 bundled-libs/Text/Wiki/Rule/phpcode.php delete mode 100644 bundled-libs/Text/Wiki/Rule/phplookup.php delete mode 100644 bundled-libs/Text/Wiki/Rule/prefilter.php delete mode 100644 bundled-libs/Text/Wiki/Rule/raw.php delete mode 100644 bundled-libs/Text/Wiki/Rule/revise.php delete mode 100644 bundled-libs/Text/Wiki/Rule/strong.php delete mode 100644 bundled-libs/Text/Wiki/Rule/superscript.php delete mode 100644 bundled-libs/Text/Wiki/Rule/table.php delete mode 100644 bundled-libs/Text/Wiki/Rule/tighten.php delete mode 100644 bundled-libs/Text/Wiki/Rule/toc.php delete mode 100644 bundled-libs/Text/Wiki/Rule/tt.php delete mode 100644 bundled-libs/Text/Wiki/Rule/url.php delete mode 100644 bundled-libs/Text/Wiki/Rule/wikilink.php delete mode 100644 bundled-libs/docs/HomePage.wiki.txt delete mode 100644 bundled-libs/docs/SamplePage.wiki.txt delete mode 100644 bundled-libs/docs/SmashWordsTogether.wiki.txt delete mode 100644 bundled-libs/docs/TextWikiProposal.wiki.txt delete mode 100644 bundled-libs/docs/TokenRuleKeys.wiki.txt delete mode 100644 bundled-libs/docs/WikiPage.wiki.txt delete mode 100644 bundled-libs/docs/WordsSmashedTogether.wiki.txt delete mode 100644 bundled-libs/docs/free links.wiki.txt delete mode 100644 bundled-libs/docs/stylesheet.css delete mode 100644 bundled-libs/tests/README delete mode 100644 deployment/archives/.ignore delete mode 100644 deployment/comment.php delete mode 100644 deployment/exit.php delete mode 100644 deployment/index.php delete mode 100644 deployment/rss.php delete mode 100644 deployment/serendipity.css.php delete mode 100644 deployment/serendipity_admin.php delete mode 100644 deployment/serendipity_admin_image_selector.php delete mode 100644 deployment/serendipity_config.inc.php delete mode 100644 deployment/serendipity_xmlrpc.php delete mode 100644 deployment/templates_c/.ignore delete mode 100644 deployment/uploads/.ignore delete mode 100644 deployment/wfwcomment.php diff --git a/bundled-libs/Text/BUNDLE_NOTICE b/bundled-libs/Text/BUNDLE_NOTICE deleted file mode 100644 index 6d2fcfe4..00000000 --- a/bundled-libs/Text/BUNDLE_NOTICE +++ /dev/null @@ -1,7 +0,0 @@ -- Replace: -Wiki.php: -require_once 'Text/Wiki/Parse.php'; -require_once dirname(__FILE__) . '/Text/Wiki/Parse.php'; - -require_once 'Text/Wiki/Render.php'; -require_once dirname(__FILE__) . '/Wiki/Render.php'; diff --git a/bundled-libs/Text/Wiki.php b/bundled-libs/Text/Wiki.php deleted file mode 100644 index ffc84733..00000000 --- a/bundled-libs/Text/Wiki.php +++ /dev/null @@ -1,1271 +0,0 @@ - -* -* @license LGPL -* -* @version $Id: Wiki.php,v 1.27 2005/02/01 16:56:56 pmjones Exp $ -* -*/ - -/** -* The baseline abstract parser class. -*/ - -require_once dirname(__FILE__) . '/Wiki/Parse.php'; - -/** -* The baseline abstract render class. -*/ - -require_once dirname(__FILE__) . '/Wiki/Render.php'; - - -/** -* -* Parse structured wiki text and render into arbitrary formats such as XHTML. -* -* This is the "master" class for handling the management and convenience -* functions to transform Wiki-formatted text. -* -* @category Text -* -* @package Text_Wiki -* -* @version 0.25.0 beta -* -*/ - -class Text_Wiki { - - /** - * - * The default list of rules, in order, to apply to the source text. - * - * @access public - * - * @var array - * - */ - - var $rules = array( - 'Prefilter', - 'Delimiter', - 'Code', - 'Function', - 'Html', - 'Raw', - 'Include', - 'Embed', - 'Anchor', - 'Heading', - 'Toc', - 'Horiz', - 'Break', - 'Blockquote', - 'List', - 'Deflist', - 'Table', - 'Image', - 'Phplookup', - 'Center', - 'Newline', - 'Paragraph', - 'Url', - 'Freelink', - 'Interwiki', - 'Wikilink', - 'Colortext', - 'Strong', - 'Bold', - 'Emphasis', - 'Italic', - 'Tt', - 'Superscript', - 'Revise', - 'Tighten' - ); - - - /** - * - * The list of rules to not-apply to the source text. - * - * @access public - * - * @var array - * - */ - - var $disable = array( - 'Html', - 'Include', - 'Embed' - ); - - - /** - * - * Custom configuration for rules at the parsing stage. - * - * In this array, the key is the parsing rule name, and the value is - * an array of key-value configuration pairs corresponding to the $conf - * property in the target parsing rule. - * - * For example: - * - * - * $parseConf = array( - * 'Include' => array( - * 'base' => '/path/to/scripts/' - * ) - * ); - * - * - * Note that most default rules do not need any parsing configuration. - * - * @access public - * - * @var array - * - */ - - var $parseConf = array(); - - - /** - * - * Custom configuration for rules at the rendering stage. - * - * Because rendering may be different for each target format, the - * first-level element in this array is always a format name (e.g., - * 'Xhtml'). - * - * Within that first level element, the subsequent elements match the - * $parseConf format. That is, the sub-key is the rendering rule name, - * and the sub-value is an array of key-value configuration pairs - * corresponding to the $conf property in the target rendering rule. - * - * @access public - * - * @var array - * - */ - - var $renderConf = array( - 'Docbook' => array(), - 'Latex' => array(), - 'Pdf' => array(), - 'Plain' => array(), - 'Rtf' => array(), - 'Xhtml' => array() - ); - - - /** - * - * Custom configuration for the output format itself. - * - * Even though Text_Wiki will render the tokens from parsed text, - * the format itself may require some configuration. For example, - * RTF needs to know font names and sizes, PDF requires page layout - * information, and DocBook needs a section hierarchy. This array - * matches the $conf property of the the format-level renderer - * (e.g., Text_Wiki_Render_Xhtml). - * - * In this array, the key is the rendering format name, and the value is - * an array of key-value configuration pairs corresponding to the $conf - * property in the rendering format rule. - * - * @access public - * - * @var array - * - */ - - var $formatConf = array( - 'Docbook' => array(), - 'Latex' => array(), - 'Pdf' => array(), - 'Plain' => array(), - 'Rtf' => array(), - 'Xhtml' => array() - ); - - - /** - * - * The delimiter for token numbers of parsed elements in source text. - * - * @access public - * - * @var string - * - */ - - var $delim = "\xFF"; - - - /** - * - * The tokens generated by rules as the source text is parsed. - * - * As Text_Wiki applies rule classes to the source text, it will - * replace portions of the text with a delimited token number. This - * is the array of those tokens, representing the replaced text and - * any options set by the parser for that replaced text. - * - * The tokens array is sequential; each element is itself a sequential - * array where element 0 is the name of the rule that generated the - * token, and element 1 is an associative array where the key is an - * option name and the value is an option value. - * - * @access private - * - * @var array - * - */ - - var $tokens = array(); - - - /** - * - * The source text to which rules will be applied. - * - * This text will be transformed in-place, which means that it will - * change as the rules are applied. - * - * @access private - * - * @var string - * - */ - - var $source = ''; - - - /** - * - * Array of rule parsers. - * - * Text_Wiki creates one instance of every rule that is applied to - * the source text; this array holds those instances. The array key - * is the rule name, and the array value is an instance of the rule - * class. - * - * @access private - * - * @var array - * - */ - - var $parseObj = array(); - - - /** - * - * Array of rule renderers. - * - * Text_Wiki creates one instance of every rule that is applied to - * the source text; this array holds those instances. The array key - * is the rule name, and the array value is an instance of the rule - * class. - * - * @access private - * - * @var array - * - */ - - var $renderObj = array(); - - - /** - * - * Array of format renderers. - * - * @access private - * - * @var array - * - */ - - var $formatObj = array(); - - - /** - * - * Array of paths to search, in order, for parsing and rendering rules. - * - * @access private - * - * @var array - * - */ - - var $path = array( - 'parse' => array(), - 'render' => array() - ); - - - - /** - * - * The directory separator character. - * - * @access private - * - * @var string - * - */ - - var $_dirSep = DIRECTORY_SEPARATOR; - - - /** - * - * Constructor. - * - * @access public - * - * @param array $rules The set of rules to load for this object. - * - */ - - function Text_Wiki($rules = null) - { - if (is_array($rules)) { - $this->rules = $rules; - } - - $this->addPath( - 'parse', - $this->fixPath(dirname(__FILE__)) . 'Wiki/Parse/Default/' - ); - - $this->addPath( - 'render', - $this->fixPath(dirname(__FILE__)) . 'Wiki/Render/' - ); - - } - - - /** - * - * Set parser configuration for a specific rule and key. - * - * @access public - * - * @param string $rule The parse rule to set config for. - * - * @param array|string $arg1 The full config array to use for the - * parse rule, or a conf key in that array. - * - * @param string $arg2 The config value for the key. - * - * @return void - * - */ - - function setParseConf($rule, $arg1, $arg2 = null) - { - $rule = ucwords(strtolower($rule)); - - if (! isset($this->parseConf[$rule])) { - $this->parseConf[$rule] = array(); - } - - // if first arg is an array, use it as the entire - // conf array for the rule. otherwise, treat arg1 - // as a key and arg2 as a value for the rule conf. - if (is_array($arg1)) { - $this->parseConf[$rule] = $arg1; - } else { - $this->parseConf[$rule][$arg1] = $arg2; - } - } - - - /** - * - * Get parser configuration for a specific rule and key. - * - * @access public - * - * @param string $rule The parse rule to get config for. - * - * @param string $key A key in the conf array; if null, - * returns the entire conf array. - * - * @return mixed The whole conf array if no key is specified, - * or the specific conf key value. - * - */ - - function getParseConf($rule, $key = null) - { - $rule = ucwords(strtolower($rule)); - - // the rule does not exist - if (! isset($this->parseConf[$rule])) { - return null; - } - - // no key requested, return the whole array - if (is_null($key)) { - return $this->parseConf[$rule]; - } - - // does the requested key exist? - if (isset($this->parseConf[$rule][$key])) { - // yes, return that value - return $this->parseConf[$rule][$key]; - } else { - // no - return null; - } - } - - - /** - * - * Set renderer configuration for a specific format, rule, and key. - * - * @access public - * - * @param string $format The render format to set config for. - * - * @param string $rule The render rule to set config for in the format. - * - * @param array|string $arg1 The config array, or the config key - * within the render rule. - * - * @param string $arg2 The config value for the key. - * - * @return void - * - */ - - function setRenderConf($format, $rule, $arg1, $arg2 = null) - { - $format = ucwords(strtolower($format)); - $rule = ucwords(strtolower($rule)); - - if (! isset($this->renderConf[$format])) { - $this->renderConf[$format] = array(); - } - - if (! isset($this->renderConf[$format][$rule])) { - $this->renderConf[$format][$rule] = array(); - } - - // if first arg is an array, use it as the entire - // conf array for the render rule. otherwise, treat arg1 - // as a key and arg2 as a value for the render rule conf. - if (is_array($arg1)) { - $this->renderConf[$format][$rule] = $arg1; - } else { - $this->renderConf[$format][$rule][$arg1] = $arg2; - } - } - - - /** - * - * Get renderer configuration for a specific format, rule, and key. - * - * @access public - * - * @param string $format The render format to get config for. - * - * @param string $rule The render format rule to get config for. - * - * @param string $key A key in the conf array; if null, - * returns the entire conf array. - * - * @return mixed The whole conf array if no key is specified, - * or the specific conf key value. - * - */ - - function getRenderConf($format, $rule, $key = null) - { - $format = ucwords(strtolower($format)); - $rule = ucwords(strtolower($rule)); - - if (! isset($this->renderConf[$format]) || - ! isset($this->renderConf[$format][$rule])) { - return null; - } - - // no key requested, return the whole array - if (is_null($key)) { - return $this->renderConf[$format][$rule]; - } - - // does the requested key exist? - if (isset($this->renderConf[$format][$rule][$key])) { - // yes, return that value - return $this->renderConf[$format][$rule][$key]; - } else { - // no - return null; - } - - } - - /** - * - * Set format configuration for a specific rule and key. - * - * @access public - * - * @param string $format The format to set config for. - * - * @param string $key The config key within the format. - * - * @param string $val The config value for the key. - * - * @return void - * - */ - - function setFormatConf($format, $arg1, $arg2 = null) - { - if (! is_array($this->formatConf[$format])) { - $this->formatConf[$format] = array(); - } - - // if first arg is an array, use it as the entire - // conf array for the format. otherwise, treat arg1 - // as a key and arg2 as a value for the format conf. - if (is_array($arg1)) { - $this->formatConf[$format] = $arg1; - } else { - $this->formatConf[$format][$arg1] = $arg2; - } - } - - - - /** - * - * Get configuration for a specific format and key. - * - * @access public - * - * @param string $format The format to get config for. - * - * @param mixed $key A key in the conf array; if null, - * returns the entire conf array. - * - * @return mixed The whole conf array if no key is specified, - * or the specific conf key value. - * - */ - - function getFormatConf($format, $key = null) - { - // the format does not exist - if (! isset($this->formatConf[$format])) { - return null; - } - - // no key requested, return the whole array - if (is_null($key)) { - return $this->formatConf[$format]; - } - - // does the requested key exist? - if (isset($this->formatConf[$format][$key])) { - // yes, return that value - return $this->formatConf[$format][$key]; - } else { - // no - return null; - } - } - - - /** - * - * Inserts a rule into to the rule set. - * - * @access public - * - * @param string $name The name of the rule. Should be different from - * all other keys in the rule set. - * - * @param string $tgt The rule after which to insert this new rule. By - * default (null) the rule is inserted at the end; if set to '', inserts - * at the beginning. - * - * @return void - * - */ - - function insertRule($name, $tgt = null) - { - $name = ucwords(strtolower($name)); - if (! is_null($tgt)) { - $tgt = ucwords(strtolower($tgt)); - } - - // does the rule name to be inserted already exist? - if (in_array($name, $this->rules)) { - // yes, return - return null; - } - - // the target name is not null, and not '', but does not exist - // in the list of rules. this means we're trying to insert after - // a target key, but the target key isn't there. - if (! is_null($tgt) && $tgt != '' && - ! in_array($tgt, $this->rules)) { - return false; - } - - // if $tgt is null, insert at the end. We know this is at the - // end (instead of resetting an existing rule) becuase we exited - // at the top of this method if the rule was already in place. - if (is_null($tgt)) { - $this->rules[] = $name; - return true; - } - - // save a copy of the current rules, then reset the rule set - // so we can insert in the proper place later. - // where to insert the rule? - if ($tgt == '') { - // insert at the beginning - array_unshift($this->rules, $name); - return true; - } - - // insert after the named rule - $tmp = $this->rules; - $this->rules = array(); - - foreach ($tmp as $val) { - $this->rules[] = $val; - if ($val == $tgt) { - $this->rules[] = $name; - } - } - - return true; - - } - - - /** - * - * Delete (remove or unset) a rule from the $rules property. - * - * @access public - * - * @param string $rule The name of the rule to remove. - * - * @return void - * - */ - - function deleteRule($name) - { - $name = ucwords(strtolower($name)); - $key = array_search($name, $this->rules); - if ($key !== false) { - unset($this->rules[$key]); - } - } - - - /** - * - * Change from one rule to another in-place. - * - * @access public - * - * @param string $old The name of the rule to change from. - * - * @param string $new The name of the rule to change to. - * - * @return void - * - */ - - function changeRule($old, $new) - { - $old = ucwords(strtolower($old)); - $new = ucwords(strtolower($new)); - $key = array_search($old, $this->rules); - if ($key !== false) { - $this->rules[$old] = $new; - } - } - - - /** - * - * Enables a rule so that it is applied when parsing. - * - * @access public - * - * @param string $rule The name of the rule to enable. - * - * @return void - * - */ - - function enableRule($name) - { - $name = ucwords(strtolower($name)); - $key = array_search($name, $this->disable); - if ($key !== false) { - unset($this->disable[$key]); - } - } - - - /** - * - * Disables a rule so that it is not applied when parsing. - * - * @access public - * - * @param string $rule The name of the rule to disable. - * - * @return void - * - */ - - function disableRule($name) - { - $name = ucwords(strtolower($name)); - $key = array_search($name, $this->disable); - if ($key === false) { - $this->disable[] = $name; - } - } - - - /** - * - * Parses and renders the text passed to it, and returns the results. - * - * First, the method parses the source text, applying rules to the - * text as it goes. These rules will modify the source text - * in-place, replacing some text with delimited tokens (and - * populating the $this->tokens array as it goes). - * - * Next, the method renders the in-place tokens into the requested - * output format. - * - * Finally, the method returns the transformed text. Note that the - * source text is transformed in place; once it is transformed, it is - * no longer the same as the original source text. - * - * @access public - * - * @param string $text The source text to which wiki rules should be - * applied, both for parsing and for rendering. - * - * @param string $format The target output format, typically 'xhtml'. - * If a rule does not support a given format, the output from that - * rule is rule-specific. - * - * @return string The transformed wiki text. - * - */ - - function transform($text, $format = 'Xhtml') - { - $this->parse($text); - return $this->render($format); - } - - - /** - * - * Sets the $_source text property, then parses it in place and - * retains tokens in the $_tokens array property. - * - * @access public - * - * @param string $text The source text to which wiki rules should be - * applied, both for parsing and for rendering. - * - * @return void - * - */ - - function parse($text) - { - // set the object property for the source text - $this->source = $text; - - // reset the tokens. - $this->tokens = array(); - - // apply the parse() method of each requested rule to the source - // text. - foreach ($this->rules as $name) { - // do not parse the rules listed in $disable - if (! in_array($name, $this->disable)) { - - // load the parsing object - $this->loadParseObj($name); - - // load may have failed; only parse if - // an object is in the array now - if (is_object($this->parseObj[$name])) { - $this->parseObj[$name]->parse(); - } - } - } - } - - - /** - * - * Renders tokens back into the source text, based on the requested format. - * - * @access public - * - * @param string $format The target output format, typically 'xhtml'. - * If a rule does not support a given format, the output from that - * rule is rule-specific. - * - * @return string The transformed wiki text. - * - */ - - function render($format = 'Xhtml') - { - // the rendering method we're going to use from each rule - $format = ucwords(strtolower($format)); - - // the eventual output text - $output = ''; - - // when passing through the parsed source text, keep track of when - // we are in a delimited section - $in_delim = false; - - // when in a delimited section, capture the token key number - $key = ''; - - // load the format object - $this->loadFormatObj($format); - - // pre-rendering activity - if (is_object($this->formatObj[$format])) { - $output .= $this->formatObj[$format]->pre(); - } - - // load the render objects - foreach (array_keys($this->parseObj) as $rule) { - $this->loadRenderObj($format, $rule); - } - - // pass through the parsed source text character by character - $k = strlen($this->source); - for ($i = 0; $i < $k; $i++) { - - // the current character - $char = $this->source{$i}; - - // are alredy in a delimited section? - if ($in_delim) { - - // yes; are we ending the section? - if ($char == $this->delim) { - - // yes, get the replacement text for the delimited - // token number and unset the flag. - $key = (int)$key; - $rule = $this->tokens[$key][0]; - $opts = $this->tokens[$key][1]; - $output .= $this->renderObj[$rule]->token($opts); - $in_delim = false; - - } else { - - // no, add to the dlimited token key number - $key .= $char; - - } - - } else { - - // not currently in a delimited section. - // are we starting into a delimited section? - if ($char == $this->delim) { - // yes, reset the previous key and - // set the flag. - $key = ''; - $in_delim = true; - } else { - // no, add to the output as-is - $output .= $char; - } - } - } - - // post-rendering activity - if (is_object($this->formatObj[$format])) { - $output .= $this->formatObj[$format]->post(); - } - - // return the rendered source text. - return $output; - } - - - /** - * - * Returns the parsed source text with delimited token placeholders. - * - * @access public - * - * @return string The parsed source text. - * - */ - - function getSource() - { - return $this->source; - } - - - /** - * - * Returns tokens that have been parsed out of the source text. - * - * @access public - * - * @param array $rules If an array of rule names is passed, only return - * tokens matching these rule names. If no array is passed, return all - * tokens. - * - * @return array An array of tokens. - * - */ - - function getTokens($rules = null) - { - if (is_null($rules)) { - return $this->tokens; - } else { - settype($rules, 'array'); - $result = array(); - foreach ($this->tokens as $key => $val) { - if (in_array($val[0], $rules)) { - $result[] = $val; - } - } - return $result; - } - } - - - /** - * - * Add a token to the Text_Wiki tokens array, and return a delimited - * token number. - * - * @access public - * - * @param array $options An associative array of options for the new - * token array element. The keys and values are specific to the - * rule, and may or may not be common to other rule options. Typical - * options keys are 'text' and 'type' but may include others. - * - * @param boolean $id_only If true, return only the token number, not - * a delimited token string. - * - * @return string|int By default, return the number of the - * newly-created token array element with a delimiter prefix and - * suffix; however, if $id_only is set to true, return only the token - * number (no delimiters). - * - */ - - function addToken($rule, $options = array(), $id_only = false) - { - // increment the token ID number. note that if you parse - // multiple times with the same Text_Wiki object, the ID number - // will not reset to zero. - static $id; - if (! isset($id)) { - $id = 0; - } else { - $id ++; - } - - // force the options to be an array - settype($options, 'array'); - - // add the token - $this->tokens[$id] = array( - 0 => $rule, - 1 => $options - ); - - // return a value - if ($id_only) { - // return the last token number - return $id; - } else { - // return the token number with delimiters - return $this->delim . $id . $this->delim; - } - } - - - /** - * - * Set or re-set a token with specific information, overwriting any - * previous rule name and rule options. - * - * @access public - * - * @param int $id The token number to reset. - * - * @param int $rule The rule name to use. - * - * @param array $options An associative array of options for the - * token array element. The keys and values are specific to the - * rule, and may or may not be common to other rule options. Typical - * options keys are 'text' and 'type' but may include others. - * - * @return void - * - */ - - function setToken($id, $rule, $options = array()) - { - // reset the token - $this->tokens[$id] = array( - 0 => $rule, - 1 => $options - ); - } - - - /** - * - * Load a rule parser class file. - * - * @access public - * - * @return bool True if loaded, false if not. - * - */ - - function loadParseObj($rule) - { - $rule = ucwords(strtolower($rule)); - $file = $rule . '.php'; - $class = "Text_Wiki_Parse_$rule"; - - if (! class_exists($class)) { - $loc = $this->findFile('parse', $file); - if ($loc) { - // found the class - include_once $loc; - } else { - // can't find the class - $this->parseObj[$rule] = null; - return false; - } - } - - $this->parseObj[$rule] = new $class($this); - - } - - - /** - * - * Load a rule-render class file. - * - * @access public - * - * @return bool True if loaded, false if not. - * - */ - - function loadRenderObj($format, $rule) - { - $format = ucwords(strtolower($format)); - $rule = ucwords(strtolower($rule)); - $file = "$format/$rule.php"; - $class = "Text_Wiki_Render_$format" . "_$rule"; - - if (! class_exists($class)) { - // load the class - $loc = $this->findFile('render', $file); - if ($loc) { - // found the class - include_once $loc; - } else { - // can't find the class - return false; - } - } - - $this->renderObj[$rule] = new $class($this); - } - - - /** - * - * Load a format-render class file. - * - * @access public - * - * @return bool True if loaded, false if not. - * - */ - - function loadFormatObj($format) - { - $format = ucwords(strtolower($format)); - $file = $format . '.php'; - $class = "Text_Wiki_Render_$format"; - - if (! class_exists($class)) { - $loc = $this->findFile('render', $file); - if ($loc) { - // found the class - include_once $loc; - } else { - // can't find the class - return false; - } - } - - $this->formatObj[$format] = new $class($this); - } - - - /** - * - * Add a path to a path array. - * - * @access public - * - * @param string $type The path-type to add (parse or render). - * - * @param string $dir The directory to add to the path-type. - * - * @return void - * - */ - - function addPath($type, $dir) - { - $dir = $this->fixPath($dir); - if (! isset($this->path[$type])) { - $this->path[$type] = array($dir); - } else { - array_unshift($this->path[$type], $dir); - } - } - - - /** - * - * Get the current path array for a path-type. - * - * @access public - * - * @param string $type The path-type to look up (plugin, filter, or - * template). If not set, returns all path types. - * - * @return array The array of paths for the requested type. - * - */ - - function getPath($type = null) - { - if (is_null($type)) { - return $this->path; - } elseif (! isset($this->path[$type])) { - return array(); - } else { - return $this->path[$type]; - } - } - - - /** - * - * Searches a series of paths for a given file. - * - * @param array $type The type of paths to search (template, plugin, - * or filter). - * - * @param string $file The file name to look for. - * - * @return string|bool The full path and file name for the target file, - * or boolean false if the file is not found in any of the paths. - * - */ - - function findFile($type, $file) - { - // get the set of paths - $set = $this->getPath($type); - - // start looping through them - foreach ($set as $path) { - $fullname = $path . $file; - if (file_exists($fullname) && is_readable($fullname)) { - return $fullname; - } - } - - // could not find the file in the set of paths - return false; - } - - - /** - * - * Append a trailing '/' to paths, unless the path is empty. - * - * @access private - * - * @param string $path The file path to fix - * - * @return string The fixed file path - * - */ - - function fixPath($path) - { - $len = strlen($this->_dirSep); - - if (! empty($path) && - substr($path, -1 * $len, $len) != $this->_dirSep) { - return $path . $this->_dirSep; - } else { - return $path; - } - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse.php b/bundled-libs/Text/Wiki/Parse.php deleted file mode 100644 index 53c0ae8d..00000000 --- a/bundled-libs/Text/Wiki/Parse.php +++ /dev/null @@ -1,253 +0,0 @@ - -* -* @package Text_Wiki -* -* $Id: Parse.php,v 1.2 2004/09/25 19:05:13 pmjones Exp $ -* -*/ - -class Text_Wiki_Parse { - - - /** - * - * Configuration options for this parser rule. - * - * @access public - * - * @var string - * - */ - - var $conf = array(); - - - /** - * - * Regular expression to find matching text for this rule. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = null; - - - /** - * - * The name of this rule for new token array elements. - * - * @access public - * - * @var string - * - */ - - var $rule = null; - - - /** - * - * A reference to the calling Text_Wiki object. - * - * This is needed so that each rule has access to the same source - * text, token set, URLs, interwiki maps, page names, etc. - * - * @access public - * - * @var object - */ - - var $wiki = null; - - - /** - * - * Constructor for this parser rule. - * - * @access public - * - * @param object &$obj The calling "parent" Text_Wiki object. - * - */ - - function Text_Wiki_Parse(&$obj) - { - // set the reference to the calling Text_Wiki object; - // this allows us access to the shared source text, token - // array, etc. - $this->wiki =& $obj; - - // set the name of this rule; generally used when adding - // to the tokens array. strip off the Text_Wiki_Parse_ portion. - // text_wiki_parse_ - // 0123456789012345 - $tmp = substr(get_class($this), 16); - $this->rule = ucwords(strtolower($tmp)); - - // override config options for the rule if specified - if (isset($this->wiki->parseConf[$this->rule]) && - is_array($this->wiki->parseConf[$this->rule])) { - - $this->conf = array_merge( - $this->conf, - $this->wiki->parseConf[$this->rule] - ); - - } - } - - - /** - * - * Abstrct method to parse source text for matches. - * - * Applies the rule's regular expression to the source text, passes - * every match to the process() method, and replaces the matched text - * with the results of the processing. - * - * @access public - * - * @see Text_Wiki_Parse::process() - * - */ - - function parse() - { - $this->wiki->source = preg_replace_callback( - $this->regex, - array(&$this, 'process'), - $this->wiki->source - ); - } - - - /** - * - * Abstract method to generate replacements for matched text. - * - * @access public - * - * @param array $matches An array of matches from the parse() method - * as generated by preg_replace_callback. $matches[0] is the full - * matched string, $matches[1] is the first matched pattern, - * $matches[2] is the second matched pattern, and so on. - * - * @return string The processed text replacement; defaults to the - * full matched string (i.e., no changes to the text). - * - * @see Text_Wiki_Parse::parse() - * - */ - - function process(&$matches) - { - return $matches[0]; - } - - - /** - * - * Simple method to safely get configuration key values. - * - * @access public - * - * @param string $key The configuration key. - * - * @param mixed $default If the key does not exist, return this value - * instead. - * - * @return mixed The configuration key value (if it exists) or the - * default value (if not). - * - */ - - function getConf($key, $default = null) - { - if (isset($this->conf[$key])) { - return $this->conf[$key]; - } else { - return $default; - } - } - - - /** - * - * Extract 'attribute="value"' portions of wiki markup. - * - * This kind of markup is typically used only in macros, but is useful - * anywhere. - * - * The syntax is pretty strict; there can be no spaces between the - * option name, the equals, and the first double-quote; the value - * must be surrounded by double-quotes. You can escape characters in - * the value with a backslash, and the backslash will be stripped for - * you. - * - * @access public - * - * @param string $text The "attributes" portion of markup. - * - * @return array An associative array of key-value pairs where the - * key is the option name and the value is the option value. - * - */ - - function getAttrs($text) - { - // find the =" sections; - $tmp = explode('="', trim($text)); - - // basic setup - $k = count($tmp) - 1; - $attrs = array(); - $key = null; - - // loop through the sections - foreach ($tmp as $i => $val) { - - // first element is always the first key - if ($i == 0) { - $key = trim($val); - continue; - } - - // find the last double-quote in the value. - // the part to the left is the value for the last key, - // the part to the right is the next key name - $pos = strrpos($val, '"'); - $attrs[$key] = stripslashes(substr($val, 0, $pos)); - $key = trim(substr($val, $pos+1)); - - } - - return $attrs; - - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Anchor.php b/bundled-libs/Text/Wiki/Parse/Default/Anchor.php deleted file mode 100644 index c7fe46ee..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Anchor.php +++ /dev/null @@ -1,67 +0,0 @@ - -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Anchor extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to find source text matching this - * rule. Looks like a macro: [[# anchor_name]] - * - * @access public - * - * @var string - * - */ - - var $regex = '/(\[\[# )([-_A-Za-z0-9.]+?)( .+)?(\]\])/i'; - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text, not including the tags. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) { - - $name = $matches[2]; - $text = $matches[3]; - - $start = $this->wiki->addToken( - $this->rule, - array('type' => 'start', 'name' => $name) - ); - - $end = $this->wiki->addToken( - $this->rule, - array('type' => 'end', 'name' => $name) - ); - - // done, place the script output directly in the source - return $start . trim($text) . $end; - } -} -?> diff --git a/bundled-libs/Text/Wiki/Parse/Default/Blockquote.php b/bundled-libs/Text/Wiki/Parse/Default/Blockquote.php deleted file mode 100644 index 5029b049..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Blockquote.php +++ /dev/null @@ -1,163 +0,0 @@ -' at the start of the line, followed by a space, -* and then the quote text; each '>' indicates an additional level of -* quoting. -* -* $Id: Blockquote.php,v 1.1 2005/01/31 15:46:52 pmjones Exp $ -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Blockquote extends Text_Wiki_Parse { - - - /** - * - * Regex for parsing the source text. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/\n((\>).*\n)(?!(\>))/Us'; - - - /** - * - * Generates a replacement for the matched text. - * - * Token options are: - * - * 'type' => - * 'start' : the start of a blockquote - * 'end' : the end of a blockquote - * - * 'level' => the indent level (0 for the first level, 1 for the - * second, etc) - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A series of text and delimited tokens marking the different - * list text and list elements. - * - */ - - function process(&$matches) - { - // the replacement text we will return to parse() - $return = ''; - - // the list of post-processing matches - $list = array(); - - // $matches[1] is the text matched as a list set by parse(); - // create an array called $list that contains a new set of - // matches for the various list-item elements. - preg_match_all( - '=^(\>+) (.*\n)=Ums', - $matches[1], - $list, - PREG_SET_ORDER - ); - - // a stack of starts and ends; we keep this so that we know what - // indent level we're at. - $stack = array(); - - // loop through each list-item element. - foreach ($list as $key => $val) { - - // $val[0] is the full matched list-item line - // $val[1] is the number of initial '>' chars (indent level) - // $val[2] is the quote text - - // we number levels starting at 1, not zero - $level = strlen($val[1]); - - // get the text of the line - $text = $val[2]; - - // add a level to the list? - while ($level > count($stack)) { - - // the current indent level is greater than the number - // of stack elements, so we must be starting a new - // level. push the new level onto the stack with a - // dummy value (boolean true)... - array_push($stack, true); - - $return .= "\n"; - - // ...and add a start token to the return. - $return .= $this->wiki->addToken( - $this->rule, - array( - 'type' => 'start', - 'level' => $level - 1 - ) - ); - - $return .= "\n\n"; - } - - // remove a level? - while (count($stack) > $level) { - - // as long as the stack count is greater than the - // current indent level, we need to end list types. - // continue adding end-list tokens until the stack count - // and the indent level are the same. - array_pop($stack); - - $return .= "\n\n"; - - $return .= $this->wiki->addToken( - $this->rule, - array ( - 'type' => 'end', - 'level' => count($stack) - ) - ); - - $return .= "\n"; - } - - // add the line text. - $return .= $text; - } - - // the last line may have been indented. go through the stack - // and create end-tokens until the stack is empty. - $return .= "\n"; - - while (count($stack) > 0) { - array_pop($stack); - $return .= $this->wiki->addToken( - $this->rule, - array ( - 'type' => 'end', - 'level' => count($stack) - ) - ); - } - - // we're done! send back the replacement text. - return "\n$return\n\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Bold.php b/bundled-libs/Text/Wiki/Parse/Default/Bold.php deleted file mode 100644 index 62f77082..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Bold.php +++ /dev/null @@ -1,61 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Bold extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/'''(()|[^'].*)'''/U"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A pair of delimited tokens to be used as a placeholder in - * the source text surrounding the text to be emphasized. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken($this->rule, array('type' => 'start')); - $end = $this->wiki->addToken($this->rule, array('type' => 'end')); - return $start . $matches[1] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Break.php b/bundled-libs/Text/Wiki/Parse/Default/Break.php deleted file mode 100644 index 86264edf..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Break.php +++ /dev/null @@ -1,54 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Break extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/ _\n/'; - - - /** - * - * Generates a replacement token for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A delimited token to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - return $this->wiki->addToken($this->rule); - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Center.php b/bundled-libs/Text/Wiki/Parse/Default/Center.php deleted file mode 100644 index d7d3148d..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Center.php +++ /dev/null @@ -1,60 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Center extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = '/\n\= (.*?)\n/'; - - /** - * - * Generates a token entry for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, - array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, - array('type' => 'end') - ); - - return "\n" . $start . $matches[1] . $end . "\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Code.php b/bundled-libs/Text/Wiki/Parse/Default/Code.php deleted file mode 100644 index 0e51dcf1..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Code.php +++ /dev/null @@ -1,81 +0,0 @@ - on a line by itself, -* followed by the inline code example, and terminated with the string -* on a line by itself. The code example is run through the -* native PHP highlight_string() function to colorize it, then surrounded -* with
...
tags when rendered as XHTML. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Code extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = '/^(\)\n(.+)\n(\<\/code\>)(\s|$)/Umsi'; - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text, not including the tags. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - // are there additional attribute arguments? - $args = trim($matches[2]); - - if ($args == '') { - $options = array( - 'text' => $matches[3], - 'attr' => array('type' => '') - ); - } else { - // get the attributes... - $attr = $this->getAttrs($args); - - // ... and make sure we have a 'type' - if (! isset($attr['type'])) { - $attr['type'] = ''; - } - - // retain the options - $options = array( - 'text' => $matches[3], - 'attr' => $attr - ); - } - - return $this->wiki->addToken($this->rule, $options) . $matches[5]; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Colortext.php b/bundled-libs/Text/Wiki/Parse/Default/Colortext.php deleted file mode 100644 index 1b0ff695..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Colortext.php +++ /dev/null @@ -1,74 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse { - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\#\#(.+?)\|(.+?)\#\#/"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * 'color' => the color indicator - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the text to be - * emphasized. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, - array( - 'type' => 'start', - 'color' => $matches[1] - ) - ); - - $end = $this->wiki->addToken( - $this->rule, - array( - 'type' => 'end', - 'color' => $matches[1] - ) - ); - - return $start . $matches[2] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Deflist.php b/bundled-libs/Text/Wiki/Parse/Default/Deflist.php deleted file mode 100644 index 2bd5969e..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Deflist.php +++ /dev/null @@ -1,104 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Deflist extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/\n((: ).*\n)(?!(: |\n))/Us'; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => - * 'list_start' : the start of a definition list - * 'list_end' : the end of a definition list - * 'term_start' : the start of a definition term - * 'term_end' : the end of a definition term - * 'narr_start' : the start of definition narrative - * 'narr_end' : the end of definition narrative - * 'unknown' : unknown type of definition portion - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A series of text and delimited tokens marking the different - * list text and list elements. - * - */ - - function process(&$matches) - { - // the replacement text we will return to parse() - $return = ''; - - // the list of post-processing matches - $list = array(); - - // start the deflist - $options = array('type' => 'list_start'); - $return .= $this->wiki->addToken($this->rule, $options); - - // $matches[1] is the text matched as a list set by parse(); - // create an array called $list that contains a new set of - // matches for the various definition-list elements. - preg_match_all( - '/^(: )(.*)?( : )(.*)?$/Ums', - $matches[1], - $list, - PREG_SET_ORDER - ); - - // add each term and narrative - foreach ($list as $key => $val) { - $return .= ( - $this->wiki->addToken($this->rule, array('type' => 'term_start')) . - trim($val[2]) . - $this->wiki->addToken($this->rule, array('type' => 'term_end')) . - $this->wiki->addToken($this->rule, array('type' => 'narr_start')) . - trim($val[4]) . - $this->wiki->addToken($this->rule, array('type' => 'narr_end')) - ); - } - - - // end the deflist - $options = array('type' => 'list_end'); - $return .= $this->wiki->addToken($this->rule, $options); - - // done! - return "\n" . $return . "\n\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Delimiter.php b/bundled-libs/Text/Wiki/Parse/Default/Delimiter.php deleted file mode 100644 index 82366f9f..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Delimiter.php +++ /dev/null @@ -1,62 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Delimiter extends Text_Wiki_Parse { - - /** - * - * Constructor. Overrides the Text_Wiki_Parse constructor so that we - * can set the $regex property dynamically (we need to include the - * Text_Wiki $delim character. - * - * @param object &$obj The calling "parent" Text_Wiki object. - * - * @param string $name The token name to use for this rule. - * - */ - - function Text_Wiki_Parse_delimiter(&$obj) - { - parent::Text_Wiki_Parse($obj); - $this->regex = '/' . $this->wiki->delim . '/'; - } - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - return $this->wiki->addToken( - $this->rule, - array('text' => $this->wiki->delim) - ); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Embed.php b/bundled-libs/Text/Wiki/Parse/Default/Embed.php deleted file mode 100644 index ab83094a..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Embed.php +++ /dev/null @@ -1,88 +0,0 @@ - or other similar tags. Be -* careful. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Embed extends Text_Wiki_Parse { - - var $conf = array( - 'base' => '/path/to/scripts/' - ); - - var $file = null; - - var $output = null; - - var $vars = null; - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = '/(\[\[embed )(.+?)( .+?)?(\]\])/i'; - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text, not including the tags. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - // save the file location - $this->file = $this->getConf('base', './') . $matches[2]; - - // extract attribs as variables in the local space - $this->vars = $this->getAttrs($matches[3]); - unset($this->vars['this']); - extract($this->vars); - - // run the script - ob_start(); - include($this->file); - $this->output = ob_get_contents(); - ob_end_clean(); - - // done, place the script output directly in the source - return $this->wiki->addToken( - $this->rule, - array('text' => $this->output) - ); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Emphasis.php b/bundled-libs/Text/Wiki/Parse/Default/Emphasis.php deleted file mode 100644 index 92a14a53..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Emphasis.php +++ /dev/null @@ -1,67 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_emphasis extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\/\/(.*?)\/\//"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the text to be - * emphasized. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . $matches[1] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Freelink.php b/bundled-libs/Text/Wiki/Parse/Default/Freelink.php deleted file mode 100644 index c77d1bd6..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Freelink.php +++ /dev/null @@ -1,111 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Freelink extends Text_Wiki_Parse { - - - /** - * - * Constructor. We override the Text_Wiki_Parse constructor so we can - * explicitly comment each part of the $regex property. - * - * @access public - * - * @param object &$obj The calling "parent" Text_Wiki object. - * - */ - - function Text_Wiki_Parse_Freelink(&$obj) - { - parent::Text_Wiki_Parse($obj); - - $this->regex = - '/' . // START regex - "\\(\\(" . // double open-parens - "(" . // START freelink page patter - "[-A-Za-z0-9 _+\\/.,;:!?'\"\\[\\]\\{\\}&\xc0-\xff]+" . // 1 or more of just about any character - ")" . // END freelink page pattern - "(" . // START display-name - "\|" . // a pipe to start the display name - "[-A-Za-z0-9 _+\\/.,;:!?'\"\\[\\]\\{\\}&\xc0-\xff]+" . // 1 or more of just about any character - ")?" . // END display-name pattern 0 or 1 - "(" . // START pattern for named anchors - "\#" . // a hash mark - "[A-Za-z]" . // 1 alpha - "[-A-Za-z0-9_:.]*" . // 0 or more alpha, digit, underscore - ")?" . // END named anchors pattern 0 or 1 - "()\\)\\)" . // double close-parens - '/'; // END regex - } - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'page' => the wiki page name (e.g., HomePage). - * - * 'text' => alternative text to be displayed in place of the wiki - * page name. - * - * 'anchor' => a named anchor on the target wiki page - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token to be used as a placeholder in - * the source text, plus any text priot to the match. - * - */ - - function process(&$matches) - { - // use nice variable names - $page = $matches[1]; - $text = $matches[2]; - - // get rid of the leading # from the anchor, if any - $anchor = substr($matches[3], 1); - - // is the page given a new text appearance? - if (trim($text) == '') { - // no - $text = $page; - } else { - // yes, strip the leading | character - $text = substr($text, 1); - } - - // set the options - $options = array( - 'page' => $page, - 'text' => $text, - 'anchor' => $anchor - ); - - // return a token placeholder - return $this->wiki->addToken($this->rule, $options); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Function.php b/bundled-libs/Text/Wiki/Parse/Default/Function.php deleted file mode 100644 index 6ad99d4d..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Function.php +++ /dev/null @@ -1,115 +0,0 @@ -)\n(.+)\n(\<\/function\>)(\s|$)/Umsi'; - - function process(&$matches) - { - // default options - $opts = array( - 'name' => null, - 'access' => null, - 'return' => null, - 'params' => array(), - 'throws' => array() - ); - - // split apart the markup lines and loop through them - $lines = explode("\n", $matches[2]); - foreach ($lines as $line) { - - // skip blank lines - if (trim($line) == '') { - continue; - } - - // find the first ':' on the line; the left part is the - // type, the right part is the value. skip lines without - // a ':' on them. - $pos = strpos($line, ':'); - if ($pos === false) { - continue; - } - - // $type is the line type: name, access, return, param, throws - // 012345678901234 - // name: something - $type = trim(substr($line, 0, $pos)); - $val = trim(substr($line, $pos+1)); - - switch($type) { - - case 'a': - case 'access': - $opts['access'] = $val; - break; - - case 'n': - case 'name': - $opts['name'] = $val; - break; - - case 'p': - case 'param': - $tmp = explode(',', $val); - $k = count($tmp); - if ($k == 1) { - $opts['params'][] = array( - 'type' => $tmp[0], - 'descr' => null, - 'default' => null - ); - } elseif ($k == 2) { - $opts['params'][] = array( - 'type' => $tmp[0], - 'descr' => $tmp[1], - 'default' => null - ); - } else { - $opts['params'][] = array( - 'type' => $tmp[0], - 'descr' => $tmp[1], - 'default' => $tmp[2] - ); - } - break; - - case 'r': - case 'return': - case 'returns': - $opts['return'] = $val; - break; - - case 't': - case 'throws': - $tmp = explode(',', $val); - $k = count($tmp); - if ($k == 1) { - $opts['throws'][] = array( - 'type' => $tmp[0], - 'descr' => null - ); - } else { - $opts['throws'][] = array( - 'type' => $tmp[0], - 'descr' => $tmp[1] - ); - } - break; - - default: - $opts[$type] = $val; - break; - - } - } - - // add the token back in place - return $this->wiki->addToken($this->rule, $opts) . $matches[4]; - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Heading.php b/bundled-libs/Text/Wiki/Parse/Default/Heading.php deleted file mode 100644 index 0918e7ce..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Heading.php +++ /dev/null @@ -1,89 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Heading extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/^(\+{1,6}) (.*)/m'; - - var $conf = array( - 'id_prefix' => 'toc' - ); - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * heading text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the heading text. - * - */ - - function process(&$matches) - { - // keep a running count for header IDs. we use this later - // when constructing TOC entries, etc. - static $id; - if (! isset($id)) { - $id = 0; - } - - $prefix = htmlspecialchars($this->getConf('id_prefix')); - - $start = $this->wiki->addToken( - $this->rule, - array( - 'type' => 'start', - 'level' => strlen($matches[1]), - 'text' => $matches[2], - 'id' => $prefix . $id ++ - ) - ); - - $end = $this->wiki->addToken( - $this->rule, - array( - 'type' => 'end', - 'level' => strlen($matches[1]) - ) - ); - - return $start . $matches[2] . $end . "\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Horiz.php b/bundled-libs/Text/Wiki/Parse/Default/Horiz.php deleted file mode 100644 index 9907f4b6..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Horiz.php +++ /dev/null @@ -1,52 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Horiz extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/^([-]{4,})$/m'; - - - /** - * - * Generates a replacement token for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A token marking the horizontal rule. - * - */ - - function process(&$matches) - { - return $this->wiki->addToken($this->rule); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Html.php b/bundled-libs/Text/Wiki/Parse/Default/Html.php deleted file mode 100644 index 515b381c..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Html.php +++ /dev/null @@ -1,57 +0,0 @@ - on its -* own line, and the block end is marked by on its own line. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Html extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/^\\n(.+)\n\<\/html\>(\s|$)/Umsi'; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'text' => The text of the HTML to be rendered as-is. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token to be used as a placeholder in - * the source text, plus any text following the HTML block. - * - */ - - function process(&$matches) - { - $options = array('text' => $matches[1]); - return $this->wiki->addToken($this->rule, $options) . $matches[2]; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Image.php b/bundled-libs/Text/Wiki/Parse/Default/Image.php deleted file mode 100644 index 764fd573..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Image.php +++ /dev/null @@ -1,76 +0,0 @@ - or other similar tags. Be -* careful. -* -* In the future, we'll add a rule config options to set the base embed -* path so that it is limited to one directory. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Image extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = '/(\[\[image )(.+?)(\]\])/i'; - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'src' => The image source, typically a relative path name. - * - * 'opts' => Any macro options following the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - $pos = strpos($matches[2], ' '); - - if ($pos === false) { - $options = array( - 'src' => $matches[2], - 'attr' => array()); - } else { - // everything after the space is attribute arguments - $options = array( - 'src' => substr($matches[2], 0, $pos), - 'attr' => $this->getAttrs(substr($matches[2], $pos+1)) - ); - } - - return $this->wiki->addToken($this->rule, $options); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Include.php b/bundled-libs/Text/Wiki/Parse/Default/Include.php deleted file mode 100644 index 1ba7d1d8..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Include.php +++ /dev/null @@ -1,84 +0,0 @@ - or other similar tags. Be -* careful. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Include extends Text_Wiki_Parse { - - var $conf = array( - 'base' => '/path/to/scripts/' - ); - - var $file = null; - - var $output = null; - - var $vars = null; - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = '/(\[\[include )(.+?)( .+?)?(\]\])/i'; - - - /** - * - * Includes the results of the script directly into the source; the output - * will subsequently be parsed by the remaining Text_Wiki rules. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return The results of the included script. - * - */ - - function process(&$matches) - { - // save the file location - $this->file = $this->getConf('base', './') . $matches[2]; - - // extract attribs as variables in the local space - $this->vars = $this->getAttrs($matches[3]); - unset($this->vars['this']); - extract($this->vars); - - // run the script - ob_start(); - include($this->file); - $this->output = ob_get_contents(); - ob_end_clean(); - - // done, place the script output directly in the source - return $this->output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Interwiki.php b/bundled-libs/Text/Wiki/Parse/Default/Interwiki.php deleted file mode 100644 index 6a4ef19c..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Interwiki.php +++ /dev/null @@ -1,120 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Interwiki extends Text_Wiki_Parse { - - // double-colons wont trip up now - var $regex = '([A-Za-z0-9_]+):((?!:)[A-Za-z0-9_\/=&~#.:;-]+)'; - - - /** - * - * Parser. We override the standard parser so we can - * find both described interwiki links and standalone links. - * - * @access public - * - * @return void - * - */ - - function parse() - { - // described interwiki links - $tmp_regex = '/\[' . $this->regex . ' (.+?)\]/'; - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'processDescr'), - $this->wiki->source - ); - - // standalone interwiki links - $tmp_regex = '/' . $this->regex . '/'; - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'process'), - $this->wiki->source - ); - - } - - - /** - * - * Generates a replacement for the matched standalone interwiki text. - * Token options are: - * - * 'site' => The key name for the Text_Wiki interwiki array map, - * usually the name of the interwiki site. - * - * 'page' => The page on the target interwiki to link to. - * - * 'text' => The text to display as the link. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token to be used as a placeholder in - * the source text, plus any text priot to the match. - * - */ - - function process(&$matches) - { - $options = array( - 'site' => $matches[1], - 'page' => $matches[2], - 'text' => $matches[0] - ); - - return $this->wiki->addToken($this->rule, $options); - } - - - /** - * - * Generates a replacement for described interwiki links. Token - * options are: - * - * 'site' => The key name for the Text_Wiki interwiki array map, - * usually the name of the interwiki site. - * - * 'page' => The page on the target interwiki to link to. - * - * 'text' => The text to display as the link. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token to be used as a placeholder in - * the source text, plus any text priot to the match. - * - */ - - function processDescr(&$matches) - { - $options = array( - 'site' => $matches[1], - 'page' => $matches[2], - 'text' => $matches[3] - ); - - return $this->wiki->addToken($this->rule, $options); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Italic.php b/bundled-libs/Text/Wiki/Parse/Default/Italic.php deleted file mode 100644 index d4d6ebfd..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Italic.php +++ /dev/null @@ -1,67 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Italic extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/''(()|[^'].*)''/U"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the text to be - * emphasized. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . $matches[1] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/List.php b/bundled-libs/Text/Wiki/Parse/Default/List.php deleted file mode 100644 index 77b40b2c..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/List.php +++ /dev/null @@ -1,230 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_List extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/\n((\*|#) .*\n)(?! {0,}(\* |# |\n))/Us'; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => - * 'bullet_start' : the start of a bullet list - * 'bullet_end' : the end of a bullet list - * 'number_start' : the start of a number list - * 'number_end' : the end of a number list - * 'item_start' : the start of item text (bullet or number) - * 'item_end' : the end of item text (bullet or number) - * 'unknown' : unknown type of list or item - * - * 'level' => the indent level (0 for the first level, 1 for the - * second, etc) - * - * 'count' => the list item number at this level. not needed for - * xhtml, but very useful for PDF and RTF. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A series of text and delimited tokens marking the different - * list text and list elements. - * - */ - - function process(&$matches) - { - // the replacement text we will return - $return = ''; - - // the list of post-processing matches - $list = array(); - - // a stack of list-start and list-end types; we keep this - // so that we know what kind of list we're working with - // (bullet or number) and what indent level we're at. - $stack = array(); - - // the item count is the number of list items for any - // given list-type on the stack - $itemcount = array(); - - // have we processed the very first list item? - $pastFirst = false; - - // populate $list with this set of matches. $matches[1] is the - // text matched as a list set by parse(). - preg_match_all( - '=^( {0,})(\*|#) (.*)$=Ums', - $matches[1], - $list, - PREG_SET_ORDER - ); - - // loop through each list-item element. - foreach ($list as $key => $val) { - - // $val[0] is the full matched list-item line - // $val[1] is the number of initial spaces (indent level) - // $val[2] is the list item type (* or #) - // $val[3] is the list item text - - // how many levels are we indented? (1 means the "root" - // list level, no indenting.) - $level = strlen($val[1]) + 1; - - // get the list item type - if ($val[2] == '*') { - $type = 'bullet'; - } elseif ($val[2] == '#') { - $type = 'number'; - } else { - $type = 'unknown'; - } - - // get the text of the list item - $text = $val[3]; - - // add a level to the list? - if ($level > count($stack)) { - - // the current indent level is greater than the - // number of stack elements, so we must be starting - // a new list. push the new list type onto the - // stack... - array_push($stack, $type); - - // ...and add a list-start token to the return. - $return .= $this->wiki->addToken( - $this->rule, - array( - 'type' => $type . '_list_start', - 'level' => $level - 1 - ) - ); - } - - // remove a level from the list? - while (count($stack) > $level) { - - // so we don't keep counting the stack, we set up a temp - // var for the count. -1 becuase we're going to pop the - // stack in the next command. $tmp will then equal the - // current level of indent. - $tmp = count($stack) - 1; - - // as long as the stack count is greater than the - // current indent level, we need to end list types. - // continue adding end-list tokens until the stack count - // and the indent level are the same. - $return .= $this->wiki->addToken( - $this->rule, - array ( - 'type' => array_pop($stack) . '_list_end', - 'level' => $tmp - ) - ); - - // reset to the current (previous) list type so that - // the new list item matches the proper list type. - $type = $stack[$tmp - 1]; - - // reset the item count for the popped indent level - unset($itemcount[$tmp + 1]); - } - - // add to the item count for this list (taking into account - // which level we are at). - if (! isset($itemcount[$level])) { - // first count - $itemcount[$level] = 0; - } else { - // increment count - $itemcount[$level]++; - } - - // is this the very first item in the list? - if (! $pastFirst) { - $first = true; - $pastFirst = true; - } else { - $first = false; - } - - // create a list-item starting token. - $start = $this->wiki->addToken( - $this->rule, - array( - 'type' => $type . '_item_start', - 'level' => $level, - 'count' => $itemcount[$level], - 'first' => $first - ) - ); - - // create a list-item ending token. - $end = $this->wiki->addToken( - $this->rule, - array( - 'type' => $type . '_item_end', - 'level' => $level, - 'count' => $itemcount[$level] - ) - ); - - // add the starting token, list-item text, and ending token - // to the return. - $return .= $start . $val[3] . $end; - } - - // the last list-item may have been indented. go through the - // list-type stack and create end-list tokens until the stack - // is empty. - while (count($stack) > 0) { - $return .= $this->wiki->addToken( - $this->rule, - array ( - 'type' => array_pop($stack) . '_list_end', - 'level' => count($stack) - ) - ); - } - - // we're done! send back the replacement text. - return "\n" . $return . "\n\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Newline.php b/bundled-libs/Text/Wiki/Parse/Default/Newline.php deleted file mode 100644 index 67e20264..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Newline.php +++ /dev/null @@ -1,57 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Newline extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/([^\n])\n([^\n])/m'; - - - /** - * - * Generates a replacement token for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A delimited token to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - return $matches[1] . - $this->wiki->addToken($this->rule) . - $matches[2]; - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Paragraph.php b/bundled-libs/Text/Wiki/Parse/Default/Paragraph.php deleted file mode 100644 index bbc42897..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Paragraph.php +++ /dev/null @@ -1,128 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse { - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = "/^.*?\n\n/m"; - - var $conf = array( - 'skip' => array( - 'blockquote', // are we sure about this one? - 'code', - 'heading', - 'horiz', - 'deflist', - 'table', - 'list', - 'toc' - ) - ); - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'start' => The starting point of the paragraph. - * - * 'end' => The ending point of the paragraph. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - $delim = $this->wiki->delim; - - // was anything there? - if (trim($matches[0]) == '') { - return ''; - } - - // does the match start with a delimiter? - if (substr($matches[0], 0, 1) != $delim) { - // no. - - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . trim($matches[0]) . $end; - } - - // the line starts with a delimiter. read in the delimited - // token number, check the token, and see if we should - // skip it. - - // loop starting at the second character (we already know - // the first is a delimiter) until we find another - // delimiter; the text between them is a token key number. - $key = ''; - $len = strlen($matches[0]); - for ($i = 1; $i < $len; $i++) { - $char = $matches[0]{$i}; - if ($char == $delim) { - break; - } else { - $key .= $char; - } - } - - // look at the token and see if it's skippable (if we skip, - // it will not be marked as a paragraph) - $token_type = strtolower($this->wiki->tokens[$key][0]); - $skip = $this->getConf('skip', array()); - - if (in_array($token_type, $skip)) { - // this type of token should not have paragraphs applied to it. - // return the entire matched text. - return $matches[0]; - } else { - - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . trim($matches[0]) . $end; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Phplookup.php b/bundled-libs/Text/Wiki/Parse/Default/Phplookup.php deleted file mode 100644 index 25511eaa..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Phplookup.php +++ /dev/null @@ -1,58 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Phplookup extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\[\[php (.+?)\]\]/"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * teletype text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the teletype text. - * - */ - - function process(&$matches) - { - return $this->wiki->addToken( - $this->rule, array('text' => $matches[1]) - ); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Prefilter.php b/bundled-libs/Text/Wiki/Parse/Default/Prefilter.php deleted file mode 100644 index 66f5eeba..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Prefilter.php +++ /dev/null @@ -1,62 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Prefilter extends Text_Wiki_Parse { - - - /** - * - * Simple parsing method. - * - * @access public - * - */ - - function parse() - { - // convert DOS line endings - $this->wiki->source = str_replace("\r\n", "\n", - $this->wiki->source); - - // convert Macintosh line endings - $this->wiki->source = str_replace("\r", "\n", - $this->wiki->source); - - // concat lines ending in a backslash - $this->wiki->source = str_replace("\\\n", "", - $this->wiki->source); - - // convert tabs to four-spaces - $this->wiki->source = str_replace("\t", " ", - $this->wiki->source); - - // add extra newlines at the top and end; this - // seems to help many rules. - $this->wiki->source = "\n" . $this->wiki->source . "\n\n"; - - // finally, compress all instances of 3 or more newlines - // down to two newlines. - $find = "/\n{3,}/m"; - $replace = "\n\n"; - $this->wiki->source = preg_replace($find, $replace, - $this->wiki->source); - } - -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Raw.php b/bundled-libs/Text/Wiki/Parse/Default/Raw.php deleted file mode 100644 index eaa95a00..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Raw.php +++ /dev/null @@ -1,55 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Raw extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = "/``(.*)``/U"; - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - $options = array('text' => $matches[1]); - return $this->wiki->addToken($this->rule, $options); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Revise.php b/bundled-libs/Text/Wiki/Parse/Default/Revise.php deleted file mode 100644 index 3425a0c2..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Revise.php +++ /dev/null @@ -1,130 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Revise extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\@\@({*?.*}*?)\@\@/U"; - - - /** - * - * Config options. - * - * @access public - * - * @var array - * - */ - - var $conf = array( - 'delmark' => '---', - 'insmark' => '+++' - ); - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * inserted text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the teletype text. - * - */ - - function process(&$matches) - { - $output = ''; - $src = $matches[1]; - $delmark = $this->getConf('delmark'); // --- - $insmark = $this->getConf('insmark'); // +++ - - // '---' must be before '+++' (if they both appear) - $del = strpos($src, $delmark); - $ins = strpos($src, $insmark); - - // if neither is found, return right away - if ($del === false && $ins === false) { - return $matches[0]; - } - - // handle text to be deleted - if ($del !== false) { - - // move forward to the end of the deletion mark - $del += strlen($delmark); - - if ($ins === false) { - // there is no insertion text following - $text = substr($src, $del); - } else { - // there is insertion text following, - // mitigate the length - $text = substr($src, $del, $ins - $del); - } - - $output .= $this->wiki->addToken( - $this->rule, array('type' => 'del_start') - ); - - $output .= $text; - - $output .= $this->wiki->addToken( - $this->rule, array('type' => 'del_end') - ); - } - - // handle text to be inserted - if ($ins !== false) { - - // move forward to the end of the insert mark - $ins += strlen($insmark); - $text = substr($src, $ins); - - $output .= $this->wiki->addToken( - $this->rule, array('type' => 'ins_start') - ); - - $output .= $text; - - $output .= $this->wiki->addToken( - $this->rule, array('type' => 'ins_end') - ); - } - - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Strong.php b/bundled-libs/Text/Wiki/Parse/Default/Strong.php deleted file mode 100644 index a46ef772..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Strong.php +++ /dev/null @@ -1,67 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Strong extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\*\*(.*?)\*\*/"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A pair of delimited tokens to be used as a placeholder in - * the source text surrounding the text to be emphasized. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . $matches[1] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Superscript.php b/bundled-libs/Text/Wiki/Parse/Default/Superscript.php deleted file mode 100644 index 5edf3291..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Superscript.php +++ /dev/null @@ -1,67 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Superscript extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\^\^(()|.*)\^\^/U"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A pair of delimited tokens to be used as a placeholder in - * the source text surrounding the text to be emphasized. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . $matches[1] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Table.php b/bundled-libs/Text/Wiki/Parse/Default/Table.php deleted file mode 100644 index e24db229..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Table.php +++ /dev/null @@ -1,208 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Table extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/\n((\|\|).*)(\n)(?!(\|\|))/Us'; - - - /** - * - * Generates a replacement for the matched text. - * - * Token options are: - * - * 'type' => - * 'table_start' : the start of a bullet list - * 'table_end' : the end of a bullet list - * 'row_start' : the start of a number list - * 'row_end' : the end of a number list - * 'cell_start' : the start of item text (bullet or number) - * 'cell_end' : the end of item text (bullet or number) - * - * 'cols' => the number of columns in the table (for 'table_start') - * - * 'rows' => the number of rows in the table (for 'table_start') - * - * 'span' => column span (for 'cell_start') - * - * 'attr' => column attribute flag (for 'cell_start') - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A series of text and delimited tokens marking the different - * table elements and cell text. - * - */ - - function process(&$matches) - { - // our eventual return value - $return = ''; - - // the number of columns in the table - $num_cols = 0; - - // the number of rows in the table - $num_rows = 0; - - // rows are separated by newlines in the matched text - $rows = explode("\n", $matches[1]); - - // loop through each row - foreach ($rows as $row) { - - // increase the row count - $num_rows ++; - - // start a new row - $return .= $this->wiki->addToken( - $this->rule, - array('type' => 'row_start') - ); - - // cells are separated by double-pipes - $cell = explode("||", $row); - - // get the number of cells (columns) in this row - $last = count($cell) - 1; - - // is this more than the current column count? - // (we decrease by 1 because we never use cell zero) - if ($last - 1 > $num_cols) { - // increase the column count - $num_cols = $last - 1; - } - - // by default, cells span only one column (their own) - $span = 1; - - // ignore cell zero, and ignore the "last" cell; cell zero - // is before the first double-pipe, and the "last" cell is - // after the last double-pipe. both are always empty. - for ($i = 1; $i < $last; $i ++) { - - // if there is no content at all, then it's an instance - // of two sets of || next to each other, indicating a - // span. - if ($cell[$i] == '') { - - // add to the span and loop to the next cell - $span += 1; - continue; - - } else { - - // this cell has content. - - // find any special "attr"ibute cell markers - if (substr($cell[$i], 0, 2) == '> ') { - // right-align - $attr = 'right'; - $cell[$i] = substr($cell[$i], 2); - } elseif (substr($cell[$i], 0, 2) == '= ') { - // center-align - $attr = 'center'; - $cell[$i] = substr($cell[$i], 2); - } elseif (substr($cell[$i], 0, 2) == '< ') { - // left-align - $attr = 'left'; - $cell[$i] = substr($cell[$i], 2); - } elseif (substr($cell[$i], 0, 2) == '~ ') { - $attr = 'header'; - $cell[$i] = substr($cell[$i], 2); - } else { - $attr = null; - } - - // start a new cell... - $return .= $this->wiki->addToken( - $this->rule, - array ( - 'type' => 'cell_start', - 'attr' => $attr, - 'span' => $span - ) - ); - - // ...add the content... - $return .= trim($cell[$i]); - - // ...and end the cell. - $return .= $this->wiki->addToken( - $this->rule, - array ( - 'type' => 'cell_end', - 'attr' => $attr, - 'span' => $span - ) - ); - - // reset the span. - $span = 1; - } - - } - - // end the row - $return .= $this->wiki->addToken( - $this->rule, - array('type' => 'row_end') - ); - - } - - // wrap the return value in start and end tokens - $return = - $this->wiki->addToken( - $this->rule, - array( - 'type' => 'table_start', - 'rows' => $num_rows, - 'cols' => $num_cols - ) - ) - . $return . - $this->wiki->addToken( - $this->rule, - array( - 'type' => 'table_end' - ) - ); - - // we're done! - return "\n$return\n\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Tighten.php b/bundled-libs/Text/Wiki/Parse/Default/Tighten.php deleted file mode 100644 index a1c5e598..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Tighten.php +++ /dev/null @@ -1,32 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Tighten extends Text_Wiki_Parse { - - - /** - * - * Apply tightening directly to the source text. - * - * @access public - * - */ - - function parse() - { - $this->wiki->source = str_replace("\n", '', - $this->wiki->source); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Toc.php b/bundled-libs/Text/Wiki/Parse/Default/Toc.php deleted file mode 100644 index c147ce3f..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Toc.php +++ /dev/null @@ -1,112 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - - -class Text_Wiki_Parse_Toc extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\n\[\[toc( .*)?\]\]\n/m"; - - - /** - * - * Generates a replacement for the matched text. - * - * Token options are: - * - * 'type' => ['list_start'|'list_end'|'item_start'|'item_end'|'target'] - * - * 'level' => The heading level (1-6). - * - * 'count' => Which entry number this is in the list. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A token indicating the TOC collection point. - * - */ - - function process(&$matches) - { - $count = 0; - - if (isset($matches[1])) { - $attr = $this->getAttrs(trim($matches[1])); - } else { - $attr = array(); - } - - $output = $this->wiki->addToken( - $this->rule, - array( - 'type' => 'list_start', - 'level' => 0, - 'attr' => $attr - ) - ); - - foreach ($this->wiki->getTokens('Heading') as $key => $val) { - - if ($val[1]['type'] != 'start') { - continue; - } - - $options = array( - 'type' => 'item_start', - 'id' => $val[1]['id'], - 'level' => $val[1]['level'], - 'count' => $count ++ - ); - - $output .= $this->wiki->addToken($this->rule, $options); - - $output .= $val[1]['text']; - - $output .= $this->wiki->addToken( - $this->rule, - array( - 'type' => 'item_end', - 'level' => $val[1]['level'] - ) - ); - } - - $output .= $this->wiki->addToken( - $this->rule, array( - 'type' => 'list_end', - 'level' => 0 - ) - ); - - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Tt.php b/bundled-libs/Text/Wiki/Parse/Default/Tt.php deleted file mode 100644 index adf05b7f..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Tt.php +++ /dev/null @@ -1,69 +0,0 @@ - ['start'|'end'] The starting or ending point of the -* teletype text. The text itself is left in the source. -* -* -* $Id: Tt.php,v 1.1 2005/01/31 15:46:52 pmjones Exp $ -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Tt extends Text_Wiki_Parse { - - - /** - * - * The regular expression used to parse the source text. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/{{({*?.*}*?)}}/U"; - - - /** - * - * Generates a replacement for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the teletype text. - * - */ - - function process(&$matches) - { - $start = $this->wiki->addToken( - $this->rule, array('type' => 'start') - ); - - $end = $this->wiki->addToken( - $this->rule, array('type' => 'end') - ); - - return $start . $matches[1] . $end; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Url.php b/bundled-libs/Text/Wiki/Parse/Default/Url.php deleted file mode 100644 index c78de9b9..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Url.php +++ /dev/null @@ -1,265 +0,0 @@ - tag (for the 'xhtml' -* format). -* -* Token options are: -* -* 'type' => ['inline'|'footnote'|'descr'] the type of URL -* -* 'href' => the URL link href portion -* -* 'text' => the displayed text of the URL link -* -* $Id: Url.php,v 1.1 2005/01/31 15:46:52 pmjones Exp $ -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Url extends Text_Wiki_Parse { - - - /** - * - * Keeps a running count of numbered-reference URLs. - * - * @access public - * - * @var int - * - */ - - var $footnoteCount = 0; - - - /** - * - * URL schemes recognized by this rule. - * - * @access public - * - * @var array - * - */ - - var $conf = array( - 'schemes' => array( - 'http://', - 'https://', - 'ftp://', - 'gopher://', - 'news://', - 'mailto:' - ) - ); - - - /** - * - * Constructor. - * - * We override the constructor so we can comment the regex nicely. - * - * @access public - * - */ - - function Text_Wiki_Parse_Url(&$obj) - { - parent::Text_Wiki_Parse($obj); - - // convert the list of recognized schemes to a regex-safe string, - // where the pattern delim is a slash - $tmp = array(); - $list = $this->getConf('schemes', array()); - foreach ($list as $val) { - $tmp[] = preg_quote($val, '/'); - } - $schemes = implode('|', $tmp); - - // build the regex - $this->regex = - "($schemes)" . // allowed schemes - "(" . // start pattern - "[^ \\/\"\'{$this->wiki->delim}]*\\/" . // no spaces, backslashes, slashes, double-quotes, single quotes, or delimiters; - ")*" . // end pattern - "[^ \\t\\n\\/\"\'{$this->wiki->delim}]*" . - "[A-Za-z0-9\\/?=&~_]"; - } - - - /** - * - * Find three different kinds of URLs in the source text. - * - * @access public - * - */ - - function parse() - { - // ------------------------------------------------------------- - // - // Described-reference (named) URLs. - // - - // the regular expression for this kind of URL - $tmp_regex = '/\[(' . $this->regex . ') ([^\]]+)\]/'; - - // use a custom callback processing method to generate - // the replacement text for matches. - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'processDescr'), - $this->wiki->source - ); - - - // ------------------------------------------------------------- - // - // Numbered-reference (footnote-style) URLs. - // - - // the regular expression for this kind of URL - $tmp_regex = '/\[(' . $this->regex . ')\]/U'; - - // use a custom callback processing method to generate - // the replacement text for matches. - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'processFootnote'), - $this->wiki->source - ); - - - // ------------------------------------------------------------- - // - // Normal inline URLs. - // - - // the regular expression for this kind of URL - - $tmp_regex = '/(^|[^A-Za-z])(' . $this->regex . ')(.*?)/'; - - // use the standard callback for inline URLs - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'process'), - $this->wiki->source - ); - } - - - /** - * - * Process inline URLs. - * - * @param array &$matches - * - * @param array $matches An array of matches from the parse() method - * as generated by preg_replace_callback. $matches[0] is the full - * matched string, $matches[1] is the first matched pattern, - * $matches[2] is the second matched pattern, and so on. - * - * @return string The processed text replacement. - * - */ - - function process(&$matches) - { - // set options - $options = array( - 'type' => 'inline', - 'href' => $matches[2], - 'text' => $matches[2] - ); - - // tokenize - return $matches[1] . $this->wiki->addToken($this->rule, $options) . $matches[5]; - } - - - /** - * - * Process numbered (footnote) URLs. - * - * Token options are: - * @param array &$matches - * - * @param array $matches An array of matches from the parse() method - * as generated by preg_replace_callback. $matches[0] is the full - * matched string, $matches[1] is the first matched pattern, - * $matches[2] is the second matched pattern, and so on. - * - * @return string The processed text replacement. - * - */ - - function processFootnote(&$matches) - { - // keep a running count for footnotes - $this->footnoteCount++; - - // set options - $options = array( - 'type' => 'footnote', - 'href' => $matches[1], - 'text' => $this->footnoteCount - ); - - // tokenize - return $this->wiki->addToken($this->rule, $options); - } - - - /** - * - * Process described-reference (named-reference) URLs. - * - * Token options are: - * 'type' => ['inline'|'footnote'|'descr'] the type of URL - * 'href' => the URL link href portion - * 'text' => the displayed text of the URL link - * - * @param array &$matches - * - * @param array $matches An array of matches from the parse() method - * as generated by preg_replace_callback. $matches[0] is the full - * matched string, $matches[1] is the first matched pattern, - * $matches[2] is the second matched pattern, and so on. - * - * @return string The processed text replacement. - * - */ - - function processDescr(&$matches) - { - // set options - $options = array( - 'type' => 'descr', - 'href' => $matches[1], - 'text' => $matches[4] - ); - - // tokenize - return $this->wiki->addToken($this->rule, $options); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Parse/Default/Wikilink.php b/bundled-libs/Text/Wiki/Parse/Default/Wikilink.php deleted file mode 100644 index ad8431a8..00000000 --- a/bundled-libs/Text/Wiki/Parse/Default/Wikilink.php +++ /dev/null @@ -1,158 +0,0 @@ - the wiki page name. -* -* 'text' => the displayed link text. -* -* 'anchor' => a named anchor on the target wiki page. -* -* $Id: Wikilink.php,v 1.1 2005/01/31 15:46:52 pmjones Exp $ -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse { - - - /** - * - * Constructor. - * - * We override the Text_Wiki_Parse constructor so we can - * explicitly comment each part of the $regex property. - * - * @access public - * - * @param object &$obj The calling "parent" Text_Wiki object. - * - */ - - function Text_Wiki_Parse_Wikilink(&$obj) - { - parent::Text_Wiki_Parse($obj); - - // allows numbers as "lowercase letters" in the regex - $this->regex = - "(!?" . // START WikiPage pattern (1) - "[A-Z]" . // 1 upper - "[A-Za-z0-9]*" . // 0+ alpha or digit - "[a-z0-9]+" . // 1+ lower or digit - "[A-Z]" . // 1 upper - "[A-Za-z0-9]*" . // 0+ or more alpha or digit - ")" . // END WikiPage pattern (/1) - "((\#" . // START Anchor pattern (2)(3) - "[A-Za-z]" . // 1 alpha - "(" . // start sub pattern (4) - "[-A-Za-z0-9_:.]*" . // 0+ dash, alpha, digit, underscore, colon, dot - "[-A-Za-z0-9_]" . // 1 dash, alpha, digit, or underscore - ")?)?)"; // end subpatterns (/4)(/3)(/2) - - } - - - /** - * - * First parses for described links, then for standalone links. - * - * @access public - * - * @return void - * - */ - - function parse() - { - // described wiki links - $tmp_regex = '/\[' . $this->regex . ' (.+?)\]/'; - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'processDescr'), - $this->wiki->source - ); - - // standalone wiki links - $tmp_regex = '/(^|[^A-Za-z0-9\-_])' . $this->regex . '/'; - $this->wiki->source = preg_replace_callback( - $tmp_regex, - array(&$this, 'process'), - $this->wiki->source - ); - } - - - /** - * - * Generate a replacement for described links. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token to be used as a placeholder in - * the source text, plus any text priot to the match. - * - */ - - function processDescr(&$matches) - { - // set the options - $options = array( - 'page' => $matches[1], - 'text' => $matches[5], - 'anchor' => $matches[3] - ); - - // create and return the replacement token and preceding text - return $this->wiki->addToken($this->rule, $options); // . $matches[7]; - } - - - /** - * - * Generate a replacement for standalone links. - * - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token to be used as a placeholder in - * the source text, plus any text prior to the match. - * - */ - - function process(&$matches) - { - // when prefixed with !, it's explicitly not a wiki link. - // return everything as it was. - if ($matches[2][0] == '!') { - return $matches[1] . substr($matches[2], 1) . $matches[3]; - } - - // set the options - $options = array( - 'page' => $matches[2], - 'text' => $matches[2] . $matches[3], - 'anchor' => $matches[3] - ); - - // create and return the replacement token and preceding text - return $matches[1] . $this->wiki->addToken($this->rule, $options); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render.php b/bundled-libs/Text/Wiki/Render.php deleted file mode 100644 index ab77bde2..00000000 --- a/bundled-libs/Text/Wiki/Render.php +++ /dev/null @@ -1,167 +0,0 @@ -wiki =& $obj; - - // get the config-key-name for this object, - // strip the Text_Wiki_Render_ part - // 01234567890123456 - $tmp = get_class($this); - $tmp = substr($tmp, 17); - - // split into pieces at the _ mark. - // first part is format, second part is rule. - $part = explode('_', $tmp); - $this->format = isset($part[0]) ? ucwords(strtolower($part[0])) : null; - $this->rule = isset($part[1]) ? ucwords(strtolower($part[1])) : null; - - // is there a format but no rule? - // then this is the "main" render object, with - // pre() and post() methods. - if ($this->format && ! $this->rule && - isset($this->wiki->formatConf[$this->format]) && - is_array($this->wiki->formatConf[$this->format])) { - - // this is a format render object - $this->conf = array_merge( - $this->conf, - $this->wiki->formatConf[$this->format] - ); - - } - - // is there a format and a rule? - if ($this->format && $this->rule && - isset($this->wiki->renderConf[$this->format][$this->rule]) && - is_array($this->wiki->renderConf[$this->format][$this->rule])) { - - // this is a rule render object - $this->conf = array_merge( - $this->conf, - $this->wiki->renderConf[$this->format][$this->rule] - ); - } - } - - - /** - * - * Simple method to safely get configuration key values. - * - * @access public - * - * @param string $key The configuration key. - * - * @param mixed $default If the key does not exist, return this value - * instead. - * - * @return mixed The configuration key value (if it exists) or the - * default value (if not). - * - */ - - function getConf($key, $default = null) - { - if (isset($this->conf[$key])) { - return $this->conf[$key]; - } else { - return $default; - } - } - - - /** - * - * Simple method to wrap a configuration in an sprintf() format. - * - * @access public - * - * @param string $key The configuration key. - * - * @param string $format The sprintf() format string. - * - * @return mixed The formatted configuration key value (if it exists) - * or null (if it does not). - * - */ - - function formatConf($format, $key) - { - if (isset($this->conf[$key])) { - return sprintf($format, $this->conf[$key]); - } else { - return null; - } - } - -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex.php b/bundled-libs/Text/Wiki/Render/Latex.php deleted file mode 100644 index 4383bda9..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex.php +++ /dev/null @@ -1,90 +0,0 @@ - -* -* @package Text_Wiki -* -* @todo [http://google.com] becomes 1 with a LaTeX footnote in subscript. -* This should be a normal LaTeX footnote associated with the -* previous word? -* -* @todo parse "..." to be ``...'' -* -* @todo parse '...' to be `...' -* -* @todo move escape_latex to a static function, move escaping to the -* individual .php files they are associated with -* -* @todo allow the user to add conf items to do things like -* + A custom document header -* + Custom page headings -* + Include packages -* + Set Title, Author, Date -* + Include a title page -* + Not output Document Head/Foot (maybe combinding many pages?) -* -*/ - -class Text_Wiki_Render_Latex extends Text_Wiki_Render { - function escape_latex ($txt) { - $txt = str_replace("\\", "\\\\", $txt); - $txt = str_replace('#', '\#', $txt); - $txt = str_replace('$', '\$', $txt); - $txt = str_replace('%', '\%', $txt); - $txt = str_replace('^', '\^', $txt); - $txt = str_replace('&', '\&', $txt); - $txt = str_replace('_', '\_', $txt); - $txt = str_replace('{', '\{', $txt); - $txt = str_replace('}', '\}', $txt); - - // Typeset things a bit prettier than normas - $txt = str_replace('~', '$\sim$', $txt); - $txt = str_replace('...', '\ldots', $txt); - - return $txt; - } - - function escape($tok, $ele) { - if (isset($tok[$ele])) { - $tok[$ele] = $this->escape_latex($tok[$ele]); - } - - return $tok; - } - - function pre() - { - foreach ($this->wiki->tokens as $k => $tok) { - if ($tok[0] == 'Code') { - continue; - } - - $tok[1] = $this->escape($tok[1], 'text'); - $tok[1] = $this->escape($tok[1], 'page'); - $tok[1] = $this->escape($tok[1], 'href'); - - $this->wiki->tokens[$k] = $tok; - } - - $this->wiki->source = $this->escape_latex($this->wiki->source); - - return - "\\documentclass{article}\n". - "\\usepackage{ulem}\n". - "\\pagestyle{headings}\n". - "\\begin{document}\n"; - } - - function post() - { - return "\\end{document}\n"; - } - -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Anchor.php b/bundled-libs/Text/Wiki/Render/Latex/Anchor.php deleted file mode 100644 index b7e0a819..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Anchor.php +++ /dev/null @@ -1,33 +0,0 @@ - -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Render_Latex_Anchor extends Text_Wiki_Render { - - function token($options) - { - extract($options); // $type, $name - - if ($type == 'start') { - //return sprintf('',$name); - return ''; - } - - if ($type == 'end') { - //return ''; - return ''; - } - } -} - -?> diff --git a/bundled-libs/Text/Wiki/Render/Latex/Blockquote.php b/bundled-libs/Text/Wiki/Render/Latex/Blockquote.php deleted file mode 100644 index 98106228..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Blockquote.php +++ /dev/null @@ -1,36 +0,0 @@ - null); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $type = $options['type']; - $level = $options['level']; - - // starting - if ($type == 'start') { - return "\\begin{quote}\n"; - } - - // ending - if ($type == 'end') { - return "\\end{quote}\n\n"; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Bold.php b/bundled-libs/Text/Wiki/Render/Latex/Bold.php deleted file mode 100644 index ed729935..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Bold.php +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Break.php b/bundled-libs/Text/Wiki/Render/Latex/Break.php deleted file mode 100644 index 1f3fdd30..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Break.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Center.php b/bundled-libs/Text/Wiki/Render/Latex/Center.php deleted file mode 100644 index 59adffd3..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Center.php +++ /dev/null @@ -1,33 +0,0 @@ -\n"; - return '
'; - } - - if ($options['type'] == 'end') { - //return "\n"; - return '
'; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Code.php b/bundled-libs/Text/Wiki/Render/Latex/Code.php deleted file mode 100644 index 40bb45a6..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Code.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Colortext.php b/bundled-libs/Text/Wiki/Render/Latex/Colortext.php deleted file mode 100644 index 86ff095a..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Colortext.php +++ /dev/null @@ -1,58 +0,0 @@ -colors)) { - $color = '#' . $color; - } - - if ($type == 'start') { - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Deflist.php b/bundled-libs/Text/Wiki/Render/Latex/Deflist.php deleted file mode 100644 index 8dbfe978..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Deflist.php +++ /dev/null @@ -1,53 +0,0 @@ - null, - 'css_dt' => null, - 'css_dd' => null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $type = $options['type']; - switch ($type) - { - case 'list_start': - return "\\begin{description}\n"; - - case 'list_end': - return "\\end{description}\n\n"; - - case 'term_start': - return '\item['; - - case 'term_end': - return '] '; - - case 'narr_start': - return '{'; - - case 'narr_end': - return "}\n"; - - default: - return ''; - - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Delimiter.php b/bundled-libs/Text/Wiki/Render/Latex/Delimiter.php deleted file mode 100644 index 49a50aa3..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Delimiter.php +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Embed.php b/bundled-libs/Text/Wiki/Render/Latex/Embed.php deleted file mode 100644 index 0936c7de..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Embed.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Emphasis.php b/bundled-libs/Text/Wiki/Render/Latex/Emphasis.php deleted file mode 100644 index d949b425..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Emphasis.php +++ /dev/null @@ -1,29 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Freelink.php b/bundled-libs/Text/Wiki/Render/Latex/Freelink.php deleted file mode 100644 index 469e0e69..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Freelink.php +++ /dev/null @@ -1,34 +0,0 @@ - array(), - 'view_url' => 'http://example.com/index.php?page=%s', - 'new_url' => 'http://example.com/new.php?page=%s', - 'new_text' => '?' - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // get nice variable names (page, text, anchor) - extract($options); - - return "$text\\footnote\{$anchor} "; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Function.php b/bundled-libs/Text/Wiki/Render/Latex/Function.php deleted file mode 100644 index 5f4c488e..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Function.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Heading.php b/bundled-libs/Text/Wiki/Render/Latex/Heading.php deleted file mode 100644 index eab4d54a..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Heading.php +++ /dev/null @@ -1,33 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Horiz.php b/bundled-libs/Text/Wiki/Render/Latex/Horiz.php deleted file mode 100644 index bb159d49..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Horiz.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Html.php b/bundled-libs/Text/Wiki/Render/Latex/Html.php deleted file mode 100644 index 350de4a5..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Html.php +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Image.php b/bundled-libs/Text/Wiki/Render/Latex/Image.php deleted file mode 100644 index e6c084bc..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Image.php +++ /dev/null @@ -1,70 +0,0 @@ - '/' - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - return 'Image: NI'; - - $src = '"' . - $this->getConf('base', '/') . - $options['src'] . '"'; - - if (isset($options['attr']['link'])) { - - // this image has a link - if (strpos($options['attr']['link'], '://')) { - // it's a URL - $href = $options['attr']['link']; - } else { - $href = $this->wiki->getRenderConf('xhtml', 'wikilink', 'view_url') . - $options['attr']['link']; - } - - } else { - // image is not linked - $href = null; - } - - // unset these so they don't show up as attributes - unset($options['attr']['link']); - - $attr = ''; - $alt = false; - foreach ($options['attr'] as $key => $val) { - if (strtolower($key) == 'alt') { - $alt = true; - } - $attr .= " $key=\"$val\""; - } - - // always add an "alt" attribute per Stephane Solliec - if (! $alt) { - $attr .= ' alt="' . basename($options['src']) . '"'; - } - - if ($href) { - return ""; - } else { - return ""; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Include.php b/bundled-libs/Text/Wiki/Render/Latex/Include.php deleted file mode 100644 index f23d7a59..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Include.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Interwiki.php b/bundled-libs/Text/Wiki/Render/Latex/Interwiki.php deleted file mode 100644 index d569a073..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Interwiki.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?%s', - 'Advogato' => 'http://advogato.org/%s', - 'Wiki' => 'http://c2.com/cgi/wiki?%s' - ), - 'target' => '_blank' - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $site = $options['site']; - $page = $options['page']; - $text = $options['text']; - - if (isset($this->conf['sites'][$site])) { - $href = $this->conf['sites'][$site]; - } else { - return $text; - } - - // old form where page is at end, - // or new form with %s placeholder for sprintf()? - if (strpos($href, '%s') === false) { - // use the old form - $href = $href . $page; - } else { - // use the new form - $href = sprintf($href, $page); - } - - // allow for alternative targets - $target = $this->getConf('target', ''); - - if ($target && trim($target) != '') { - $target = " target=\"$target\""; - } - - return "$text\\footnote\{$href}"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Italic.php b/bundled-libs/Text/Wiki/Render/Latex/Italic.php deleted file mode 100644 index 60785303..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Italic.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/List.php b/bundled-libs/Text/Wiki/Render/Latex/List.php deleted file mode 100644 index 6936e38a..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/List.php +++ /dev/null @@ -1,57 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Newline.php b/bundled-libs/Text/Wiki/Render/Latex/Newline.php deleted file mode 100644 index f5d09c48..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Newline.php +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Paragraph.php b/bundled-libs/Text/Wiki/Render/Latex/Paragraph.php deleted file mode 100644 index 45d487ef..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Paragraph.php +++ /dev/null @@ -1,31 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Phplookup.php b/bundled-libs/Text/Wiki/Render/Latex/Phplookup.php deleted file mode 100644 index 8c75604d..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Phplookup.php +++ /dev/null @@ -1,34 +0,0 @@ - '_blank'); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - return 'Phplookup: NI'; - - $text = trim($options['text']); - - $target = $this->getConf('target', ''); - if ($target) { - $target = " target=\"$target\""; - } - - return "$text"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Prefilter.php b/bundled-libs/Text/Wiki/Render/Latex/Prefilter.php deleted file mode 100644 index 13a2edf6..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Prefilter.php +++ /dev/null @@ -1,40 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Prefilter.php,v 1.2 2004/09/25 19:05:13 pmjones Exp $ - - -/** -* -* This class implements a Text_Wiki_Render_Latex to "pre-filter" source text so -* that line endings are consistently \n, lines ending in a backslash \ -* are concatenated with the next line, and tabs are converted to spaces. -* -* @author Jeremy Cowgar -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Render_Latex_Prefilter extends Text_Wiki_Render { - function token() - { - return ''; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Raw.php b/bundled-libs/Text/Wiki/Render/Latex/Raw.php deleted file mode 100644 index 4ef4cbe6..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Raw.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Revise.php b/bundled-libs/Text/Wiki/Render/Latex/Revise.php deleted file mode 100644 index f880156f..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Revise.php +++ /dev/null @@ -1,38 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Strong.php b/bundled-libs/Text/Wiki/Render/Latex/Strong.php deleted file mode 100644 index 721ffa37..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Strong.php +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Superscript.php b/bundled-libs/Text/Wiki/Render/Latex/Superscript.php deleted file mode 100644 index 887a8b38..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Superscript.php +++ /dev/null @@ -1,31 +0,0 @@ -'; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Table.php b/bundled-libs/Text/Wiki/Render/Latex/Table.php deleted file mode 100644 index 96c773db..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Table.php +++ /dev/null @@ -1,93 +0,0 @@ - null, - 'css_tr' => null, - 'css_th' => null, - 'css_td' => null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // make nice variable names (type, attr, span) - extract($options); - - switch ($type) - { - case 'table_start': - $this->cell_count = $cols; - - $tbl_start = '\begin{tabular}{|'; - for ($a=0; $a < $this->cell_count; $a++) { - $tbl_start .= 'l|'; - } - $tbl_start .= "}\n"; - - return $tbl_start; - - case 'table_end': - return "\\hline\n\\end{tabular}\n"; - - case 'row_start': - $this->is_spanning = false; - $this->cell_id = 0; - return "\\hline\n"; - - case 'row_end': - return "\\\\\n"; - - case 'cell_start': - if ($span > 1) { - $col_spec = ''; - if ($this->cell_id == 0) { - $col_spec = '|'; - } - $col_spec .= 'l|'; - - $this->cell_id += $span; - $this->is_spanning = true; - - return "\\multicolumn\{$span}\{$col_spec}{"; - } - - $this->cell_id += 1; - return ''; - - case 'cell_end': - $out = ''; - if ($this->is_spanning) { - $this->is_spanning = false; - $out = '}'; - } - - if ($this->cell_id != $this->cell_count) { - $out .= ' & '; - } - - return $out; - - default: - return ''; - - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Tighten.php b/bundled-libs/Text/Wiki/Render/Latex/Tighten.php deleted file mode 100644 index 7755e94d..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Tighten.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Toc.php b/bundled-libs/Text/Wiki/Render/Latex/Toc.php deleted file mode 100644 index fc5846f8..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Toc.php +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Tt.php b/bundled-libs/Text/Wiki/Render/Latex/Tt.php deleted file mode 100644 index 45073a71..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Tt.php +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Url.php b/bundled-libs/Text/Wiki/Render/Latex/Url.php deleted file mode 100644 index 47a9d375..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Url.php +++ /dev/null @@ -1,35 +0,0 @@ - false, - 'images' => true, - 'img_ext' => array('jpg', 'jpeg', 'gif', 'png') - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // create local variables from the options array (text, - // href, type) - extract($options); - - return " $text\\footnote\{$href}"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Latex/Wikilink.php b/bundled-libs/Text/Wiki/Render/Latex/Wikilink.php deleted file mode 100644 index 3cf33a6e..00000000 --- a/bundled-libs/Text/Wiki/Render/Latex/Wikilink.php +++ /dev/null @@ -1,60 +0,0 @@ - array(), - 'view_url' => 'http://example.com/index.php?page=%s', - 'new_url' => 'http://example.com/new.php?page=%s', - 'new_text' => '?' - ); - - /** - * - * Renders a token into XHTML. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // make nice variable names (page, anchor, text) - extract($options); - - // are we checking page existence? - $list =& $this->getConf('pages'); - if (is_array($list)) { - // yes, check against the page list - $exists = in_array($page, $list); - } else { - // no, assume it exists - $exists = true; - } - - // convert *after* checking against page names so as not to mess - // up what the user typed and what we're checking. - $page = htmlspecialchars($page); - $anchor = htmlspecialchars($anchor); - $text = htmlspecialchars($text); - - $href = $this->getConf('view_url'); - - if (strpos($href, '%s') === false) { - // use the old form (page-at-end) - $href = $href . $page . $anchor; - } else { - // use the new form (sprintf format string) - $href = sprintf($href, $page . $anchor); - } - - // get the CSS class and generate output - $css = $this->formatConf(' class="%s"', 'css'); - return "$text\\footnote\{$href}"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain.php b/bundled-libs/Text/Wiki/Render/Plain.php deleted file mode 100644 index e1b02a8a..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain.php +++ /dev/null @@ -1,16 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Anchor.php b/bundled-libs/Text/Wiki/Render/Plain/Anchor.php deleted file mode 100644 index f24f467f..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Anchor.php +++ /dev/null @@ -1,23 +0,0 @@ - -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Render_Plain_Anchor extends Text_Wiki_Render { - - function token($options) - { - return $options['name']; - } -} - -?> diff --git a/bundled-libs/Text/Wiki/Render/Plain/Blockquote.php b/bundled-libs/Text/Wiki/Render/Plain/Blockquote.php deleted file mode 100644 index 08da94a1..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Blockquote.php +++ /dev/null @@ -1,39 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Bold.php b/bundled-libs/Text/Wiki/Render/Plain/Bold.php deleted file mode 100644 index 628fb514..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Bold.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Break.php b/bundled-libs/Text/Wiki/Render/Plain/Break.php deleted file mode 100644 index 5705bed6..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Break.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Center.php b/bundled-libs/Text/Wiki/Render/Plain/Center.php deleted file mode 100644 index 7b363675..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Center.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Code.php b/bundled-libs/Text/Wiki/Render/Plain/Code.php deleted file mode 100644 index 5f523a3b..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Code.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Colortext.php b/bundled-libs/Text/Wiki/Render/Plain/Colortext.php deleted file mode 100644 index d577fe08..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Colortext.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Deflist.php b/bundled-libs/Text/Wiki/Render/Plain/Deflist.php deleted file mode 100644 index d05593b6..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Deflist.php +++ /dev/null @@ -1,59 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Delimiter.php b/bundled-libs/Text/Wiki/Render/Plain/Delimiter.php deleted file mode 100644 index 0e436aa1..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Delimiter.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Embed.php b/bundled-libs/Text/Wiki/Render/Plain/Embed.php deleted file mode 100644 index 3a4304ff..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Embed.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Emphasis.php b/bundled-libs/Text/Wiki/Render/Plain/Emphasis.php deleted file mode 100644 index 8d329959..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Emphasis.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Freelink.php b/bundled-libs/Text/Wiki/Render/Plain/Freelink.php deleted file mode 100644 index 61de2943..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Freelink.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Function.php b/bundled-libs/Text/Wiki/Render/Plain/Function.php deleted file mode 100644 index c90644f0..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Function.php +++ /dev/null @@ -1,39 +0,0 @@ - $val) { - $output .= "{$val['type']} {$val['descr']} {$val['default']} "; - } - - $output .= ') '; - - foreach ($throws as $key => $val) { - $output .= "{$val['type']} {$val['descr']} "; - } - - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Heading.php b/bundled-libs/Text/Wiki/Render/Plain/Heading.php deleted file mode 100644 index 306f2bf9..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Heading.php +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Horiz.php b/bundled-libs/Text/Wiki/Render/Plain/Horiz.php deleted file mode 100644 index 9d937643..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Horiz.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Html.php b/bundled-libs/Text/Wiki/Render/Plain/Html.php deleted file mode 100644 index e64e94b4..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Html.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Image.php b/bundled-libs/Text/Wiki/Render/Plain/Image.php deleted file mode 100644 index c5ddd6f7..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Image.php +++ /dev/null @@ -1,22 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Include.php b/bundled-libs/Text/Wiki/Render/Plain/Include.php deleted file mode 100644 index 445990af..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Include.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Interwiki.php b/bundled-libs/Text/Wiki/Render/Plain/Interwiki.php deleted file mode 100644 index 892f372a..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Interwiki.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Italic.php b/bundled-libs/Text/Wiki/Render/Plain/Italic.php deleted file mode 100644 index e2a596c5..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Italic.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/List.php b/bundled-libs/Text/Wiki/Render/Plain/List.php deleted file mode 100644 index 9983689a..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/List.php +++ /dev/null @@ -1,68 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Newline.php b/bundled-libs/Text/Wiki/Render/Plain/Newline.php deleted file mode 100644 index 7c7903ee..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Newline.php +++ /dev/null @@ -1,12 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Paragraph.php b/bundled-libs/Text/Wiki/Render/Plain/Paragraph.php deleted file mode 100644 index 16e536f7..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Paragraph.php +++ /dev/null @@ -1,31 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Phplookup.php b/bundled-libs/Text/Wiki/Render/Plain/Phplookup.php deleted file mode 100644 index a4268d16..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Phplookup.php +++ /dev/null @@ -1,25 +0,0 @@ - '_blank'); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - return trim($options['text']); - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Prefilter.php b/bundled-libs/Text/Wiki/Render/Plain/Prefilter.php deleted file mode 100644 index 417d1931..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Prefilter.php +++ /dev/null @@ -1,40 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Prefilter.php,v 1.2 2004/09/25 19:05:14 pmjones Exp $ - - -/** -* -* This class implements a Text_Wiki_Render_Xhtml to "pre-filter" source text so -* that line endings are consistently \n, lines ending in a backslash \ -* are concatenated with the next line, and tabs are converted to spaces. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Render_Plain_Prefilter extends Text_Wiki_Render { - function token() - { - return ''; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Raw.php b/bundled-libs/Text/Wiki/Render/Plain/Raw.php deleted file mode 100644 index e7fa8a84..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Raw.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Revise.php b/bundled-libs/Text/Wiki/Render/Plain/Revise.php deleted file mode 100644 index 32bbcad9..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Revise.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Strong.php b/bundled-libs/Text/Wiki/Render/Plain/Strong.php deleted file mode 100644 index 7ff55a3d..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Strong.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Superscript.php b/bundled-libs/Text/Wiki/Render/Plain/Superscript.php deleted file mode 100644 index d239ee3f..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Superscript.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Table.php b/bundled-libs/Text/Wiki/Render/Plain/Table.php deleted file mode 100644 index 4956cf25..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Table.php +++ /dev/null @@ -1,57 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Tighten.php b/bundled-libs/Text/Wiki/Render/Plain/Tighten.php deleted file mode 100644 index e2babf43..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Tighten.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Toc.php b/bundled-libs/Text/Wiki/Render/Plain/Toc.php deleted file mode 100644 index 34f30612..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Toc.php +++ /dev/null @@ -1,39 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Tt.php b/bundled-libs/Text/Wiki/Render/Plain/Tt.php deleted file mode 100644 index c59ccf4d..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Tt.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Url.php b/bundled-libs/Text/Wiki/Render/Plain/Url.php deleted file mode 100644 index 4326c764..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Url.php +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Plain/Wikilink.php b/bundled-libs/Text/Wiki/Render/Plain/Wikilink.php deleted file mode 100644 index 8337dda5..00000000 --- a/bundled-libs/Text/Wiki/Render/Plain/Wikilink.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml.php b/bundled-libs/Text/Wiki/Render/Xhtml.php deleted file mode 100644 index 1b7de089..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml.php +++ /dev/null @@ -1,33 +0,0 @@ - HTML_ENTITIES); - - function pre() - { - // attempt to translate HTML entities in the source before continuing. - $type = $this->getConf('translate', null); - - // are we translating html? - if ($type !== false && $type !== null) { - - // yes! get the translation table. - $xlate = get_html_translation_table($type); - - // remove the delimiter character it doesn't get translated - unset($xlate[$this->wiki->delim]); - - // translate! - $this->wiki->source = strtr($this->wiki->source, $xlate); - } - - } - - function post() - { - return; - } - -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Anchor.php b/bundled-libs/Text/Wiki/Render/Xhtml/Anchor.php deleted file mode 100644 index 1cebf8ef..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Anchor.php +++ /dev/null @@ -1,37 +0,0 @@ - -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Render_Xhtml_Anchor extends Text_Wiki_Render { - - var $conf = array( - 'css' => null - ); - - function token($options) - { - extract($options); // $type, $name - - if ($type == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - $format = ""; - return sprintf($format ,$name); - } - - if ($type == 'end') { - return ''; - } - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Blockquote.php b/bundled-libs/Text/Wiki/Render/Xhtml/Blockquote.php deleted file mode 100644 index e573b74a..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Blockquote.php +++ /dev/null @@ -1,46 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $type = $options['type']; - $level = $options['level']; - - // set up indenting so that the results look nice; we do this - // in two steps to avoid str_pad mathematics. ;-) - $pad = str_pad('', $level, "\t"); - $pad = str_replace("\t", ' ', $pad); - - // pick the css type - $css = $this->formatConf(' class="%s"', 'css'); - - // starting - if ($type == 'start') { - return "$pad"; - } - - // ending - if ($type == 'end') { - return $pad . "\n"; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Bold.php b/bundled-libs/Text/Wiki/Render/Xhtml/Bold.php deleted file mode 100644 index 0530d380..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Bold.php +++ /dev/null @@ -1,34 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Break.php b/bundled-libs/Text/Wiki/Render/Xhtml/Break.php deleted file mode 100644 index 28145aaa..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Break.php +++ /dev/null @@ -1,29 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $css = $this->formatConf(' class="%s"', 'css'); - return "\n"; - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Center.php b/bundled-libs/Text/Wiki/Render/Xhtml/Center.php deleted file mode 100644 index 4b0464d0..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Center.php +++ /dev/null @@ -1,29 +0,0 @@ -'; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Code.php b/bundled-libs/Text/Wiki/Render/Xhtml/Code.php deleted file mode 100644 index 306c3e43..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Code.php +++ /dev/null @@ -1,102 +0,0 @@ - null, // class for
-        'css_code' => null, // class for generic 
-        'css_php'  => null, // class for PHP 
-        'css_html' => null // class for HTML 
-    );
-    
-    /**
-    * 
-    * Renders a token into text matching the requested format.
-    * 
-    * @access public
-    * 
-    * @param array $options The "options" portion of the token (second
-    * element).
-    * 
-    * @return string The text rendered from the token options.
-    * 
-    */
-    
-    function token($options)
-    {
-        $text = $options['text'];
-        $attr = $options['attr'];
-        $type = strtolower($attr['type']);
-        
-        $css      = $this->formatConf(' class="%s"', 'css');
-        $css_code = $this->formatConf(' class="%s"', 'css_code');
-        $css_php  = $this->formatConf(' class="%s"', 'css_php');
-        $css_html = $this->formatConf(' class="%s"', 'css_html');
-        
-        if ($type == 'php') {
-            
-            // PHP code example:
-            // add the PHP tags
-            $text = ""; // ... tags)
-            ob_start();
-            highlight_string($text);
-            $text = ob_get_contents();
-            ob_end_clean();
-            
-            // replace 
tags with simple newlines. - // replace non-breaking space with simple spaces. - // translate HTML and color to XHTML and style. - // courtesy of research by A. Kalin :-). - $map = array( - '
' => "\n", - ' ' => ' ', - ' '' => '
', - 'color="' => 'style="color:' - ); - $text = strtr($text, $map); - - // get rid of the last newline inside the code block - // (becuase higlight_string puts one there) - if (substr($text, -8) == "\n
") { - $text = substr($text, 0, -8) . "
"; - } - - // replace all tags with classed tags - if ($css_php) { - $text = str_replace('', "", $text); - } - - // done - $text = "$text
"; - - } elseif ($type == 'html' || $type == 'xhtml') { - - // HTML code example: - // add opening and closing tags, - // convert tabs to four spaces, - // convert entities. - $text = str_replace("\t", " ", $text); - $text = "\n$text\n"; - $text = htmlentities($text); - $text = "$text"; - - } else { - // generic code example: - // convert tabs to four spaces, - // convert entities. - $text = str_replace("\t", " ", $text); - $text = htmlentities($text); - $text = "$text"; - } - - return "\n$text\n\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Colortext.php b/bundled-libs/Text/Wiki/Render/Xhtml/Colortext.php deleted file mode 100644 index 95882e4f..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Colortext.php +++ /dev/null @@ -1,56 +0,0 @@ -colors)) { - $color = '#' . $color; - } - - if ($type == 'start') { - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Deflist.php b/bundled-libs/Text/Wiki/Render/Xhtml/Deflist.php deleted file mode 100644 index c2f7251e..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Deflist.php +++ /dev/null @@ -1,64 +0,0 @@ - null, - 'css_dt' => null, - 'css_dd' => null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $type = $options['type']; - $pad = " "; - - switch ($type) { - - case 'list_start': - $css = $this->formatConf(' class="%s"', 'css_dl'); - return "\n"; - break; - - case 'list_end': - return "\n\n"; - break; - - case 'term_start': - $css = $this->formatConf(' class="%s"', 'css_dt'); - return $pad . ""; - break; - - case 'term_end': - return "\n"; - break; - - case 'narr_start': - $css = $this->formatConf(' class="%s"', 'css_dd'); - return $pad . $pad . ""; - break; - - case 'narr_end': - return "\n"; - break; - - default: - return ''; - - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Delimiter.php b/bundled-libs/Text/Wiki/Render/Xhtml/Delimiter.php deleted file mode 100644 index 2cbd685e..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Delimiter.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Embed.php b/bundled-libs/Text/Wiki/Render/Xhtml/Embed.php deleted file mode 100644 index 1ff84729..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Embed.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Emphasis.php b/bundled-libs/Text/Wiki/Render/Xhtml/Emphasis.php deleted file mode 100644 index b7756e56..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Emphasis.php +++ /dev/null @@ -1,35 +0,0 @@ - null - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Freelink.php b/bundled-libs/Text/Wiki/Render/Xhtml/Freelink.php deleted file mode 100644 index 0872a3c0..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Freelink.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Function.php b/bundled-libs/Text/Wiki/Render/Xhtml/Function.php deleted file mode 100644 index 5c203540..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Function.php +++ /dev/null @@ -1,87 +0,0 @@ - ', ', - - // the "main" format string - 'format_main' => '%access %return %name ( %params ) %throws', - - // the looped format string for required params - 'format_param' => '%type %descr', - - // the looped format string for params with default values - 'format_paramd' => '[%type %descr default %default]', - - // the looped format string for throws - 'format_throws' => 'throws %type %descr' - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - extract($options); // name, access, return, params, throws - - // build the baseline output - $output = $this->conf['format_main']; - $output = str_replace('%access', htmlspecialchars($access), $output); - $output = str_replace('%return', htmlspecialchars($return), $output); - $output = str_replace('%name', htmlspecialchars($name), $output); - - // build the set of params - $list = array(); - foreach ($params as $key => $val) { - - // is there a default value? - if ($val['default']) { - $tmp = $this->conf['format_paramd']; - } else { - $tmp = $this->conf['format_param']; - } - - // add the param elements - $tmp = str_replace('%type', htmlspecialchars($val['type']), $tmp); - $tmp = str_replace('%descr', htmlspecialchars($val['descr']), $tmp); - $tmp = str_replace('%default', htmlspecialchars($val['default']), $tmp); - $list[] = $tmp; - } - - // insert params into output - $tmp = implode($this->conf['list_sep'], $list); - $output = str_replace('%params', $tmp, $output); - - // build the set of throws - $list = array(); - foreach ($throws as $key => $val) { - $tmp = $this->conf['format_throws']; - $tmp = str_replace('%type', htmlspecialchars($val['type']), $tmp); - $tmp = str_replace('%descr', htmlspecialchars($val['descr']), $tmp); - $list[] = $tmp; - } - - // insert throws into output - $tmp = implode($this->conf['list_sep'], $list); - $output = str_replace('%throws', $tmp, $output); - - // close the div and return the output - $output .= ''; - return "\n$output\n\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Heading.php b/bundled-libs/Text/Wiki/Render/Xhtml/Heading.php deleted file mode 100644 index c5e30749..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Heading.php +++ /dev/null @@ -1,29 +0,0 @@ - null, - 'css_h2' => null, - 'css_h3' => null, - 'css_h4' => null, - 'css_h5' => null, - 'css_h6' => null - ); - - function token($options) - { - // get nice variable names (id, type, level) - extract($options); - - if ($type == 'start') { - $css = $this->formatConf(' class="%s"', "css_h$level"); - return ""; - } - - if ($type == 'end') { - return "\n"; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Horiz.php b/bundled-libs/Text/Wiki/Render/Xhtml/Horiz.php deleted file mode 100644 index d397ab67..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Horiz.php +++ /dev/null @@ -1,28 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $css = $this->formatConf(' class="%s"', 'css'); - return "\n"; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Html.php b/bundled-libs/Text/Wiki/Render/Xhtml/Html.php deleted file mode 100644 index 404621b2..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Html.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Image.php b/bundled-libs/Text/Wiki/Render/Xhtml/Image.php deleted file mode 100644 index ebeda8b3..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Image.php +++ /dev/null @@ -1,151 +0,0 @@ - '/', - 'css' => null, - 'css_link' => null - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // note the image source - $src = $options['src']; - - // is the source a local file or URL? - if (strpos($src, '://') === false) { - // the source refers to a local file. - // add the URL base to it. - $src = $this->getConf('base', '/') . $src; - } - - // stephane@metacites.net - // is the image clickable? - if (isset($options['attr']['link'])) { - // yes, the image is clickable. - // are we linked to a URL or a wiki page? - if (strpos($options['attr']['link'], '://')) { - // it's a URL - $href = $options['attr']['link']; - } else { - // it's a WikiPage; assume it exists. - /** @todo This needs to honor sprintf wikilinks (pmjones) */ - /** @todo This needs to honor interwiki (pmjones) */ - /** @todo This needs to honor freelinks (pmjones) */ - $href = $this->wiki->getRenderConf('xhtml', 'wikilink', 'view_url') . - $options['attr']['link']; - } - } else { - // image is not clickable. - $href = null; - } - // unset so it won't show up as an attribute - unset($options['attr']['link']); - - // stephane@metacites.net -- 25/07/2004 - // we make up an align="center" value for the tag. - if (isset($options['attr']['align']) && - $options['attr']['align'] == 'center') { - - // unset so it won't show up as an attribute - unset($options['attr']['align']); - - // make sure we have a style attribute - if (! isset($options['attr']['style'])) { - // no style, set up a blank one - $options['attr']['style'] = ''; - } else { - // style exists, add a space - $options['attr']['style'] .= ' '; - } - - // add a "center" style to the existing style. - $options['attr']['style'] .= - 'display: block; margin-left: auto; margin-right: auto;'; - } - - // stephane@metacites.net -- 25/07/2004 - // try to guess width and height - if (! isset($options['attr']['width']) && - ! isset($options['attr']['height'])) { - - // does the source refer to a local file or a URL? - if (strpos($src,'://')) { - // is a URL link - $imageFile = $src; - } else { - // is a local file - $imageFile = $_SERVER['DOCUMENT_ROOT'] . $src; - } - - // attempt to get the image size - $imageSize = @getimagesize($imageFile); - - if (is_array($imageSize)) { - $options['attr']['width'] = $imageSize[0]; - $options['attr']['height'] = $imageSize[1]; - } - - } - - // start the HTML output - $output = 'formatConf(' class="%s"', 'css'); - - // add the attributes to the output, and be sure to - // track whether or not we find an "alt" attribute - $alt = false; - foreach ($options['attr'] as $key => $val) { - - // track the 'alt' attribute - if (strtolower($key) == 'alt') { - $alt = true; - } - - // the 'class' attribute overrides the CSS class conf - if (strtolower($key) == 'class') { - $css = null; - } - - $key = htmlspecialchars($key); - $val = htmlspecialchars($val); - $output .= " $key=\"$val\""; - } - - // always add an "alt" attribute per Stephane Solliec - if (! $alt) { - $alt = htmlspecialchars(basename($options['src'])); - $output .= " alt=\"$alt\""; - } - - // end the image tag with the automatic CSS class (if any) - $output .= "$css />"; - - // was the image clickable? - if ($href) { - // yes, add the href and return - $href = htmlspecialchars($href); - $css = $this->formatConf(' class="%s"', 'css_link'); - $output = "$output"; - } - - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Include.php b/bundled-libs/Text/Wiki/Render/Xhtml/Include.php deleted file mode 100644 index f04a7d40..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Include.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Interwiki.php b/bundled-libs/Text/Wiki/Render/Xhtml/Interwiki.php deleted file mode 100644 index 30b363ef..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Interwiki.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'MeatBall' => 'http://www.usemod.com/cgi-bin/mb.pl?%s', - 'Advogato' => 'http://advogato.org/%s', - 'Wiki' => 'http://c2.com/cgi/wiki?%s' - ), - 'target' => '_blank', - 'css' => null - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $site = $options['site']; - $page = $options['page']; - $text = $options['text']; - $css = $this->formatConf(' class="%s"', 'css'); - - if (isset($this->conf['sites'][$site])) { - $href = $this->conf['sites'][$site]; - } else { - return $text; - } - - // old form where page is at end, - // or new form with %s placeholder for sprintf()? - if (strpos($href, '%s') === false) { - // use the old form - $href = $href . $page; - } else { - // use the new form - $href = sprintf($href, $page); - } - - // allow for alternative targets - $target = $this->getConf('target'); - - // build base link - $text = htmlspecialchars($text); - $output = " \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Italic.php b/bundled-libs/Text/Wiki/Render/Xhtml/Italic.php deleted file mode 100644 index 6ae3a9a1..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Italic.php +++ /dev/null @@ -1,34 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/List.php b/bundled-libs/Text/Wiki/Render/Xhtml/List.php deleted file mode 100644 index b6dabba0..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/List.php +++ /dev/null @@ -1,142 +0,0 @@ - null, - 'css_ol_li' => null, - 'css_ul' => null, - 'css_ul_li' => null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * This rendering method is syntactically and semantically compliant - * with XHTML 1.1 in that sub-lists are part of the previous list item. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // make nice variables (type, level, count) - extract($options); - - // set up indenting so that the results look nice; we do this - // in two steps to avoid str_pad mathematics. ;-) - $pad = str_pad('', $level, "\t"); - $pad = str_replace("\t", ' ', $pad); - - switch ($type) { - - case 'bullet_list_start': - - // build the base HTML - $css = $this->formatConf(' class="%s"', 'css_ul'); - $html = ""; - - // if this is the opening block for the list, - // put an extra newline in front of it so the - // output looks nice. - if ($level == 0) { - $html = "\n$html"; - } - - // done! - return $html; - break; - - case 'bullet_list_end': - - // build the base HTML - $html = "\n$pad"; - - // if this is the closing block for the list, - // put extra newlines after it so the output - // looks nice. - if ($level == 0) { - $html .= "\n\n"; - } - - // done! - return $html; - break; - - case 'number_list_start': - - // build the base HTML - $css = $this->formatConf(' class="%s"', 'css_ol'); - $html = ""; - - // if this is the opening block for the list, - // put an extra newline in front of it so the - // output looks nice. - if ($level == 0) { - $html = "\n$html"; - } - - // done! - return $html; - break; - - case 'number_list_end': - - // build the base HTML - $html = "\n$pad"; - - // if this is the closing block for the list, - // put extra newlines after it so the output - // looks nice. - if ($level == 0) { - $html .= "\n\n"; - } - - // done! - return $html; - break; - - case 'bullet_item_start': - case 'number_item_start': - - // pick the proper CSS class - if ($type == 'bullet_item_start') { - $css = $this->formatConf(' class="%s"', 'css_ul_li'); - } else { - $css = $this->formatConf(' class="%s"', 'css_ol_li'); - } - - // build the base HTML - $html = "\n$pad"; - - // for the very first item in the list, do nothing. - // but for additional items, be sure to close the - // previous item. - if ($count > 0) { - $html = "$html"; - } - - // done! - return $html; - break; - - case 'bullet_item_end': - case 'number_item_end': - default: - // ignore item endings and all other types. - // item endings are taken care of by the other types - // depending on their place in the list. - return ''; - break; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Newline.php b/bundled-libs/Text/Wiki/Render/Xhtml/Newline.php deleted file mode 100644 index 441dfb25..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Newline.php +++ /dev/null @@ -1,12 +0,0 @@ -\n"; - } -} - -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Paragraph.php b/bundled-libs/Text/Wiki/Render/Xhtml/Paragraph.php deleted file mode 100644 index 4d992c08..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Paragraph.php +++ /dev/null @@ -1,36 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - extract($options); //type - - if ($type == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($type == 'end') { - return "

\n\n"; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Phplookup.php b/bundled-libs/Text/Wiki/Render/Xhtml/Phplookup.php deleted file mode 100644 index 91b25983..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Phplookup.php +++ /dev/null @@ -1,59 +0,0 @@ - '_blank', - 'css' => null - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - $text = trim($options['text']); - $css = $this->formatConf(' class="%s"', 'css'); - - // start the html - $output = "getConf('target', ''); - if ($target) { - // use a "popup" window. this is XHTML compliant, suggested by - // Aaron Kalin. uses the $target as the new window name. - $target = htmlspecialchars($target); - $output .= " onclick=\"window.open(this.href, '$target');"; - $output .= " return false;\""; - } - - // take off the final parens for functions - if (substr($text, -2) == '()') { - $q = substr($text, 0, -2); - } else { - $q = $text; - } - - $q = htmlspecialchars($q); - $text = htmlspecialchars($text); - - // finish and return - $output .= " href=\"http://php.net/$q\">$text"; - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Prefilter.php b/bundled-libs/Text/Wiki/Render/Xhtml/Prefilter.php deleted file mode 100644 index 6308db6d..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Prefilter.php +++ /dev/null @@ -1,40 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Prefilter.php,v 1.5 2004/09/25 19:05:14 pmjones Exp $ - - -/** -* -* This class implements a Text_Wiki_Render_Xhtml to "pre-filter" source text so -* that line endings are consistently \n, lines ending in a backslash \ -* are concatenated with the next line, and tabs are converted to spaces. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Render_Xhtml_Prefilter extends Text_Wiki_Render { - function token() - { - return ''; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Raw.php b/bundled-libs/Text/Wiki/Render/Xhtml/Raw.php deleted file mode 100644 index a986aa06..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Raw.php +++ /dev/null @@ -1,23 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Revise.php b/bundled-libs/Text/Wiki/Render/Xhtml/Revise.php deleted file mode 100644 index 7cb5e957..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Revise.php +++ /dev/null @@ -1,45 +0,0 @@ - null, - 'css_del' => null - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'del_start') { - $css = $this->formatConf(' class="%s"', 'css_del'); - return ""; - } - - if ($options['type'] == 'del_end') { - return ""; - } - - if ($options['type'] == 'ins_start') { - $css = $this->formatConf(' class="%s"', 'css_ins'); - return ""; - } - - if ($options['type'] == 'ins_end') { - return ""; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Strong.php b/bundled-libs/Text/Wiki/Render/Xhtml/Strong.php deleted file mode 100644 index 6b231bdf..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Strong.php +++ /dev/null @@ -1,35 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Superscript.php b/bundled-libs/Text/Wiki/Render/Xhtml/Superscript.php deleted file mode 100644 index f1226adf..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Superscript.php +++ /dev/null @@ -1,34 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Table.php b/bundled-libs/Text/Wiki/Render/Xhtml/Table.php deleted file mode 100644 index 231be578..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Table.php +++ /dev/null @@ -1,98 +0,0 @@ - null, - 'css_tr' => null, - 'css_th' => null, - 'css_td' => null - ); - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // make nice variable names (type, attr, span) - extract($options); - - $pad = ' '; - - switch ($type) { - - case 'table_start': - $css = $this->formatConf(' class="%s"', 'css_table'); - return "\n\n\n"; - break; - - case 'table_end': - return "\n\n"; - break; - - case 'row_start': - $css = $this->formatConf(' class="%s"', 'css_tr'); - return "$pad\n"; - break; - - case 'row_end': - return "$pad\n"; - break; - - case 'cell_start': - - // base html - $html = $pad . $pad; - - // is this a TH or TD cell? - if ($attr == 'header') { - // start a header cell - $css = $this->formatConf(' class="%s"', 'css_th'); - $html .= "formatConf(' class="%s"', 'css_td'); - $html .= " 1) { - $html .= " colspan=\"$span\""; - } - - // add alignment - if ($attr != 'header' && $attr != '') { - $html .= " style=\"text-align: $attr;\""; - } - - // done! - $html .= '>'; - return $html; - break; - - case 'cell_end': - if ($attr == 'header') { - return "\n"; - } else { - return "\n"; - } - break; - - default: - return ''; - - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Tighten.php b/bundled-libs/Text/Wiki/Render/Xhtml/Tighten.php deleted file mode 100644 index fdc1738b..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Tighten.php +++ /dev/null @@ -1,10 +0,0 @@ - \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Toc.php b/bundled-libs/Text/Wiki/Render/Xhtml/Toc.php deleted file mode 100644 index e5b5f4bd..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Toc.php +++ /dev/null @@ -1,80 +0,0 @@ - null, - 'css_item' => null, - 'title' => 'Table of Contents', - 'div_id' => 'toc' - ); - - var $min = 2; - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // type, id, level, count, attr - extract($options); - - switch ($type) { - - case 'list_start': - - $html = 'getConf('css_list'); - if ($css) { - $html .= " class=\"$css\""; - } - - $div_id = $this->getConf('div_id'); - if ($div_id) { - $html .= " id=\"$div_id\""; - } - - $html .= '>'; - $html .= $this->getConf('title'); - return $html; - break; - - case 'list_end': - return "\n"; - break; - - case 'item_start': - $html = 'getConf('css_item'); - if ($css) { - $html .= " class=\"$css\""; - } - - $pad = ($level - $this->min); - $html .= " style=\"margin-left: {$pad}em;\">"; - - $html .= ""; - return $html; - break; - - case 'item_end': - return "\n"; - break; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Tt.php b/bundled-libs/Text/Wiki/Render/Xhtml/Tt.php deleted file mode 100644 index e40ea976..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Tt.php +++ /dev/null @@ -1,35 +0,0 @@ - null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - if ($options['type'] == 'start') { - $css = $this->formatConf(' class="%s"', 'css'); - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Url.php b/bundled-libs/Text/Wiki/Render/Xhtml/Url.php deleted file mode 100644 index a7bf121d..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Url.php +++ /dev/null @@ -1,91 +0,0 @@ - '_blank', - 'images' => true, - 'img_ext' => array('jpg', 'jpeg', 'gif', 'png'), - 'css_inline' => null, - 'css_footnote' => null, - 'css_descr' => null, - 'css_img' => null - ); - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // create local variables from the options array (text, - // href, type) - extract($options); - - // find the rightmost dot and determine the filename - // extension. - $pos = strrpos($href, '.'); - $ext = strtolower(substr($href, $pos + 1)); - $href = htmlspecialchars($href); - - // does the filename extension indicate an image file? - if ($this->getConf('images') && - in_array($ext, $this->getConf('img_ext', array()))) { - - // create alt text for the image - if (! isset($text) || $text == '') { - $text = basename($href); - $text = htmlspecialchars($text); - } - - // generate an image tag - $css = $this->formatConf(' class="%s"', 'css_img'); - $output = ""; - - } else { - - // allow for alternative targets on non-anchor HREFs - if ($href[0] == '#') { - $target = ''; - } else { - $target = $this->getConf('target'); - } - - // generate a regular link (not an image) - $text = htmlspecialchars($text); - $css = $this->formatConf(' class="%s"', "css_$type"); - $output = "'; - } - } - - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Render/Xhtml/Wikilink.php b/bundled-libs/Text/Wiki/Render/Xhtml/Wikilink.php deleted file mode 100644 index 141ab1a5..00000000 --- a/bundled-libs/Text/Wiki/Render/Xhtml/Wikilink.php +++ /dev/null @@ -1,137 +0,0 @@ - array(), // set to null or false to turn off page checks - 'view_url' => 'http://example.com/index.php?page=%s', - 'new_url' => 'http://example.com/new.php?page=%s', - 'new_text' => '?', - 'new_text_pos' => 'after', // 'before', 'after', or null/false - 'css' => null, - 'css_new' => null, - 'exists_callback' => null // call_user_func() callback - ); - - - /** - * - * Renders a token into XHTML. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function token($options) - { - // make nice variable names (page, anchor, text) - extract($options); - - // is there a "page existence" callback? - // we need to access it directly instead of through - // getConf() because we'll need a reference (for - // object instance method callbacks). - if (isset($this->conf['exists_callback'])) { - $callback =& $this->conf['exists_callback']; - } else { - $callback = false; - } - - if ($callback) { - // use the callback function - $exists = call_user_func($callback, $page); - } else { - // no callback, go to the naive page array. - $list =& $this->getConf('pages'); - if (is_array($list)) { - // yes, check against the page list - $exists = in_array($page, $list); - } else { - // no, assume it exists - $exists = true; - } - } - - // convert *after* checking against page names so as not to mess - // up what the user typed and what we're checking. - $page = htmlspecialchars($page); - $anchor = htmlspecialchars($anchor); - $text = htmlspecialchars($text); - - // does the page exist? - if ($exists) { - - // PAGE EXISTS. - - // link to the page view, but we have to build - // the HREF. we support both the old form where - // the page always comes at the end, and the new - // form that uses %s for sprintf() - $href = $this->getConf('view_url'); - - if (strpos($href, '%s') === false) { - // use the old form (page-at-end) - $href = $href . $page . $anchor; - } else { - // use the new form (sprintf format string) - $href = sprintf($href, $page . $anchor); - } - - // get the CSS class and generate output - $css = $this->formatConf(' class="%s"', 'css'); - $output = "$text"; - - } else { - - // PAGE DOES NOT EXIST. - - // link to a create-page url, but only if new_url is set - $href = $this->getConf('new_url', null); - - // set the proper HREF - if (! $href || trim($href) == '') { - - // no useful href, return the text as it is - $output = $text; - - } else { - - // yes, link to the new-page href, but we have to build - // it. we support both the old form where - // the page always comes at the end, and the new - // form that uses sprintf() - if (strpos($href, '%s') === false) { - // use the old form - $href = $href . $page; - } else { - // use the new form - $href = sprintf($href, $page); - } - } - - // get the appropriate CSS class and new-link text - $css = $this->formatConf(' class="%s"', 'css_new'); - $new = $this->getConf('new_text'); - - // what kind of linking are we doing? - $pos = $this->getConf('new_text_pos'); - if (! $pos || ! $new) { - // no position (or no new_text), use css only on the page name - $output = "$page"; - } elseif ($pos == 'before') { - // use the new_text BEFORE the page name - $output = "$new$text"; - } else { - // default, use the new_text link AFTER the page name - $output = "$text$new"; - } - } - return $output; - } -} -?> \ No newline at end of file diff --git a/bundled-libs/Text/Wiki/Rule.php b/bundled-libs/Text/Wiki/Rule.php deleted file mode 100644 index 8c871a2d..00000000 --- a/bundled-libs/Text/Wiki/Rule.php +++ /dev/null @@ -1,345 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: Rule.php,v 1.3 2004/12/02 10:54:31 nohn Exp $ - -/** -* -* Baseline rule class for extension into a "real" wiki rule. -* -* Text_Wiki_Rule classes do not stand on their own; they are called by a -* Text_Wiki object, typcially in the transform()method. Each rule class -* performs three main activities: parse, process, and render. -* -* The parse() method takes a regex and applies it to the whole block of -* source text at one time. Each match is sent as $matches to the -* process() method. -* -* The process() method acts on the matched text from the source, and -* then processes the source text is some way. This may mean the -* creation of a delimited token using addToken(). In every case, the -* process() method returns the text that should replace the matched text -* from parse(). -* -* Finally, the render*() methods take any token created by the rule and -* creates output text matching a specific format. Individual rules may -* or may not have options for specific formats. -* -* Typically, the extended rule only needs to define the process() and -* render() methods; the parse() method is generally the same from rule -* to rule, and has been included here. However, there is no reason that -* rules cannot override these methods, so long as the new methods operate -* in substantially the same manner; similarly, the rule need not generate -* any tokens at all, and may use a specialized parse() method to filter -* the source text. See the default rule classes for many examples. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = null; - - - /** - * - * A reference to the calling Text_Wiki object. This is needed so - * that each rule has access to the same source text, token set, - * URLs, interwiki maps, page names, etc. - * - * @access public - * - * @var object - */ - - var $_wiki = null; - - - /** - * - * The name of this rule; used when inserting new token array - * elements. - * - * @access private - * - * @var string - * - */ - - var $_rule = null; - - - /** - * - * Configuration options for this rule. - * - * @access private - * - * @var string - * - */ - - var $_conf = null; - - - /** - * - * Constructor for the rule. - * - * @access public - * - * @param object &$obj The calling "parent" Text_Wiki object. - * - * @param string $name The token name to use for this rule. - * - */ - - function Text_Wiki_Rule(&$obj, $name) - { - // set the reference to the calling Text_Wiki object; - // this allows us access to the shared source text, token - // array, etc. - $this->_wiki =& $obj; - - // set the name of this rule; generally used when adding - // to the tokens array. - $this->_rule = $name; - - // config options reference - $this->_conf =& $this->_wiki->rules[$this->_rule]['conf']; - } - - - /** - * - * Add a token to the Text_Wiki tokens array, and return a delimited - * token number. - * - * @access public - * - * @param array $options An associative array of options for the new - * token array element. The keys and values are specific to the - * rule, and may or may not be common to other rule options. Typical - * options keys are 'text' and 'type' but may include others. - * - * @param boolean $id_only If true, return only the token number, not - * a delimited token string. - * - * @return string|int By default, return the number of the - * newly-created token array element with a delimiter prefix and - * suffix; however, if $id_only is set to true, return only the token - * number (no delimiters). - * - */ - - function addToken($options = array(), $id_only = false) - { - // force the options to be an array - settype($options, 'array'); - - // find the next token number - $id = count($this->_wiki->_tokens); - - // add the token - $this->_wiki->_tokens[$id] = array( - 0 => $this->_rule, - 1 => $options - ); - - // return a value - if ($id_only) { - // return the last token number - return $id; - } else { - // return the token number with delimiters - return $this->_wiki->delim . $id . $this->_wiki->delim; - } - } - - - /** - * - * Set or re-set a token with specific information, overwriting any - * previous rule name and rule options. - * - * @access public - * - * @param int $id The token number to reset. - * - * @param int $rule The rule name to use; by default, use the current - * rule name, although you can specify any rule. - * - * @param array $options An associative array of options for the - * token array element. The keys and values are specific to the - * rule, and may or may not be common to other rule options. Typical - * options keys are 'text' and 'type' but may include others. - * - * @return void - * - */ - - function setToken($id, $rule = null, $options = array()) - { - // get a rule name - if (is_null($rule)) { - $rule = $this->_rule; - } - - // reset the token - $this->_wiki->_tokens[$id] = array( - 0 => $rule, - 1 => $options - ); - } - - - /** - * - * Simple parsing method to apply the rule's regular expression to - * the source text, pass every match to the process() method, and - * replace the matched text with the results of the processing. - * - * @access public - * - */ - - function parse() - { - $this->_wiki->_source = preg_replace_callback( - $this->regex, - array(&$this, 'process'), - $this->_wiki->_source - ); - } - - - /** - * - * Simple processing mathod to take matched text and generate - * replacement text. This is one of the methods you will definitely - * want to override in your rule class extensions. - * - * @access public - * - * @param array $matches An array of matches from the parse() method - * as generated by preg_replace_callback. $matches[0] is the full - * matched string, $matches[1] is the first matched pattern, - * $matches[2] is the second matched pattern, and so on. - * - * @return string The processed text replacement; defaults to the - * full matched string (i.e., no changes to the text). - * - */ - - function process(&$matches) - { - return $matches[0]; - } - - - /** - * - * Simple rendering method to take a set of token options and - * generate replacement text for it. This is another method you will - * definitely want to override in your rule subclass extensions. - * - * @access public - * - * @param array $options The "options" portion of the token (second element). - * - * @return string The text rendered from the token options; by default, - * no text is returned. You should change this in your subclass. ;-) - * - */ - - function renderXhtml($options) - { - return ''; - } - - - /** - * - * Simple method to extract 'option="value"' portions of wiki markup, - * typically used only in macros. - * - * The syntax is pretty strict; there can be no spaces between the - * option name, the equals, and the first double-quote; the value - * must be surrounded by double-quotes. You can escape characters in - * the value with a backslash, and the backslash will be stripped for - * you. - * - * @access public - * - * @param string $text The "macro options" portion of macro markup. - * - * @return array An associative array of key-value pairs where the - * key is the option name and the value is the option value. - * - */ - - function getMacroArgs($text) - { - // find the =" sections; - $tmp = explode('="', trim($text)); - - // basic setup - $k = count($tmp) - 1; - $arg = array(); - $key = null; - - // loop through the sections - foreach ($tmp as $i => $val) { - - // first element is always the first key - if ($i == 0) { - $key = trim($val); - continue; - } - - // find the last double-quote in the value. - // the part to the left is the value for the last key, - // the part to the right is the next key name - $pos = strrpos($val, '"'); - $arg[$key] = stripslashes(substr($val, 0, $pos)); - $key = trim(substr($val, $pos+1)); - - } - - return $arg; - - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/blockquote.php b/bundled-libs/Text/Wiki/Rule/blockquote.php deleted file mode 100644 index d0605f9f..00000000 --- a/bundled-libs/Text/Wiki/Rule/blockquote.php +++ /dev/null @@ -1,209 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: blockquote.php,v 1.3 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find source text marked as a -* blockquote, identified by any number of greater-than signs '>' at the -* start of the line, followed by a space, and then the quote text; each -* '>' indicates an additional level of quoting. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_blockquote extends Text_Wiki_Rule { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/\n((\>).*\n)(?!(\>))/Us'; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => - * 'start' : the start of a blockquote - * 'end' : the end of a blockquote - * - * 'level' => the indent level (0 for the first level, 1 for the - * second, etc) - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A series of text and delimited tokens marking the different - * list text and list elements. - * - */ - - function process(&$matches) - { - // the replacement text we will return to parse() - $return = ''; - - // the list of post-processing matches - $list = array(); - - // $matches[1] is the text matched as a list set by parse(); - // create an array called $list that contains a new set of - // matches for the various list-item elements. - preg_match_all( - '=^(\>+) (.*\n)=Ums', - $matches[1], - $list, - PREG_SET_ORDER - ); - - // a stack of starts and ends; we keep this so that we know what - // indent level we're at. - $stack = array(); - - // loop through each list-item element. - foreach ($list as $key => $val) { - - // $val[0] is the full matched list-item line - // $val[1] is the number of initial '>' chars (indent level) - // $val[2] is the quote text - - // we number levels starting at 1, not zero - $level = strlen($val[1]); - - // get the text of the line - $text = $val[2]; - - // add a level to the list? - if ($level > count($stack)) { - - // the current indent level is greater than the number - // of stack elements, so we must be starting a new - // level. push the new level onto the stack with a - // dummy value (boolean true)... - array_push($stack, true); - - $return .= "\n"; - - // ...and add a start token to the return. - $return .= $this->addToken( - array( - 'type' => 'start', - 'level' => $level - 1 - ) - ); - - $return .= "\n\n"; - } - - // remove a level? - while (count($stack) > $level) { - - // as long as the stack count is greater than the - // current indent level, we need to end list types. - // continue adding end-list tokens until the stack count - // and the indent level are the same. - array_pop($stack); - - $return .= "\n\n"; - - $return .= $this->addToken( - array ( - 'type' => 'end', - 'level' => count($stack) - ) - ); - - $return .= "\n"; - } - - // add the line text. - $return .= $text; - } - - // the last line may have been indented. go through the stack - // and create end-tokens until the stack is empty. - $return .= "\n"; - - while (count($stack) > 0) { - array_pop($stack); - $return .= $this->addToken( - array ( - 'type' => 'end', - 'level' => count($stack) - ) - ); - } - - // we're done! send back the replacement text. - return "$return\n"; - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - $type = $options['type']; - $level = $options['level']; - - // set up indenting so that the results look nice; we do this - // in two steps to avoid str_pad mathematics. ;-) - $pad = str_pad('', $level, "\t"); - $pad = str_replace("\t", ' ', $pad); - - // starting - if ($type == 'start') { - return "$pad
"; - } - - // ending - if ($type == 'end') { - return $pad . "
\n"; - } - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/bold.php b/bundled-libs/Text/Wiki/Rule/bold.php deleted file mode 100644 index 4155b98f..00000000 --- a/bundled-libs/Text/Wiki/Rule/bold.php +++ /dev/null @@ -1,103 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: bold.php,v 1.3 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find source text marked for -* strong emphasis (bold) as defined by text surrounded by three -* single-quotes. On parsing, the text itself is left in place, but the -* starting and ending instances of three single-quotes are replaced with -* tokens. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_bold extends Text_Wiki_Rule { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/'''(()|[^'].*)'''/U"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A pair of delimited tokens to be used as a placeholder in - * the source text surrounding the text to be emphasized. - * - */ - - function process(&$matches) - { - $start = $this->addToken(array('type' => 'start')); - $end = $this->addToken(array('type' => 'end')); - return $start . $matches[1] . $end; - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - if ($options['type'] == 'start') { - return ''; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/break.php b/bundled-libs/Text/Wiki/Rule/break.php deleted file mode 100644 index fcc74139..00000000 --- a/bundled-libs/Text/Wiki/Rule/break.php +++ /dev/null @@ -1,90 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: break.php,v 1.2 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to mark forced line breaks in the -* source text. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_break extends Text_Wiki_Rule { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/ _\n/'; - - - /** - * - * Generates a replacement token for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A delimited token to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - return $this->addToken(); - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - return "
\n"; - } -} - -?> diff --git a/bundled-libs/Text/Wiki/Rule/center.php b/bundled-libs/Text/Wiki/Rule/center.php deleted file mode 100644 index c4c3e782..00000000 --- a/bundled-libs/Text/Wiki/Rule/center.php +++ /dev/null @@ -1,98 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: center.php,v 1.2 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find lines marked for centering. -* The line must start with "= " (i.e., an equal-sign followed by a space). -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_center extends Text_Wiki_Rule { - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - //var $regex = '/\n(\)\n(.+)\n(\<\/center\>)\n/Umsi'; - var $regex = '/\n\= (.*?)\n/'; - - /** - * - * Generates a token entry for the matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - $start = $this->addToken(array('type' => 'start')); - $end = $this->addToken(array('type' => 'end')); - //return "\n" . $start . "\n" . $matches[2] . "\n\n" . $end . "\n"; - return "\n" . $start . $matches[1] . $end . "\n"; - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - if ($options['type'] == 'start') { - //return "\n
\n"; - return '
'; - } - - if ($options['type'] == 'end') { - //return "
\n"; - return ''; - } - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/code.php b/bundled-libs/Text/Wiki/Rule/code.php deleted file mode 100644 index 6bd4045a..00000000 --- a/bundled-libs/Text/Wiki/Rule/code.php +++ /dev/null @@ -1,177 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: code.php,v 1.4 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find sections marked as code -* examples. Blocks are marked as the string on a line by itself, -* followed by the inline code example, and terminated with the string -* on a line by itself. The code example is run through the -* native PHP highlight_string() function to colorize it, then surrounded -* with
...
tags when rendered as XHTML. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_code extends Text_Wiki_Rule { - - - /** - * - * The regular expression used to find source text matching this - * rule. - * - * @access public - * - * @var string - * - */ - - var $regex = '/^(\)\n(.+)\n(\<\/code\>)(\s|$)/Umsi'; - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text, not including the tags. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - // are there additional arguments? - $args = trim($matches[2]); - - if ($args == '') { - $options = array( - 'text' => $matches[3], - 'args' => array('type' => '') - ); - } else { - $options = array( - 'text' => $matches[3], - 'args' => $this->getMacroArgs($args) - ); - } - - return $this->addToken($options) . $matches[5]; - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - // trim opening and closing whitespace - $text = trim($options['text']); - $args = $options['args']; - - if (strtolower($args['type']) == 'php') { - - // PHP code example - - // add the PHP tags - $text = ""; // ... tags) - ob_start(); - highlight_string($text); - $text = ob_get_contents(); - ob_end_clean(); - - // replace
tags with simple newlines - //$text = str_replace("
", "\n", $text); - - // replace non-breaking space with simple spaces - //$text = str_replace(" ", " ", $text); - - // replace
tags with simple newlines - // replace non-breaking space with simple spaces - // translate old HTML to new XHTML - // courtesy of research by A. Kalin :-) - $map = array( - '
' => "\n", - ' ' => ' ', - ' '' => '', - 'color="' => 'style="color:' - ); - $text = strtr($text, $map); - - // get rid of the last newline inside the code block - // (becuase higlight_string puts one there) - if (substr($text, -8) == "\n") { - $text = substr($text, 0, -8) . ""; - } - - // done - $text = "
$text
"; - - } elseif (strtolower($args['type']) == 'html') { - - // HTML code example: - // add opening and closing tags, - // convert tabs to four spaces, - // convert entities. - $text = str_replace("\t", " ", $text); - $text = "\n$text\n"; - $text = htmlentities($text); - $text = "
$text
"; - - } else { - // generic code example: - // convert tabs to four spaces, - // convert entities. - $text = str_replace("\t", " ", $text); - $text = htmlentities($text); - $text = "
$text
"; - } - - return "\n$text\n"; - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/colortext.php b/bundled-libs/Text/Wiki/Rule/colortext.php deleted file mode 100644 index 7d9ffd5f..00000000 --- a/bundled-libs/Text/Wiki/Rule/colortext.php +++ /dev/null @@ -1,139 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: colortext.php,v 1.2 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find source text marked for -* coloring. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_colortext extends Text_Wiki_Rule { - - var $colors = array( - 'aqua', - 'black', - 'blue', - 'fuchsia', - 'gray', - 'green', - 'lime', - 'maroon', - 'navy', - 'olive', - 'purple', - 'red', - 'silver', - 'teal', - 'white', - 'yellow' - ); - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = "/\#\#(.+?)\|(.+?)\#\#/"; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => ['start'|'end'] The starting or ending point of the - * emphasized text. The text itself is left in the source. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return string A pair of delimited tokens to be used as a - * placeholder in the source text surrounding the text to be - * emphasized. - * - */ - - function process(&$matches) - { - $start = $this->addToken( - array( - 'type' => 'start', - 'color' => $matches[1] - ) - ); - - $end = $this->addToken( - array( - 'type' => 'end', - 'color' => $matches[1] - ) - ); - - return $start . $matches[2] . $end; - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - $type = $options['type']; - $color = $options['color']; - - if (! in_array($color, $this->colors)) { - $color = '#' . $color; - } - - if ($type == 'start') { - return ""; - } - - if ($options['type'] == 'end') { - return ''; - } - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/deflist.php b/bundled-libs/Text/Wiki/Rule/deflist.php deleted file mode 100644 index 68ff89e8..00000000 --- a/bundled-libs/Text/Wiki/Rule/deflist.php +++ /dev/null @@ -1,172 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: deflist.php,v 1.3 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find source text marked as a -* definition list. In short, if a line starts with ':' then it is a -* definition list item; another ':' on the same lines indicates the end -* of the definition term and the beginning of the definition narrative. -* The list items must be on sequential lines (no blank lines between -* them) -- a blank line indicates the beginning of a new list. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_deflist extends Text_Wiki_Rule { - - - /** - * - * The regular expression used to parse the source text and find - * matches conforming to this rule. Used by the parse() method. - * - * @access public - * - * @var string - * - * @see parse() - * - */ - - var $regex = '/\n((:).*\n)(?!(:))/Us'; - - - /** - * - * Generates a replacement for the matched text. Token options are: - * - * 'type' => - * 'list_start' : the start of a definition list - * 'list_end' : the end of a definition list - * 'term_start' : the start of a definition term - * 'term_end' : the end of a definition term - * 'narr_start' : the start of definition narrative - * 'narr_end' : the end of definition narrative - * 'unknown' : unknown type of definition portion - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A series of text and delimited tokens marking the different - * list text and list elements. - * - */ - - function process(&$matches) - { - // the replacement text we will return to parse() - $return = ''; - - // the list of post-processing matches - $list = array(); - - // start the deflist - $options = array('type' => 'list_start'); - $return .= $this->addToken($options); - - // $matches[1] is the text matched as a list set by parse(); - // create an array called $list that contains a new set of - // matches for the various definition-list elements. - preg_match_all( - '/^(:)(.*)?(:)(.*)?$/Ums', - $matches[1], - $list, - PREG_SET_ORDER - ); - - // add each term and narrative - foreach ($list as $key => $val) { - $return .= ( - $this->addToken(array('type' => 'term_start')) . - trim($val[2]) . - $this->addToken(array('type' => 'term_end')) . - $this->addToken(array('type' => 'narr_start')) . - trim($val[4]) . - $this->addToken(array('type' => 'narr_end')) - ); - } - - - // end the deflist - $options = array('type' => 'list_end'); - $return .= $this->addToken($options); - - // done! - return "\n" . $return . "\n"; - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - $type = $options['type']; - $pad = " "; - - switch ($type) { - - case 'list_start': - return "
\n"; - break; - - case 'list_end': - return "
\n"; - break; - - case 'term_start': - return $pad . "
"; - break; - - case 'term_end': - return "
\n"; - break; - - case 'narr_start': - return $pad . $pad . "
"; - break; - - case 'narr_end': - return "
\n"; - break; - - default: - return ''; - - } - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/delimiter.php b/bundled-libs/Text/Wiki/Rule/delimiter.php deleted file mode 100644 index 27782ee1..00000000 --- a/bundled-libs/Text/Wiki/Rule/delimiter.php +++ /dev/null @@ -1,95 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: delimiter.php,v 1.3 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to find instances of the delimiter -* character already embedded in the source text; it extracts them and replaces -* them with a delimited token, then renders them as the delimiter itself -* when the target format is XHTML. -* -* @author Paul M. Jones -* -* @package Text_Wiki -* -*/ - -class Text_Wiki_Rule_delimiter extends Text_Wiki_Rule { - - /** - * - * Constructor. Overrides the Text_Wiki_Rule constructor so that we - * can set the $regex property dynamically (we need to include the - * Text_Wiki $delim character. - * - * @param object &$obj The calling "parent" Text_Wiki object. - * - * @param string $name The token name to use for this rule. - * - */ - - function Text_Wiki_Rule_delimiter(&$obj, $name) - { - parent::Text_Wiki_Rule($obj, $name); - $this->regex = '/' . $this->_wiki->delim . '/'; - } - - - /** - * - * Generates a token entry for the matched text. Token options are: - * - * 'text' => The full matched text. - * - * @access public - * - * @param array &$matches The array of matches from parse(). - * - * @return A delimited token number to be used as a placeholder in - * the source text. - * - */ - - function process(&$matches) - { - return $this->addToken(); - } - - - /** - * - * Renders a token into text matching the requested format. - * - * @access public - * - * @param array $options The "options" portion of the token (second - * element). - * - * @return string The text rendered from the token options. - * - */ - - function renderXhtml($options) - { - return $this->_wiki->delim; - } -} -?> diff --git a/bundled-libs/Text/Wiki/Rule/embed.php b/bundled-libs/Text/Wiki/Rule/embed.php deleted file mode 100644 index 93191445..00000000 --- a/bundled-libs/Text/Wiki/Rule/embed.php +++ /dev/null @@ -1,102 +0,0 @@ - | -// +----------------------------------------------------------------------+ -// -// $Id: embed.php,v 1.2 2004/12/02 10:54:32 nohn Exp $ - - -/** -* -* This class implements a Text_Wiki_Rule to embed the contents of a URL -* inside the page at render-time. Typically used to get script output. -* This differs from the 'include' rule, which incorporates results at -* parse-time; 'embed' output does not get parsed by Text_Wiki, while -* 'include' ouput does. -* -* This rule is inherently not secure; it allows cross-site scripting to -* occur if the embedded output has