From 0c4192f54b144ae6e3402a181c1cca83ba801875 Mon Sep 17 00:00:00 2001 From: vargenau Date: Tue, 18 Jun 2013 13:39:29 +0000 Subject: [PATCH] Merge OldTextFormattingRules into TextFormattingRules; rename underscore plugins git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@8815 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/BlockParser.php | 11 +- lib/CachedMarkup.php | 2 +- lib/IniConfig.php | 18 +- lib/InlineParser.php | 16 +- lib/PageList.php | 5 +- lib/PageType.php | 10 +- lib/WysiwygEdit.php | 2 +- lib/WysiwygEdit/Wikiwyg.php | 4 +- lib/XmlRpcServer.php | 1 - lib/diff.php | 2 +- lib/editpage.php | 24 - lib/main.php | 8 +- lib/plugin/CalendarList.php | 2 +- lib/plugin/CreatePage.php | 4 +- lib/plugin/CreateToc.php | 8 - .../{_AuthInfo.php => DebugAuthInfo.php} | 2 +- ...{_BackendInfo.php => DebugBackendInfo.php} | 2 +- .../{_GroupInfo.php => DebugGroupInfo.php} | 2 +- ...{_Retransform.php => DebugRetransform.php} | 0 lib/plugin/EditMetaData.php | 4 +- lib/plugin/FileInfo.php | 2 +- lib/plugin/GoogleMaps.php | 3 +- lib/plugin/IncludePage.php | 2 +- lib/plugin/InterWikiSearch.php | 3 +- lib/plugin/MediawikiTable.php | 10 +- lib/plugin/ModeratedPage.php | 2 +- lib/plugin/OldStyleTable.php | 3 +- ...referencesInfo.php => PreferencesInfo.php} | 2 +- lib/plugin/RecentChanges.php | 4 +- lib/plugin/RichTable.php | 8 +- lib/plugin/SiteMap.php | 6 +- lib/plugin/SpellCheck.php | 2 +- lib/plugin/Template.php | 4 +- lib/plugin/TranslateText.php | 11 +- lib/plugin/UnfoldSubpages.php | 7 +- lib/plugin/WikiAdminMarkup.php | 207 ------- lib/plugin/WikiBlog.php | 1 - lib/plugin/WikicreoleTable.php | 4 +- lib/plugin/_WikiTranslation.php | 575 ------------------ lib/stdlib.php | 207 ------- lib/wikilens/PageListColumns.php | 2 +- lib/wikilens/Utils.php | 3 +- lib/ziplib.php | 3 - themes/MonoBook/templates/info.tmpl | 8 - themes/Portland/lib/RecentChanges.php | 4 +- themes/SpaceWiki/lib/RecentChanges.php | 4 +- themes/Wordpress/lib/RecentChanges.php | 4 +- themes/default/templates/info.tmpl | 8 - themes/default/templates/login.tmpl | 2 +- themes/default/templates/userprefs.tmpl | 2 +- 50 files changed, 73 insertions(+), 1157 deletions(-) rename lib/plugin/{_AuthInfo.php => DebugAuthInfo.php} (99%) rename lib/plugin/{_BackendInfo.php => DebugBackendInfo.php} (99%) rename lib/plugin/{_GroupInfo.php => DebugGroupInfo.php} (98%) rename lib/plugin/{_Retransform.php => DebugRetransform.php} (100%) rename lib/plugin/{_PreferencesInfo.php => PreferencesInfo.php} (97%) delete mode 100644 lib/plugin/WikiAdminMarkup.php delete mode 100644 lib/plugin/_WikiTranslation.php diff --git a/lib/BlockParser.php b/lib/BlockParser.php index 6bcb0ad34..204883996 100644 --- a/lib/BlockParser.php +++ b/lib/BlockParser.php @@ -1401,16 +1401,11 @@ class Block_divspan extends BlockMarkup /** * 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); @@ -1423,9 +1418,9 @@ function TransformTextPre($text, $markup = 2.0, $basepage = false) * 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 diff --git a/lib/CachedMarkup.php b/lib/CachedMarkup.php index da285fef6..2e58aa6ae 100644 --- a/lib/CachedMarkup.php +++ b/lib/CachedMarkup.php @@ -87,7 +87,7 @@ class CacheableMarkup extends XmlContent } 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; diff --git a/lib/IniConfig.php b/lib/IniConfig.php index d1877f31b..8bfbb788e 100644 --- a/lib/IniConfig.php +++ b/lib/IniConfig.php @@ -704,14 +704,14 @@ function fixup_static_configs($file) // 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 @@ function fixup_static_configs($file) $AllAllowedPlugins[] = 'Ploticus'; $AllAllowedPlugins[] = 'PopularNearby'; $AllAllowedPlugins[] = 'PreferenceApp'; - $AllAllowedPlugins[] = '_PreferencesInfo'; + $AllAllowedPlugins[] = 'PreferencesInfo'; $AllAllowedPlugins[] = '_Retransform'; $AllAllowedPlugins[] = 'SqlResult'; $AllAllowedPlugins[] = 'TeX2png'; @@ -728,13 +728,12 @@ function fixup_static_configs($file) $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 @@ function fixup_static_configs($file) $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'; diff --git a/lib/InlineParser.php b/lib/InlineParser.php index df4f85d9f..7141318cd 100644 --- a/lib/InlineParser.php +++ b/lib/InlineParser.php @@ -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 @@ class NowikiTransformer extends InlineTransformer } } -function TransformInline($text, $markup = 2.0, $basepage = false) +function TransformInline($text, $basepage = false) { static $trfm; $action = $GLOBALS['request']->getArg('action'); @@ -1443,17 +1443,13 @@ function TransformInline($text, $markup = 2.0, $basepage = false) $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 @@ function TransformLinks($text, $markup = 2.0, $basepage = false) $trfm = new LinkTransformer; } - if ($markup < 2.0) { - $text = ConvertOldMarkup($text, 'links'); - } - if ($basepage) { return new CacheableMarkup($trfm->parse($text), $basepage); } @@ -1474,7 +1466,7 @@ function TransformLinks($text, $markup = 2.0, $basepage = false) /** * Transform only html markup and entities. */ -function TransformInlineNowiki($text, $markup = 2.0, $basepage = false) +function TransformInlineNowiki($text, $basepage = false) { static $trfm; diff --git a/lib/PageList.php b/lib/PageList.php index bc03d09ca..3f434ed98 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -436,7 +436,7 @@ class _PageList_Column_content extends _PageList_Column } 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 @@ class PageList 'hits' => null, 'size' => null, 'version' => null, - 'markup' => null, 'external' => null, ); } @@ -1279,8 +1278,6 @@ class PageList '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' diff --git a/lib/PageType.php b/lib/PageType.php index 1d18fb061..984d19c51 100644 --- a/lib/PageType.php +++ b/lib/PageType.php @@ -365,18 +365,12 @@ class PageFormatter { $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 @@ class PageFormatter_pdf extends PageFormatter function _transform($text) { include_once 'lib/BlockParser.php'; - return TransformText($text, $this->_markup); + return TransformText($text); } // one page or set of pages? diff --git a/lib/WysiwygEdit.php b/lib/WysiwygEdit.php index 8e0554b7f..dddebf86c 100644 --- a/lib/WysiwygEdit.php +++ b/lib/WysiwygEdit.php @@ -50,7 +50,7 @@ class WysiwygEdit 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(); } diff --git a/lib/WysiwygEdit/Wikiwyg.php b/lib/WysiwygEdit/Wikiwyg.php index 0e95d77c3..5ca66924e 100644 --- a/lib/WysiwygEdit/Wikiwyg.php +++ b/lib/WysiwygEdit/Wikiwyg.php @@ -156,7 +156,7 @@ class WikiToHtml 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 @@ function replace_rich_table($matched) $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(); } } diff --git a/lib/XmlRpcServer.php b/lib/XmlRpcServer.php index 3cf40a15f..029d4caae 100644 --- a/lib/XmlRpcServer.php +++ b/lib/XmlRpcServer.php @@ -501,7 +501,6 @@ function putPage($params) ); $version_meta = array('author' => $userid, 'author_id' => $userid, - 'markup' => 2.0, 'summary' => isset($summary) ? $summary : _("xml-rpc change"), 'mtime' => $now, 'pagetype' => 'wikitext', diff --git a/lib/diff.php b/lib/diff.php index ace2bb4db..17d3d0ffa 100644 --- a/lib/diff.php +++ b/lib/diff.php @@ -353,7 +353,7 @@ function showDiff(&$request) $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'; diff --git a/lib/editpage.php b/lib/editpage.php index 174922cb3..44e26ccbb 100644 --- a/lib/editpage.php +++ b/lib/editpage.php @@ -390,10 +390,6 @@ class PageEditor function isUnchanged() { $current = &$this->current; - - if ($this->meta['markup'] != $current->get('markup')) - return false; - return $this->_content == $current->getPackedContent(); } @@ -511,8 +507,6 @@ class PageEditor { 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 @@ class PageEditor '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 @@ class PageEditor 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 @@ class PageEditor && $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 diff --git a/lib/main.php b/lib/main.php index 8d81d6907..22d593f2c 100644 --- a/lib/main.php +++ b/lib/main.php @@ -966,8 +966,8 @@ class WikiRequest extends Request // 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 @@ class WikiRequest extends Request 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)) diff --git a/lib/plugin/CalendarList.php b/lib/plugin/CalendarList.php index cbd0441b8..cfaf499e3 100644 --- a/lib/plugin/CalendarList.php +++ b/lib/plugin/CalendarList.php @@ -128,7 +128,7 @@ class WikiPlugin_CalendarList $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')), diff --git a/lib/plugin/CreatePage.php b/lib/plugin/CreatePage.php index 03e18a11d..260f6731f 100644 --- a/lib/plugin/CreatePage.php +++ b/lib/plugin/CreatePage.php @@ -115,13 +115,11 @@ class WikiPlugin_CreatePage 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>/s', $initial_content)) { $initial_content = preg_replace("/.+?<\/noinclude>/s", "", diff --git a/lib/plugin/CreateToc.php b/lib/plugin/CreateToc.php index d2219d961..37684a80b 100644 --- a/lib/plugin/CreateToc.php +++ b/lib/plugin/CreateToc.php @@ -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 @@ class WikiPlugin_CreateToc } $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"))); diff --git a/lib/plugin/_AuthInfo.php b/lib/plugin/DebugAuthInfo.php similarity index 99% rename from lib/plugin/_AuthInfo.php rename to lib/plugin/DebugAuthInfo.php index 136d97632..4e68bf07c 100644 --- a/lib/plugin/_AuthInfo.php +++ b/lib/plugin/DebugAuthInfo.php @@ -28,7 +28,7 @@ require_once 'lib/Template.php'; * * Warning! This may display db and user passwords in cleartext. */ -class WikiPlugin__AuthInfo +class WikiPlugin_DebugAuthInfo extends WikiPlugin { function getDescription() diff --git a/lib/plugin/_BackendInfo.php b/lib/plugin/DebugBackendInfo.php similarity index 99% rename from lib/plugin/_BackendInfo.php rename to lib/plugin/DebugBackendInfo.php index d6964c688..f064b014e 100644 --- a/lib/plugin/_BackendInfo.php +++ b/lib/plugin/DebugBackendInfo.php @@ -23,7 +23,7 @@ require_once 'lib/Template.php'; /** */ -class WikiPlugin__BackendInfo +class WikiPlugin_DebugBackendInfo extends WikiPlugin { function getDescription() diff --git a/lib/plugin/_GroupInfo.php b/lib/plugin/DebugGroupInfo.php similarity index 98% rename from lib/plugin/_GroupInfo.php rename to lib/plugin/DebugGroupInfo.php index ae08c7bfd..0770fc5ea 100644 --- a/lib/plugin/_GroupInfo.php +++ b/lib/plugin/DebugGroupInfo.php @@ -23,7 +23,7 @@ /** * @author: Charles Corrigan */ -class WikiPlugin__GroupInfo +class WikiPlugin_DebugGroupInfo extends WikiPlugin { function getDescription() diff --git a/lib/plugin/_Retransform.php b/lib/plugin/DebugRetransform.php similarity index 100% rename from lib/plugin/_Retransform.php rename to lib/plugin/DebugRetransform.php diff --git a/lib/plugin/EditMetaData.php b/lib/plugin/EditMetaData.php index 4b39414d6..ddcc80448 100644 --- a/lib/plugin/EditMetaData.php +++ b/lib/plugin/EditMetaData.php @@ -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() { diff --git a/lib/plugin/FileInfo.php b/lib/plugin/FileInfo.php index 1ee0509a8..81374c3ff 100644 --- a/lib/plugin/FileInfo.php +++ b/lib/plugin/FileInfo.php @@ -167,7 +167,7 @@ class WikiPlugin_FileInfo $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); } diff --git a/lib/plugin/GoogleMaps.php b/lib/plugin/GoogleMaps.php index 1df232b92..6a2d214bf 100644 --- a/lib/plugin/GoogleMaps.php +++ b/lib/plugin/GoogleMaps.php @@ -117,8 +117,7 @@ class WikiPlugin_GoogleMaps 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) { diff --git a/lib/plugin/IncludePage.php b/lib/plugin/IncludePage.php index b7a0ef3f5..b0bf6e4be 100644 --- a/lib/plugin/IncludePage.php +++ b/lib/plugin/IncludePage.php @@ -154,7 +154,7 @@ class WikiPlugin_IncludePage 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); diff --git a/lib/plugin/InterWikiSearch.php b/lib/plugin/InterWikiSearch.php index 9c5b5d62c..5378521c2 100644 --- a/lib/plugin/InterWikiSearch.php +++ b/lib/plugin/InterWikiSearch.php @@ -48,12 +48,11 @@ class WikiPlugin_InterWikiSearch 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'); */ } diff --git a/lib/plugin/MediawikiTable.php b/lib/plugin/MediawikiTable.php index 349527107..8344beb7f 100644 --- a/lib/plugin/MediawikiTable.php +++ b/lib/plugin/MediawikiTable.php @@ -65,8 +65,6 @@ class WikiPlugin_MediawikiTable 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 @@ class WikiPlugin_MediawikiTable 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 @@ class WikiPlugin_MediawikiTable 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 @@ class WikiPlugin_MediawikiTable 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 @@ class WikiPlugin_MediawikiTable 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)); } } diff --git a/lib/plugin/ModeratedPage.php b/lib/plugin/ModeratedPage.php index 0b4da6f04..5ccb77271 100644 --- a/lib/plugin/ModeratedPage.php +++ b/lib/plugin/ModeratedPage.php @@ -373,7 +373,7 @@ class WikiPlugin_ModeratedPage $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)); diff --git a/lib/plugin/OldStyleTable.php b/lib/plugin/OldStyleTable.php index 3199ab922..b953d2075 100644 --- a/lib/plugin/OldStyleTable.php +++ b/lib/plugin/OldStyleTable.php @@ -138,8 +138,7 @@ class WikiPlugin_OldStyleTable 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(' '))); diff --git a/lib/plugin/_PreferencesInfo.php b/lib/plugin/PreferencesInfo.php similarity index 97% rename from lib/plugin/_PreferencesInfo.php rename to lib/plugin/PreferencesInfo.php index 4fb970839..5b1f5878b 100644 --- a/lib/plugin/_PreferencesInfo.php +++ b/lib/plugin/PreferencesInfo.php @@ -23,7 +23,7 @@ /** * Plugin to display the current preferences without auth check. */ -class WikiPlugin__PreferencesInfo +class WikiPlugin_PreferencesInfo extends WikiPlugin { function getDescription() diff --git a/lib/plugin/RecentChanges.php b/lib/plugin/RecentChanges.php index fc0ee79e7..18db4b6db 100644 --- a/lib/plugin/RecentChanges.php +++ b/lib/plugin/RecentChanges.php @@ -248,7 +248,7 @@ class _RecentChanges_HtmlFormatter 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 @@ class _RecentChanges_SideBarFormatter return HTML::span(array('class' => 'wiki-summary'), "[", /*TransformLinks(*/ - $summary, /* $rev->get('markup')),*/ + $summary, "]"); } diff --git a/lib/plugin/RichTable.php b/lib/plugin/RichTable.php index 332728c20..d1ace981c 100644 --- a/lib/plugin/RichTable.php +++ b/lib/plugin/RichTable.php @@ -43,8 +43,6 @@ class WikiPlugin_RichTable 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 @@ class WikiPlugin_RichTable 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 @@ class WikiPlugin_RichTable 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 @@ class WikiPlugin_RichTable 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); diff --git a/lib/plugin/SiteMap.php b/lib/plugin/SiteMap.php index cb3b9e317..38432584c 100644 --- a/lib/plugin/SiteMap.php +++ b/lib/plugin/SiteMap.php @@ -165,7 +165,7 @@ class WikiPlugin_SiteMap 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 @@ class WikiPlugin_SiteMap $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; } diff --git a/lib/plugin/SpellCheck.php b/lib/plugin/SpellCheck.php index a3a650f4b..da5a12adc 100644 --- a/lib/plugin/SpellCheck.php +++ b/lib/plugin/SpellCheck.php @@ -163,7 +163,7 @@ class WikiPlugin_SpellCheck } $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"))); diff --git a/lib/plugin/Template.php b/lib/plugin/Template.php index aa3b7f2be..c4900c3af 100644 --- a/lib/plugin/Template.php +++ b/lib/plugin/Template.php @@ -197,10 +197,10 @@ class WikiPlugin_Template $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); diff --git a/lib/plugin/TranslateText.php b/lib/plugin/TranslateText.php index ccbdc5076..879495d4e 100644 --- a/lib/plugin/TranslateText.php +++ b/lib/plugin/TranslateText.php @@ -26,7 +26,7 @@ * One required argument: lang * Requires that an action page with the <> line exists. * - * Usually called from <<_WikiTranslation >> + * Usually called from <> * 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 @@ class WikiPlugin_TranslateText 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 @@ class WikiPlugin_TranslateText $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*"), diff --git a/lib/plugin/UnfoldSubpages.php b/lib/plugin/UnfoldSubpages.php index 155dd7bf9..6970c43f2 100644 --- a/lib/plugin/UnfoldSubpages.php +++ b/lib/plugin/UnfoldSubpages.php @@ -151,11 +151,10 @@ class WikiPlugin_UnfoldSubpages if ($smalltitle) { $pname = array_pop(explode(SUBPAGE_SEPARATOR, $cpagename)); // get last subpage name // Use _("%s: %s") instead of .": ". for French punctuation - $ct = TransformText(sprintf(_("%s: %s"), "[$pname|$cpagename]", - $ct), - $r->get('markup'), $cpagename); + $ct = TransformText(sprintf(_("%s: %s"), "[$pname|$cpagename]", $ct), + $cpagename); } else { - $ct = TransformText($ct, $r->get('markup'), $cpagename); + $ct = TransformText($ct, $cpagename); } array_pop($included_pages); if (!$smalltitle) { diff --git a/lib/plugin/WikiAdminMarkup.php b/lib/plugin/WikiAdminMarkup.php deleted file mode 100644 index 982377cb2..000000000 --- a/lib/plugin/WikiAdminMarkup.php +++ /dev/null @@ -1,207 +0,0 @@ -> or called via WikiAdminSelect - * @author: Reini Urban - * - */ -require_once 'lib/PageList.php'; -require_once 'lib/plugin/WikiAdminSelect.php'; - -class WikiPlugin_WikiAdminMarkup - extends WikiPlugin_WikiAdminSelect -{ - function getDescription() - { - return _("Change the markup type of selected pages."); - } - - function getDefaultArguments() - { - return array_merge - ( - WikiPlugin_WikiAdminSelect::getDefaultArguments(), - array( - 'markup' => 2, - /* Columns to include in listing */ - 'info' => 'pagename,markup,mtime', - )); - } - - function chmarkupPages(&$dbi, &$request, $pages, $newmarkup) - { - $result = HTML::div(); - $ul = HTML::ul(); - $count = 0; - foreach ($pages as $name) { - $page = $dbi->getPage($name); - $current = $page->getCurrentRevision(); - $markup = $current->get('markup'); - if (!$markup or $newmarkup != $markup) { - if (!mayAccessPage('change', $name)) { - $result->setAttr('class', 'error'); - $result->pushContent(HTML::p(fmt("Access denied to change page “%s”.", - WikiLink($name)))); - } else { - $version = $current->getVersion(); - $meta = $current->_data; - $meta['markup'] = $newmarkup; - // convert text? - $text = $current->getPackedContent(); - $meta['summary'] = sprintf(_("Change markup type from %s to %s"), $markup, $newmarkup); - $meta['is_minor_edit'] = 1; - $meta['author'] = $request->_user->UserName(); - unset($meta['mtime']); // force new date - $page->save($text, $version + 1, $meta); - $current = $page->getCurrentRevision(); - if ($current->get('markup') === $newmarkup) { - $ul->pushContent(HTML::li(fmt("change page “%s” to markup type “%s”.", - WikiLink($name), $newmarkup))); - $count++; - } else { - $ul->pushContent(HTML::li(fmt("Couldn't change page “%s” to markup type “%s”.", - WikiLink($name), $newmarkup))); - } - } - } - } - if ($count) { - $dbi->touch(); - $result->setAttr('class', 'feedback'); - if ($count == 1) { - $result->pushContent(HTML::p(_("One page has been changed:"))); - } else { - $result->pushContent(HTML::p(fmt("%d pages have been changed:", $count))); - } - $result->pushContent($ul); - return $result; - } else { - $result->setAttr('class', 'error'); - $result->pushContent(HTML::p(_("No pages changed."))); - return $result; - } - } - - function run($dbi, $argstr, &$request, $basepage) - { - if ($request->getArg('action') != 'browse') { - if (!$request->getArg('action') == __("PhpWikiAdministration")."/".__("Markup")) { - return $this->disabled(_("Plugin not run: not in browse mode")); - } - } - - $args = $this->getArgs($argstr, $request); - $this->_args = $args; - $this->preSelectS($args, $request); - - $p = $request->getArg('p'); - if (!$p) $p = $this->_list; - $post_args = $request->getArg('admin_markup'); - if (!$request->isPost() and empty($post_args['markup'])) - $post_args['markup'] = $args['markup']; - $next_action = 'select'; - $pages = array(); - if ($p && !$request->isPost()) - $pages = $p; - if ($p && $request->isPost() && - !empty($post_args['button']) && empty($post_args['cancel']) - ) { - // without individual PagePermissions: - if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) { - $request->_notAuthorized(WIKIAUTH_ADMIN); - $this->disabled("! user->isAdmin"); - } - // DONE: error message if not allowed. - if ($post_args['action'] == 'verify') { - // Real action - return $this->chmarkupPages($dbi, $request, array_keys($p), - $post_args['markup']); - } - if ($post_args['action'] == 'select') { - if (!empty($post_args['markup'])) - $next_action = 'verify'; - foreach ($p as $name => $c) { - $pages[$name] = 1; - } - } - } - if ($next_action == 'select' and empty($pages)) { - $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], - $args['exclude']); - } - - if ($next_action == 'select') { - $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args); - } else { - $pagelist = new PageList_Unselectable($args['info'], $args['exclude'], $args); - } - $pagelist->addPageList($pages); - - $header = HTML::fieldset(); - if ($next_action == 'verify') { - $button_label = _("Yes"); - $header->pushContent(HTML::legend(_("Confirm markup change"))); - $header->pushContent( - HTML::p(HTML::strong( - _("Are you sure you want to change the markup type of the selected files?")))); - $header = $this->chmarkupForm($header, $post_args); - } else { - $button_label = _("Change markup type"); - $header->pushContent(HTML::legend(_("Select the pages to change the markup type"))); - $header = $this->chmarkupForm($header, $post_args); - } - - $buttons = HTML::p(Button('submit:admin_markup[button]', $button_label, 'wikiadmin'), - Button('submit:admin_markup[cancel]', _("Cancel"), 'button')); - $header->pushContent($buttons); - - return HTML::form(array('action' => $request->getPostURL(), - 'method' => 'post'), - $header, - $pagelist->getContent(), - HiddenInputs($request->getArgs(), - false, - array('admin_markup')), - HiddenInputs(array('admin_markup[action]' => $next_action)), - ENABLE_PAGEPERM - ? '' - : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN))); - } - - function chmarkupForm(&$header, $post_args) - { - $header->pushContent(_("Change markup to: ")); - $header->pushContent(HTML::input(array('name' => 'admin_markup[markup]', - 'value' => $post_args['markup']))); - return $header; - } -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: diff --git a/lib/plugin/WikiBlog.php b/lib/plugin/WikiBlog.php index 26ea04aee..c029593a9 100644 --- a/lib/plugin/WikiBlog.php +++ b/lib/plugin/WikiBlog.php @@ -176,7 +176,6 @@ class WikiPlugin_WikiBlog $perm->perm['edit'] = $perm->perm['remove']; $version_meta = array('author' => $blog_meta['creator'], 'author_id' => $blog_meta['creator_id'], - 'markup' => 2.0, // assume new markup 'summary' => $summary ? $summary : _("New comment."), 'mtime' => $now, 'pagetype' => $type, diff --git a/lib/plugin/WikicreoleTable.php b/lib/plugin/WikicreoleTable.php index f9af99169..5ea208a58 100644 --- a/lib/plugin/WikicreoleTable.php +++ b/lib/plugin/WikicreoleTable.php @@ -116,12 +116,12 @@ class WikiPlugin_WikicreoleTable foreach ($row as $cell) { if ($cell && $cell[0] == '=') { $cell = trim(substr($cell, 1)); - $html_row->pushContent(HTML::th(TransformInline($cell, 2.0, $basepage))); + $html_row->pushContent(HTML::th(TransformInline($cell, $basepage))); } else { if (is_numeric($cell)) { $html_row->pushContent(HTML::td(array('style' => "text-align:right"), $cell)); } else { - $html_row->pushContent(HTML::td(TransformInline($cell, 2.0, $basepage))); + $html_row->pushContent(HTML::td(TransformInline($cell, $basepage))); } } } diff --git a/lib/plugin/_WikiTranslation.php b/lib/plugin/_WikiTranslation.php deleted file mode 100644 index e9cff7180..000000000 --- a/lib/plugin/_WikiTranslation.php +++ /dev/null @@ -1,575 +0,0 @@ -> - * Translation service for HomePage into french (redirect to translate.google.com) - * <<_WikiTranslation what=pages >> - * Translation matrix of all pages with proper translations (all in pgsrc) - * <<_WikiTranslation what=wikiwords match="W*" limit=20 >> - * Translation matrix of the first 20 wikiwords matching "W*" - * <<_WikiTranslation string=HomePage languages=fr,de,sv >> - * Translation matrix for all given languages - * <<_WikiTranslation string=HomePage >> - * Translation matrix for all supported languages - * <<_WikiTranslation string=HomePage languages=fr >> - * Just return the translated string for this language. - * - * @author: Reini Urban - */ - -/* Container for untranslated pagenames. Needed to show up in locale/po/phpwiki.pot */ -$pgsrc_container = - _("AddComment") . ',' . - _("AddCommentPlugin") . ',' . - _("AddingPages") . ',' . - _("AllPages") . ',' . - _("AllPagesCreatedByMe") . ',' . - _("AllPagesLastEditedByMe") . ',' . - _("AllPagesOwnedByMe") . ',' . - _("AllUsers") . ',' . - _("AnalyseAccessLogSql") . ',' . - _("AppendText") . ',' . - _("AsciiMath") . ',' . - _("AsciiSVG") . ',' . - _("AtomFeed") . ',' . - _("_AuthInfo") . ',' . - _("AuthorHistory") . ',' . - _("AuthorHistoryPlugin") . ',' . - _("_BackendInfo") . ',' . - _("BackLinks") . ',' . - _("BlogArchives") . ',' . - _("BlogJournal") . ',' . - _("BoxRight") . ',' . - _("CacheTest") . ',' . - _("Calendar") . ',' . - _("CalendarList") . ',' . - _("CalendarListPlugin") . ',' . - _("CalendarPlugin") . ',' . - _("CategoryCategory") . ',' . - _("CategoryHomePages") . ',' . - _("CategoryPage") . ',' . - _("Chart") . ',' . - _("Chown") . ',' . - _("Comment") . ',' . - _("CommentPlugin") . ',' . - _("CreateBib") . ',' . - _("CreatePage") . ',' . - _("CreateToc") . ',' . - _("CreateTocPlugin") . ',' . - _("CurrentTime") . ',' . - _("DeadEndPages") . ',' . - _("DebugInfo") . ',' . - _("Diff") . ',' . - _("DynamicIncludePage") . ',' . - _("EditMetaData") . ',' . - _("EditMetaDataPlugin") . ',' . - _("ExternalSearch") . ',' . - _("ExternalSearchPlugin") . ',' . - _("FacebookLike") . ',' . - _("FileInfo") . ',' . - _("FindPage") . ',' . - _("FoafViewer") . ',' . - _("FoafViewerPlugin") . ',' . - _("FrameInclude") . ',' . - _("FrameIncludePlugin") . ',' . - _("FullRecentChanges") . ',' . - _("FullTextSearch") . ',' . - _("FuzzyPages") . ',' . - _("GoogleMaps") . ',' . - _("GooglePlugin") . ',' . - _("GoTo") . ',' . - _("GraphViz") . ',' . - _("_GroupInfo") . ',' . - _("HelloWorld") . ',' . - _("HelloWorldPlugin") . ',' . - _("HomePageAlias") . ',' . - _("HtmlConverter") . ',' . - _("Imdb") . ',' . - _("IncludePage") . ',' . - _("IncludePagePlugin") . ',' . - _("IncludePages") . ',' . - _("IncludeSiteMap") . ',' . - _("IncludeTree") . ',' . - _("InterWiki") . ',' . - _("InterWikiSearch") . ',' . - _("JabberPresence") . ',' . - _("LdapSearch") . ',' . - _("LikePages") . ',' . - _("LinkDatabase") . ',' . - _("LinkIcons") . ',' . - _("LinkSearch") . ',' . - _("ListPages") . ',' . - _("ListRelations") . ',' . - _("ListSubpages") . ',' . - _("MagicPhpWikiURLs") . ',' . - _("MediawikiTable") . ',' . - _("ModeratedPage") . ',' . - _("MoreAboutMechanics") . ',' . - _("MostPopular") . ',' . - _("NewPagesPerUser") . ',' . - _("NoCache") . ',' . - _("OldStyleTable") . ',' . - _("OldStyleTablePlugin") . ',' . - _("OrphanedPages") . ',' . - _("PageDump") . ',' . - _("PageGroup") . ',' . - _("PageHistory") . ',' . - _("PageInfo") . ',' . - _("PageTrail") . ',' . - _("PasswordReset") . ',' . - _("PhotoAlbum") . ',' . - _("PhotoAlbumPlugin") . ',' . - _("PhpHighlight") . ',' . - _("PhpHighlightPlugin") . ',' . - _("PhpWeather") . ',' . - _("PhpWeatherPlugin") . ',' . - _("PhpWiki") . ',' . - _("PhpWikiAdministration") . ',' . - _("PhpWikiDocumentation") . ',' . - _("PhpWikiPoll") . ',' . - _("Ploticus") . ',' . - _("PloticusPlugin") . ',' . - _("PluginManager") . ',' . - _("PopularNearby") . ',' . - _("PopularTags") . ',' . - _("PopUp") . ',' . - _("PreferenceApp") . ',' . - _("_PreferencesInfo") . ',' . - _("PrevNext") . ',' . - _("Processing") . ',' . - _("RandomPage") . ',' . - _("RateIt") . ',' . - _("RawHtml") . ',' . - _("RawHtmlPlugin") . ',' . - _("RecentChanges") . ',' . - _("RecentChangesCached") . ',' . - _("RecentComments") . ',' . - _("RecentEdits") . ',' . - _("RecentReferrers") . ',' . - _("RecentVisitors") . ',' . - _("RedirectTo") . ',' . - _("RedirectToPlugin") . ',' . - _("RelatedChanges") . ',' . - _("ReleaseNotes") . ',' . - _("Remove") . ',' . - _("Rename") . ',' . - _("Replace") . ',' . - _("_Retransform") . ',' . - _("RichTable") . ',' . - _("RichTablePlugin") . ',' . - _("RssFeed") . ',' . - _("SearchHighlight") . ',' . - _("SemanticRelations") . ',' . - _("SemanticSearch") . ',' . - _("SemanticSearchAdvanced") . ',' . - _("SetAcl") . ',' . - _("SiteMap") . ',' . - _("SpellCheck") . ',' . - _("SpecialPages") . ',' . - _("SqlResult") . ',' . - _("SyncWiki") . ',' . - _("SyntaxHighlighter") . ',' . - _("SystemInfo") . ',' . - _("SystemInfoPlugin") . ',' . - _("Template") . ',' . - _("TeX2png") . ',' . - _("text2png") . ',' . - _("TextFormattingRules") . ',' . - _("TexToPng") . ',' . - _("TitleSearch") . ',' . - _("Transclude") . ',' . - _("TranscludePlugin") . ',' . - _("TranslateText") . ',' . - _("UnfoldSubpages") . ',' . - _("UnfoldSubpagesPlugin") . ',' . - _("UpLoad") . ',' . - _("UpLoadPlugin") . ',' . - _("UriResolver") . ',' . - _("UserPreferences") . ',' . - _("UserRatings") . ',' . - _("Video") . ',' . - _("VisualWiki") . ',' . - _("WabiSabi") . ',' . - _("WantedPages") . ',' . - _("WantedPagesOld") . ',' . - _("WatchPage") . ',' . - _("WhoIsOnline") . ',' . - _("WikiAdminChown") . ',' . - _("WikiAdminDeleteAcl") . ',' . - _("WikiAdminMarkup") . ',' . - _("WikiAdminPurge") . ',' . - _("WikiAdminRemove") . ',' . - _("WikiAdminRename") . ',' . - _("WikiAdminSearchReplace") . ',' . - _("WikiAdminSelect") . ',' . - _("WikiAdminSetAcl") . ',' . - _("WikiAdminSetAclSimple") . ',' . - _("WikiAdminSetExternal") . ',' . - _("WikiAdminUtils") . ',' . - _("WikiBlog") . ',' . - _("WikiBlogPlugin") . ',' . - _("WikicreoleTable") . ',' . - _("WikiForm") . ',' . - _("WikiFormRich") . ',' . - _("WikiForum") . ',' . - _("WikiPlugin") . ',' . - _("WikiPoll") . ',' . - _("_WikiTranslation") . ',' . - _("WikiWikiWeb") . ',' . - _("YouTube"); - -require_once 'lib/PageList.php'; - -class WikiPlugin__WikiTranslation - extends WikiPlugin -{ - - function getDescription() - { - return _("Show translations of various words or pages."); - } - - function getDefaultArguments() - { - return array_merge - ( - PageList::supportedArgs(), - array('languages' => '', // comma delimited string of de,en,sv,... - 'string' => '', - 'page' => '', // use a translation service - 'what' => 'pages', // or 'buttons', 'plugins' or 'wikiwords' - - 'match' => '*', - 'from_lang' => false, - 'include_empty' => false, - //'exclude' => '', - //'sortby' => '', - //'limit' => 0, - 'nolinks' => false, // don't display any links - // (for development only) - 'noT' => false // don't display the T link - // (for development only) - )); - } - - function init_locale($lang) - { - if ($lang != $this->lang) - update_locale($lang); - if ($lang == 'en') { - // Hack alert! we need hash for stepping through it, even if it's - // in the wrong language - include (FindFile("locale/de/LC_MESSAGES/phpwiki.php", 0, 'reinit')); - foreach ($locale as $en => $de) { - $locale[$en] = $en; - } - // gettext module loaded: must load the LC_MESSAGES php hash - } elseif (function_exists('bindtextdomain')) { - include (FindFile("locale/$lang/LC_MESSAGES/phpwiki.php", 0, 'reinit')); - //include (FindLocalizedFile("LC_MESSAGES/phpwiki.php", 0,'reinit')); - // we already have a $locale, but maybe it's in the wrong language - } elseif ($lang != $this->lang or empty($GLOBALS['locale'])) { - include (FindFile("locale/$lang/LC_MESSAGES/phpwiki.php", 0, 'reinit')); - } else { - $locale = & $GLOBALS['locale']; - } - $this->_locales[$lang] = $locale; - } - - // reverse translation: - function translate_to_en($text, $lang = false) - { - if (!$lang) $lang = $this->lang; // current locale - if ($lang == 'en') return $text; - - $this->_locales = array(); - $this->_reverse_locales = array(); - - if (!isset($this->_locales[$lang])) { - $this->init_locale($lang); - } - assert(!empty($this->_locales[$lang])); - if (!isset($this->_reverse_locales[$lang])) { - // and now do a reverse lookup in the $locale hash - $this->_reverse_locales[$lang] = array_flip($this->_locales[$lang]); - } - if (!empty($this->_reverse_locales[$lang][$text])) { - return $this->_reverse_locales[$lang][$text]; - } else { - return $text; - } - } - - /** - * setlocale() switching with the gettext extension is by far too slow. - * So use the hash regardless if gettext is loaded or not. - */ - function fast_translate($text, $to_lang, $from_lang = false) - { - if (!$from_lang) $from_lang = $this->lang; // current locale - if ($from_lang == $to_lang) return $text; - // setup hash from en => to_lang - if (!isset($this->_locales[$to_lang])) - $this->init_locale($to_lang); - if ($from_lang != 'en') { - // get reverse gettext: translate to english - $text = $this->translate_to_en($text, $from_lang); - } - return !empty($this->_locales[$to_lang][$text]) - ? $this->_locales[$to_lang][$text] - : $text; - } - - //FIXME! There's something wrong. - function translate($text, $to_lang, $from_lang = false) - { - if (!$from_lang) $from_lang = $this->lang; // current locale - if ($from_lang == $to_lang) return $text; - // Speed up hash lookup. Not needed for gettext module - if (!isset($this->_locales[$from_lang]) and !function_exists('bindtextdomain')) { - $this->init_locale($from_lang); - } - if ($from_lang != 'en') { - // get reverse gettext: translate to english - $en = $this->translate_to_en($text, $from_lang); - // and then to target - update_locale($to_lang); - $result = gettext($en); - update_locale($from_lang); - } else { - // locale switching is very slow with the gettext extension. - // better use fast_translate - if ($from_lang != $to_lang) { - update_locale($to_lang); - } - $result = gettext($text); - if ($from_lang != $to_lang) { - update_locale($from_lang); - } - } - return $result; - } - - function run($dbi, $argstr, &$request, $basepage) - { - $this->args = $this->getArgs($argstr, $request); - extract($this->args); - $this->request = &$request; - if (!$from_lang) $from_lang = $request->getPref('lang'); - if (!$from_lang) $from_lang = $GLOBALS['LANG']; - $this->lang = $from_lang; - - if (empty($languages)) { - $available_languages = listAvailableLanguages(); - if ($from_lang == 'en') { - // "en" is always the first. - array_shift($available_languages); - } - // put from_lang to the very end. - if (in_array($from_lang, $available_languages)) - $languages = $available_languages; - else - $languages = array_merge($available_languages, array($from_lang)); - } elseif (strstr($languages, ',')) { - $languages = explode(',', $languages); - } else { - $languages = array($languages); - } - $to_lang = $languages[0]; - if (!empty($string) and count($languages) == 1) { - return $this->translate($string, $to_lang, $from_lang); - } - if (!empty($page)) { - $pagename = $page; - if ($dbi->isWikiPage($pagename)) { - $url = ''; - // google can only translate from english and french - if (in_array($from_lang, array('en', 'fr'))) { - $url = "http://translate.google.com/translate"; - $url .= "?langpair=" . urlencode($from_lang . "|" . $to_lang); - $url .= "&u=" . urlencode(WikiURL($pagename, false, true)); - } - // redirect or transclude? - if ($url) { - return $request->redirect($url); - } - return HTML(fmt("TODO: Google can only translate from english and french. Find a translation service for %s to language %s", - WikiURL($pagename, false, true), - $to_lang)); - } else { - return $this->error(fmt("%s is empty.", $pagename)); - } - } - - $pagelist = new PageList('', $exclude, $this->args); - $pagelist->_columns[0]->_heading = "$from_lang"; - foreach ($languages as $lang) { - if ($lang == $from_lang) continue; - $field = "custom:$lang"; - $pagelist->addColumnObject( - new _PageList_Column_customlang($field, $from_lang, $this)); - } - if (!empty($string)) { - $pagelist->addPage($string); - return $pagelist; - } - switch ($what) { - case 'allpages': - $pagelist->addPages($dbi->getAllPages($include_empty, $sortby, - $limit, $exclude)); - break; - case 'pages': - // not all pages, only the pgsrc pages - if (!is_array($exclude)) - $exclude = $pagelist->explodePageList($exclude, false, $sortby, - $limit, $exclude); - $path = FindLocalizedFile(WIKI_PGSRC); - $pgsrc = new fileSet($path); - foreach ($pgsrc->getFiles($exclude, $sortby, $limit) as $pagename) { - $pagename = urldecode($pagename); - if (substr($pagename, -1, 1) == '~') continue; - if (in_array($pagename, $exclude)) - continue; // exclude page. - if ($match != '*' and !glob_match($match, $pagename)) - continue; - $page_handle = $dbi->getPage($pagename); - $pagelist->addPage($page_handle); - } - break; - case 'wikiwords': - if (!isset($this->_locales[$from_lang])) { - $this->init_locale($from_lang); - } - $locale = & $this->_locales[$from_lang]; - if (is_array($locale)) { - $count = 0; - foreach ($locale as $from => $to) { - if ($match != '*' and !glob_match($match, $from)) - continue; - if (isWikiWord($from)) { - $count++; - $pagelist->addPage($from); - if ($limit and $count > $limit) break; - } - } - } - break; - // all Button texts, which need a localized .png - // where to get them from? templates/*.tmpl: Button() - // and WikiLink(?,'button') - // navbar links, actionpages, and admin requests - case 'buttons': - $buttons = $GLOBALS['AllActionPages']; - $fileset = new FileSet(FindFile("themes/MacOSX/buttons/en"), - "*.png"); - foreach ($fileset->getFiles() as $file) { - $b = urldecode(substr($file, 0, -4)); - if (!in_array($b, $buttons)) - $buttons[] = $b; - } - $count = 0; - foreach ($buttons as $button) { - $pagelist->addPage($button); - if ($limit and ++$count > $limit) break; - } - break; - } - return $pagelist; - } -} - -class _PageList_Column_customlang extends _PageList_Column -{ - function _PageList_Column_customlang($field, $from_lang, $plugin) - { - $this->_field = $field; - $this->_from_lang = $from_lang; - $this->_plugin =& $plugin; - $this->_what = $plugin->args['what']; - $this->_noT = $plugin->args['noT']; - $this->_nolinks = $plugin->args['nolinks']; - $this->_iscustom = substr($field, 0, 7) == 'custom:'; - if ($this->_iscustom) - $this->_field = substr($field, 7); - //$heading = $field; - $this->dbi = &$GLOBALS['request']->getDbh(); - $this->_PageList_Column_base($this->_field); - } - - function _getValue($page, &$revision_handle) - { - if (is_object($page)) $text = $page->getName(); - else $text = $page; - $trans = $this->_plugin->fast_translate($text, $this->_field, - $this->_from_lang); - // how to markup untranslated words and not existing pages? - // untranslated: (TODO) link to translation editor - if ($trans == $text or // untranslated - (($this->_from_lang != 'en') and - ($this->_field != 'en') and - ($trans == $this->_plugin->fast_translate($text, 'en', - $this->_from_lang)) - ) - ) { - global $WikiTheme; - $link = $WikiTheme->linkUnknownWikiWord($trans); - if (!($this->_noT or $this->_nolinks) - and $this->dbi->isWikiPage($trans) - ) { - $url = WikiURL($trans, array('action' => 'TranslateText', - 'lang' => $this->_field)); - $button = $WikiTheme->makeButton('T', $url); - $button->addTooltip(sprintf(_("Define the translation for %s in %s"), - $trans, $this->_field)); - $link = HTML::span($button); - $link->setAttr('class', 'wikiunknown'); - $text = HTML::span($WikiTheme->maybeSplitWikiWord($trans)); - $text->setAttr('style', 'text-decoration:line-through'); - $link->pushContent($text); - return $link; - } elseif (is_object($page)) - return ''; else // not existing: empty - return ''; - } elseif (is_object($page)) { - if (!$this->_nolinks) - return WikiLink($trans, 'auto'); - else - return $trans; - } else { - return $trans; - } - } -} - -// Local Variables: -// mode: php -// tab-width: 8 -// c-basic-offset: 4 -// c-hanging-comment-ender-p: nil -// indent-tabs-mode: nil -// End: diff --git a/lib/stdlib.php b/lib/stdlib.php index eb56768e9..278de094f 100644 --- a/lib/stdlib.php +++ b/lib/stdlib.php @@ -33,7 +33,6 @@ SplitQueryArgs ($query_args) LinkPhpwikiURL ($url, $text, $basepage) - ConvertOldMarkup ($content, $markup_type = "block") MangleXmlIdentifier($str) class Stack { push($item), pop(), cnt(), top() } @@ -989,212 +988,6 @@ class WikiPageName } } -/** - * Convert old page markup to new-style markup. - * - * @param string $text Old-style wiki markup. - * - * @param string $markup_type - * One of:
- *
"block"
Convert all markup. - *
"inline"
Convert only inline markup. - *
"links"
Convert only link markup. - *
- * - * @return string New-style wiki markup. - * - * @bugs Footnotes don't work quite as before (esp if there are - * multiple references to the same footnote. But close enough, - * probably for now.... - * @bugs Apache2 and IIS crash with OldTextFormattingRules or - * AnciennesR%E8glesDeFormatage. (at the 2nd attempt to do the anchored block regex) - * It only crashes with CreateToc so far, but other pages (not in pgsrc) are - * also known to crash, even with Apache1. - */ -function ConvertOldMarkup($text, $markup_type = "block") -{ - - static $subs; - static $block_re; - - // FIXME: - // Trying to detect why the 2nd paragraph of OldTextFormattingRules or - // AnciennesR%E8glesDeFormatage crashes. - // It only crashes with CreateToc so far, but other pages (not in pgsrc) are - // also known to crash, even with Apache1. - $debug_skip = false; - // I suspect this only to crash with Apache2 and IIS. - if (in_array(php_sapi_name(), array('apache2handler', 'apache2filter', 'isapi')) - and preg_match("/plugin CreateToc/", $text) - ) { - trigger_error(_("The CreateTocPlugin is not yet old markup compatible! ") - . _("Please remove the CreateToc line to be able to reformat this page to old markup. ") - . _("Skipped."), E_USER_WARNING); - $debug_skip = true; - //if (!DEBUG) return $text; - return $text; - } - - if (empty($subs)) { - /***************************************************************** - * Conversions for inline markup: - */ - - // escape tilde's - $orig[] = '/~/'; - $repl[] = '~~'; - - // escape escaped brackets - $orig[] = '/\[\[/'; - $repl[] = '~['; - - // change ! escapes to ~'s. - global $WikiNameRegexp, $request; - $bang_esc[] = "(?:" . ALLOWED_PROTOCOLS . "):[^\s<>\[\]\"'()]*[^\s<>\[\]\"'(),.?]"; - // before 4.3.9 pcre had a memory release bug, which might hit us here. so be safe. - $map = getInterwikiMap(); - if ($map_regex = $map->getRegexp()) - $bang_esc[] = $map_regex . ":[^\\s.,;?()]+"; // FIXME: is this really needed? - $bang_esc[] = $WikiNameRegexp; - $orig[] = '/!((?:' . join(')|(', $bang_esc) . '))/'; - $repl[] = '~\\1'; - - $subs["links"] = array($orig, $repl); - - // Temporarily URL-encode pairs of underscores in links to hide - // them from the re for bold markup. - $orig[] = '/\[[^\[\]]*?__[^\[\]]*?\]/e'; - $repl[] = 'str_replace(\'__\', \'%5F%5F\', \'\\0\')'; - - // Escape '<'s - //$orig[] = '/<(?!\?plugin)|(?~[[\\1|#ftnt_\\1]~]'; - - // Convert old style emphases to HTML style emphasis. - $orig[] = '/__(.*?)__/'; - $repl[] = '\\1'; - $orig[] = "/''(.*?)''/"; - $repl[] = '\\1'; - - // Escape nestled markup. - $orig[] = '/^(?<=^|\s)[=_](?=\S)|(?<=\S)[=_*](?=\s|$)/m'; - $repl[] = '~\\0'; - - // in old markup headings only allowed at beginning of line - $orig[] = '/!/'; - $repl[] = '~!'; - - // Convert URL-encoded pairs of underscores in links back to - // real underscores after bold markup has been converted. - $orig = '/\[[^\[\]]*?%5F%5F[^\[\]]*?\]/e'; - $repl = 'str_replace(\'%5F%5F\', \'__\', \'\\0\')'; - - $subs["inline"] = array($orig, $repl); - - /***************************************************************** - * Patterns which match block markup constructs which take - * special handling... - */ - - // Indented blocks - $blockpats[] = '[ \t]+\S(?:.*\s*\n[ \t]+\S)*'; - // Tables - $blockpats[] = '\|(?:.*\n\|)*'; - - // List items - $blockpats[] = '[#*;]*(?:[*#]|;.*?:)'; - - // Footnote definitions - $blockpats[] = '\[\s*(\d+)\s*\]'; - - if (!$debug_skip) { - // Plugins - $blockpats[] = '<\?plugin(?:-form)?\b.*\?>\s*$'; - } - - // Section Title - $blockpats[] = '!{1,3}[^!]'; - /* - removed .|\n in the anchor not to crash on /m because with /m "." already includes \n - this breaks headings but it doesn't crash anymore (crash on non-cgi, non-cli only) - */ - $block_re = ('/\A((?:.|\n)*?)(^(?:' - . join("|", $blockpats) - . ').*$)\n?/m'); - - } - - if ($markup_type != "block") { - list ($orig, $repl) = $subs[$markup_type]; - return preg_replace($orig, $repl, $text); - } else { - list ($orig, $repl) = $subs['inline']; - $out = ''; - //FIXME: - // php crashes here in the 2nd paragraph of OldTextFormattingRules, - // AnciennesR%E8glesDeFormatage and more - // See http://www.pcre.org/pcre.txt LIMITATIONS - while (preg_match($block_re, $text, $m)) { - $text = substr($text, strlen($m[0])); - list (, $leading_text, $block) = $m; - $suffix = "\n"; - - if (strchr(" \t", $block[0])) { - // Indented block - $prefix = "
\n";
-                $suffix = "\n
\n"; - } elseif ($block[0] == '|') { - // Old-style table - $prefix = "\n"; - } elseif (strchr("#*;", $block[0])) { - // Old-style list item - preg_match('/^([#*;]*)([*#]|;.*?:) */', $block, $m); - list (, $ind, $bullet) = $m; - $block = substr($block, strlen($m[0])); - - $indent = str_repeat(' ', strlen($ind)); - if ($bullet[0] == ';') { - //$term = ltrim(substr($bullet, 1)); - //return $indent . $term . "\n" . $indent . ' '; - $prefix = $ind . $bullet; - } else - $prefix = $indent . $bullet . ' '; - } elseif ($block[0] == '[') { - // Footnote definition - preg_match('/^\[\s*(\d+)\s*\]/', $block, $m); - $footnum = $m[1]; - $block = substr($block, strlen($m[0])); - $prefix = "#[|ftnt_" . ${footnum} . "]~[[" . ${footnum} . "|#ftnt_ref_" . ${footnum} . "]~] "; - } elseif ($block[0] == '<') { - // Plugin. - // HACK: no inline markup... - $prefix = $block; - $block = ''; - } elseif ($block[0] == '!') { - // Section heading - preg_match('/^!{1,3}/', $block, $m); - $prefix = $m[0]; - $block = substr($block, strlen($m[0])); - } else { - // AAck! - assert(0); - } - if ($leading_text) $leading_text = preg_replace($orig, $repl, $leading_text); - if ($block) $block = preg_replace($orig, $repl, $block); - $out .= $leading_text; - $out .= $prefix; - $out .= $block; - $out .= $suffix; - } - return $out . preg_replace($orig, $repl, $text); - } -} - /** * Expand tabs in string. * diff --git a/lib/wikilens/PageListColumns.php b/lib/wikilens/PageListColumns.php index f6b080c37..2d6e71343 100644 --- a/lib/wikilens/PageListColumns.php +++ b/lib/wikilens/PageListColumns.php @@ -27,7 +27,7 @@ * of pagelist types. E.g. certain plugins, like MostPopular might use * info=pagename,hits,rating * which displays the rating column whenever the wikilens theme is active. - * Similarly as in certain plugins, like WikiAdminRename or _WikiTranslation + * Similarly as in certain plugins, like WikiAdminRename or WikiTranslation */ require_once 'lib/PageList.php'; diff --git a/lib/wikilens/Utils.php b/lib/wikilens/Utils.php index 4f393a3cf..2069571ed 100644 --- a/lib/wikilens/Utils.php +++ b/lib/wikilens/Utils.php @@ -35,8 +35,7 @@ function addPageTextData($user, $dbi, $new_data, $START_DELIM, $DELIM) $meta = $current->_data; } else { $text = ''; - $meta = array('markup' => 2.0, - 'author' => $user->getId()); + $meta = array('author' => $user->getId()); } // add new data to the appropriate line diff --git a/lib/ziplib.php b/lib/ziplib.php index 376771200..5142ed0a8 100644 --- a/lib/ziplib.php +++ b/lib/ziplib.php @@ -613,8 +613,6 @@ function MimeifyPageRevision(&$page, &$revision) $params['flags'] = ($params['flags'] ? $params['flags'] . ',EXTERNAL_PAGE' : 'EXTERNAL_PAGE'); if ($revision->get('author_id')) $params['author_id'] = $revision->get('author_id'); - if ($revision->get('markup')) // what is the default? we must use 1 - $params['markup'] = $revision->get('markup'); if ($revision->get('summary')) $params['summary'] = $revision->get('summary'); if ($page->get('hits')) @@ -855,7 +853,6 @@ function ParseMimeifiedPages($data) case 'author': case 'author_id': case 'summary': - case 'markup': case 'pagetype': $versiondata[$key] = $value; break; diff --git a/themes/MonoBook/templates/info.tmpl b/themes/MonoBook/templates/info.tmpl index e4f12fb75..f0f071291 100644 --- a/themes/MonoBook/templates/info.tmpl +++ b/themes/MonoBook/templates/info.tmpl @@ -37,10 +37,6 @@ else $wordcount = fmt("%s words", $c); -$markupVersion = ($markupVersion = $revision->get('markup')) - ? fmt("Version %s", $markupVersion) - : _("Original (1.2 or 1.0)"); - $summary = HTML::textarea(array('name' => 'summary', 'class' => 'summary', /* use fixed dimensions? */ @@ -112,10 +108,6 @@ if ($type == 'inherited') { - - - - , diff --git a/themes/Portland/lib/RecentChanges.php b/themes/Portland/lib/RecentChanges.php index f0fde4be4..c34386de7 100644 --- a/themes/Portland/lib/RecentChanges.php +++ b/themes/Portland/lib/RecentChanges.php @@ -42,7 +42,7 @@ class _Portland_RecentChanges_Formatter return ''; return HTML::strong(array('class' => 'wiki-summary'), "(", - TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + TransformLinks($summary, $rev->getPageName()), ")"); } } @@ -61,7 +61,7 @@ class _Portland_PageHistory_Formatter return ''; return HTML::strong(array('class' => 'wiki-summary'), "(", - TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + TransformLinks($summary, $rev->getPageName()), ")"); } } diff --git a/themes/SpaceWiki/lib/RecentChanges.php b/themes/SpaceWiki/lib/RecentChanges.php index 5305800d6..dcfc88855 100644 --- a/themes/SpaceWiki/lib/RecentChanges.php +++ b/themes/SpaceWiki/lib/RecentChanges.php @@ -50,7 +50,7 @@ class _SpaceWiki_RecentChanges_Formatter return ''; return HTML::strong(array('class' => 'wiki-summary'), " ", - TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + TransformLinks($summary, $rev->getPageName()), " "); } @@ -76,7 +76,7 @@ class _SpaceWiki_PageHistory_Formatter return ''; return HTML::strong(array('class' => 'wiki-summary'), " ", - TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + TransformLinks($summary, $rev->getPageName()), " "); } } diff --git a/themes/Wordpress/lib/RecentChanges.php b/themes/Wordpress/lib/RecentChanges.php index 932d4a043..5e7d479d3 100644 --- a/themes/Wordpress/lib/RecentChanges.php +++ b/themes/Wordpress/lib/RecentChanges.php @@ -42,7 +42,7 @@ class _Wordpress_RecentChanges_Formatter return ''; return HTML::strong(array('class' => 'wiki-summary'), "(", - TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + TransformLinks($summary, $rev->getPageName()), ")"); } } @@ -61,7 +61,7 @@ class _Wordpress_PageHistory_Formatter return ''; return HTML::strong(array('class' => 'wiki-summary'), "(", - TransformLinks($summary, $rev->get('markup'), $rev->getPageName()), + TransformLinks($summary, $rev->getPageName()), ")"); } } diff --git a/themes/default/templates/info.tmpl b/themes/default/templates/info.tmpl index a07c7f1f2..b97b114b0 100644 --- a/themes/default/templates/info.tmpl +++ b/themes/default/templates/info.tmpl @@ -30,10 +30,6 @@ else $wordcount = fmt("%s words", $c); -$markupVersion = ($markupVersion = $revision->get('markup')) - ? fmt("Version %s", $markupVersion) - : _("Original (1.2 or 1.0)"); - $summary = $revision->get('summary'); if ($is_current = $revision->isCurrent()) { @@ -99,10 +95,6 @@ if ($type == 'inherited') { - - - - , diff --git a/themes/default/templates/login.tmpl b/themes/default/templates/login.tmpl index cf16d9acd..68907bca4 100644 --- a/themes/default/templates/login.tmpl +++ b/themes/default/templates/login.tmpl @@ -43,7 +43,7 @@ if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) { // sample Japanese login name $examplechars = $examplechars . "天道あかね"; } - $t = asXML(TransformText(_("You may sign in using any [[Help:AddingPages|WikiWord]] as a user id. (Any characters in %s etc. may be used too). The user id will be used as a link in RecentChanges to your home page."), 2.0, true)); + $t = asXML(TransformText(_("You may sign in using any [[Help:AddingPages|WikiWord]] as a user id. (Any characters in %s etc. may be used too). The user id will be used as a link in RecentChanges to your home page."), true)); if (substr_count($t,"%s") == 1) { $s = @sprintf($t, $examplechars); // FIXME: Workaround gettext or sprintf problem diff --git a/themes/default/templates/userprefs.tmpl b/themes/default/templates/userprefs.tmpl index 213520b70..0eb8b8094 100644 --- a/themes/default/templates/userprefs.tmpl +++ b/themes/default/templates/userprefs.tmpl @@ -118,7 +118,7 @@ if ( $isForm ) {
_authmethod : @$user->auth_how; ?> get('userid'), " from " . $authmethod), -- 2.42.0