Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -654,6 +654,16 @@ |
655 | 655 | &$checks: Array of edit checks like "watch this page"/"minor edit" |
656 | 656 | &$tabindex: HTML tabindex of the last edit check/button |
657 | 657 | |
| 658 | +'EditPageCopyrightWarning': Allow for site and per-namespace customization of contribution/copyright notice. |
| 659 | +$title: title of page being edited |
| 660 | +&$msg: localization message name, overridable. Default is either 'copyrightwarning' or 'copyrightwarning2' |
| 661 | + |
| 662 | +'EditPageTosSummary': Give a chance for site and per-namespace customizations |
| 663 | +of terms of service summary link that might exist separately from the copyright |
| 664 | +notice. |
| 665 | +$title: title of page being edited |
| 666 | +&$msg: localization message name, overridable. Default is 'editpage-tos-summary' |
| 667 | + |
658 | 668 | 'EditSectionLink': Do not use, use DoEditSectionLink instead. |
659 | 669 | $skin: Skin rendering the UI |
660 | 670 | $title: Title being linked to |
— | — | @@ -1224,6 +1234,12 @@ |
1225 | 1235 | &$bar: Sidebar contents |
1226 | 1236 | Modify $bar to add or modify sidebar portlets. |
1227 | 1237 | |
| 1238 | +'SkinCopyrightFooter': Allow for site and per-namespace customization of copyright notice. |
| 1239 | +$title: displayed page title |
| 1240 | +$type: 'normal' or 'history' for old/diff views |
| 1241 | +&$msg: overridable message; usually 'copyright' or 'history_copyright'. This message must be in HTML format, not wikitext! |
| 1242 | +&$link: overridable HTML link to be passed into the message as $1 |
| 1243 | + |
1228 | 1244 | 'SkinSubPageSubtitle': At the beginning of Skin::subPageSubtitle() |
1229 | 1245 | $skin: Skin object |
1230 | 1246 | &$subpages: Subpage links HTML |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1317,6 +1317,8 @@ |
1318 | 1318 | $copywarnMsg = array( 'copyrightwarning2', |
1319 | 1319 | '[[' . wfMsgForContent( 'copyrightpage' ) . ']]' ); |
1320 | 1320 | } |
| 1321 | + // Allow for site and per-namespace customization of contribution/copyright notice. |
| 1322 | + wfRunHooks( 'EditPageCopyrightWarning', array( $this->mTitle, &$copywarnMsg ) ); |
1321 | 1323 | |
1322 | 1324 | if ( $wgUser->getOption('showtoolbar') and !$this->isCssJsSubpage ) { |
1323 | 1325 | # prepare toolbar for edit buttons |
— | — | @@ -1547,6 +1549,7 @@ |
1548 | 1550 | $token = htmlspecialchars( $wgUser->editToken() ); |
1549 | 1551 | $wgOut->addHTML( "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n" ); |
1550 | 1552 | |
| 1553 | + $this->showTosSummary(); |
1551 | 1554 | $this->showEditTools(); |
1552 | 1555 | |
1553 | 1556 | $wgOut->addHTML( <<<END |
— | — | @@ -1695,6 +1698,24 @@ |
1696 | 1699 | '"' . $liveAction . '"' . ")"; |
1697 | 1700 | } |
1698 | 1701 | |
| 1702 | + protected function showTosSummary() { |
| 1703 | + $msg = 'editpage-tos-summary'; |
| 1704 | + // Give a chance for site and per-namespace customizations of |
| 1705 | + // terms of service summary link that might exist separately |
| 1706 | + // from the copyright notice. |
| 1707 | + // |
| 1708 | + // This will display between the save button and the edit tools, |
| 1709 | + // so should remain short! |
| 1710 | + wfRunHooks( 'EditPageTosSummary', array( $this->mTitle, &$msg ) ); |
| 1711 | + $text = wfMsgForContent( $msg ); |
| 1712 | + if( $text != '-' ) { |
| 1713 | + global $wgOut; |
| 1714 | + $wgOut->addHTML( '<div class="mw-tos-summary">' ); |
| 1715 | + $wgOut->addWikiMsgArray( $msg, array(), array( 'content' ) ); |
| 1716 | + $wgOut->addHTML( '</div>' ); |
| 1717 | + } |
| 1718 | + } |
| 1719 | + |
1699 | 1720 | protected function showEditTools() { |
1700 | 1721 | global $wgOut; |
1701 | 1722 | $wgOut->addHTML( '<div class="mw-editTools">' ); |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1436,6 +1436,9 @@ |
1437 | 1437 | # Give up now |
1438 | 1438 | return $out; |
1439 | 1439 | } |
| 1440 | + // Allow for site and per-namespace customization of copyright notice. |
| 1441 | + wfRunHooks( 'SkinCopyrightFooter', array( $wgArticle->getTitle(), $type, &$msg, &$link ) ); |
| 1442 | + |
1440 | 1443 | $out .= wfMsgForContent( $msg, $link ); |
1441 | 1444 | return $out; |
1442 | 1445 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1183,6 +1183,7 @@ |
1184 | 1184 | If you do not want your writing to be edited mercilessly, then do not submit it here.<br /> |
1185 | 1185 | 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). |
1186 | 1186 | '''Do not submit copyrighted work without permission!'''", |
| 1187 | +'editpage-tos-summary' => '-', |
1187 | 1188 | 'longpagewarning' => "'''Warning:''' This page is $1 kilobytes long; |
1188 | 1189 | some browsers may have problems editing pages approaching or longer than 32kb. |
1189 | 1190 | Please consider breaking the page into smaller sections.", |
Index: trunk/extensions/WikimediaMessages/WikimediaMessages.i18n.php |
— | — | @@ -101,6 +101,12 @@ |
102 | 102 | |
103 | 103 | # The name for the common shared repo 'shared' |
104 | 104 | 'shared-repo-name-shared' => 'Wikimedia Commons', # only translate this message to other languages if you have to change it |
| 105 | + |
| 106 | + # Copyright fun! |
| 107 | + 'wikimedia-copyright' => 'Text is available under the <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution/Share-Alike License</a>; additional terms may apply. See <a href="http://wikimediafoundation.org/wiki/Terms_of_Use">Terms of Use</a> for details.', |
| 108 | + 'wikimedia-copyrightwarning' => 'By saving, you agree to irrevocably release your contribution under the [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution/Share-Alike License 3.0] and the [http://www.gnu.org/copyleft/fdl.html GFDL]. You agree to be credited by re-users, at minimum, through a hyperlink or URL to the article you are contributing to. See the [http://wikimediafoundation.org/wiki/Terms_of_Use Terms of Use] for details.', |
| 109 | + 'wikimedia-editpage-tos-summary' => 'If you do not want your writing to be edited and redistributed at will, then do not submit it here. If you did not write this yourself, it must be available under terms consistent with the [http://wikimediafoundation.org/wiki/Terms_of_Use Terms of Use], and you agree to follow any relevant licensing requirements.', |
| 110 | + |
105 | 111 | ); |
106 | 112 | |
107 | 113 | /** Message documentation (Message documentation) |
Index: trunk/extensions/WikimediaMessages/WikimediaMessages.php |
— | — | @@ -24,5 +24,30 @@ |
25 | 25 | include_once ( $dir .'WikimediaGrammarForms.php' ); |
26 | 26 | |
27 | 27 | function wfSetupWikimediaMessages() { |
| 28 | + global $wgRightsUrl, $wgHooks; |
28 | 29 | wfLoadExtensionMessages('WikimediaMessages'); |
| 30 | + if( $wgRightsUrl == 'http://creativecommons.org/licenses/by-sa/3.0/' ) { |
| 31 | + // Override with Wikimedia's site-specific copyright message defaults |
| 32 | + // with the CC/GFDL semi-dual license fun! |
| 33 | + $wgHooks['SkinCopyrightFooter'][] = 'efWikimediaSkinCopyrightFooter'; |
| 34 | + $wgHooks['EditPageCopyrightWarning'][] = 'efWikimediaEditPageCopyrightWarning'; |
| 35 | + $wgHooks['EditPageTosSummary'][] = 'efWikimediaEditPageTosSummary'; |
| 36 | + } |
29 | 37 | } |
| 38 | + |
| 39 | +function efWikimediaEditPageCopyrightWarning( $title, &$msg ) { |
| 40 | + $msg = 'wikimedia-copyrightwarning'; |
| 41 | + return true; |
| 42 | +} |
| 43 | + |
| 44 | +function efWikimediaSkinCopyrightFooter( $title, $type, &$msg, &$link ) { |
| 45 | + if( $type != 'history' ) { |
| 46 | + $msg = 'wikimedia-copyright'; |
| 47 | + } |
| 48 | + return true; |
| 49 | +} |
| 50 | + |
| 51 | +function efWikimediaEditPageTosSummary( $title, &$msg ) { |
| 52 | + $msg = 'wikimedia-editpage-tos-summary'; |
| 53 | + return true; |
| 54 | +} |
\ No newline at end of file |