From: <var...@us...> - 2013-06-18 13:39:33
|
Revision: 8815 http://sourceforge.net/p/phpwiki/code/8815 Author: vargenau Date: 2013-06-18 13:39:29 +0000 (Tue, 18 Jun 2013) Log Message: ----------- Merge OldTextFormattingRules into TextFormattingRules; rename underscore plugins Modified Paths: -------------- trunk/lib/BlockParser.php trunk/lib/CachedMarkup.php trunk/lib/IniConfig.php trunk/lib/InlineParser.php trunk/lib/PageList.php trunk/lib/PageType.php trunk/lib/WysiwygEdit/Wikiwyg.php trunk/lib/WysiwygEdit.php trunk/lib/XmlRpcServer.php trunk/lib/diff.php trunk/lib/editpage.php trunk/lib/main.php trunk/lib/plugin/CalendarList.php trunk/lib/plugin/CreatePage.php trunk/lib/plugin/CreateToc.php trunk/lib/plugin/EditMetaData.php trunk/lib/plugin/FileInfo.php trunk/lib/plugin/GoogleMaps.php trunk/lib/plugin/IncludePage.php trunk/lib/plugin/InterWikiSearch.php trunk/lib/plugin/MediawikiTable.php trunk/lib/plugin/ModeratedPage.php trunk/lib/plugin/OldStyleTable.php trunk/lib/plugin/RecentChanges.php trunk/lib/plugin/RichTable.php trunk/lib/plugin/SiteMap.php trunk/lib/plugin/SpellCheck.php trunk/lib/plugin/Template.php trunk/lib/plugin/TranslateText.php trunk/lib/plugin/UnfoldSubpages.php trunk/lib/plugin/WikiBlog.php trunk/lib/plugin/WikicreoleTable.php trunk/lib/stdlib.php trunk/lib/wikilens/PageListColumns.php trunk/lib/wikilens/Utils.php trunk/lib/ziplib.php trunk/themes/MonoBook/templates/info.tmpl trunk/themes/Portland/lib/RecentChanges.php trunk/themes/SpaceWiki/lib/RecentChanges.php trunk/themes/Wordpress/lib/RecentChanges.php trunk/themes/default/templates/info.tmpl trunk/themes/default/templates/login.tmpl trunk/themes/default/templates/userprefs.tmpl Added Paths: ----------- trunk/lib/plugin/DebugAuthInfo.php trunk/lib/plugin/DebugBackendInfo.php trunk/lib/plugin/DebugGroupInfo.php trunk/lib/plugin/DebugRetransform.php trunk/lib/plugin/PreferencesInfo.php Removed Paths: ------------- trunk/lib/plugin/WikiAdminMarkup.php trunk/lib/plugin/_AuthInfo.php trunk/lib/plugin/_BackendInfo.php trunk/lib/plugin/_GroupInfo.php trunk/lib/plugin/_PreferencesInfo.php trunk/lib/plugin/_Retransform.php trunk/lib/plugin/_WikiTranslation.php Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/BlockParser.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -1401,17 +1401,12 @@ /** * Transform the text of a page, and return a parse tree. */ -function TransformTextPre($text, $markup = 2.0, $basepage = false) +function TransformTextPre($text, $basepage = false) { if (isa($text, 'WikiDB_PageRevision')) { $rev = $text; $text = $rev->getPackedContent(); - $markup = $rev->get('markup'); } - // NEW: default markup is new, to increase stability - if (!empty($markup) && $markup < 2.0) { - $text = ConvertOldMarkup($text); - } // Expand leading tabs. $text = expand_tabs($text); $output = new WikiText($text); @@ -1423,9 +1418,9 @@ * Transform the text of a page, and return an XmlContent, * suitable for printXml()-ing. */ -function TransformText($text, $markup = 2.0, $basepage = false) +function TransformText($text, $basepage = false) { - $output = TransformTextPre($text, $markup, $basepage); + $output = TransformTextPre($text, $basepage); if ($basepage) { // This is for immediate consumption. // We must bind the contents to a base pagename so that Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/CachedMarkup.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -87,7 +87,7 @@ } if (preg_match("/^\w+$/", $packed)) return $packed; - // happened with _BackendInfo problem also. + // happened with DebugBackendInfo problem also. trigger_error("Can't unpack bad cached markup. Probably php_zlib extension not loaded.", E_USER_WARNING); return false; Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/IniConfig.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -704,14 +704,14 @@ // The FUSIONFORGE theme omits them if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { $AllAllowedPlugins[] = 'AnalyseAccessLogSql'; - $AllAllowedPlugins[] = '_AuthInfo'; - $AllAllowedPlugins[] = '_BackendInfo'; + $AllAllowedPlugins[] = 'DebugAuthInfo'; + $AllAllowedPlugins[] = 'DebugBackendInfo'; $AllAllowedPlugins[] = 'CacheTest'; $AllAllowedPlugins[] = 'CategoryPage'; $AllAllowedPlugins[] = 'FoafViewer'; $AllAllowedPlugins[] = 'FrameInclude'; $AllAllowedPlugins[] = 'GraphViz'; - $AllAllowedPlugins[] = '_GroupInfo'; + $AllAllowedPlugins[] = 'DebugGroupInfo'; $AllAllowedPlugins[] = 'HtmlConverter'; $AllAllowedPlugins[] = 'Imdb'; $AllAllowedPlugins[] = 'JabberPresence'; @@ -720,7 +720,7 @@ $AllAllowedPlugins[] = 'Ploticus'; $AllAllowedPlugins[] = 'PopularNearby'; $AllAllowedPlugins[] = 'PreferenceApp'; - $AllAllowedPlugins[] = '_PreferencesInfo'; + $AllAllowedPlugins[] = 'PreferencesInfo'; $AllAllowedPlugins[] = '_Retransform'; $AllAllowedPlugins[] = 'SqlResult'; $AllAllowedPlugins[] = 'TeX2png'; @@ -728,13 +728,12 @@ $AllAllowedPlugins[] = 'TexToPng'; $AllAllowedPlugins[] = 'VisualWiki'; $AllAllowedPlugins[] = 'WantedPagesOld'; - $AllAllowedPlugins[] = 'WikiAdminMarkup'; $AllAllowedPlugins[] = 'WikiForum'; - $AllAllowedPlugins[] = '_WikiTranslation'; + $AllAllowedPlugins[] = 'WikiTranslation'; } // Used by SetupWiki to pull in required pages, if not translated, then in English. - // Also used by _WikiTranslation. Really important are only those which return pagelists + // Also used by WikiTranslation. Really important are only those which return pagelists // or contain basic functionality. $AllActionPages = $ActionPages; $AllActionPages[] = 'AllPagesCreatedByMe'; @@ -764,11 +763,6 @@ $AllActionPages[] = 'SetGlobalAccessRightsSimple'; $AllActionPages[] = 'UserContribs'; - // The FUSIONFORGE theme omits them - if (!(defined('FUSIONFORGE') and FUSIONFORGE)) { - $AllActionPages[] = 'PhpWikiAdministration/Markup'; - } - if ((defined('FUSIONFORGE') and FUSIONFORGE)) { if (ENABLE_EXTERNAL_PAGES) { $AllAllowedPlugins[] = 'WikiAdminSetExternal'; Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/InlineParser.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /** - * This is the code which deals with the inline part of the (new-style) + * This is the code which deals with the inline part of the * wiki-markup. * * @package Markup @@ -1435,7 +1435,7 @@ } } -function TransformInline($text, $markup = 2.0, $basepage = false) +function TransformInline($text, $basepage = false) { static $trfm; $action = $GLOBALS['request']->getArg('action'); @@ -1443,17 +1443,13 @@ $trfm = new InlineTransformer; } - if ($markup < 2.0) { - $text = ConvertOldMarkup($text, 'inline'); - } - if ($basepage) { return new CacheableMarkup($trfm->parse($text), $basepage); } return $trfm->parse($text); } -function TransformLinks($text, $markup = 2.0, $basepage = false) +function TransformLinks($text, $basepage = false) { static $trfm; @@ -1461,10 +1457,6 @@ $trfm = new LinkTransformer; } - if ($markup < 2.0) { - $text = ConvertOldMarkup($text, 'links'); - } - if ($basepage) { return new CacheableMarkup($trfm->parse($text), $basepage); } @@ -1474,7 +1466,7 @@ /** * Transform only html markup and entities. */ -function TransformInlineNowiki($text, $markup = 2.0, $basepage = false) +function TransformInlineNowiki($text, $basepage = false) { static $trfm; Modified: trunk/lib/PageList.php =================================================================== --- trunk/lib/PageList.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/PageList.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -436,7 +436,7 @@ } include_once 'lib/BlockParser.php'; // false --> don't bother processing hrefs for embedded WikiLinks - $ct = TransformText($c, $revision_handle->get('markup'), false); + $ct = TransformText($c, false); if (empty($pagelist->_sortby[$this->_field])) unset($revision_handle->_data['%pagedata']['_cached_html']); return HTML::div(array('style' => 'font-size:x-small'), @@ -752,7 +752,6 @@ 'hits' => null, 'size' => null, 'version' => null, - 'markup' => null, 'external' => null, ); } @@ -1279,8 +1278,6 @@ 'minor' => new _PageList_Column_bool('rev:is_minor_edit', _("Minor Edit"), _("minor")), - 'markup' - => new _PageList_Column('rev:markup', _("Markup")), // 'rating' initialised by the wikilens theme hook: addPageListColumn /* 'rating' Modified: trunk/lib/PageType.php =================================================================== --- trunk/lib/PageType.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/PageType.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -365,18 +365,12 @@ { $this->_page = $page; $this->_meta = $meta; - if (!empty($meta['markup'])) - $this->_markup = $meta['markup']; - else - $this->_markup = 2; // dump used old-markup as empty. - // FIXME: To be able to restore old plain-backups we should keep markup 1 as default. - // New policy: default = new markup (old crashes quite often) } function _transform($text) { include_once 'lib/BlockParser.php'; - return TransformText($text, $this->_markup); + return TransformText($text); } /** Transform the page text. @@ -535,7 +529,7 @@ function _transform($text) { include_once 'lib/BlockParser.php'; - return TransformText($text, $this->_markup); + return TransformText($text); } // one page or set of pages? Modified: trunk/lib/WysiwygEdit/Wikiwyg.php =================================================================== --- trunk/lib/WysiwygEdit/Wikiwyg.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/WysiwygEdit/Wikiwyg.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -156,7 +156,7 @@ function convert() { require_once 'lib/BlockParser.php'; - $xmlcontent = TransformText($this->_wikitext, 2.0, $this->_request->getArg('pagename')); + $xmlcontent = TransformText($this->_wikitext, $this->_request->getArg('pagename')); $this->_html = $xmlcontent->AsXML(); $this->replace_inside_html(); @@ -298,7 +298,7 @@ $plugin = "<?plugin RichTable " . $plugin . " ?>"; require_once 'lib/BlockParser.php'; - $xmlcontent = TransformText($plugin, 2.0, $GLOBALS['request']->getArg('pagename')); + $xmlcontent = TransformText($plugin, $GLOBALS['request']->getArg('pagename')); return $xmlcontent->AsXML(); } } Modified: trunk/lib/WysiwygEdit.php =================================================================== --- trunk/lib/WysiwygEdit.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/WysiwygEdit.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -50,7 +50,7 @@ function ConvertBefore($text) { require_once 'lib/BlockParser.php'; - $xml = TransformText($text, 2.0, $GLOBALS['request']->getArg('pagename')); + $xml = TransformText($text, $GLOBALS['request']->getArg('pagename')); return $xml->AsXML(); } Modified: trunk/lib/XmlRpcServer.php =================================================================== --- trunk/lib/XmlRpcServer.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/XmlRpcServer.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -501,7 +501,6 @@ ); $version_meta = array('author' => $userid, 'author_id' => $userid, - 'markup' => 2.0, 'summary' => isset($summary) ? $summary : _("xml-rpc change"), 'mtime' => $now, 'pagetype' => 'wikitext', Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/diff.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -353,7 +353,7 @@ $html->pushContent(HTML::hr(), HTML::h2($new_version)); require_once 'lib/BlockParser.php'; - $html->pushContent(TransformText($new, $new->get('markup'), $pagename)); + $html->pushContent(TransformText($new, $pagename)); } require_once 'lib/Template.php'; Modified: trunk/lib/editpage.php =================================================================== --- trunk/lib/editpage.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/editpage.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -390,10 +390,6 @@ function isUnchanged() { $current = &$this->current; - - if ($this->meta['markup'] != $current->get('markup')) - return false; - return $this->_content == $current->getPackedContent(); } @@ -511,8 +507,6 @@ { require_once 'lib/PageType.php'; $this->_content = $this->getContent(); - $this->meta['markup'] = 2.0; - $this->_content = ConvertOldMarkup($this->_content); return new TransformedText($this->page, $this->_content, $this->meta); } @@ -664,15 +658,6 @@ 'name' => 'edit[minor_edit]', 'id' => 'edit-minor_edit', 'checked' => (bool)$this->meta['is_minor_edit'])); - $el['OLD_MARKUP_CB'] - = HTML::input(array('type' => 'checkbox', - 'name' => 'edit[markup]', - 'value' => 'old', - 'checked' => $this->meta['markup'] < 2.0, - 'id' => 'useOldMarkup', - 'onclick' => 'showOldMarkupRules(this.checked)')); - $el['OLD_MARKUP_CONVERT'] = ($this->meta['markup'] < 2.0) - ? Button('submit:edit[edit_convert]', _("Convert"), 'wikiaction') : ''; $el['LOCKED_CB'] = HTML::input(array('type' => 'checkbox', 'name' => 'edit[locked]', @@ -779,8 +764,6 @@ if ($this->_currentVersion > $this->current->getVersion()) return false; // FIXME: some kind of warning? - $is_old_markup = !empty($posted['markup']) && $posted['markup'] == 'old'; - $meta['markup'] = $is_old_markup ? false : 2.0; $meta['summary'] = trim(substr($posted['summary'], 0, 256)); $meta['is_minor_edit'] = !empty($posted['minor_edit']); $meta['pagetype'] = !empty($posted['pagetype']) ? $posted['pagetype'] : false; @@ -827,13 +810,6 @@ && $current->get('author') == $user->getId() ); - // Default for new pages is new-style markup. - if ($selected->hasDefaultContents()) - $is_new_markup = true; - else - $is_new_markup = $selected->get('markup') >= 2.0; - - $this->meta['markup'] = $is_new_markup ? 2.0 : false; $this->meta['pagetype'] = $selected->get('pagetype'); if ($this->meta['pagetype'] == 'wikiblog') $this->meta['summary'] = $selected->get('summary'); // keep blog title Modified: trunk/lib/main.php =================================================================== --- trunk/lib/main.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/main.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -966,8 +966,8 @@ // Handle untranslated actionpages in non-english // (people playing with switching languages) if (0 and $GLOBALS['LANG'] != 'en') { - require_once 'lib/plugin/_WikiTranslation.php'; - $trans = new WikiPlugin__WikiTranslation(); + require_once 'lib/plugin/WikiTranslation.php'; + $trans = new WikiPlugin_WikiTranslation(); $en_action = $trans->translate($action, 'en', $GLOBALS['LANG']); if (isActionPage($en_action)) return $en_action; @@ -1063,8 +1063,8 @@ global $LANG; if ($LANG != "en") { require_once 'lib/WikiPlugin.php'; - require_once 'lib/plugin/_WikiTranslation.php'; - $trans = new WikiPlugin__WikiTranslation(); + require_once 'lib/plugin/WikiTranslation.php'; + $trans = new WikiPlugin_WikiTranslation(); $trans->lang = $LANG; $default = $trans->translate_to_en($action, $LANG); if ($default and isActionPage($default)) Modified: trunk/lib/plugin/CalendarList.php =================================================================== --- trunk/lib/plugin/CalendarList.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/CalendarList.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -128,7 +128,7 @@ $r = $p->getCurrentRevision(); $c = $r->getContent(); include_once 'lib/BlockParser.php'; - $content = TransformText(implode("\n", $c), $r->get('markup')); + $content = TransformText(implode("\n", $c)); $link = HTML::a(array('class' => 'cal-hide', 'href' => WikiURL($page_for_date, array('action' => 'edit')), Modified: trunk/lib/plugin/CreatePage.php =================================================================== --- trunk/lib/plugin/CreatePage.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/CreatePage.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -115,13 +115,11 @@ return $this->error(fmt("%s already exists", WikiLink($s))); } else { $user = $request->getUser(); - $meta = array('markup' => 2.0, - 'author' => $user->getId()); + $meta = array('author' => $user->getId()); if (!empty($param['template']) and !$initial_content) { $tmplpage = $dbi->getPage($template); $currenttmpl = $tmplpage->getCurrentRevision(); $initial_content = $currenttmpl->getPackedContent(); - $meta['markup'] = $currenttmpl->_data['markup']; if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) { $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "", Modified: trunk/lib/plugin/CreateToc.php =================================================================== --- trunk/lib/plugin/CreateToc.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/CreateToc.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -29,7 +29,6 @@ * @author: Reini Urban, Marc-Etienne Vargenau * * Known problems: - * - it will crash with old markup and Apache2 (?) * - Certain corner-edges will not work with TOC_FULL_SYNTAX. * I believe I fixed all of them now, but who knows? * - bug #969495 "existing labels not honored" seems to be fixed. @@ -430,13 +429,6 @@ } $current = $page->getCurrentRevision(); - //FIXME: I suspect this only to crash with Apache2 - if (!$current->get('markup') or $current->get('markup') < 2) { - if (in_array(php_sapi_name(), array('apache2handler', 'apache2filter'))) { - return $this->error(_("CreateToc disabled for old markup.")); - } - } - $content = $r->getContent(); $html = HTML::div(array('class' => 'toc', 'id' => GenerateId("toc"))); Copied: trunk/lib/plugin/DebugAuthInfo.php (from rev 8810, trunk/lib/plugin/_AuthInfo.php) =================================================================== --- trunk/lib/plugin/DebugAuthInfo.php (rev 0) +++ trunk/lib/plugin/DebugAuthInfo.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -0,0 +1,205 @@ +<?php + +/** + * Copyright 2004 $ThePhpWikiProgrammingTeam + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +require_once 'lib/Template.php'; +/** + * Used to debug auth problems and settings. + * This plugin is only testing purposes. + * if DEBUG is false, only admin can call it, which is of no real use. + * + * Warning! This may display db and user passwords in cleartext. + */ +class WikiPlugin_DebugAuthInfo + extends WikiPlugin +{ + function getDescription() + { + return _("Display general and user specific auth information."); + } + + function getDefaultArguments() + { + return array('userid' => ''); + } + + function run($dbi, $argstr, &$request, $basepage) + { + $args = $this->getArgs($argstr, $request); + extract($args); + if (empty($userid) or $userid == $request->_user->UserName()) { + $user = $request->_user; + $userid = $user->UserName(); + } else { + $user = WikiUser($userid); + } + if (!$user->isAdmin() and !(DEBUG && _DEBUG_LOGIN)) { + $request->_notAuthorized(WIKIAUTH_ADMIN); + $this->disabled("! user->isAdmin"); + } + + $html = HTML(HTML::h3(fmt("General Auth Settings"))); + $table = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0)); + $table->pushContent($this->show_hash("AUTH DEFINES", + $this->buildConstHash( + array("ENABLE_USER_NEW", "ALLOW_ANON_USER", + "ALLOW_ANON_EDIT", "ALLOW_BOGO_LOGIN", + "REQUIRE_SIGNIN_BEFORE_EDIT", "ALLOW_USER_PASSWORDS", + "PASSWORD_LENGTH_MINIMUM", "USE_DB_SESSION")))); + if ((defined('ALLOW_LDAP_LOGIN') && ALLOW_LDAP_LOGIN) or in_array("LDAP", $GLOBALS['USER_AUTH_ORDER'])) + $table->pushContent($this->show_hash("LDAP DEFINES", + $this->buildConstHash(array("LDAP_AUTH_HOST", "LDAP_BASE_DN")))); + if ((defined('ALLOW_IMAP_LOGIN') && ALLOW_IMAP_LOGIN) or in_array("IMAP", $GLOBALS['USER_AUTH_ORDER'])) + $table->pushContent($this->show_hash("IMAP DEFINES", array("IMAP_AUTH_HOST" => IMAP_AUTH_HOST))); + if (defined('AUTH_USER_FILE') or in_array("File", $GLOBALS['USER_AUTH_ORDER'])) + $table->pushContent($this->show_hash("AUTH_USER_FILE", + $this->buildConstHash(array("AUTH_USER_FILE", + "AUTH_USER_FILE_STORABLE")))); + if (defined('GROUP_METHOD')) + $table->pushContent($this->show_hash("GROUP_METHOD", + $this->buildConstHash(array("GROUP_METHOD", "AUTH_GROUP_FILE", "GROUP_LDAP_QUERY")))); + $table->pushContent($this->show_hash("\$USER_AUTH_ORDER[]", $GLOBALS['USER_AUTH_ORDER'])); + $table->pushContent($this->show_hash("USER_AUTH_POLICY", array("USER_AUTH_POLICY" => USER_AUTH_POLICY))); + $DBParams = $GLOBALS['DBParams']; + $DBParams['dsn'] = class_exists('WikiDB_SQL') ? WikiDB_SQL::view_dsn($DBParams['dsn']) : ''; + $table->pushContent($this->show_hash("\$DBParams[]", $DBParams)); + $DBAuthParams = $GLOBALS['DBAuthParams']; + if (isset($DBAuthParams['auth_dsn']) and class_exists('WikiDB_SQL')) + $DBAuthParams['auth_dsn'] = WikiDB_SQL::view_dsn($DBAuthParams['auth_dsn']); + else + $DBAuthParams['auth_dsn'] = ''; + unset($DBAuthParams['dummy']); + $table->pushContent($this->show_hash("\$DBAuthParams[]", $DBAuthParams)); + $html->pushContent($table); + $html->pushContent(HTML(HTML::h3(fmt("Personal Auth Settings for “%s”", $userid)))); + if (!$user) { + $html->pushContent(HTML::p(fmt("No userid"))); + } else { + $table = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0)); + //$table->pushContent(HTML::tr(HTML::td(array('colspan' => 2)))); + $userdata = obj2hash($user, array('_dbi', '_request', 'password', 'passwd')); + if (isa($user, "_FilePassUser")) { + foreach ($userdata['_file']->users as $u => $p) { + $userdata['_file']->users[$u] = "<hidden>"; + } + } + $table->pushContent($this->show_hash("User: Object of " . get_class($user), $userdata)); + if (ENABLE_USER_NEW) { + $group = &$request->getGroup(); + $groups = $group->getAllGroupsIn(); + $groupdata = obj2hash($group, array('_dbi', '_request', 'password', 'passwd')); + unset($groupdata['request']); + $table->pushContent($this->show_hash("Group: Object of " . get_class($group), $groupdata)); + $groups = $group->getAllGroupsIn(); + $groupdata = array('getAllGroupsIn' => $groups); + foreach ($groups as $g) { + $groupdata["getMembersOf($g)"] = $group->getMembersOf($g); + $groupdata["isMember($g)"] = $group->isMember($g); + } + $table->pushContent($this->show_hash("Group Methods: ", $groupdata)); + } + $html->pushContent($table); + } + return $html; + } + + private function show_hash($heading, $hash, $depth = 0) + { + static $seen = array(); + static $max_depth = 0; + $rows = array(); + $max_depth++; + if ($max_depth > 35) return $heading; + + if ($heading) + $rows[] = HTML::tr(array('bgcolor' => '#ffcccc', + 'style' => 'color:#000000'), + HTML::td(array('colspan' => 2, + 'style' => 'color:#000000'), + $heading)); + if (is_object($hash)) + $hash = obj2hash($hash); + if (!empty($hash)) { + ksort($hash); + foreach ($hash as $key => $val) { + if (is_object($val)) { + $heading = "Object of " . get_class($val); + if ($depth > 3) $val = $heading; + elseif ($heading == "Object of wikidb_sql") $val = $heading; elseif (substr($heading, 0, 13) == "Object of db_") $val = $heading; elseif (!isset($seen[$heading])) { + //if (empty($seen[$heading])) $seen[$heading] = 1; + $val = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0), + $this->show_hash($heading, obj2hash($val), $depth + 1)); + } else { + $val = $heading; + } + } elseif (is_array($val)) { + $heading = $key . "[]"; + if ($depth > 3) $val = $heading; + elseif (!isset($seen[$heading])) { + //if (empty($seen[$heading])) $seen[$heading] = 1; + $val = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0), + $this->show_hash($heading, $val, $depth + 1)); + } else { + $val = $heading; + } + } + $rows[] = HTML::tr(HTML::td(array('align' => 'right', + 'bgcolor' => '#cccccc', + 'style' => 'color:#000000'), + HTML(HTML::raw(' '), $key, + HTML::raw(' '))), + HTML::td(array('bgcolor' => '#ffffff', + 'style' => 'color:#000000'), + $val ? $val : HTML::raw(' ')) + ); + //if (empty($seen[$key])) $seen[$key] = 1; + } + } + return $rows; + } + + private function buildConstHash($constants) + { + $hash = array(); + foreach ($constants as $c) { + $hash[$c] = defined($c) ? constant($c) : '<empty>'; + if ($hash[$c] === false) $hash[$c] = 'false'; + elseif ($hash[$c] === true) $hash[$c] = 'true'; + } + return $hash; + } +} + +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: Copied: trunk/lib/plugin/DebugBackendInfo.php (from rev 8810, trunk/lib/plugin/_BackendInfo.php) =================================================================== --- trunk/lib/plugin/DebugBackendInfo.php (rev 0) +++ trunk/lib/plugin/DebugBackendInfo.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -0,0 +1,205 @@ +<?php + +/** + * Copyright 1999,2000,2001,2002,2006,2007 $ThePhpWikiProgrammingTeam + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +require_once 'lib/Template.php'; +/** + */ +class WikiPlugin_DebugBackendInfo + extends WikiPlugin +{ + function getDescription() + { + return sprintf(_("Get debugging information for %s."), '[pagename]'); + } + + function getDefaultArguments() + { + return array('page' => '[pagename]', + 'notallversions' => 0); + } + + function run($dbi, $argstr, &$request, $basepage) + { + $args = $this->getArgs($argstr, $request); + extract($args); + if (empty($page)) + return $this->error("page missing"); + + $backend = &$dbi->_backend; + $this->chunk_split = true; + $this->readonly_pagemeta = array(); + $this->hidden_pagemeta = array('_cached_html'); + + $html = HTML(HTML::h3(fmt("Querying backend directly for “%s”", + $page))); + + $table = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0)); + $pagedata = $backend->get_pagedata($page); + if (!$pagedata) { + // FIXME: invalid HTML + $html->pushContent(HTML::p(fmt("No pagedata for %s", $page))); + } else { + $this->_fixupData($pagedata); + $table->pushContent($this->_showhash("get_pagedata('$page')", $pagedata)); + } + if (!$notallversions) { + $version = $backend->get_latest_version($page); + $vdata = $backend->get_versiondata($page, $version, true); + $this->_fixupData($vdata); + $table->pushContent(HTML::tr(HTML::td(array('colspan' => 2)))); + $table->pushContent($this->_showhash("get_versiondata('$page',$version)", + $vdata)); + } else { + for ($version = $backend->get_latest_version($page); + $version; + $version = $backend->get_previous_version($page, $version)) { + $vdata = $backend->get_versiondata($page, $version, true); + $this->_fixupData($vdata); + $table->pushContent(HTML::tr(HTML::td(array('colspan' => 2)))); + $table->pushContent($this->_showhash("get_versiondata('$page',$version)", + $vdata)); + } + } + + $linkdata = $backend->get_links($page, false); + if ($linkdata->count()) + $table->pushContent($this->_showhash("get_links('$page')", $linkdata->asArray())); + $relations = $backend->get_links($page, false, false, false, false, false, true); + if ($relations->count()) { + $table->pushContent($this->_showhash("get_relations('$page')", array())); + while ($rel = $relations->next()) + $table->pushContent($this->_showhash(false, $rel)); + } + $linkdata = $backend->get_links($page, true); + if ($linkdata->count()) + $table->pushContent($this->_showhash("get_backlinks('$page')", $linkdata->asArray())); + + $html->pushContent($table); + return $html; + } + + /** + * Really should have a _fixupPagedata and _fixupVersiondata, but this works. + * also used in plugin/EditMetaData + */ + private function _fixupData(&$data, $prefix = '') + { + if (!is_array($data)) return; + + global $request; + $user = $request->getUser(); + foreach ($data as $key => $val) { + $fullkey = $prefix . '[' . $key . ']'; + if (is_integer($key)) { + ; + } elseif ($key == 'passwd' and !$user->isAdmin()) { + $data[$key] = $val ? _("<not displayed>") : _("<empty>"); + } elseif ($key and $key == '_cached_html') { + $val = TransformedText::unpack($val); + ob_start(); + print_r($val); + $data[$key] = HTML::pre(ob_get_contents()); + ob_end_clean(); + } elseif (is_bool($val)) { + $data[$key] = $this->_showvalue($key, $val ? "true" : "false", $prefix); + } elseif (is_string($val) && ((substr($val, 0, 2) == 'a:' + or (substr($val, 0, 2) == 'O:'))) + ) { + // how to indent this table? + $val = unserialize($val); + $this->_fixupData($val, $fullkey); + $data[$key] = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0), + $this->_showhash(false, $val, $fullkey)); + } elseif (is_array($val)) { + // how to indent this table? + $this->_fixupData($val, $fullkey); + $data[$key] = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0), + $this->_showhash(false, $val, $fullkey)); + } elseif (is_object($val)) { + // how to indent this table? + ob_start(); + print_r($val); + $val = HTML::pre(ob_get_contents()); + ob_end_clean(); + $data[$key] = HTML::table(array('border' => 1, + 'cellpadding' => 2, + 'cellspacing' => 0), + $this->_showhash(false, $val, $fullkey)); + } elseif ($key and $key == '%content') { + if ($val === true) + $val = '<true>'; + elseif (strlen($val) > 40) + $val = substr($val, 0, 40) . " ..."; + $data[$key] = $val; + } + } + unset($data['%pagedata']); // problem in backend + } + + /* also used in plugin/EditMetaData */ + private function _showhash($heading, $hash, $prefix = '') + { + $rows = array(); + if ($heading) + $rows[] = HTML::tr(array('bgcolor' => '#ffcccc', + 'style' => 'color:#000000'), + HTML::td(array('colspan' => 2, + 'style' => 'color:#000000'), + $heading)); + if (!is_array($hash)) return array(); + ksort($hash); + foreach ($hash as $key => $val) { + if ($this->chunk_split and is_string($val)) $val = chunk_split($val); + $rows[] = HTML::tr(HTML::td(array('align' => 'right', + 'bgcolor' => '#cccccc', + 'style' => 'color:#000000'), + HTML(HTML::raw(' '), $key, + HTML::raw(' '))), + HTML::td(array('bgcolor' => '#ffffff', + 'style' => 'color:#000000'), + $this->_showvalue($key, $val, $prefix)) + ); + } + return $rows; + } + + /* also used in plugin/EditMetaData */ + private function _showvalue($key, $val, $prefix = '') + { + return $val ? $val : HTML::raw(' '); + } + +} + +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: Copied: trunk/lib/plugin/DebugGroupInfo.php (from rev 8810, trunk/lib/plugin/_GroupInfo.php) =================================================================== --- trunk/lib/plugin/DebugGroupInfo.php (rev 0) +++ trunk/lib/plugin/DebugGroupInfo.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -0,0 +1,63 @@ +<?php + +/* + * Copyright 2004 $ThePhpWikiProgrammingTeam + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * @author: Charles Corrigan + */ +class WikiPlugin_DebugGroupInfo + extends WikiPlugin +{ + function getDescription() + { + return sprintf(_("Show Group Information.")); + } + + function getDefaultArguments() + { + return array(); + } + + function run($dbi, $argstr, &$request, $basepage) + { + $args = $this->getArgs($argstr, $request); + extract($args); + + $output = HTML(HTML::h1("Group Info")); + + $group = WikiGroup::getGroup(); + $allGroups = $group->getAllGroupsIn(); + + foreach ($allGroups as $g) { + $members = $group->getMembersOf($g); + $output->pushContent(HTML::h3($g . " - members: " . + sizeof($members) . " - isMember: " . ($group->isMember($g) ? "yes" : "no") + )); + foreach ($members as $m) { + $output->pushContent($m); + $output->pushContent(HTML::br()); + } + } + $output->pushContent(HTML::p("--- the end ---")); + + return $output; + } +} Copied: trunk/lib/plugin/DebugRetransform.php (from rev 8810, trunk/lib/plugin/_Retransform.php) =================================================================== --- trunk/lib/plugin/DebugRetransform.php (rev 0) +++ trunk/lib/plugin/DebugRetransform.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -0,0 +1,86 @@ +<?php + +/** + * Copyright 2007 $ThePhpWikiProgrammingTeam + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * Only useful for link and parser debugging purposes. + */ +class WikiPlugin__Retransform + extends WikiPlugin +{ + function getDescription() + { + return sprintf(_("Show a markup retransformation of page %s."), '[pagename]'); + } + + function getDefaultArguments() + { + return array('page' => '[pagename]'); + } + + function run($dbi, $argstr, &$request, $basepage) + { + $args = $this->getArgs($argstr, $request); + extract($args); + if (empty($page)) + return ''; + + $html = HTML(HTML::h3(fmt("Retransform page “%s”", $page))); + + // bypass WikiDB and cache, go directly through the backend. + $backend = &$dbi->_backend; + //$pagedata = $backend->get_pagedata($page); + $version = $backend->get_latest_version($page); + $vdata = $backend->get_versiondata($page, $version, true); + + include_once 'lib/PageType.php'; + $formatted = new TransformedText($dbi->getPage($page), $vdata['%content'], $vdata); + $content =& $formatted->_content; + $html->pushContent($this->DebugPrintArray($content)); + $links = $formatted->getWikiPageLinks(); + if (count($links) > 0) { + $html->pushContent(HTML::h3("Links")); + $html->pushContent($this->DebugPrintArray($links)); + } + return $html; + } + + private function DebugPrintArray(&$array) + { + $html = HTML(); + foreach ($array as $line) { + ob_start(); + print_r($line); + $s = HTML::pre(ob_get_contents()); + ob_end_clean(); + $html->pushContent($s); + } + return $html; + } +} + +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: Modified: trunk/lib/plugin/EditMetaData.php =================================================================== --- trunk/lib/plugin/EditMetaData.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/EditMetaData.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -39,10 +39,10 @@ * Rewritten for recursive array support by Reini Urban. */ -require_once 'lib/plugin/_BackendInfo.php'; +require_once 'lib/plugin/DebugBackendInfo.php'; class WikiPlugin_EditMetaData - extends WikiPlugin__BackendInfo + extends WikiPlugin_DebugBackendInfo { function getDescription() { Modified: trunk/lib/plugin/FileInfo.php =================================================================== --- trunk/lib/plugin/FileInfo.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/FileInfo.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -167,7 +167,7 @@ $result = call_user_func_array("sprintf", $s); if (in_array('link', $modes)) { require_once 'lib/InlineParser.php'; - return TransformInline($result, 2, $basepage); + return TransformInline($result, $basepage); } else { return HTML::raw($result); } Modified: trunk/lib/plugin/GoogleMaps.php =================================================================== --- trunk/lib/plugin/GoogleMaps.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/GoogleMaps.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -117,8 +117,7 @@ include_once 'lib/BlockParser.php'; $page = $dbi->getPage($request->getArg('pagename')); $rev = $page->getCurrentRevision(false); - $markup = $rev->get('markup'); - $markertext = TransformText($InfoText, $markup, $basepage); + $markertext = TransformText($InfoText, $basepage); } $markerjs = JavaScript(" function createMarker(point, text) { Modified: trunk/lib/plugin/IncludePage.php =================================================================== --- trunk/lib/plugin/IncludePage.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/IncludePage.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -154,7 +154,7 @@ array_push($included_pages, $page); include_once 'lib/BlockParser.php'; - $content = TransformText($ct, $r->get('markup'), $page); + $content = TransformText($ct, $page); array_pop($included_pages); Modified: trunk/lib/plugin/InterWikiSearch.php =================================================================== --- trunk/lib/plugin/InterWikiSearch.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/InterWikiSearch.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -48,12 +48,11 @@ return $this->disabled("Sorry, this plugin is currently out of order."); $page = $dbi->getPage($request->getArg('pagename')); - return new TransformedText($page, __('InterWikiMap'), array('markup' => 2), + return new TransformedText($page, __('InterWikiMap'), array(), 'searchableInterWikiMap'); /* return new PageType($pagerevisionhandle, $pagename = __('InterWikiMap'), - $markup = 2, $overridePageType = 'PageType_searchableInterWikiMap'); */ } Modified: trunk/lib/plugin/MediawikiTable.php =================================================================== --- trunk/lib/plugin/MediawikiTable.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/MediawikiTable.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -65,8 +65,6 @@ function run($dbi, $argstr, &$request, $basepage) { include_once 'lib/BlockParser.php'; - // MediawikiTablePlugin markup is new. - $markup = 2.0; // We allow the compact Mediawiki syntax with: // - multiple cells on the same line (separated by "||"), @@ -127,7 +125,7 @@ if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { - $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + $cell->pushContent(TransformText(trim($content), $basepage)); } unset($content); } @@ -188,7 +186,7 @@ if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { - $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + $cell->pushContent(TransformText(trim($content), $basepage)); } unset($content); } @@ -237,7 +235,7 @@ if (is_numeric(trim($line))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($line))); } else { - $cell->pushContent(TransformText(trim($line), $markup, $basepage)); + $cell->pushContent(TransformText(trim($line), $basepage)); } continue; } @@ -255,7 +253,7 @@ if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { - $cell->pushContent(TransformText(trim($content), $markup, $basepage)); + $cell->pushContent(TransformText(trim($content), $basepage)); } } Modified: trunk/lib/plugin/ModeratedPage.php =================================================================== --- trunk/lib/plugin/ModeratedPage.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/ModeratedPage.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -373,7 +373,7 @@ $header = HTML::h3(_("Please approve or reject this request:")); $loader = new WikiPluginLoader(); - $BackendInfo = $loader->getPlugin("_BackendInfo"); + $BackendInfo = $loader->getPlugin("DebugBackendInfo"); $table = HTML::table(array('border' => 1, 'cellpadding' => 2, 'cellspacing' => 0)); Modified: trunk/lib/plugin/OldStyleTable.php =================================================================== --- trunk/lib/plugin/OldStyleTable.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/OldStyleTable.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -138,8 +138,7 @@ else $attr['align'] = 'left'; - // Assume new-style inline markup. - $content = TransformInline($m[4], 2.0, $basepage); + $content = TransformInline($m[4], $basepage); $row->pushContent(HTML::td($attr, HTML::raw(' '), $content, HTML::raw(' '))); Copied: trunk/lib/plugin/PreferencesInfo.php (from rev 8810, trunk/lib/plugin/_PreferencesInfo.php) =================================================================== --- trunk/lib/plugin/PreferencesInfo.php (rev 0) +++ trunk/lib/plugin/PreferencesInfo.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -0,0 +1,55 @@ +<?php + +/** + * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with PhpWiki; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * Plugin to display the current preferences without auth check. + */ +class WikiPlugin_PreferencesInfo + extends WikiPlugin +{ + function getDescription() + { + return sprintf(_("Get preferences information for current user %s."), + '[userid]'); + } + + function getDefaultArguments() + { + return array('page' => '[pagename]', + 'userid' => '[userid]'); + } + + function run($dbi, $argstr, &$request, $basepage) + { + $args = $this->getArgs($argstr, $request); + // $user = &$request->getUser(); + return Template('userprefs', $args); + } +} + +// Local Variables: +// mode: php +// tab-width: 8 +// c-basic-offset: 4 +// c-hanging-comment-ender-p: nil +// indent-tabs-mode: nil +// End: Modified: trunk/lib/plugin/RecentChanges.php =================================================================== --- trunk/lib/plugin/RecentChanges.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/RecentChanges.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -248,7 +248,7 @@ return ''; return HTML::span(array('class' => 'wiki-summary'), "(", - // TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + // TransformLinks($summary, $rev->getPageName()), // We do parse the summary: // 1) if the summary contains {{foo}}, the template must no be // expanded @@ -721,7 +721,7 @@ return HTML::span(array('class' => 'wiki-summary'), "[", /*TransformLinks(*/ - $summary, /* $rev->get('markup')),*/ + $summary, "]"); } Modified: trunk/lib/plugin/RichTable.php =================================================================== --- trunk/lib/plugin/RichTable.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/RichTable.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -43,8 +43,6 @@ function run($dbi, $argstr, &$request, $basepage) { include_once 'lib/BlockParser.php'; - // RichTablePlugin markup is new. - $markup = 2.0; $lines = preg_split('/\n/', $argstr); $table = HTML::table(); @@ -71,7 +69,7 @@ if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { - $cell->pushContent(TransformText($content, $markup, $basepage)); + $cell->pushContent(TransformText($content, $basepage)); } unset($content); } @@ -97,7 +95,7 @@ if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { - $cell->pushContent(TransformText($content, $markup, $basepage)); + $cell->pushContent(TransformText($content, $basepage)); } unset($content); } @@ -131,7 +129,7 @@ if (is_numeric(trim($content))) { $cell->pushContent(HTML::p(array('style' => "text-align:right"), trim($content))); } else { - $cell->pushContent(TransformText($content, $markup, $basepage)); + $cell->pushContent(TransformText($content, $basepage)); } } $row->pushContent($cell); Modified: trunk/lib/plugin/SiteMap.php =================================================================== --- trunk/lib/plugin/SiteMap.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/SiteMap.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -165,7 +165,7 @@ if (!$noheader) { $out = $this->getDescription() . " " . sprintf(_("(max. recursion level: %d)"), $reclimit) . ":\n\n"; - $html->pushContent(TransformText($out, 1.0, $page)); + $html->pushContent(TransformText($out, $page)); } $pagelist = new PageList($info, $exclude); $p = $dbi->getPage($page); @@ -202,14 +202,12 @@ $plugin_args = 'page=\'' . $link->getName() . '\' ' . $includepages; $pagehtml = $plugin->run($dbi, $plugin_args, $request, $basepage); $html->pushContent($pagehtml); - //$html->pushContent( HTML(TransformText($indenter, 1.0, $page), $pagehtml)); - //$out .= $indenter . $pagehtml . "\n"; } else { $out .= $key . "\n"; } } if (empty($includepages)) { - return TransformText($out, 2.0, $page); + return TransformText($out, $page); } else { return $html; } Modified: trunk/lib/plugin/SpellCheck.php =================================================================== --- trunk/lib/plugin/SpellCheck.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/SpellCheck.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -163,7 +163,7 @@ } $GLOBALS['request']->setArg('suggestions', $sugg); include_once 'lib/BlockParser.php'; - $ori_html = TransformText($revision, $revision->get('markup'), $page); + $ori_html = TransformText($revision, $page); $GLOBALS['request']->setArg('suggestions', false); $html->pushContent($ori_html, HTML::hr(), HTML::h1(_("SpellCheck result"))); Modified: trunk/lib/plugin/Template.php =================================================================== --- trunk/lib/plugin/Template.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/Template.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -197,10 +197,10 @@ $initial_content = trim($initial_content, "\n"); if (preg_match("/\n/", $initial_content)) { include_once 'lib/BlockParser.php'; - $content = TransformText($initial_content, $r->get('markup'), $page); + $content = TransformText($initial_content, $page); } else { include_once 'lib/InlineParser.php'; - $content = TransformInline($initial_content, $r->get('markup'), $page); + $content = TransformInline($initial_content, $page); } array_pop($included_pages); Modified: trunk/lib/plugin/TranslateText.php =================================================================== --- trunk/lib/plugin/TranslateText.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/TranslateText.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -26,7 +26,7 @@ * One required argument: lang * Requires that an action page with the <<TranslateText >> line exists. * - * Usually called from <<_WikiTranslation >> + * Usually called from <<WikiTranslation >> * Contributed translation are stored in UsersPage/ContributedTranslations * * Examples: @@ -35,10 +35,10 @@ * @author: Reini Urban */ -require_once 'lib/plugin/_WikiTranslation.php'; +require_once 'lib/plugin/WikiTranslation.php'; class WikiPlugin_TranslateText - extends WikiPlugin__WikiTranslation + extends WikiPlugin_WikiTranslation { function getDescription() { @@ -60,7 +60,7 @@ if (!$lang) return $this->error( _("This internal action page cannot viewed.") . "\n" . - _("You can only use it via the _WikiTranslation plugin.")); + _("You can only use it via the WikiTranslation plugin.")); $this->lang = $lang; //action=save @@ -83,8 +83,7 @@ $meta = $current->_data; } else { $text = ''; - $meta = array('markup' => 2.0, - 'author' => $user->getId()); + $meta = array('author' => $user->getId()); } $text .= $user->getId() . " " . Iso8601DateTime() . "\n" . "* " . sprintf(_("Translate “%s” to “%s” in *%s*"), Modified: trunk/lib/plugin/UnfoldSubpages.php =================================================================== --- trunk/lib/plugin/UnfoldSubpages.php 2013-06-18 12:55:27 UTC (rev 8814) +++ trunk/lib/plugin/UnfoldSubpages.php 2013-06-18 13:39:29 UTC (rev 8815) @@ -151,11 +151,10 @@ if ($smalltitle) { $pname = array_pop(explode(SUBPAGE_SEPARATOR, $cpagename)); // get last subpage name // Use _("%s: %s") instead of .": ". for French punctuation - $ct = T... [truncated message content] |