From: Brion Vibber Date: Wed, 24 Jun 2009 16:49:28 +0000 (+0000) Subject: Prepping for site default overrides of copyright/TOS statements for Wikimedia X-Git-Tag: 1.31.0-rc.0~41229 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=644cccdf394d7fcb99f564ea58b2f9fdd5ca2122;p=lhc%2Fweb%2Fwiklou.git Prepping for site default overrides of copyright/TOS statements for Wikimedia sites with updated CC-BY-SA license... Messages now available in WikimediaMessages extension for localization: * wikimedia-copyright - page footer * wikimedia-copyrightwarning - edit page, above summary/save button * wikimedia-editpage-tos-summary - edit page, below summary/save button & above edittools Initial English defaults are taken from http://meta.wikimedia.org/wiki/Licensing_update/Implementation Ariel's search for other copyright-related messages looks fairly clean, so we should be good here for now as $wgRightsText/$wgRightsUrl are already updated. Messages are overridden using new hooks, which can also be used to switch the messages based on title or namespace -- this may be desirable for sites such as mediawiki.org which keep some namespaces PD etc. Use of the overridden messages by WikimediaMessages is switched in when $wgRightsUrl is set to 'http://creativecommons.org/licenses/by-sa/3.0/' --- diff --git a/docs/hooks.txt b/docs/hooks.txt index ada88d1acc..3981f110b8 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -654,6 +654,16 @@ textarea in the edit form &$checks: Array of edit checks like "watch this page"/"minor edit" &$tabindex: HTML tabindex of the last edit check/button +'EditPageCopyrightWarning': Allow for site and per-namespace customization of contribution/copyright notice. +$title: title of page being edited +&$msg: localization message name, overridable. Default is either 'copyrightwarning' or 'copyrightwarning2' + +'EditPageTosSummary': Give a chance for site and per-namespace customizations +of terms of service summary link that might exist separately from the copyright +notice. +$title: title of page being edited +&$msg: localization message name, overridable. Default is 'editpage-tos-summary' + 'EditSectionLink': Do not use, use DoEditSectionLink instead. $skin: Skin rendering the UI $title: Title being linked to @@ -1224,6 +1234,12 @@ $skin: Skin object &$bar: Sidebar contents Modify $bar to add or modify sidebar portlets. +'SkinCopyrightFooter': Allow for site and per-namespace customization of copyright notice. +$title: displayed page title +$type: 'normal' or 'history' for old/diff views +&$msg: overridable message; usually 'copyright' or 'history_copyright'. This message must be in HTML format, not wikitext! +&$link: overridable HTML link to be passed into the message as $1 + 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle() $skin: Skin object &$subpages: Subpage links HTML diff --git a/includes/EditPage.php b/includes/EditPage.php index d3732b0775..c6c272d0f2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1317,6 +1317,8 @@ class EditPage { $copywarnMsg = array( 'copyrightwarning2', '[[' . wfMsgForContent( 'copyrightpage' ) . ']]' ); } + // Allow for site and per-namespace customization of contribution/copyright notice. + wfRunHooks( 'EditPageCopyrightWarning', array( $this->mTitle, &$copywarnMsg ) ); if ( $wgUser->getOption('showtoolbar') and !$this->isCssJsSubpage ) { # prepare toolbar for edit buttons @@ -1547,6 +1549,7 @@ END $token = htmlspecialchars( $wgUser->editToken() ); $wgOut->addHTML( "\n\n" ); + $this->showTosSummary(); $this->showEditTools(); $wgOut->addHTML( <<mTitle, &$msg ) ); + $text = wfMsgForContent( $msg ); + if( $text != '-' ) { + global $wgOut; + $wgOut->addHTML( '
' ); + $wgOut->addWikiMsgArray( $msg, array(), array( 'content' ) ); + $wgOut->addHTML( '
' ); + } + } + protected function showEditTools() { global $wgOut; $wgOut->addHTML( '
' ); diff --git a/includes/Skin.php b/includes/Skin.php index b2ccb66f88..3c5b2523b5 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1436,6 +1436,9 @@ END; # Give up now return $out; } + // Allow for site and per-namespace customization of copyright notice. + wfRunHooks( 'SkinCopyrightFooter', array( $wgArticle->getTitle(), $type, &$msg, &$link ) ); + $out .= wfMsgForContent( $msg, $link ); return $out; } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 927d553979..98c17b9a6d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1183,6 +1183,7 @@ You are also promising us that you wrote this yourself, or copied it from a publ If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see $1 for details). '''Do not submit copyrighted work without permission!'''", +'editpage-tos-summary' => '-', 'longpagewarning' => "'''Warning:''' This page is $1 kilobytes long; some browsers may have problems editing pages approaching or longer than 32kb. Please consider breaking the page into smaller sections.",