Page MenuHomePhabricator
Paste P5986

WeRelate modifications to MW 1.7.1
ActivePublic

Authored by Samwilson on Sep 12 2017, 12:59 AM.
Tags
None
Referenced Files
F9470196: WeRelate modifications to MW 1.7.1
Sep 12 2017, 12:59 AM
Subscribers
None
diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php
index 2084c36..68f7399 100644
--- a/includes/AjaxDispatcher.php
+++ b/includes/AjaxDispatcher.php
@@ -56,6 +56,7 @@ class AjaxDispatcher {
$this->args = array();
}
}
+ if (!is_array($this->args)) $this->args = array($this->args);
wfProfileOut( 'AjaxDispatcher::AjaxDispatcher' );
}
@@ -69,9 +70,9 @@ class AjaxDispatcher {
if (! in_array( $this->func_name, $wgAjaxExportList ) ) {
echo "-:{$this->func_name} not callable";
} else {
- echo "+:";
+// WERELATE - remove echo and have ajaxcachepolicy write the content type
+// echo "+:";
$result = call_user_func_array($this->func_name, $this->args);
- header( 'Content-Type: text/html; charset=utf-8', true );
$wgAjaxCachePolicy->writeHeader();
echo $result;
}
diff --git a/includes/AjaxFunctions.php b/includes/AjaxFunctions.php
index 4387a60..f776164 100644
--- a/includes/AjaxFunctions.php
+++ b/includes/AjaxFunctions.php
@@ -47,7 +47,7 @@ function js_unescape($source, $iconv_to = 'UTF-8') {
if ($iconv_to != "UTF-8") {
$decodedStr = iconv("UTF-8", $iconv_to, $decodedStr);
}
-
+
return $decodedStr;
}
@@ -70,18 +70,29 @@ function code2utf($num){
return '';
}
+// WERELATE - added setting and writing contentType
+
class AjaxCachePolicy {
var $policy;
+ var $contentType;
function AjaxCachePolicy( $policy = null ) {
$this->policy = $policy;
+ $this->contentType = 'text/xml';
}
function setPolicy( $policy ) {
$this->policy = $policy;
}
+ // WERELATE
+ function setContentType($contentType) {
+ $this->contentType = $contentType;
+ }
+
function writeHeader() {
+ // WERELATE
+ header( "Content-Type: {$this->contentType}; charset=utf-8", true );
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
if ( is_null( $this->policy ) ) {
// Bust cache in the head
@@ -95,15 +106,15 @@ class AjaxCachePolicy {
}
}
}
-
+
function wfSajaxSearch( $term ) {
global $wgContLang, $wgAjaxCachePolicy, $wgOut;
$limit = 16;
-
+
$l = new Linker;
- $term = str_replace( ' ', '_', $wgContLang->ucfirst(
+ $term = str_replace( ' ', '_', $wgContLang->ucfirst(
$wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) )
) );
@@ -140,7 +151,7 @@ function wfSajaxSearch( $term ) {
$subtitle = $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) );
$term = htmlspecialchars( $term );
- return '<div style="float:right; border:solid 1px black;background:gainsboro;padding:2px;"><a onclick="Searching_Hide_Results();">'
+ return '<div style="float:right; border:solid 1px black;background:gainsboro;padding:2px;"><a onclick="Searching_Hide_Results();">'
. wfMsg( 'hideresults' ) . '</a></div>'
. '<h1 class="firstHeading">'.wfMsg('search')
. '</h1><div id="contentSub">'. $subtitle . '</div><ul><li>'
diff --git a/includes/Article.php b/includes/Article.php
index b1e1f62..7d285c9 100644
--- a/includes/Article.php
+++ b/includes/Article.php
@@ -41,6 +41,8 @@ class Article {
var $mTouched; //!<
var $mUser; //!<
var $mUserText; //!<
+// WERELATE - added
+ var $mRevIdEdited;
/**@}}*/
/**
@@ -53,7 +55,7 @@ class Article {
$this->mOldId = $oldId;
$this->clear();
}
-
+
/**
* Tell the page view functions that this view was redirected
* from another page on the wiki.
@@ -62,14 +64,14 @@ class Article {
function setRedirectedFrom( $from ) {
$this->mRedirectedFrom = $from;
}
-
+
/**
* @return mixed false, Title of in-wiki target, or string with URL
*/
function followRedirect() {
$text = $this->getContent();
$rt = Title::newFromRedirect( $text );
-
+
# process if title object is valid and not special:userlogout
if( $rt ) {
if( $rt->getInterwiki() != '' ) {
@@ -78,7 +80,7 @@ class Article {
//
// This can be hard to reverse and may produce loops,
// so they may be disabled in the site configuration.
-
+
$source = $this->mTitle->getFullURL( 'redirect=no' );
return $rt->getFullURL( 'rdfrom=' . urlencode( $source ) );
}
@@ -89,7 +91,7 @@ class Article {
// the rest of the page we're on.
//
// This can be hard to reverse, so they may be disabled.
-
+
if( $rt->getNamespace() == NS_SPECIAL && $rt->getText() == 'Userlogout' ) {
// rolleyes
} else {
@@ -99,7 +101,7 @@ class Article {
return $rt;
}
}
-
+
// No or invalid redirect
return false;
}
@@ -128,6 +130,8 @@ class Article {
$this->mForUpdate = false;
$this->mIsRedirect = false;
$this->mRevIdFetched = 0;
+// WERELATE - added
+ $this->mRevIdEdited = 0;
$this->mRedirectUrl = false;
$this->mLatest = false;
}
@@ -155,7 +159,11 @@ class Article {
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
$ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
} else {
- $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+// WERELATE - added namespace check
+ $ret = wfmsg('noarticletext' . $this->mTitle->getNamespace());
+ if (strpos($ret, 'noarticletext') !== false) {
+ $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+ }
}
return "<div class='noarticletext'>$ret</div>";
@@ -307,7 +315,7 @@ class Article {
$dbr =& $this->getDB();
$data = $this->pageDataFromId( $dbr, $this->getId() );
}
-
+
$lc =& LinkCache::singleton();
if ( $data ) {
$lc->addGoodLinkObj( $data->page_id, $this->mTitle );
@@ -624,7 +632,7 @@ class Article {
$parserCache =& ParserCache::singleton();
$ns = $this->mTitle->getNamespace(); # shortcut
-
+
# Get variables from query string
$oldid = $this->getOldID();
@@ -666,11 +674,12 @@ class Article {
wfProfileOut( __METHOD__ );
return;
}
-
+
if ( empty( $oldid ) && $this->checkTouched() ) {
$wgOut->setETag($parserCache->getETag($this, $wgUser));
-
if( $wgOut->checkLastModified( $this->mTouched ) ){
+ // WERELATE: add viewUpdates call just in case
+ $this->viewUpdates();
wfProfileOut( __METHOD__ );
return;
} else if ( $this->tryFileCache() ) {
@@ -715,7 +724,7 @@ class Article {
$wasRedirected = true;
}
}
-
+
$outputDone = false;
if ( $pcache ) {
if ( $wgOut->tryParserCache( $this, $wgUser ) ) {
@@ -885,7 +894,8 @@ class Article {
return;
}
- if ((!$wgUser->isAllowed('delete'))) {
+// WERELATE: added title parm
+ if ((!$wgUser->isAllowed('delete', $wgTitle))) {
$wgOut->sysopRequired();
return;
}
@@ -932,7 +942,7 @@ class Article {
$wgOut->addHTML( $msg );
}
}
-
+
/**
* Perform the actions of a page purging
*/
@@ -1066,7 +1076,7 @@ class Article {
*/
function replaceSection($section, $text, $summary = '', $edittime = NULL) {
wfProfileIn( __METHOD__ );
-
+
if( $section == '' ) {
// Whole-page edit; let the text through unmolested.
} else {
@@ -1099,7 +1109,8 @@ class Article {
/**
* @deprecated use Article::doEdit()
*/
- function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
+ function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false, $showRedir=true ) {
+// WERELATE: added $showRedir parameter
$flags = EDIT_NEW | EDIT_DEFER_UPDATES |
( $isminor ? EDIT_MINOR : 0 ) |
( $suppressRC ? EDIT_SUPPRESS_RC : 0 );
@@ -1108,52 +1119,63 @@ class Article {
if ( $comment && $summary != "" ) {
$text = "== {$summary} ==\n\n".$text;
}
-
+
$this->doEdit( $text, $summary, $flags );
- $dbw =& wfGetDB( DB_MASTER );
- if ($watchthis) {
- if (!$this->mTitle->userIsWatching()) {
- $dbw->begin();
- $this->doWatch();
- $dbw->commit();
- }
- } else {
- if ( $this->mTitle->userIsWatching() ) {
- $dbw->begin();
- $this->doUnwatch();
- $dbw->commit();
- }
+// WERELATE: don't watch redirs
+ $isRedir = $this->isRedirect( $text );
+ if (!$isRedir) {
+ $dbw =& wfGetDB( DB_MASTER );
+ if ($watchthis) {
+ if (!$this->mTitle->userIsWatching()) {
+ $dbw->begin();
+// WERELATE - pass text to doWatch
+ $this->doWatch(true, $text);
+ $dbw->commit();
+ }
+ } else {
+ if ( $this->mTitle->userIsWatching() ) {
+ $dbw->begin();
+ $this->doUnwatch(true);
+ $dbw->commit();
+ }
+ }
+ }
+ if ($showRedir) {
+ $this->doRedirect( $isRedir );
}
- $this->doRedirect( $this->isRedirect( $text ) );
}
/**
* @deprecated use Article::doEdit()
*/
- function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
+ function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
$flags = EDIT_UPDATE | EDIT_DEFER_UPDATES |
( $minor ? EDIT_MINOR : 0 ) |
( $forceBot ? EDIT_FORCE_BOT : 0 );
-
$good = $this->doEdit( $text, $summary, $flags );
if ( $good ) {
- $dbw =& wfGetDB( DB_MASTER );
- if ($watchthis) {
- if (!$this->mTitle->userIsWatching()) {
- $dbw->begin();
- $this->doWatch();
- $dbw->commit();
- }
- } else {
- if ( $this->mTitle->userIsWatching() ) {
- $dbw->begin();
- $this->doUnwatch();
- $dbw->commit();
- }
- }
-
- $this->doRedirect( $this->isRedirect( $text ), $sectionanchor );
+// WERELATE: don't watch redirs
+ $isRedir = $this->isRedirect( $text );
+ if (!$isRedir) {
+ $dbw =& wfGetDB( DB_MASTER );
+ if ($watchthis) {
+ if (!$this->mTitle->userIsWatching()) {
+ $dbw->begin();
+// WERELATE - pass text to doWatch
+ $this->doWatch(true, $text);
+ $dbw->commit();
+ }
+ } else {
+ if ( $this->mTitle->userIsWatching() ) {
+ $dbw->begin();
+ $this->doUnwatch(true);
+ $dbw->commit();
+ }
+ }
+ }
+
+ $this->doRedirect( $isRedir, $sectionanchor );
}
return $good;
}
@@ -1161,7 +1183,7 @@ class Article {
/**
* Article::doEdit()
*
- * Change an existing article or create a new article. Updates RC and all necessary caches,
+ * Change an existing article or create a new article. Updates RC and all necessary caches,
* optionally via the deferred update array.
*
* $wgUser must be set before calling this function.
@@ -1181,9 +1203,9 @@ class Article {
* Mark the edit a "bot" edit regardless of user rights
* EDIT_DEFER_UPDATES
* Defer some of the updates until the end of index.php
- *
- * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected.
- * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If
+ *
+ * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected.
+ * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If
* EDIT_NEW is specified and the article does exist, a duplicate key error will cause an exception
* to be thrown from the Database. These two conditions are also possible with auto-detection due
* to MediaWiki's performance-optimised locking strategy.
@@ -1192,7 +1214,6 @@ class Article {
*/
function doEdit( $text, $summary, $flags = 0 ) {
global $wgUser, $wgDBtransactions;
-
wfProfileIn( __METHOD__ );
$good = true;
@@ -1204,10 +1225,9 @@ class Article {
$flags |= EDIT_NEW;
}
}
-
if( !wfRunHooks( 'ArticleSave', array( &$this, &$wgUser, &$text,
&$summary, $flags & EDIT_MINOR,
- null, null, &$flags ) ) )
+ null, null, &$flags ) ) )
{
wfDebug( __METHOD__ . ": ArticleSave hook aborted save!\n" );
wfProfileOut( __METHOD__ );
@@ -1222,7 +1242,7 @@ class Article {
$dbw =& wfGetDB( DB_MASTER );
$now = wfTimestampNow();
-
+
if ( $flags & EDIT_UPDATE ) {
# Update article, but only if changed.
@@ -1251,7 +1271,7 @@ class Article {
wfProfileOut( __METHOD__ );
return false;
}
-
+
$revision = new Revision( array(
'page' => $this->getId(),
'comment' => $summary,
@@ -1274,8 +1294,8 @@ class Article {
if( !( $flags & EDIT_SUPPRESS_RC ) ) {
$rcid = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
$lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
- $revisionId );
-
+ $revisionId);
+
# Mark as patrolled if the user can do so and has it set in their options
if( $wgUser->isAllowed( 'patrol' ) && $wgUser->getOption( 'autopatrol' ) ) {
RecentChange::markPatrolled( $rcid );
@@ -1296,19 +1316,19 @@ class Article {
}
if ( $good ) {
- # Invalidate cache of this article and all pages using this article
+ # Invalidate cache of this article and all pages using this article
# as a template. Partly deferred.
Article::onArticleEdit( $this->mTitle );
-
+
# Update links tables, site stats, etc.
$changed = ( strcmp( $oldtext, $text ) != 0 );
$this->editUpdates( $text, $summary, $isminor, $now, $revisionId, $changed );
}
} else {
# Create new article
-
+
# Set statistics members
- # We work out if it's countable after PST to avoid counter drift
+ # We work out if it's countable after PST to avoid counter drift
# when articles are created with {{subst:}}
$this->mGoodAdjustment = (int)$this->isCountable( $text );
$this->mTotalAdjustment = 1;
@@ -1357,12 +1377,16 @@ class Article {
if ( $good && !( $flags & EDIT_DEFER_UPDATES ) ) {
wfDoUpdates();
}
+// WERELATE - added
+ if ($good) {
+ $this->mRevIdEdited = $revisionId;
+ }
wfRunHooks( 'ArticleSaveComplete',
array( &$this, &$wgUser, $text,
$summary, $flags & EDIT_MINOR,
null, null, &$flags ) );
-
+
wfProfileOut( __METHOD__ );
return $good;
}
@@ -1390,7 +1414,7 @@ class Article {
}
$wgOut->redirect( $this->mTitle->getFullURL( $query ) . $sectionAnchor );
}
-
+
/**
* Mark this particular edit as patrolled
*/
@@ -1403,13 +1427,13 @@ class Article {
$wgOut->errorPage( 'rcpatroldisabled', 'rcpatroldisabledtext' );
return;
}
-
+
# Check permissions
if( !$wgUser->isAllowed( 'patrol' ) ) {
$wgOut->permissionRequired( 'patrol' );
return;
}
-
+
$rcid = $wgRequest->getVal( 'rcid' );
if ( !is_null ( $rcid ) ) {
if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, false ) ) ) {
@@ -1442,36 +1466,42 @@ class Article {
$wgOut->readOnlyPage();
return;
}
-
+
if( $this->doWatch() ) {
- $wgOut->setPagetitle( wfMsg( 'addedwatch' ) );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
+// WERELATE
+ $wgOut->redirect( $this->mTitle->getLocalURL('msg=watched') );
+ return;
- $link = $this->mTitle->getPrefixedText();
- $text = wfMsg( 'addedwatchtext', $link );
- $wgOut->addWikiText( $text );
+// $wgOut->setPagetitle( wfMsg( 'addedwatch' ) );
+// $wgOut->setRobotpolicy( 'noindex,nofollow' );
+//
+// $link = $this->mTitle->getPrefixedText();
+// $text = wfMsg( 'addedwatchtext', $link );
+// $wgOut->addWikiText( $text );
}
$wgOut->returnToMain( true, $this->mTitle->getPrefixedText() );
}
-
+
/**
* Add this page to $wgUser's watchlist
+ * @param bool $newRevision if called while creating/updating the article
* @return bool true on successful watch operation
*/
- function doWatch() {
+ function doWatch($newRevision = false, $newText = null) {
+//WERELATE - add newText parameter to this function and to WatchArticle hook
global $wgUser;
if( $wgUser->isAnon() ) {
return false;
}
-
- if (wfRunHooks('WatchArticle', array(&$wgUser, &$this))) {
+
+ if (wfRunHooks('WatchArticle', array(&$wgUser, &$this, $newText))) {
$wgUser->addWatch( $this->mTitle );
$wgUser->saveSettings();
- return wfRunHooks('WatchArticleComplete', array(&$wgUser, &$this));
+ return wfRunHooks('WatchArticleComplete', array(&$wgUser, &$this, $newRevision));
}
-
+
return false;
}
@@ -1490,24 +1520,29 @@ class Article {
$wgOut->readOnlyPage();
return;
}
-
+
if( $this->doUnwatch() ) {
- $wgOut->setPagetitle( wfMsg( 'removedwatch' ) );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
+// WERELATE
+ $wgOut->redirect( $this->mTitle->getLocalURL('msg=unwatched') );
+ return;
- $link = $this->mTitle->getPrefixedText();
- $text = wfMsg( 'removedwatchtext', $link );
- $wgOut->addWikiText( $text );
+// $wgOut->setPagetitle( wfMsg( 'removedwatch' ) );
+// $wgOut->setRobotpolicy( 'noindex,nofollow' );
+//
+// $link = $this->mTitle->getPrefixedText();
+// $text = wfMsg( 'removedwatchtext', $link );
+// $wgOut->addWikiText( $text );
}
$wgOut->returnToMain( true, $this->mTitle->getPrefixedText() );
}
-
+
/**
* Stop watching a page
+ * @param bool $newRevision if called while creating/updating the article
* @return bool true on successful unwatch
*/
- function doUnwatch() {
+ function doUnwatch($newRevision = false) {
global $wgUser;
if( $wgUser->isAnon() ) {
return false;
@@ -1517,9 +1552,9 @@ class Article {
$wgUser->removeWatch( $this->mTitle );
$wgUser->saveSettings();
- return wfRunHooks('UnwatchArticleComplete', array(&$wgUser, &$this));
+ return wfRunHooks('UnwatchArticleComplete', array(&$wgUser, &$this, $newRevision));
}
-
+
return false;
}
@@ -1548,7 +1583,7 @@ class Article {
*/
function updateRestrictions( $limit = array(), $reason = '' ) {
global $wgUser, $wgRestrictionTypes, $wgContLang;
-
+
$id = $this->mTitle->getArticleID();
if( !$wgUser->isAllowed( 'protect' ) || wfReadOnly() || $id == 0 ) {
return false;
@@ -1562,16 +1597,16 @@ class Article {
$current = Article::flattenRestrictions( $current );
$updated = Article::flattenRestrictions( $limit );
-
+
$changed = ( $current != $updated );
$protect = ( $updated != '' );
-
+
# If nothing's changed, do nothing
if( $changed ) {
if( wfRunHooks( 'ArticleProtect', array( &$this, &$wgUser, $limit, $reason ) ) ) {
$dbw =& wfGetDB( DB_MASTER );
-
+
# Prepare a null revision to be added to the history
$comment = $wgContLang->ucfirst( wfMsgForContent( $protect ? 'protectedarticle' : 'unprotectedarticle', $this->mTitle->getPrefixedText() ) );
if( $reason )
@@ -1580,7 +1615,7 @@ class Article {
$comment .= " [$updated]";
$nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true );
$nullRevId = $nullRevision->insertOn( $dbw );
-
+
# Update page record
$dbw->update( 'page',
array( /* SET */
@@ -1592,7 +1627,7 @@ class Article {
), 'Article::protect'
);
wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) );
-
+
# Update the protection log
$log = new LogPage( 'protect' );
if( $protect ) {
@@ -1600,10 +1635,10 @@ class Article {
} else {
$log->addEntry( 'unprotect', $this->mTitle, $reason );
}
-
+
} # End hook
} # End "changed" check
-
+
return true;
}
@@ -1640,7 +1675,8 @@ class Article {
# This code desperately needs to be totally rewritten
# Check permissions
- if( $wgUser->isAllowed( 'delete' ) ) {
+// WERELATE: added title parm
+ if( $wgUser->isAllowed( 'delete', $this->mTitle ) ) {
if( $wgUser->isBlocked() ) {
$wgOut->blockedPage();
return;
@@ -1656,7 +1692,7 @@ class Article {
}
$wgOut->setPagetitle( wfMsg( 'confirmdelete' ) );
-
+
# Better double-check that it hasn't been deleted yet!
$dbw =& wfGetDB( DB_MASTER );
$conds = $this->mTitle->pageCond();
@@ -1675,7 +1711,7 @@ class Article {
# and insert a warning if it does
$maxRevisions = 20;
$authors = $this->getLastNAuthors( $maxRevisions, $latest );
-
+
if( count( $authors ) > 1 && !$confirm ) {
$skin=$wgUser->getSkin();
$wgOut->addHTML( '<strong>' . wfMsg( 'historywarning' ) . ' ' . $skin->historyLink() . '</strong>' );
@@ -1788,7 +1824,7 @@ class Article {
wfProfileOut( __METHOD__ );
return $authors;
}
-
+
/**
* Output deletion confirmation dialog
*/
@@ -1864,7 +1900,7 @@ class Article {
* Deletes the article with database consistency, writes logs, purges caches
* Returns success
*/
- function doDeleteArticle( $reason ) {
+ function doDeleteArticle( $reason, $rc = true ) {
global $wgUseSquid, $wgDeferredUpdateList;
global $wgPostCommitUpdateList, $wgUseTrackbacks;
@@ -1919,6 +1955,17 @@ class Article {
# Clean up recentchanges entries...
$dbw->delete( 'recentchanges', array( 'rc_namespace' => $ns, 'rc_title' => $t ), __METHOD__ );
+// WERELATE: remove from watchlists on delete
+ if (Namespac::isMain($ns)) {
+ $rows = $dbw->select(array('watchlist', 'user'), array('user_name'), array('wl_user=user_id', 'wl_namespace' => $ns, 'wl_title' => $t));
+ while ($row = $dbw->fetchObject($rows)) {
+ $user = User::newFromName($row->user_name, false);
+ $wl = WatchedItem::fromUserTitle( $user, $this->mTitle );
+ $wl->removeWatch();
+ }
+ $dbw->freeResult($rows);
+ }
+
# Finally, clean up the link tables
$t = $this->mTitle->getPrefixedDBkey();
@@ -1934,8 +1981,9 @@ class Article {
$dbw->delete( 'langlinks', array( 'll_from' => $id ) );
# Log the deletion
- $log = new LogPage( 'delete' );
- $log->addEntry( 'delete', $this->mTitle, $reason );
+ $log = new LogPage( 'delete', $rc );
+ // WERELATE - add id as a log param
+ $log->addEntry( 'delete', $this->mTitle, $reason, array($id) );
# Clear the cached article id so the interface doesn't act like we exist
$this->mTitle->resetArticleID( 0 );
@@ -2054,6 +2102,9 @@ class Article {
$this->updateArticle( $target->getText(), $newComment, 1, $this->mTitle->userIsWatching(), $bot );
+ //WERELATE - added hook for rollback
+ wfRunHooks('ArticleRollbackComplete', array(&$this, &$wgUser));
+
$wgOut->returnToMain( false );
}
@@ -2083,7 +2134,7 @@ class Article {
* Do standard deferred updates after page edit.
* Update links tables, site stats, search index and message cache.
* Every 1000th edit, prune the recent changes table.
- *
+ *
* @private
* @param $text New text of the article
* @param $summary Edit summary
@@ -2112,14 +2163,15 @@ class Article {
if ( wfRunHooks( 'ArticleEditUpdatesDeleteFromRecentchanges', array( &$this ) ) ) {
wfSeedRandom();
- if ( 0 == mt_rand( 0, 999 ) ) {
+// WERELATE 999 -> 49; limit deletions to 250
+ if ( 0 == mt_rand( 0, 49 ) ) {
# Periodically flush old entries from the recentchanges table.
global $wgRCMaxAge;
$dbw =& wfGetDB( DB_MASTER );
$cutoff = $dbw->timestamp( time() - $wgRCMaxAge );
$recentchanges = $dbw->tableName( 'recentchanges' );
- $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}'";
+ $sql = "DELETE FROM $recentchanges WHERE rc_timestamp < '{$cutoff}' LIMIT 250";
$dbw->query( $sql );
}
}
@@ -2195,10 +2247,10 @@ class Article {
$nextdiff = $current
? wfMsg( 'diff' )
: $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid );
-
+
$userlinks = $sk->userLink( $revision->getUser(), $revision->getUserText() )
. $sk->userToolLinks( $revision->getUser(), $revision->getUserText() );
-
+
$r = wfMsg( 'old-revision-navigation', $td, $lnk, $prevlink, $nextlink, $userlinks, $prevdiff, $nextdiff );
$wgOut->setSubtitle( $r );
}
@@ -2415,7 +2467,7 @@ class Article {
$title->touchLinks();
$title->purgeSquid();
-
+
# File cache
if ( $wgUseFileCache ) {
$cm = new CacheManager( $title );
diff --git a/includes/ChangesList.php b/includes/ChangesList.php
index b2c1abe..f5ee823 100644
--- a/includes/ChangesList.php
+++ b/includes/ChangesList.php
@@ -141,8 +141,7 @@ class ChangesList {
$logname = LogPage::logName( $logtype );
$s .= '(' . $this->skin->makeKnownLinkObj($title, $logname ) . ')';
}
-
-
+
function insertDiffHist(&$s, &$rc, $unpatrolled) {
# Diff link
if( $rc->mAttribs['rc_type'] == RC_NEW || $rc->mAttribs['rc_type'] == RC_LOG ) {
@@ -245,6 +244,11 @@ class OldChangesList extends ChangesList {
// moved pages
if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$this->insertMove( $s, $rc );
+ // WERELATE - add ReviewMerge entries
+ } elseif( $rc_namespace == NS_SPECIAL && strpos($rc_title, 'ReviewMerge/') === 0) {
+ $s .= '(' . $this->skin->makeKnownLinkObj($rc->getTitle(), 'review', $unpatrolled ? wfArrayToCGI(array('rcid' => $rc_id)) : array()) . ')';
+ $s .= ' . . ' . $this->recentChangesFlags(false, $rc_minor, $unpatrolled, '', $rc_bot );
+ $this->insertArticleLink($s, $rc, $unpatrolled, $watched);
// log entries
} elseif( $rc_namespace == NS_SPECIAL && preg_match( '!^Log/(.*)$!', $rc_title, $matches ) ) {
$this->insertLog($s, $rc->getTitle(), $matches[1]);
diff --git a/includes/CoreParserFunctions.php b/includes/CoreParserFunctions.php
index d6578ab..4ef95e2 100644
--- a/includes/CoreParserFunctions.php
+++ b/includes/CoreParserFunctions.php
@@ -13,7 +13,7 @@ class CoreParserFunctions {
$found = true;
} else {
$param = str_replace( ' ', '_', strtolower( $part1 ) );
- $index = Namespace::getCanonicalIndex( strtolower( $param ) );
+ $index = Namespac::getCanonicalIndex( strtolower( $param ) );
if ( !is_null( $index ) ) {
$text = $wgContLang->getNsText( $index );
$found = true;
diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php
index 741b719..c3b9c60 100644
--- a/includes/DifferenceEngine.php
+++ b/includes/DifferenceEngine.php
@@ -1683,8 +1683,18 @@ class TableDiffFormatter extends DiffFormatter
function _lines( $lines, $prefix=' ', $color='white' ) {
}
+// WERELATE: new addHeaderLink function
+ function addHeaderLink(&$line) {
+ $matches = array();
+ if (preg_match('/^ *([=]{1,6})(.*?)(\\1) *$/', $line, $matches)) {
+ $line = $matches[1].'<a href="#' . Sanitizer::escapeId(trim(preg_replace('/<.*?>/', '', $matches[2]))) . '">' . $matches[2] . '</a>'.$matches[1];
+ }
+ }
+
# HTML-escape parameter before calling this
function addedLine( $line ) {
+// WERELATE: add link to header
+ $this->addHeaderLink($line);
return "<td>+</td><td class='diff-addedline'>{$line}</td>";
}
@@ -1694,7 +1704,9 @@ class TableDiffFormatter extends DiffFormatter
}
# HTML-escape parameter before calling this
- function contextLine( $line ) {
+ function contextLine( $line, $isRight ) {
+// WERELATE: add link to header
+ $this->addHeaderLink($line);
return "<td> </td><td class='diff-context'>{$line}</td>";
}
@@ -1718,9 +1730,10 @@ class TableDiffFormatter extends DiffFormatter
function _context( $lines ) {
foreach ($lines as $line) {
+// WERELATE: distinguish left from right context
echo '<tr>' .
- $this->contextLine( htmlspecialchars ( $line ) ) .
- $this->contextLine( htmlspecialchars ( $line ) ) . "</tr>\n";
+ $this->contextLine( htmlspecialchars ( $line ), false ) .
+ $this->contextLine( htmlspecialchars ( $line ), true ) . "</tr>\n";
}
}
diff --git a/includes/EditPage.php b/includes/EditPage.php
index d43a120..fd2bdd2 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -39,6 +39,8 @@ class EditPage {
var $textbox1 = '', $textbox2 = '', $summary = '';
var $edittime = '', $section = '', $starttime = '';
var $oldid = 0, $editintro = '', $scrolltop = null;
+// WERELATE: added cmt
+ var $cmt = '';
/**
* @todo document
@@ -49,7 +51,7 @@ class EditPage {
global $wgTitle;
$this->mTitle =& $wgTitle;
}
-
+
/**
* Fetch initial editing page content.
*/
@@ -59,6 +61,8 @@ class EditPage {
# Get variables from query string :P
$section = $wgRequest->getVal( 'section' );
$preload = $wgRequest->getVal( 'preload' );
+//WERELATE: added cmt
+ $cmt = $wgRequest->getVal( 'cmt' );
wfProfileIn( __METHOD__ );
@@ -77,18 +81,19 @@ class EditPage {
// fetch the page record from the high-priority server,
// which is needed to guarantee we don't pick up lagged
// information.
-
+
$text = $this->mArticle->getContent();
-
+
if( $section != '' ) {
- if( $section == 'new' ) {
+// WERELATE: added cmt
+ if( $section == 'new' || $cmt == 'new') {
$text = $this->getPreloadedText( $preload );
} else {
$text = $wgParser->getSection( $text, $section );
}
}
}
-
+
wfProfileOut( __METHOD__ );
return $text;
}
@@ -100,8 +105,9 @@ class EditPage {
* @return string The contents of the page.
*/
private function getPreloadedText($preload) {
- if ( $preload === '' )
+ if ( $preload === '' ) {
return '';
+ }
else {
$preloadTitle = Title::newFromText( $preload );
if ( isset( $preloadTitle ) && $preloadTitle->userCanRead() ) {
@@ -354,6 +360,12 @@ class EditPage {
if( $this->mTitle->isTalkPage() ) {
$wgOut->addWikiText( wfMsg( 'talkpagetext' ) );
}
+// WERELATE - added
+ $editHelpText = wfmsg('edithelptext' . $this->mTitle->getNamespace());
+ if (strpos($editHelpText, 'edithelptext') !== false) {
+ $editHelpText = wfmsg('edithelptext');
+ }
+ $wgOut->addWikiText($editHelpText);
# Attempt submission here. This will check for edit conflicts,
# and redundantly check for locked database, blocked IPs, etc.
@@ -372,7 +384,7 @@ class EditPage {
# checking, etc.
if ( 'initial' == $this->formtype || $this->firsttime ) {
$this->initialiseForm();
- if( !$this->mTitle->getArticleId() )
+ if( !$this->mTitle->getArticleId() )
wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
}
@@ -389,7 +401,8 @@ class EditPage {
*/
function previewOnOpen() {
global $wgUser;
- return $this->section != 'new' &&
+// WERELATE: add cmt
+ return $this->section != 'new' && $this->cmt != 'new' &&
( ( $wgUser->getOption( 'previewonfirst' ) && $this->mTitle->exists() ) ||
( $this->mTitle->getNamespace() == NS_CATEGORY &&
!$this->mTitle->exists() ) );
@@ -432,7 +445,7 @@ class EditPage {
// Remember whether a save was requested, so we can indicate
// if we forced preview due to session failure.
$this->mTriedSave = !$this->preview;
-
+
if ( $this->tokenOk( $request ) ) {
# Some browsers will not report any submit button
# if the user hits enter in the comment box.
@@ -466,8 +479,8 @@ class EditPage {
} else {
$this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' );
}
-
- $this->autoSumm = $request->getText( 'wpAutoSummary' );
+
+ $this->autoSumm = $request->getText( 'wpAutoSummary' );
} else {
# Not a posted form? Start with nothing.
wfDebug( "$fname: Not a posted form.\n" );
@@ -489,10 +502,15 @@ class EditPage {
# Section edit can come from either the form or a link
$this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
+// WERELATE: add cmt
+ $this->cmt = $request->getVal( 'wpCmt', $request->getVal( 'cmt' ) );
$this->live = $request->getCheck( 'live' );
$this->editintro = $request->getText( 'editintro' );
+// WERELATE - added
+ wfRunHooks('ImportEditFormDataComplete', array(&$this, &$request));
+
wfProfileOut( $fname );
}
@@ -592,7 +610,7 @@ class EditPage {
wfProfileOut( $fname );
return true;
}
-
+
if ( !$wgUser->isAllowed('edit') ) {
if ( $wgUser->isAnon() ) {
$this->userNotLoggedInPage();
@@ -658,6 +676,15 @@ class EditPage {
}
$isComment=($this->section=='new');
+// WERELATE: update talk page section header / summary w today's date; add sig if there isn't one
+ if ($this->section == 'new') {
+ $this->updateSectionDate($this->summary, true);
+ }
+ else {
+ $this->updateSectionDate($this->textbox1, false);
+ }
+ $this->addSignature($this->textbox1);
+
$this->mArticle->insertNewArticle( $this->textbox1, $this->summary,
$this->minoredit, $this->watchthis, false, $isComment);
@@ -672,7 +699,8 @@ class EditPage {
if( $this->mArticle->getTimestamp() != $this->edittime ) {
$this->isConflict = true;
- if( $this->section == 'new' ) {
+// WERELATE: added cmt
+ if( $this->section == 'new' || $this->cmt == 'new') {
if( $this->mArticle->getUserText() == $wgUser->getName() &&
$this->mArticle->getComment() == $this->summary ) {
// Probably a duplicate submission of a new comment.
@@ -687,6 +715,25 @@ class EditPage {
}
}
$userid = $wgUser->getID();
+
+// WERELATE: cmt=new -> fill in textbox1 with full section + HR + new cmt
+ if ($this->section != '' && $this->section != 'new' && $this->cmt == 'new') {
+ if ( $this->textbox1 == '' ) {
+ $this->missingComment = true;
+ return true;
+ }
+ $rev = Revision::newFromTitle( $this->mTitle );
+ $this->textbox1 = $this->mArticle->getSection($rev->getText(), $this->section) . "\n\n----\n" . $this->textbox1;
+ }
+
+// WERELATE: update talk page section header / summary w today's date; add sig if there isn't one
+ if ($this->section == 'new') {
+ $this->updateSectionDate($this->summary, true);
+ }
+ else {
+ $this->updateSectionDate($this->textbox1, false);
+ }
+ $this->addSignature($this->textbox1);
if ( $this->isConflict) {
wfDebug( "EditPage::editForm conflict! getting section '$this->section' for time '$this->edittime' (article time '" .
@@ -717,6 +764,8 @@ class EditPage {
wfDebug( "Suppressing edit conflict, successful merge.\n" );
} else {
$this->section = '';
+// WERELATE - added cmt
+ $this->cmt = '';
$this->textbox1 = $text;
wfDebug( "Keeping edit conflict, failed merge.\n" );
}
@@ -748,7 +797,7 @@ class EditPage {
# All's well
wfProfileIn( "$fname-sectionanchor" );
$sectionanchor = '';
- if( $this->section == 'new' ) {
+ if( $this->section == 'new') {
if ( $this->textbox1 == '' ) {
$this->missingComment = true;
return true;
@@ -775,6 +824,8 @@ class EditPage {
// replace that into a duplicated mess.
$this->textbox1 = $text;
$this->section = '';
+// WERELATE: added cmt
+ $this->cmt = '';
// Check for length errors again now that the section is merged in
$this->kblength = (int)(strlen( $text ) / 1024);
@@ -844,12 +895,17 @@ class EditPage {
if( $this->section == 'new' ) {
$s = wfMsg('editingcomment', $this->mTitle->getPrefixedText() );
} else {
- $s = wfMsg('editingsection', $this->mTitle->getPrefixedText() );
+// WERELATE: distinguish section from topic
+ $s = wfMsg($this->mTitle->isTalkPage() ? 'editingtopic' : 'editingsection', $this->mTitle->getPrefixedText() );
if( !$this->preview && !$this->diff ) {
preg_match( "/^(=+)(.+)\\1/mi",
$this->textbox1,
$matches );
if( !empty( $matches[2] ) ) {
+// WERELATE: remove date from summary for topics
+ if ($this->mTitle->isTalkPage()) {
+ $matches[2] = preg_replace('/\[[^\]]+\] *$/', '', $matches[2]);
+ }
$this->summary = "/* ". trim($matches[2])." */ ";
}
}
@@ -862,11 +918,11 @@ class EditPage {
if ( $this->missingComment ) {
$wgOut->addWikiText( wfMsg( 'missingcommenttext' ) );
}
-
+
if( $this->missingSummary ) {
$wgOut->addWikiText( wfMsg( 'missingsummary' ) );
}
-
+
if( !$this->hookError == '' ) {
$wgOut->addWikiText( $this->hookError );
}
@@ -896,7 +952,7 @@ class EditPage {
}
}
}
-
+
if( $this->mTitle->isProtected( 'edit' ) ) {
# Is the protection due to the namespace, e.g. interface text?
if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
@@ -920,8 +976,6 @@ class EditPage {
}
if ( $this->tooBig || $this->kblength > $wgMaxArticleSize ) {
$wgOut->addWikiText( wfMsg( 'longpageerror', $wgLang->formatNum( $this->kblength ), $wgMaxArticleSize ) );
- } elseif( $this->kblength > 29 ) {
- $wgOut->addWikiText( wfMsg( 'longpagewarning', $wgLang->formatNum( $this->kblength ) ) );
}
$rows = $wgUser->getIntOption( 'rows' );
@@ -973,7 +1027,7 @@ class EditPage {
# Already watched
$this->watchthis = true;
}
-
+
if( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;
}
@@ -1016,7 +1070,8 @@ class EditPage {
# Otherwise, show a summary field at the bottom
$summarytext = htmlspecialchars( $wgContLang->recodeForEdit( $this->summary ) ); # FIXME
if( $this->section == 'new' ) {
- $commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}:</label></span>\n<div class='editOptions'>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
+// WERELATE - added extra br
+ $commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}:</label></span>\n<div class='editOptions'>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br /><br />";
$editsummary = '';
} else {
$commentsubject = '';
@@ -1025,7 +1080,8 @@ class EditPage {
# Set focus to the edit box on load, except on preview or diff, where it would interfere with the display
if( !$this->preview && !$this->diff ) {
- $wgOut->setOnloadHandler( 'document.editform.wpTextbox1.focus()' );
+// WERELATE - removed -- nothing can be in the onload handler because it might mess up JQuery
+// $wgOut->setOnloadHandler( 'document.editform.wpTextbox1.focus()' );
}
$templates = $this->formatTemplates();
@@ -1055,6 +1111,18 @@ class EditPage {
}
}
+// WERELATE - add script to protect leaving edited page
+ $wgOut->addScript(<<< END
+<script type="text/javascript">
+//<![CDATA[
+var needConfirm=(window.location.href.indexOf('&action=submit') > 0);
+$(document).ready(function() { $("#editform :input").change(function(){ needConfirm=true; })});
+window.onbeforeunload = function() { if (needConfirm) return "If you leave, any edits will be lost."; };
+//]]>
+</script>
+END
+);
+
$temp = array(
'id' => 'wpSave',
'name' => 'wpSave',
@@ -1063,6 +1131,7 @@ class EditPage {
'value' => wfMsg('savearticle'),
'accesskey' => wfMsg('accesskey-save'),
'title' => wfMsg('tooltip-save'),
+ 'onClick' => 'needConfirm=false', // WERELATE
);
$buttons['save'] = wfElement('input', $temp, '');
$temp = array(
@@ -1073,6 +1142,7 @@ class EditPage {
'value' => wfMsg('showdiff'),
'accesskey' => wfMsg('accesskey-diff'),
'title' => wfMsg('tooltip-diff'),
+ 'onClick' => 'needConfirm=false', // WERELATE
);
$buttons['diff'] = wfElement('input', $temp, '');
@@ -1087,6 +1157,7 @@ class EditPage {
'accesskey' => '',
'title' => wfMsg('tooltip-preview'),
'style' => 'display: none;',
+ 'onClick' => 'needConfirm=false', // WERELATE
);
$buttons['preview'] = wfElement('input', $temp, '');
$temp = array(
@@ -1097,7 +1168,7 @@ class EditPage {
'value' => wfMsg('showlivepreview'),
'accesskey' => wfMsg('accesskey-preview'),
'title' => '',
- 'onclick' => $this->doLivePreviewScript(),
+ 'onclick' => $this->doLivePreviewScript(). '; needConfirm=false', // WERELATE
);
$buttons['live'] = wfElement('input', $temp, '');
} else {
@@ -1109,6 +1180,7 @@ class EditPage {
'value' => wfMsg('showpreview'),
'accesskey' => wfMsg('accesskey-preview'),
'title' => wfMsg('tooltip-preview'),
+ 'onClick' => 'needConfirm=false', // WERELATE
);
$buttons['preview'] = wfElement('input', $temp, '');
$buttons['live'] = '';
@@ -1118,26 +1190,33 @@ class EditPage {
? ""
: "<input type='hidden' name=\"safemode\" value='1' />\n";
+// WERELATE - moved toolbar from here to below
$wgOut->addHTML( <<<END
-{$toolbar}
<form id="editform" name="editform" method="post" action="$action" enctype="multipart/form-data">
END
);
-
if( is_callable( $formCallback ) ) {
call_user_func_array( $formCallback, array( &$wgOut ) );
}
// Put these up at the top to ensure they aren't lost on early form submission
+// WERELATE - add cmt
$wgOut->addHTML( "
<input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\" name=\"wpSection\" />
+<input type='hidden' value=\"" . htmlspecialchars( $this->cmt ) . "\" name=\"wpCmt\" />
<input type='hidden' value=\"{$this->starttime}\" name=\"wpStarttime\" />\n
<input type='hidden' value=\"{$this->edittime}\" name=\"wpEdittime\" />\n
<input type='hidden' value=\"{$this->scrolltop}\" name=\"wpScrolltop\" id=\"wpScrolltop\" />\n" );
+// WERELATE - added wfRunHooks, moved {$toolbar} from above, added treecheckboxeshtml
+require_once("extensions/familytree/FamilyTreeUtil.php");
+$treecheckboxeshtml = FamilyTreeUtil::generateTreeCheckboxes($wgUser, $this->mTitle, true);
+ wfRunHooks('ArticleEditShow', array(&$this));
+
$wgOut->addHTML( <<<END
$recreate
{$commentsubject}
+{$toolbar}
<textarea tabindex='1' accesskey="," name="wpTextbox1" id="wpTextbox1" rows='{$rows}'
cols='{$cols}'{$ew} $hidden>
END
@@ -1151,6 +1230,7 @@ END
{$metadata}
{$editsummary}
{$checkboxhtml}
+{$treecheckboxeshtml}
{$safemodehtml}
");
@@ -1192,7 +1272,7 @@ END
if( $this->missingSummary ) {
$wgOut->addHTML( "<input type=\"hidden\" name=\"wpIgnoreBlankSummary\" value=\"1\" />\n" );
}
-
+
# For a bit more sophisticated detection of blank summaries, hash the
# automatic one and pass that in a hidden field.
$autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary );
@@ -1218,7 +1298,7 @@ END
} else {
$wgOut->addHTML( '<div id="wikiPreview"></div>' );
}
-
+
if ( $this->formtype == 'diff') {
$wgOut->addHTML( $this->getDiff() );
}
@@ -1367,7 +1447,7 @@ END
# don't parse user css/js, show message about preview
# XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
-
+
if ( $this->isCssJsSubpage ) {
if(preg_match("/\\.css$/", $wgTitle->getText() ) ) {
$previewtext = wfMsg('usercsspreview');
@@ -1393,12 +1473,18 @@ END
$toparse="== {$this->summary} ==\n\n".$toparse;
}
+// WERELATE - add signature, modify date in header
+ $this->updateSectionDate($toparse, false); // even if it's a new section, it looks like an existing section now
+ $this->addSignature($toparse);
+
if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
$parserOptions->setTidy(true);
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
$wgTitle, $parserOptions );
$previewHTML = $parserOutput->getText();
+// WERELATE - add call to hook
+ wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$previewHTML ) );
$wgOut->addParserOutputNoText( $parserOutput );
wfProfileOut( $fname );
@@ -1412,12 +1498,12 @@ END
function blockedPage() {
global $wgOut, $wgUser;
$wgOut->blockedPage( false ); # Standard block notice on the top, don't 'return'
-
+
# If the user made changes, preserve them when showing the markup
- # (This happens when a user is blocked during edit, for instance)
+ # (This happens when a user is blocked during edit, for instance)
$first = $this->firsttime || ( !$this->save && $this->textbox1 == '' );
$source = $first ? $this->getContent() : $this->textbox1;
-
+
# Spit out the source or the user's modified version
$rows = $wgUser->getOption( 'rows' );
$cols = $wgUser->getOption( 'cols' );
@@ -1433,14 +1519,14 @@ END
function userNotLoggedInPage() {
global $wgUser, $wgOut;
$skin = $wgUser->getSkin();
-
+
$loginTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
$loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() );
-
+
$wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false );
-
+
$wgOut->addHtml( wfMsgWikiHtml( 'whitelistedittext', $loginLink ) );
$wgOut->returnToMain( false, $this->mTitle->getPrefixedUrl() );
}
@@ -1456,7 +1542,7 @@ END
$wgOut->setPageTitle( wfMsg( 'confirmedittitle' ) );
$wgOut->setRobotPolicy( 'noindex,nofollow' );
$wgOut->setArticleRelated( false );
-
+
$wgOut->addWikiText( wfMsg( 'confirmedittext' ) );
$wgOut->returnToMain( false );
}
@@ -1476,7 +1562,7 @@ END
$wgOut->addWikiText( wfMsg( 'spamprotectiontext' ) );
if ( $match )
$wgOut->addWikiText( wfMsg( 'spamprotectionmatch', "<nowiki>{$match}</nowiki>" ) );
-
+
$wgOut->returnToMain( false );
}
@@ -1624,20 +1710,20 @@ END
'tip' => wfMsg('image_tip'),
'key' => 'D'
),
- array( 'image' =>'button_media.png',
- 'open' => '[['.$wgContLang->getNsText(NS_MEDIA).':',
- 'close' => ']]',
- 'sample'=> wfMsg('media_sample'),
- 'tip' => wfMsg('media_tip'),
- 'key' => 'M'
- ),
- array( 'image' =>'button_math.png',
- 'open' => "<math>",
- 'close' => "<\\/math>",
- 'sample'=> wfMsg('math_sample'),
- 'tip' => wfMsg('math_tip'),
- 'key' => 'C'
- ),
+// array( 'image' =>'button_media.png',
+// 'open' => '[['.$wgContLang->getNsText(NS_MEDIA).':',
+// 'close' => ']]',
+// 'sample'=> wfMsg('media_sample'),
+// 'tip' => wfMsg('media_tip'),
+// 'key' => 'M'
+// ),
+// array( 'image' =>'button_math.png',
+// 'open' => "<math>",
+// 'close' => "<\\/math>",
+// 'sample'=> wfMsg('math_sample'),
+// 'tip' => wfMsg('math_tip'),
+// 'key' => 'C'
+// ),
array( 'image' =>'button_nowiki.png',
'open' => "<nowiki>",
'close' => "<\\/nowiki>",
@@ -1859,6 +1945,27 @@ END
$wgOut->addWikiText( wfMsg( 'nocreatetext' ) );
}
+// WERELATE - added functions
+ function updateSectionDate(&$text, $updateSummary) {
+ if ($this->mTitle->isTalkPage() && $this->section != '') {
+ global $wgLang;
+ $date = $wgLang->date(wfTimestampNow(), true, false);
+ if ($updateSummary) { // can't use section == 'new' here because we call this from preview, which makes it look like an existing section
+ if (!preg_match('/\[.*?\] *$/', $text)) {
+ $text .= " [$date]";
+ }
+ }
+ else {
+ $text = preg_replace('/^ *([=]{1,6})(.*?) *(\[[^\[\]]*\]( *))?(\\1) *\\n/', "\\1\\2 [$date]\\4\\1\n", $text, 1);
+ }
+ }
+ }
+
+ function addSignature(&$text) {
+ if (($this->section == 'new' || $this->cmt == 'new') && mb_strpos($text, '~~~~') === false) {
+ $text .= '--~~~~';
+ }
+ }
}
?>
diff --git a/includes/Export.php b/includes/Export.php
index da92694..7dbc952 100644
--- a/includes/Export.php
+++ b/includes/Export.php
@@ -588,7 +588,7 @@ class DumpFilter {
*/
class DumpNotalkFilter extends DumpFilter {
function pass( $page ) {
- return !Namespace::isTalk( $page->page_namespace );
+ return !Namespac::isTalk( $page->page_namespace );
}
}
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 4daffaf..c00fbc1 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -64,7 +64,7 @@ function wfRunHooks($event, $args = null) {
if (count($hook) < 1) {
throw new MWException("Empty array in hooks for " . $event . "\n");
} else if (is_object($hook[0])) {
- $object =& $wgHooks[$event][$index][0];
+ $object = $wgHooks[$event][$index][0];
if (count($hook) < 2) {
$method = "on" . $event;
} else {
@@ -87,7 +87,7 @@ function wfRunHooks($event, $args = null) {
} else if (is_string($hook)) { # functions look like strings, too
$func = $hook;
} else if (is_object($hook)) {
- $object =& $wgHooks[$event][$index];
+ $object = $wgHooks[$event][$index];
$method = "on" . $event;
} else {
throw new MWException("Unknown datatype in hooks for " . $event . "\n");
@@ -109,7 +109,7 @@ function wfRunHooks($event, $args = null) {
/* Call the hook. */
wfProfileIn( $func );
if( isset( $object ) ) {
- $retval = call_user_func_array(array(&$object, $method), $hook_args);
+ $retval = call_user_func_array(array($object, $method), $hook_args);
} else {
$retval = call_user_func_array($func, $hook_args);
}
diff --git a/includes/Image.php b/includes/Image.php
index 185d732..46f8ba0 100644
--- a/includes/Image.php
+++ b/includes/Image.php
@@ -90,7 +90,7 @@ class Image
$this->dataLoaded = false;
}
-
+
/**
* Normalize a file extension to the common form, and ensure it's clean.
* Extensions with non-alphanumeric characters will be discarded.
@@ -113,7 +113,7 @@ class Image
return '';
}
}
-
+
/**
* Get the memcached keys
* Returns an array, first element is the local cache key, second is the shared cache key, if there is one
@@ -470,7 +470,7 @@ class Image
}
wfProfileOut( __METHOD__ );
}
-
+
/**
* Split an internet media type into its two components; if not
* a two-part name, set the minor type to 'unknown'.
@@ -784,7 +784,8 @@ class Image
* @todo document
* @private
*/
- function thumbUrl( $width, $subdir='thumb') {
+ function thumbUrl( $width, $subdir='thumb', $makeMapIcon=false) {
+ // WERELATE: makeMapIcon
global $wgUploadPath, $wgUploadBaseUrl, $wgSharedUploadPath;
global $wgSharedThumbnailScriptPath, $wgThumbnailScriptPath;
@@ -807,7 +808,8 @@ class Image
$url.= '&r=1';
}
} else {
- $name = $this->thumbName( $width );
+ // WERELATE: makeMapIcon
+ $name = $this->thumbName( $width, $makeMapIcon );
if($this->fromSharedDirectory) {
$base = '';
$path = $wgSharedUploadPath;
@@ -834,11 +836,13 @@ class Image
* @param boolean $shared Does the thumbnail come from the shared repository?
* @private
*/
- function thumbName( $width ) {
+ function thumbName( $width, $makeMapIcon=false ) {
+ // WERELATE: makeMapIcon
$thumb = $width."px-".$this->name;
- if( $this->mustRender() ) {
- if( $this->canRender() ) {
+ // WERELATE: makeMapIcon
+ if( $this->mustRender() && !$makeMapIcon) {
+ if( $this->canRender()) {
# Rasterize to PNG (for SVG vector images, etc)
$thumb .= '.png';
}
@@ -848,6 +852,10 @@ class Image
return NULL; //can't make bitmap
}
}
+ // WERELATE: makeMapIcon
+ if ($makeMapIcon) {
+ $thumb .= '-mapicon.gif';
+ }
return $thumb;
}
@@ -867,8 +875,9 @@ class Image
* @param integer $height maximum height of the image (optional)
* @public
*/
- function createThumb( $width, $height=-1 ) {
- $thumb = $this->getThumbnail( $width, $height );
+ function createThumb( $width, $height=-1, $makeMapIcon=false ) {
+ // WERELATE: makeMapIcon
+ $thumb = $this->getThumbnail( $width, $height, true, $makeMapIcon );
if( is_null( $thumb ) ) return '';
return $thumb->getUrl();
}
@@ -888,7 +897,8 @@ class Image
* @return ThumbnailImage or null on failure
* @public
*/
- function getThumbnail( $width, $height=-1, $render = true ) {
+ function getThumbnail( $width, $height=-1, $render = true, $makeMapIcon = false ) {
+ // WERELATE: makeMapIcon
wfProfileIn( __METHOD__ );
if ($this->canRender()) {
if ( $height > 0 ) {
@@ -898,14 +908,16 @@ class Image
}
}
if ( $render ) {
- $thumb = $this->renderThumb( $width );
+ // WERELATE: makeMapIcon
+ $thumb = $this->renderThumb( $width, true, $makeMapIcon );
} else {
// Don't render, just return the URL
if ( $this->validateThumbParams( $width, $height ) ) {
if ( !$this->mustRender() && $width == $this->width && $height == $this->height ) {
$url = $this->getURL();
} else {
- list( $isScriptUrl, $url ) = $this->thumbUrl( $width );
+ // WERELATE: makeMapIcon
+ list( $isScriptUrl, $url ) = $this->thumbUrl( $width, 'thumb', $makeMapIcon );
}
$thumb = new ThumbnailImage( $url, $width, $height );
} else {
@@ -942,11 +954,11 @@ class Image
*
* @param integer &$width Specified width (input/output)
* @param integer &$height Height (output only)
- * @return false to indicate that an error should be returned to the user.
+ * @return false to indicate that an error should be returned to the user.
*/
function validateThumbParams( &$width, &$height ) {
global $wgSVGMaxSize, $wgMaxImageArea;
-
+
$this->load();
if ( ! $this->exists() )
@@ -954,9 +966,9 @@ class Image
# If there is no image, there will be no thumbnail
return false;
}
-
+
$width = intval( $width );
-
+
# Sanity check $width
if( $width <= 0 || $this->width <= 0) {
# BZZZT
@@ -985,7 +997,7 @@ class Image
$height = round( $this->height * $width / $this->width );
return true;
}
-
+
/**
* Create a thumbnail of the image having the specified width.
* The thumbnail will not be created if the width is larger than the
@@ -998,7 +1010,8 @@ class Image
* @return ThumbnailImage or null on failure
* @private
*/
- function renderThumb( $width, $useScript = true ) {
+ function renderThumb( $width, $useScript = true, $makeMapIcon = false ) {
+ // WERELATE: makeMapIcon
global $wgUseSquid, $wgThumbnailEpoch;
wfProfileIn( __METHOD__ );
@@ -1011,14 +1024,16 @@ class Image
return null;
}
- if ( !$this->mustRender() && $width == $this->width && $height == $this->height ) {
+ // WERELATE: makeMapIcon
+ if ( !$this->mustRender() && $width == $this->width && $height == $this->height && !$makeMapIcon) {
# validateThumbParams (or the user) wants us to return the unscaled image
$thumb = new ThumbnailImage( $this->getURL(), $width, $height );
wfProfileOut( __METHOD__ );
return $thumb;
}
-
- list( $isScriptUrl, $url ) = $this->thumbUrl( $width );
+
+ // WERELATE: makeMapIcon
+ list( $isScriptUrl, $url ) = $this->thumbUrl( $width, 'thumb', $makeMapIcon );
if ( $isScriptUrl && $useScript ) {
// Use thumb.php to render the image
$thumb = new ThumbnailImage( $url, $width, $height );
@@ -1026,7 +1041,8 @@ class Image
return $thumb;
}
- $thumbName = $this->thumbName( $width, $this->fromSharedDirectory );
+ // WERELATE: makeMapIcon
+ $thumbName = $this->thumbName( $width, $makeMapIcon );
$thumbDir = wfImageThumbDir( $this->name, $this->fromSharedDirectory );
$thumbPath = $thumbDir.'/'.$thumbName;
@@ -1048,7 +1064,7 @@ class Image
$done = true;
if ( !file_exists( $thumbPath ) ||
- filemtime( $thumbPath ) < wfTimestamp( TS_UNIX, $wgThumbnailEpoch ) )
+ filemtime( $thumbPath ) < wfTimestamp( TS_UNIX, $wgThumbnailEpoch ) )
{
// Create the directory if it doesn't exist
if ( is_file( $thumbDir ) ) {
@@ -1056,7 +1072,7 @@ class Image
@unlink( $thumbDir );
}
wfMkdirParents( $thumbDir );
-
+
$oldThumbPath = wfDeprecatedThumbDir( $thumbName, 'thumb', $this->fromSharedDirectory ).
'/'.$thumbName;
$done = false;
@@ -1081,7 +1097,8 @@ class Image
}
}
if ( !$done ) {
- $this->lastError = $this->reallyRenderThumb( $thumbPath, $width, $height );
+ // WERELATE: makeMapIcon
+ $this->lastError = $this->reallyRenderThumb( $thumbPath, $width, $height, $makeMapIcon );
if ( $this->lastError === true ) {
$done = true;
} elseif( $GLOBALS['wgIgnoreImageErrors'] ) {
@@ -1119,7 +1136,8 @@ class Image
* @return bool True on error, false or error string on failure.
* @private
*/
- function reallyRenderThumb( $thumbPath, $width, $height ) {
+ function reallyRenderThumb( $thumbPath, $width, $height, $makeMapIcon=false ) {
+ // WERELATE: makeMapIcon
global $wgSVGConverters, $wgSVGConverter;
global $wgUseImageMagick, $wgImageMagickConvertCommand;
global $wgCustomConvertCommand;
@@ -1129,8 +1147,9 @@ class Image
$err = false;
$cmd = "";
$retval = 0;
-
- if( $this->mime === "image/svg" ) {
+
+ // WERELATE: makeMapIcon
+ if( $this->mime === "image/svg" && !$makeMapIcon) {
#Right now we have only SVG
global $wgSVGConverters, $wgSVGConverter;
@@ -1151,33 +1170,43 @@ class Image
}
} elseif ( $wgUseImageMagick ) {
# use ImageMagick
-
- if ( $this->mime == 'image/jpeg' ) {
- $quality = "-quality 80"; // 80%
- } elseif ( $this->mime == 'image/png' ) {
- $quality = "-quality 95"; // zlib 9, adaptive filtering
- } else {
- $quality = ''; // default
+ // WERELATE: makeMapIcon
+ if ($makeMapIcon) {
+ global $wrIconCircleFilePath, $wrIconMaskFilePath;
+ $cmd = wfEscapeShellArg($wgImageMagickConvertCommand) . ' ' .
+ wfEscapeShellArg($wrIconCircleFilePath) .
+ ' \( ' . wfEscapeShellArg($wrIconMaskFilePath) .
+ ' \( ' . wfEscapeShellArg($this->imagePath) . " -resize $width \) -compose src-atop -composite \) -compose dst-over -composite " .
+ wfEscapeShellArg($thumbPath) . ' 2>&1';
+ }
+ else {
+ if ( $this->mime == 'image/jpeg' ) {
+ $quality = "-quality 80"; // 80%
+ } elseif ( $this->mime == 'image/png' ) {
+ $quality = "-quality 95"; // zlib 9, adaptive filtering
+ } else {
+ $quality = ''; // default
+ }
+
+ # Specify white background color, will be used for transparent images
+ # in Internet Explorer/Windows instead of default black.
+
+ # Note, we specify "-size {$width}" and NOT "-size {$width}x{$height}".
+ # It seems that ImageMagick has a bug wherein it produces thumbnails of
+ # the wrong size in the second case.
+
+ $cmd = wfEscapeShellArg($wgImageMagickConvertCommand) .
+ " {$quality} -background white -size {$width} ".
+ wfEscapeShellArg($this->imagePath) .
+ // Coalesce is needed to scale animated GIFs properly (bug 1017).
+ ' -coalesce ' .
+ // For the -resize option a "!" is needed to force exact size,
+ // or ImageMagick may decide your ratio is wrong and slice off
+ // a pixel.
+ " -resize " . wfEscapeShellArg( "{$width}x{$height}!" ) .
+ " -depth 8 " .
+ wfEscapeShellArg($thumbPath) . " 2>&1";
}
-
- # Specify white background color, will be used for transparent images
- # in Internet Explorer/Windows instead of default black.
-
- # Note, we specify "-size {$width}" and NOT "-size {$width}x{$height}".
- # It seems that ImageMagick has a bug wherein it produces thumbnails of
- # the wrong size in the second case.
-
- $cmd = wfEscapeShellArg($wgImageMagickConvertCommand) .
- " {$quality} -background white -size {$width} ".
- wfEscapeShellArg($this->imagePath) .
- // Coalesce is needed to scale animated GIFs properly (bug 1017).
- ' -coalesce ' .
- // For the -resize option a "!" is needed to force exact size,
- // or ImageMagick may decide your ratio is wrong and slice off
- // a pixel.
- " -resize " . wfEscapeShellArg( "{$width}x{$height}!" ) .
- " -depth 8 " .
- wfEscapeShellArg($thumbPath) . " 2>&1";
wfDebug("reallyRenderThumb: running ImageMagick: $cmd\n");
wfProfileIn( 'convert' );
$err = wfShellExec( $cmd, $retval );
@@ -1324,7 +1353,8 @@ class Image
$urls = array();
foreach ( $files as $file ) {
if ( preg_match( '/^(\d+)px/', $file, $m ) ) {
- $urls[] = $this->thumbUrl( $m[1], $this->fromSharedDirectory );
+ $isMapIcon = preg_match('/-mapicon.gif$/', $file);
+ $urls[] = $this->thumbUrl( $m[1], $this->fromSharedDirectory, $isMapIcon );
@unlink( "$dir/$file" );
}
}
@@ -1338,7 +1368,7 @@ class Image
wfPurgeSquidServers( $urls );
}
}
-
+
/**
* Purge the image description page, but don't go after
* pages using the image. Use when modifying file history
@@ -1349,7 +1379,7 @@ class Image
$page->invalidateCache();
$page->purgeSquid();
}
-
+
/**
* Purge metadata and all affected pages when the image is created,
* deleted, or majorly updated. A set of additional URLs may be
@@ -1360,7 +1390,7 @@ class Image
// Delete thumbnails and refresh image metadata cache
$this->purgeCache();
$this->purgeDescription();
-
+
// Purge cache of all pages using this image
$update = new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' );
$update->doUpdate();
@@ -1377,9 +1407,9 @@ class Image
}
# new fields must exist
- #
- # Not really, there's hundreds of checks like this that we could do and they're all pointless, because
- # if the fields are missing, the database will loudly report a query error, the first time you try to do
+ #
+ # Not really, there's hundreds of checks like this that we could do and they're all pointless, because
+ # if the fields are missing, the database will loudly report a query error, the first time you try to do
# something. The only reason I put the above schema check in was because the absence of that particular
# index would lead to an annoying subtle bug. No error message, just some very odd behaviour on duplicate
# uploads. -- TS
@@ -1497,8 +1527,9 @@ class Image
/**
* Record an image upload in the upload log and the image table
*/
- function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '', $watch = false ) {
- global $wgUser, $wgUseCopyrightUpload;
+ function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '', $watch = false , $metadata = '', $redir = true) {
+// WERELATE - added $metadata paramter, redir parameter
+ global $wgUser, $wgUseCopyrightUpload;
$dbw =& wfGetDB( DB_MASTER );
@@ -1517,17 +1548,20 @@ class Image
if ( $license != '' ) {
$licensetxt = '== ' . wfMsgForContent( 'license' ) . " ==\n" . '{{' . $license . '}}' . "\n";
}
- $textdesc = '== ' . wfMsg ( 'filedesc' ) . " ==\n" . $desc . "\n" .
+// WERELATE - added $metadata paramter
+ $textdesc = $metadata . '== ' . wfMsg ( 'filedesc' ) . " ==\n" . $desc . "\n" .
'== ' . wfMsgForContent ( 'filestatus' ) . " ==\n" . $copyStatus . "\n" .
"$licensetxt" .
'== ' . wfMsgForContent ( 'filesource' ) . " ==\n" . $source ;
} else {
if ( $license != '' ) {
$filedesc = $desc == '' ? '' : '== ' . wfMsg ( 'filedesc' ) . " ==\n" . $desc . "\n";
- $textdesc = $filedesc .
+// WERELATE - added $metadata paramter
+ $textdesc = $metadata . $filedesc .
'== ' . wfMsgForContent ( 'license' ) . " ==\n" . '{{' . $license . '}}' . "\n";
} else {
- $textdesc = $desc;
+// WERELATE - added $metadata paramter
+ $textdesc = $metadata . $desc;
}
}
@@ -1626,7 +1660,8 @@ class Image
$descTitle->purgeSquid();
} else {
// New image; create the description page.
- $article->insertNewArticle( $textdesc, $desc, $minor, $watch, $suppressRC );
+// WERELATE: pass in redir parameter
+ $article->insertNewArticle( $textdesc, $desc, $minor, $watch, $suppressRC, false, $redir );
}
# Add the log entry
@@ -1680,7 +1715,7 @@ class Image
wfProfileOut( __METHOD__ );
return $retVal;
}
-
+
/**
* Retrive Exif data from the file and prune unrecognized tags
* and/or tags with invalid contents
@@ -1690,7 +1725,7 @@ class Image
*/
private function retrieveExifData( $filename ) {
global $wgShowEXIF;
-
+
/*
if ( $this->getMimeType() !== "image/jpeg" )
return array();
@@ -1700,7 +1735,7 @@ class Image
$exif = new Exif( $filename );
return $exif->getFilteredData();
}
-
+
return array();
}
@@ -1760,7 +1795,7 @@ class Image
function isLocal() {
return !$this->fromSharedDirectory;
}
-
+
/**
* Was this image ever deleted from the wiki?
*
@@ -1770,7 +1805,7 @@ class Image
$title = Title::makeTitle( NS_IMAGE, $this->name );
return ( $title->isDeleted() > 0 );
}
-
+
/**
* Delete all versions of the image.
*
@@ -1785,34 +1820,34 @@ class Image
function delete( $reason ) {
$transaction = new FSTransaction();
$urlArr = array( $this->getURL() );
-
+
if( !FileStore::lock() ) {
wfDebug( __METHOD__.": failed to acquire file store lock, aborting\n" );
return false;
}
-
+
try {
$dbw = wfGetDB( DB_MASTER );
$dbw->begin();
-
+
// Delete old versions
$result = $dbw->select( 'oldimage',
array( 'oi_archive_name' ),
array( 'oi_name' => $this->name ) );
-
+
while( $row = $dbw->fetchObject( $result ) ) {
$oldName = $row->oi_archive_name;
-
+
$transaction->add( $this->prepareDeleteOld( $oldName, $reason ) );
-
+
// We'll need to purge this URL from caches...
$urlArr[] = wfImageArchiveUrl( $oldName );
}
$dbw->freeResult( $result );
-
+
// And the current version...
$transaction->add( $this->prepareDeleteCurrent( $reason ) );
-
+
$dbw->immediateCommit();
} catch( MWException $e ) {
wfDebug( __METHOD__.": db error, rolling back file transactions\n" );
@@ -1820,22 +1855,22 @@ class Image
FileStore::unlock();
throw $e;
}
-
+
wfDebug( __METHOD__.": deleted db items, applying file transactions\n" );
$transaction->commit();
FileStore::unlock();
-
+
// Update site_stats
$site_stats = $dbw->tableName( 'site_stats' );
$dbw->query( "UPDATE $site_stats SET ss_images=ss_images-1", __METHOD__ );
-
+
$this->purgeEverything( $urlArr );
-
+
return true;
}
-
-
+
+
/**
* Delete an old version of the image.
*
@@ -1851,12 +1886,12 @@ class Image
function deleteOld( $archiveName, $reason ) {
$transaction = new FSTransaction();
$urlArr = array();
-
+
if( !FileStore::lock() ) {
wfDebug( __METHOD__.": failed to acquire file store lock, aborting\n" );
return false;
}
-
+
$transaction = new FSTransaction();
try {
$dbw = wfGetDB( DB_MASTER );
@@ -1869,11 +1904,11 @@ class Image
FileStore::unlock();
throw $e;
}
-
+
wfDebug( __METHOD__.": deleted db items, applying file transaction\n" );
$transaction->commit();
FileStore::unlock();
-
+
$this->purgeDescription();
// Squid purging
@@ -1886,7 +1921,7 @@ class Image
}
return true;
}
-
+
/**
* Delete the current version of a file.
* May throw a database error.
@@ -1960,12 +1995,12 @@ class Image
*/
private function prepareDeleteVersion( $path, $reason, $table, $fieldMap, $where, $fname ) {
global $wgUser, $wgSaveDeletedFiles;
-
+
// Dupe the file into the file store
if( file_exists( $path ) ) {
if( $wgSaveDeletedFiles ) {
$group = 'deleted';
-
+
$store = FileStore::get( $group );
$key = FileStore::calculateKey( $path, $this->extension );
$transaction = $store->insert( $key, $path,
@@ -1981,24 +2016,24 @@ class Image
$key = null;
$transaction = new FSTransaction(); // empty
}
-
+
if( $transaction === false ) {
// Fail to restore?
wfDebug( __METHOD__.": import to file store failed, aborting\n" );
throw new MWException( "Could not archive and delete file $path" );
return false;
}
-
+
$dbw = wfGetDB( DB_MASTER );
$storageMap = array(
'fa_storage_group' => $dbw->addQuotes( $group ),
'fa_storage_key' => $dbw->addQuotes( $key ),
-
+
'fa_deleted_user' => $dbw->addQuotes( $wgUser->getId() ),
'fa_deleted_timestamp' => $dbw->timestamp(),
'fa_deleted_reason' => $dbw->addQuotes( $reason ) );
$allFields = array_merge( $storageMap, $fieldMap );
-
+
try {
if( $wgSaveDeletedFiles ) {
$dbw->insertSelect( 'filearchive', $table, $allFields, $where, $fname );
@@ -2011,10 +2046,10 @@ class Image
$transaction->rollback();
throw $e;
}
-
+
return $transaction;
}
-
+
/**
* Restore all or specified deleted revisions to the given file.
* Permissions and logging are left to the caller.
@@ -2031,31 +2066,31 @@ class Image
wfDebug( __METHOD__." could not acquire filestore lock\n" );
return false;
}
-
+
$transaction = new FSTransaction();
try {
$dbw = wfGetDB( DB_MASTER );
$dbw->begin();
-
+
// Re-confirm whether this image presently exists;
// if no we'll need to create an image record for the
// first item we restore.
$exists = $dbw->selectField( 'image', '1',
array( 'img_name' => $this->name ),
__METHOD__ );
-
+
// Fetch all or selected archived revisions for the file,
// sorted from the most recent to the oldest.
$conditions = array( 'fa_name' => $this->name );
if( $versions ) {
$conditions['fa_id'] = $versions;
}
-
+
$result = $dbw->select( 'filearchive', '*',
$conditions,
__METHOD__,
array( 'ORDER BY' => 'fa_timestamp DESC' ) );
-
+
if( $dbw->numRows( $result ) < count( $versions ) ) {
// There's some kind of conflict or confusion;
// we can't restore everything we were asked to.
@@ -2072,7 +2107,7 @@ class Image
FileStore::unlock();
return true;
}
-
+
$revisions = 0;
while( $row = $dbw->fetchObject( $result ) ) {
$revisions++;
@@ -2081,20 +2116,20 @@ class Image
wfDebug( __METHOD__.": skipping row with no file.\n" );
continue;
}
-
+
if( $revisions == 1 && !$exists ) {
$destDir = wfImageDir( $row->fa_name );
if ( !is_dir( $destDir ) ) {
wfMkdirParents( $destDir );
}
$destPath = $destDir . DIRECTORY_SEPARATOR . $row->fa_name;
-
+
// We may have to fill in data if this was originally
// an archived file revision.
if( is_null( $row->fa_metadata ) ) {
$tempFile = $store->filePath( $row->fa_storage_key );
$metadata = serialize( $this->retrieveExifData( $tempFile ) );
-
+
$magic = wfGetMimeMagic();
$mime = $magic->guessMimeType( $tempFile, true );
$media_type = $magic->getMediaType( $tempFile, $mime );
@@ -2105,7 +2140,7 @@ class Image
$minor_mime = $row->fa_minor_mime;
$media_type = $row->fa_media_type;
}
-
+
$table = 'image';
$fields = array(
'img_name' => $row->fa_name,
@@ -2136,7 +2171,7 @@ class Image
wfMkdirParents( $destDir );
}
$destPath = $destDir . DIRECTORY_SEPARATOR . $archiveName;
-
+
$table = 'oldimage';
$fields = array(
'oi_name' => $row->fa_name,
@@ -2150,13 +2185,13 @@ class Image
'oi_user_text' => $row->fa_user_text,
'oi_timestamp' => $row->fa_timestamp );
}
-
+
$dbw->insert( $table, $fields, __METHOD__ );
/// @fixme this delete is not totally safe, potentially
$dbw->delete( 'filearchive',
array( 'fa_id' => $row->fa_id ),
__METHOD__ );
-
+
// Check if any other stored revisions use this file;
// if so, we shouldn't remove the file from the deletion
// archives so they will still work.
@@ -2172,39 +2207,39 @@ class Image
} else {
$flags = 0;
}
-
+
$transaction->add( $store->export( $row->fa_storage_key,
$destPath, $flags ) );
}
-
+
$dbw->immediateCommit();
} catch( MWException $e ) {
wfDebug( __METHOD__." caught error, aborting\n" );
$transaction->rollback();
throw $e;
}
-
+
$transaction->commit();
FileStore::unlock();
-
+
if( $revisions > 0 ) {
if( !$exists ) {
wfDebug( __METHOD__." restored $revisions items, creating a new current\n" );
-
+
// Update site_stats
$site_stats = $dbw->tableName( 'site_stats' );
$dbw->query( "UPDATE $site_stats SET ss_images=ss_images+1", __METHOD__ );
-
+
$this->purgeEverything();
} else {
wfDebug( __METHOD__." restored $revisions as archived versions\n" );
$this->purgeDescription();
}
}
-
+
return $revisions;
}
-
+
} //class
/**
diff --git a/includes/ImagePage.php b/includes/ImagePage.php
index dac9602..41d41a6 100644
--- a/includes/ImagePage.php
+++ b/includes/ImagePage.php
@@ -44,10 +44,15 @@ class ImagePage extends Article {
$showmeta = false;
}
- if ($this->img->exists())
- $wgOut->addHTML($this->showTOC($showmeta));
+// WERELATE - removed
+// if ($this->img->exists())
+// $wgOut->addHTML($this->showTOC($showmeta));
- $this->openShowImage();
+// WERELATE - if there image_data, that will show the image
+// $imageData = preg_match('#<image_data>(.*?)</image_data>#s', $this->getContent());
+// if (!$imageData) {
+ $this->openShowImage();
+// }
# No need to display noarticletext, we use our own message, output in openShowImage()
if( $this->getID() ) {
@@ -69,7 +74,10 @@ class ImagePage extends Article {
$wgOut->addHTML( '<div id="shared-image-desc">' . $this->mExtraDescription . '</div>' );
}
- $this->closeShowImage();
+// WERELATE - if there is image data, that will show the image
+// if (!$imageData) {
+ $this->closeShowImage();
+// }
$this->imageHistory();
$this->imageLinks();
if( $exif ) {
@@ -82,6 +90,14 @@ class ImagePage extends Article {
"<script type=\"text/javascript\" src=\"$wgStylePath/common/metadata.js\"></script>\n" .
"<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" );
}
+// WERELATE - show license
+ $text = $this->getContent();
+ $matches = array();
+ if (preg_match('#<license>(.*?)</license>#', $text, $matches)) {
+ $wgOut->addHTML('<div id="imglicense">');
+ $wgOut->addWikiText("'''".wfMsg('license').":''' {{".$matches[1].'}}');
+ $wgOut->addHTML('</div>');
+ }
} else {
Article::view();
}
@@ -153,7 +169,7 @@ class ImagePage extends Article {
/**
* Overloading Article's getContent method.
- *
+ *
* Omit noarticletext if sharedupload; text will be fetched from the
* shared upload server if possible.
*/
@@ -164,6 +180,8 @@ class ImagePage extends Article {
return Article::getContent();
}
+// WERELATE - if the url, height, or width calculations change, change them in Fotonotes.php
+// WERELATE - changes to this function must be reflected in SDImage.getContentHTML
function openShowImage() {
global $wgOut, $wgUser, $wgImageLimits, $wgRequest;
global $wgUseImageResize, $wgGenerateThumbnailOnParse;
@@ -186,6 +204,8 @@ class ImagePage extends Article {
$sk = $wgUser->getSkin();
if ( $this->img->exists() ) {
+// WERELATE - add wrapper div
+ $wgOut->addHTML('<div class="imageWrapper">');
# image
$width = $this->img->getWidth();
$height = $this->img->getHeight();
@@ -239,6 +259,9 @@ class ImagePage extends Article {
$wgOut->addHTML( '<div class="fullImageLink" id="file">' . $anchoropen .
"<img border=\"0\" src=\"{$url}\" width=\"{$width}\" height=\"{$height}\" alt=\"" .
htmlspecialchars( $wgRequest->getVal( 'image' ) ).'" />' . $anchorclose . '</div>' );
+// WERELATE - added
+ global $wgScriptPath;
+ $wgOut->addHTML("<script type=\"text/javascript\" src=\"$wgScriptPath/fnclientwiki.yui.1.js\"></script>");
} else {
#if direct link is allowed but it's not a renderable image, show an icon.
if ($this->img->isSafeFile()) {
@@ -285,6 +308,8 @@ END
if($this->img->fromSharedDirectory) {
$this->printSharedImageText();
}
+// WERELATE - end wrapper div
+ $wgOut->addHTML('</div>');
} else {
# Image does not exist
@@ -338,19 +363,22 @@ END
return;
$sk = $wgUser->getSkin();
-
+
$wgOut->addHtml( '<br /><ul>' );
-
+
# "Upload a new version of this file" link
if( $wgUser->isAllowed( 'reupload' ) ) {
$ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
$wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
}
-
- # External editing link
- $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
- $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
-
+
+// WERELATE - add editing link, removed external editing link
+ $elink = $sk->makeKnownLinkObj( $this->mTitle, 'Edit/annotate image', 'action=edit' );
+ $wgOut->addHtml("<li>$elink</li>");
+// # External editing link
+// $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
+// $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
+
$wgOut->addHtml( '</ul>' );
}
@@ -440,8 +468,9 @@ END
# Only sysops can delete images. Previously ordinary users could delete
# old revisions, but this is no longer the case.
- if ( !$wgUser->isAllowed('delete') ) {
- $wgOut->sysopRequired();
+// WERELATE: pass in title, change sysop required to permission required
+ if ( !$wgUser->isAllowed('delete', $this->mTitle) ) {
+ $wgOut->permissionRequired( 'delete' );
return;
}
if ( $wgUser->isBlocked() ) {
@@ -513,12 +542,18 @@ END
$wgOut->showFileDeleteError( $this->img->getName() );
return;
}
-
+
# Image itself is now gone, and database is cleaned.
# Now we remove the image description page.
-
+
$article = new Article( $this->mTitle );
- $article->doDeleteArticle( $reason ); # ignore errors
+// WERELATE: added calls to ArticleDelete and ArticleDeleteComplete hooks
+ global $wgUser;
+ if (wfRunHooks('ArticleDelete', array(&$article, &$wgUser, &$reason))) {
+ if ($article->doDeleteArticle( $reason )) {
+ wfRunHooks('ArticleDeleteComplete', array(&$article, &$wgUser, $reason));
+ }
+ }
$deleted = $this->img->getName();
}
@@ -629,7 +664,7 @@ END
$edit = new EditPage( $this );
return $edit->blockedIPpage();
}
-
+
/**
* Override handling of action=purge
*/
@@ -706,7 +741,7 @@ class ImageHistoryList {
$dlink = $del;
}
}
-
+
$userlink = $this->skin->userLink( $user, $usertext ) . $this->skin->userToolLinks( $user, $usertext );
$nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
$wgLang->formatNum( $size ) );
diff --git a/includes/JobQueue.php b/includes/JobQueue.php
index 746cf5d..a54af2a 100644
--- a/includes/JobQueue.php
+++ b/includes/JobQueue.php
@@ -1,4 +1,9 @@
<?php
+require_once("$IP/extensions/familytree/DeleteFamilyTreeJob.php");
+require_once("$IP/extensions/familytree/WatchTreePagesJob.php");
+require_once("$IP/extensions/familytree/AddTreePagesJob.php");
+require_once("$IP/extensions/gedcom/GedcomExportJob.php");
+require_once("$IP/extensions/structuredNamespaces/Place.php");
if ( !defined( 'MEDIAWIKI' ) ) {
die( "This file is part of MediaWiki, it is not a valid entry point\n" );
@@ -16,7 +21,7 @@ abstract class Job {
* Static functions
*------------------------------------------------------------------------*/
- /**
+ /**
* @deprecated use LinksUpdate::queueRecursiveJobs()
*/
/**
@@ -72,7 +77,7 @@ abstract class Job {
$dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
$affected = $dbw->affectedRows();
$dbw->immediateCommit();
-
+
if ( !$affected ) {
// Random job gone before we exclusively deleted it
// Give up
@@ -80,26 +85,37 @@ abstract class Job {
return false;
}
}
-
+
// If execution got to here, there's a row in $row that has been deleted from the database
// by this thread. Hence the concurrent pop was successful.
$namespace = $row->job_namespace;
$dbkey = $row->job_title;
$title = Title::makeTitleSafe( $namespace, $dbkey );
$job = Job::factory( $row->job_cmd, $title, Job::extractBlob( $row->job_params ), $row->job_id );
-
+
// Remove any duplicates it may have later in the queue
$dbw->delete( 'job', $job->insertFields(), __METHOD__ );
-
+
wfProfileOut( __METHOD__ );
return $job;
}
- /**
+ /**
* Create an object of a subclass
*/
static function factory( $command, $title, $params = false, $id = 0 ) {
- switch ( $command ) {
+// WERELATE: added deleteFamilyTree, watchTreePages, gedcomExport, ...
+ switch ( $command ) {
+ case 'deleteFamilyTree':
+ return new DeleteFamilyTreeJob($params, $id);
+ case 'watchTreePages':
+ return new WatchTreePagesJob($params, $id);
+ case 'addTreePages':
+ return new AddTreePagesJob($params, $id);
+ case 'gedcomExport':
+ return new GedcomExportJob($params, $id);
+ case 'placeRedirect':
+ return new PlaceRedirectJob($params, $id);
case 'refreshLinks':
return new RefreshLinksJob( $title, $params, $id );
case 'htmlCacheUpdate':
@@ -148,7 +164,7 @@ abstract class Job {
$fields = $this->insertFields();
$dbw =& wfGetDB( DB_MASTER );
-
+
if ( $this->removeDuplicates ) {
$res = $dbw->select( 'job', array( '1' ), $fields, __METHOD__ );
if ( $dbw->numRows( $res ) ) {
@@ -158,7 +174,7 @@ abstract class Job {
$fields['job_id'] = $dbw->nextSequenceValue( 'job_job_id_seq' );
$dbw->insert( 'job', $fields, __METHOD__ );
}
-
+
protected function insertFields() {
return array(
'job_cmd' => $this->command,
@@ -167,7 +183,7 @@ abstract class Job {
'job_params' => Job::makeBlob( $this->params )
);
}
-
+
/**
* Batch-insert a group of jobs into the queue.
* This will be wrapped in a transaction with a forced commit.
@@ -194,7 +210,7 @@ abstract class Job {
* @return boolean success
*/
abstract function run();
-
+
function toString() {
$paramString = '';
if ( $this->params ) {
@@ -237,7 +253,7 @@ class RefreshLinksJob extends Job {
$linkCache =& LinkCache::singleton();
$linkCache->clear();
-
+
if ( is_null( $this->title ) ) {
$this->error = "refreshLinks: Invalid title";
wfProfileOut( __METHOD__ );
diff --git a/includes/LinkCache.php b/includes/LinkCache.php
index 451b3f0..a7cbe47 100644
--- a/includes/LinkCache.php
+++ b/includes/LinkCache.php
@@ -21,7 +21,7 @@ class LinkCache {
/**
* Get an instance of this class
*/
- function &singleton() {
+ static function &singleton() {
static $instance;
if ( !isset( $instance ) ) {
$instance = new LinkCache;
diff --git a/includes/Linker.php b/includes/Linker.php
index 4a0eafb..1291b1d 100644
--- a/includes/Linker.php
+++ b/includes/Linker.php
@@ -355,7 +355,9 @@ class Linker {
} else {
$q = 'action=edit&'.$query;
}
- $u = $nt->escapeLocalURL( $q );
+// WERELATE - changed because I don't think people generally want to be taken to edit pages for broken links
+// $u = $nt->escapeLocalURL( $q );
+ $u = $nt->escapeLocalURL( $query );
if ( '' == $text ) {
$text = htmlspecialchars( $nt->getPrefixedText() );
@@ -458,7 +460,8 @@ class Linker {
function makeImageLinkObj( $nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false,
$thumb = false, $manual_thumb = '' )
{
- global $wgContLang, $wgUser, $wgThumbLimits, $wgGenerateThumbnailOnParse;
+ // WERELATE - added wgMaxDefaultImageWidth
+ global $wgContLang, $wgUser, $wgThumbLimits, $wgGenerateThumbnailOnParse, $wgMaxDefaultImageWidth;
$img = new Image( $nt );
if ( !$img->allowInlineDisplay() && $img->exists() ) {
@@ -535,6 +538,11 @@ class Linker {
} else {
$width = $img->width;
$height = $img->height;
+ // WERELATE - set max image width; let the browser rescale (for now)
+ if ($width > $wgMaxDefaultImageWidth) {
+ $height = round($height * $wgMaxDefaultImageWidth / $width);
+ $width = $wgMaxDefaultImageWidth;
+ }
}
wfDebug( "makeImageLinkObj2: '$width'x'$height'\n" );
@@ -958,7 +966,7 @@ class Linker {
*
* @return string
*/
- function commentBlock( $comment, $title = NULL ) {
+ function commentBlock( $comment, $title = NULL) {
// '*' used to be the comment inserted by the software way back
// in antiquity in case none was provided, here for backwards
// compatability, acc. to brion -ævar
@@ -978,7 +986,7 @@ class Linker {
*/
function revComment( $rev ) {
if( $rev->userCan( Revision::DELETED_COMMENT ) ) {
- $block = $this->commentBlock( $rev->getRawComment(), $rev->getTitle() );
+ $block = $this->commentBlock( $rev->getRawComment(), $rev->getTitle());
} else {
$block = " <span class=\"comment\">" .
wfMsgHtml( 'rev-deleted-comment' ) . "</span>";
@@ -1016,8 +1024,9 @@ class Linker {
/** @todo document */
function tocList($toc) {
- global $wgJsMimeType;
- $title = wfMsgForContent('toc') ;
+// WERELATE: use topics instead of toc for talk pages
+ global $wgJsMimeType, $wgTitle;
+ $title = wfMsgForContent($wgTitle && get_class($wgTitle) != 'FakeTitle' && $wgTitle->isTalkPage() ? 'topics' : 'toc');
return
'<table id="toc" class="toc" summary="' . $title .'"><tr><td>'
. '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
@@ -1062,8 +1071,15 @@ class Linker {
global $wgContLang;
$editurl = '&section='.$section;
- $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'editsectionhint', htmlspecialchars( $hint ) ) . '"';
- $url = $this->makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint );
+// WERELATE: distinguish section from topic, add hr, comment link
+ $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( $nt->isTalkPage() ? 'edittopichint' : 'editsectionhint', htmlspecialchars( $hint ) ) . '"';
+ $url = $this->makeKnownLinkObj( $nt, wfMsg($nt->isTalkPage() ? 'edittopic' : 'editsection'), 'action=edit'.$editurl, '', '', '', $hint );
+ $hr = '';
+ $cmtLink = '';
+ if ($nt->isTalkPage()) {
+ $hr = '<hr class="topic"/>';
+ $cmtLink = '['. $this->makeKnownLinkObj( $nt, wfMsg('addcomment'), 'action=edit'.$editurl.'&cmt=new', '', '', '', ' title="' . wfMsgHtml('addcommenthint') . '"' ).'] ';
+ }
if( $wgContLang->isRTL() ) {
$farside = 'left';
@@ -1072,7 +1088,7 @@ class Linker {
$farside = 'right';
$nearside = 'left';
}
- return "<div class=\"editsection\" style=\"float:$farside;margin-$nearside:5px;\">[".$url."]</div>";
+ return "$hr<div class=\"editsection\" style=\"float:$farside;margin-$nearside:5px;\">{$cmtLink}[".$url."]</div>";
}
/**
diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php
index 9e25bf0..04d780b 100644
--- a/includes/LinksUpdate.php
+++ b/includes/LinksUpdate.php
@@ -57,8 +57,8 @@ class LinksUpdate {
$this->mCategories = $parserOutput->getCategories();
# Convert the format of the interlanguage links
- # I didn't want to change it in the ParserOutput, because that array is passed all
- # the way back to the skin, so either a skin API break would be required, or an
+ # I didn't want to change it in the ParserOutput, because that array is passed all
+ # the way back to the skin, so either a skin API break would be required, or an
# inefficient back-conversion.
$ill = $parserOutput->getLanguageLinks();
$this->mInterlangs = array();
@@ -85,7 +85,7 @@ class LinksUpdate {
function doIncrementalUpdate() {
$fname = 'LinksUpdate::doIncrementalUpdate';
wfProfileIn( $fname );
-
+
# Page links
$existing = $this->getExistingLinks();
$this->incrTableUpdate( 'pagelinks', 'pl', $this->getLinkDeletions( $existing ),
@@ -129,7 +129,7 @@ class LinksUpdate {
if ( $this->mRecursive ) {
$this->queueRecursiveJobs();
}
-
+
wfProfileOut( $fname );
}
@@ -170,13 +170,13 @@ class LinksUpdate {
function queueRecursiveJobs() {
wfProfileIn( __METHOD__ );
-
+
$batchSize = 100;
$dbr =& wfGetDB( DB_SLAVE );
- $res = $dbr->select( array( 'templatelinks', 'page' ),
+ $res = $dbr->select( array( 'templatelinks', 'page' ),
array( 'page_namespace', 'page_title' ),
- array(
- 'page_id=tl_from',
+ array(
+ 'page_id=tl_from',
'tl_namespace' => $this->mTitle->getNamespace(),
'tl_title' => $this->mTitle->getDBkey()
), __METHOD__
@@ -199,7 +199,7 @@ class LinksUpdate {
$dbr->freeResult( $res );
wfProfileOut( __METHOD__ );
}
-
+
/**
* Invalidate the cache of a list of pages from a single namespace
*
@@ -208,11 +208,11 @@ class LinksUpdate {
*/
function invalidatePages( $namespace, $dbkeys ) {
$fname = 'LinksUpdate::invalidatePages';
-
+
if ( !count( $dbkeys ) ) {
return;
}
-
+
/**
* Determine which pages need to be updated
* This is necessary to prevent the job queue from smashing the DB with
@@ -220,8 +220,8 @@ class LinksUpdate {
*/
$now = $this->mDb->timestamp();
$ids = array();
- $res = $this->mDb->select( 'page', array( 'page_id' ),
- array(
+ $res = $this->mDb->select( 'page', array( 'page_id' ),
+ array(
'page_namespace' => $namespace,
'page_title IN (' . $this->mDb->makeList( $dbkeys ) . ')',
'page_touched < ' . $this->mDb->addQuotes( $now )
@@ -233,14 +233,14 @@ class LinksUpdate {
if ( !count( $ids ) ) {
return;
}
-
+
/**
* Do the update
- * We still need the page_touched condition, in case the row has changed since
+ * We still need the page_touched condition, in case the row has changed since
* the non-locking select above.
*/
- $this->mDb->update( 'page', array( 'page_touched' => $now ),
- array(
+ $this->mDb->update( 'page', array( 'page_touched' => $now ),
+ array(
'page_id IN (' . $this->mDb->makeList( $ids ) . ')',
'page_touched < ' . $this->mDb->addQuotes( $now )
), $fname
@@ -410,7 +410,7 @@ class LinksUpdate {
/**
* Get an array of interlanguage link insertions
- * @param array $existing Array mapping existing language codes to titles
+ * @param array $existing Array mapping existing language codes to titles
* @private
*/
function getInterlangInsertions( $existing = array() ) {
@@ -469,7 +469,7 @@ class LinksUpdate {
return array_diff_key( $existing, $this->mImages );
}
- /**
+ /**
* Given an array of existing external links, returns those links which are not
* in $this and thus should be deleted.
* @private
@@ -487,7 +487,7 @@ class LinksUpdate {
return array_diff_assoc( $existing, $this->mCategories );
}
- /**
+ /**
* Given an array of existing interlanguage links, returns those links which are not
* in $this and thus should be deleted.
* @private
@@ -583,13 +583,13 @@ class LinksUpdate {
}
/**
- * Get an array of existing interlanguage links, with the language code in the key and the
+ * Get an array of existing interlanguage links, with the language code in the key and the
* title in the value.
* @private
*/
function getExistingInterlangs() {
$fname = 'LinksUpdate::getExistingInterlangs';
- $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
+ $res = $this->mDb->select( 'langlinks', array( 'll_lang', 'll_title' ),
array( 'll_from' => $this->mId ), $fname, $this->mOptions );
$arr = array();
while ( $row = $this->mDb->fetchObject( $res ) ) {
diff --git a/includes/Metadata.php b/includes/Metadata.php
index af40ab2..3f69c32 100644
--- a/includes/Metadata.php
+++ b/includes/Metadata.php
@@ -73,7 +73,7 @@ function wfCreativeCommonsRdf($article) {
function rdfSetup() {
global $wgOut, $_SERVER;
- $rdftype = wfNegotiateType(wfAcceptToPrefs($_SERVER['HTTP_ACCEPT']), wfAcceptToPrefs(RDF_TYPE_PREFS));
+ $rdftype = wfNegotiateType(wfAcceptToPrefs(@$_SERVER['HTTP_ACCEPT']), wfAcceptToPrefs(RDF_TYPE_PREFS));
if (!$rdftype) {
wfHttpError(406, "Not Acceptable", wfMsg("notacceptable"));
diff --git a/includes/Namespace.php b/includes/Namespace.php
index ab7511d..f565065 100644
--- a/includes/Namespace.php
+++ b/includes/Namespace.php
@@ -43,7 +43,7 @@ if( is_array( $wgExtraNamespaces ) ) {
*
* @package MediaWiki
*/
-class Namespace {
+class Namespac {
/**
* Check if the given namespace might be moved
@@ -58,14 +58,14 @@ class Namespace {
* @return bool
*/
function isMain( $index ) {
- return ! Namespace::isTalk( $index );
+ return ! Namespac::isTalk( $index );
}
/**
* Check if the give namespace is a talk page
* @return bool
*/
- function isTalk( $index ) {
+ static function isTalk( $index ) {
return ($index > NS_MAIN) // Special namespaces are negative
&& ($index % 2); // Talk namespaces are odd-numbered
}
@@ -73,8 +73,8 @@ class Namespace {
/**
* Get the talk namespace corresponding to the given index
*/
- function getTalk( $index ) {
- if ( Namespace::isTalk( $index ) ) {
+ static function getTalk( $index ) {
+ if ( Namespac::isTalk( $index ) ) {
return $index;
} else {
# FIXME
@@ -83,7 +83,7 @@ class Namespace {
}
function getSubject( $index ) {
- if ( Namespace::isTalk( $index ) ) {
+ if ( Namespac::isTalk( $index ) ) {
return $index - 1;
} else {
return $index;
diff --git a/includes/ObjectCache.php b/includes/ObjectCache.php
index fe7417d..c10f532 100644
--- a/includes/ObjectCache.php
+++ b/includes/ObjectCache.php
@@ -53,19 +53,62 @@ function &wfGetCache( $inputType ) {
require_once( 'memcached-client.php' );
if (!class_exists("MemcachedClientforWiki")) {
- class MemCachedClientforWiki extends memcached {
+ class MemCachedClientforWiki extends MWmemcached {
+// WERELATE - added functions to call prepareKey before entering memcached
+ function prepareKey($key) {
+ return str_replace(' ','_',$key);
+ }
+
+ function add ($key, $val, $exp = 0)
+ {
+ return parent::add($this->prepareKey($key), $val, $exp);
+ }
+ function decr ($key, $amt=1)
+ {
+ return parent::decr($this->prepareKey($key), $amt);
+ }
+ function delete ($key, $time = 0)
+ {
+ return parent::delete($this->prepareKey($key), $time);
+ }
+ function get ($key)
+ {
+ return parent::get($this->prepareKey($key));
+ }
+ function get_multi ($keys)
+ {
+ $pKeys = array();
+ foreach ($keys as $key)
+ {
+ $pKeys[] = $this->prepareKey($key);
+ }
+ return parent::get_multi($pKeys);
+ }
+ function incr ($key, $amt=1)
+ {
+ return parent::incr($this->prepareKey($key), $amt);
+ }
+ function replace ($key, $value, $exp=0)
+ {
+ return parent::replace($this->prepareKey($key), $value, $exp);
+ }
+ function set ($key, $value, $exp=0)
+ {
+ return parent::set($this->prepareKey($key), $value, $exp);
+ }
function _debugprint( $text ) {
wfDebug( "memcached: $text\n" );
}
}
}
- $wgCaches[CACHE_DB] = new MemCachedClientforWiki(
+// WERELATE - changed CACHE_DB to CACHE_MEMCACHED and moved assignment outside IF
+ $wgCaches[CACHE_MEMCACHED] = new MemCachedClientforWiki(
array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) );
- $cache =& $wgCaches[CACHE_DB];
- $cache->set_servers( $wgMemCachedServers );
- $cache->set_debug( $wgMemCachedDebug );
+ $wgCaches[CACHE_MEMCACHED]->set_servers( $wgMemCachedServers );
+ $wgCaches[CACHE_MEMCACHED]->set_debug( $wgMemCachedDebug );
}
+ $cache =& $wgCaches[CACHE_MEMCACHED];
} elseif ( $type == CACHE_ACCEL ) {
if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) {
if ( function_exists( 'eaccelerator_get' ) ) {
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 31a0781..4d38331 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -26,7 +26,7 @@ class OutputPage {
var $mShowFeedLinks = false;
var $mEnableClientCache = true;
var $mArticleBodyOnly = false;
-
+
var $mNewSectionLink = false;
var $mNoGallery = false;
@@ -53,8 +53,14 @@ class OutputPage {
$this->mRevisionId = null;
$this->mNewSectionLink = false;
}
-
- function redirect( $url, $responsecode = '302' ) {
+
+ function redirect( $url, $responsecode = '302' ) {
+ # WR DWQ
+ global $wrProtocol;
+ if ( substr( $url, 0, 7 ) === "http://" && $wrProtocol = "https" ) {
+ $url = $wrProtocol . "://" . substr( $url, 7);
+ }
+
# Strip newlines as a paranoia check for header injection in PHP<5.1.2
$this->mRedirect = str_replace( "\n", '', $url );
$this->mRedirectCode = $responsecode;
@@ -341,9 +347,18 @@ class OutputPage {
* For anything that isn't primary text or interface message
*/
function addSecondaryWikiText( $text, $linestart = true ) {
- global $wgTitle;
+ global $wgTitle, $wgParser;
$this->mParserOptions->setTidy(true);
- $this->addWikiTextTitle($text, $wgTitle, $linestart);
+
+// WERELATE - replace call to addWikiTextTitle with function contents so I can add call to hook
+ $parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions,
+ $linestart, true, $this->mRevisionId );
+ $this->addParserOutputNoText( $parserOutput );
+ $text = $parserOutput->getText();
+ wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) );
+ $parserOutput->setText( $text );
+ $this->addHTML( $parserOutput->getText() );
+
$this->mParserOptions->setTidy(false);
}
@@ -386,6 +401,9 @@ class OutputPage {
$this->addKeywords( $parserOutput );
$this->mNewSectionLink = $parserOutput->getNewSection();
$this->mNoGallery = $parserOutput->getNoGallery();
+ // WERELATE
+ $this->mSubtitle .= $parserOutput->mSubtitle;
+
$text = $parserOutput->getText();
wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) );
$this->addHTML( $text );
@@ -489,13 +507,14 @@ class OutputPage {
wfProfileIn( $fname );
$sk = $wgUser->getSkin();
- if ( $wgUseAjax ) {
- $this->addScript( "<script type=\"{$wgJsMimeType}\">
- var wgScriptPath=\"{$wgScriptPath}\";
- var wgServer=\"{$wgServer}\";
- </script>" );
- $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js\"></script>\n" );
- }
+// WERELATE - remove
+// if ( $wgUseAjax ) {
+// $this->addScript( "<script type=\"{$wgJsMimeType}\">
+// var wgScriptPath=\"{$wgScriptPath}\";
+// var wgServer=\"{$wgServer}\";
+// </script>" );
+// $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajax.js\"></script>\n" );
+// }
if ( '' != $this->mRedirect ) {
if( substr( $this->mRedirect, 0, 4 ) != 'http' ) {
@@ -663,7 +682,7 @@ class OutputPage {
$link = '[[' . $wgContLang->getNsText( NS_USER ) . ":{$name}|{$name}]]";
$this->addWikiText( wfMsg( 'blockedtext', $link, $reason, $ip, $name ) );
-
+
# Don't auto-return to special pages
if( $return ) {
$return = $wgTitle->getNamespace() > -1 ? $wgTitle->getPrefixedText() : NULL;
@@ -695,7 +714,7 @@ class OutputPage {
function errorpage( $title, $msg ) {
throw new ErrorPageError( $title, $msg );
}
-
+
/**
* Display an error page indicating that a given version of MediaWiki is
* required to use it
@@ -775,17 +794,17 @@ class OutputPage {
function loginToUse() {
global $wgUser, $wgTitle, $wgContLang;
$skin = $wgUser->getSkin();
-
+
$this->setPageTitle( wfMsg( 'loginreqtitle' ) );
$this->setHtmlTitle( wfMsg( 'errorpagetitle' ) );
$this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleFlag( false );
-
+
$loginTitle = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
$loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
$this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
$this->addHtml( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" );
-
+
$this->returnToMain();
}
@@ -804,7 +823,7 @@ class OutputPage {
$skin = $wgUser->getSkin();
$this->setPageTitle( wfMsg( 'viewsource' ) );
$this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
-
+
# Determine if protection is due to the page being a system message
# and show an appropriate explanation
if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) {
@@ -833,7 +852,7 @@ class OutputPage {
}
$rows = $wgUser->getIntOption( 'rows' );
$cols = $wgUser->getIntOption( 'cols' );
-
+
$text = "\n<textarea name='wpTextbox1' id='wpTextbox1' cols='$cols' rows='$rows' readonly='readonly'>" .
htmlspecialchars( $source ) . "\n</textarea>";
$this->addHTML( $text );
@@ -843,10 +862,10 @@ class OutputPage {
}
/** @obsolete */
- function fatalError( $message ) {
- throw new FatalError( $message );
+ function fatalError( $message ) {
+ throw new FatalError( $message );
}
-
+
/** @obsolete */
function unexpectedValueError( $name, $val ) {
throw new FatalError( wfMsg( 'unexpected', $name, $val ) );
@@ -908,15 +927,21 @@ class OutputPage {
*/
function returnToMain( $auto = true, $returnto = NULL ) {
global $wgUser, $wgOut, $wgRequest;
-
+
if ( $returnto == NULL ) {
$returnto = $wgRequest->getText( 'returnto' );
}
-
+
if ( '' === $returnto ) {
$returnto = wfMsgForContent( 'mainpage' );
}
+// WERELATE - use page title for link text of MyRelate when we makeLinkObj below
+ $linkText = '';
+ if ($returnto == 'Special:MyRelate') {
+ $linkText = wfmsg('myrelate');
+ }
+
if ( is_object( $returnto ) ) {
$titleObj = $returnto;
} else {
@@ -927,12 +952,13 @@ class OutputPage {
}
$sk = $wgUser->getSkin();
- $link = $sk->makeLinkObj( $titleObj, '' );
+ $link = $sk->makeLinkObj( $titleObj, $linkText );
$r = wfMsg( 'returnto', $link );
- if ( $auto ) {
- $wgOut->addMeta( 'http:Refresh', '10;url=' . $titleObj->escapeFullURL() );
- }
+// WERELATE - don't automatically redirect
+// if ( $auto ) {
+// $wgOut->addMeta( 'http:Refresh', '10;url=' . $titleObj->escapeFullURL() );
+// }
$wgOut->addHTML( "\n<p>$r</p>\n" );
}
@@ -1060,11 +1086,12 @@ class OutputPage {
function rateLimited() {
global $wgOut;
$wgOut->disable();
+// WERELATE: changed message
wfHttpError( 500, 'Internal Server Error',
- 'Sorry, the server has encountered an internal error. ' .
+ 'Sorry, to discourage spammers we limit the number of edits that can be made in a short period of time. ' .
'Please wait a moment and hit "refresh" to submit the request again.' );
}
-
+
/**
* Show an "add new section" link?
*
diff --git a/includes/Parser.php b/includes/Parser.php
index 31976ba..a7ba53b 100644
--- a/includes/Parser.php
+++ b/includes/Parser.php
@@ -174,12 +174,12 @@ class Parser
if ( $wgAllowSlowParserFunctions ) {
$this->setFunctionHook( MAG_PAGESINNAMESPACE, array( 'CoreParserFunctions', 'pagesinnamespace' ), SFH_NO_HASH );
}
-
+
$this->initialiseVariables();
$this->mFirstCall = false;
wfProfileOut( __METHOD__ );
- }
+ }
/**
* Clear Parser state
@@ -210,7 +210,7 @@ class Parser
'titles' => array()
);
$this->mRevisionId = null;
-
+
/**
* Prefix for temporary replacement strings for the multipass parser.
* \x07 should never appear in input as it's disallowed in XML.
@@ -321,8 +321,8 @@ class Parser
} else {
# attempt to sanitize at least some nesting problems
# (bug #2702 and quite a few others)
- $tidyregs = array(
- # ''Something [http://www.cool.com cool''] -->
+ $tidyregs = array(
+ # ''Something [http://www.cool.com cool''] -->
# <i>Something</i><a href="http://www.cool.com"..><i>cool></i></a>
'/(<([bi])>)(<([bi])>)?([^<]*)(<\/?a[^<]*>)([^<]*)(<\/\\4>)?(<\/\\2>)/' =>
'\\1\\3\\5\\8\\9\\6\\1\\3\\7\\8\\9',
@@ -337,10 +337,10 @@ class Parser
'\\1\\3&lt;div\\5&gt;\\6&lt;/div&gt;\\8\\9',
# remove empty italic or bold tag pairs, some
# introduced by rules above
- '/<([bi])><\/\\1>/' => ''
+ '/<([bi])><\/\\1>/' => ''
);
- $text = preg_replace(
+ $text = preg_replace(
array_keys( $tidyregs ),
array_values( $tidyregs ),
$text );
@@ -444,7 +444,7 @@ class Parser
$text = $q[2];
}
}
-
+
$matches[$marker] = array( $element,
$content,
Sanitizer::decodeTagAttributes( $attributes ),
@@ -463,7 +463,7 @@ class Parser
* will be stripped in addition to other tags. This is important
* for section editing, where these comments cause confusion when
* counting the sections in the wikisource
- *
+ *
* @param array dontstrip contains tags which should not be stripped;
* used to prevent stipping of <gallery> when saving (fixes bug 2700)
*
@@ -476,7 +476,7 @@ class Parser
$uniq_prefix = $this->mUniqPrefix;
#$text = str_replace( $uniq_prefix, wfHtmlEscapeFirst( $uniq_prefix ), $text );
$commentState = array();
-
+
$elements = array_merge(
array( 'nowiki', 'gallery' ),
array_keys( $this->mTagHooks ) );
@@ -487,13 +487,13 @@ class Parser
if( $this->mOptions->getUseTeX() ) {
$elements[] = 'math';
}
-
+
# Removing $dontstrip tags from $elements list (currently only 'gallery', fixing bug 2700)
foreach ( $elements AS $k => $v ) {
if ( !in_array ( $v , $dontstrip ) ) continue;
unset ( $elements[$k] );
}
-
+
$matches = array();
$text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
@@ -545,7 +545,7 @@ class Parser
$state[$element][$marker] = $output;
}
}
-
+
# Unstrip comments unless explicitly told otherwise.
# (The comments are always stripped prior to this point, so as to
# not invoke any extension tags / parser hooks contained within
@@ -797,13 +797,13 @@ class Parser
}
$after = substr ( $x , 1 ) ;
if ( $fc == '!' ) $after = str_replace ( '!!' , '||' , $after ) ;
-
+
// Split up multiple cells on the same line.
// FIXME: This can result in improper nesting of tags processed
// by earlier parser steps, but should avoid splitting up eg
// attribute values containing literal "||".
$after = wfExplodeMarkup( '||', $after );
-
+
$t[$k] = '' ;
# Loop through each table cell
@@ -881,7 +881,7 @@ class Parser
$text = strtr( $text, array( '<onlyinclude>' => '' , '</onlyinclude>' => '' ) );
$text = strtr( $text, array( '<noinclude>' => '', '</noinclude>' => '') );
$text = preg_replace( '/<includeonly>.*?<\/includeonly>/s', '', $text );
-
+
$text = Sanitizer::removeHTMLtags( $text, array( &$this, 'attributeStripCallback' ) );
$text = $this->replaceVariables( $text, $args );
@@ -1197,7 +1197,7 @@ class Parser
# Normalize any HTML entities in input. They will be
# re-escaped by makeExternalLink().
$url = Sanitizer::decodeCharReferences( $url );
-
+
# Escape any control characters introduced by the above step
$url = preg_replace( '/[\][<>"\\x00-\\x20\\x7F]/e', "urlencode('\\0')", $url );
@@ -1248,10 +1248,10 @@ class Parser
# special case: handle urls as url args:
# http://www.example.com/foo?=http://www.example.com/bar
- if(strlen($trail) == 0 &&
+ if(strlen($trail) == 0 &&
isset($bits[$i]) &&
preg_match('/^'. wfUrlProtocols() . '$/S', $bits[$i]) &&
- preg_match( '/^('.EXT_LINK_URL_CLASS.'+)(.*)$/s', $bits[$i + 1], $m ))
+ preg_match( '/^('.EXT_LINK_URL_CLASS.'+)(.*)$/s', $bits[$i + 1], $m ))
{
# add protocol, arg
$url .= $bits[$i] . $m[1]; # protocol, url as arg to previous link
@@ -1283,7 +1283,7 @@ class Parser
# Normalize any HTML entities in input. They will be
# re-escaped by makeExternalLink() or maybeMakeExternalImage()
$url = Sanitizer::decodeCharReferences( $url );
-
+
# Escape any control characters introduced by the above step
$url = preg_replace( '/[\][<>"\\x00-\\x20\\x7F]/e', "urlencode('\\0')", $url );
@@ -1448,16 +1448,16 @@ class Parser
# Still some problems for cases where the ] is meant to be outside punctuation,
# and no image is in sight. See bug 2095.
#
- if( $text !== '' &&
- preg_match( "/^\](.*)/s", $m[3], $n ) &&
- strpos($text, '[') !== false
- )
+ if( $text !== '' &&
+ preg_match( "/^\](.*)/s", $m[3], $n ) &&
+ strpos($text, '[') !== false
+ )
{
$text .= ']'; # so that replaceExternalLinks($text) works later
$m[3] = $n[1];
}
# fix up urlencoded title texts
- if(preg_match('/%/', $m[1] ))
+ if(preg_match('/%/', $m[1] ))
# Should anchors '#' also be rejected?
$m[1] = str_replace( array('<', '>'), array('&lt;', '&gt;'), urldecode($m[1]) );
$trail = $m[3];
@@ -2049,14 +2049,14 @@ class Parser
function findColonNoLinks($str, &$before, &$after) {
$fname = 'Parser::findColonNoLinks';
wfProfileIn( $fname );
-
+
$pos = strpos( $str, ':' );
if( $pos === false ) {
// Nothing to find!
wfProfileOut( $fname );
return false;
}
-
+
$lt = strpos( $str, '<' );
if( $lt === false || $lt > $pos ) {
// Easy; no tag nesting to worry about
@@ -2065,14 +2065,14 @@ class Parser
wfProfileOut( $fname );
return $pos;
}
-
+
// Ugly state machine to walk through avoiding tags.
$state = MW_COLON_STATE_TEXT;
$stack = 0;
$len = strlen( $str );
for( $i = 0; $i < $len; $i++ ) {
$c = $str{$i};
-
+
switch( $state ) {
// (Using the number is a performance hack for common cases)
case 0: // MW_COLON_STATE_TEXT:
@@ -2574,7 +2574,7 @@ class Parser
wfProfileOut( $fname );
return $text;
}
-
+
/**
* Replace magic variables
* @private
@@ -2704,13 +2704,13 @@ class Parser
$mwMsg =& MagicWord::get( MAG_MSG );
$mwMsg->matchStartAndRemove( $part1 );
}
-
+
# Check for RAW:
$mwRaw =& MagicWord::get( MAG_RAW );
if ( $mwRaw->matchStartAndRemove( $part1 ) ) {
$forceRawInterwiki = true;
}
-
+
# Check if it is an internal message
$mwInt =& MagicWord::get( MAG_INT );
if ( $mwInt->matchStartAndRemove( $part1 ) ) {
@@ -2724,7 +2724,7 @@ class Parser
# Parser functions
if ( !$found ) {
wfProfileIn( __METHOD__ . '-pfunc' );
-
+
$colonPos = strpos( $part1, ':' );
if ( $colonPos !== false ) {
# Case sensitive functions
@@ -2764,7 +2764,7 @@ class Parser
}
}
}
- wfProfileOut( __METHOD__ . '-pfunc' );
+ wfProfileOut( __METHOD__ . '-pfunc' );
}
# Template table test
@@ -2852,7 +2852,7 @@ class Parser
}
$found = true;
}
-
+
# Template cache array insertion
# Use the original $piece['title'] not the mangled $part1, so that
# modifiers such as RAW: produce separate cache entries
@@ -2865,7 +2865,7 @@ class Parser
$text = $linestart . $text;
}
}
- wfProfileOut( __METHOD__ . '-loadtpl' );
+ wfProfileOut( __METHOD__ . '-loadtpl' );
}
# Recursive parsing, escaping and link table handling
@@ -3112,15 +3112,15 @@ class Parser
if( $mw->matchAndRemove( $text ) ) {
$this->mShowToc = false;
}
-
+
$mw = MagicWord::get( MAG_TOC );
if( $mw->match( $text ) ) {
$this->mShowToc = true;
$this->mForceTocPosition = true;
-
+
// Set a placeholder. At the end we'll fill it in with the TOC.
$text = $mw->replace( '<!--MWTOC-->', $text, 1 );
-
+
// Only keep the first one.
$text = $mw->replace( '', $text );
}
@@ -3476,7 +3476,7 @@ class Parser
$text .= $keyword . $x;
continue;
}
-
+
$id = $blank = '' ;
/** remove and save whitespaces in $blank */
@@ -3569,10 +3569,10 @@ class Parser
# Variable replacement
# Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags
$text = $this->replaceVariables( $text );
-
+
# Strip out <nowiki> etc. added via replaceVariables
$text = $this->strip( $text, $stripState, false, array( 'gallery' ) );
-
+
# Signatures
$sigText = $this->getUserSig( $user );
$text = strtr( $text, array(
@@ -3631,7 +3631,7 @@ class Parser
$username = $user->getName();
$nickname = $user->getOption( 'nickname' );
$nickname = $nickname === '' ? $username : $nickname;
-
+
if( $user->getBoolOption( 'fancysig' ) !== false ) {
# Sig. might contain markup; validate this
if( $this->validateSig( $nickname ) !== false ) {
@@ -3661,7 +3661,7 @@ class Parser
function validateSig( $text ) {
return( wfIsWellFormedXmlFragment( $text ) ? $text : false );
}
-
+
/**
* Clean up signature text
*
@@ -3675,7 +3675,7 @@ class Parser
function cleanSig( $text, $parsing = false ) {
global $wgTitle;
$this->startExternalParse( $wgTitle, new ParserOptions(), $parsing ? OT_WIKI : OT_MSG );
-
+
$substWord = MagicWord::get( MAG_SUBST );
$substRegex = '/\{\{(?!(?:' . $substWord->getBaseRegex() . '))/x' . $substWord->getRegexCase();
$substText = '{{' . $substWord->getSynonym( 0 );
@@ -3683,8 +3683,8 @@ class Parser
$text = preg_replace( $substRegex, $substText, $text );
$text = $this->cleanSigInSig( $text );
$text = $this->replaceVariables( $text );
-
- $this->clearState();
+
+ $this->clearState();
return $text;
}
@@ -3697,7 +3697,7 @@ class Parser
$text = preg_replace( '/~{3,5}/', '', $text );
return $text;
}
-
+
/**
* Set up some variables which are usually set up in parse()
* so that an external function can call some class members with confidence
@@ -3773,10 +3773,10 @@ class Parser
* The callback function should have the form:
* function myParserFunction( &$parser, $arg1, $arg2, $arg3 ) { ... }
*
- * The callback may either return the text result of the function, or an array with the text
- * in element 0, and a number of flags in the other elements. The names of the flags are
+ * The callback may either return the text result of the function, or an array with the text
+ * in element 0, and a number of flags in the other elements. The names of the flags are
* specified in the keys. Valid flags are:
- * found The text returned is valid, stop processing the template. This
+ * found The text returned is valid, stop processing the template. This
* is on by default.
* nowiki Wiki markup in the return value should be escaped
* noparse Unsafe HTML tags should not be stripped, etc.
@@ -3787,7 +3787,7 @@ class Parser
*
* @param mixed $id The magic word ID, or (deprecated) the function name. Function names are case-insensitive.
* @param mixed $callback The callback function (and object) to use
- * @param integer $flags a combination of the following flags:
+ * @param integer $flags a combination of the following flags:
* SFH_NO_HASH No leading hash, i.e. {{plural:...}} instead of {{#if:...}}
*
* @return The old callback function for this name, if any
@@ -4033,13 +4033,13 @@ class Parser
function renderPreTag( $text, $attribs, $parser ) {
// Backwards-compatibility hack
$content = preg_replace( '!<nowiki>(.*?)</nowiki>!is', '\\1', $text );
-
+
$attribs = Sanitizer::validateTagAttributes( $attribs, 'pre' );
return wfOpenElement( 'pre', $attribs ) .
wfEscapeHTMLTagsOnly( $content ) .
'</pre>';
}
-
+
/**
* Renders an image gallery from a text with one line per image.
* text labels may be given by using |-style alternative text. E.g.
@@ -4058,7 +4058,7 @@ class Parser
if( isset( $params['caption'] ) )
$ig->setCaption( $params['caption'] );
-
+
$lines = explode( "\n", $text );
foreach ( $lines as $line ) {
# match lines like these:
@@ -4170,7 +4170,7 @@ class Parser
# make sure there are no placeholders in thumbnail attributes
# that are later expanded to html- so expand them now and
# remove the tags
- $alt = $this->unstrip($alt, $this->mStripState);
+ $alt = $this->unstrip($alt, $this->mStripState);
$alt = Sanitizer::stripAllTags( $alt );
# Linker does the rest
@@ -4242,14 +4242,14 @@ class Parser
# strip NOWIKI etc. to avoid confusion (true-parameter causes HTML
# comments to be stripped as well)
$striparray = array();
-
+
$oldOutputType = $this->mOutputType;
$oldOptions = $this->mOptions;
$this->mOptions = new ParserOptions();
$this->mOutputType = OT_WIKI;
-
+
$striptext = $this->strip( $text, $striparray, true );
-
+
$this->mOutputType = $oldOutputType;
$this->mOptions = $oldOptions;
@@ -4293,7 +4293,7 @@ class Parser
/mix",
$striptext, -1,
PREG_SPLIT_DELIM_CAPTURE);
-
+
if( $mode == "get" ) {
if( $section == 0 ) {
// "Section 0" returns the content before any other section.
@@ -4360,7 +4360,7 @@ class Parser
$rv = trim( $rv );
return $rv;
}
-
+
/**
* This function returns the text of a section, specified by a number ($section).
* A section is text under a heading like == Heading == or \<h1\>Heading\</h1\>, or
@@ -4375,7 +4375,7 @@ class Parser
function getSection( $text, $section ) {
return $this->extractSections( $text, $section, "get" );
}
-
+
function replaceSection( $oldtext, $section, $text ) {
return $this->extractSections( $oldtext, $section, "replace", $text );
}
@@ -4448,7 +4448,7 @@ class ParserOutput
function addImage( $name ) { $this->mImages[$name] = 1; }
function addLanguageLink( $t ) { $this->mLanguageLinks[] = $t; }
function addExternalLink( $url ) { $this->mExternalLinks[$url] = 1; }
-
+
function setNewSection( $value ) {
$this->mNewSection = (bool)$value;
}
diff --git a/includes/ProxyTools.php b/includes/ProxyTools.php
index bed79c1..e99cb95 100644
--- a/includes/ProxyTools.php
+++ b/includes/ProxyTools.php
@@ -43,6 +43,10 @@ function wfGetIP() {
# Get list of trusted proxies
# Flipped for quicker access
$trustedProxies = array_flip( array_merge( $wgSquidServers, $wgSquidServersNoPurge ) );
+ # WERELATE
+ if ( substr($ip, 0, 3) === '10.' ) { # we're behind a load balancer, which can change its IP from time to time, but always starts with 10.
+ $trustedProxies[$ip] = true;
+ }
if ( count( $trustedProxies ) ) {
# Append XFF on to $ipchain
$forwardedFor = wfGetForwardedFor();
diff --git a/includes/RecentChange.php b/includes/RecentChange.php
index f320a47..57a251a 100644
--- a/includes/RecentChange.php
+++ b/includes/RecentChange.php
@@ -200,7 +200,7 @@ class RecentChange
$oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0,
$newId = 0)
{
- if ( $bot == 'default' ) {
+ if ($bot === 'default') {
$bot = $user->isBot();
}
@@ -341,7 +341,7 @@ class RecentChange
# A log entry is different to an edit in that previous revisions are
# not kept
/*static*/ function notifyLog( $timestamp, &$title, &$user, $comment, $ip='',
- $type, $action, $target, $logComment, $params )
+ $type, $action, $target, $logComment, $params, $minor = 0, $patrolled = 1) // WERELATE - added minor, patrolled
{
if ( !$ip ) {
$ip = wfGetIP();
@@ -357,7 +357,7 @@ class RecentChange
'rc_namespace' => $title->getNamespace(),
'rc_title' => $title->getDBkey(),
'rc_type' => RC_LOG,
- 'rc_minor' => 0,
+ 'rc_minor' => $minor ? 1 : 0,
'rc_cur_id' => $title->getArticleID(),
'rc_user' => $user->getID(),
'rc_user_text' => $user->getName(),
@@ -368,7 +368,7 @@ class RecentChange
'rc_moved_to_ns' => 0,
'rc_moved_to_title' => '',
'rc_ip' => $ip,
- 'rc_patrolled' => 1,
+ 'rc_patrolled' => $patrolled ? 1 : 0,
'rc_new' => 0 # obsolete
);
$rc->mExtra = array(
@@ -452,7 +452,7 @@ class RecentChange
$titleObj =& $this->getTitle();
if ( $rc_type == RC_LOG ) {
- $title = Namespace::getCanonicalName( $titleObj->getNamespace() ) . $titleObj->getText();
+ $title = Namespac::getCanonicalName( $titleObj->getNamespace() ) . $titleObj->getText();
} else {
$title = $titleObj->getPrefixedText();
}
diff --git a/includes/Revision.php b/includes/Revision.php
index 653bacb..1bb1425 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -25,7 +25,7 @@ class Revision {
* @static
* @access public
*/
- function newFromId( $id ) {
+ static function newFromId( $id ) {
return Revision::newFromConds(
array( 'page_id=rev_page',
'rev_id' => intval( $id ) ) );
@@ -42,7 +42,7 @@ class Revision {
* @access public
* @static
*/
- function newFromTitle( &$title, $id = 0 ) {
+ static function newFromTitle( &$title, $id = 0 ) {
if( $id ) {
$matchId = intval( $id );
} else {
@@ -66,7 +66,7 @@ class Revision {
* @return Revision
* @access public
*/
- function loadFromPageId( &$db, $pageid, $id = 0 ) {
+ static function loadFromPageId( &$db, $pageid, $id = 0 ) {
$conds=array('page_id=rev_page','rev_page'=>intval( $pageid ), 'page_id'=>intval( $pageid ));
if( $id ) {
$conds['rev_id']=intval($id);
@@ -130,7 +130,7 @@ class Revision {
* @static
* @access private
*/
- function newFromConds( $conditions ) {
+ static function newFromConds( $conditions ) {
$db =& wfGetDB( DB_SLAVE );
$row = Revision::loadFromConds( $db, $conditions );
if( is_null( $row ) ) {
@@ -150,7 +150,7 @@ class Revision {
* @static
* @access private
*/
- function loadFromConds( &$db, $conditions ) {
+ static function loadFromConds( &$db, $conditions ) {
$res = Revision::fetchFromConds( $db, $conditions );
if( $res ) {
$row = $res->fetchObject();
@@ -192,7 +192,7 @@ class Revision {
* @static
* @access public
*/
- function fetchRevision( &$title ) {
+ static function fetchRevision( &$title ) {
return Revision::fetchFromConds(
wfGetDB( DB_SLAVE ),
array( 'rev_id=page_latest',
@@ -212,7 +212,7 @@ class Revision {
* @static
* @access private
*/
- function fetchFromConds( &$db, $conditions ) {
+ static function fetchFromConds( &$db, $conditions ) {
$res = $db->select(
array( 'page', 'revision' ),
array( 'page_namespace',
diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index f5a24df..8bf53e7 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -921,7 +921,7 @@ class Sanitizer {
* @return string
* @public
*/
- function decodeCharReferences( $text ) {
+ static function decodeCharReferences( $text ) {
return preg_replace_callback(
MW_CHAR_REFS_REGEX,
array( 'Sanitizer', 'decodeCharReferencesCallback' ),
@@ -932,7 +932,7 @@ class Sanitizer {
* @param string $matches
* @return string
*/
- function decodeCharReferencesCallback( $matches ) {
+ static function decodeCharReferencesCallback( $matches ) {
if( $matches[1] != '' ) {
return Sanitizer::decodeEntity( $matches[1] );
} elseif( $matches[2] != '' ) {
@@ -953,7 +953,7 @@ class Sanitizer {
* @return string
* @private
*/
- function decodeChar( $codepoint ) {
+ static function decodeChar( $codepoint ) {
if( Sanitizer::validateCodepoint( $codepoint ) ) {
return codepointToUtf8( $codepoint );
} else {
@@ -969,7 +969,7 @@ class Sanitizer {
* @param string $name
* @return string
*/
- function decodeEntity( $name ) {
+ static function decodeEntity( $name ) {
global $wgHtmlEntities;
if( isset( $wgHtmlEntities[$name] ) ) {
return codepointToUtf8( $wgHtmlEntities[$name] );
diff --git a/includes/SiteStatsUpdate.php b/includes/SiteStatsUpdate.php
index 1b6d380..995493e 100644
--- a/includes/SiteStatsUpdate.php
+++ b/includes/SiteStatsUpdate.php
@@ -39,7 +39,8 @@ class SiteStatsUpdate {
$dbw =& wfGetDB( DB_MASTER );
# First retrieve the row just to find out which schema we're in
- $row = $dbw->selectRow( 'site_stats', '*', false, $fname );
+ // WERELATE - comment out unnecessary database read
+// $row = $dbw->selectRow( 'site_stats', '*', false, $fname );
$updates = '';
@@ -47,31 +48,31 @@ class SiteStatsUpdate {
$this->appendUpdate( $updates, 'ss_total_edits', $this->mEdits );
$this->appendUpdate( $updates, 'ss_good_articles', $this->mGood );
- if ( isset( $row->ss_total_pages ) ) {
+// if ( isset( $row->ss_total_pages ) ) {
# Update schema if required
- if ( $row->ss_total_pages == -1 && !$this->mViews ) {
- $dbr =& wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') );
- extract( $dbr->tableNames( 'page', 'user' ) );
+// if ( $row->ss_total_pages == -1 && !$this->mViews ) {
+// $dbr =& wfGetDB( DB_SLAVE, array( 'SpecialStatistics', 'vslow') );
+// extract( $dbr->tableNames( 'page', 'user' ) );
- $sql = "SELECT COUNT(page_namespace) AS total FROM $page";
- $res = $dbr->query( $sql, $fname );
- $pageRow = $dbr->fetchObject( $res );
- $pages = $pageRow->total + $this->mPages;
+// $sql = "SELECT COUNT(page_namespace) AS total FROM $page";
+// $res = $dbr->query( $sql, $fname );
+// $pageRow = $dbr->fetchObject( $res );
+// $pages = $pageRow->total + $this->mPages;
- $sql = "SELECT COUNT(user_id) AS total FROM $user";
- $res = $dbr->query( $sql, $fname );
- $userRow = $dbr->fetchObject( $res );
- $users = $userRow->total + $this->mUsers;
+// $sql = "SELECT COUNT(user_id) AS total FROM $user";
+// $res = $dbr->query( $sql, $fname );
+// $userRow = $dbr->fetchObject( $res );
+// $users = $userRow->total + $this->mUsers;
- if ( $updates ) {
- $updates .= ',';
- }
- $updates .= "ss_total_pages=$pages, ss_users=$users";
- } else {
+// if ( $updates ) {
+// $updates .= ',';
+// }
+// $updates .= "ss_total_pages=$pages, ss_users=$users";
+// } else {
$this->appendUpdate( $updates, 'ss_total_pages', $this->mPages );
$this->appendUpdate( $updates, 'ss_users', $this->mUsers );
- }
- }
+// }
+// }
if ( $updates ) {
$site_stats = $dbw->tableName( 'site_stats' );
$sql = $dbw->limitResultForUpdate("UPDATE $site_stats SET $updates", 1);
diff --git a/includes/Skin.php b/includes/Skin.php
index 8a03f46..ddf2809 100644
--- a/includes/Skin.php
+++ b/includes/Skin.php
@@ -109,7 +109,7 @@ class Skin extends Linker {
*/
function &newFromKey( $key ) {
global $wgStyleDirectory;
-
+
$key = Skin::normalizeKey( $key );
$skinNames = Skin::getSkinNames();
@@ -169,7 +169,7 @@ class Skin extends Linker {
$this->addMetadataLinks($out);
$this->mRevisionId = $out->mRevisionId;
-
+
$this->preloadExistence();
wfProfileOut( $fname );
@@ -186,14 +186,14 @@ class Skin extends Linker {
} else {
$otherTab = $wgTitle->getTalkPage();
}
- $lb = new LinkBatch( array(
+ $lb = new LinkBatch( array(
$wgUser->getUserPage(),
$wgUser->getTalkPage(),
$otherTab
));
$lb->execute();
}
-
+
function addMetadataLinks( &$out ) {
global $wgTitle, $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf;
global $wgRightsPage, $wgRightsUrl;
@@ -262,7 +262,8 @@ class Skin extends Linker {
function getHeadScripts() {
global $wgStylePath, $wgUser, $wgAllowUserJs, $wgJsMimeType;
- $r = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
+// WERELATE - already included
+// $r = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
$userpage = $wgUser->getUserPage();
$userjs = htmlspecialchars( $this->makeUrl(
@@ -654,7 +655,8 @@ END;
(($wgTitle->getArticleId() == 0) || ($action == "history")) &&
($n = $wgTitle->isDeleted() ) )
{
- if ( $wgUser->isAllowed( 'delete' ) ) {
+// WERELATE: added title parm; undelete action
+ if ( $wgUser->isAllowed( 'undelete', $wgTitle ) ) {
$msg = 'thisisdeleted';
} else {
$msg = 'viewdeleted';
@@ -871,7 +873,8 @@ END;
}
if ( $wgTitle->getArticleId() ) {
$s .= "\n<br />";
- if($wgUser->isAllowed('delete')) { $s .= $this->deleteThisPage(); }
+// WERELATE: added title parm
+ if($wgUser->isAllowed('delete', $wgTitle)) { $s .= $this->deleteThisPage(); }
if($wgUser->isAllowed('protect')) { $s .= $sep . $this->protectThisPage(); }
if($wgUser->isAllowed('move')) { $s .= $sep . $this->moveThisPage(); }
}
@@ -1135,7 +1138,8 @@ END;
global $wgUser, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
- if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) {
+// WERELATE: added title parm
+ if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete', $wgTitle) ) {
$t = wfMsg( 'deletethispage' );
$s = $this->makeKnownLinkObj( $wgTitle, $t, 'action=delete' );
@@ -1354,7 +1358,7 @@ END;
if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
return '';
}
-
+
# __NEWSECTIONLINK___ changes behaviour here
# If it's present, the link points to this page, otherwise
# it points to the talk page
@@ -1365,7 +1369,7 @@ END;
} else {
$title =& $wgTitle->getTalkPage();
}
-
+
return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit&section=new' );
}
@@ -1453,7 +1457,7 @@ END;
$key = "{$wgDBname}:sidebar";
$cacheSidebar = $wgEnableSidebarCache &&
($wgLanguageCode == $wgContLanguageCode);
-
+
if ($cacheSidebar) {
$cachedsidebar = $parserMemc->get( $key );
if ($cachedsidebar!="") {
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php
index 6657d38..4b0f234 100644
--- a/includes/SkinTemplate.php
+++ b/includes/SkinTemplate.php
@@ -32,6 +32,8 @@ if ( ! defined( 'MEDIAWIKI' ) )
*/
require_once 'GlobalFunctions.php';
+// WERELATE - added
+require_once("extensions/familytree/FamilyTreeUtil.php");
/**
* Wrapper object for MediaWiki's localization functions,
@@ -95,6 +97,9 @@ class SkinTemplate extends Skin {
*/
var $template;
+// WERELATE - added
+ var $trees;
+
/**#@-*/
/**
@@ -109,6 +114,8 @@ class SkinTemplate extends Skin {
$this->skinname = 'monobook';
$this->stylename = 'monobook';
$this->template = 'QuickTemplate';
+// WERELATE - added
+ $this->trees = null;
}
/**
@@ -404,6 +411,9 @@ class SkinTemplate extends Skin {
}
wfProfileOut( "$fname-stuff4" );
+// WERELATE - added trees
+ $tpl->setRef('trees', $this->getTrees());
+
# Personal toolbar
$tpl->set('personal_urls', $this->buildPersonalUrls());
$content_actions = $this->buildContentActionUrls();
@@ -434,6 +444,17 @@ class SkinTemplate extends Skin {
wfProfileOut( $fname );
}
+// WERELATE - added
+ function getTrees() {
+ if ($this->trees == null) {
+ $this->trees = array();
+ if ($this->mUser->isLoggedIn() && FamilyTreeUtil::isTreePage($this->mTitle->getNamespace(), $this->mTitle->getDBkey())) {
+ $this->trees = FamilyTreeUtil::getOwnerTrees($this->mUser, $this->mTitle, true);
+ }
+ }
+ return $this->trees;
+ }
+
/**
* Output the string, or print error message if it's
* an error object of the appropriate type.
@@ -530,7 +551,7 @@ class SkinTemplate extends Skin {
}
}
- wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$wgTitle ) );
+ wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$wgTitle ) );
wfProfileOut( $fname );
return $personal_urls;
}
@@ -543,6 +564,15 @@ class SkinTemplate extends Skin {
return $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] );
}
+// WERELATE: added function
+ function getMsgOrEmpty($message) {
+ $text = wfMsg($message);
+ if ($text == "&lt;$message&gt;") {
+ return '';
+ }
+ return $text;
+ }
+
function tabAction( $title, $message, $selected, $query='', $checkEdit=false ) {
$classes = array();
if( $selected ) {
@@ -550,18 +580,21 @@ class SkinTemplate extends Skin {
}
if( $checkEdit && $title->getArticleId() == 0 ) {
$classes[] = 'new';
- $query = 'action=edit';
+// WERELATE: removed action=edit
+// $query = 'action=edit';
}
$text = wfMsg( $message );
if ( $text == "&lt;$message&gt;" ) {
global $wgContLang;
- $text = $wgContLang->getNsText( Namespace::getSubject( $title->getNamespace() ) );
+ $text = $wgContLang->getNsText( Namespac::getSubject( $title->getNamespace() ) );
}
+// WERELATE: added title attribute
return array(
'class' => implode( ' ', $classes ),
'text' => $text,
+ 'title' => $this->getMsgOrEmpty($message.'tip'),
'href' => $title->getLocalUrl( $query ) );
}
@@ -621,27 +654,33 @@ class SkinTemplate extends Skin {
'',
true);
- wfProfileIn( "$fname-edit" );
+// WERELATE: added title attributes; switch order of edit and addsection
+ wfProfileIn( "$fname-edit" );
if ( $this->mTitle->userCanEdit() && ( $this->mTitle->exists() || $this->mTitle->userCanCreate() ) ) {
$istalk = $this->mTitle->isTalkPage();
$istalkclass = $istalk?' istalk':'';
- $content_actions['edit'] = array(
- 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ? 'selected' : '').$istalkclass,
- 'text' => wfMsg('edit'),
- 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
- );
if ( $istalk || $wgOut->showNewSectionLink() ) {
$content_actions['addsection'] = array(
'class' => $section == 'new'?'selected':false,
'text' => wfMsg('addsection'),
+ 'title' => $this->getMsgOrEmpty('addsectiontip'),
'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
);
}
+
+ $content_actions['edit'] = array(
+ 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ? 'selected' : '').$istalkclass,
+ 'text' => wfMsg('edit'),
+ 'title' => $this->getMsgOrEmpty('edittip'),
+ 'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
+ );
+
} else {
$content_actions['viewsource'] = array(
'class' => ($action == 'edit') ? 'selected' : false,
'text' => wfMsg('viewsource'),
+ 'title' => $this->getMsgOrEmpty('viewsourcetip'),
'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
);
}
@@ -653,6 +692,7 @@ class SkinTemplate extends Skin {
$content_actions['history'] = array(
'class' => ($action == 'history') ? 'selected' : false,
'text' => wfMsg('history_short'),
+ 'title' => $this->getMsgOrEmpty('historytip'),
'href' => $this->mTitle->getLocalUrl( 'action=history')
);
@@ -661,6 +701,7 @@ class SkinTemplate extends Skin {
$content_actions['protect'] = array(
'class' => ($action == 'protect') ? 'selected' : false,
'text' => wfMsg('protect'),
+ 'title' => $this->getMsgOrEmpty('protecttip'),
'href' => $this->mTitle->getLocalUrl( 'action=protect' )
);
@@ -668,14 +709,17 @@ class SkinTemplate extends Skin {
$content_actions['unprotect'] = array(
'class' => ($action == 'unprotect') ? 'selected' : false,
'text' => wfMsg('unprotect'),
+ 'title' => $this->getMsgOrEmpty('unprotecttip'),
'href' => $this->mTitle->getLocalUrl( 'action=unprotect' )
);
}
}
- if($wgUser->isAllowed('delete')){
+// WERELATE: added title parm to isAllowed
+ if($wgUser->isAllowed('delete', $this->mTitle)){
$content_actions['delete'] = array(
'class' => ($action == 'delete') ? 'selected' : false,
'text' => wfMsg('delete'),
+ 'title' => $this->getMsgOrEmpty('deletetip'),
'href' => $this->mTitle->getLocalUrl( 'action=delete' )
);
}
@@ -684,17 +728,20 @@ class SkinTemplate extends Skin {
$content_actions['move'] = array(
'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == NS_SPECIAL) ? 'selected' : false,
'text' => wfMsg('move'),
+ 'title' => $this->getMsgOrEmpty('movetip'),
'href' => $moveTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
);
}
} else {
//article doesn't exist or is deleted
- if( $wgUser->isAllowed( 'delete' ) ) {
+// WERELATE: added title parm; undelete action
+ if( $wgUser->isAllowed( 'undelete', $this->mTitle ) ) {
if( $n = $this->mTitle->isDeleted() ) {
$undelTitle = Title::makeTitle( NS_SPECIAL, 'Undelete' );
$content_actions['undelete'] = array(
'class' => false,
'text' => wfMsgExt( 'undelete_short', array( 'parsemag' ), $n ),
+ 'title' => $this->getMsgOrEmpty('undeletetip'),
'href' => $undelTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
#'href' => $this->makeSpecialUrl("Undelete/$this->thispage")
);
@@ -708,12 +755,14 @@ class SkinTemplate extends Skin {
$content_actions['watch'] = array(
'class' => ($action == 'watch' or $action == 'unwatch') ? 'selected' : false,
'text' => wfMsg('watch'),
+ 'title' => $this->getMsgOrEmpty('watchtip'),
'href' => $this->mTitle->getLocalUrl( 'action=watch' )
);
} else {
$content_actions['unwatch'] = array(
'class' => ($action == 'unwatch' or $action == 'watch') ? 'selected' : false,
'text' => wfMsg('unwatch'),
+ 'title' => $this->getMsgOrEmpty('unwatchtip'),
'href' => $this->mTitle->getLocalUrl( 'action=unwatch' )
);
}
@@ -961,7 +1010,7 @@ class SkinTemplate extends Skin {
wfProfileIn( $fname );
$out = false;
wfRunHooks( 'SkinTemplateSetupPageCss', array( &$out ) );
-
+
wfProfileOut( $fname );
return $out;
}
diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php
index b3f67ab..17fe4913 100644
--- a/includes/SpecialBlockip.php
+++ b/includes/SpecialBlockip.php
@@ -96,6 +96,17 @@ class IPBlockForm {
$token = htmlspecialchars( $wgUser->editToken() );
+// WERELATE - add blockNotice here and in addHTML below
+ $blockNotice = '';
+ if ($this->BlockAddress) {
+ $dbr =& wfGetDB( DB_SLAVE );
+ $expiryDate = $dbr->selectField('ipblocks', 'ipb_expiry', array('ipb_address' => $this->BlockAddress));
+ if ($expiryDate) {
+ global $wgLang;
+ $blockNotice = wfMsg('userblocked', $wgLang->timeanddate(wfTimestamp( TS_MW, $expiryDate )));
+ }
+ }
+
$wgOut->addHTML( "
<form id=\"blockip\" method=\"post\" action=\"{$action}\">
<table border='0'>
@@ -103,6 +114,7 @@ class IPBlockForm {
<td align=\"right\">{$mIpaddress}:</td>
<td align=\"left\">
<input tabindex='1' type='text' size='20' name=\"wpBlockAddress\" value=\"{$scBlockAddress}\" />
+ $blockNotice
</td>
</tr>
<tr>");
@@ -215,7 +227,8 @@ class IPBlockForm {
wfRunHooks('BlockIpComplete', array($ban, $wgUser));
# Make log entry
- $log = new LogPage( 'block' );
+// WERELATE: don't add to RC
+ $log = new LogPage( 'block', false );
$log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ),
$this->BlockReason, $expirestr );
diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php
index a9e8573..7038d3c 100644
--- a/includes/SpecialLog.php
+++ b/includes/SpecialLog.php
@@ -61,7 +61,7 @@ class LogReader {
function setupQuery( $request ) {
$page = $this->db->tableName( 'page' );
$user = $this->db->tableName( 'user' );
- $this->joinClauses = array(
+ $this->joinClauses = array(
"LEFT OUTER JOIN $page ON log_namespace=page_namespace AND log_title=page_title",
"INNER JOIN $user ON user_id=log_user" );
$this->whereClauses = array();
@@ -101,11 +101,11 @@ class LogReader {
if ( is_null( $usertitle ) )
return false;
$this->user = $usertitle->getText();
-
+
/* Fetch userid at first, if known, provides awesome query plan afterwards */
$userid = $this->db->selectField('user','user_id',array('user_name'=>$this->user));
if (!$userid)
- /* It should be nicer to abort query at all,
+ /* It should be nicer to abort query at all,
but for now it won't pass anywhere behind the optimizer */
$this->whereClauses[] = "NULL";
else
@@ -331,6 +331,19 @@ class LogViewer {
'&wpMovetalk=0' ) . ')';
}
}
+ // WERELATE: newuser log
+ global $wgUser;
+ if ($s->log_type == 'newuser') {
+ if (!$wgUser->isAllowed('block')) {
+ // block normal users from seeing IP addresses
+ $comment = '';
+ }
+ else if (isset($paramArray[0])) {
+ // add a block link
+ $specialTitle = Title::makeTitle( NS_SPECIAL, 'Blockip' );
+ $revert = '('.$this->skin->makeKnownLinkObj($specialTitle, wfMsgHtml('blocklink').' IP', 'ip='.urlencode($paramArray[0])).')';
+ }
+ }
$action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
$out = "<li>$time $userLink $action $comment $revert</li>\n";
diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php
index 3939712..0c15417 100644
--- a/includes/SpecialMovepage.php
+++ b/includes/SpecialMovepage.php
@@ -69,7 +69,8 @@ class MovePageForm {
if( $this->newTitle == '' ) {
# Show the current title as a default
# when the form is first opened.
- $encNewTitle = $encOldTitle;
+// WERELATE - remove (d+) from end of person/family title
+ $encNewTitle = ($ot->getNamespace() == NS_PERSON || $ot->getNamespace() == NS_FAMILY) ? preg_replace('/\s+\(\d+\)$/', '', $encOldTitle) : $encOldTitle;
} else {
if( $err == '' ) {
$nt = Title::newFromURL( $this->newTitle );
@@ -87,7 +88,9 @@ class MovePageForm {
}
$encReason = htmlspecialchars( $this->reason );
- if ( $err == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) {
+// WERELATE: added title parm
+ $tempTitle = $this->newTitle ? Title::newFromURL($this->newTitle) : null;
+ if ( $err == 'articleexists' && $wgUser->isAllowed( 'delete', $tempTitle ) ) {
$wgOut->addWikiText( wfMsg( 'delete_and_move_text', $encNewTitle ) );
$movepagebtn = wfMsgHtml( 'delete_and_move' );
$confirmText = wfMsgHtml( 'delete_and_move_confirm' );
@@ -99,12 +102,14 @@ class MovePageForm {
</td>
<td align='left'><label for='wpConfirm'>{$confirmText}</label></td>
</tr>";
+ $cancel = "&nbsp; <a href=\"{$ot->getLocalURL()}\">Cancel</a>";
$err = '';
} else {
$wgOut->addWikiText( wfMsg( 'movepagetext' ) );
$movepagebtn = wfMsgHtml( 'movepagebtn' );
$submitVar = 'wpMove';
$confirm = false;
+ $cancel = '';
}
$oldTalk = $ot->getTalkPage();
@@ -160,12 +165,14 @@ class MovePageForm {
<td><label for=\"wpMovetalk\">{$movetalk}</label></td>
</tr>" );
}
+ // WERELATE - added id='wpMove' and cancel
$wgOut->addHTML( "
{$confirm}
<tr>
<td>&nbsp;</td>
<td align='left'>
- <input type='submit' name=\"{$submitVar}\" value=\"{$movepagebtn}\" />
+ <input type='submit' id='wpMove' name=\"{$submitVar}\" value=\"{$movepagebtn}\" />
+ $cancel
</td>
</tr>
</table>
@@ -187,11 +194,18 @@ class MovePageForm {
# Variables beginning with 'o' for old article 'n' for new article
+// WERELATE - default ns on new title to ns on old title
$ot = Title::newFromText( $this->oldTitle );
- $nt = Title::newFromText( $this->newTitle );
+ $nt = Title::newFromText( $this->newTitle, $ot->getNamespace() );
+
+// WERELATE - added: PERSON and FAMILY pages must have a unique id
+ if ($nt && ($nt->getNamespace() == NS_PERSON || $nt->getNamespace() == NS_FAMILY) && !StructuredData::titleStringHasId($nt->getText())) {
+ $nt = StructuredData::appendUniqueId($nt);
+ }
# Delete to make way if requested
- if ( $wgUser->isAllowed( 'delete' ) && $this->deleteAndMove ) {
+// WERELATE: added title parm and $nt condition
+ if ($nt && $wgUser->isAllowed( 'delete', $nt ) && $this->deleteAndMove ) {
$article = new Article( $nt );
// This may output an error message and exit
$article->doDelete( wfMsgForContent( 'delete_and_move_reason' ) );
@@ -216,7 +230,7 @@ class MovePageForm {
if( $ott->exists() ) {
if( $wgRequest->getVal( 'wpMovetalk' ) == 1 && !$ot->isTalkPage() && !$nt->isTalkPage() ) {
$ntt = $nt->getTalkPage();
-
+
# Attempt the move
$error = $ott->moveTo( $ntt, true, $this->reason );
if ( $error === true ) {
@@ -245,7 +259,7 @@ class MovePageForm {
function showSuccess() {
global $wgOut, $wgRequest, $wgRawHtml;
-
+
$wgOut->setPagetitle( wfMsg( 'movepage' ) );
$wgOut->setSubtitle( wfMsg( 'pagemovedsub' ) );
@@ -254,7 +268,7 @@ class MovePageForm {
$talkmoved = $wgRequest->getVal('talkmoved');
$text = wfMsg( 'pagemovedtext', $oldText, $newText );
-
+
$allowHTML = $wgRawHtml;
$wgRawHtml = false;
$wgOut->addWikiText( $text );
@@ -271,13 +285,13 @@ class MovePageForm {
}
}
}
-
+
function showLogFragment( $title, &$out ) {
$out->addHtml( wfElement( 'h2', NULL, LogPage::logName( 'move' ) ) );
$request = new FauxRequest( array( 'page' => $title->getPrefixedText(), 'type' => 'move' ) );
$viewer = new LogViewer( new LogReader( $request ) );
$viewer->showList( $out );
}
-
+
}
?>
diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php
index c6003b7..cb4d39d 100644
--- a/includes/SpecialPreferences.php
+++ b/includes/SpecialPreferences.php
@@ -52,11 +52,13 @@ class PreferencesForm {
$this->mNick = $request->getVal( 'wpNick' );
$this->mUserLanguage = $request->getVal( 'wpUserLanguage' );
$this->mUserVariant = $request->getVal( 'wpUserVariant' );
- $this->mSearch = $request->getVal( 'wpSearch' );
+// WERELATE removed
+// $this->mSearch = $request->getVal( 'wpSearch' );
$this->mRecent = $request->getVal( 'wpRecent' );
$this->mHourDiff = $request->getVal( 'wpHourDiff' );
- $this->mSearchLines = $request->getVal( 'wpSearchLines' );
- $this->mSearchChars = $request->getVal( 'wpSearchChars' );
+// WERELATE removed
+// $this->mSearchLines = $request->getVal( 'wpSearchLines' );
+// $this->mSearchChars = $request->getVal( 'wpSearchChars' );
$this->mImageSize = $request->getVal( 'wpImageSize' );
$this->mThumbSize = $request->getInt( 'wpThumbSize' );
$this->mUnderline = $request->getInt( 'wpOpunderline' );
@@ -84,15 +86,16 @@ class PreferencesForm {
# Search namespace options
# Note: namespaces don't necessarily have consecutive keys
- $this->mSearchNs = array();
- if ( $this->mPosted ) {
- $namespaces = $wgContLang->getNamespaces();
- foreach ( $namespaces as $i => $namespace ) {
- if ( $i >= 0 ) {
- $this->mSearchNs[$i] = $request->getCheck( "wpNs$i" ) ? 1 : 0;
- }
- }
- }
+// WERELATE removed
+// $this->mSearchNs = array();
+// if ( $this->mPosted ) {
+// $namespaces = $wgContLang->getNamespaces();
+// foreach ( $namespaces as $i => $namespace ) {
+// if ( $i >= 0 ) {
+// $this->mSearchNs[$i] = $request->getCheck( "wpNs$i" ) ? 1 : 0;
+// }
+// }
+// }
# Validate language
if ( !preg_match( '/^[a-z\-]*$/', $this->mUserLanguage ) ) {
@@ -258,9 +261,10 @@ class PreferencesForm {
$wgUser->setOption( 'math', $this->mMath );
}
$wgUser->setOption( 'date', $this->validateDate( $this->mDate, 0, 20 ) );
- $wgUser->setOption( 'searchlimit', $this->validateIntOrNull( $this->mSearch ) );
- $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) );
- $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars ) );
+// WERELATE removed
+// $wgUser->setOption( 'searchlimit', $this->validateIntOrNull( $this->mSearch ) );
+// $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines ) );
+// $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars ) );
$wgUser->setOption( 'rclimit', $this->validateIntOrNull( $this->mRecent ) );
$wgUser->setOption( 'wllimit', $this->validateIntOrNull( $this->mWatchlistEdits, 0, 1000 ) );
$wgUser->setOption( 'rows', $this->validateInt( $this->mRows, 4, 1000 ) );
@@ -273,9 +277,10 @@ class PreferencesForm {
$wgUser->setOption( 'watchlistdays', $this->validateFloat( $this->mWatchlistDays, 0, 7 ) );
# Set search namespace options
- foreach( $this->mSearchNs as $i => $value ) {
- $wgUser->setOption( "searchNs{$i}", $value );
- }
+// WERELATE removed
+// foreach( $this->mSearchNs as $i => $value ) {
+// $wgUser->setOption( "searchNs{$i}", $value );
+// }
if( $wgEnableEmail && $wgEnableUserEmail ) {
$wgUser->setOption( 'disablemail', $this->mEmailFlag );
@@ -361,9 +366,10 @@ class PreferencesForm {
$this->mCols = $wgUser->getOption( 'cols' );
$this->mStubs = $wgUser->getOption( 'stubthreshold' );
$this->mHourDiff = $wgUser->getOption( 'timecorrection' );
- $this->mSearch = $wgUser->getOption( 'searchlimit' );
- $this->mSearchLines = $wgUser->getOption( 'contextlines' );
- $this->mSearchChars = $wgUser->getOption( 'contextchars' );
+// WERELATE removed
+// $this->mSearch = $wgUser->getOption( 'searchlimit' );
+// $this->mSearchLines = $wgUser->getOption( 'contextlines' );
+// $this->mSearchChars = $wgUser->getOption( 'contextchars' );
$this->mImageSize = $wgUser->getOption( 'imagesize' );
$this->mThumbSize = $wgUser->getOption( 'thumbsize' );
$this->mRecent = $wgUser->getOption( 'rclimit' );
@@ -377,12 +383,13 @@ class PreferencesForm {
$this->mToggles[$tname] = $wgUser->getOption( $tname );
}
- $namespaces = $wgContLang->getNamespaces();
- foreach ( $namespaces as $i => $namespace ) {
- if ( $i >= NS_MAIN ) {
- $this->mSearchNs[$i] = $wgUser->getOption( 'searchNs'.$i );
- }
- }
+// WERELATE removed
+// $namespaces = $wgContLang->getNamespaces();
+// foreach ( $namespaces as $i => $namespace ) {
+// if ( $i >= NS_MAIN ) {
+// $this->mSearchNs[$i] = $wgUser->getOption( 'searchNs'.$i );
+// }
+// }
}
/**
@@ -515,7 +522,8 @@ class PreferencesForm {
$emailauthenticated = wfMsg( 'noemailprefs' );
}
- $ps = $this->namespacesCheckboxes();
+// WERELATE removed
+// $ps = $this->namespacesCheckboxes();
$enotifwatchlistpages = ($wgEnotifWatchlist) ? $this->getToggle( 'enotifwatchlistpages', false, $disableEmailPrefs ) : '';
$enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : '';
@@ -649,6 +657,20 @@ class PreferencesForm {
);
}
}
+ // WERELATE ADDED
+ if ($wgUser->getOption('wrnoads') > '') {
+ $donateLink = '';
+ if ($wgUser->getOption('wrnoads') < wfTimestampNow()) {
+ $donateLink = ' - <a href="/wiki/WeRelate:Donate">Donate</a>';
+ }
+ $wgOut->addHTML(
+ $this->addRow(
+ '<label for="wrNoAds">' . 'Ads disabled until:' . '</label>',
+ '<span id="wrNoAds">' . $wgLang->date($wgUser->getOption('wrnoads')) . $donateLink . '</span>'
+ )
+ );
+ }
+
$wgOut->addHTML('</table>');
# Password
@@ -872,20 +894,21 @@ class PreferencesForm {
$wgOut->addHTML( '</fieldset>' );
# Search
- $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'searchresultshead' ) . '</legend><table>' .
- $this->addRow(
- wfLabel( wfMsg( 'resultsperpage' ), 'wpSearch' ),
- wfInput( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) )
- ) .
- $this->addRow(
- wfLabel( wfMsg( 'contextlines' ), 'wpSearchLines' ),
- wfInput( 'wpSearchLines', 4, $this->mSearchLines, array( 'id' => 'wpSearchLines' ) )
- ) .
- $this->addRow(
- wfLabel( wfMsg( 'contextchars' ), 'wpSearchChars' ),
- wfInput( 'wpSearchChars', 4, $this->mSearchChars, array( 'id' => 'wpSearchChars' ) )
- ) .
- "</table><fieldset><legend>" . wfMsg( 'defaultns' ) . "</legend>$ps</fieldset></fieldset>" );
+// WERELATE removed
+// $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'searchresultshead' ) . '</legend><table>' .
+// $this->addRow(
+// wfLabel( wfMsg( 'resultsperpage' ), 'wpSearch' ),
+// wfInput( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) )
+// ) .
+// $this->addRow(
+// wfLabel( wfMsg( 'contextlines' ), 'wpSearchLines' ),
+// wfInput( 'wpSearchLines', 4, $this->mSearchLines, array( 'id' => 'wpSearchLines' ) )
+// ) .
+// $this->addRow(
+// wfLabel( wfMsg( 'contextchars' ), 'wpSearchChars' ),
+// wfInput( 'wpSearchChars', 4, $this->mSearchChars, array( 'id' => 'wpSearchChars' ) )
+// ) .
+// "</table><fieldset><legend>" . wfMsg( 'defaultns' ) . "</legend>$ps</fieldset></fieldset>" );
# Misc
#
diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php
index 97f810d..80551d6 100644
--- a/includes/SpecialRecentchanges.php
+++ b/includes/SpecialRecentchanges.php
@@ -538,8 +538,8 @@ function rcOptionsPanel( $defaults, $nondefaults ) {
$links[] = wfMsgHtml( 'rcshowhideminor', $minorLink );
$links[] = wfMsgHtml( 'rcshowhidebots', $botLink );
- $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink );
- $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink );
+// $links[] = wfMsgHtml( 'rcshowhideanons', $anonsLink ); // WERELATE - removed
+// $links[] = wfMsgHtml( 'rcshowhideliu', $liuLink ); // WERELATE - removed
if( $wgUseRCPatrol )
$links[] = wfMsgHtml( 'rcshowhidepatr', $patrLink );
$links[] = wfMsgHtml( 'rcshowhidemine', $myselfLink );
@@ -573,7 +573,7 @@ function rcNamespaceForm( $namespace, $invert, $nondefaults, $categories_any ) {
global $wgScript, $wgAllowCategorizedRecentChanges, $wgRequest;
$t = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
- $namespaceselect = HTMLnamespaceselector($namespace, '');
+ $namespaceselect = HTMLnamespaceselector($namespace, '', true); // WERELATE - add true as third parameter
$submitbutton = '<input type="submit" value="' . wfMsgHtml( 'allpagessubmit' ) . "\" />\n";
$invertbox = "<input type='checkbox' name='invert' value='1' id='nsinvert'" . ( $invert ? ' checked="checked"' : '' ) . ' />';
diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php
index 4db27e8..27bc8c3 100644
--- a/includes/SpecialSearch.php
+++ b/includes/SpecialSearch.php
@@ -1,413 +1,3 @@
<?php
-# Copyright (C) 2004 Brion Vibber <brion@pobox.com>
-# http://www.mediawiki.org/
-#
-# This program 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.
-#
-# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# http://www.gnu.org/copyleft/gpl.html
-
-/**
- * Run text & title search and display the output
- * @package MediaWiki
- * @subpackage SpecialPage
- */
-
-/**
- * Entry point
- *
- * @param $par String: (default '')
- */
-function wfSpecialSearch( $par = '' ) {
- global $wgRequest, $wgUser;
-
- $search = $wgRequest->getText( 'search', $par );
- $searchPage = new SpecialSearch( $wgRequest, $wgUser );
- if( $wgRequest->getVal( 'fulltext' ) ||
- !is_null( $wgRequest->getVal( 'offset' ) ) ||
- !is_null ($wgRequest->getVal( 'searchx' ) ) ) {
- $searchPage->showResults( $search );
- } else {
- $searchPage->goResult( $search );
- }
-}
-
-/**
- * @todo document
- * @package MediaWiki
- * @subpackage SpecialPage
- */
-class SpecialSearch {
-
- /**
- * Set up basic search parameters from the request and user settings.
- * Typically you'll pass $wgRequest and $wgUser.
- *
- * @param WebRequest $request
- * @param User $user
- * @public
- */
- function SpecialSearch( &$request, &$user ) {
- list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, 'searchlimit' );
-
- if( $request->getCheck( 'searchx' ) ) {
- $this->namespaces = $this->powerSearch( $request );
- } else {
- $this->namespaces = $this->userNamespaces( $user );
- }
-
- $this->searchRedirects = $request->getcheck( 'redirs' ) ? true : false;
- }
-
- /**
- * If an exact title match can be found, jump straight ahead to
- * @param string $term
- * @public
- */
- function goResult( $term ) {
- global $wgOut;
- global $wgGoToEdit;
-
- $this->setupPage( $term );
-
- # Try to go to page as entered.
- #
- $t = Title::newFromText( $term );
-
- # If the string cannot be used to create a title
- if( is_null( $t ) ){
- return $this->showResults( $term );
- }
-
- # If there's an exact or very near match, jump right there.
- $t = SearchEngine::getNearMatch( $term );
- if( !is_null( $t ) ) {
- $wgOut->redirect( $t->getFullURL() );
- return;
- }
-
- # No match, generate an edit URL
- $t = Title::newFromText( $term );
- if( is_null( $t ) ) {
- $editurl = ''; # hrm...
- } else {
- wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
- # If the feature is enabled, go straight to the edit page
- if ( $wgGoToEdit ) {
- $wgOut->redirect( $t->getFullURL( 'action=edit' ) );
- return;
- } else {
- $editurl = $t->escapeLocalURL( 'action=edit' );
- }
- }
- $wgOut->addWikiText( wfMsg( 'noexactmatch', $term ) );
-
- return $this->showResults( $term );
- }
-
- /**
- * @param string $term
- * @public
- */
- function showResults( $term ) {
- $fname = 'SpecialSearch::showResults';
- wfProfileIn( $fname );
-
- $this->setupPage( $term );
-
- global $wgUser, $wgOut;
- $sk = $wgUser->getSkin();
- $wgOut->addWikiText( wfMsg( 'searchresulttext' ) );
-
- #if ( !$this->parseQuery() ) {
- if( '' === trim( $term ) ) {
- $wgOut->setSubtitle( '' );
- $wgOut->addHTML( $this->powerSearchBox( $term ) );
- wfProfileOut( $fname );
- return;
- }
-
- global $wgDisableTextSearch;
- if ( $wgDisableTextSearch ) {
- global $wgForwardSearchUrl;
- if( $wgForwardSearchUrl ) {
- $url = str_replace( '$1', urlencode( $term ), $wgForwardSearchUrl );
- $wgOut->redirect( $url );
- return;
- }
- global $wgInputEncoding;
- $wgOut->addHTML( wfMsg( 'searchdisabled' ) );
- $wgOut->addHTML(
- wfMsg( 'googlesearch',
- htmlspecialchars( $term ),
- htmlspecialchars( $wgInputEncoding ),
- htmlspecialchars( wfMsg( 'search' ) )
- )
- );
- wfProfileOut( $fname );
- return;
- }
-
- $search = SearchEngine::create();
- $search->setLimitOffset( $this->limit, $this->offset );
- $search->setNamespaces( $this->namespaces );
- $search->showRedirects = $this->searchRedirects;
- $titleMatches = $search->searchTitle( $term );
- $textMatches = $search->searchText( $term );
-
- $num = ( $titleMatches ? $titleMatches->numRows() : 0 )
- + ( $textMatches ? $textMatches->numRows() : 0);
- if ( $num >= $this->limit ) {
- $top = wfShowingResults( $this->offset, $this->limit );
- } else {
- $top = wfShowingResultsNum( $this->offset, $this->limit, $num );
- }
- $wgOut->addHTML( "<p>{$top}</p>\n" );
-
- if( $num || $this->offset ) {
- $prevnext = wfViewPrevNext( $this->offset, $this->limit,
- 'Special:Search',
- wfArrayToCGI(
- $this->powerSearchOptions(),
- array( 'search' => $term ) ) );
- $wgOut->addHTML( "<br />{$prevnext}\n" );
- }
-
- if( $titleMatches ) {
- if( $titleMatches->numRows() ) {
- $wgOut->addWikiText( '==' . wfMsg( 'titlematches' ) . "==\n" );
- $wgOut->addHTML( $this->showMatches( $titleMatches ) );
- } else {
- $wgOut->addWikiText( '==' . wfMsg( 'notitlematches' ) . "==\n" );
- }
- }
-
- if( $textMatches ) {
- if( $textMatches->numRows() ) {
- $wgOut->addWikiText( '==' . wfMsg( 'textmatches' ) . "==\n" );
- $wgOut->addHTML( $this->showMatches( $textMatches ) );
- } elseif( $num == 0 ) {
- # Don't show the 'no text matches' if we received title matches
- $wgOut->addWikiText( '==' . wfMsg( 'notextmatches' ) . "==\n" );
- }
- }
-
- if ( $num == 0 ) {
- $wgOut->addWikiText( wfMsg( 'nonefound' ) );
- }
- if( $num || $this->offset ) {
- $wgOut->addHTML( "<p>{$prevnext}</p>\n" );
- }
- $wgOut->addHTML( $this->powerSearchBox( $term ) );
- wfProfileOut( $fname );
- }
-
- #------------------------------------------------------------------
- # Private methods below this line
-
- /**
- *
- */
- function setupPage( $term ) {
- global $wgOut;
- $wgOut->setPageTitle( wfMsg( 'searchresults' ) );
- $subtitlemsg = ( Title::newFromText($term) ? 'searchsubtitle' : 'searchsubtitleinvalid' );
- $wgOut->setSubtitle( $wgOut->parse( wfMsg( $subtitlemsg, wfEscapeWikiText($term) ) ) );
- $wgOut->setArticleRelated( false );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
- }
-
- /**
- * Extract default namespaces to search from the given user's
- * settings, returning a list of index numbers.
- *
- * @param User $user
- * @return array
- * @private
- */
- function userNamespaces( &$user ) {
- $arr = array();
- foreach( SearchEngine::searchableNamespaces() as $ns => $name ) {
- if( $user->getOption( 'searchNs' . $ns ) ) {
- $arr[] = $ns;
- }
- }
- return $arr;
- }
-
- /**
- * Extract "power search" namespace settings from the request object,
- * returning a list of index numbers to search.
- *
- * @param WebRequest $request
- * @return array
- * @private
- */
- function powerSearch( &$request ) {
- $arr = array();
- foreach( SearchEngine::searchableNamespaces() as $ns => $name ) {
- if( $request->getCheck( 'ns' . $ns ) ) {
- $arr[] = $ns;
- }
- }
- return $arr;
- }
-
- /**
- * Reconstruct the 'power search' options for links
- * @return array
- * @private
- */
- function powerSearchOptions() {
- $opt = array();
- foreach( $this->namespaces as $n ) {
- $opt['ns' . $n] = 1;
- }
- $opt['redirs'] = $this->searchRedirects ? 1 : 0;
- $opt['searchx'] = 1;
- return $opt;
- }
-
- /**
- * @param SearchResultSet $matches
- * @param string $terms partial regexp for highlighting terms
- */
- function showMatches( &$matches ) {
- $fname = 'SpecialSearch::showMatches';
- wfProfileIn( $fname );
-
- global $wgContLang;
- $tm = $wgContLang->convertForSearchResult( $matches->termMatches() );
- $terms = implode( '|', $tm );
-
- $off = $this->offset + 1;
- $out = "<ol start='{$off}'>\n";
-
- while( $result = $matches->next() ) {
- $out .= $this->showHit( $result, $terms );
- }
- $out .= "</ol>\n";
-
- // convert the whole thing to desired language variant
- global $wgContLang;
- $out = $wgContLang->convert( $out );
- wfProfileOut( $fname );
- return $out;
- }
-
- /**
- * Format a single hit result
- * @param SearchResult $result
- * @param string $terms partial regexp for highlighting terms
- */
- function showHit( $result, $terms ) {
- $fname = 'SpecialSearch::showHit';
- wfProfileIn( $fname );
- global $wgUser, $wgContLang, $wgLang;
-
- $t = $result->getTitle();
- if( is_null( $t ) ) {
- wfProfileOut( $fname );
- return "<!-- Broken link in search result -->\n";
- }
- $sk =& $wgUser->getSkin();
-
- $contextlines = $wgUser->getOption( 'contextlines' );
- if ( '' == $contextlines ) { $contextlines = 5; }
- $contextchars = $wgUser->getOption( 'contextchars' );
- if ( '' == $contextchars ) { $contextchars = 50; }
-
- $link = $sk->makeKnownLinkObj( $t );
- $revision = Revision::newFromTitle( $t );
- $text = $revision->getText();
- $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
- $wgLang->formatNum( strlen( $text ) ) );
-
- $lines = explode( "\n", $text );
-
- $max = intval( $contextchars ) + 1;
- $pat1 = "/(.*)($terms)(.{0,$max})/i";
-
- $lineno = 0;
-
- $extract = '';
- wfProfileIn( "$fname-extract" );
- foreach ( $lines as $line ) {
- if ( 0 == $contextlines ) {
- break;
- }
- ++$lineno;
- if ( ! preg_match( $pat1, $line, $m ) ) {
- continue;
- }
- --$contextlines;
- $pre = $wgContLang->truncate( $m[1], -$contextchars, '...' );
-
- if ( count( $m ) < 3 ) {
- $post = '';
- } else {
- $post = $wgContLang->truncate( $m[3], $contextchars, '...' );
- }
-
- $found = $m[2];
-
- $line = htmlspecialchars( $pre . $found . $post );
- $pat2 = '/(' . $terms . ")/i";
- $line = preg_replace( $pat2,
- "<span class='searchmatch'>\\1</span>", $line );
-
- $extract .= "<br /><small>{$lineno}: {$line}</small>\n";
- }
- wfProfileOut( "$fname-extract" );
- wfProfileOut( $fname );
- return "<li>{$link} ({$size}){$extract}</li>\n";
- }
-
- function powerSearchBox( $term ) {
- $namespaces = '';
- foreach( SearchEngine::searchableNamespaces() as $ns => $name ) {
- $checked = in_array( $ns, $this->namespaces )
- ? ' checked="checked"'
- : '';
- $name = str_replace( '_', ' ', $name );
- if( '' == $name ) {
- $name = wfMsg( 'blanknamespace' );
- }
- $namespaces .= " <label><input type='checkbox' value=\"1\" name=\"" .
- "ns{$ns}\"{$checked} />{$name}</label>\n";
- }
-
- $checked = $this->searchRedirects
- ? ' checked="checked"'
- : '';
- $redirect = "<input type='checkbox' value='1' name=\"redirs\"{$checked} />\n";
-
- $searchField = '<input type="text" name="search" value="' .
- htmlspecialchars( $term ) ."\" size=\"16\" />\n";
-
- $searchButton = '<input type="submit" name="searchx" value="' .
- htmlspecialchars( wfMsg('powersearch') ) . "\" />\n";
-
- $ret = wfMsg( 'powersearchtext',
- $namespaces, $redirect, $searchField,
- '', '', '', '', '', # Dummy placeholders
- $searchButton );
-
- $title = Title::makeTitle( NS_SPECIAL, 'Search' );
- $action = $title->escapeLocalURL();
- return "<br /><br />\n<form id=\"powersearch\" method=\"get\" " .
- "action=\"$action\">\n{$ret}\n</form>\n";
- }
-}
-
+# Replaced by extensions/other/SpecialSearch.php
?>
diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php
index 695c8c2..ac38cfb 100644
--- a/includes/SpecialUndelete.php
+++ b/includes/SpecialUndelete.php
@@ -67,7 +67,7 @@ class PageArchive {
$ret = $dbr->resultObject( $res );
return $ret;
}
-
+
/**
* List the deleted file revisions for this page, if it's a file page.
* Returns a result wrapper with various filearchive fields, or null
@@ -195,27 +195,27 @@ class PageArchive {
// If both the set of text revisions and file revisions are empty,
// restore everything. Otherwise, just restore the requested items.
$restoreAll = empty( $timestamps ) && empty( $fileVersions );
-
+
$restoreText = $restoreAll || !empty( $timestamps );
$restoreFiles = $restoreAll || !empty( $fileVersions );
-
+
if( $restoreFiles && $this->title->getNamespace() == NS_IMAGE ) {
$img = new Image( $this->title );
$filesRestored = $img->restore( $fileVersions );
} else {
$filesRestored = 0;
}
-
+
if( $restoreText ) {
$textRestored = $this->undeleteRevisions( $timestamps );
} else {
$textRestored = 0;
}
-
+
// Touch the log!
global $wgContLang;
$log = new LogPage( 'delete' );
-
+
if( $textRestored && $filesRestored ) {
$reason = wfMsgForContent( 'undeletedrevisions-files',
$wgContLang->formatNum( $textRestored ),
@@ -230,14 +230,18 @@ class PageArchive {
wfDebug( "Undelete: nothing undeleted...\n" );
return false;
}
-
+
if( trim( $comment ) != '' )
$reason .= ": {$comment}";
- $log->addEntry( 'restore', $this->title, $reason );
-
+// WERELATE - add article id parm
+ $log->addEntry( 'restore', $this->title, $reason, $this->title->getArticleID() );
+
+//WERELATE - added new hook
+ wfRunHooks('ArticleUndeleteComplete', array(&$this->title, &$wgUser));
+
return true;
}
-
+
/**
* This is the meaty bit -- restores archived revisions of the given page
* to the cur/old tables. If the page currently exists, all revisions will
@@ -254,7 +258,7 @@ class PageArchive {
$fname = __CLASS__ . '::' . __FUNCTION__;
$restoreAll = empty( $timestamps );
-
+
$dbw =& wfGetDB( DB_MASTER );
extract( $dbw->tableNames( 'page', 'archive' ) );
@@ -319,7 +323,7 @@ class PageArchive {
wfDebug( "$fname: couldn't find all requested rows\n" );
return false;
}
-
+
$revision = null;
$newRevId = $previousRevId;
$restored = 0;
@@ -368,10 +372,18 @@ class PageArchive {
#TODO: SearchUpdate, etc.
}
+// WERELATE: watch article
+ global $wgUser;
+ $watchthis = false;
if( $newid ) {
Article::onArticleCreate( $this->title );
+ $watchthis = $wgUser->getOption( 'watchcreations' ) || $wgUser->getOption( 'watchdefault' );
} else {
Article::onArticleEdit( $this->title );
+ $watchthis = $wgUser->getOption( 'watchdefault' );
+ }
+ if ($watchthis && !$article->getTitle()->userIsWatching()) {
+ $article->doWatch();
}
} else {
# Something went terribly wrong!
@@ -405,28 +417,29 @@ class UndeleteForm {
$this->mTarget = $request->getText( 'target' );
$this->mTimestamp = $request->getText( 'timestamp' );
$this->mFile = $request->getVal( 'file' );
-
+
$posted = $request->wasPosted() &&
$wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) );
$this->mRestore = $request->getCheck( 'restore' ) && $posted;
$this->mPreview = $request->getCheck( 'preview' ) && $posted;
$this->mComment = $request->getText( 'wpComment' );
-
+
if( $par != "" ) {
$this->mTarget = $par;
}
- if ( $wgUser->isAllowed( 'delete' ) && !$wgUser->isBlocked() ) {
+ if ( $this->mTarget !== "" ) {
+ $this->mTargetObj = Title::newFromURL( $this->mTarget );
+ } else {
+ $this->mTargetObj = NULL;
+ }
+// WERELATE: added title parm; undelete action; moved below setting mTargetObj
+ if ( $wgUser->isAllowed( 'undelete', $this->mTargetObj ) && !$wgUser->isBlocked() ) {
$this->mAllowed = true;
} else {
$this->mAllowed = false;
$this->mTimestamp = '';
$this->mRestore = false;
}
- if ( $this->mTarget !== "" ) {
- $this->mTargetObj = Title::newFromURL( $this->mTarget );
- } else {
- $this->mTargetObj = NULL;
- }
if( $this->mRestore ) {
$timestamps = array();
$this->mFileVersions = array();
@@ -434,7 +447,7 @@ class UndeleteForm {
if( preg_match( '/^ts(\d{14})$/', $key, $matches ) ) {
array_push( $timestamps, $matches[1] );
}
-
+
if( preg_match( '/^fileid(\d+)$/', $key, $matches ) ) {
$this->mFileVersions[] = intval( $matches[1] );
}
@@ -506,14 +519,14 @@ class UndeleteForm {
$wgOut->setPagetitle( wfMsg( "undeletepage" ) );
$wgOut->addWikiText( "(" . wfMsg( "undeleterevision",
$wgLang->date( $timestamp ) ) . ")\n" );
-
+
if( $this->mPreview ) {
$wgOut->addHtml( "<hr />\n" );
$wgOut->addWikiText( $text );
}
-
+
$self = Title::makeTitle( NS_SPECIAL, "Undelete" );
-
+
$wgOut->addHtml(
wfElement( 'textarea', array(
'readonly' => true,
@@ -546,14 +559,14 @@ class UndeleteForm {
wfCloseElement( 'form' ) .
wfCloseElement( 'div' ) );
}
-
+
/**
* Show a deleted file version requested by the visitor.
*/
function showFile( $key ) {
global $wgOut;
$wgOut->disable();
-
+
$store = FileStore::get( 'deleted' );
$store->stream( $key );
}
@@ -585,10 +598,10 @@ class UndeleteForm {
# List all stored revisions
$revisions = $archive->listRevisions();
$files = $archive->listFiles();
-
+
$haveRevisions = $revisions && $revisions->numRows() > 0;
$haveFiles = $files && $files->numRows() > 0;
-
+
# Batch existence check on user and talk pages
if( $haveRevisions ) {
$batch = new LinkBatch();
@@ -626,7 +639,7 @@ class UndeleteForm {
array( 'page' => $this->mTargetObj->getPrefixedText(),
'type' => 'delete' ) ) ) );
$logViewer->showList( $wgOut );
-
+
if( $this->mAllowed && ( $haveRevisions || $haveFiles ) ) {
# Format the user-visible controls (comment field, submission button)
# in a nice little table
@@ -640,9 +653,9 @@ class UndeleteForm {
$table .= '</td></tr></table></fieldset>';
$wgOut->addHtml( $table );
}
-
+
$wgOut->addHTML( "<h2>" . htmlspecialchars( wfMsg( "history" ) ) . "</h2>\n" );
-
+
if( $haveRevisions ) {
# The page's stored (deleted) history:
$wgOut->addHTML("<ul>");
@@ -661,7 +674,7 @@ class UndeleteForm {
$userLink = $sk->userLink( $row->ar_user, $row->ar_user_text ) . $sk->userToolLinks( $row->ar_user, $row->ar_user_text );
$comment = $sk->commentBlock( $row->ar_comment );
$wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" );
-
+
}
$revisions->free();
$wgOut->addHTML("</ul>");
@@ -669,7 +682,7 @@ class UndeleteForm {
$wgOut->addWikiText( wfMsg( "nohistory" ) );
}
-
+
if( $haveFiles ) {
$wgOut->addHtml( "<h2>" . wfMsgHtml( 'imghistory' ) . "</h2>\n" );
$wgOut->addHtml( "<ul>" );
@@ -700,7 +713,7 @@ class UndeleteForm {
$files->free();
$wgOut->addHTML( "</ul>" );
}
-
+
if ( $this->mAllowed ) {
# Slip in the hidden controls here
$misc = wfHidden( 'target', $this->mTarget );
@@ -716,12 +729,12 @@ class UndeleteForm {
if( !is_null( $this->mTargetObj ) ) {
$archive = new PageArchive( $this->mTargetObj );
$ok = true;
-
+
$ok = $archive->undelete(
$this->mTargetTimestamp,
$this->mComment,
$this->mFileVersions );
-
+
if( $ok ) {
$skin =& $wgUser->getSkin();
$link = $skin->makeKnownLinkObj( $this->mTargetObj );
diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php
index 06336df..0fbfecf 100644
--- a/includes/SpecialUpload.php
+++ b/includes/SpecialUpload.php
@@ -31,16 +31,281 @@ class UploadForm {
var $mUploadSaveName, $mUploadTempName, $mUploadSize, $mUploadOldVersion;
var $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload;
var $mOname, $mSessionKey, $mStashed, $mDestFile, $mRemoveTempFile;
+// WERELATE - added vars
+ var $mDate, $mPlace, $mCopyright, $mReUploading, $mPeople, $mFamilies;
+ var $mTarget, $mId;
+ var $mWhatLinksHere = null;
/**#@-*/
- /**
+// WERELATE - copied escapeXml, titleStringHasId, getXml, getWhatLinksHere from StructuredData
+// - added getAttrs, getMetadata, fromRequest, toRequest functions
+ private function escapeXml($text) {
+ return str_replace(array('&', '<', '>', '"', "'"), array('&amp;', '&lt;', '&gt;', '&quot;', '&apos;'), $text);
+ }
+
+ private function titleStringHasId($titleString) {
+ return preg_match('/\(\d+\)$/', $titleString);
+ }
+
+
+ private function standardizeNameCase($name) {
+ $result = '';
+ $pieces = explode(' ', $name);
+ for ($i = 0; $i < count($pieces); $i++) {
+ if ($pieces[$i]) {
+ if ($result) {
+ $result .= ' ';
+ }
+
+ if ($i < count($pieces) - 1 && strcasecmp($pieces[$i], 'and') == 0) {
+ $result .= 'and';
+ }
+ else if ($pieces[$i] == mb_strtoupper($pieces[$i]) || $pieces[$i] == mb_strtolower($pieces[$i])) { // all uppercase or all lowercase
+ $result .= mb_convert_case($pieces[$i], MB_CASE_TITLE);
+ }
+ else {
+ $result .= $pieces[$i];
+ }
+ }
+ }
+ return $result;
+ }
+
+ private function getXml($tagName, &$text) {
+ $start = strpos($text, "<$tagName>");
+ if ($start !== false) {
+ $end = strpos($text, "</$tagName>", $start);
+ if ($end !== false) {
+ // We expect only one tag instance; ignore any extras
+ return simplexml_load_string(substr($text, $start, $end + 3 + strlen($tagName) - $start));
+ }
+ }
+ return null;
+ }
+
+ private function getWhatLinksHere() {
+ if (is_null($this->mWhatLinksHere) && $this->mDestFile) {
+ $title = Title::newFromText($this->mDestFile, NS_IMAGE);
+ if ($title) {
+ $this->mWhatLinksHere = array();
+ $db =& wfGetDB(DB_MASTER); // make sure this is the most current set of pages that link here
+ // get pages linking to images
+ $rows = $db->select('imagelinks', 'il_from', array('il_to' => $title->getDBkey()), 'SpecialUpload::getWhatLinksHere');
+ while ($row = $db->fetchObject($rows)) {
+ $this->mWhatLinksHere[] = $row->il_from;
+ }
+ $db->freeResult($rows);
+ }
+ }
+ return $this->mWhatLinksHere;
+ }
+
+ private function getEventAttrs($eventName, $event) {
+ $result = '';
+ if ((string)$event['date']) {
+ $result .= " {$eventName}date=\"".$this->escapeXml((string)$event['date']).'"';
+ }
+ if ((string)$event['place']) {
+ $result .= " {$eventName}place=\"".$this->escapeXml((string)$event['place']).'"';
+ }
+ return $result;
+ }
+
+ private function getAttrs($titleString, $ns) {
+ $result = '';
+ $t = Title::newFromText($titleString, $ns);
+ $revision = null;
+ $nt = $t;
+ while ($nt) { // follow redirects
+ $t = $nt;
+ $nt = null;
+ $revision = Revision::newFromTitle($t);
+ if ($revision) {
+ $text =& $revision->getText();
+ $nt = Title::newFromRedirect($text);
+ }
+ }
+ if ($t) {
+ $result .= ' title="'.$this->escapeXml($t->getText()).'"';
+ }
+ if ($revision) {
+ // get attributes from text
+ if ($ns == NS_PERSON) {
+ $xml = $this->getXml('person', $text);
+ if (isset($xml)) {
+ $name = $xml->name;
+ if (isset($name)) {
+ if ((string)$name['given']) {
+ $result .= ' given="'.$this->escapeXml((string)$name['given']).'"';
+ }
+ if ((string)$name['surname']) {
+ $result .= ' surname="'.$this->escapeXml((string)$name['surname']).'"';
+ }
+ if ((string)$name['title_prefix']) {
+ $result .= ' title_prefix="'.$this->escapeXml((string)$name['title_prefix']).'"';
+ }
+ if ((string)$name['title_suffix']) {
+ $result .= ' title_suffix="'.$this->escapeXml((string)$name['title_suffix']).'"';
+ }
+ }
+ if (isset($xml->event_fact)) {
+ foreach ($xml->event_fact as $ef) {
+ if ($ef['type'] == 'Birth') {
+ $result .= $this->getEventAttrs('birth', $ef);
+ }
+ else if ($ef['type'] == 'Death') {
+ $result .= $this->getEventAttrs('death', $ef);
+ }
+ else if ($ef['type'] == 'Christening' || $ef['type'] == 'Baptism') {
+ $result .= $this->getEventAttrs('chr', $ef);
+ }
+ else if ($ef['type'] == 'Burial') {
+ $result .= $this->getEventAttrs('burial', $ef);
+ }
+ }
+ }
+ }
+ }
+ }
+ return $result;
+ }
+
+ private function getMetadata() {
+ $result = "<image_data>\n".
+ ($this->mLicense ? '<license>'.$this->escapeXml($this->mLicense)."</license>\n" : '') .
+ ($this->mCopyright ? '<copyright_holder>'.$this->escapeXml($this->mCopyright)."</copyright_holder>\n" : '');
+ $result .=
+ ($this->mDate ? '<date>'.$this->escapeXml($this->mDate)."</date>\n" : '') .
+ ($this->mPlace ? '<place>'.$this->escapeXml($this->mPlace)."</place>\n" : '');
+ foreach ($this->mPeople as $person) {
+ $attrs = $this->getAttrs($person, NS_PERSON);
+ $result .= "<person$attrs/>\n";
+ }
+ foreach ($this->mFamilies as $family) {
+ $attrs = $this->getAttrs($family, NS_FAMILY);
+ $result .= "<family$attrs/>\n";
+ }
+ $result .= "</image_data>\n";
+ return $result;
+ }
+
+ private function fromRequest($request, $name, $ns) {
+ $targetTitle = '';
+ if ($this->mTarget) {
+ $t = Title::newFromText($this->mTarget);
+ if ($t && $t->getNamespace() == $ns) {
+ $targetTitle = $t->getText();
+ }
+ }
+ $result = array();
+ // get titles from request, except target
+ for ($i = 0; $request->getVal("{$name}_id$i"); $i++) {
+ $titleString = $request->getVal("$name$i");
+ if ($titleString) {
+ if (!$this->titleStringHasId($titleString)) {
+ $titleString = $this->standardizeNameCase($titleString);
+ }
+ $t = Title::newFromText($titleString, $ns);
+ // don't save target title; we'll update that when the target page is saved
+ if ($t && $t->getNamespace() == $ns && $t->getText() != $targetTitle && !in_array($t->getText(), $result)) {
+ $result[] = $t->getText();
+ }
+ }
+ }
+ // add any titles from WLH (even target if it already links here)
+ // uses mDestFile instead of mUploadSaveName because the latter hasn't been set yet
+ // only do this if the request is a "get" with a passed-in wpDestFile
+ if( !$request->wasPosted() && $this->mDestFile) {
+ $t = Title::newFromText($this->mDestFile, NS_IMAGE);
+ $filename = ($t ? $t->getText() : '');
+ $pageids = $this->getWhatLinksHere();
+ $db =& wfGetDB(DB_MASTER); // make sure this is the most current set of pages that link here
+ foreach ($pageids as $pageid) {
+ $revision = Revision::loadFromPageId($db, $pageid);
+ if ($revision && $revision->getTitle()->getNamespace() == $ns) {
+ $text = $revision->getText();
+ $xml = $this->getXml($name, $text);
+ if (isset($xml)) {
+ foreach ($xml->image as $img) {
+ if ((string)$img['filename'] == $filename && !in_array($revision->getTitle()->getText(), $result)) {
+ $result[] = $revision->getTitle()->getText();
+ }
+ }
+ }
+ }
+ }
+ }
+ return $result;
+ }
+
+ private function toForm($titles, $name, $ns, $visible) {
+ $targetPos = -1;
+ if ($this->mTarget) {
+ $t = Title::newFromText($this->mTarget);
+ if ($t && $t->getNamespace() == $ns && !in_array($t->getText(), $titles)) {
+ $targetPos = count($titles);
+ $titles[] = $t->getText();
+ }
+ }
+ if ($visible) {
+ if (count($titles) == 0) { // ensure go through loop at least once
+ $titles[] = '';
+ }
+ $result = "<table id='image_{$name}_table' cellspacing=0 cellpadding=0>";
+ }
+ else {
+ $result = '';
+ }
+ $i = 0;
+ foreach($titles as $title) {
+ $readOnly = ($visible && $targetPos == $i ? " readOnly='true'" : '');
+ $result .= ($visible ? "<tr><td>" : '') .
+ "<input type=\"hidden\" name=\"{$name}_id$i\" value=\"".($i+1)."\"/>".
+ "<input ".($visible ? "class=\"{$name}_input\" type=\"text\" size=40$readOnly" : "type=\"hidden\"")." name=\"$name$i\" value=\"" . htmlspecialchars( $title ) . "\"/>".
+ ($visible ? "</td></tr>" : '') . "\n";
+ $i++;
+ }
+ if ($visible) {
+ $result .= '</table>';
+ }
+ return $result;
+ }
+
+
+ // WERELATE added
+ private function cleanFilename($filename) {
+ $unwanted_array = array(
+ 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
+ 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',
+ 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',
+ 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o',
+ 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y',
+ 'Ğ'=>'G', 'İ'=>'I', 'Ş'=>'S', 'ğ'=>'g', 'ı'=>'i', 'ş'=>'s', 'ü'=>'u',
+ 'ă'=>'a', 'Ă'=>'A', 'ș'=>'s', 'Ș'=>'S', 'ț'=>'t', 'Ț'=>'T');
+ return iconv('UTF-8', 'US-ASCII//TRANSLIT//IGNORE', strtr($filename, $unwanted_array ));
+ }
+
+ /**
* Constructor : initialise object
* Get data POSTed through the form and assign them to the object
* @param $request Data posted.
*/
function UploadForm( &$request ) {
- $this->mDestFile = $request->getText( 'wpDestFile' );
-
+// WERELATE - clean filename so we don't error when creating thumbnails
+ $this->mDestFile = $this->cleanFilename($request->getText( 'wpDestFile' ));
+// WERELATE - add target and id and people and families
+ $this->mTarget = $request->getText( 'target');
+ $this->mId = $request->getText( 'id');
+ $this->mPeople = $this->fromRequest($request, 'person', NS_PERSON);
+ $this->mFamilies = $this->fromRequest($request, 'family', NS_FAMILY);
+
+// WERELATE - added mReUploading
+ $this->mReUploading = false;
+ if (strlen($this->mDestFile) > 0) {
+ $imageTitle = Title::newFromText($this->mDestFile, NS_IMAGE);
+ $this->mReUploading = $imageTitle && $imageTitle->exists();
+ }
+
if( !$request->wasPosted() ) {
# GET requests just give the main form; no data except wpDestfile.
return;
@@ -52,10 +317,13 @@ class UploadForm {
$this->mUploadDescription = $request->getText( 'wpUploadDescription' );
$this->mLicense = $request->getText( 'wpLicense' );
+// WERELATE - added fields
+ $this->mDate = $request->getText( 'wrDate' );
+ $this->mPlace = $request->getText( 'wrPlace' );
+ $this->mCopyright = $request->getText( 'wrCopyright' );
$this->mUploadCopyStatus = $request->getText( 'wpUploadCopyStatus' );
$this->mUploadSource = $request->getText( 'wpUploadSource' );
$this->mWatchthis = $request->getBool( 'wpWatchthis' );
- wfDebug( "UploadForm: watchthis is: '$this->mWatchthis'\n" );
$this->mAction = $request->getVal( 'action' );
@@ -181,7 +449,7 @@ class UploadForm {
* only the final one for the whitelist.
*/
list( $partname, $ext ) = $this->splitExtensions( $basename );
-
+
if( count( $ext ) ) {
$finalExt = $ext[count( $ext ) - 1];
} else {
@@ -201,7 +469,13 @@ class UploadForm {
return;
}
- /**
+// WERELATE - added validation tests
+ if (!$this->mLicense && !$this->mReUploading) {
+ $this->uploadError("You must select a license (press the \"back button\" on your browser to correct this)");
+ return;
+ }
+
+ /**
* Filter out illegal characters, and try to make a legible name
* out of it. We'll strip some silently that Title would die on.
*/
@@ -298,16 +572,21 @@ class UploadForm {
$sk = $wgUser->getSkin();
$dlink = $sk->makeKnownLinkObj( $nt );
$warning .= '<li>'.wfMsgHtml( 'fileexists', $dlink ).'</li>';
+// WERELATE: added fileexistsnoreupload warning; assume that if user entered license, then this isn't a case of purposeful re-uploading
+ if ($this->mLicense) {
+ $warning .= '<li>'.wfMsgHtml('fileexistsnoreupload').'</li>';
+ }
} else {
# If the file existed before and was deleted, warn the user of this
# Don't bother doing so if the image exists now, however
- $image = new Image( $nt );
- if( $image->wasDeleted() ) {
- $skin = $wgUser->getSkin();
- $ltitle = Title::makeTitle( NS_SPECIAL, 'Log' );
- $llink = $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ), 'type=delete&page=' . $nt->getPrefixedUrl() );
- $warning .= wfOpenElement( 'li' ) . wfMsgWikiHtml( 'filewasdeleted', $llink ) . wfCloseElement( 'li' );
- }
+// WERELATE: remove
+// $image = new Image( $nt );
+// if( $image->wasDeleted() ) {
+// $skin = $wgUser->getSkin();
+// $ltitle = Title::makeTitle( NS_SPECIAL, 'Log' );
+// $llink = $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ), 'type=delete&page=' . $nt->getPrefixedUrl() );
+// $warning .= wfOpenElement( 'li' ) . wfMsgWikiHtml( 'filewasdeleted', $llink ) . wfCloseElement( 'li' );
+// }
}
if( $warning != '' ) {
@@ -332,15 +611,24 @@ class UploadForm {
* if it's a new file.
*/
$img = Image::newFromName( $this->mUploadSaveName );
+// WERELATE - changed - added getMetadata, null out license (because we capture it in metadata), redirect only if target is empty
$success = $img->recordUpload( $this->mUploadOldVersion,
$this->mUploadDescription,
- $this->mLicense,
+ '',
$this->mUploadCopyStatus,
$this->mUploadSource,
- $this->mWatchthis );
-
+ $this->mWatchthis,
+ $this->getMetadata(),
+ !$this->mTarget );
if ( $success ) {
- $this->showSuccess();
+// WERELATE - if we're uploading for a P/F target, showSuccess, else just redirect
+ if ($this->mTarget) {
+ $this->showSuccess();
+ }
+ else {
+ $article = new Article( $img->getTitle() );
+ $article->doRedirect();
+ }
wfRunHooks( 'UploadComplete', array( &$img ) );
} else {
// Image::recordUpload() fails if the image went missing, which is
@@ -371,7 +659,7 @@ class UploadForm {
$archive = wfImageArchiveDir( $saveName );
if ( !is_dir( $dest ) ) wfMkdirParents( $dest );
if ( !is_dir( $archive ) ) wfMkdirParents( $archive );
-
+
$this->mSavedFile = "{$dest}/{$saveName}";
if( is_file( $this->mSavedFile ) ) {
@@ -489,16 +777,29 @@ class UploadForm {
*/
function showSuccess() {
global $wgUser, $wgOut, $wgContLang;
-
+// WERELATE: add script if uploading for P/F target; change fileuploaded message to wiki text with title, target parms; don't return to main
+ $title = Title::makeTitleSafe( NS_IMAGE, $this->mUploadSaveName );
+ $value = htmlspecialchars($title->getText());
+ $id = htmlspecialchars($this->mId);
+ $wgOut->addScript(<<< END
+<script type='text/javascript'>/*<![CDATA[*/
+$(document).ready(function() {
+ window.opener.document.getElementById("$id").value="$value";
+});
+/*]]>*/</script>
+END
+);
$sk = $wgUser->getSkin();
- $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) );
+// $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) );
+ $ilink = $sk->makeImageLinkObj( $title, $this->mUploadSaveName, $this->mUploadSaveName);
$dname = $wgContLang->getNsText( NS_IMAGE ) . ':'.$this->mUploadSaveName;
$dlink = $sk->makeKnownLink( $dname, $dname );
$wgOut->addHTML( '<h2>' . wfMsgHtml( 'successfulupload' ) . "</h2>\n" );
- $text = wfMsgWikiHtml( 'fileuploaded', $ilink, $dlink );
+// $text = wfMsgWikiHtml( 'fileuploaded', $ilink, $dlink, htmlspecialchars($this->mTarget) );
+ $text = wfMsg( 'fileuploaded', $ilink, $dlink, htmlspecialchars($this->mTarget) );
$wgOut->addHTML( $text );
- $wgOut->returnToMain( false );
+// $wgOut->returnToMain( false );
}
/**
@@ -537,7 +838,12 @@ class UploadForm {
$iw = wfMsgWikiHtml( 'ignorewarning' );
$reup = wfMsgWikiHtml( 'reuploaddesc' );
$titleObj = Title::makeTitle( NS_SPECIAL, 'Upload' );
- $action = $titleObj->escapeLocalURL( 'action=submit' );
+// WERELATE: added target and id
+ $query = 'action=submit';
+ if ($this->mTarget) {
+ $query .= '&target=' . urlencode($this->mTarget) . '&id=' . urlencode($this->mId);
+ }
+ $action = $titleObj->escapeLocalURL( $query );
if ( $wgUseCopyrightUpload )
{
@@ -549,11 +855,29 @@ class UploadForm {
$copyright = "";
}
- $wgOut->addHTML( "
+// WERELATE - added back-button instructions; added four fields; added id='wpUpload' to wpUpload button; removed reupload; added $people and $families; added checkboxes
+// metadata fields and tree checkboxes are ignored in a re-upload situation
+ $people = $this->toForm($this->mPeople, 'person', NS_PERSON, false);
+ $families = $this->toForm($this->mFamilies, 'family', NS_FAMILY, false);
+//!!! remove this code dependency before sharing
+ require_once("extensions/familytree/FamilyTreeUtil.php");
+ global $wgUser, $wgRequest;
+ $allTrees = FamilyTreeUtil::getFamilyTrees($wgUser->getName());
+ $checkedTreeIds = FamilyTreeUtil::readTreeCheckboxes($allTrees, $wgRequest);
+ $treecheckboxeshtml = FamilyTreeUtil::generateHiddenTreeCheckboxes($allTrees, $checkedTreeIds);
+ $wgOut->addHTML("<p><b>Press the \"back button\" on your browser to choose a different file, or</b></p>");
+
+ $wgOut->addHTML( "
<form id='uploadwarning' method='post' enctype='multipart/form-data' action='$action'>
<input type='hidden' name='wpIgnoreWarning' value='1' />
<input type='hidden' name='wpSessionKey' value=\"" . htmlspecialchars( $this->mSessionKey ) . "\" />
<input type='hidden' name='wpUploadDescription' value=\"" . htmlspecialchars( $this->mUploadDescription ) . "\" />
+ <input type='hidden' name='wrDate' value=\"" . htmlspecialchars( $this->mDate ) . "\" />
+ <input type='hidden' name='wrPlace' value=\"" . htmlspecialchars( $this->mPlace ) . "\" />
+ $people
+ $families
+ $treecheckboxeshtml
+ <input type='hidden' name='wrCopyright' value=\"" . htmlspecialchars( $this->mCopyright ) . "\" />
<input type='hidden' name='wpLicense' value=\"" . htmlspecialchars( $this->mLicense ) . "\" />
<input type='hidden' name='wpDestFile' value=\"" . htmlspecialchars( $this->mDestFile ) . "\" />
<input type='hidden' name='wpWatchthis' value=\"" . htmlspecialchars( intval( $this->mWatchthis ) ) . "\" />
@@ -562,16 +886,10 @@ class UploadForm {
<tr>
<tr>
<td align='right'>
- <input tabindex='2' type='submit' name='wpUpload' value=\"$save\" />
+ <input tabindex='2' type='submit' id='wpUpload' name='wpUpload' value=\"$save\" />
</td>
<td align='left'>$iw</td>
</tr>
- <tr>
- <td align='right'>
- <input tabindex='2' type='submit' name='wpReUpload' value=\"{$reupload}\" />
- </td>
- <td align='left'>$reup</td>
- </tr>
</tr>
</table></form>\n" );
}
@@ -611,49 +929,68 @@ class UploadForm {
$license = wfMsgHtml( 'license' );
$nolicense = wfMsgHtml( 'nolicense' );
$licenseshtml = $licenses->getHtml();
+// WERELATE - added licenseHelp
+ $licenseHelpUrl = $sk->makeInternalOrExternalUrl( wfMsgForContent( 'licensehelppage' ));
+ $licenseHelp = '<a target="helpwindow" href="'.$licenseHelpUrl.'">'.htmlspecialchars( wfMsg( 'licensehelp' ) ).'</a>';
+
+// WERELATE - added code to select proper license
+ if ($this->mLicense) {
+ $protectedLicense = str_replace(array( '\\', '$', '^', '.', '[', ']', '|', '(', ')', '?', '*', '+', '{', '}', '-'),
+ array('\\\\','\\$','\\^','\\.','\\[','\\]','\\|','\\(','\\)','\\?','\\*','\\+','\\{','\\}','\\-'), $this->mLicense);
+ $licenseshtml = preg_replace('$value="('.$protectedLicense.')"$','value="$1" selected="selected"', $licenseshtml);
+ }
$ulb = wfMsgHtml( 'uploadbtn' );
$titleObj = Title::makeTitle( NS_SPECIAL, 'Upload' );
- $action = $titleObj->escapeLocalURL();
+// WERELATE: added target and id
+ $query = '';
+ if ($this->mTarget) {
+ $query = 'target=' . urlencode($this->mTarget) . '&id=' . urlencode($this->mId);
+ }
+ $action = $titleObj->escapeLocalURL($query);
$encDestFile = htmlspecialchars( $this->mDestFile );
-
- $watchChecked = $wgUser->getOption( 'watchdefault' )
+//WERELATE - added watchcreations
+ $watchChecked = $wgUser->getOption( 'watchdefault' ) || $wgUser->getOption( 'watchcreations' )
? 'checked="checked"'
: '';
-
+// WERELATE - add scripts
+ global $wgScriptPath;
+ $wgOut->addScript("<script type=\"text/javascript\" src=\"$wgScriptPath/autocomplete.10.js\"></script>");
+ $wgOut->addScript("<script type=\"text/javascript\" src=\"$wgScriptPath/image.1.js\"></script>");
+// WERELATE: removed tabindexes; added id to table
$wgOut->addHTML( "
<form id='upload' method='post' enctype='multipart/form-data' action=\"$action\">
- <table border='0'>
+ <table id='image_form_table' border='0'>
<tr>
<td align='right'><label for='wpUploadFile'>{$sourcefilename}:</label></td>
<td align='left'>
- <input tabindex='1' type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile?"":"onchange='fillDestFilename()' ") . "size='40' />
+ <input type='file' name='wpUploadFile' id='wpUploadFile' " . ($this->mDestFile?"":"onchange='fillDestFilename()' ") . "size='40' />
</td>
</tr>
<tr>
<td align='right'><label for='wpDestFile'>{$destfilename}:</label></td>
<td align='left'>
- <input tabindex='2' type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"$encDestFile\" />
- </td>
- </tr>
- <tr>
- <td align='right'><label for='wpUploadDescription'>{$summary}</label></td>
- <td align='left'>
- <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars( $this->mUploadDescription ) . "</textarea>
+ <input type='text' name='wpDestFile' id='wpDestFile' size='40' value=\"$encDestFile\" />
</td>
- </tr>
- <tr>" );
-
- if ( $licenseshtml != '' ) {
+ </tr>");
+// WERELATE - added check to omit fields in case of a re-upload, since they're ignored
+ $treecheckboxeshtml = '';
+ if( !$this->mReUploading ) {
+ $wgOut->addHTML( "
+ <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align='left'><b>License and copyright</b></td></tr>
+ <tr>");
+
+ if ( $licenseshtml != '' ) {
global $wgStylePath;
$wgOut->addHTML( "
- <td align='right'><label for='wpLicense'>$license:</label></td>
+ <td align='right'><label for='wpLicense'>$license (&nbsp;$licenseHelp&nbsp;):</label></td>
<td align='left'>
- <script type='text/javascript' src=\"$wgStylePath/common/upload.js\"></script>
- <select name='wpLicense' id='wpLicense' tabindex='4'
+ <script type='text/javascript' src=\"$wgStylePath/common/upload.2.js\"></script>
+ <select name='wpLicense' id='wpLicense'
onchange='licenseSelectorCheck()'>
<option value=''>$nolicense</option>
$licenseshtml
@@ -663,33 +1000,92 @@ class UploadForm {
<tr>
");
}
-
+
if ( $wgUseCopyrightUpload ) {
$filestatus = wfMsgHtml ( 'filestatus' );
$copystatus = htmlspecialchars( $this->mUploadCopyStatus );
$filesource = wfMsgHtml ( 'filesource' );
$uploadsource = htmlspecialchars( $this->mUploadSource );
-
+
$wgOut->addHTML( "
<td align='right' nowrap='nowrap'><label for='wpUploadCopyStatus'>$filestatus:</label></td>
- <td><input tabindex='5' type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"$copystatus\" size='40' /></td>
+ <td><input type='text' name='wpUploadCopyStatus' id='wpUploadCopyStatus' value=\"$copystatus\" size='40' /></td>
</tr>
<tr>
<td align='right'><label for='wpUploadCopyStatus'>$filesource:</label></td>
- <td><input tabindex='6' type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"$uploadsource\" size='40' /></td>
+ <td><input type='text' name='wpUploadSource' id='wpUploadCopyStatus' value=\"$uploadsource\" size='40' /></td>
</tr>
<tr>
");
}
-
+// WERELATE: added fields
+ $personTbl = $this->toForm($this->mPeople, 'person', NS_PERSON, true);
+ $familyTbl = $this->toForm($this->mFamilies, 'family', NS_FAMILY, true);
+ $wgOut->addHTML("
+ <td align='right'><label for='wrCopyright'>Copyright holder:</label></td>
+ <td align='left'>
+ <input type='text' name='wrCopyright' id='wrCopyright' size='30' value=\"" . htmlspecialchars($this->mCopyright) ."\" />
+ </td>
+ </tr>
+ <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
+ <tr><td>&nbsp;</td><td align='left'><b>Time place and people</b></td></tr>
+ <tr>
+ <td align='right'><label for='wrDate'>Image date:</label></td>
+ <td align='left'>
+ <input type='text' name='wrDate' id='wrDate' size='15' value=\"" . htmlspecialchars($this->mDate) ."\" />
+ </td>
+ </tr>
+ <tr>
+ <td align='right'><label for='wrPlace'>Place:</label></td>
+ <td align='left'>
+ <input class='place_input' type='text' name='wrPlace' id='wrDate' size='30' value=\"" . htmlspecialchars($this->mPlace) ."\" />
+ </td>
+ </tr>
+ <tr>
+ <td align='right' valign='top'>Person page:</td>
+ <td align='left'>$personTbl</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align='left'><a id='person_link' href='javascript:void(0)' onClick='addImagePage(\"person\"); return preventDefaultAction(event);'>Add another person</a></td>
+ </tr>
+ <tr>
+ <td align='right' valign='top'>Family page:</td>
+ <td align='left'>$familyTbl</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align='left'><a id='family_link' href='javascript:void(0)' onClick='addImagePage(\"family\"); return preventDefaultAction(event);'>Add another family</a></td>
+ </tr>
+ ");
+
+// WERELATE - move description from above; end reUploading if statement; moved summary label
+// add id for wpUpload; added tree checkboxes
+//!!! remove this code dependency before sharing
+ require_once("extensions/familytree/FamilyTreeUtil.php");
+ $t = null;
+ if ($this->mDestFile) {
+ $t = Title::newFromText($this->mDestFile, NS_IMAGE);
+ }
+ $treecheckboxeshtml = FamilyTreeUtil::generateTreeCheckboxes($wgUser, $t, true);
$wgOut->addHtml( "
+ <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
+ <tr><td></td><td align='left'><b>{$summary}</b></td></tr>
+ <tr><td></td><td align='left'>
+ <textarea name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars( $this->mUploadDescription ) . "</textarea>
+ </td>
+ </tr> ");
+ }
+ $wgOut->addHTML( "
+ <tr>
<td></td>
<td>
- <input tabindex='7' type='checkbox' name='wpWatchthis' id='wpWatchthis' $watchChecked value='true' />
+ <input type='checkbox' name='wpWatchthis' id='wpWatchthis' $watchChecked value='true' />
<label for='wpWatchthis'>" . wfMsgHtml( 'watchthis' ) . "</label>
- <input tabindex='8' type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />
- <label for='wpIgnoreWarning'>" . wfMsgHtml( 'ignorewarnings' ) . "</label>
+ <input type='checkbox' name='wpIgnoreWarning' id='wpIgnoreWarning' value='true' />
+ <label for='wpIgnoreWarning'>" . wfMsgHtml('ignorewarnings' ) . "</label>" .
+$treecheckboxeshtml . "
</td>
</tr>
<tr>
@@ -697,7 +1093,7 @@ class UploadForm {
</tr>
<tr>
<td></td>
- <td align='left'><input tabindex='9' type='submit' name='wpUpload' value=\"{$ulb}\" /></td>
+ <td align='left'><input type='submit' id='wpUpload' name='wpUpload' value=\"{$ulb}\" /></td>
</tr>
<tr>
diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php
index 4ee35b1..787cd65 100644
--- a/includes/SpecialUserlogin.php
+++ b/includes/SpecialUserlogin.php
@@ -136,23 +136,23 @@ class LoginForm {
*/
function addNewAccount() {
global $wgUser, $wgEmailAuthentication;
-
+
# Create the account and abort if there's a problem doing so
$u = $this->addNewAccountInternal();
if( $u == NULL )
return;
-
+
# If we showed up language selection links, and one was in use, be
# smart (and sensible) and save that language as the user's preference
global $wgLoginLanguageSelector;
if( $wgLoginLanguageSelector && $this->mLanguage )
$u->setOption( 'language', $this->mLanguage );
-
+
# Save user settings and send out an email authentication message if needed
$u->saveSettings();
if( $wgEmailAuthentication && User::isValidEmailAddr( $u->getEmail() ) )
$u->sendConfirmationMail();
-
+
# If not logged in, assume the new account as the current one and set session cookies
# then show a "welcome" message or a "need cookies" message as needed
if( $wgUser->isAnon() ) {
@@ -259,8 +259,9 @@ class LoginForm {
}
}
+ // WERELATE - added mEmail parameter
$abortError = '';
- if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
+ if( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError, $this->mEmail ) ) ) {
// Hook point to add extra creation throttles and blocks
wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
$this->mainLoginForm( $abortError );
@@ -372,13 +373,13 @@ class LoginForm {
*/
function mailPassword() {
global $wgUser, $wgOut;
-
+
# Check against the rate limiter
if( $wgUser->pingLimiter( 'mailpassword' ) ) {
$wgOut->rateLimited();
return;
}
-
+
if ( '' == $this->mName ) {
$this->mainLoginForm( wfMsg( 'noname' ) );
return;
@@ -482,6 +483,16 @@ class LoginForm {
return;
}
+ // WERELATE
+ if ($this->mType == 'signup' && $wgUser->isLoggedIn()) {
+ $wgOut->setPageTitle('Already signed in');
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
+ $wgOut->setArticleRelated(false);
+ $wgOut->addWikiText('You don\'t need to create an account. You\'re already signed in.');
+ $wgOut->returnToMain(false);
+ return;
+ }
+
if ( '' == $this->mName ) {
if ( $wgUser->isLoggedIn() ) {
$this->mName = $wgUser->getName();
@@ -512,7 +523,7 @@ class LoginForm {
$q .= $returnto;
$linkq .= $returnto;
}
-
+
# Pass any language selection on to the mode switch link
if( $wgLoginLanguageSelector && $this->mLanguage )
$linkq .= '&uselang=' . $this->mLanguage;
@@ -526,7 +537,7 @@ class LoginForm {
$template->set( 'link', wfMsgHtml( $linkmsg, $link ) );
else
$template->set( 'link', '' );
-
+
$template->set( 'header', '' );
$template->set( 'name', $this->mName );
$template->set( 'password', $this->mPassword );
@@ -542,14 +553,14 @@ class LoginForm {
$template->set( 'userealname', $wgAllowRealName );
$template->set( 'useemail', $wgEnableEmail );
$template->set( 'remember', $wgUser->getOption( 'rememberpassword' ) or $this->mRemember );
-
+
# Prepare language selection links as needed
if( $wgLoginLanguageSelector ) {
$template->set( 'languages', $this->makeLanguageSelector() );
if( $this->mLanguage )
$template->set( 'uselang', $this->mLanguage );
}
-
+
// Give authentication and captcha plugins a chance to modify the form
$wgAuth->modifyUITemplate( $template );
if ( $this->mType == 'signup' ) {
@@ -563,13 +574,15 @@ class LoginForm {
$wgOut->setArticleRelated( false );
$wgOut->addTemplate( $template );
}
-
+
/**
* @private
*/
function showCreateOrLoginLink( &$user ) {
if( $this->mType == 'signup' ) {
return( true );
+ } elseif ($user->isLoggedIn()) { // WERELATE
+ return false;
} elseif( $user->isAllowedToCreateAccount() ) {
return( true );
} else {
@@ -625,7 +638,7 @@ class LoginForm {
$wgOut->addWikiText( wfMsg( 'acct_creation_throttle_hit', $limit ) );
}
-
+
/**
* Produce a bar of links which allow the user to select another language
* during login/registration but retain "returnto"
@@ -647,7 +660,7 @@ class LoginForm {
return '';
}
}
-
+
/**
* Create a language selector link for a particular language
* Links back to this page preserving type and returnto
@@ -666,6 +679,6 @@ class LoginForm {
$skin =& $wgUser->getSkin();
return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) );
}
-
+
}
?>
diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php
index 8bbe49c..3dfb57e 100644
--- a/includes/SpecialWantedpages.php
+++ b/includes/SpecialWantedpages.php
@@ -33,6 +33,7 @@ class WantedPagesPage extends QueryPage {
$dbr =& wfGetDB( DB_SLAVE );
$pagelinks = $dbr->tableName( 'pagelinks' );
$page = $dbr->tableName( 'page' );
+ // WERELATE - replace left join w pg2 with straight_join ; query takes too long otherwise
return
"SELECT 'Wantedpages' AS type,
pl_namespace AS namespace,
@@ -41,10 +42,10 @@ class WantedPagesPage extends QueryPage {
FROM $pagelinks
LEFT JOIN $page AS pg1
ON pl_namespace = pg1.page_namespace AND pl_title = pg1.page_title
- LEFT JOIN $page AS pg2
+ straight_join $page AS pg2
ON pl_from = pg2.page_id
WHERE pg1.page_namespace IS NULL
- AND pl_namespace NOT IN ( 2, 3 )
+ AND pl_namespace not in (2,3)
AND pg2.page_namespace != 8
GROUP BY pl_namespace, pl_title
HAVING COUNT(*) > $count";
diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php
index 5b1e289..71e3d5b 100644
--- a/includes/SpecialWatchlist.php
+++ b/includes/SpecialWatchlist.php
@@ -60,7 +60,7 @@ function wfSpecialWatchlist( $par ) {
$days = $wgRequest->getVal( 'days', $prefs['days'] );
$hideOwn = $wgRequest->getBool( 'hideOwn', $prefs['hideown'] );
$hideBots = $wgRequest->getBool( 'hideBots', $prefs['hidebots'] );
-
+
# Get namespace value, if supplied, and prepare a WHERE fragment
$nameSpace = $wgRequest->getIntOrNull( 'namespace' );
if( !is_null( $nameSpace ) ) {
@@ -88,13 +88,17 @@ function wfSpecialWatchlist( $par ) {
foreach($id as $one) {
$t = Title::newFromURL( $one );
if( !is_null( $t ) ) {
- $wl = WatchedItem::fromUserTitle( $wgUser, $t );
- if( $wl->removeWatch() === false ) {
- $wgOut->addHTML( "<br />\n" . wfMsg( 'couldntremove', htmlspecialchars($one) ) );
- } else {
- wfRunHooks('UnwatchArticle', array(&$wgUser, new Article($t)));
- $wgOut->addHTML( ' (' . htmlspecialchars($one) . ')' );
- }
+ // WERELATE - run UnwatchArticle hooks; fix UnwatchArticle hook below to UnwatchArticleComplete
+ $article = new Article($t);
+ if (wfRunHooks('UnwatchArticle', array(&$wgUser, &$article))) {
+ $wl = WatchedItem::fromUserTitle( $wgUser, $t );
+ if( $wl->removeWatch() === false ) {
+ $wgOut->addHTML( "<br />\n" . wfMsg( 'couldntremove', htmlspecialchars($one) ) );
+ } else {
+ wfRunHooks('UnwatchArticleComplete', array(&$wgUser, &$article));
+ $wgOut->addHTML( ' (' . htmlspecialchars($one) . ')' );
+ }
+ }
} else {
$wgOut->addHTML( "<br />\n" . wfMsg( 'iteminvalidname', htmlspecialchars($one) ) );
}
@@ -118,7 +122,7 @@ function wfSpecialWatchlist( $par ) {
$sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
$res = $dbr->query( $sql, $fname );
$s = $dbr->fetchObject( $res );
-
+
# Patch *** A1 *** (see A2 below)
# adjust for page X, talk:page X, which are both stored separately, but treated together
$nitems = floor($s->n / 2);
@@ -131,12 +135,13 @@ function wfSpecialWatchlist( $par ) {
if( is_null($days) || !is_numeric($days) ) {
$big = 1000; /* The magical big */
- if($nitems > $big) {
+// WERELATE - don't change default; pages don't change that often
+// if($nitems > $big) {
# Set default cutoff shorter
- $days = $defaults['days'] = (12.0 / 24.0); # 12 hours...
- } else {
+// $days = $defaults['days'] = (12.0 / 24.0); # 12 hours...
+// } else {
$days = $defaults['days']; # default cutoff for shortlisters
- }
+// }
} else {
$days = floatval($days);
}
@@ -182,7 +187,7 @@ function wfSpecialWatchlist( $par ) {
$sql = "SELECT wl_namespace, wl_title, page_is_redirect FROM $watchlist LEFT JOIN $page ON wl_namespace = page_namespace AND wl_title = page_title WHERE wl_user=$uid";
$res = $dbr->query( $sql, $fname );
-
+
# Batch existence check
$linkBatch = new LinkBatch();
while( $row = $dbr->fetchObject( $res ) )
@@ -190,7 +195,7 @@ function wfSpecialWatchlist( $par ) {
$linkBatch->execute();
if( $dbr->numRows( $res ) > 0 )
$dbr->dataSeek( $res, 0 ); # Let's do the time warp again!
-
+
$sk = $wgUser->getSkin();
$list = array();
@@ -200,7 +205,7 @@ function wfSpecialWatchlist( $par ) {
// TODO: Display a TOC
foreach($list as $ns => $titles) {
- if (Namespace::isTalk($ns))
+ if (Namespac::isTalk($ns))
continue;
if ($ns != NS_MAIN)
$wgOut->addHTML( '<h2>' . $wgContLang->getFormattedNsText( $ns ) . '</h2>' );
@@ -228,7 +233,7 @@ function wfSpecialWatchlist( $par ) {
} else {
$spanopen = $spanclosed = '';
}
-
+
$wgOut->addHTML( "<li>{$checkbox}{$spanopen}{$pageLink}{$spanclosed} {$toolLinks}</li>\n" );
}
}
@@ -266,7 +271,7 @@ function wfSpecialWatchlist( $par ) {
# Toggle watchlist content (all recent edits or just the latest)
if( $wgUser->getOption( 'extendwatchlist' )) {
- $andLatest='';
+ $andLatest='';
$limitWatchlist = 'LIMIT ' . intval( $wgUser->getOption( 'wllimit' ) );
} else {
$andLatest= 'AND rc_this_oldid=page_latest';
@@ -288,6 +293,27 @@ function wfSpecialWatchlist( $par ) {
"\n\n" );
}
+ // WERELATE - handle changed view
+ if ($wgRequest->getBool('changed') || $par == 'changed' ) {
+ $wgOut->addHTML( '<hr /><h2>All pages changed since last visited</h2><ul><li><a href="'.$specialTitle->getFullUrl().'">Show recently-changed pages</a></li></ul>' );
+ $sql = 'select wl_namespace, wl_title from watchlist where wl_user='.$wgUser->getID().' and wl_notificationtimestamp > \'0\'';
+ $res = $dbr->query( $sql, $fname );
+ $sk = $wgUser->getSkin();
+ $changed = '';
+ $count = 0;
+ while ( $obj = $dbr->fetchObject( $res ) ) {
+ $t = Title::makeTitle($obj->wl_namespace, $obj->wl_title);
+ $historylink = $sk->makeKnownLinkObj( $t, 'hist', wfArrayToCGI( array('action' => 'history' ) ) );
+ $articlelink = $sk->makeKnownLinkObj( $t );
+ $changed .= "<li> ( $historylink ) . . $articlelink</li>\n";
+ $count += 1;
+ }
+ $dbr->freeResult( $res );
+ $wgOut->addHTML("<h3>$count page(s)</h3>\n<ul>" . $changed . '</ul>');
+ return;
+ }
+
+// WERELATE - remove join with page table
$sql = "SELECT
rc_namespace AS page_namespace, rc_title AS page_title,
rc_comment AS rev_comment, rc_cur_id AS page_id,
@@ -296,13 +322,11 @@ function wfSpecialWatchlist( $par ) {
rc_this_oldid AS rev_id,
rc_last_oldid, rc_id, rc_patrolled,
rc_new AS page_is_new,wl_notificationtimestamp
- FROM $watchlist,$recentchanges,$page
+ FROM $watchlist,$recentchanges
WHERE wl_user=$uid
AND wl_namespace=rc_namespace
AND wl_title=rc_title
AND rc_timestamp > '$cutoff'
- AND rc_cur_id=page_id
- $andLatest
$andHideOwn
$andHideBots
$nameSpaceClause
@@ -310,10 +334,53 @@ function wfSpecialWatchlist( $par ) {
$limitWatchlist";
$res = $dbr->query( $sql, $fname );
- $numRows = $dbr->numRows( $res );
+
+// WERELATE - moved up from below so we can calculate $numRows inside the loop
+// $numRows = $dbr->numRows( $res );
+ $numRows = 0;
+ $list = ChangesList::newFromUser( $wgUser );
+
+ $rcs = $list->beginRecentChangesList();
+ $counter = 1;
+// WERELATE - added array of seen pagetitles
+ $seen = array();
+ while ( $obj = $dbr->fetchObject( $res ) ) {
+ $nsTitle = "{$obj->page_namespace}:{$obj->page_title}";
+ if (!$andLatest || !isset($seen[$nsTitle])) {
+ $seen[$nsTitle] = 1;
+ $numRows++;
+
+ # Make fake RC entry
+ $rc = RecentChange::newFromCurRow( $obj, $obj->rc_last_oldid );
+ $rc->counter = $counter++;
+
+ if ( $wgShowUpdatedMarker ) {
+ $updated = $obj->wl_notificationtimestamp;
+ } else {
+ // Same visual appearance as MW 1.4
+ $updated = true;
+ }
+
+ if ($wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) {
+ $sql3 = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_title='" .wfStrencode($obj->page_title). "' AND wl_namespace='{$obj->page_namespace}'" ;
+ $res3 = $dbr->query( $sql3, DB_READ, $fname );
+ $x = $dbr->fetchObject( $res3 );
+ $rc->numberofWatchingusers = $x->n;
+ } else {
+ $rc->numberofWatchingusers = 0;
+ }
+
+ $rcs .= $list->recentChangesLine( $rc, $updated );
+ }
+ }
+ $rcs .= $list->endRecentChangesList();
+
+ $dbr->freeResult( $res );
/* Start bottom header */
- $wgOut->addHTML( "<hr />\n<p>" );
+ // WERELATE - add link to changed view
+// $wgOut->addHTML( "<hr />\n<p>" );
+ $wgOut->addHTML( '<hr /><h2>Recently-changed pages</h2><ul><li><a href="'.$specialTitle->getFullUrl('changed=yes').'">Show all pages changed since last visited</a></li></ul><br/><p>' );
if($days >= 1)
$wgOut->addWikiText( wfMsg( 'rcnote', $wgLang->formatNum( $numRows ),
@@ -328,7 +395,7 @@ function wfSpecialWatchlist( $par ) {
$thisTitle = Title::makeTitle( NS_SPECIAL, 'Watchlist' );
$skin = $wgUser->getSkin();
$linkElements = array( 'hideOwn' => 'wlhideshowown', 'hideBots' => 'wlhideshowbots' );
-
+
# Problems encountered using the fancier method
$label = $hideBots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
$linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
@@ -363,37 +430,8 @@ function wfSpecialWatchlist( $par ) {
$wgOut->addHTML( "</p>\n" );
/* End bottom header */
- $list = ChangesList::newFromUser( $wgUser );
-
- $s = $list->beginRecentChangesList();
- $counter = 1;
- while ( $obj = $dbr->fetchObject( $res ) ) {
- # Make fake RC entry
- $rc = RecentChange::newFromCurRow( $obj, $obj->rc_last_oldid );
- $rc->counter = $counter++;
-
- if ( $wgShowUpdatedMarker ) {
- $updated = $obj->wl_notificationtimestamp;
- } else {
- // Same visual appearance as MW 1.4
- $updated = true;
- }
-
- if ($wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) {
- $sql3 = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_title='" .wfStrencode($obj->page_title). "' AND wl_namespace='{$obj->page_namespace}'" ;
- $res3 = $dbr->query( $sql3, DB_READ, $fname );
- $x = $dbr->fetchObject( $res3 );
- $rc->numberofWatchingusers = $x->n;
- } else {
- $rc->numberofWatchingusers = 0;
- }
-
- $s .= $list->recentChangesLine( $rc, $updated );
- }
- $s .= $list->endRecentChangesList();
-
- $dbr->freeResult( $res );
- $wgOut->addHTML( $s );
+// WERELATE - change $s to $rcs
+ $wgOut->addHTML( $rcs );
if ( $wgUseWatchlistCache ) {
$wgMemc->set( $memckey, $s, $wgWLCacheTimeout);
@@ -451,18 +489,18 @@ function wlCutoffLinks( $days, $page = 'Watchlist', $options = array() ) {
*/
function wlCountItems( &$user, $talk = true ) {
$dbr =& wfGetDB( DB_SLAVE );
-
+
# Fetch the raw count
$res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->mId ), 'wlCountItems' );
$row = $dbr->fetchObject( $res );
$count = $row->count;
$dbr->freeResult( $res );
-
+
# Halve to remove talk pages if needed
if( !$talk )
$count = floor( $count / 2 );
-
- return( $count );
+
+ return( $count );
}
/**
@@ -485,7 +523,20 @@ function wlHandleClear( &$out, &$request, $par ) {
if( $request->wasPosted() && $wgUser->matchEditToken( $request->getText( 'token' ), 'clearwatchlist' ) ) {
# Clearing, so do it and report the result
$dbw =& wfGetDB( DB_MASTER );
- $dbw->delete( 'watchlist', array( 'wl_user' => $wgUser->mId ), 'wlHandleClear' );
+ // WERELATE - don't remove pages in your trees; call WatchedItem::removeWatch
+ // $dbw->delete( 'watchlist', array( 'wl_user' => $wgUser->mId ), 'wlHandleClear' );
+ $sql = 'SELECT wl_namespace, wl_title FROM watchlist where wl_user='.$dbw->addQuotes($wgUser->mId).
+ ' AND NOT EXISTS (SELECT fp_tree_id FROM familytree_page WHERE fp_namespace=(wl_namespace & ~1) AND fp_title=wl_title AND fp_user_id=wl_user)';
+ $rows = $dbw->query($sql, 'wlHandleClear');
+ while ($row = $dbw->fetchObject($rows)) {
+ $title = Title::makeTitle($row->wl_namespace, $row->wl_title);
+ if ($title) {
+ $wl = WatchedItem::fromUserTitle( $wgUser, $title );
+ $wl->removeWatch();
+ }
+ }
+ $dbw->freeResult($rows);
+
$out->addWikiText( wfMsg( 'watchlistcleardone', $count ) );
$out->returnToMain();
} else {
@@ -496,7 +547,7 @@ function wlHandleClear( &$out, &$request, $par ) {
$out->addWikiText( wfMsg( 'watchlistcleartext' ) );
$out->addHTML( wfElement( 'input', array( 'type' => 'hidden', 'name' => 'token', 'value' => $wgUser->editToken( 'clearwatchlist' ) ), '' ) );
$out->addHTML( wfElement( 'input', array( 'type' => 'submit', 'name' => 'submit', 'value' => wfMsgHtml( 'watchlistclearbutton' ) ), '' ) );
- $out->addHTML( wfCloseElement( 'form' ) );
+ $out->addHTML( wfCloseElement( 'form' ) );
}
return( true );
} else {
diff --git a/includes/SpecialWhatlinkshere.php b/includes/SpecialWhatlinkshere.php
index cedf604..7615a10 100644
--- a/includes/SpecialWhatlinkshere.php
+++ b/includes/SpecialWhatlinkshere.php
@@ -30,11 +30,11 @@ class WhatLinksHerePage {
function execute() {
global $wgOut;
- $this->limit = min( $this->request->getInt( 'limit', 50 ), 5000 );
+ $this->limit = min( $this->request->getInt( 'limit', 500 ), 5000 );
if ( $this->limit <= 0 ) {
- $this->limit = 50;
+ $this->limit = 500;
}
- $this->from = $this->request->getInt( 'from' );
+ $this->from = $this->request->getText( 'from' );
$this->dir = $this->request->getText( 'dir', 'next' );
if ( $this->dir != 'prev' ) {
$this->dir = 'next';
@@ -64,6 +64,16 @@ class WhatLinksHerePage {
$this->showIndirectLinks( 0, $this->target, $this->limit, $this->from, $this->dir );
}
+ function padNs($ns) {
+ if ($ns < 10) {
+ return '00'.$ns;
+ }
+ if ($ns < 100) {
+ return '0'.$ns;
+ }
+ return $ns;
+ }
+
/**
* @param int $level Recursion level
* @param Title $target Target title
@@ -72,7 +82,7 @@ class WhatLinksHerePage {
* @param string $dir 'next' or 'prev', whether $fromTitle is the start or end of the list
* @private
*/
- function showIndirectLinks( $level, $target, $limit, $from = 0, $dir = 'next' ) {
+ function showIndirectLinks( $level, $target, $limit, $from = '', $dir = 'next' ) {
global $wgOut;
$fname = 'WhatLinksHerePage::showIndirectLinks';
@@ -81,7 +91,6 @@ class WhatLinksHerePage {
extract( $dbr->tableNames( 'pagelinks', 'templatelinks', 'page' ) );
// Some extra validation
- $from = intval( $from );
if ( !$from && $dir == 'prev' ) {
// Before start? No make sense
$dir = 'next';
@@ -100,17 +109,21 @@ class WhatLinksHerePage {
'tl_title' => $target->getDBkey(),
);
- if ( $from ) {
+ $options = array();
+ if ( $from && strpos($from, ':')) {
+ $flds = split(":", $from, 2);
+ $fromNamespace = $dbr->addQuotes($flds[0]);
+ $fromTitle = $dbr->addQuotes($flds[1]);
if ( 'prev' == $dir ) {
- $offsetCond = "page_id < $from";
- $options = array( 'ORDER BY page_id DESC' );
+ $offsetCond = "(page_namespace < $fromNamespace OR (page_namespace = $fromNamespace AND page_title < $fromTitle))";
+ $options['ORDER BY'] = 'page_namespace DESC, page_title DESC';
} else {
- $offsetCond = "page_id >= $from";
- $options = array( 'ORDER BY page_id' );
+ $offsetCond = "(page_namespace > $fromNamespace OR (page_namespace = $fromNamespace AND page_title >= $fromTitle))";
+ $options['ORDER BY'] = 'page_namespace, page_title';
}
} else {
$offsetCond = false;
- $options = array( 'ORDER BY page_id,is_template DESC' );
+ $options['ORDER BY'] = 'page_namespace, page_title';
}
// Read an extra row as an at-end check
$queryLimit = $limit + 1;
@@ -136,14 +149,15 @@ class WhatLinksHerePage {
// Read the rows into an array and remove duplicates
// templatelinks comes second so that the templatelinks row overwrites the
// pagelinks row, so we get (inclusion) rather than nothing
+ $rows = array();
while ( $row = $dbr->fetchObject( $plRes ) ) {
$row->is_template = 0;
- $rows[$row->page_id] = $row;
+ $rows[$this->padNs($row->page_namespace).':'.$row->page_title] = $row;
}
$dbr->freeResult( $plRes );
while ( $row = $dbr->fetchObject( $tlRes ) ) {
$row->is_template = 1;
- $rows[$row->page_id] = $row;
+ $rows[$this->padNs($row->page_namespace).':'.$row->page_title] = $row;
}
$dbr->freeResult( $tlRes );
@@ -155,16 +169,17 @@ class WhatLinksHerePage {
// Work out the start and end IDs, for prev/next links
if ( $dir == 'prev' ) {
+ $rows = array_reverse($rows);
// Descending order
if ( $numRows > $limit ) {
// More rows available before these ones
- // Get the ID from the next row past the end of the displayed set
- $prevId = $rows[$limit]->page_id;
+ // Get the ID from the top row displayed
+ $prevId = $rows[$limit-1]->page_namespace.':'.$rows[$limit-1]->page_title;
// Remove undisplayed rows
$rows = array_slice( $rows, 0, $limit );
} else {
// No more rows available before
- $prevId = 0;
+ $prevId = '';
}
// Assume that the ID specified in $from exists, so there must be another page
$nextId = $from;
@@ -176,7 +191,7 @@ class WhatLinksHerePage {
if ( $numRows > $limit ) {
// More rows available after these ones
// Get the ID from the last row in the result set
- $nextId = $rows[$limit]->page_id;
+ $nextId = $rows[$limit]->page_namespace.':'.$rows[$limit]->page_title;
// Remove undisplayed rows
$rows = array_slice( $rows, 0, $limit );
} else {
diff --git a/includes/Title.php b/includes/Title.php
index bc8f69a..ea6f7f9 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -30,8 +30,8 @@ class Title {
*/
static private $titleCache=array();
static private $interwikiCache=array();
-
-
+
+
/**
* All member variables should be considered private
* Please use the accessor functions
@@ -108,7 +108,7 @@ class Title {
* @static
* @access public
*/
- function newFromText( $text, $defaultNamespace = NS_MAIN ) {
+ static function newFromText( $text, $defaultNamespace = NS_MAIN ) {
$fname = 'Title::newFromText';
if( is_object( $text ) ) {
@@ -206,7 +206,7 @@ class Title {
}
/**
- * Make an array of titles from an array of IDs
+ * Make an array of titles from an array of IDs
*/
function newFromIDs( $ids ) {
$dbr =& wfGetDB( DB_SLAVE );
@@ -233,7 +233,7 @@ class Title {
* @static
* @access public
*/
- function &makeTitle( $ns, $title ) {
+ static function &makeTitle( $ns, $title ) {
$t =& new Title();
$t->mInterwiki = '';
$t->mFragment = '';
@@ -256,7 +256,7 @@ class Title {
* @static
* @access public
*/
- function makeTitleSafe( $ns, $title ) {
+ static function makeTitleSafe( $ns, $title ) {
$t = new Title();
$t->mDbkeyform = Title::makeName( $ns, $title );
if( $t->secureAndSplit() ) {
@@ -435,7 +435,7 @@ class Title {
return $s->iw_url;
}
-
+
/**
* Fetch interwiki prefix data from local cache in constant database
*
@@ -617,7 +617,7 @@ class Title {
*/
function getSubjectNsText() {
global $wgContLang;
- return $wgContLang->getNsText( Namespace::getSubject( $this->mNamespace ) );
+ return $wgContLang->getNsText( Namespac::getSubject( $this->mNamespace ) );
}
/**
@@ -626,17 +626,17 @@ class Title {
*/
function getTalkNsText() {
global $wgContLang;
- return( $wgContLang->getNsText( Namespace::getTalk( $this->mNamespace ) ) );
+ return( $wgContLang->getNsText( Namespac::getTalk( $this->mNamespace ) ) );
}
-
+
/**
* Could this title have a corresponding talk page?
* @return bool
*/
function canTalk() {
- return( Namespace::canTalk( $this->mNamespace ) );
+ return( Namespac::canTalk( $this->mNamespace ) );
}
-
+
/**
* Get the interwiki prefix (or null string)
* @return string
@@ -737,7 +737,7 @@ class Title {
return( $this->mTextform );
}
}
-
+
/**
* Get a URL-encoded form of the subpage text
* @return string URL-encoded subpage name
@@ -860,7 +860,7 @@ class Title {
$url = "{$wgScript}?title={$dbkey}&{$query}";
}
}
-
+
// FIXME: this causes breakage in various places when we
// actually expected a local URL and end up with dupe prefixes.
if ($wgRequest->getVal('action') == 'render') {
@@ -967,7 +967,7 @@ class Title {
function isProtected( $action = '' ) {
global $wgRestrictionLevels;
if ( -1 == $this->mNamespace ) { return true; }
-
+
if( $action == 'edit' || $action == '' ) {
$r = $this->getRestrictions( 'edit' );
foreach( $wgRestrictionLevels as $level ) {
@@ -976,7 +976,7 @@ class Title {
}
}
}
-
+
if( $action == 'move' || $action == '' ) {
$r = $this->getRestrictions( 'move' );
foreach( $wgRestrictionLevels as $level ) {
@@ -1047,21 +1047,39 @@ class Title {
# protect css/js subpages of user pages
# XXX: this might be better using restrictions
# XXX: Find a way to work around the php bug that prevents using $this->userCanEditCssJsSubpage() from working
- if( NS_USER == $this->mNamespace
- && preg_match("/\\.(css|js)$/", $this->mTextform )
+// WERELATE - added User Talk move/create block
+ if( (NS_USER == $this->mNamespace ||
+ (NS_USER_TALK == $this->mNamespace &&
+ ($action == 'move' ||
+ ($action == 'create' &&
+ (User::idFromName(current(explode('/', $this->mTextform, 2))) == 0 || // user does not exist
+ (mb_strpos($this->mTextform, '/') !== false && // is sub-page
+ !$this->getSubjectPage()->exists()))))))
+// WERELATE - removed - don't allow anyone to edit user pages except sysops and the user
+// && preg_match("/\\.(css|js)$/", $this->mTextform )
&& !$wgUser->isAllowed('editinterface')
- && !preg_match('/^'.preg_quote($wgUser->getName(), '/').'\//', $this->mTextform) ) {
+// WERELATE - modified
+ && !preg_match('/^'.preg_quote($wgUser->getName(), '/').'(\/|$)/', $this->mTextform) ) {
wfProfileOut( $fname );
return false;
}
+// WERELATE - added
+ if ((NS_MYSOURCE == $this->mNamespace || NS_MYSOURCE_TALK == $this->mNamespace) &&
+ ($action == 'create' || $action == 'move') &&
+ !$wgUser->isAllowed('editinterface') &&
+ (mb_strpos($this->mTextform, '/') === false || User::idFromName(current(explode('/', $this->mTextform, 2))) == 0)) {
+ wfProfileOut($fname);
+ return false;
+ }
foreach( $this->getRestrictions($action) as $right ) {
// Backwards compatibility, rewrite sysop -> protect
if ( $right == 'sysop' ) {
$right = 'protect';
}
- if( '' != $right && !$wgUser->isAllowed( $right ) ) {
- wfProfileOut( $fname );
+// WERELATE: added title parm
+ if( '' != $right && !$wgUser->isAllowed( $right, $this ) ) {
+ wfProfileOut( $fname );
return false;
}
}
@@ -1118,7 +1136,7 @@ class Title {
* @access public
*/
function isMovable() {
- return Namespace::isMovable( $this->getNamespace() )
+ return Namespac::isMovable( $this->getNamespace() )
&& $this->getInterwiki() == '';
}
@@ -1171,7 +1189,7 @@ class Title {
* @access public
*/
function isTalkPage() {
- return Namespace::isTalk( $this->getNamespace() );
+ return Namespac::isTalk( $this->getNamespace() );
}
/**
@@ -1314,14 +1332,19 @@ class Title {
return $this->mArticleID;
}
- function getLatestRevID() {
- if ($this->mLatestID !== false)
+ // WERELATE - added flags parameter
+ function getLatestRevID( $flags = 0 ) {
+ if (!($flags & GAID_FOR_UPDATE) && $this->mLatestID !== false)
return $this->mLatestID;
- $db =& wfGetDB(DB_SLAVE);
+ // WERELATE - added this too
+ $articleId = $this->getArticleID($flags);
+ if (!$articleId) return $this->mLatestID = false;
+
+ $db =& wfGetDB($flags & GAID_FOR_UPDATE ? DB_MASTER : DB_SLAVE);
return $this->mLatestID = $db->selectField( 'revision',
"max(rev_id)",
- array('rev_page' => $this->getArticleID()),
+ array('rev_page' => $articleId),
'Title::getLatestRevID' );
}
@@ -1351,7 +1374,8 @@ class Title {
* @return bool true if the update succeded
* @access public
*/
- function invalidateCache() {
+ function invalidateCache($ts=0) {
+// WERELATE: add optional ts parameter
global $wgUseFileCache;
if ( wfReadOnly() ) {
@@ -1361,7 +1385,7 @@ class Title {
$dbw =& wfGetDB( DB_MASTER );
$success = $dbw->update( 'page',
array( /* SET */
- 'page_touched' => $dbw->timestamp()
+ 'page_touched' => $dbw->timestamp($ts)
), array( /* WHERE */
'page_namespace' => $this->getNamespace() ,
'page_title' => $this->getDBkey()
@@ -1451,7 +1475,7 @@ class Title {
if ( preg_match( "/^(.+?)_*:_*(.*)$/S", $t, $m ) ) {
$p = $m[1];
$lowerNs = strtolower( $p );
- if ( $ns = Namespace::getCanonicalIndex( $lowerNs ) ) {
+ if ( $ns = Namespac::getCanonicalIndex( $lowerNs ) ) {
# Canonical namespace
$t = $m[2];
$this->mNamespace = $ns;
@@ -1566,7 +1590,7 @@ class Title {
if ( $t !== '' && ':' == $t{0} ) {
return false;
}
-
+
# Fill fields
$this->mDbkeyform = $t;
$this->mUrlform = wfUrlencode( $t );
@@ -1582,7 +1606,7 @@ class Title {
* @access public
*/
function getTalkPage() {
- return Title::makeTitle( Namespace::getTalk( $this->getNamespace() ), $this->getDBkey() );
+ return Title::makeTitle( Namespac::getTalk( $this->getNamespace() ), $this->getDBkey() );
}
/**
@@ -1593,7 +1617,7 @@ class Title {
* @access public
*/
function getSubjectPage() {
- return Title::makeTitle( Namespace::getSubject( $this->getNamespace() ), $this->getDBkey() );
+ return Title::makeTitle( Namespac::getSubject( $this->getNamespace() ), $this->getDBkey() );
}
/**
@@ -1758,6 +1782,17 @@ class Title {
return 'badarticleerror';
}
+// WERELATE - added
+ global $wgUser;
+ // can't rename user pages to a different user, and can't rename subpages to main user pages or vice-versa
+ if (($this->getNamespace() == NS_USER || $this->getNamespace() == NS_USER_TALK) && !$wgUser->isAllowed('protect')) {
+ $oldPieces = mb_split("/", $this->getText(), 2);
+ $newPieces = mb_split("/", $nt->getText(), 2);
+ if ($oldPieces[0] != $newPieces[0] || count($oldPieces) != count($newPieces)) {
+ return 'userpagemove';
+ }
+ }
+
if ( $auth && (
!$this->userCanEdit() || !$nt->userCanEdit() ||
!$this->userCanMove() || !$nt->userCanMove() ) ) {
@@ -1773,6 +1808,46 @@ class Title {
return 'articleexists';
}
}
+
+// WERELATE - added
+ if ($this->getNamespace() != $nt->getNamespace() && !($this->getNamespace() == NS_SOURCE && $nt->getNamespace() == NS_REPOSITORY)) {
+ return 'namespacemove';
+ }
+ if ($this->getNamespace() == NS_PLACE) {
+ $pieces = mb_split(",", $nt->getText(), 2);
+ if (count($pieces) > 1) {
+ $locatedIn = trim($pieces[1]);
+ if ($locatedIn) {
+ $t = Title::newFromText($locatedIn, NS_PLACE);
+ if (!$t || !$t->exists()) {
+ return 'movelocatedinmissing';
+ }
+ }
+ }
+ }
+// WERELATE - added
+ if ($this->getNamespace() == NS_PLACE && !$wgUser->isAllowed('protect')) {
+ $dbr =& wfGetDB(DB_SLAVE);
+ $sql = 'select page_title from page, pagelinks where pl_namespace='.$dbr->addQuotes(NS_PLACE).
+ ' and pl_title='.$dbr->addQuotes($this->getDBkey()).
+ ' and pl_from=page_id and page_is_redirect=0 and page_namespace='.$dbr->addQuotes(NS_PLACE);
+ $rows = $dbr->query($sql);
+ $suffix = ',_'.$this->getDBkey();
+ $slen = mb_strlen($suffix);
+ $found = false;
+ while ($row = $dbr->fetchObject($rows)) {
+ $rlen = mb_strlen($row->page_title);
+ if ($rlen > $slen && mb_substr($row->page_title, $rlen-$slen) == $suffix) {
+ $found = true;
+ break;
+ }
+ }
+ $dbr->freeResult($rows);
+ if ($found) {
+ return 'moveplacesubplaces';
+ }
+ }
+
return true;
}
@@ -2228,7 +2303,7 @@ class Title {
/**
* Update page_touched timestamps and send squid purge messages for
- * pages linking to this title. May be sent to the job queue depending
+ * pages linking to this title. May be sent to the job queue depending
* on the number of links. Typically called on create and delete.
*/
function touchLinks() {
@@ -2271,6 +2346,31 @@ class Title {
*/
function getNamespaceKey() {
switch ($this->getNamespace()) {
+// WERELATE added our namespaces
+ case NS_GIVEN_NAME:
+ case NS_GIVEN_NAME_TALK:
+ return 'nstab-givenname';
+ case NS_SURNAME:
+ case NS_SURNAME_TALK:
+ return 'nstab-surname';
+ case NS_SOURCE:
+ case NS_SOURCE_TALK:
+ return 'nstab-source';
+ case NS_MYSOURCE:
+ case NS_MYSOURCE_TALK:
+ return 'nstab-mysource';
+ case NS_REPOSITORY:
+ case NS_REPOSITORY_TALK:
+ return 'nstab-repository';
+ case NS_PLACE:
+ case NS_PLACE_TALK:
+ return 'nstab-place';
+ case NS_PERSON:
+ case NS_PERSON_TALK:
+ return 'nstab-person';
+ case NS_FAMILY:
+ case NS_FAMILY_TALK:
+ return 'nstab-family';
case NS_MAIN:
case NS_TALK:
return 'nstab-main';
@@ -2299,6 +2399,12 @@ class Title {
case NS_CATEGORY:
case NS_CATEGORY_TALK:
return 'nstab-category';
+ case NS_PORTAL:
+ case NS_PORTAL_TALK:
+ return 'nstab-portal';
+ case NS_TRANSCRIPT:
+ case NS_TRANSCRIPT_TALK:
+ return 'nstab-transcript';
default:
return 'nstab-' . strtolower( $this->getSubjectNsText() );
}
diff --git a/includes/User.php b/includes/User.php
index f242628..d1a86be 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -187,9 +187,9 @@ class User {
*
* This function exists for username validation, in order to reject
* usernames which are similar in form to IP addresses. Strings such
- * as 300.300.300.300 will return true because it looks like an IP
+ * as 300.300.300.300 will return true because it looks like an IP
* address, despite not being strictly valid.
- *
+ *
* We match \d{1,3}\.\d{1,3}\.\d{1,3}\.xxx as an anonymous IP
* address because the usemod software would "cloak" anonymous IP
* addresses like this, if we allowed accounts like this to be created
@@ -240,7 +240,7 @@ class User {
|| $parsed->getNamespace()
|| strcmp( $name, $parsed->getPrefixedText() ) )
return false;
-
+
// Check an additional blacklist of troublemaker characters.
// Should these be merged into the title char list?
$unicodeBlacklist = '/[' .
@@ -254,7 +254,7 @@ class User {
if( preg_match( $unicodeBlacklist, $name ) ) {
return false;
}
-
+
return true;
}
@@ -524,13 +524,13 @@ class User {
if( !isset( $wgRateLimits[$action] ) ) {
return false;
}
-
+
# Some groups shouldn't trigger the ping limiter, ever
foreach( $this->getGroups() as $group ) {
if( array_search( $group, $wgRateLimitsExcludedGroups ) !== false )
return false;
}
-
+
global $wgMemc, $wgDBname, $wgRateLimitLog;
$fname = 'User::pingLimiter';
wfProfileIn( $fname );
@@ -539,6 +539,12 @@ class User {
$keys = array();
$id = $this->getId();
$ip = wfGetIP();
+// WERELATE: added night check
+ global $wrNightBegin, $wrNightEnd;
+ $time = substr(wfTimestamp(TS_MW), 8);
+ if( isset( $limits['night']) && $time > $wrNightBegin && $time < $wrNightEnd) {
+ $keys["$wgDBname:limiter:$action:night"] = $limits['night'];
+ }
if( isset( $limits['anon'] ) && $id == 0 ) {
$keys["$wgDBname:limiter:$action:anon"] = $limits['anon'];
@@ -564,7 +570,8 @@ class User {
foreach( $keys as $key => $limit ) {
list( $max, $period ) = $limit;
$summary = "(limit $max in {$period}s)";
- $count = $wgMemc->get( $key );
+// WERELATE: change get to incr, and remove incr from below else clause
+ $count = $wgMemc->incr( $key );
if( $count ) {
if( $count > $max ) {
wfDebug( "$fname: tripped! $key at $count $summary\n" );
@@ -579,7 +586,6 @@ class User {
wfDebug( "$fname: adding record for $key $summary\n" );
$wgMemc->add( $key, 1, intval( $period ) );
}
- $wgMemc->incr( $key );
}
wfProfileOut( $fname );
@@ -773,7 +779,7 @@ class User {
if( $accountAge >= $wgAutoConfirmAge ) {
$implicitGroups[] = 'autoconfirmed';
}
-
+
# Implicit group for users whose email addresses are confirmed
global $wgEmailAuthentication;
if( $this->isValidEmailAddr( $this->mEmail ) ) {
@@ -864,7 +870,7 @@ class User {
return array(array("wiki" => $wgDBname, "link" => $utp->getLocalURL()));
}
-
+
/**
* Perform a user_newtalk check on current slaves; if the memcached data
* is funky we don't want newtalk state to get stuck on save, as that's
@@ -1075,7 +1081,7 @@ class User {
function getBoolOption( $oname ) {
return (bool)$this->getOption( $oname );
}
-
+
/**
* Get an option as an integer value from the source string.
* @param string $oname The option to check
@@ -1239,13 +1245,44 @@ class User {
* @param string $action Action to be checked (see $wgAvailableRights in Defines.php for possible actions).
* @return boolean True: action is allowed, False: action should not be allowed
*/
- function isAllowed($action='') {
+ function isAllowed($action='', $title=null) {
if ( $action === '' )
// In the spirit of DWIM
return true;
$this->loadFromDatabase();
- return in_array( $action , $this->mRights );
+ $res = in_array( $action , $this->mRights );
+// WERELATE: added
+ if (!$res && ($action == 'delete' || $action == 'undelete') && $this->isLoggedIn() && $title != null) {
+ if (in_array($title->getNamespace(), array(NS_MYSOURCE, NS_MYSOURCE_TALK, NS_USER, NS_USER_TALK))) {
+ $res = preg_match('/^'.preg_quote($this->getName(), '/').'(\/|$)/', $title->getText());
+ }
+ else if (in_array($title->getNamespace(), array(NS_PERSON, NS_PERSON_TALK, NS_FAMILY, NS_FAMILY_TALK, NS_IMAGE, NS_IMAGE_TALK))) {
+ $dbr =& wfGetDB(DB_SLAVE);
+ if ($action == 'delete') {
+ $sql = 'SELECT count(*) FROM watchlist WHERE wl_namespace=' . $dbr->addQuotes($title->getNamespace()) .
+ ' AND wl_title=' . $dbr->addQuotes($title->getDBkey()) . ' AND wl_user<>' . $dbr->addQuotes($this->getID());
+ $rows = $dbr->query($sql);
+ if ($rows !== false) {
+ $row = $dbr->fetchRow($rows);
+ $res = ($row !== false) && $row[0] == 0;
+ $dbr->freeResult($rows);
+ }
+ }
+ else { // undelete
+ $sql = 'SELECT count(*) FROM logging WHERE log_namespace=' . $dbr->addQuotes($title->getNamespace()) .
+ ' AND log_title=' . $dbr->addQuotes($title->getDBkey()) . ' AND log_user=' . $dbr->addQuotes($this->getID()) .
+ ' AND log_type="delete"';
+ $rows = $dbr->query($sql);
+ if ($rows !== false) {
+ $row = $dbr->fetchRow($rows);
+ $res = ($row !== false) && $row[0] > 0;
+ $dbr->freeResult($rows);
+ }
+ }
+ }
+ }
+ return $res;
}
/**
@@ -1285,8 +1322,12 @@ class User {
* Watch an article
*/
function addWatch( $title ) {
- $wl = WatchedItem::fromUserTitle( $this, $title );
- $wl->addWatch();
+// WERELATE - add wrWatchlistSummary
+ global $wrWatchlistSummary;
+
+ $wl = WatchedItem::fromUserTitle( $this, $title);
+ $wl->addWatch(@$wrWatchlistSummary);
+ $wrWatchlistSummary = null;
$this->invalidateCache();
}
@@ -1373,9 +1414,10 @@ class User {
if( $currentUser != 0 ) {
$dbw =& wfGetDB( DB_MASTER );
+ // WERELATE: set wl_notificationtimestamp to NULL instead of 0
$success = $dbw->update( 'watchlist',
array( /* SET */
- 'wl_notificationtimestamp' => 0
+ 'wl_notificationtimestamp' => NULL
), array( /* WHERE */
'wl_user' => $currentUser
), 'UserMailer::clearAll'
@@ -1963,7 +2005,7 @@ class User {
array_keys( $wgGroupPermissions ),
array( '*', 'user', 'autoconfirmed', 'emailconfirmed' ) );
}
-
+
/**
* Get the title of a page describing a particular group
*
@@ -1979,8 +2021,8 @@ class User {
}
return false;
}
-
-
+
+
}
?>
diff --git a/includes/UserMailer.php b/includes/UserMailer.php
index 8de39a6..64c445b 100644
--- a/includes/UserMailer.php
+++ b/includes/UserMailer.php
@@ -80,6 +80,18 @@ class MailAddress {
function userMailer( $to, $from, $subject, $body, $replyto=false ) {
global $wgUser, $wgSMTP, $wgOutputEncoding, $wgErrorString;
+ // WERELATE - if mail from WeRelate system, set to WeRelate donotreply@werelate.org; otherwise set to {name} werelate-user@werelate.org
+ // this is done because Amazon SES requires validating all sender emails, and we don't want to do that for each user
+ // TODO: this needs to be parameterized so other websites can enter their own from addresses
+ if (substr($from->address, -13) === '@werelate.org' && ($from->name === 'WeRelateAdmin' || !$from->name)) {
+ $replyto = '';
+ $from = new MailAddress('donotreply@werelate.org', 'WeRelate');
+ }
+ else {
+ $replyto = $from->toString();
+ $from = new MailAddress('werelate-user@werelate.org', $from->name);
+ }
+
if (is_array( $wgSMTP )) {
require_once( 'Mail.php' );
@@ -91,6 +103,9 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) {
if ( $replyto ) {
$headers['Reply-To'] = $replyto;
}
+ else {
+ $headers['Reply-To'] = $from->toString();
+ }
$headers['Subject'] = wfQuotedPrintable( $subject );
$headers['Date'] = date( 'r' );
$headers['MIME-Version'] = '1.0';
@@ -122,10 +137,13 @@ function userMailer( $to, $from, $subject, $body, $replyto=false ) {
"Content-type: text/plain; charset={$wgOutputEncoding}\n" .
"Content-Transfer-Encoding: 8bit\n" .
"X-Mailer: MediaWiki mailer\n".
- 'From: ' . $from->toString() . "\n";
+ "From: {$from->toString()}\n";
if ($replyto) {
$headers .= "Reply-To: $replyto\n";
}
+ else {
+ $headers .= 'Reply-To: ' . $from->toString() . "\n";
+ }
$dest = $to->toString();
@@ -208,6 +226,8 @@ class EmailNotification {
$isUserTalkPage = ($title->getNamespace() == NS_USER_TALK);
$enotifusertalkpage = ($isUserTalkPage && $wgEnotifUserTalk);
$enotifwatchlistpage = $wgEnotifWatchlist;
+// WERELATE: yesterday
+ $yesterday = wfTimestamp(TS_MW, time() - 24 * 60 * 60);
if ( (!$minorEdit || $wgEnotifMinorEdits) ) {
if( $wgEnotifWatchlist ) {
@@ -233,12 +253,13 @@ class EmailNotification {
$dbr =& wfGetDB( DB_MASTER );
extract( $dbr->tableNames( 'watchlist' ) );
+// WERELATE: add wl_notificationtimestamp < yesterday so we re-notify people
$res = $dbr->select( 'watchlist', array( 'wl_user' ),
array(
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
$userCondition,
- 'wl_notificationtimestamp IS NULL',
+ '(wl_notificationtimestamp IS NULL OR wl_notificationtimestamp < '.$dbr->addQuotes($dbr->timestamp($yesterday)).')',
), $fname );
# if anyone is watching ... set up the email message text which is
@@ -258,8 +279,10 @@ class EmailNotification {
$wuser = $dbr->fetchObject( $res );
$watchingUser->setID($wuser->wl_user);
- if ( ( $enotifwatchlistpage && $watchingUser->getOption('enotifwatchlistpages') ) ||
- ( $enotifusertalkpage && $watchingUser->getOption('enotifusertalkpages') )
+// WERELATE: fixed bug: (1st or 2nd line), 3rd, and 4th lines must be true
+// WERELATE: fixed bug: notify user talk page only if this is watchers talk page
+ if ( ( ( $enotifwatchlistpage && $watchingUser->getOption('enotifwatchlistpages') ) ||
+ ( $enotifusertalkpage && $watchingUser->getOption('enotifusertalkpages') && $title->getText() == $watchingUser->getName() ) )
&& (!$minorEdit || ($wgEnotifMinorEdits && $watchingUser->getOption('enotifminoredits') ) )
&& ($watchingUser->isEmailConfirmed() ) ) {
# ... adjust remaining text and page edit time placeholders
@@ -276,12 +299,16 @@ class EmailNotification {
# mark the changed watch-listed page with a timestamp, so that the page is
# listed with an "updated since your last visit" icon in the watch list, ...
$dbw =& wfGetDB( DB_MASTER );
+// WERELATE: added wl_user <> wgUser -- never put a page I edit on my own watchlist
+// WERELATE: add wl_notificationtimestamp IS NULL or < yesterday so we can tell how long it's been since you were notified
$success = $dbw->update( 'watchlist',
array( /* SET */
'wl_notificationtimestamp' => $dbw->timestamp($timestamp)
), array( /* WHERE */
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
+ 'wl_user <> ' . intval( $wgUser->getId() ),
+ '(wl_notificationtimestamp IS NULL OR wl_notificationtimestamp < '.$dbw->addQuotes($dbw->timestamp($yesterday)).')',
), 'UserMailer::NotifyOnChange'
);
# FIXME what do we do on failure ?
@@ -328,6 +355,8 @@ class EmailNotification {
$pagetitle = $this->title->getPrefixedText();
$keys['$PAGETITLE'] = $pagetitle;
$keys['$PAGETITLE_URL'] = $this->title->getFullUrl();
+ // WERELATE: add unwatch key
+ $keys['$UNWATCH_URL'] = $this->title->getFullUrl('action=unwatch');
$keys['$PAGEMINOREDIT'] = $medit;
$keys['$PAGESUMMARY'] = $summary;
@@ -338,7 +367,8 @@ class EmailNotification {
# the user has not opted-out and the option is enabled at the
# global configuration level.
$name = $wgUser->getName();
- $adminAddress = new MailAddress( $wgEmergencyContact, 'WikiAdmin' );
+ // WERELATE: changed WikiAdmin to WeRelateAdmin
+ $adminAddress = new MailAddress( $wgEmergencyContact, 'WeRelateAdmin' );
$editorAddress = new MailAddress( $wgUser );
if( $wgEnotifRevealEditorAddress
&& ( $wgUser->getEmail() != '' )
@@ -365,7 +395,8 @@ class EmailNotification {
$emailPage = Title::makeTitle( NS_SPECIAL, 'Emailuser/' . $name );
$keys['$PAGEEDITOR_EMAIL'] = $emailPage->getFullUrl();
}
- $userPage = $wgUser->getUserPage();
+ // WERELATE - change user to talk page
+ $userPage = $wgUser->getTalkPage();
$keys['$PAGEEDITOR_WIKI'] = $userPage->getFullUrl();
$body = strtr( $body, $keys );
$body = wordwrap( $body, 72 );
diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php
index 3885bb9..ae4db52 100644
--- a/includes/WatchedItem.php
+++ b/includes/WatchedItem.php
@@ -9,14 +9,15 @@
* @package MediaWiki
*/
class WatchedItem {
- var $mTitle, $mUser;
+// WERELATE - add summary
+ var $mTitle, $mUser, $mSummary;
/**
* Create a WatchedItem object with the given user and title
* @todo document
* @access private
*/
- function &fromUserTitle( &$user, &$title ) {
+ function &fromUserTitle( &$user, &$title) {
$wl = new WatchedItem;
$wl->mUser =& $user;
$wl->mTitle =& $title;
@@ -63,18 +64,21 @@ class WatchedItem {
/**
* @todo document
*/
- function addWatch() {
+ function addWatch($summary = null) {
+// WERELATE - add summary
$fname = 'WatchedItem::addWatch';
wfProfileIn( $fname );
// Use INSERT IGNORE to avoid overwriting the notification timestamp
// if there's already an entry for this page
$dbw =& wfGetDB( DB_MASTER );
+
$dbw->insert( 'watchlist',
array(
'wl_user' => $this->id,
'wl_namespace' => ($this->ns & ~1),
'wl_title' => $this->ti,
+ 'wr_summary' => $summary,
'wl_notificationtimestamp' => NULL
), $fname, 'IGNORE' );
@@ -140,8 +144,9 @@ class WatchedItem {
* @param Title $nt Page title to add watches on
* @static
*/
- function duplicateEntries( $ot, $nt ) {
- WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage() );
+ function duplicateEntries( $ot, $nt, $summary=null ) {
+//WERELATE - add optional $summary parameter
+ WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage(), $summary );
WatchedItem::doDuplicateEntries( $ot->getTalkPage(), $nt->getTalkPage() );
}
@@ -149,7 +154,8 @@ class WatchedItem {
* @static
* @access private
*/
- function doDuplicateEntries( $ot, $nt ) {
+ function doDuplicateEntries( $ot, $nt, $summary=null ) {
+// WERELATE - add optional $summary parameter
$fname = "WatchedItem::duplicateEntries";
$oldnamespace = $ot->getNamespace();
$newnamespace = $nt->getNamespace();
@@ -157,17 +163,25 @@ class WatchedItem {
$newtitle = $nt->getDBkey();
$dbw =& wfGetDB( DB_MASTER );
- $res = $dbw->select( 'watchlist', 'wl_user',
- array( 'wl_namespace' => $oldnamespace, 'wl_title' => $oldtitle ),
- $fname, 'FOR UPDATE'
- );
+ // WERELATE - changed SQL call to filter out users already watching the new title
+// $res = $dbw->select( 'watchlist', 'wl_user',
+// array( 'wl_namespace' => $oldnamespace, 'wl_title' => $oldtitle ),
+// $fname, 'FOR UPDATE'
+// );
+// WERELATE - copy wr_flags and wr_summary
+ $res = $dbw->query('SELECT w1.wl_user, w1.wr_flags, w1.wr_summary FROM watchlist w1 WHERE w1.wl_namespace='.$dbw->addQuotes($oldnamespace).' AND w1.wl_title='.$dbw->addQuotes($oldtitle).
+ ' AND NOT EXISTS (select 1 from watchlist w2 WHERE w2.wl_namespace='.$dbw->addQuotes($newnamespace).' AND w2.wl_title='.$dbw->addQuotes($newtitle).' AND w2.wl_user=w1.wl_user)',
+ $fname);
+
# Construct array to replace into the watchlist
$values = array();
while ( $s = $dbw->fetchObject( $res ) ) {
$values[] = array(
'wl_user' => $s->wl_user,
'wl_namespace' => $newnamespace,
- 'wl_title' => $newtitle
+ 'wl_title' => $newtitle,
+ 'wr_flags' => $s->wr_flags,
+ 'wr_summary' => (is_null($summary) ? $s->wr_summary : $summary) // set summary if passed in; old summary otherwise
);
}
$dbw->freeResult( $res );
@@ -180,7 +194,10 @@ class WatchedItem {
# Perform replace
# Note that multi-row replace is very efficient for MySQL but may be inefficient for
# some other DBMSes, mostly due to poor simulation by us
- $dbw->replace( 'watchlist', array(array( 'wl_user', 'wl_namespace', 'wl_title')), $values, $fname );
+ // WERELATE - change replace to insert (replace is no longer necessary, if it ever even was)
+// $dbw->replace( 'watchlist', array(array( 'wl_user', 'wl_namespace', 'wl_title')), $values, $fname );
+ $dbw->insert('watchlist', $values, $fname);
+
return true;
}
diff --git a/includes/Xml.php b/includes/Xml.php
index 5299336..20d6a53 100644
--- a/includes/Xml.php
+++ b/includes/Xml.php
@@ -68,7 +68,8 @@ class Xml {
* @return String: Html string containing the namespace selector
*/
function &namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {
- global $wgContLang;
+// WERELATE - added $wgSortedNamespaces (set in LocalSettings); hijack includeHidden (which is not used) to include NS_SPECIAL namespace for logs
+ global $wgContLang, $wgSortedNamespaces;
if( $selected !== '' ) {
if( is_null( $selected ) ) {
// No namespace selected; let exact match work without hitting Main
@@ -80,14 +81,28 @@ class Xml {
}
$s = "<select id='namespace' name='namespace' class='namespaceselector'>\n\t";
$arr = $wgContLang->getFormattedNamespaces();
+$sortedNamespaces = $wgSortedNamespaces;
+if ($includehidden) array_push($sortedNamespaces, NS_SPECIAL);
if( !is_null($allnamespaces) ) {
- $arr = array($allnamespaces => wfMsg('namespacesall')) + $arr;
+// $arr = array($allnamespaces => wfMsg('namespacesall')) + $arr;
+array_unshift($sortedNamespaces, $allnamespaces);
}
- foreach ($arr as $index => $name) {
- if ($index < NS_MAIN) continue;
-
- $name = $index !== 0 ? $name : wfMsg('blanknamespace');
-
+// foreach ($arr as $index => $name) {
+foreach ($sortedNamespaces as $index) {
+// if ($index < NS_MAIN) continue;
+// $name = $index !== 0 ? $name : wfMsg('blanknamespace');
+if (!is_null($allnamespaces) && $index === $allnamespaces) {
+ $name = wfMsg('namespacesall');
+}
+else if ($index === 0) {
+ $name = wfMsg('blanknamespace');
+}
+else if ($index === NS_SPECIAL) {
+ $name = 'Logs';
+}
+else {
+ $name = $arr[$index];
+}
if ($index === $selected) {
$s .= self::element("option",
array("value" => $index, "selected" => "selected"),
diff --git a/includes/memcached-client.php b/includes/memcached-client.php
index 697509e..61c3ac3 100644
--- a/includes/memcached-client.php
+++ b/includes/memcached-client.php
@@ -75,6 +75,7 @@ define("MEMCACHE_SERIALIZED", 1<<0);
/**
* Flag: indicates data is compressed
*/
+// WERELATE - may already be defined
define("MEMCACHE_COMPRESSED", 1<<1);
// }}}
@@ -93,7 +94,8 @@ define("COMPRESSION_SAVINGS", 0.20);
* @author Ryan T. Dean <rtdean@cytherianage.net>
* @package memcached-client
*/
-class memcached
+// WERELATE conflicts with php 5.3 I think - rename
+class MWmemcached
{
// {{{ properties
// {{{ public
@@ -235,7 +237,8 @@ class memcached
* @return mixed
* @access public
*/
- function memcached ($args)
+ // WERELATE - changed this too
+ function MWmemcached ($args)
{
$this->set_servers(@$args['servers']);
$this->_debug = @$args['debug'];
diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php
index d864199..09f5397 100644
--- a/includes/normal/UtfNormal.php
+++ b/includes/normal/UtfNormal.php
@@ -125,7 +125,7 @@ class UtfNormal {
* @param string $string a UTF-8 string
* @return string a clean, shiny, normalized UTF-8 string
*/
- function cleanUp( $string ) {
+ static function cleanUp( $string ) {
if( NORMALIZE_ICU ) {
# We exclude a few chars that ICU would not.
$string = preg_replace(
@@ -271,7 +271,7 @@ class UtfNormal {
* Returns false if not or uncertain.
* @param string $string a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
*/
- function quickIsNFCVerify( &$string ) {
+ static function quickIsNFCVerify( &$string ) {
# Screen out some characters that eg won't be allowed in XML
$string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', UTF8_REPLACEMENT, $string );
diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php
index 6636866..c831269 100644
--- a/includes/templates/Userlogin.php
+++ b/includes/templates/Userlogin.php
@@ -25,7 +25,6 @@ class UserloginTemplate extends QuickTemplate {
</div>
<div class="visualClear"></div>
<?php } ?>
-
<div id="userloginForm">
<form name="userlogin" method="post" action="<?php $this->text('action') ?>">
<h2><?php $this->msg('login') ?></h2>
@@ -83,9 +82,8 @@ class UserloginTemplate extends QuickTemplate {
<?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
</form>
</div>
-<div id="loginend"><?php $this->msgWiki( 'loginend' ); ?></div>
<?php
-
+ $this->msgWiki( 'loginend' );
}
}
@@ -114,6 +112,7 @@ class UsercreateTemplate extends QuickTemplate {
<td align='left'>
<input type='text' class='loginText' name="wpName" id="wpName2"
value="<?php $this->text('name') ?>" size='20' />
+ &nbsp;&nbsp;&nbsp;(don't use your email address)
</td>
</tr>
<tr>
@@ -164,6 +163,7 @@ class UsercreateTemplate extends QuickTemplate {
</td>
<?php } ?>
</tr>
+ <?php $this->html('captcha'); /* WERELATE */ ?>
<tr>
<td></td>
<td align='left'>
@@ -206,9 +206,8 @@ class UsercreateTemplate extends QuickTemplate {
<?php if( @$this->haveData( 'uselang' ) ) { ?><input type="hidden" name="uselang" value="<?php $this->text( 'uselang' ); ?>" /><?php } ?>
</form>
</div>
-<div id="signupend"><?php $this->msgWiki( 'signupend' ); ?></div>
<?php
-
+ $this->msgWiki( 'signupend' );
}
}
diff --git a/index.php b/index.php
index f18fa8a..2c4d2d3 100644
--- a/index.php
+++ b/index.php
@@ -19,6 +19,14 @@ if ( isset( $_REQUEST['GLOBALS'] ) ) {
die( '<a href="http://www.hardened-php.net/index.76.html">$GLOBALS overwrite vulnerability</a>');
}
+# need to allow http access from fte and gedcom-review
+if(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] != "https" && strpos($_SERVER['HTTP_REFERER'], "werelate.org") === false) {
+ $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+ header('HTTP/1.1 301 Moved Permanently');
+ header('Location: ' . $redirect);
+ exit();
+}
+
# Valid web server entry point, enable includes.
# Please don't move this line to includes/Defines.php. This line essentially
# defines a valid entry point. If you put it in includes/Defines.php, then
diff --git a/languages/Language.php b/languages/Language.php
index cbb5e31..f3547ac 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -722,10 +722,12 @@ class Language {
}
}
- function getMessage( $key ) {
- global $wgAllMessagesEn;
- return @$wgAllMessagesEn[$key];
- }
+
+
+ function getMessage( $key ) {
+ global $wgAllMessagesEn;
+ return @$wgAllMessagesEn[$key];
+ }
function getAllMessages() {
global $wgAllMessagesEn;
diff --git a/languages/Messages.php b/languages/Messages.php
index 6cbfac9..df7cfd7 100644
--- a/languages/Messages.php
+++ b/languages/Messages.php
@@ -2055,6 +2055,42 @@ Please confirm that really want to recreate this page.',
* Italiano|it
* Nederlands|nl",
+# WERELATE
+'add' => 'Add',
+'all' => 'All',
+'admin' => 'Admin',
+'articles' => 'Articles',
+'browseall' => 'Browse All',
+'comparepages' => 'Compare pages',
+'contents' => 'Contents',
+'family' => 'Family',
+'gedcomreview' => 'GEDCOM review',
+'home' => 'Home',
+'image' => 'Image',
+'images' => 'Images',
+'launchfte' => 'Launch FTE',
+'logs' => 'Logs',
+'myrelate' => 'My Relate',
+'mysource' => 'MySource',
+'nominate' => 'Nominate',
+'otherpage' => 'Other Page',
+'people' => 'People',
+'person' => 'Person',
+'place' => 'Place',
+'places' => 'Places',
+'portals' => 'Portals',
+'repository' => 'Repository',
+'reviewneeded' => 'Review Needed',
+'speedydelete' => 'Speedy Delete',
+'source' => 'Source',
+'sources' => 'Sources',
+'suggestions' => 'Suggestions',
+'support' => 'Support',
+'transcript' => 'Transcript',
+'treeupdate' => 'Trees',
+'treeupdatebutton' => 'Update',
+'userprofile' => 'User Profile',
+'watercooler' => 'Watercooler'
);
?>
diff --git a/maintenance/FiveUpgrade.inc b/maintenance/FiveUpgrade.inc
index 7caf681..e53815e 100644
--- a/maintenance/FiveUpgrade.inc
+++ b/maintenance/FiveUpgrade.inc
@@ -911,14 +911,14 @@ END;
$now = $this->dbw->timestamp();
$add[] = array(
'wl_user' => $row->wl_user,
- 'wl_namespace' => Namespace::getSubject( $row->wl_namespace ),
+ 'wl_namespace' => Namespac::getSubject( $row->wl_namespace ),
'wl_title' => $this->conv( $row->wl_title ),
'wl_notificationtimestamp' => '0' );
$this->addChunk( $add );
$add[] = array(
'wl_user' => $row->wl_user,
- 'wl_namespace' => Namespace::getTalk( $row->wl_namespace ),
+ 'wl_namespace' => Namespac::getTalk( $row->wl_namespace ),
'wl_title' => $this->conv( $row->wl_title ),
'wl_notificationtimestamp' => '0' );
$this->addChunk( $add );
diff --git a/maintenance/dtrace/counts.d b/maintenance/dtrace/counts.d
index bedb454..13725d9 100644
--- a/maintenance/dtrace/counts.d
+++ b/maintenance/dtrace/counts.d
@@ -1,7 +1,7 @@
/*
* This software is in the public domain.
*
- * $Id$
+ * $Id: counts.d 10510 2005-08-15 01:46:19Z kateturner $
*/
#pragma D option quiet
diff --git a/maintenance/dtrace/tree.d b/maintenance/dtrace/tree.d
index a799cb1..2f16e41 100644
--- a/maintenance/dtrace/tree.d
+++ b/maintenance/dtrace/tree.d
@@ -1,7 +1,7 @@
/*
* This software is in the public domain.
*
- * $Id$
+ * $Id: tree.d 10510 2005-08-15 01:46:19Z kateturner $
*/
#pragma D option quiet
diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php
index 2cf8312..a8ebdfb 100644
--- a/maintenance/generateSitemap.php
+++ b/maintenance/generateSitemap.php
@@ -202,7 +202,7 @@ class GenerateSitemap {
* @return string
*/
function guessPriority( $namespace ) {
- return Namespace::isMain( $namespace ) ? $this->priorities[GS_MAIN] : $this->priorities[GS_TALK];
+ return Namespac::isMain( $namespace ) ? $this->priorities[GS_MAIN] : $this->priorities[GS_TALK];
}
/**
diff --git a/maintenance/mctest.php b/maintenance/mctest.php
index 7deaa07..95249b2 100644
--- a/maintenance/mctest.php
+++ b/maintenance/mctest.php
@@ -1,5 +1,5 @@
<?php
-/* $Id$ */
+/* $Id: mctest.php 12896 2006-01-28 08:22:24Z timstarling $ */
$optionsWithArgs = array( 'i' );
diff --git a/maintenance/refreshLinks.inc b/maintenance/refreshLinks.inc
index 34ea629..d7e484e 100644
--- a/maintenance/refreshLinks.inc
+++ b/maintenance/refreshLinks.inc
@@ -20,7 +20,8 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) {
$wgUser->setOption('math', MW_MATH_SOURCE);
# Don't generate extension images (e.g. Timeline)
- $wgParser->mTagHooks = array();
+// WERELATE - commented out so that our extensions run; be careful if you run this with SpamBlacklist on (memory leak?)
+// $wgParser->mTagHooks = array();
# Don't generate thumbnail images
$wgUseImageResize = false;
@@ -67,13 +68,13 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) {
function fixLinksFromArticle( $id ) {
global $wgTitle, $wgParser;
-
+
$wgTitle = Title::newFromID( $id );
$dbw =& wfGetDB( DB_MASTER );
$linkCache =& LinkCache::singleton();
$linkCache->clear();
-
+
if ( is_null( $wgTitle ) ) {
return;
}
diff --git a/skins/MonoBook.php b/skins/MonoBook.php
index c80700d..2c141fc 100644
--- a/skins/MonoBook.php
+++ b/skins/MonoBook.php
@@ -30,6 +30,69 @@ class SkinMonoBook extends SkinTemplate {
$this->stylename = 'monobook';
$this->template = 'MonoBookTemplate';
}
+
+// WERELATE - copied from SkinTemplate
+ function buildPersonalUrls() {
+ global $wgTitle, $wgShowIPinHeader;
+
+ $fname = 'SkinTemplate::buildPersonalUrls';
+ $pageurl = $wgTitle->getLocalURL();
+ wfProfileIn( $fname );
+
+ /* set up the default links for the personal toolbar */
+ $personal_urls = array();
+ if ($this->loggedin) {
+ $personal_urls['userpage'] = array(
+ 'text' => $this->username,
+ 'href' => &$this->userpageUrlDetails['href'],
+ 'class' => $this->userpageUrlDetails['exists']?false:'new',
+ 'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
+ );
+ $personal_urls['preferences'] = array(
+ 'text' => 'Settings',
+ 'href' => $this->makeNSUrl('Preferences', '', NS_SPECIAL),
+ );
+ }
+ else {
+ if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
+ $personal_urls['anonlogin'] = array(
+ 'text' => wfMsg('userlogin'),
+ 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
+ 'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
+ );
+ } else {
+ $personal_urls['login'] = array(
+ 'text' => wfMsg('userlogin'),
+ 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
+ 'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
+ );
+ }
+ $personal_urls['newuser'] = array(
+ 'text' => wfMsg('createaccount'),
+ 'href' => $this->makeSpecialUrl('Userlogin', 'type=signup&returnto=' . $this->thisurl )
+ );
+ }
+ $personal_urls['donate'] = array(
+ 'text' => 'Donate',
+ 'href' => $this->makeNSUrl('Donate', '', NS_PROJECT)
+ );
+ $personal_urls['volunteer'] = array(
+ 'text' => 'Volunteer',
+ 'href' => $this->makeNSUrl('Maintenance', '', NS_PORTAL)
+ );
+ $personal_urls['help'] = array();
+ if ($this->loggedin) {
+ $personal_urls['logout'] = array(
+ 'text' => wfMsg('userlogout'),
+ 'href' => $this->makeSpecialUrl( 'Userlogout',
+ $wgTitle->getNamespace() === NS_SPECIAL && $wgTitle->getText() === 'Preferences' ? '' : "returnto={$this->thisurl}"
+ )
+ );
+ }
+ wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$wgTitle ) );
+ wfProfileOut( $fname );
+ return $personal_urls;
+ }
}
/**
@@ -38,6 +101,73 @@ class SkinMonoBook extends SkinTemplate {
* @subpackage Skins
*/
class MonoBookTemplate extends QuickTemplate {
+
+ /**
+ * Get a local URL given any page title (optionally with namespace prefix).
+ *
+ * This is a rather verbose workaround to avoid Title calling
+ * Namespac::getCanonicalIndex() statically and so throwing an error in
+ * newer PHP versions. It can be replaced by Title::newFromText($text)->getLocalURL()
+ * one day.
+ *
+ * @param string $title Page title, possibly with colon-separated NS prefix
+ * @return string The local URL as given by Title::getLocalURL()
+ */
+ function getLocalUrl($title) {
+ global $wgSitename;
+ $targetParts = explode(':', $title);
+ $ns = (count($targetParts)==2) ? $targetParts[0] : '';
+ if ($ns == $wgSitename) {
+ $ns = 'Project';
+ }
+ else if ($ns == $wgSitename.'_talk') {
+ $ns = 'Project_talk';
+ }
+ $title = (count($targetParts)==2) ? $targetParts[1] : $targetParts[0];
+ $namespace = new Namespac();
+ $nsIndex = $namespace->getCanonicalIndex(strtolower($ns));
+ $url = Title::makeTitle($nsIndex, $title)->getLocalURL();
+ return $url;
+ }
+
+ function getMenuText($text, $target) {
+ $msg = str_replace(' ','&nbsp;',htmlspecialchars(wfMsg($text)));
+ $value = "<li id=\"menu-{$text}\">";
+ if (is_array($target)) {
+ $value .= "<span class=\"wr-menu-more\">$msg</span>▼<ul>";
+ foreach ($target as $innerText => $innerTarget) {
+ $hdr = '';
+ if (substr($innerText,0,1) == '-') {
+ $value .= "<li class=\"wr-menu-sep\"><span class=\"wr-menu-sep\">&nbsp;</span></li>";
+ $innerText = substr($innerText,1);
+ }
+ $msg = str_replace(' ','&nbsp;',htmlspecialchars(wfMsg($innerText)));
+ $value .= "<li id=\"menu-{$innerText}\"><a href=\"".
+ (substr($innerTarget, 0, 1) === "/" || substr($innerTarget, 0, 4) === "http" ? $innerTarget : $this->getLocalUrl($innerTarget)).
+ "\">$msg</a></li>";
+ }
+ $value .= "</ul>";
+ }
+ else {
+ $value .= "<a href=\"".(substr($target, 0, 1) === "/" || substr($target, 0, 4) === "http" ? $target : $this->getLocalUrl($target))."\">$msg</a>";
+ }
+ $value .= "</li>";
+ return $value;
+ }
+
+ function getActionMenuText($key, $action) {
+ $key = htmlspecialchars($key);
+ $class = (string)$action['class'] ? ' class="'.htmlspecialchars($action['class']).'"' : '';
+ $href = $action['href'];
+ $title = (string)$action['title'] ? ' title="'.htmlspecialchars($action['title']).'"' : '';
+ $text = str_replace(' ','&nbsp;',htmlspecialchars($action['text']));
+ return <<<END
+<li id="actions-$key"$class>
+ <a href="$href" rel="nofollow"$title>$text</a>
+</li>
+END;
+ }
+
/**
* Template filter callback for MonoBook skin.
* Takes an associative array of data set from a SkinTemplate-based
@@ -49,224 +179,411 @@ class MonoBookTemplate extends QuickTemplate {
function execute() {
// Suppress warnings to prevent notices about missing indexes in $this->data
wfSuppressWarnings();
-
+// WERELATE - added vml namespace
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
- <head>
- <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
- <?php $this->html('headlinks') ?>
- <title><?php $this->text('pagetitle') ?></title>
- <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css?9"; /*]]>*/</style>
- <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
- <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
- <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
- <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
- <!--[if IE 7]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?1";</style><![endif]-->
- <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
- <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <script type="<?php $this->text('jsmimetype') ?>">var skin = '<?php $this->text('skinname')?>';var stylepath = '<?php $this->text('stylepath')?>';</script>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?1"><!-- wikibits js --></script>
-<?php if($this->data['jsvarurl' ]) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"><!-- site js --></script>
-<?php } ?>
-<?php if($this->data['pagecss' ]) { ?>
- <style type="text/css"><?php $this->html('pagecss' ) ?></style>
-<?php }
- if($this->data['usercss' ]) { ?>
- <style type="text/css"><?php $this->html('usercss' ) ?></style>
-<?php }
- if($this->data['userjs' ]) { ?>
- <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script>
-<?php }
- if($this->data['userjsprev']) { ?>
- <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script>
-<?php }
- if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
- <!-- Head Scripts -->
- <?php $this->html('headscripts') ?>
- </head>
-<body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
-<?php if($this->data['body_onload' ]) { ?>onload="<?php $this->text('body_onload') ?>"<?php } ?>
- class="<?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">
- <div id="globalWrapper">
- <div id="column-content">
- <div id="content">
- <a name="top" id="top"></a>
- <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
- <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
- <div id="bodyContent">
- <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
- <div id="contentSub"><?php $this->html('subtitle') ?></div>
- <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
- <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
- <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?>
- <!-- start content -->
- <?php $this->html('bodytext') ?>
- <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
- <!-- end content -->
- <div class="visualClear"></div>
- </div>
- </div>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
+ <?php
+ global $wgTitle, $wgUser, $wgUseGoogleAnalytics, $wgOut, $wgScriptPath, $wgArticle, $wgRequest, $wrProtocol;
+
+ $now = wfTimestampNow(); // WERELATE
+ $sk = $wgUser->getSkin();
+ $ns = $wgTitle->getNamespace();
+ $titleString = $wgTitle->getText();
+ $noTitlePage = false;
+ $overrideTitle = '';
+ $suppressAds = ($wgRequest->getVal('action') == 'edit' || !$this->data['notspecialpage'] || ($ns == NS_MAIN && $titleString == 'Main Page'));
+ if ($wgRequest->getVal('msg')) {
+ $this->data['msg'] = wfMsg($wgRequest->getVal('msg'));
+ }
+ $mainPage = ($ns == NS_MAIN && $titleString == 'Main Page');
+ if ($mainPage) {
+ $overrideTitle = '<span class="wr-maintitle">WeRelate.org</span>';
+ }
+ $menulinks = array(
+ 'home' => 'Main_Page',
+ 'search' => array(
+ 'all' => 'Special:Search',
+ 'articles' => 'Special:Search/Article',
+ 'people' => 'Special:Search/Person',
+ 'images' => 'Special:Search/Image',
+ 'sources' => 'Special:Search/Source',
+ 'places' => 'Special:Search/Place'
+ ),
+ 'list' => array(
+ 'people' => ($wgUser->isLoggedIn() ? 'Special:ListPages/' . urlencode($wgUser->getName()) : 'Special:Userlogin'),
+ 'contributions' => ($wgUser->isLoggedIn() ? 'Special:Contributions/' . urlencode($wgUser->getName()) : 'Special:Userlogin')
+ ),
+ 'add' => array(
+ 'article' => 'Special:AddPage/Article',
+ 'person' => 'Special:AddPage/Person',
+ 'family' => 'Special:AddPage/Family',
+ 'image' => 'Special:Upload',
+ 'mysource' => 'Special:AddPage/MySource',
+ 'source' => 'Special:AddPage/Source',
+ 'transcript' => 'Special:AddPage/Transcript',
+ 'repository' => 'Special:AddPage/Repository',
+ 'place' => 'Special:AddPage/Place',
+ 'userpage' => 'Special:AddPage/User',
+ 'otherpage' => 'Special:AddPage',
+ '-importgedcom' => 'Special:ImportGedcom'
+ ),
+ 'myrelate' => array(
+ 'dashboard' => 'Special:Dashboard',
+ 'network' => ($wgUser->isLoggedIn() ? 'Special:Network/' . urlencode($wgUser->getName()) : 'Special:Userlogin'),
+ 'watchlist' => ($wgUser->isLoggedIn() ? 'Special:Watchlist/' . urlencode($wgUser->getName()) : 'Special:Userlogin'),
+ 'userprofile' => ($wgUser->isLoggedIn() ? 'User:' . urlencode($wgUser->getName()) : 'Special:Userlogin'),
+ 'talkpage' => ($wgUser->isLoggedIn() ? 'User_talk:' . urlencode($wgUser->getName()) : 'Special:Userlogin'),
+ 'trees' => 'Special:Trees',
+ 'showduplicates' => ($wgUser->isLoggedIn() ? 'Special:ShowDuplicates/' . urlencode($wgUser->getName()) : 'Special:Userlogin'),
+ '-launchfte' => $wrProtocol.'://www.werelate.org/fte'
+ ),
+ 'admin' => array(
+ 'recentchanges' => 'Special:Recentchanges',
+ 'nominate' => 'WeRelate:Featured_page_nominations',
+ 'logs' => 'Special:Log',
+ 'newimages' => 'Special:Newimages',
+ 'reviewneeded' => 'Category:Review_needed',
+ 'gedcomreview' => 'Special:Gedcoms',
+ 'speedydelete' => 'Category:Speedy_Delete',
+ 'nameslog' => 'Special:NamesLog',
+ 'browseall' => 'Special:Browse',
+ 'comparepages' => 'Special:Compare',
+ 'specialpages' => 'Special:Specialpages'
+ ),
+ );
+ $helpLinks = array(
+ 'contents' => 'Help:Contents',
+ 'search' => 'Special:Search/Help',
+ 'faq' => 'Help:FAQ',
+ 'support' => 'WeRelate_talk:Support',
+ 'portals' => 'Portal:Community',
+ 'watercooler' => 'WeRelate_talk:Watercooler',
+ 'suggestions'=>'WeRelate:Suggestions'
+ );
+ $moreActions = array('protect', 'unprotect','delete', 'share','pedigree', 'match', 'compare-parents', 'compare-spouses', 'compare-husbands', 'compare-wives');
+ ?>
+<head>
+ <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
+ <?php $this->html('headlinks') ?>
+ <title><?php $this->text('pagetitle') ?></title>
+ <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/redmond/jquery-ui.css">
+ <style type="text/css" media="all">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.79.css"; /*]]>*/</style>
+ <link rel="stylesheet" type="text/css" <?php if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php $this->text('stylepath') ?>/common/commonPrint.7.css" />
+ <script type="<?php $this->text('jsmimetype') ?>" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+ <script type="<?php $this->text('jsmimetype') ?>" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
+ <script type="<?php $this->text('jsmimetype') ?>" src="<?php echo $wgScriptPath; ?>/jquery.json-2.3.min.1.js"></script>
+ <script type="<?php $this->text('jsmimetype') ?>" src="<?php echo $wgScriptPath; ?>/jquery.ezpz_hint.min.2.js"></script>
+ <script type="<?php $this->text('jsmimetype') ?>" src="<?php echo $wgScriptPath; ?>/jquery.plugins.4.js"></script>
+<?php
+// jquery.bgiframe.min.1.js separator.js
+// jquery.clickmenu.yui.3.js separator.js
+// jquery.cluetip.yui.1.js separator.js
+// jstorage.min.1.js separator.js
+?>
+ <script type="text/javascript">var addthis_config = {pubid: 'ra-4dac29732a79195f', services_exclude: 'print'};</script>
+ <script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js#acync=1"></script>
+ <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.yui.30.js"></script>
+<!-- Head Scripts -->
+<?php $this->html('headscripts') ?>
+ <?php if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?>
+</head>
+<body id="www-werelate-org" <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php }
+ if ($this->data['body_onload'] || $wgOut->getOnloadHandler()) { ?>onload="<?php if ($this->data['body_onload']) { $this->text('body_onload'); ?>;<?php }
+ if ($wgOut->getOnloadHandler()) { echo htmlspecialchars($wgOut->getOnloadHandler()); } ?>;"<?php } ?>>
+<div id="wr-header">
+ <div id="wr-logo">
+ <a href="<?php echo Title::makeTitle('', 'Main_Page')->getLocalURL()?>" title="<?php $this->msg('mainpage') ?>">
+ <img src="<?php $this->text('logopath') ?>"/>
+ </a>
+ <div class="wr-sidebar-separator"></div>
+ </div>
+ <div id="wr-navtitle">
+ <div id="wr-navigation">
+ <div class="portlet" id="wr-menu">
+ <h5><?php echo 'Menu'; ?></h5>
+ <div class="nav-body">
+ <ul id="wr-menulist">
+ <?php
+ foreach( $menulinks as $text => $target) {
+ echo $this->getMenuText($text, $target);
+ }
+ ?>
+ </ul>
+ </div>
+ </div>
+ <div class="portlet" id="wr-personal">
+ <h5><?php $this->msg('personaltools') ?></h5>
+ <div class="nav-body">
+ <ul id="wr-personallist">
+ <?php
+ foreach($this->data['personal_urls'] as $key => $item) {
+ if ($key == 'help') {
+ echo $this->getMenuText($key, $helpLinks);
+ }
+ else {
+ ?>
+ <li id="personal-<?php echo htmlspecialchars($key) ?>"<?php if ($item['active']) { ?> class="active"<?php } ?>>
+ <a href="<?php echo htmlspecialchars($item['href']) ?>"<?php if(!empty($item['class'])) { ?> class="<?php
+ echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php echo htmlspecialchars($item['text']) ?></a>
+ </li>
+ <?php
+ }
+ }
+ ?>
+ </ul>
+ </div>
+ </div>
+ </div>
+ <div id="wr-titlearea">
+ <div id="wr-searchbox">
+ <form method="get" action="<?php echo Title::makeTitle(NS_SPECIAL, 'Search')->getLocalURL() ?>">
+ <input type="hidden" name="go" value="true"/>
+ <input class="wr-searchbox-text" type="text" title="Search" name="k"/>
+ <button type="submit" title="Search WeRelate">&nbsp;</button>
+ </form>
+ </div>
+ <?php if(!$noTitlePage) {
+ $firstHeadingClass = ($ns == NS_PERSON || $ns == NS_FAMILY ? "firstHeadingPersonFamily" : "firstHeading");
+ ?>
+ <div id="wr-title">
+ <h1 class="<?php echo $firstHeadingClass; ?>"><?php if ($overrideTitle) { echo $overrideTitle; } else { $this->data['displaytitle']!=""?$this->text('title'):$this->html('title'); } ?></h1>
+ </div>
+ <?php } ?>
+ <div id="contentSub"><?php
+ $this->html('subtitle');
+ if ($wgRequest->getVal('target') && !$wgRequest->getVal('action') && $this->data['notspecialpage']) {
+ echo '<div style="color:red; margin:4px 8px">To select this page: click the <i>Back</i> button on your browser (if using Chrome, right-click and select <i>Back</i>), then click <i>Select</i></div>';
+ }
+ if ($wgTitle->getNamespace() == NS_USER && strpos($wgTitle->getText(), '/') === false) {
+ $userName = $wgTitle->getText();
+ $userTalk = Title::newFromText($userName, NS_USER_TALK);
+ echo '<div id="wr-leavemessage"><ul><li>'.$sk->makeKnownLinkObj($userTalk, "Leave a message for $userName", "action=edit&section=new").'</li></ul></div>';
+ }
+ else if (!$mainPage && !$wgTitle->isTalkPage() && $wgTitle->getTalkPage()->getArticleId() != 0) {
+ echo '<div id="wr-leavemessage"><ul><li>'.$sk->makeKnownLinkObj($wgTitle->getTalkPage(), "View the talk page").'</li></ul></div>';
+ }
+ ?></div>
+ <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
+ <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?>
+ <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
+ <?php if($this->data['msg'] ) { ?><div class="usermessage"><?php $this->html('msg') ?></div><?php } ?>
+ </div>
+ </div>
+</div><div id="wr-content"<?php if ($this->data['nav_urls']['print']) { echo ' class="wr-articleview"';} ?>>
+ <div id="bodyContent">
+ <table id="sdlayout">
+ <tr>
+ <td id="infobox">
+ <?php
+ if ($this->data['notspecialpage']) {
+ ?><div class="portlet" id="wr-actions">
+ <h5><?php $this->msg('views') ?></h5>
+ <div class="nav-body">
+ <ul id="wr-actionslist">
+ <?php
+ $moreActionsList = array();
+ foreach($this->data['content_actions'] as $key => $tab) {
+ if (in_array($key, $moreActions)) {
+ $moreActionsList[$key] = $tab;
+ }
+ else {
+ echo $this->getActionMenuText($key, $tab);
+ }
+ }
+ // $moreActionsList['recentchangeslinked'] = array('href' => $this->data['nav_urls']['recentchangeslinked']['href'], 'text' => wfMsg('recentchangeslinked'));
+ // $moreActionsList['whatlinkshere'] = array('href' => $this->data['nav_urls']['whatlinkshere']['href'], 'text' => wfMsg('whatlinkshere'));
+ foreach (array('whatlinkshere', 'emailuser', 'contributions', 'blockip', 'print') as $special) { // 'permalink'
+ if ($this->data['nav_urls'][$special]) {
+ if ($special == 'contributions' || $special == 'whatlinkshere') {
+ echo $this->getActionMenuText($special, array('href'=>$this->data['nav_urls'][$special]['href'], 'text' => wfMsg($special)));
+ }
+ else {
+ $moreActionsList[$special] = array('href' => $this->data['nav_urls'][$special]['href'], 'text' => wfMsg($special));
+ }
+ }
+ }
+ ?>
+ <li id="actions-more"><span class="wr-menu-more">more</span>▼<ul>
+ <?php foreach($moreActionsList as $key => $tab) {
+ echo $this->getActionMenuText($key, $tab);
+ } ?>
+ </ul></li>
+ </ul>
+ </div>
+ </div>
+ <div class="wr-sidebar-separator"></div>
+ <div class="portlet" id="wr-watchers">
+ <h5>Watchers</h5>
+ <div class="nav-body"><?php
+ $watchers = StructuredData::getWatchers($wgTitle, 0, 6);
+ if (count($watchers) == 0) {
+ $watchers[] = '<li>no watchers</li>';
+ }
+ $firstFive = array_slice($watchers, 0, 5);
+ echo '<ul>'.join('',$firstFive).'</ul>';
+ if (count($watchers) > 5) {
+ $watchersUrl = '/w/index.php?'.http_build_query(
+ array('action' => 'ajax', 'rs'=>'wfGetWatchers',
+ 'rsargs' => 'title='.$wgTitle->getPrefixedText().'|offset=5'));
+ echo "<ul class=\"wr-watchers-showall\"><li><a href=\"$watchersUrl\">[show all]</a></li></ul>";
+ }
+ ?></div>
+ </div>
+ <div class="portlet" id="wr-morelikethis">
+ <?php
+ $moreLikeThis = StructuredData::getMoreLikeThis($wgTitle);
+ if (count($moreLikeThis) > 0) {
+ echo '<h5>Browse</h5><div class="nav-body morelikethis"><ul>';
+ foreach ($moreLikeThis as $more) {
+ echo '<li>'.$more['link'];
+ if (count($more['places']) > 0) {
+ echo '<ul>';
+ foreach ($more['places'] as $place) {
+ echo '<li>in '.$place.'</li>';
+ }
+ echo '</ul>';
+ }
+ echo '</li>';
+ }
+ echo '</ul></div>';
+ }
+ ?>
+ </div>
+ <?php
+ if ($mainPage) {
+ ?><div id="awards"><?php
+ echo wfMsg('awards');
+ ?></div><?php
+ }
+ else if (false && $wgUser->getOption('wrnoads') < $now) { // don't show this ad
+ ?><div id="lhsadbox">
+<div style="text-align: right; border-bottom: 1px solid #aaa; padding-right: 3px"><a href="/wiki/WeRelate:Donate">Don't want ads?</a></div>
+<!-- remove or replace -->
+<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+<!-- lhs -->
+<ins class="adsbygoogle"
+ style="display:inline-block;width:160px;height:600px"
+ data-ad-client="ca-pub-5042243421154153"
+ data-ad-slot="4780960811"></ins>
+<script>
+(adsbygoogle = window.adsbygoogle || []).push({});
+</script>
+ </div><?php
+ }
+ }
+ else {
+ global $wrSidebarHtml;
+ echo $wrSidebarHtml;
+ } ?>
+ </td>
+ <td id="contentbox">
+ <!-- start content -->
+ <a name="top" id="top"></a>
+ <?php $this->html('bodytext') ?>
+ <a name="bottom" id="bottom"></a>
+ <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
+ <!-- end content -->
+ </td>
+ <?php if (!$suppressAds && $wgUser->getOption('wrnoads') < $now) { ?>
+ <td id="rhsadbox">
+ <div id="rhsads">
+<div style="text-align: right; padding-right: 3px"><a href="/wiki/WeRelate:Donate">Don't want ads?</a></div>
+<div style="margin-top: 16px">
+<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
+<!-- rhs600 -->
+<ins class="adsbygoogle"
+ style="display:inline-block;width:300px;height:600px"
+ data-ad-client="ca-pub-5042243421154153"
+ data-ad-slot="7402015214"></ins>
+<script>
+(adsbygoogle = window.adsbygoogle || []).push({});
+</script>
+</div>
+ </div>
+ </td>
+ <?php } ?>
+ </tr>
+ </table>
+ </div>
+</div>
+<div class="visualClear"></div>
+<div id="wr-footer">
+ <div id="wr-footer-bg"></div>
+ <div id="wr-poweredby">
+ <?php /* WERELATE - added */ if ($ns == NS_SOURCE) { ?>
+ <div id="f-opendirectoryico">
+ <table border="0" cellpadding="2"><tr><td align=center><font face="sans-serif, Arial, Helvetica" size="2">Portions from the<br>Open Directory Project</font></td>
+ <td><table border="0" cellpadding="3" cellspacing="0" style="background-color: #336600;">
+ <tr>
+ <td>
+ <table width="100%" cellpadding="2" cellspacing="0" border="0" style="background-color: #336600;">
+ <tr align="center">
+ <td><font face="sans-serif, Arial, Helvetica" size="2" color="#FFFFFF">Help build the largest human-edited directory on the web.</font></td>
+ </tr>
+ <tr bgcolor="#CCCCCC" align="center">
+ <td><font face="sans-serif, Arial, Helvetica" size="2">
+ <a href="http://dmoz.org/cgi-bin/add.cgi?where=Society/Genealogy" style="text-decoration: underline">Submit a Site</a> -
+ <a href="http://dmoz.org/about.html" style="text-decoration: underline"><b>Open Directory Project</b></a> -
+ <a href="http://dmoz.org/cgi-bin/apply.cgi?where=Society/Genealogy" style="text-decoration: underline">Become an Editor</a> </font>
+ </td></tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td></tr></table>
</div>
- <div id="column-one">
- <div id="p-cactions" class="portlet">
- <h5><?php $this->msg('views') ?></h5>
- <ul>
-<?php foreach($this->data['content_actions'] as $key => $tab) { ?>
- <li id="ca-<?php echo htmlspecialchars($key) ?>"<?php
- if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }
- ?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"><?php
- echo htmlspecialchars($tab['text']) ?></a></li>
-<?php } ?>
+ <?php } elseif($this->data['poweredbyico']) { ?><div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div><?php } ?>
+ </div>
+ <div id="wr-footer-content">
+ <ul id="f-list">
+ <?php
+ $footerlinks = array(
+ array('lastmod', 'viewcount', 'numberofwatchingusers', 'credits'),
+ array('copyright'),
+ array('privacy', 'about', 'disclaimer', 'tagline'),
+ );
+ foreach ($footerlinks as $links) {
+ echo '<ul>';
+ foreach( $links as $aLink ) {
+ if( $this->data[$aLink] ) { ?>
+ <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
+ <?php }
+ }
+ echo '</ul>';
+ } ?>
</ul>
- </div>
- <div class="portlet" id="p-personal">
- <h5><?php $this->msg('personaltools') ?></h5>
- <div class="pBody">
- <ul>
-<?php foreach($this->data['personal_urls'] as $key => $item) { ?>
- <li id="pt-<?php echo htmlspecialchars($key) ?>"<?php
- if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
- echo htmlspecialchars($item['href']) ?>"<?php
- if(!empty($item['class'])) { ?> class="<?php
- echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
- echo htmlspecialchars($item['text']) ?></a></li>
-<?php } ?>
- </ul>
- </div>
- </div>
- <div class="portlet" id="p-logo">
- <a style="background-image: url(<?php $this->text('logopath') ?>);" <?php
- ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php
- ?>title="<?php $this->msg('mainpage') ?>"></a>
- </div>
- <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
- <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
- <div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
- <h5><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) echo $bar; else echo $out; ?></h5>
- <div class='pBody'>
- <ul>
-<?php foreach($cont as $key => $val) { ?>
- <li id="<?php echo htmlspecialchars($val['id']) ?>"<?php
- if ( $val['active'] ) { ?> class="active" <?php }
- ?>><a href="<?php echo htmlspecialchars($val['href']) ?>"><?php echo htmlspecialchars($val['text']) ?></a></li>
-<?php } ?>
- </ul>
- </div>
- </div>
- <?php } ?>
- <div id="p-search" class="portlet">
- <h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
- <div id="searchBody" class="pBody">
- <form action="<?php $this->text('searchaction') ?>" id="searchform"><div>
- <input id="searchInput" name="search" type="text" <?php
- if($this->haveMsg('accesskey-search')) {
- ?>accesskey="<?php $this->msg('accesskey-search') ?>"<?php }
- if( isset( $this->data['search'] ) ) {
- ?> value="<?php $this->text('search') ?>"<?php } ?> />
- <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg('go') ?>" />&nbsp;
- <input type='submit' name="fulltext" class="searchButton" value="<?php $this->msg('search') ?>" />
- </div></form>
- </div>
- </div>
- <div class="portlet" id="p-tb">
- <h5><?php $this->msg('toolbox') ?></h5>
- <div class="pBody">
- <ul>
-<?php
- if($this->data['notspecialpage']) { ?>
- <li id="t-whatlinkshere"><a href="<?php
- echo htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
- ?>"><?php $this->msg('whatlinkshere') ?></a></li>
-<?php
- if( $this->data['nav_urls']['recentchangeslinked'] ) { ?>
- <li id="t-recentchangeslinked"><a href="<?php
- echo htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
- ?>"><?php $this->msg('recentchangeslinked') ?></a></li>
-<?php }
- }
- if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
- <li id="t-trackbacklink"><a href="<?php
- echo htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
- ?>"><?php $this->msg('trackbacklink') ?></a></li>
-<?php }
- if($this->data['feeds']) { ?>
- <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
- ?><span id="feed-<?php echo htmlspecialchars($key) ?>"><a href="<?php
- echo htmlspecialchars($feed['href']) ?>"><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;</span>
- <?php } ?></li><?php
- }
-
- foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) {
-
- if($this->data['nav_urls'][$special]) {
- ?><li id="t-<?php echo $special ?>"><a href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
- ?>"><?php $this->msg($special) ?></a></li>
-<?php }
- }
+ <?php $this->html('reporttime') ?>
+ </div>
+</div>
+<script type="<?php $this->text('jsmimetype') ?>">
+var pageRevid=<?php echo ($wgArticle != null ? $wgArticle->getRevIdFetched() : 0) ?>;
+var treeNames="<?php echo htmlspecialchars(implode('|', $this->data['trees'])); ?>";
+var userName="<?php echo ($wgUser->isLoggedIn() ? htmlspecialchars($wgUser->getName()) : ''); ?>";
+var userId="<?php echo ($wgUser->isLoggedIn() ? htmlspecialchars($wgUser->getID()) : ''); ?>";
+var skin='<?php $this->text('skinname')?>';
+var stylepath='<?php $this->text('stylepath')?>';</script>
+<!-- remove this or replace Tracking ID with your ID -->
+<script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- if(!empty($this->data['nav_urls']['print']['href'])) { ?>
- <li id="t-print"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['print']['href'])
- ?>"><?php $this->msg('printableversion') ?></a></li><?php
- }
+ ga('create', 'UA-61266128-1', 'auto');
+ ga('send', 'pageview');
- if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
- <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
- ?>"><?php $this->msg('permalink') ?></a></li><?php
- } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
- <li id="t-ispermalink"><?php $this->msg('permalink') ?></li><?php
- }
-
- wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) );
-?>
- </ul>
- </div>
- </div>
-<?php
- if( $this->data['language_urls'] ) { ?>
- <div id="p-lang" class="portlet">
- <h5><?php $this->msg('otherlanguages') ?></h5>
- <div class="pBody">
- <ul>
-<?php foreach($this->data['language_urls'] as $langlink) { ?>
- <li class="<?php echo htmlspecialchars($langlink['class'])?>"><?php
- ?><a href="<?php echo htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></li>
-<?php } ?>
- </ul>
- </div>
- </div>
-<?php } ?>
- </div><!-- end of the left (by default at least) column -->
- <div class="visualClear"></div>
- <div id="footer">
+</script>
<?php
- if($this->data['poweredbyico']) { ?>
- <div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
-<?php }
- if($this->data['copyrightico']) { ?>
- <div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
-<?php }
-
- // Generate additional footer links
+ if (false) { //!$this->loggedin) {
?>
- <ul id="f-list">
+<script id="_webengage_script_tag" type="text/javascript">
+var webengage; !function(w,e,b,n,g){function o(e,t){e[t[t.length-1]]=function(){r.__queue.push([t.join("."),arguments])}}var i,s,r=w[b],z=" ",l="init options track screen onReady".split(z),a="feedback survey notification".split(z),c="options render clear abort".split(z),p="Open Close Submit Complete View Click".split(z),u="identify login logout setAttribute".split(z);if(!r||!r.__v){for(w[b]=r={__queue:[],__v:"6.0",user:{}},i=0;i<l.length;i++)o(r,[l[i]]);for(i=0;i<a.length;i++){for(r[a[i]]={},s=0;s<c.length;s++)o(r[a[i]],[a[i],c[s]]);for(s=0;s<p.length;s++)o(r[a[i]],[a[i],"on"+p[s]])}for(i=0;i<u.length;i++)o(r.user,["user",u[i]]);setTimeout(function(){var f=e.createElement("script"),d=e.getElementById("_webengage_script_tag");f.type="text/javascript",f.async=!0,f.src=("https:"==e.location.protocol?"https://ssl.widgets.webengage.com":"http://cdn.widgets.webengage.com")+"/js/webengage-min-v-6.0.js",d.parentNode.insertBefore(f,d)})}}(window,document,"webengage");
+
+webengage.init("aa1323db");
+</script>
<?php
- $footerlinks = array(
- 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',
- 'privacy', 'about', 'disclaimer', 'tagline',
- );
- foreach( $footerlinks as $aLink ) {
- if( $this->data[$aLink] ) {
-?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
-<?php }
- }
+ }
?>
- </ul>
- </div>
- <script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script>
-</div>
-<?php $this->html('reporttime') ?>
-
</body></html>
<?php
wfRestoreWarnings();
diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css
index 7dcb570..f759c94 100644
--- a/skins/common/commonPrint.css
+++ b/skins/common/commonPrint.css
@@ -10,7 +10,7 @@
a.stub,
a.new{ color:#ba0000; text-decoration:none; }
-#toc {
+#toc {
/*border:1px solid #2f6fab;*/
border:1px solid #aaaaaa;
background-color:#f9f9f9;
@@ -27,22 +27,22 @@ a.new{ color:#ba0000; text-decoration:none; }
}
/* images */
-div.floatright {
- float: right;
+div.floatright {
+ float: right;
margin: 0;
position:relative;
border: 0.5em solid White;
border-width: 0.5em 0 0.8em 1.4em;
}
-div.floatright p { font-style: italic;}
-div.floatleft {
- float: left;
+div.floatright p { font-style: italic;}
+div.floatleft {
+ float: left;
margin: 0.3em 0.5em 0.5em 0;
position:relative;
border: 0.5em solid White;
border-width: 0.5em 1.4em 0.8em 0;
}
-div.floatleft p { font-style: italic; }
+div.floatleft p { font-style: italic; }
/* thumbnails */
div.thumb {
margin-bottom: 0.5em;
@@ -77,10 +77,10 @@ div.tleft {
/* table standards */
table.rimage {
- float:right;
- width:1pt;
+ float:right;
+ width:1pt;
position:relative;
- margin-left:1em;
+ margin-left:1em;
margin-bottom:1em;
text-align:center;
}
@@ -93,10 +93,20 @@ body {
padding: 0;
}
+/* WERELATE - added tagline and navigation */
+#wr-navigation,
+#infobox,
+.addthis_toolbox,
+#adbox,
+#wr-logo,
+#wr-searchbox,
+#contentSub,
+#contentSub2,
+#siteNotice,
+.userMessage,
+.firstHeadingPersonFamily,
.noprint,
-div#jump-to-nav,
div.top,
-div#column-one,
#colophon,
.editsection,
.toctoggle,
@@ -106,25 +116,65 @@ div#f-copyrightico,
li#f-viewcount,
li#f-about,
li#f-disclaimer,
-li#f-privacy {
+.wr-infobox-editlink,
+.addfamilylink,
+.addchildlink,
+#wr_familytreelink {
/* Hides all the elements irrelevant for printing */
display: none;
}
-ul {
+.firstHeading {
+ padding-bottom: 20px;
+}
+#wr-navtitle {
+ margin-left: 0;
+}
+#wr-titlearea {
+ height: auto;
+ border: none;
+}
+
+/* WERELATE - left-align family infoboxes */
+.wr-infobox-person, .wr-infobox-family {
+ width: auto;
+ float: left;
+}
+.wr-infobox-familybadges {
+ float: left;
+ clear: left;
+}
+.wr-infobox-familybadge {
+ width: auto;
+}
+.wr-infobox-familybadge .wr-infobox-yearrange {
+ display: inline;
+ padding-left: 16px;
+}
+.h2like {
+ clear: left;
+}
+.wr-openclose {
+ display: none;
+}
+
+/* WERELATE - print these things */
+#siteSub, .printfooter {
+ display: block;
+}
+
+ul {
list-style-type: square;
}
-#content {
+#wr-content {
background: none;
border: none ! important;
font-size: 11pt;
padding: 0 ! important;
margin: 0 ! important;
}
-#footer {
- background : white;
- color : black;
+#wr-footer {
border-top: 1px solid black;
}
@@ -135,22 +185,34 @@ h1, h2, h3, h4, h5, h6
p, .documentDescription {
margin: 1em 0 ! important;
- line-height: 1.2em;
+ line-height: 1.2em;
}
.tocindent p {
margin: 0 0 0 0 ! important;
}
+pre
+{
+ white-space: normal;
+ font: x-small sans-serif;
+ color: black;
+ padding: 0;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ text-indent: 1.5em;
+ margin: 1em 0;
+ line-height: 1.2em;
+ font-size: 100%;
+}
+/*
pre {
border: 1pt dashed black;
white-space: pre;
font-size: 8pt;
overflow: auto;
padding: 1em 0;
- background : white;
- color : black;
}
+*/
table.listing,
table.listing td {
@@ -160,7 +222,8 @@ table.listing td {
a {
color: Black !important;
- padding: 0 !important
+ padding: 0 !important;
+ background: none !important;
}
a:link, a:visited {
@@ -169,26 +232,17 @@ a:link, a:visited {
text-decoration: underline;
}
-#content a.external.text:after, #content a.external.autonumber:after {
+#wr-content a.external.text:after, #wr-content a.external.autonumber:after {
/* Expand URLs for printing */
content: " (" attr(href) ") ";
}
-#globalWrapper {
+#body {
width: 100% !important;
min-width: 0 !important;
}
-#content {
- background : white;
- color : black;
-}
-
-#column-content {
- margin: 0 !important;
-}
-
-#column-content #content {
+#wr-content {
padding: 1em;
margin: 0 !important;
}
@@ -221,7 +275,7 @@ div.townBox {
}
div.townBox dl {
padding: 0;
- margin: 0 0 0.3em 0;
+ margin: 0 0 0.3em 0;
font-size: 96%;
}
div.townBox dl dt {
@@ -242,7 +296,7 @@ table.gallery {
background-color:#ffffff;
}
-table.gallery tr {
+table.gallery tr {
vertical-align:top;
}
@@ -257,12 +311,12 @@ div.gallerybox div.thumb {
text-align: center;
border: 1px solid #cccccc;
margin: 2px;
-}
+}
div.gallerytext {
font-size: 94%;
padding: 2px 4px;
-}
+}
/*
** Diff rendering
diff --git a/skins/common/images/button_link.png b/skins/common/images/button_link.png
index e9507b9..cae101c 100644
Binary files a/skins/common/images/button_link.png and b/skins/common/images/button_link.png differ
diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js
index d95c4dc..b613b9d 100644
--- a/skins/common/wikibits.js
+++ b/skins/common/wikibits.js
@@ -3,13 +3,20 @@
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1)
&& (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1));
-var is_safari = ((clientPC.indexOf('applewebkit')!=-1) && (clientPC.indexOf('spoofer')==-1));
+var webkit_match = clientPC.match(/applewebkit\/(\d+)/);
+if (webkit_match) {
+ var is_safari = clientPC.indexOf('applewebkit') != -1 &&
+ clientPC.indexOf('spoofer') == -1;
+ var is_safari_win = is_safari && clientPC.indexOf('windows') != -1;
+ var webkit_version = parseInt(webkit_match[1]);
+}
var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ));
if (clientPC.indexOf('opera') != -1) {
var is_opera = true;
var is_opera_preseven = (window.opera && !document.childNodes);
var is_opera_seven = (window.opera && document.childNodes);
}
+var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
// add any onload functions in this hook (please don't hard-code any events in the xhtml source)
@@ -49,21 +56,10 @@ function hookEvent(hookName, hookFunct) {
attachEvent("on" + hookName, hookFunct);
}
-hookEvent("load", runOnloadHook);
+//WERELATE - call in document.ready below
+//hookEvent("load", runOnloadHook);
-// document.write special stylesheet links
-if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {
- if (is_opera_preseven) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera6Fixes.css">');
- } else if (is_opera_seven) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera7Fixes.css">');
- } else if (is_khtml) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/KHTMLFixes.css">');
- }
-}
-// Un-trap us from framesets
-if (window.top != window)
- window.top.location = window.location;
+// WERELATE - remove special stylesheet links and untrapping from framesets
// for enhanced RecentChanges
function toggleVisibility(_levelId, _otherId, _linkId) {
@@ -347,7 +343,7 @@ function mwInsertEditButton(parent, item) {
insertTags(item.tagOpen, item.tagClose, item.sampleText);
return false;
}
-
+
parent.appendChild(image);
return true;
}
@@ -358,12 +354,12 @@ function mwSetupToolbar() {
var textbox = document.getElementById('wpTextbox1');
if (!textbox) return false;
-
+
// Don't generate buttons for browsers which don't fully
// support it.
if (!document.selection && textbox.selectionStart == null)
return false;
-
+
for (var i in mwEditButtons) {
mwInsertEditButton(toolbar, mwEditButtons[i]);
}
@@ -457,48 +453,43 @@ function insertTags(tagOpen, tagClose, sampleText) {
txtarea.caretPos = document.selection.createRange().duplicate();
}
-function akeytt() {
- if (typeof ta == "undefined" || !ta)
- return;
- var pref = 'alt-';
- if (is_safari || navigator.userAgent.toLowerCase().indexOf('mac') + 1
- || navigator.userAgent.toLowerCase().indexOf('konqueror') + 1 )
- pref = 'control-';
- if (is_opera)
- pref = 'shift-esc-';
-
- for (var id in ta) {
- var n = document.getElementById(id);
- if (n) {
- var a = null;
- var ak = '';
- // Are we putting accesskey in it
- if (ta[id][0].length > 0) {
- // Is this object a object? If not assume it's the next child.
-
- if (n.nodeName.toLowerCase() == "a") {
- a = n;
- } else {
- a = n.childNodes[0];
- }
+var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
- if (a) {
- a.accessKey = ta[id][0];
- ak = ' ['+pref+ta[id][0]+']';
- }
- } else {
- // We don't care what type the object is when assigning tooltip
- a = n;
- ak = '';
- }
-
- if (a) {
- a.title = ta[id][1]+ak;
- }
+function updateTooltipAccessKeys( tooltipAccessKeyPrefix, nodeList ) {
+ for ( var i = 0; i < nodeList.length; i++ ) {
+ var element = nodeList[i];
+ var tip = element.getAttribute("title");
+ if ( tip && tooltipAccessKeyRegexp.exec(tip) ) {
+ tip = tip.replace(tooltipAccessKeyRegexp,
+ "["+tooltipAccessKeyPrefix+"$5]");
+ element.setAttribute("title", tip );
}
}
}
+function akeytt() {
+ var tooltipAccessKeyPrefix = 'alt-';
+ if (is_opera) {
+ tooltipAccessKeyPrefix = 'shift-esc-';
+ } else if (!is_safari_win && is_safari && webkit_version > 526) {
+ tooltipAccessKeyPrefix = 'ctrl-alt-';
+ } else if (!is_safari_win && (is_safari
+ || clientPC.indexOf('mac') != -1
+ || clientPC.indexOf('konqueror') != -1 )) {
+ tooltipAccessKeyPrefix = 'ctrl-';
+ } else if (is_ff2) {
+ tooltipAccessKeyPrefix = 'alt-shift-';
+ }
+
+ // skins without a "column-one" element don't seem to have links with accesskeys either
+ var columnOne = document.getElementById("column-one");
+ if ( columnOne )
+ updateTooltipAccessKeys( tooltipAccessKeyPrefix, columnOne.getElementsByTagName("a") );
+ // these are rare enough that no such optimization is needed
+ updateTooltipAccessKeys( tooltipAccessKeyPrefix, document.getElementsByTagName("input") );
+ updateTooltipAccessKeys( tooltipAccessKeyPrefix, document.getElementsByTagName("label") );
+}
+
function setupRightClickEdit() {
if (document.getElementsByTagName) {
var divs = document.getElementsByTagName('div');
@@ -665,7 +656,8 @@ function scrollEditBox() {
}
}
-hookEvent("load", scrollEditBox);
+//WERELATE - call in document.ready below
+//hookEvent("load", scrollEditBox);
function allmessagesfilter() {
text = document.getElementById('allmessagesinput').value;
@@ -737,12 +729,682 @@ function allmessagesmodified() {
}
function allmessagesshow() {
- k = document.getElementById('allmessagesfilter');
+ var k = document.getElementById('allmessagesfilter');
if (k) { k.style.display = ''; }
allmessages_prev = '';
allmessages_modified = false;
}
-hookEvent("load", allmessagesshow);
-hookEvent("load", mwSetupToolbar);
+function fixCompareAction(data, id) {
+ if (typeof(data) != 'undefined' && data.indexOf('|') >= 0) {
+ $('#actions-'+id+' a').attr('href', $('#actions-'+id+' a').attr('href')+data);
+ }
+ else {
+ $('#actions-'+id).remove();
+ }
+}
+function fixCompareActions() {
+ fixCompareAction(window['personParents'], 'compare-parents');
+ fixCompareAction(window['personSpouses'], 'compare-spouses');
+ fixCompareAction(window['familyHusbands'], 'compare-husbands');
+ fixCompareAction(window['familyWives'], 'compare-wives');
+}
+
+/*
+ * Table sorting script based on one (c) 1997-2006 Stuart Langridge and Joost
+ * de Valk:
+ * http://www.joostdevalk.nl/code/sortable-table/
+ * http://www.kryogenix.org/code/browser/sorttable/
+ *
+ * @todo don't break on colspans/rowspans (bug 8028)
+ * @todo language-specific digit grouping/decimals (bug 8063)
+ * @todo support all accepted date formats (bug 8226)
+ */
+
+window.ts_image_path = '/w/skins/common/images/';
+window.ts_image_up = 'sort_up.gif';
+window.ts_image_down = 'sort_down.gif';
+window.ts_image_none = 'sort_none.gif';
+window.ts_europeandate = false; // The non-American-inclined can change to "true"
+window.ts_alternate_row_colors = false;
+window.ts_number_transform_table = null;
+window.ts_number_regex = null;
+
+/*
+ Written by Jonathan Snook, http://www.snook.ca/jonathan
+ Add-ons by Robert Nyman, http://www.robertnyman.com
+ Author says "The credit comment is all it takes, no license. Go crazy with it!:-)"
+ From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
+*/
+window.getElementsByClassName = function( oElm, strTagName, oClassNames ) {
+ var arrReturnElements = new Array();
+ if ( typeof( oElm.getElementsByClassName ) == 'function' ) {
+ /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
+ var arrNativeReturn = oElm.getElementsByClassName( oClassNames );
+ if ( strTagName == '*' ) {
+ return arrNativeReturn;
+ }
+ for ( var h = 0; h < arrNativeReturn.length; h++ ) {
+ if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() ) {
+ arrReturnElements[arrReturnElements.length] = arrNativeReturn[h];
+ }
+ }
+ return arrReturnElements;
+ }
+ var arrElements = ( strTagName == '*' && oElm.all ) ? oElm.all : oElm.getElementsByTagName( strTagName );
+ var arrRegExpClassNames = new Array();
+ if( typeof oClassNames == 'object' ) {
+ for( var i = 0; i < oClassNames.length; i++ ) {
+ arrRegExpClassNames[arrRegExpClassNames.length] =
+ new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)");
+ }
+ } else {
+ arrRegExpClassNames[arrRegExpClassNames.length] =
+ new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)");
+ }
+ var oElement;
+ var bMatchesAll;
+ for( var j = 0; j < arrElements.length; j++ ) {
+ oElement = arrElements[j];
+ bMatchesAll = true;
+ for( var k = 0; k < arrRegExpClassNames.length; k++ ) {
+ if( !arrRegExpClassNames[k].test( oElement.className ) ) {
+ bMatchesAll = false;
+ break;
+ }
+ }
+ if( bMatchesAll ) {
+ arrReturnElements[arrReturnElements.length] = oElement;
+ }
+ }
+ return ( arrReturnElements );
+};
+
+window.sortables_init = function() {
+ var idnum = 0;
+ // Find all tables with class sortable and make them sortable
+ var tables = getElementsByClassName( document, 'table', 'sortable' );
+ for ( var ti = 0; ti < tables.length ; ti++ ) {
+ if ( !tables[ti].id ) {
+ tables[ti].setAttribute( 'id', 'sortable_table_id_' + idnum );
+ ++idnum;
+ }
+ ts_makeSortable( tables[ti] );
+ }
+};
+
+window.ts_makeSortable = function( table ) {
+ var firstRow;
+ if ( table.rows && table.rows.length > 0 ) {
+ if ( table.tHead && table.tHead.rows.length > 0 ) {
+ firstRow = table.tHead.rows[table.tHead.rows.length-1];
+ } else {
+ firstRow = table.rows[0];
+ }
+ }
+ if ( !firstRow ) {
+ return;
+ }
+
+ // We have a first row: assume it's the header, and make its contents clickable links
+ for ( var i = 0; i < firstRow.cells.length; i++ ) {
+ var cell = firstRow.cells[i];
+ if ( (' ' + cell.className + ' ').indexOf(' unsortable ') == -1 ) {
+ $(cell).append ( '<a href="#" class="sortheader" '
+ + 'onclick="ts_resortTable(this);return false;">'
+ + '<span class="sortarrow">'
+ + '<img src="'
+ + ts_image_path
+ + ts_image_none
+ + '" alt="&darr;"/></span></a>');
+ }
+ }
+ if ( ts_alternate_row_colors ) {
+ ts_alternate( table );
+ }
+};
+
+window.getInnerText = function( el ) {
+ if ( typeof el == 'string' ) {
+ return el;
+ }
+ if ( typeof el == 'undefined' ) {
+ return el;
+ }
+ // Custom sort value through 'data-sort-value' attribute
+ // (no need to prepend hidden text to change sort value)
+ if ( el.nodeType && el.getAttribute( 'data-sort-value' ) !== null ) {
+ // Make sure it's a valid DOM element (.nodeType) and that the attribute is set (!null)
+ return el.getAttribute( 'data-sort-value' );
+ }
+ if ( el.textContent ) {
+ return el.textContent; // not needed but it is faster
+ }
+ if ( el.innerText ) {
+ return el.innerText; // IE doesn't have textContent
+ }
+ var str = '';
+
+ var cs = el.childNodes;
+ var l = cs.length;
+ for ( var i = 0; i < l; i++ ) {
+ switch ( cs[i].nodeType ) {
+ case 1: // ELEMENT_NODE
+ str += ts_getInnerText( cs[i] );
+ break;
+ case 3: // TEXT_NODE
+ str += cs[i].nodeValue;
+ break;
+ }
+ }
+ return str;
+};
+
+window.ts_getInnerText = function( el ) {
+ return getInnerText( el );
+};
+
+window.ts_resortTable = function( lnk ) {
+ // get the span
+ var span = lnk.getElementsByTagName('span')[0];
+
+ var td = lnk.parentNode;
+ var tr = td.parentNode;
+ var column = td.cellIndex;
+
+ var table = tr.parentNode;
+ while ( table && !( table.tagName && table.tagName.toLowerCase() == 'table' ) ) {
+ table = table.parentNode;
+ }
+ if ( !table ) {
+ return;
+ }
+
+ if ( table.rows.length <= 1 ) {
+ return;
+ }
+
+ // Generate the number transform table if it's not done already
+ if ( ts_number_transform_table === null ) {
+ ts_initTransformTable();
+ }
+
+ // Work out a type for the column
+ // Skip the first row if that's where the headings are
+ var rowStart = ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 );
+ var bodyRows = 0;
+ if (rowStart == 0 && table.tBodies) {
+ for (var i=0; i < table.tBodies.length; i++ ) {
+ bodyRows += table.tBodies[i].rows.length;
+ }
+ if (bodyRows < table.rows.length)
+ rowStart = 1;
+ }
+
+ var itm = '';
+ for ( var i = rowStart; i < table.rows.length; i++ ) {
+ if ( table.rows[i].cells.length > column ) {
+ itm = ts_getInnerText(table.rows[i].cells[column]);
+ itm = itm.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, '');
+ if ( itm != '' ) {
+ break;
+ }
+ }
+ }
+
+ // TODO: bug 8226, localised date formats
+ var sortfn = ts_sort_generic;
+ var preprocessor = ts_toLowerCase;
+ if ( /^\d?\d[\/. -][a-zA-Z]{3,9}[\/. -]\d\d\d\d$/.test( itm ) ) {
+ preprocessor = ts_dateToSortKey;
+ }
+ else if ( /^[a-zA-Z]{3,9}[\/. -]\d\d\d\d$/.test( itm ) ) {
+ preprocessor = ts_dateToSortKey;
+ } else if ( /^\d\d\d\d$/.test( itm ) ) {
+ preprocessor = ts_dateToSortKey;
+ // (minus sign)([pound dollar euro yen currency]|cents)
+ } else if ( /(^([-\u2212] *)?[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/.test( itm ) ) {
+ preprocessor = ts_currencyToSortKey;
+ } else if ( ts_number_regex.test( itm ) ) {
+ preprocessor = ts_parseFloat;
+ }
+
+ var reverse = ( span.getAttribute( 'sortdir' ) == 'down' );
+
+ var newRows = new Array();
+ var staticRows = new Array();
+ for ( var j = rowStart; j < table.rows.length; j++ ) {
+ var row = table.rows[j];
+ if( (' ' + row.className + ' ').indexOf(' unsortable ') < 0 ) {
+ var keyText = ts_getInnerText( row.cells[column] );
+ if( keyText === undefined ) {
+ keyText = '';
+ }
+ var oldIndex = ( reverse ? -j : j );
+ var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, '') );
+
+ newRows[newRows.length] = new Array( row, preprocessed, oldIndex );
+ } else {
+ staticRows[staticRows.length] = new Array( row, false, j-rowStart );
+ }
+ }
+
+ newRows.sort( sortfn );
+
+ var arrowHTML;
+ if ( reverse ) {
+ arrowHTML = '<img src="' + ts_image_path + ts_image_down + '" alt="&darr;"/>';
+ newRows.reverse();
+ span.setAttribute( 'sortdir', 'up' );
+ } else {
+ arrowHTML = '<img src="' + ts_image_path + ts_image_up + '" alt="&uarr;"/>';
+ span.setAttribute( 'sortdir', 'down' );
+ }
+
+ for ( var i = 0; i < staticRows.length; i++ ) {
+ var row = staticRows[i];
+ newRows.splice( row[2], 0, row );
+ }
+
+ // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
+ // don't do sortbottom rows
+ for ( var i = 0; i < newRows.length; i++ ) {
+ if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') == -1 ) {
+ table.tBodies[0].appendChild( newRows[i][0] );
+ }
+ }
+ // do sortbottom rows only
+ for ( var i = 0; i < newRows.length; i++ ) {
+ if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') != -1 ) {
+ table.tBodies[0].appendChild( newRows[i][0] );
+ }
+ }
+
+ // Delete any other arrows there may be showing
+ var spans = getElementsByClassName( tr, 'span', 'sortarrow' );
+ for ( var i = 0; i < spans.length; i++ ) {
+ spans[i].innerHTML = '<img src="' + ts_image_path + ts_image_none + '" alt="&darr;"/>';
+ }
+ span.innerHTML = arrowHTML;
+
+ if ( ts_alternate_row_colors ) {
+ ts_alternate( table );
+ }
+};
+
+window.ts_initTransformTable = function() {
+ if ( typeof wgSeparatorTransformTable == 'undefined'
+ || ( wgSeparatorTransformTable[0] == '' && wgDigitTransformTable[2] == '' ) )
+ {
+ var digitClass = "[0-9,.]";
+ ts_number_transform_table = false;
+ } else {
+ ts_number_transform_table = {};
+ // Unpack the transform table
+ // Separators
+ var ascii = wgSeparatorTransformTable[0].split("\t");
+ var localised = wgSeparatorTransformTable[1].split("\t");
+ for ( var i = 0; i < ascii.length; i++ ) {
+ ts_number_transform_table[localised[i]] = ascii[i];
+ }
+ // Digits
+ ascii = wgDigitTransformTable[0].split("\t");
+ localised = wgDigitTransformTable[1].split("\t");
+ for ( var i = 0; i < ascii.length; i++ ) {
+ ts_number_transform_table[localised[i]] = ascii[i];
+ }
+
+ // Construct regex for number identification
+ var digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ',', '\\.'];
+ var maxDigitLength = 1;
+ for ( var digit in ts_number_transform_table ) {
+ // Escape regex metacharacters
+ digits.push(
+ digit.replace( /[\\\\$\*\+\?\.\(\)\|\{\}\[\]\-]/,
+ function( s ) { return '\\' + s; } )
+ );
+ if ( digit.length > maxDigitLength ) {
+ maxDigitLength = digit.length;
+ }
+ }
+ if ( maxDigitLength > 1 ) {
+ var digitClass = '[' + digits.join('') + ']';
+ } else {
+ var digitClass = '(' + digits.join('|') + ')';
+ }
+ }
+
+ // We allow a trailing percent sign, which we just strip. This works fine
+ // if percents and regular numbers aren't being mixed.
+ ts_number_regex = new RegExp(
+ "^(" +
+ "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific
+ "|" +
+ "[-+\u2212]?" + digitClass + "+%?" + // Generic localised
+ ")$", "i"
+ );
+};
+
+window.ts_toLowerCase = function( s ) {
+ return s.toLowerCase();
+};
+
+window.ts_dateToSortKey = function( date ) {
+ date = $.trim(date);
+ // if date starts with a letter, add 00 for day
+ if (date.length > 0 && date.substr(0,1).toLowerCase() >= 'a' && date.substr(0,1).toLowerCase() <= 'z') {
+ date = '00 '+date;
+ }
+ else if (date.length > 1 && date.substr(1,1) == ' ') {
+ date = '0'+date;
+ }
+ if ( date.length >= 11 ) {
+ switch ( date.substr( 3, 3 ).toLowerCase() ) {
+ case 'jan':
+ var month = '01';
+ break;
+ case 'feb':
+ var month = '02';
+ break;
+ case 'mar':
+ var month = '03';
+ break;
+ case 'apr':
+ var month = '04';
+ break;
+ case 'may':
+ var month = '05';
+ break;
+ case 'jun':
+ var month = '06';
+ break;
+ case 'jul':
+ var month = '07';
+ break;
+ case 'aug':
+ var month = '08';
+ break;
+ case 'sep':
+ var month = '09';
+ break;
+ case 'oct':
+ var month = '10';
+ break;
+ case 'nov':
+ var month = '11';
+ break;
+ case 'dec':
+ var month = '12';
+ break;
+ default:
+ var month = '00';
+ }
+ return date.substr( date.length - 4, 4 ) + month + date.substr( 0, 2 );
+ }
+ else if (date.length == 4 ) {
+ return date+'0000';
+ }
+ return '00000000';
+};
+
+window.ts_parseFloat = function( s ) {
+ if ( !s ) {
+ return 0;
+ }
+ if ( ts_number_transform_table != false ) {
+ var newNum = '', c;
+
+ for ( var p = 0; p < s.length; p++ ) {
+ c = s.charAt( p );
+ if ( c in ts_number_transform_table ) {
+ newNum += ts_number_transform_table[c];
+ } else {
+ newNum += c;
+ }
+ }
+ s = newNum;
+ }
+ var num = parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') );
+ return ( isNaN( num ) ? -Infinity : num );
+};
+
+window.ts_currencyToSortKey = function( s ) {
+ return ts_parseFloat(s.replace(/[^-\u22120-9.,]/g,''));
+};
+
+window.ts_sort_generic = function( a, b ) {
+ return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2];
+};
+
+window.ts_alternate = function( table ) {
+ // Take object table and get all it's tbodies.
+ var tableBodies = table.getElementsByTagName( 'tbody' );
+ // Loop through these tbodies
+ for ( var i = 0; i < tableBodies.length; i++ ) {
+ // Take the tbody, and get all it's rows
+ var tableRows = tableBodies[i].getElementsByTagName( 'tr' );
+ // Loop through these rows
+ // Start at 1 because we want to leave the heading row untouched
+ for ( var j = 0; j < tableRows.length; j++ ) {
+ // Check if j is even, and apply classes for both possible results
+ var oldClasses = tableRows[j].className.split(' ');
+ var newClassName = '';
+ for ( var k = 0; k < oldClasses.length; k++ ) {
+ if ( oldClasses[k] != '' && oldClasses[k] != 'even' && oldClasses[k] != 'odd' ) {
+ newClassName += oldClasses[k] + ' ';
+ }
+ }
+ tableRows[j].className = newClassName + ( j % 2 == 0 ? 'even' : 'odd' );
+ }
+ }
+};
+
+/*
+ * End of table sorting code
+ */
+
+function preventDefaultAction(e) {
+ if (e.preventDefault) {
+ e.preventDefault();
+ } else {
+ e.returnValue = false;
+ }
+ return false;
+}
+
+//WERELATE - call in document.ready below
+//hookEvent("load", allmessagesshow);
+//hookEvent("load", mwSetupToolbar);
+
+function getAcStorageKey(nsText) {
+ return 'ac:'+nsText+':';
+}
+
+function escapeHtml(unsafe) {
+ return unsafe
+ .replace(/&/g, "&amp;")
+ .replace(/</g, "&lt;")
+ .replace(/>/g, "&gt;")
+ .replace(/"/g, "&quot;")
+ .replace(/'/g, "&#039;");
+}
+
+$.fn.defaultTreeCheck = function(treeName) {
+ this.each(function() {
+ if (treeName.length == 0 || this.name == treeName) {
+ $(this).attr("checked", "checked");
+ $('#wpWatchthis').attr("checked", "checked");
+ }
+ });
+ return this;
+}
+
+function showWatchers() {
+ function slideDownFadeIn(j, f) {
+ j.css('visibility', 'hidden');
+ j.slideDown('fast', function() {
+ j.fadeOut(0);
+ j.css('visibility', 'visible');
+ j.fadeIn('fast', f);
+ });
+ }
+
+ function fadeOutSlideUp(j, f) {
+ j.fadeOut('fast', function() {
+ j.css('display', 'block');
+ j.css('visibility', 'hidden');
+ j.slideUp('fast', f);
+ });
+ }
+
+ var loaded = false;
+ $('#wr-watchers .wr-watchers-showall a').click(function () {
+ var jthis = $(this);
+ var showall = jthis.closest('ul');
+ if (!loaded) {
+ jthis.html('[loading]');
+ $('<ul/>').insertBefore(showall).load(jthis.attr('href'), function() {
+ loaded = true;
+ jthis.html('[show fewer]');
+ });
+ }
+ else {
+ var all = showall.prev();
+ if (all.is(':visible')) {
+ fadeOutSlideUp(all, function() {
+ jthis.html('[show all]');
+ });
+ }
+ else {
+ slideDownFadeIn(all, function() {
+ jthis.html('[show fewer]');
+ });
+ }
+ }
+ return false;
+ });
+}
+
+function addOpenClose() {
+ $('.wr-articleview h2,.wr-articleview div.h2like').each(function() {
+ if ($(this).parents('#toc').size() == 0) {
+ var x = $('<span class="wr-openclose">▼</span>').click(function() {
+ var jthis = $(this);
+ if (jthis.data('closed')) {
+ jthis.parent().nextUntil('h2,div.h2like,.printfooter,.wr-openclose-end').slideDown('fast');
+ jthis.data('closed', false).html('▼');
+ }
+ else {
+ jthis.parent().nextUntil('h2,div.h2like,.printfooter,.wr-openclose-end').slideUp('fast');
+ jthis.data('closed', true).html('►');
+ }
+ });
+ $(this).prepend(x);
+ }
+ });
+}
+
+function familytreelink_init() {
+ $('#wr_familytreelink').click(function() {
+ var iframe = $('#wr_familytree_iframe');
+ // if iframe exists
+ if (iframe.length) {
+// if (iframe.is(':hidden')) {
+// iframe.slideDown(700);
+// }
+// else {
+ iframe.slideUp(300, function() {
+ iframe.remove();
+ });
+// }
+ }
+ else {
+ var titleRE = /\/wiki\/([^?#]+)/;
+ var title = titleRE.exec(window.location.href);
+ if (!title || title.length < 2) {
+ titleRE = /[?&]title=([^&#]+)/;
+ title = titleRE.exec(window.location.href);
+ }
+ if (title && title.length == 2) {
+ $('#wr_familytreelink').after(
+ '<iframe style="display:none" id="wr_familytree_iframe" width="100%" height="100%" frameBorder="0" src="/w/familytree.html?id='+
+ title[1]+'"/>');
+// '<div id="wr_familytree_iframe"><iframe width="100%" height="100%" src="/w/familytree.html?id='+
+// title+'"/></div>');
+ $('#wr_familytree_iframe').slideDown(700);
+ }
+ }
+ });
+}
+
+$(document).ready(function() {
+ runOnloadHook();
+ scrollEditBox();
+ allmessagesshow();
+ mwSetupToolbar();
+ fixCompareActions();
+ addOpenClose();
+ $('#wr-menulist').clickMenu();
+ $('#wr-menulist').show();
+ $('#wr-personallist').clickMenu();
+ $('#wr-personallist').show();
+ $('#wr-actionslist').clickMenu();
+ $('#wr-actionslist').show();
+ $('#wr-searchbox input').ezpz_hint({hintName:'a'});
+// $('#wr-searchbox').inputHintOverlay();
+ familytreelink_init();
+ var treeName = '';
+ var p = parent;
+ if (window.opener) {
+ p = window.opener.parent;
+ }
+ try {
+ if (p && p.fte) {
+ var swf=(navigator.appName.indexOf("Microsoft")!=-1) ? p.fte.window["FTE"] : p.fte.document["FTE"];
+ if (swf) {
+ if (swf.contentLoaded) {
+ swf.contentLoaded(document.title, document.URL, pageRevid); //, treeNames);
+ }
+ if (swf.contentLoaded2) {
+ swf.contentLoaded2(document.title, document.URL, pageRevid, treeNames, userName);
+ }
+ if (swf.getTreeName) {
+ treeName = swf.getTreeName();
+ }
+ }
+ }
+ }
+ catch (e) {
+ }
+ if (treeName.length > 0) {
+ var re = new RegExp("[^a-zA-Z0-9]","g");
+ treeName = 'tree_'+treeName.replace(re,"_");
+ $('.treeCheckbox').defaultTreeCheck(treeName);
+ }
+ else {
+ $('.defaultTreeCheckbox').defaultTreeCheck('');
+ }
+ $('.treeCheck').click(function() {
+ if ($(this).is(':checked')) {
+ $('#wpWatchthis').attr("checked", "checked");
+ }
+ });
+ $('.popup').click(function() {
+ window.open($(this).attr('href'),'','height=600,width=800,scrollbars=yes,resizable=yes,toolbar=yes,menubar=no,location=no,directories=no');
+ return false;
+ });
+ $('.wr-imagehover').each(function() {
+ var jthis=$(this);
+ var attrs = jthis.attr('title').split('|');
+ jthis.attr('title','');
+ $('a', jthis).attr('rel',attrs[0]).attr('title',attrs.length >= 3 ? attrs[2] : '')
+ .cluetip({dropShadow:false,cluetipClass:'image',width:attrs[1],showTitle:false,clickThrough:true});
+ });
+ $('.jTip').cluetip({local:true,dropShadow:false,cluetipClass:'jtip',activation:'click',sticky:true,closePosition:'title'});
+ showWatchers();
+ sortables_init();
+ if (addthis) {
+ addthis.init();
+ }
+});
diff --git a/skins/monobook/IE55Fixes.css b/skins/monobook/IE55Fixes.css
index 637daae..de8904e 100644
--- a/skins/monobook/IE55Fixes.css
+++ b/skins/monobook/IE55Fixes.css
@@ -31,6 +31,7 @@
body { font-size: xx-small; }
+/* WERELATE
#p-cactions {
width: 76% !important;
z-index: 3 !important;
@@ -57,6 +58,8 @@ body { font-size: xx-small; }
#p-cactions li a:hover {
padding-bottom: 0.17em;
}
+*/
+
#p-navigation a {
display: inline-block;
width: 100%;
diff --git a/skins/monobook/IE60Fixes.css b/skins/monobook/IE60Fixes.css
index 6b646c7..1c1638e 100644
--- a/skins/monobook/IE60Fixes.css
+++ b/skins/monobook/IE60Fixes.css
@@ -1,14 +1,14 @@
/* 6.0 - only fixes */
-/* content area */
+/* content area */
/* workaround for various ie float bugs */
-#column-content {
- float: none;
+#column-content {
+ float: none;
margin-left: 0;
height: 1%;
}
#column-content #content {
- margin-left: 12.2em;
- margin-top: 3em;
+ margin-left: 16em;
+ margin-top: 12em;
height: 1%;
}
#column-one {
@@ -24,6 +24,7 @@
/* the tabs */
+/* WERELATE
#p-cactions {
z-index: 3;
}
@@ -49,6 +50,8 @@
#p-cactions li a:hover {
padding-bottom: 0.17em;
}
+*/
+
#p-navigation a {
display: inline-block;
width: 100%;
diff --git a/skins/monobook/IE70Fixes.css b/skins/monobook/IE70Fixes.css
index 2a2c9c7..8be42c4 100644
--- a/skins/monobook/IE70Fixes.css
+++ b/skins/monobook/IE70Fixes.css
@@ -3,9 +3,10 @@
/* workaround for various ie float bugs */
/* This bit is needed to make links clickable... WTF */
+/* WERELATE - change margin-left: 12.2em to 200px; margin-top: 3em to 150px
#column-content #content {
- margin-left: 12.2em;
- margin-top: 3em;
+ margin-left: 200px;
+ margin-top: 150px;
height: 1%;
}
@@ -21,6 +22,7 @@
/* the tabs */
+/* WERELATE
#p-cactions {
z-index: 3;
}
@@ -48,6 +50,8 @@
#p-cactions li a:hover {
padding-bottom: 0.17em;
}
+*/
+
#p-navigation a {
display: inline-block;
width: 100%;
diff --git a/skins/monobook/main.css b/skins/monobook/main.css
index 6373d18..38c61b4 100644
--- a/skins/monobook/main.css
+++ b/skins/monobook/main.css
@@ -1,1448 +1,4539 @@
/*
-** MediaWiki 'monobook' style sheet for CSS2-capable browsers.
-** Copyright Gabriel Wicke - http://wikidev.net/
+** New CSS file
+** Portions Copyright Gabriel Wicke - http://wikidev.net/
+** Portions Copyright Dallan Quass
** License: GPL (http://www.gnu.org/copyleft/gpl.html)
-**
-** Loosely based on http://www.positioniseverything.net/ordered-floats.html by Big John
-** and the Plone 2.0 styles, see http://plone.org/ (Alexander Limi,Joe Geldart & Tom Croucher,
-** Michael Zeltner and Geir Bækholt)
-** All you guys rock :)
*/
-#column-content {
- width: 100%;
- float: right;
- margin: 0 0 .6em -12.2em;
- padding: 0;
-}
-#content {
- margin: 2.8em 0 0 12.2em;
- padding: 0 1em 1.5em 1em;
- background: white;
- color: black;
- border: 1px solid #aaa;
- border-right: none;
- line-height: 1.5em;
- position: relative;
- z-index: 2;
-}
-#column-one {
- padding-top: 160px;
-}
-/* the left column width is specified in class .portlet */
-
-/* Font size:
-** We take advantage of keyword scaling- browsers won't go below 9px
-** More at http://www.w3.org/2003/07/30-font-size
-** http://style.cleverchimp.com/font_size_intervals/altintervals.html
-*/
+/********** BODY **********/
-body {
+body
+{
font: x-small sans-serif;
- background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat;
- color: black;
- margin: 0;
+ color: #333;
padding: 0;
+ margin: 0;
+/* font-family: "lucida grande",tahoma,verdana,arial,sans-serif; */
+ font-family: arial,sans-serif;
+ background-color: #fff;
}
-/* scale back up to a sane default */
-#globalWrapper {
+/********** CONTENT **********/
+
+#wr-content
+{
font-size: 127%;
width: 100%;
- margin: 0;
+ margin: 0;
padding: 0;
+ background-color: #fff;
+ line-height: 1.5em;
+ clear: both;
}
-.visualClear {
- clear: both;
+
+#bodyContent
+{
+ background-color: #fff;
+ color: #333;
+ margin: 0;
+ padding: 0;
}
-/* general styles */
+#wr-titlearea
+{
+ clear: both;
+ height: 74px;
+ padding-left: 12px;
+ border-left: 1px solid #ccc;
+}
-table {
- background: white;
- font-size: 100%;
- color: black;
+#wr-title
+{
+ padding: 8px 4px 2px 0;
}
-a {
- text-decoration: none;
- color: #002bb8;
- background: none;
+
+#wr-searchbox
+{
+ float: right;
+ margin: 8px;
+ width: 156px;
+ line-height: 1;
+ border: 1px solid #AAA;
+}
+#wr-searchbox .wr-searchbox-text {
+ font-size: 13px;
+ height: 18px;
+ line-height: 18px;
+ margin: 0;
+ padding: 2px 0 2px 2px;
+ width: 126px;
+ border: medium none;
+}
+#wr-searchbox div {
+ float: left;
+}
+#wr-searchbox button {
+ background-color: transparent;
+ background-image: url(../common/images/search-ltr.png);
+ background-position: 50% 60%;
+ background-repeat: no-repeat;
+ border: medium none;
+ cursor: pointer;
+ margin: 0;
+ padding: 0;
+ width: 24px;
+ height: 22px;
+}
+#wr-searchbox .ezpz-hint {
+ color: #999;
+ font-size: 13px;
+}
+.inputHintOverlay {
+ color: #999;
+ font-size: 13px;
+ padding-top: 5px;
+ padding-left: 3px;
+ z-index: 0 !important;
}
-a:visited {
- color: #5a3696;
+
+#siteSub
+{
+ display: none;
}
-a:active {
- color: #faa700;
+
+#contentSub, #contentSub2
+{
+ font-size: 11px;
}
-a:hover {
- text-decoration: underline;
+
+span.subpages
+{
+ display: block;
}
-a.stub {
- color: #772233;
+.wr-maintitle {
+ font-size: 22px;
}
-a.new, #p-personal a.new {
- color: #ba0000;
+.firstHeadingPersonFamily {
+ font-size: 15px;
+ padding: 0;
}
-a.new:visited, #p-personal a.new:visited {
- color: #a55858;
+.firstHeading
+{
+ font-size: 18px;
+ padding: 0;
+/* margin-bottom: .1em; */
}
-img {
- border: none;
+.usermessage
+{
+ background-color: #ffce7b;
+ border: 1px solid #ffa500;
+ color: #333;
+ font-weight: bold;
+ margin: 2px 8px 2px 0;
+ padding: 4px 8px;
vertical-align: middle;
+ font-size: 11px;
}
-p {
- margin: .4em 0 .5em 0;
- line-height: 1.5em;
+
+#siteNotice
+{
+ text-align: center;
+ font-size: 95%;
+ padding: 0 .9em;
}
-p img {
+
+#siteNotice p
+{
margin: 0;
+ padding: 0;
}
-hr {
- height: 1px;
- color: #aaa;
- background-color: #aaa;
- border: 0;
- margin: .2em 0 .2em 0;
+.error
+{
+ color: red;
+ font-size: larger;
}
-h1, h2, h3, h4, h5, h6 {
- color: black;
+#catlinks
+{
+ border: 1px solid #efc4a1;
+ background-color: #f7f9ff;
+ font-size: 110%;
+ padding: 5px;
+ margin-top: 1em;
+ clear: both;
+}
+
+/* sdlayout is internal use */
+.fullwidth
+{
+ width: 100%;
+}
+#sdlayout {
+ border-collapse: collapse;
+ border-spacing: 0;
+ width: 100%;
+}
+#infobox
+{
+ margin: 0;
+ padding: 0;
+ width: 160px;
+ min-width: 160px;
+ max-width: 160px;
+ background-color: #fff;
+ text-align: left;
+ vertical-align: top;
+ border-right: 1px solid #ccc;
+}
+#infobox .portlet {
+ padding-left: 12px;
+}
+
+.infobox-header, .infobox-subheader, #watchers th
+{
+ color: #093e8c;
background: none;
+ font-size: 127%;
font-weight: normal;
- margin: 0;
- padding-top: .5em;
- padding-bottom: .17em;
- border-bottom: 1px solid #aaa;
-}
-h1 { font-size: 188%; }
-h2 { font-size: 150%; }
-h3, h4, h5, h6 {
- border-bottom: none;
- font-weight: bold;
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ padding-bottom: 2px;
+ border-bottom: 2px #c0c0c0 solid;
}
-h3 { font-size: 132%; }
-h4 { font-size: 116%; }
-h5 { font-size: 100%; }
-h6 { font-size: 80%; }
-ul {
- line-height: 1.5em;
- list-style-type: square;
- margin: .3em 0 0 1.5em;
- padding: 0;
- list-style-image: url(bullet.gif);
+.infobox-header, #watchers th
+{
+ margin: 0 .7em 0 .7em;
}
-ol {
- line-height: 1.5em;
- margin: .3em 0 0 3.2em;
- padding: 0;
- list-style-image: none;
+
+.infobox-subheader
+{
+ margin: 0 0 .4em 0;
}
-li {
- margin-bottom: .1em;
+
+#infobox table
+{
+ padding: .4em .9em;
}
-dt {
- font-weight: bold;
- margin-bottom: .1em;
+
+#contentbox
+{
+ vertical-align: top;
+ padding: 0 8px 0 12px;
+ margin: 0;
}
-dl {
- margin-top: .2em;
- margin-bottom: .5em;
+
+.addthis_toolbox
+{
+ float: right;
+ margin: 4px;
+}
+.addthis_button_preferred_1,
+.addthis_button_preferred_2,
+.addthis_button_preferred_3,
+.addthis_button_preferred_4,
+.addthis_button_google_plusone,
+.addthis_button_compact
+{
+ float: left;
+ margin: 0 1px;
}
-dd {
- line-height: 1.5em;
- margin-left: 2em;
- margin-bottom: .1em;
+
+/*
+#gsfn_search_widget
+{
+ border: 4px solid #DDDDDD;
+ padding: 8px 12px;
+ max-width: 670px;
+}
+#gsfn_search_widget .powered_by
+{
+ font-size: 9px;
+ text-align: right;
+ margin-top: 8px;
+}
+#gsfn_search_widget .widget_title
+{
+ float: left;
+ margin-top: 8px;
+}
+#gsfn_search_form
+{
+ margin-top: 4px;
+}
+#gsfn_search_query
+{
+ width: 240px;
+ margin-left: 2px;
}
+*/
-fieldset {
- border: 1px solid #2f6fab;
- margin: 1em 0 1em 0;
- padding: 0 1em 1em;
- line-height: 1.5em;
+#rhsadbox {
+ width: 316px;
+ vertical-align: top;
+ margin: 0;
+ padding: 0;
+}
+#rhsads {
+ width: 300px;
+ margin: 54px 8px 0 8px;
+}
+#lhsadbox {
+ width: 160px;
+ margin: 12px 0 0 0;
+ padding: 0;
+}
+#topadbox {
+ width: 728px;
+ height: 90px;
+ margin: 8px 0;
+ padding: 0;
+}
+/********** NAVIGATION **********/
+
+#wr-navigation
+{
+ font-size: 13px;
+ height: 19px;
+ line-height: 19px;
+ padding:8px 0;
+ border-bottom: 1px solid #ccc;
}
-legend {
- background: white;
- padding: .5em;
- font-size: 95%;
+
+#wr-menu
+{
+ padding: 0;
+ float: left;
}
-form {
- border: none;
+
+#wr-menu .nav-body
+{
margin: 0;
+ padding: 0;
}
-textarea {
- width: 100%;
- padding: .1em;
+#wr-actions
+{
}
-input.historysubmit {
- padding: 0 .3em .3em .3em !important;
- font-size: 94%;
- cursor: pointer;
- height: 1.7em !important;
- margin-left: 1.6em;
+#wr-actions .nav-body
+{
}
-select {
- vertical-align: top;
+
+#wr-menu h5, #wr-actions h5
+{
+ display: none;
}
-abbr, acronym, .explain {
- border-bottom: 1px dotted black;
- color: black;
- background: none;
- cursor: help;
+
+#wr-toolbox
+{
+ margin-top: 8px;
+ margin-left: 8px;
+ width: 98%;
+ padding-bottom: 5px;
}
-q {
- font-family: Times, "Times New Roman", serif;
- font-style: italic;
+
+#wr-toolbox, #wr-languages
+{
+ font-size: 110%;
}
-/* disabled for now
-blockquote {
- font-family: Times, "Times New Roman", serif;
- font-style: italic;
-}*/
-code {
- background-color: #f9f9f9;
+
+#wr-toolbox h5, #wr-languages h5
+{
+ display: none;
}
-pre {
- padding: 1em;
- border: 1px dashed #2f6fab;
- color: black;
- background-color: #f9f9f9;
- line-height: 1.1em;
+
+#wr-toolbox ul, #wr-languages ul
+{
+ text-align: center;
+ list-style: none none;
}
-/*
-** the main content area
-*/
+#wr-leavemessage ul {
+ margin: 0 0 0 8px;
+ padding: 0;
+}
-#siteSub {
- display: none;
+#wr-leavemessage a, #wr-searchbrowse a
+{
+ font-size: 100%;
+ background: url(../common/images/bullet-toolbox-arrow.gif) no-repeat 0% 50%;
}
-#jump-to-nav {
- display: none;
+#wr-toolbox li, #wr-languages li, #wr-leavemessage li, #wr-searchbrowse li
+{
+ display: inline;
+ margin: 0;
+ padding: 0;
}
-#contentSub, #contentSub2 {
- font-size: 84%;
- line-height: 1.2em;
- margin: 0 0 1.4em 1em;
- color: #7d7d7d;
- width: auto;
+#wr-toolbox a, #wr-languages a, #wr-leavemessage a, #wr-searchbrowse a
+{
+ padding: 0 1em;
+ color: #00408f;
}
-span.subpages {
- display: block;
+
+#wr-toolbox .first a, #wr-languages .first a
+{
+ background: none;
}
-/* Some space under the headers in the content area */
-#bodyContent h1, #bodyContent h2 {
- margin-bottom: .6em;
+#feed-rss
+{
+ background: url(../common/images/feed-icon-16.png) no-repeat 100% 50%;
}
-#bodyContent h3, #bodyContent h4, #bodyContent h5 {
- margin-bottom: .3em;
+
+#toolbox-ispermalink
+{
+ color: #999;
}
-.firstHeading {
- margin-bottom: .1em;
+
+#wr-personal {
+ float: right;
+ margin-right: 4px;
+}
+#wr-personal h5
+{
+ display: none;
}
-/* user notification thing */
-.usermessage {
- background-color: #ffce7b;
- border: 1px solid #ffa500;
- color: black;
- font-weight: bold;
- margin: 2em 0 1em;
- padding: .5em 1em;
- vertical-align: middle;
+#searchbox
+{
+ padding: 0;
+ margin: 0;
}
-#siteNotice {
- text-align: center;
- font-size: 95%;
- padding: 0 .9em;
+
+#searchbox form
+{
+ display: inline;
+ padding: 0;
+ margin: 0 8px 0 0;
+ font-size:80%;
}
-#siteNotice p {
+
+#searchbox input
+{
margin: 0;
padding: 0;
+ border: 0;
}
-.error {
- color: red;
- font-size: larger;
+
+#wr-extra {
+ width: 100%;
}
-.errorbox, .successbox {
- font-size: larger;
- border: 2px solid;
- padding: .5em 1em;
- float: left;
- margin-bottom: 2em;
- color: #000;
+#wr-extra ul {
+ list-style: none none;
+ margin: 0;
+ padding: 0 0 6px;
}
-.errorbox {
- border-color: red;
- background-color: #fff2f2;
+#wr-extra li {
+ width: 104px;
+ background: #ffeee0;
+ border: 1px solid #efc4a1;
+ padding: 0 3px;
+ text-align: center;
+ margin: 0 0 3px 0;
}
-.successbox {
- border-color: green;
- background-color: #dfd;
+#wr-extra a {
+ color: #333;
}
-.errorbox h2, .successbox h2 {
- font-size: 1em;
- font-weight: bold;
- display: inline;
- margin: 0 .5em 0 0;
- border: none;
+
+.wr-sidebar-separator
+{
+ width: 136px;
+ margin: 16px 0 0 12px;
+ border-top: 1px solid #eee;
+ font-size: 1px;
+ height: 1px;
}
-#catlinks {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
- padding: 5px;
- margin-top: 1em;
- clear: both;
+/* wr-watchers */
+
+#wr-watchers {
+ width: 116px;
+ max-width: 116px;
+ overflow: hidden;
+}
+#wr-watchers ul {
+ list-style: none none;
+ padding: 0;
+ margin: 0;
+ line-height: 1;
+}
+#wr-watchers li {
+ font-size: 11px;
+ line-height: 1.3;
+ color: #333;
+ padding-left: 8px;
+ margin-bottom: 0;
+}
+#wr-watchers h5 {
+ margin-bottom: 0 !important;
+ color: #333;
+ font-weight: normal;
+}
+#wr-watchers .wr-watchers-showall {
+ margin-top: 4px;
}
-/* currently unused, intended to be used by a metadata box
-in the bottom-right corner of the content area */
-.documentDescription {
- /* The summary text describing the document */
- font-weight: bold;
- display: block;
- margin: 1em 0;
- line-height: 1.5em;
+
+#awards {
+ margin-top: 100px;
+ padding-left: 12px;
}
-.documentByLine {
- text-align: right;
- font-size: 90%;
- clear: both;
- font-weight: normal;
- color: #76797c;
+/********** HEADER **********/
+
+#wr-logo
+{
+ width: 128px;
+ padding: 0;
+ background-color: #fff;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+#wr-logo a {
+ padding-left: 22px;
}
+#wr-navtitle
+{
+ margin-left: 160px;
+}
+/********** FOOTER **********/
-/* emulate center */
-.center {
- width: 100%;
+#wr-footer
+{
+ display: block;
+ background-color: white;
+ margin: 1em 0 1em 0;
+ padding: 8px 0 0;
text-align: center;
+ font-size: 97%;
+ border-top: 1px solid #ccc;
}
-*.center * {
- margin-left: auto;
- margin-right: auto;
+
+#wr-footer li
+{
+ display: inline;
+ margin: 0 1.3em;
+ padding-left: 15px;
}
-/* small for tables and similar */
-.small, .small * {
- font-size: 94%;
+
+#wr-footer a
+{
+ color: #00408f;
}
-table.small {
- font-size: 100%;
+
+#wr-footer ul {
+ margin-bottom: 0;
}
-/*
-** content styles
-*/
+#wr-licenses
+{
-#toc,
-.toc,
-.mw-warning {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
- padding: 5px;
- font-size: 95%;
-}
-#toc h2,
-.toc h2 {
- display: inline;
- border: none;
- padding: 0;
- font-size: 100%;
- font-weight: bold;
}
-#toc #toctitle,
-.toc #toctitle,
-#toc .toctitle,
-.toc .toctitle {
- text-align: center;
+
+#wr-poweredby
+{
+
}
-#toc ul,
-.toc ul {
- list-style-type: none;
- list-style-image: none;
- margin-left: 0;
- padding-left: 0;
- text-align: left;
+
+#wr-footer-content
+{
+
}
-#toc ul ul,
-.toc ul ul {
- margin: 0 0 0 2em;
+
+#f-poweredbyico, #f-copyrightico
+{
+ margin: 0 8px;
+ position: relative;
+ top: -2px; /* Bump it up just a tad */
}
-#toc .toctoggle,
-.toc .toctoggle {
- font-size: 94%;
+
+#f-poweredbyico
+{
+ float: right;
+ height: 1%;
}
-.mw-warning {
- margin-left: 50px;
- margin-right: 50px;
- text-align: center;
+#f-copyrightico
+{
+ float: left;
+ height: 1%;
}
-/* images */
-div.floatright, table.floatright {
- clear: right;
- float: right;
+#f-opendirectoryico
+{
+ margin: 0 4px;
position: relative;
- margin: 0 0 .5em .5em;
- border: 0;
-/*
- border: .5em solid white;
- border-width: .5em 0 .8em 1.4em;
-*/
+ top: -4px;
+ float: right;
+ height: 1%;
}
-div.floatright p { font-style: italic; }
-div.floatleft, table.floatleft {
- float: left;
- position: relative;
- margin: 0 .5em .5em 0;
+
+/********** GENERAL STYLES **********/
+
+.visualClear
+{
+ clear: both;
+}
+
+.visualClearLeft
+{
+ clear: left;
+}
+
+input[readonly]
+{
+ color: #777;
+ background-color: #f9f9f9;
+ border: 1px solid #ddd;
+}
+
+input[type=radio],input[type=checkbox]
+{
+ vertical-align:top;
+}
+
+table
+{
+ font-size: 100%;
+ color: #333;
+}
+
+a
+{
+ text-decoration: none;
+ color: #1111CC;
+ background: none;
+}
+
+a:visited
+{
+ color: #5a3696;
+}
+
+a:active
+{
+ color: #0066B3;
+}
+
+a:hover
+{
+ text-decoration: underline;
+}
+
+a.stub
+{
+ color: #772233;
+}
+
+a.new, #p-personal a.new
+{
+ color: #ba0000;
+}
+
+a.new:visited, #p-personal a.new:visited
+{
+ color: #a55858;
+}
+
+img
+{
+ border: none;
+ vertical-align: middle;
+}
+
+p
+{
+ margin: .4em 0 1em 0;
+ line-height: 1.5em;
+}
+
+p img
+{
+ margin: 0;
+}
+
+hr
+{
+ height: 1px;
+ color: #e0e0e0;
+ background-color: #e0e0e0;
border: 0;
-/*
- margin: .3em .5em .5em 0;
- border: .5em solid white;
- border-width: .5em 1.4em .8em 0;
-*/
+ margin: .5em 0 .5em 0;
}
-div.floatleft p { font-style: italic; }
-/* thumbnails */
-div.thumb {
+
+hr.topic
+{
+ background-color: #aaa;
+ margin: 1.5em 0 -0.5em 0;
+}
+
+div.header, div.myrelate-header
+{
+ font-size: 150%;
+ padding-top: 5px;
+ padding-bottom: 2px;
+ margin-top: .4em;
+ color: #ed5800;
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+}
+
+h1, h2, h3, h4, h5, h6
+{
+ color: #ed5800;
+ background: none;
+ font-weight: normal;
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ margin: 0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+h1
+{
+ color: #333;
+ font-size: 164%;
+}
+
+h2
+{
+ font-size: 160%;
+/* padding-top: 2px; */
+ padding-bottom: 2px;
+/* border-top: 1px solid #a0a0a0; */
+ font-weight: normal;
+}
+.h2like {
+ color: #ed5800;
+ background: none;
+ font-weight: normal;
+ font-size: 160%;
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ margin: 0.4em 0;
+ padding-top: 5px;
+ padding-bottom: 2px;
+}
+
+div.editsection
+{
+ margin-top: 1em;
+ font-size: 11px;
+}
+
+h3, h4, h5, h6
+{
+ border-bottom: none;
+}
+
+h3
+{
+ font-size: 132%;
+}
+
+h4
+{
+ font-size: 116%;
+}
+
+h5
+{
+ font-size: 100%;
+}
+
+h6
+{
+ font-size: 80%;
+}
+
+ul
+{
+ list-style-type: square;
+ margin: 0 0 1em 1.2em;
+ padding: 0;
+ list-style-image: url(bullet.gif);
+}
+
+ol
+{
+ line-height: 1.3em;
+ margin: 0 0 1em 2.5em;
+ padding: 0;
+}
+
+li
+{
+ margin-bottom: .1em;
+}
+
+dt
+{
+ font-weight: bold;
+ margin-bottom: .1em;
+}
+
+dl
+{
+ margin-top: .2em;
+ margin-bottom: 1em;
+}
+
+dd
+{
+ line-height: 1.5em;
+ margin-left: 2em;
+ /*margin-bottom: .1em;*/
margin-bottom: .5em;
- border-style: solid;
- border-color: white;
- width: auto;
}
-div.thumb div {
- border: 1px solid #ccc;
- padding: 3px !important;
- background-color: #f9f9f9;
- font-size: 94%;
- text-align: center;
- overflow: hidden;
+
+fieldset
+{
+ border: 1px solid #2f6fab;
+ margin: 1em 0 1em 0;
+ padding: 0 1em 1em;
+ line-height: 1.5em;
}
-div.thumb div a img {
- border: 1px solid #ccc;
+
+legend
+{
+ background: white;
+ padding: .5em;
+ font-size: 95%;
}
-div.thumb div div.thumbcaption {
+
+form
+{
border: none;
- text-align: left;
- line-height: 1.4em;
- padding: .3em 0 .1em 0;
+ margin: 0;
}
-div.magnify {
- float: right;
- border: none !important;
- background: none !important;
+
+textarea
+{
+ /*width: 100%; */
+ padding: .1em;
}
-div.magnify a, div.magnify img {
- display: block;
- border: none !important;
- background: none !important;
+
+#wpTextbox1
+{
+ width: 98%;
}
-div.tright {
- clear: right;
- float: right;
- border-width: .5em 0 .8em 1.4em;
+
+input.historysubmit
+{
+ padding: 0 .3em .3em .3em !important;
+ font-size: 94%;
+ cursor: pointer;
+ height: 1.7em !important;
+ margin-left: 1.6em;
}
-div.tleft {
- float: left;
- margin-right: .5em;
- border-width: .5em 1.4em .8em 0;
+
+select
+{
+ vertical-align: top;
}
-.hiddenStructure {
- display: none;
- speak: none;
+abbr, acronym, .explain
+{
+ border-bottom: 1px dotted black;
+ color: #333;
+ background: none;
+ cursor: help;
}
-img.tex {
- vertical-align: middle;
+
+q
+{
+ font-family: Times, "Times New Roman", serif;
+ font-style: italic;
}
-span.texhtml {
- font-family: serif;
+
+/* disabled for now
+blockquote
+{
+ font-family: Times, "Times New Roman", serif;
+ font-style: italic;
}
+*/
+code {
+ color: #333;
+ padding: 0;
+ font-family: "Lucida Console", Monaco, monospace;
+ white-space: pre;
+ margin: 0;
+ font-size: 11px;
+ line-height: 1.2;
+}
+pre
+{
+ color: #333;
+ padding: 0;
+ margin: 0;
+ font-family: "Lucida Console", Monaco, monospace;
+ white-space: -moz-pre-wrap; /* Mozilla */
+ white-space: -pre-wrap; /* Opera */
+ white-space: -o-pre-wrap; /* Opera */
+ white-space: pre-wrap; /* CSS3 */
+ word-wrap: break-word; /* IE 5.5+ */
/*
-** classes for special content elements like town boxes
-** intended to be referenced directly from the wiki src
+ margin: .4em 0 1em 0;
+ line-height: 1.5em;
+ font-size: 100%;
*/
-
+}
+/* parser sometimes adds p inside pre tags */
+pre p {
+ margin: 0;
+ padding: 0;
+ line-height: 1.3em;
+}
/*
-** User styles
+pre
+{
+ padding: 1em;
+ border: 1px dashed #2f6fab;
+ color: black;
+ background-color: #f9f9f9;
+ line-height: 1.1em;
+}
*/
-/* table standards */
-table.rimage {
- float: right;
- position: relative;
- margin-left: 1em;
- margin-bottom: 1em;
+
+/* emulate center */
+.center
+{
+ width: 100%;
text-align: center;
}
-.toccolours {
- border: 1px solid #aaa;
- background-color: #f9f9f9;
+
+*.center *
+{
+ margin-left: auto;
+ margin-right: auto;
+}
+
+/* small for tables and similar */
+.small, .small *
+{
+ font-size: 94%;
+}
+
+table.small
+{
+ font-size: 100%;
+}
+
+.warning
+{
+ color: red;
+}
+
+/********** CONTENT STYLES **********/
+#toc,.toc
+{
+ border: 1px solid #efc4a1;
+ background-color: #f7f9ff;
padding: 5px;
font-size: 95%;
+ margin-top: 8px;
+}
+
+#toc h2,.toc h2
+{
+ display: inline;
+ border: none;
+ padding: 0;
+ font-size: 100%;
+ font-weight: bold;
+}
+
+#toc #toctitle,.toc #toctitle,#toc .toctitle,.toc .toctitle
+{
+ text-align: center;
+}
+
+#toc ul,.toc ul
+{
+ list-style: none none;
+ margin-left: 0;
+ padding-left: 0;
+ text-align: left;
+ margin-bottom: 0;
+}
+
+#toc ul ul,.toc ul ul
+{
+ margin: 0 0 0 2em;
+}
+
+#toc .toctoggle,.toc .toctoggle
+{
+ font-size: 94%;
+}
+
+/* Some space under the headers in the content area */
+#bodyContent h1, #bodyContent h2
+{
+ margin-top: .4em;
+ margin-bottom: .4em; /* .6em; */
+}
+
+#bodyContent h3, #bodyContent h4, #bodyContent h5
+{
+ margin-top: .3em;
+ margin-bottom: .3em;
+}
+
+/*
+** keep the whitespace in front of the ^=, hides rule from konqueror
+** this is css3, the validator doesn't like it when validating as css2
+*/
+
+#bodyContent a.external,#bodyContent a.extiw
+{
+ background: url(external.png) right no-repeat;
+ padding-right: 13px;
+}
+
+#bodyContent a[href ^="gopher://"]
+{
+ background: url(external.png) center right no-repeat;
+ padding-right: 13px;
+}
+
+/* background: url(lock_icon.gif) center right no-repeat; */
+#bodyContent a[href ^="https://"],
+.link-https
+{
+ background: url(external.png) center right no-repeat;
+ padding-right: 16px;
+}
+
+#bodyContent a[href ^="mailto:"],
+.link-mailto
+{
+ background: url(mail_icon.gif) center right no-repeat;
+ padding-right: 18px;
+}
+
+#bodyContent a[href ^="news://"]
+{
+ background: url(news_icon.png) center right no-repeat;
+ padding-right: 18px;
+}
+
+#bodyContent a[href ^="ftp://"],
+.link-ftp
+{
+ background: url(file_icon.gif) center right no-repeat;
+ padding-right: 18px;
+}
+
+#bodyContent a[href ^="irc://"],
+.link-irc
+{
+ background: url(discussionitem_icon.gif) center right no-repeat;
+ padding-right: 18px;
+}
+
+/* disable interwiki styling
+
+#bodyContent a.extiw,#bodyContent a.extiw:active
+{
+ color: #36b;
+ background: none;
+ padding: 0;
+}
+
+*/
+
+#bodyContent a.extiw,#bodyContent a.external
+{
+ color: #36b;
+}
+
+/* this can be used in the content area to switch off special external link styling */
+
+#bodyContent .plainlinks a
+{
+ background: none !important;
+ padding: 0;
+}
+#bodyContent .redlinks a
+{
+ color: #ba0000 !important;
+}
+
+.redirectText
+{
+ font-size: 150%;
+ margin: 5px;
+}
+
+.printfooter
+{
+ display: none;
+}
+
+.not-patrolled
+{
+ background-color: #ffa;
+}
+div.patrollink
+{
+ font-size: 75%;
+ text-align: right;
+}
+
+span.newpage, span.minor, span.searchmatch
+{
+ font-weight: bold;
+}
+
+span.unpatrolled
+{
+ font-weight: bold;
+ color: red;
+}
+
+span.searchmatch
+{
+ color: red;
+}
+
+.sharedUploadNotice
+{
+ font-style: italic;
+}
+
+span.updatedmarker
+{
+ color: #333;
+ background-color: #0f0;
+}
+
+span.newpageletter
+{
+ font-weight: bold;
+ color: #333;
+ background-color: yellow;
+}
+
+span.minoreditletter
+{
+ color: #333;
+ background-color: #c5ffe6;
+}
+
+table.gallery
+{
+ border: 1px solid #ccc;
+ margin: 2px;
+ padding: 2px;
+ background-color: #f7f9ff; /* white; */
+}
+
+table.gallery tr
+{
+ vertical-align: top;
+}
+
+table.gallery td
+{
+ vertical-align: top;
+ background-color: #f7f9ff;
+ border: none; /* solid 2px white; */
+}
+
+div.gallerybox
+{
+ margin: 2px;
+ width: 150px;
+}
+
+div.gallerybox div.thumb
+{
+ text-align: center;
+ border: 1px solid #ccc;
+ margin: 2px;
+}
+
+div.gallerytext
+{
+ font-size: 94%;
+ padding: 2px 4px;
+}
+
+span.comment
+{
+ font-style: italic;
+}
+
+span.changedby
+{
+ font-size: 95%;
+}
+
+.previewnote
+{
+ text-indent: 3em;
+ color: #c00;
+ border-bottom: 1px solid #aaa;
+ padding-bottom: 1em;
+ margin-bottom: 1em;
+}
+
+.previewnote p
+{
+ margin: 0;
+ padding: 0;
+}
+
+.editExternally
+{
+ border: 1px solid gray;
+ background-color: #ffffff;
+ padding: 3px;
+ margin-top: 0.5em;
+ float: left;
+ font-size: small;
+ text-align: center;
+}
+.editExternallyHelp
+{
+ font-style: italic;
+ color: gray;
+}
+
+li span.deleted
+{
+ text-decoration: line-through;
+ color: #888;
+ font-style: italic;
+}
+
+.toggle
+{
+ margin-left: 2em;
+ text-indent: -2em;
+}
+
+table.citation-fix td {
+ padding-left: 10px;
+}
+
+/* wikitable/prettytable class for skinning normal tables */
+table.wikitable,
+table.prettytable {
+ margin: 1em 1em 1em 0;
+ background: #f7f9ff;
+ border: 1px #aaa solid;
+ border-collapse: collapse;
+}
+.wikitable th, .wikitable td,
+.prettytable th, .prettytable td {
+ border: 1px #aaa solid;
+ padding: 0.2em 0.4em;
+}
+.wikitable th,
+.prettytable th {
+ background: #f2f2f2;
+ text-align: center;
+}
+.wikitable caption,
+.prettytable caption {
+ font-weight: bold;
+}
+ .sortarrow {
+ margin-left: 4px;
+ }
+
+/********** IMAGES **********/
+
+div.floatright, table.floatright
+{
+/*
+ clear: right;
+*/
+ float: right;
+ position: relative;
+ margin: 0 0 .5em .5em;
+ border: 0;
+/*
+ border: .5em solid white;
+ border-width: .5em 0 .8em 1.4em;
+*/
+}
+
+div.floatright p
+{
+ font-style: italic;
+}
+
+div.floatleft, table.floatleft
+{
+ float: left;
+ position: relative;
+ margin: 0 .5em .5em 0;
+ border: 0;
+ /*
+ margin: .3em .5em .5em 0;
+ border: .5em solid white;
+ border-width: .5em 1.4em .8em 0;
+ */
+}
+
+div.floatleft p
+{
+ font-style: italic;
+}
+
+/********** THUMBNAILS **********/
+
+div.thumb
+{
+ margin-bottom: .5em;
+/* border-style: solid;
+ border-color: white;
+*/
+ width: auto;
+}
+
+div.thumb div
+{
+ border: 1px solid #ccc;
+ padding: 3px !important;
+ background-color: #f7f9ff;
+ font-size: 94%;
+ text-align: center;
+ overflow: hidden;
+}
+
+div.thumb div a img
+{
+ border: 1px solid #ccc;
+}
+
+div.thumb div div.thumbcaption
+{
+ border: none;
+ text-align: left;
+ line-height: 1.4em;
+ padding: .3em 0 .1em 0;
+}
+
+div.magnify
+{
+ float: right;
+ border: none !important;
+ background: none !important;
+}
+
+div.magnify a, div.magnify img
+{
+ display: block;
+ border: none !important;
+ background: none !important;
+}
+
+div.tright
+{
+ clear: right;
+ float: right;
+ border-width: .5em 0 .8em 1.4em;
+}
+
+div.tleft
+{
+ float: left;
+ margin-right: .5em;
+ border-width: .5em 1.4em .8em 0;
+}
+
+.hiddenStructure
+{
+ display: none;
+}
+
+img.tex
+{
+ vertical-align: middle;
+}
+
+span.texhtml
+{
+ font-family: serif;
+}
+
+/* Classes for EXIF data display */
+table.metadata
+{
+ font-size: 0.8em;
+ margin-left: 0.5em;
+ margin-bottom: 0.5em;
+}
+
+table.metadata caption
+{
+ font-weight: bold;
+}
+
+table.metadata th
+{
+ font-weight: normal;
+}
+
+table.metadata td
+{
+ padding: 0.1em;
+}
+
+table.metadata
+{
+ border: none;
+ border-collapse: collapse;
+}
+
+table.metadata td, table.metadata th
+{
+ text-align: center;
+ border: 1px solid #aaaaaa;
+ padding-left: 0.1em;
+ padding-right: 0.1em;
+}
+
+table.metadata th
+{
+ background-color: #f7f9ff;
+}
+
+table.metadata td
+{
+ background-color: #fcfcfc;
+}
+
+/* filetoc */
+ul#filetoc
+{
+ text-align: center;
+ border: 1px solid #aaaaaa;
+ background-color: #f7f9ff;
+ padding: 5px;
+ font-size: 95%;
+ margin-bottom: 0.5em;
+ margin-left: 0;
+ margin-right: 0;
+}
+
+#filetoc li
+{
+ display: inline;
+ list-style: none none;
+ padding-right: 2em;
+}
+
+/********** USER STYLES CLASSES FOR SPECIAL CONTENT RENDERING **********/
+
+/* E.G town boxes intended to be referenced directly from the wiki src */
+
+/* table standards */
+
+table.rimage
+{
+ float: right;
+ position: relative;
+ margin-left: 1em;
+ margin-bottom: 1em;
+ text-align: center;
+}
+
+.toccolours
+{
+ border: 1px solid #aaa;
+ background-color: #f7f9ff;
+ padding: 5px;
+ font-size: 95%;
+}
+
+div.townBox
+{
+ position: relative;
+ float: right;
+ background: white;
+ margin-left: 1em;
+ border: 1px solid gray;
+ padding: .3em;
+ width: 200px;
+ overflow: hidden;
+ clear: right;
+}
+
+div.townBox dl
+{
+ padding: 0;
+ margin: 0 0 .3em;
+ font-size: 96%;
+}
+
+div.townBox dl dt
+{
+ background: none;
+ margin: .4em 0 0;
+}
+
+div.townBox dl dd
+{
+ margin: .1em 0 0 1.1em;
+ background-color: #f3f3f3;
+}
+
+/********** EDIT VIEWS, ETC **********/
+
+.special li
+{
+ line-height: 1.4em;
+ margin: 0;
+ padding: 0;
+}
+
+/* @bug 1714 */
+input#wpSave, input#wpDiff
+{
+ margin-right: 0.33em;
+}
+
+#editform .editOptions
+{
+ display: inline;
+}
+
+#wpSave
+{
+ font-weight: bold;
+}
+
+/********** PAGE HISTORY STYLES **********/
+
+.autocomment
+{
+ color: gray;
+}
+
+#pagehistory span.user
+{
+ margin-left: 1.4em;
+ margin-right: .4em;
+}
+
+#pagehistory span.minor
+{
+ font-weight: bold;
+}
+
+#pagehistory li
+{
+ border: 1px solid white;
+}
+
+#pagehistory li.selected
+{
+ background-color: #f7f9ff;
+ border: 1px dashed #aaa;
+}
+
+/********** DIFF RENDERING **********/
+
+table.diff, td.diff-otitle, td.diff-ntitle
+{
+ background-color: white;
+}
+
+td.diff-addedline
+{
+ background: #cfc;
+ font-size: smaller;
+}
+
+td.diff-hdrline
+{
+ font-size: smaller;
+}
+
+td.diff-deletedline
+{
+ background: #ffa;
+ font-size: smaller;
+}
+
+td.diff-context
+{
+ background: #eee;
+ font-size: smaller;
+}
+
+span.diffchange
+{
+ color: red;
+ font-weight: bold;
+}
+
+/********** Special:Movepage **********/
+
+#movepage #wpNewTitle {
+ width: 500px;
+}
+#movepage #wpReason {
+ width: 500px;
+}
+
+/********** SPECIAL: Search ************/
+
+.input_short
+{
+ width: 130px;
+}
+
+.input_medium
+{
+ width: 225px;
+}
+
+.input_wider {
+ width: 350px;
+}
+
+.input_long
+{
+ width: 650px;
+}
+
+/*** Search ***/
+
+#search_form {
+ padding-bottom: 6px;
+}
+
+table.searchform
+{
+ border: 1px #c0c0c0 solid;
+ background-color: #f5f5f5;
+ padding: 4px 10px 4px 6px;
+ border-collapse: separate;
+}
+
+table.searchform tr, table.searchform td
+{
+ background-color: inherit;
+ padding-left: 4px;
+}
+
+div.prev_next_links_top
+{
+ text-align: right;
+ margin: .4em 1.6em 0;
+}
+
+div.prev_next_links_bottom
+{
+ text-align: center;
+}
+
+.searchresulttable
+{
+ width: 99%;
+ line-height: 1.1em;
+}
+
+.searchresult
+{
+ padding-top: 1em;
+ padding-bottom: 0;
+ margin-bottom: 0;
+}
+
+.searchresulttitle
+{
+ font-size: 122%;
+}
+
+.searchresultlabel
+{
+ color: #808080;
+}
+
+.cache_entry input {
+ margin-right: 6px;
+}
+
+#rows {
+ vertical-align: baseline;
+ font-size: 10px;
+}
+
+#watch, #sort {
+ font-size: 10px;
+}
+.sort_label {
+ font-size: 11px;
+ padding-right: 5px;
+}
+
+#talk_input {
+ font-size: 11px;
+ vertical-align: bottom;
+}
+
+/********** SPECIAL: UserLogin **********/
+
+#join
+{
+ color: #A33333;
+ font-weight: normal;
+ font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+ margin: 5px;
+ /*
+ padding-top: .5em;
+ padding-bottom: .17em;
+ */
+ font-size: 150%;
+}
+
+/********** SPECIAL: Preferences **********/
+
+#preftoc
+{
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ clear: both;
+}
+
+#preftoc li
+{
+ margin: 1px -2px 1px 2px;
+ float: left;
+ padding: 2px 0 3px 0;
+ background-color: #f0f0f0;
+ color: #000;
+ border: 1px solid #fff;
+ border-right-color: #716f64;
+ border-bottom: 0;
+ position: relative;
+ white-space: nowrap;
+ list-style: none none;
+ z-index: 3;
+}
+
+#preftoc li.selected
+{
+ font-weight: bold;
+ background-color: #f7f9ff;
+ border: 1px solid #aaa;
+ border-bottom: none;
+ cursor: default;
+ top: 1px;
+ padding-top: 2px;
+ margin-right: -3px;
+}
+
+#preftoc > li.selected
+{
+ top: 2px;
+}
+
+#preftoc a,#preftoc a:active
+{
+ display: block;
+ color: #000;
+ padding: 0 .7em;
+ position: relative;
+ text-decoration: none;
+}
+
+#preftoc li.selected a
+{
+ cursor: default;
+ text-decoration: none;
+}
+
+#prefcontrol
+{
+ padding-top: 2em;
+ clear: both;
+}
+
+#preferences
+{
+ margin: 0;
+ border: 1px solid #aaa;
+ clear: both;
+ padding: 1.5em;
+ background-color: #f7f9ff;
+}
+
+.prefsection
+{
+ border: none;
+ padding: 0;
+ margin: 0;
+ clear: both;
+}
+.prefsection fieldset
+{
+ border: 1px solid #aaa;
+ float: left;
+ margin-right: 2em;
+}
+
+.prefsection legend
+{
+ font-weight: bold;
+}
+
+.prefsection table, .prefsection legend
+{
+ background-color: #f7f9ff;
+}
+
+.mainLegend
+{
+ display: none;
+}
+
+div.prefsectiontip
+{
+ font-size: 95%;
+ margin-top: 0;
+ background-color: #FFC1C1;
+ padding: .2em .7em;
+ clear: both;
+}
+
+.btnSavePrefs
+{
+ font-weight: bold;
+ padding-left: .3em;
+ padding-right: .3em;
+}
+
+.preferences-save-success
+{
+ border: 2px solid green;
+ color: #000;
+ padding: .5em 1.2em;
+ background-color: #ddffdd;
+ float: left;
+ margin-bottom: 1em;
+}
+
+.preferences-login
+{
+ clear: both;
+ margin-bottom: 1.5em;
+}
+
+.prefcache
+{
+ font-size: 90%;
+ margin-top: 2em;
+}
+
+/********** SPECIAL: GedcomPage ***********/
+
+#matchButton
+{
+ padding: 5px 20px;
+ vertical-align: top;
+}
+
+#matchButton input {
+ font-size: 15px;
+}
+
+/********** SPECIAL: ShowPedigree **********/
+
+
+#pd_table
+{
+ border:0;
+ padding:0;
+ margin:0;
+ border-collapse: collapse;
+}
+
+#pd_table .ancestor2
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#fff2f2;
+}
+
+#pd_table .ancestor3
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#f2fff2;
+}
+
+#pd_table .ancestor4
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#fff2fc;
+}
+
+#pd_table .ancestor5
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#fff9f2;
+}
+
+#pd_table .ancestor6
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#fbfff2;
+}
+
+#pd_table .ancestor7
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#f2fffa;
+}
+
+#pd_table .spouse
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#f2f2ff;
+}
+
+#pd_table .child
+{
+ border:1px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#f2f2f2;
+}
+
+#pd_table .self
+{
+ border:2px solid black;
+ margin:2px 0;
+ padding:5px;
+ background:#fffff2;
+}
+
+#pd_table .ancestor2 table
+{
+ background:#fff2f2;
+}
+
+#pd_table .ancestor3 table
+{
+ background:#f2fff2;
+}
+
+#pd_table .ancestor4 table
+{
+ background:#fff2fc;
+}
+
+#pd_table .ancestor5 table
+{
+ background:#fff9f2;
+}
+
+#pd_table .ancestor6 table
+{
+ background:#fbfff2;
+}
+
+#pd_table .ancestor7 table
+{
+ background:#f2fffa;
+}
+
+#pd_table .spouse table
+{
+ background:#f2f2ff;
+}
+
+#pd_table .child table
+{
+ background:#f2f2f2;
+}
+
+#pd_table .self table
+{
+ background:#fffff2;
+}
+
+#pd_table .personempty
+{
+}
+
+#pd_table .bracket
+{
+ border-top:1px solid black;
+ border-left:1px solid black;
+ border-bottom:1px solid black;
+ margin:0;
+ padding:0 8px 0 2px;
+}
+
+#pd_table .bracketempty
+{
+}
+
+#pd_table .line
+{
+ border-top:1px solid black;
+ margin:0;
+ padding:0 5px;
+}
+
+#pd_table .lineempty
+{
+}
+
+#pd_table .cont
+{
+ margin:2px;
+}
+
+#pd_table .family
+{
+}
+
+#pd_table .spouse_children_table
+{
+ border:1px solid black;
+ margin:10px 20px 10px 10px;
+ padding:10px;
+}
+
+#pd_table .spouse_children_table th
+{
+ text-align:center;
+ font-weight: normal;
+ padding:5px;
+}
+
+#pedigree_link
+{
+ float: right;
+ margin: -46px 12px 0 0;
+}
+
+/*
+** Timelines
+*/
+.wr_timeline td
+{
+ padding:0 2em 0 0;
+ text-align:left;
+}
+.wr_timeline th
+{
+ padding:0 2em 0 0;
+}
+
+/********** CLASSES FOR ARTICLE VALIDATION **********/
+
+table.revisionform_default
+{
+ border: 1px solid #000000;
+}
+
+table.revisionform_focus
+{
+ border: 1px solid #000000;
+ background-color:#00BBFF;
+}
+
+tr.revision_tr_default
+{
+ background-color:#EEEEEE;
+}
+
+tr.revision_tr_first
+{
+ background-color:#DDDDDD;
+}
+
+p.revision_saved
+{
+ color: green;
+ font-weight:bold;
+}
+
+/********** MISC STYLES **********/
+
+#mw_trackbacks
+{
+ border: solid 1px #bbbbff;
+ background-color: #eeeeff;
+ padding: 0.2em;
+}
+
+/* all messages table */
+#allmessagestable th
+{
+ background-color: #b2b2ff;
+}
+
+#allmessagestable tr.orig
+{
+ background-color: #ffe2e2;
+}
+
+#allmessagestable tr.new
+{
+ background-color: #e2ffe2;
+}
+
+#allmessagestable tr.def
+{
+ background-color: #f0f0ff;
+}
+
+/* noarticletext */
+div.noarticletext
+{
+ border: 1px solid #ccc;
+ background: #fff;
+ padding: .2em 1em;
+ color: #000;
+}
+
+.highlight
+{
+ font-weight: bold;
+}
+
+/********** AUTOCOMPLETE **********/
+
+.ac_results
+{
+ width: 300px;
+ background: #EEEEEE;
+ cursor: pointer;
+ position: absolute;
+ left: 0;
+ /*font-size: 90%;*/
+ height: 200px;
+ z-index: 101;
+}
+
+.ac_results ul
+{
+ width: 280px;
+ list-style-position: outside;
+ list-style: none none;
+ padding: 0;
+ margin: 0;
+ /* border: 1px solid #000; */
+}
+
+.ac_results li
+{
+ /*width: 390px;*/
+ padding: 2px 2px;
+}
+
+.ac_results a
+{
+ width: 100%;
+}
+
+.ac_loading
+{
+ background : url('../common/images/indicator.gif') right center no-repeat; } .ac_over {
+ background: yellow;
+}
+
+/********** IMAGE PAGE **********/
+
+.imageWrapper
+{
+ clear: left;
+ float: left;
+ position: relative;
+ margin: 0 0 .5em .5em;
+ border: 0;
+}
+
+.diff
+{
+ clear: left;
+}
+
+/********** FOTONOTES **********/
+
+/* The overall canvas: added in fnclient-0.5.0 to provide a canvas works space to be able to place controls outside of image, and also one of: container-inactive container-active */
+
+.fn-canvas
+{
+ position: relative;
+ border: 0px solid #ddd;
+ /*background-color: #eef5f9;
+ border-left: 1px solid #d5e6ee;
+ border-top: 1px solid #d5e6ee;
+ border-right: 1px solid #d5e6ee; */
+}
+
+/* The overall container: always has class="fn-container", and also one of: container-inactive container-active */
+
+.fn-container
+{
+ position: absolute;
+}
+
+.fn-container img
+{
+ border-width: 0;
+}
+
+.fn-view-image-link
+{
+ display: block;
+ margin-top: 10px;
+ text-align: left;
+}
+
+#fn-modaldialog
+{
+ position: absolute;
+ background-color: #fddddd;
+ height: 20px;
+ width: 150px;
+ right: 0px;
+ top: 0px;
+ color: #333;
+ padding-left: 4px;
+}
+
+/* Note areas - a separate class is applied to those being edited. */
+.fn-area
+{
+ position: absolute;
+ background: url(../common/images/fotonotes/transparent.gif);
+ border: 1px solid #222;
+ cursor: crosshair;
+}
+
+#fn-area-new
+{
+ border: 1px dotted #ff0;
+}
+
+.fn-container-active .fn-area
+{
+ visibility: inherit;
+}
+
+.fn-container-inactive .fn-area
+{
+ visibility: hidden;
+}
+
+.fn-area-editing
+{
+ position: absolute;
+ visibility: visible;
+ background: url(../common/images/fotonotes/transparent.gif);
+ border: 1px dashed #FFFFFF;
+ cursor: crosshair;
+}
+
+.fn-area-innerborder-left
+{
+ position: absolute;
+/* top: 0px; */
+ left: 0px;
+ border-left:1px solid #fff;
+ width: 0px;
+ height: 100%;
+}
+
+.fn-area-innerborder-top
+{
+ position: absolute;
+/* top: 0px; */
+ left: 0px;
+ border-top: 1px solid #fff;
+ width: 100%;
+ height: 1px;
+}
+
+.fn-area-innerborder-right
+{
+ position: absolute;
+/* top: 0px; */
+ right: 0px;
+ border-right:1px solid #fff;
+ width: 0px;
+ height: 100%;
+}
+
+.fn-area-innerborder-bottom
+{
+ position: absolute;
+/* top: 0px; */
+ bottom: 0px;
+ border-bottom: 1px solid #fff;
+ width: 100%;
+}
+
+/* Notes themselves. */
+.fn-note
+{
+ position: absolute;
+ left: 0%;
+ top: 100%;
+ width: 150px;
+ visibility: hidden;
+ padding: 4px;
+ background-color: #FFEECC;
+ border: 1px solid #000;
+}
+
+.fn-note span
+{
+ display: block;
+ margin-top: 2px;
+ text-align: left;
+ line-height: 1em;
+}
+
+.fn-note-title
+{
+ margin-bottom: 1px;
+ font-size: 110%;
+ font-weight: bold;
+ color: #666633;
+}
+
+.fn-note-content
+{
+ color: #000000;
+}
+
+.fn-note-author
+{
+ font-size: 80%;
+ font-style: italic;
+ text-align: right;
+ color: #333300;
+}
+
+/* Note drag/resize UI */
+.dragresize
+{
+ position: absolute;
+ width: 5px;
+ height: 5px;
+ font-size: 1px;
+ background: white;
+ border: 1px solid black;
+}
+
+.dragresize-tl
+{
+ top: -8px;
+ left: -8px;
+ cursor: nw-resize;
+}
+
+.dragresize-tm
+{
+ top: -8px;
+ left: 50%;
+ margin-left: -4px;
+ cursor: n-resize;
+}
+
+.dragresize-tr
+{
+ top: -8px;
+ right: -8px;
+ cursor: ne-resize;
+}
+
+.dragresize-ml
+{
+ top: 50%;
+ margin-top: -4px;
+ left: -8px;
+ cursor: w-resize;
+}
+
+.dragresize-mr
+{
+ top: 50%;
+ margin-top: -4px;
+ right: -8px;
+ cursor: e-resize;
+}
+
+.dragresize-bl
+{
+ bottom: -8px;
+ left: -8px;
+ cursor: sw-resize;
+}
+
+.dragresize-bm
+{
+ bottom: -8px;
+ left: 50%;
+ margin-left: -4px;
+ cursor: s-resize;
+}
+
+.dragresize-br
+{
+ bottom: -8px;
+ right: -8px;
+ cursor: se-resize;
+}
+
+/* Control buttons. */
+
+.fn-controlbar
+{
+ position: absolute;
+ right: 0px;
+ top: -18px;
+ height: 15px;
+ z-index: 50;
+}
+
+.fn-controlbar-inactive
+{
+ background: transparent;
+ width:100%;
+}
+
+.fn-controlbar-active
+{
+ width: 100%;
+}
+
+.fn-controlbar span
+{
+ position: absolute;
+ visibility: hidden;
+ bottom: 2px;
+ height: 11px;
+ font-size: 1px;
+ line-height: 1px;
+ cursor: pointer;
+}
+
+.fn-controlbar-active span
+{
+ visibility: inherit;
+}
+
+span.fn-controlbar-toggle-inactive
+{
+ left: 0px;
+ top: -5px;
+ width: 62px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/toggle-inactive.gif);
+}
+
+span.fn-controlbar-toggle-active
+{
+ left: 0px;
+ top: -4px;
+ width: 62px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/toggle-active.gif);
+}
+
+span.fn-controlbar-add-inactive
+{
+ left: 0px;
+ top: -5px;
+ width: 52px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/add-inactive.gif);
+}
+
+span.fn-controlbar-add-active
+{
+ left: 0px;
+ top: -5px;
+ width: 20px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/add-active.gif);
+}
+
+span.fn-controlbar-edit-inactive
+{
+ left: 60px;
+ top: -5px;
+ width: 52px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/edit-inactive.gif);
+}
+
+span.fn-controlbar-edit-active
+{
+ left: 60px;
+ top: -5px;
+ width: 52px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/edit-active.gif);
+}
+
+span.fn-controlbar-del-inactive
+{
+ left: 120px;
+ top: -5px;
+ width: 62px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/del-inactive.gif);
+}
+
+span.fn-controlbar-del-active
+{
+ left: 121px;
+ top: -5px;
+ width: 62px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/del-active.gif);
+}
+
+span.fn-controlbar-credits
+{
+ left: 53px;
+ top: -1px;
+ width: 77px;
+ height: 20px;
+ background-image: url(../common/images/fotonotes/fncredits.gif);
+}
+
+span.fn-controlbar-logo
+{
+ visibility: visible;
+ right: 2px;
+ width: 20px;
+ background-image: url(../common/images/fotonotes/fnlogo.gif);
+}
+
+/* Editing UI */
+.fn-editbar
+{
+ position: absolute;
+ left: 0px;
+ top: 100%;
+ z-index: 100;
+ width: 100%;
+ background-color: #ddd;
+ padding-left: 5px;
+ padding-bottom: 5px;
+ font-size: 12px;
+ border: 1px solid black;
+}
+
+.fn-editbar-inactive
+{
+ visibility: hidden;
+}
+
+.fn-editbar-active
+{
+ visibility: inherit;
+ padding-bottom: 30px;
+}
+
+.fn-editbar-fields
+{
+ left: 0px;
+ top: 100%;
+ z-index: 100;
+ width: 100%;
+ padding: 5px 0;
+ font-size: 12px;
+ border: 0px solid green;
+}
+
+.fn-editbar label
+{
+ margin-left: 5px;
+ font-weight: bold;
+}
+
+.fn-editbar-fields p
+{
+ font-weight: bold;
+ text-align: left;
+ display: block;
+}
+
+.fn-editbar input
+{
+ font-weight: normal;
+ width: 90%;
+ font-family: arial, helvetica, sans-serif;
+ font-size: 9pt;
+ font-weight: bold;
+ cursor: text;
+ border: 0px solid #ddd;
+}
+
+.fn-editbar-content
+{
+ width: 90%;
+ height: 3em;
+ font-family: arial, helvetica, sans-serif;
+ font-size: 9pt;
+ cursor: text;
+ border: 0px solid #ddd;
+}
+
+.fn-editbar span
+{
+ position: absolute;
+ visibility: visible;
+ top: 2px;
+ height: 11px;
+ font-size: 1px;
+ line-height: 1px;
+ cursor: pointer;
+}
+
+.fn-editbar-active span
+{
+ visibility: inherit;
+}
+
+span.fn-editbar-ok
+{
+ right: 70px;
+ width: 28px;
+ height: 18px;
+ background-image: url(../common/images/fotonotes/ok.gif);
+ border: 1px solid #bbb;
+ visibility: inherit;
+ padding:0px;
+}
+
+span.fn-editbar-cancel
+{
+ right: 6px;
+ width: 55px;
+ height: 18px;
+ background-image: url(../common/images/fotonotes/cancel.gif);
+ border: 1px solid #bbb;
+ visibility: inherit;
+}
+
+
+/********** PAGE STYLES **********/
+
+/*** Watchers ***/
+
+#watchers
+{
+ padding: 0;
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+#watchers tr, #watchers td
+{
+ background-color: inherit;
+ text-align: left;
+ margin: 0;
+ padding: 0;
+}
+
+#watchers dl
+{
+ margin: 8px;
+ padding: 0;
+}
+
+#watchers dd
+{
+ font-size: 95%;
+ line-height: 1.2em;
+/* margin: .3em 8px; */
+/* padding: 0; */
+}
+
+
+/*** FamilyTree ***/
+
+div#familytree-table table, div#familytree-table tr, div#familytree-table td
+{
+ border: 1px solid #ddd;
+ color: #000000;
+ background-color: #f5f5f5;
+}
+
+/*** MyRelate ***/
+
+#myrelate-table
+{
+}
+
+td.myrelate-cell
+{
+ vertical-align: top;
+ padding: 0em 1em .5em 1em;
+ border: 1px solid #507EA1;
+ color: #000000;
+ background-color: #f5f5f5;
+}
+
+div.myrelate-header
+{
+ font-size: 132%;
+ padding-top: 2px;
+ padding-bottom: 5px;
+ margin: 0;
+}
+
+/*** Browse Page ***/
+
+.browse table
+{
+ border: 1px #c0c0c0 solid;
+ background-color: #f5f5f5;
+ padding: .4em .9em;
+ margin-bottom: .5em;
+}
+
+.browse tr, .browse td
+{
+ background: inherit;
+ padding: 5px;
+}
+
+/*** Compare ***/
+
+.compare_default
+{
+ border: 1px #c0c0c0 solid;
+}
+
+.compare_page
+{
+ border: 0;
+ text-align: center;
+}
+
+.compare_match
+{
+ border: 1px #c0c0c0 solid;
+ background-color: #ccffcc;
+}
+
+.compare_partial
+{
+ border: 1px #c0c0c0 solid;
+ background-color: #fffccc;
+}
+
+.compare_nomatch
+{
+ border: 1px #c0c0c0 solid;
+ background-color: #ffcccc;
+}
+
+.compare_separator
+{
+ border: 0;
+ line-height: 0.5em;
+}
+
+.compare_ulc
+{
+ border: 0;
+ text-align: center;
+ font-weight: bold;
+}
+
+.compare_superlabel
+{
+ border: 0;
+ text-align: right;
+ font-weight: bold;
+}
+
+.compare_label
+{
+ border: 0;
+ text-align: right;
+}
+
+/*** Merge ***/
+.merge_checked
+{
+ color: #333;
+}
+
+.merge_unchecked
+{
+ color: #808080;
+ border: 1px #c0c0c0 dotted;
+}
+
+.merge_unchecked a
+{
+ color: #808080 !important;
+}
+
+.merge_separator
+{
+ border: 0;
+ line-height: 1.5em;
+ font-weight: bold;
+}
+
+.merge_checkbox
+{
+ border: 1px #c0c0c0 solid;
+ text-align: right;
+}
+
+/*** Network ***/
+
+.network-table table, .network-table tr, .network-table td, .network-table th
+{
+ border: 1px solid #ddd;
+ padding: 5px 10px;
+ background-color: inherit;
+}
+
+/** create account, login **/
+p#userloginlink
+{
+ font-weight: bold;
+}
+
+div#userlogin, div#userloginForm
+{
+ float: left;
+ margin: 0 30px 10px 10px;
+ background: #f5f5f5;
+ border: 1px solid #c0c0c0;
+ padding: 0 10px 10px 10px;
+}
+
+div#userlogin table, div#userlogin tr, div#userlogin td, div#userloginForm table, div#userloginForm tr, div#userloginForm td
+{
+ background: #f5f5f5;
+}
+
+div#signupend, div#loginend
+{
+ float:right;
+ width:40%
+}
+
+input#wpLoginattempt, input#wpMailmypassword, input#wpCreateaccount
+{
+ border: 1px solid #333;
+ background: #CFDCE6;
+}
+
+/*** person/family page ***/
+
+div.srcimgnote-table
+{
+ clear: left;
+ margin: 1em 0;
+}
+
+/** person/family generate title popup **/
+/* Editing UI */
+div.pf-popup
+{
+ position: relative;
+}
+table.pf-popup
+{
+ display: none;
+ position: absolute;
+ left: 0;
+ top: -40px;
+ background-color: #ddd;
+ padding: 10px;
+ font-size: 12px;
+ border: 1px solid black;
+}
+a.pf-popup-button
+{
+ border: 1px solid #888;
+ margin: 0px 0px 0px 10px;
+ padding: 0px 10px;
+}
+
+div#imglicense
+{
+ clear: both;
+ border: 1px solid #E0E0E0;
+ padding: .2em 1em;
+ background-color: #F8F8F8;
+ font-size: 90%;
+}
+
+/** clickmenu **/
+.clickMenu
+{
+ margin: 0;
+ padding: 0;
+}
+.clickMenu, .clickMenu ul {
+ list-style: none none;
+}
+.clickMenu a:visited {
+ color: #1111CC;
+}
+.clickMenu ul {
+ margin: 0;
+ min-width: 80px;
+ float: left;/*ie again*/
+ width: 100%;/*and again*/
+}
+.clickMenu .wr-menu-more {
+ font-size: 13px;
+ padding-right: 4px;
+}
+.clickMenu a {
+ font-size: 13px;
+}
+.clickMenu div.outerbox
+{
+ display: none;
+}
+.clickMenu div.inner
+{
+ top: 27px;
+ left: 0;
+ margin: 0;
+}
+.clickMenu div.inner div.outerbox
+{
+ margin: 0;
+ left: 98px;
+ top: -3px;
+}
+.clickMenu img.liArrow
+{
+ position: absolute;
+ right: 5px;
+ top: 0.41em;
+}
+.clickMenu li.wr-menu-sep {
+ font-size: 1px;
+ line-height: 1px !important;
+ margin: 2px 5px !important;
+ width: auto !important;
+ height: 1px;
+}
+.clickMenu span.wr-menu-sep {
+ display: block;
+ border-top: 1px solid #ccc;
+ width: 100%;
+}
+#wr-menulist,
+#wr-personallist,
+#wr-actionslist
+{
+ display: none;
+}
+#wr-menulist .shadowbox1,
+#wr-menulist .shadowbox2,
+#wr-menulist .shadowbox3,
+#wr-personallist .shadowbox1,
+#wr-personallist .shadowbox2,
+#wr-personallist .shadowbox3 {
+ background: transparent !important;
+}
+#wr-menulist div.inner
+{
+}
+#wr-actionslist div.inner
+{
+}
+#menu-help div.inner
+{
+ margin-left: -38px;
+ width: 94px;
+}
+#wr-actionslist #actions-more div.inner
+{
+ top: 22px;
+}
+/* clickMenu li */
+.clickMenu li {
+ font-size: 9px;
+ margin: 0;
+ color: #1111CC;
+ /*white-space: nowrap; does not really work in ie */
+}
+#wr-menulist li,
+#wr-personallist li,
+#actions-more,
+#actions-more li {
+ position: relative;
+}
+.clickMenu li.main {
+ z-index: 1;
+}
+.clickMenu li.hover
+{
+ cursor: pointer;
+ /* z-index: 1; !important; the hover z-index has to be below the normal one the hovering items may be drawn over a submenu */
+}
+.clickMenu li.hover span.wr-menu-more
+{
+ text-decoration: underline;
+}
+#wr-menulist li.main,
+#wr-personallist li.main
+{
+ float: left;
+ border-left: 1px solid #ccc;
+ padding: 0 10px;
+}
+#wr-menulist li.main:first-child,
+#wr-personallist li.main:first-child
+{
+ border-left: none;
+ padding-left: 12px;
+}
+#wr-actionslist li.main {
+ cursor: default;
+ margin-left: 6px;
+}
+#wr-actionslist li.hover span.wr-menu-more {
+ cursor: pointer;
+}
+#wr-actionslist li.main:first-child
+{
+ display: inline;
+ margin-left: 0;
+}
+#wr-actionslist #actions-talk {
+ display: inline;
+ margin-left: 8px;
+ position: static;
+}
+/* highlight edit on primary page; addsection on talk page */
+#wr-actionslist #actions-edit a,
+#wr-actionslist #actions-addsection a {
+ font-size: 17px;
+ line-height: 22px;
+}
+#wr-actionslist #actions-edit.istalk a {
+ font-size: 13px !important;
+ line-height: inherit !important;
+}
+/* red links on missing */
+#wr-actionslist li.new a {
+ color: #BA0000;
+}
+#wr-actionslist li.selected a {
+ color: #333 !important;
+}
+
+/* clickMenu li li */
+.clickMenu li.main ul {
+ padding: 0;
+ border: 1px solid #888;
+ background-color: #fff;
+}
+.clickMenu li.main li
+{
+ width: 100%;
+ line-height: 21px;
+ padding: 0;
+/* z-index: 2; */
+}
+.clickMenu li.main li a {
+ padding: 0 6px;
+}
+.clickMenu li.main li.hover
+{
+/* background-color: #0b3e91; */
+ background-color: #558BE3;
+}
+.clickMenu li.main li.hover a
+{
+ color: #fff;
+}
+.clickMenu li.main li a:hover
+{
+ text-decoration: none;
+}
+
+/* thats for the shadowbox */
+html>body div.outerbox
+{
+ padding: 0 5px 5px 0;
+}
+html>body div.shadowbox1
+{
+ position: absolute;
+ right: 0;
+ bottom: 5px;
+ width: 5px;
+ height: 100%;
+ background: url(../common/images/myshadow.png) no-repeat right top;
+}
+html>body div.shadowbox2
+{
+ position: absolute;
+ bottom: 0;
+ right: 5px;
+ height: 5px;
+ width: 100%;
+ background: url(../common/images/myshadow.png) left bottom;
+}
+html>body div.shadowbox3
+{
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ height: 5px;
+ width: 5px;
+ background: url(../common/images/myshadow.png) no-repeat right bottom;
+}
+html>body .innerbox
+{
+ margin: 0;
+ display: inherit;
+}
+
+/* exhibit */
+#wr-pedigreemap-sidebar {
+ font-size: 10px;
+}
+.exhibit-lens {
+ border: 1px solid #ddd;
+ padding: 0.5em;
+ margin: 0.2em;
+ font-size: 127%;
+ line-height: 1.5em;
+}
+table.exhibit-thumbnail {
+ border: 1px solid #ddd;
+ padding: 0.5em !important;
+ margin: 0.5em !important;
+}
+.exhibit-name {
+ font-weight: bold;
+ font-size: 120%;
+}
+.exhibit-place {
+ font-style: italic;
+}
+.exhibit-children {
+ margin-top: .1em;
+ margin-bottom: .2em;
+}
+.exhibit-more {
+ font-size: 90%;
+}
+.exhibit-collectionSummaryWidget-results {
+ padding-left: 1em;
+}
+div.exhibit-collectionView-header {
+ margin-bottom: .8em !important;
+}
+div.exhibit-viewPanel-viewSelection {
+ margin-bottom: 1em !important;
+ font-size: 116%;
+}
+div.exhibit-views-bubbleWithItems {
+ height: 100px;
+ width: 285px;
+ overflow: auto;
+}
+.exhibit-facet, .exhibit-text-facet {
+ padding-right: 1em;
+}
+div.exhibit-pedigree {
+ position: relative;
+ height: 99%;
+ width: 99%;
+}
+div.exhibit-pedigree-box, div.exhibit-pedigree-header {
+ position: absolute;
+ height: 25px;
+ width: 145px;
+}
+div.exhibit-pedigree-box {
+ overflow: auto;
+}
+div.exhibit-pedigree-header {
+ overflow: hidden;
+ text-align: center;
+ font-size: 100%;
}
-div.townBox {
- position: relative;
- float: right;
- background: white;
- margin-left: 1em;
- border: 1px solid gray;
- padding: .3em;
- width: 200px;
+div.exhibit-pedigree-small-lens,
+div.exhibit-pedigree-child-lens,
+div.exhibit-pedigree-eol-lens,
+div.exhibit-pedigree-med-lens,
+div.exhibit-pedigree-big-lens {
+ border: 1px solid #000;
+ font-size: 80%;
overflow: hidden;
- clear: right;
+ line-height: 1.5em;
}
-div.townBox dl {
- padding: 0;
- margin: 0 0 .3em;
- font-size: 96%;
+div.exhibit-pedigree-small-lens {
+ height: 21px;
+ width: 135px;
}
-div.townBox dl dt {
- background: none;
- margin: .4em 0 0;
+table.exhibit-pedigree-table {
+ margin: 0;
+ padding: 0;
+ width: 145px;
+ overflow: hidden;
}
-div.townBox dl dd {
- margin: .1em 0 0 1.1em;
- background-color: #f3f3f3;
+table.exhibit-pedigree-table tr {
+ margin: 0;
+ padding: 0;
}
-
-/*
-** edit views etc
-*/
-.special li {
- line-height: 1.4em;
+table.exhibit-pedigree-table tr td {
margin: 0;
padding: 0;
}
-
-/* Page history styling */
-/* the auto-generated edit comments */
-.autocomment {
- color: gray;
+div.exhibit-pedigree-arrow {
+ width: 8px;
+ font-size: 80%;
}
-#pagehistory span.user {
- margin-left: 1.4em;
- margin-right: .4em;
+div.exhibit-pedigree-child-lens {
+ height: 19px;
+ width: 125px;
}
-#pagehistory span.minor {
- font-weight: bold;
+div.exhibit-pedigree-eol-lens {
+ height: 19px;
+ width: 125px;
}
-#pagehistory li {
- border: 1px solid white;
+div.exhibit-pedigree-med-lens {
+ height: 50px;
+ width: 135px;
}
-#pagehistory li.selected {
- background-color: #f9f9f9;
- border: 1px dashed #aaa;
+div.exhibit-pedigree-big-lens {
+ height: 71px;
+ width: 135px;
+ border: 2px solid #555;
+}
+div.exhibit-pedigree-lens-padding {
+ margin: 0px 3px !important;
}
-/*
-** Diff rendering
-*/
-table.diff, td.diff-otitle, td.diff-ntitle {
- background-color: white;
+/* clearfix */
+.clearfix:after, .clearfix-left:after, .clearfix-right:after {
+ visibility:hidden;
+ display:block;
+ font-size:0;
+ content:".";
+ height:0;
+ line-height:0;
}
-td.diff-addedline {
- background: #cfc;
- font-size: smaller;
+.clearfix:after {
+ clear: both;
}
-td.diff-deletedline {
- background: #ffa;
- font-size: smaller;
+.clearfix-left:after {
+ clear: left;
}
-td.diff-context {
- background: #eee;
- font-size: smaller;
+.clearfix-right:after {
+ clear: right;
}
-span.diffchange {
- color: red;
- font-weight: bold;
+.clearfix, .clearfix-left, .clearfix-right {
+ display:block;
}
+* html .clearfix, * html .clearfix-left, * html .clearfix-right { zoom: 1; } /* IE6 */
+*:first-child+html .clearfix, *:first-child+html .clearfix-left, *:first-child+html .clearfix-right { zoom: 1; } /* IE7 */
-/*
-** keep the whitespace in front of the ^=, hides rule from konqueror
-** this is css3, the validator doesn't like it when validating as css2
-*/
-#bodyContent a.external,
-#bodyContent a[href ^="gopher://"] {
- background: url(external.png) center right no-repeat;
- padding-right: 13px;
+/* wr-infobox */
+.wr-infobox {
+ border: 1px solid #efc4a1;
+ background-color: #f7f9ff;
+ -moz-border-radius: 8px;
+ -webkit-border-radius: 8px;
+ border-radius: 8px;
+ line-height: 1.1;
+ margin-bottom: 16px;
+ min-height: 110px;
+}
+.wr-infobox td {
+ vertical-align: baseline;
+ padding-right: 3px;
+}
+.wr-infobox-event {
+ margin-left: 16px;
+ text-indent:-16px;
+}
+.wr-infobox-date {
+ padding-right: 3px;
+}
+.wr-infobox .wr-infobox-image pre {
+ margin: 0;
+ text-indent: 0;
+ white-space: normal;
}
-#bodyContent a[href ^="https://"],
-.link-https {
- background: url(lock_icon.gif) center right no-repeat;
- padding-right: 16px;
+
+#wr_familytreelink {
+ padding-left: 20px;
+ margin: 2px 4px 0;
+ background: url("../common/images/familytree.png") no-repeat 0 50%;
+ color: #1111CC;
+ cursor: pointer;
+}
+.wr-familytreelink-arrow {
+ font-size: 9px;
+ padding-left: 2px;
+}
+.wr-familytreelink-text:hover {
+ text-decoration: underline;
+}
+#wr_familytree_iframe {
+ width: 99%;
+ height: 450px;
+ border: 1px solid #efc4a1;
+ margin-bottom: 12px;
}
-#bodyContent a[href ^="mailto:"],
-.link-mailto {
- background: url(mail_icon.gif) center right no-repeat;
- padding-right: 18px;
+
+/* wr-infobox-person */
+
+.wr-infobox-person {
+ width: 99%;
+ margin-bottom: 0 !important;
+}
+.wr-infobox-person .wr-infobox-image {
+ float: left;
+ width: 100px;
+ height: 100px;
+ margin: 2px;
+}
+.wr-infobox-person .wr-infobox-noimage-male, .wr-infobox-person .wr-infobox-noimage-female {
+ height: 100%;
+ width: 100%;
+ position: relative;
+}
+.wr-infobox-person .wr-infobox-noimage-male {
+ background: #f7f9ff url("../common/images/man.png") no-repeat 50% 10px;
+}
+.wr-infobox-person .wr-infobox-noimage-female {
+ background: #f7f9ff url("../common/images/woman.png") no-repeat 50% 10px;
+}
+.wr-infobox-person .wr-infobox-addimage {
+ position:absolute;
+ bottom: 0;
+ width: 100%;
+ text-align:center;
+ color: #7f7f7f;
+ font-size: 11px;
+ padding-bottom: 4px;
+}
+.wr-infobox-person .wr-infobox-content {
+ margin: 4px 8px 4px 110px;
+}
+.wr-infobox-person .wr-infobox-fullname {
+ font-size: 22px;
+ padding: 6px 0;
+}
+.wr-infobox-person .wr-infobox-event {
+ font-size: 15px;
+ padding: 5px 0;
}
-#bodyContent a[href ^="news://"] {
- background: url(news_icon.png) center right no-repeat;
- padding-right: 18px;
+
+/* wr-infobox-familybadge(s) */
+
+.wr-infobox-familybadges {
+ float: right;
}
-#bodyContent a[href ^="ftp://"],
-.link-ftp {
- background: url(file_icon.gif) center right no-repeat;
- padding-right: 18px;
+.wr-infobox-familybadges .addfamilylink {
+ font-size: 12px;
+ margin: 12px 4px;
+ text-align: center;
}
-#bodyContent a[href ^="irc://"],
-.link-irc {
- background: url(discussionitem_icon.gif) center right no-repeat;
- padding-right: 18px;
+.wr-infobox-familybadges .addotherfamilylink {
+ margin-top: -6px !important;
}
-/* disable interwiki styling */
-#bodyContent a.extiw,
-#bodyContent a.extiw:active {
- color: #36b;
- background: none;
- padding: 0;
+.wr-infobox-familybadge {
+ width: 200px;
+ margin: 0 4px 12px 8px;
}
-#bodyContent a.external {
- color: #36b;
+.wr-infobox-spousechildren {
+ background-color: #fffbf7 !important;
}
-/* this can be used in the content area to switch off
-special external link styling */
-#bodyContent .plainlinks a {
- background: none !important;
- padding: 0 !important;
+.wr-infobox-familybadge .wr-infobox-heading {
+ text-align: center;
+ font-size: 14px;
+ padding: 4px 12px 2px;
}
-/*
-** Structural Elements
-*/
-
-/*
-** general portlet styles (elements in the quickbar)
-*/
-.portlet {
- border: none;
- margin: 0 0 .5em;
- padding: 0;
- float: none;
- width: 11.6em;
- overflow: hidden;
+.wr-infobox-familybadge .wr-infobox-warning {
+ width: 100%;
+ text-align: center;
+ font-size: 11px;
+ color: red;
}
-.portlet h4 {
- font-size: 95%;
- font-weight: normal;
- white-space: nowrap;
+.wr-infobox-familybadge .wr-infobox-editlink {
+ font-size: 10px;
+ text-align: center;
}
-.portlet h5 {
- background: transparent;
- padding: 0 1em 0 .5em;
- display: inline;
- height: 1em;
- text-transform: lowercase;
- font-size: 91%;
- font-weight: normal;
- white-space: nowrap;
+.wr-infobox-familybadge .wr-infobox-fullname {
+ font-size: 13px;
}
-.portlet h6 {
- background: #ffae2e;
- border: 1px solid #2f6fab;
- border-style: solid solid none solid;
- padding: 0 1em 0 1em;
- text-transform: lowercase;
- display: block;
- font-size: 1em;
- height: 1.2em;
- font-weight: normal;
- white-space: nowrap;
+.wr-infobox-familybadge .wr-infobox-yearrange {
+ display: block;
+ font-size: 11px;
}
-.pBody {
- font-size: 95%;
- background-color: white;
- color: black;
- border-collapse: collapse;
- border: 1px solid #aaa;
- padding: 0 .8em .3em .5em;
+.wr-infobox-familybadge .wr-infobox-label {
+ font-family: "Lucida Console", Monaco, monospace;
+ font-size: 11px;
}
-.portlet h1,
-.portlet h2,
-.portlet h3,
-.portlet h4 {
- margin: 0;
- padding: 0;
+.wr-infobox-familybadge .wr-infobox-event {
+ margin: -4px 8px 4px;
+ text-align: center;
+ font-size: 11px;
}
-.portlet ul {
- line-height: 1.5em;
- list-style-type: square;
- list-style-image: url(bullet.gif);
- font-size: 95%;
+.wr-infobox-familybadge li {
+ margin-top: 8px;
+ margin-bottom: 8px;
}
-.portlet li {
- padding: 0;
- margin: 0;
+.wr-infobox-familybadge ul {
+ list-style: none none;
+ margin: 10px 10px;
}
-
-/*
-** Logo properties
-*/
-
-#p-logo {
- z-index: 3;
- position: absolute; /*needed to use z-index */
- top: 0;
- left: 0;
- height: 155px;
- width: 12em;
- overflow: visible;
+.wr-infobox-familybadge ul li {
+ margin-left: 15px;
+ text-indent:-15px;
}
-#p-logo h5 {
- display: none;
+.wr-infobox-familybadge ul .wr-infobox-yearrange {
+ padding-top: 2px;
+ padding-left: 19px;
}
-#p-logo a,
-#p-logo a:hover {
- display: block;
- height: 155px;
- width: 12.2em;
- background-repeat: no-repeat;
- background-position: 35% 50% !important;
- text-decoration: none;
+.wr-infobox-familybadge ol {
+ margin: 0;
+ border-top: 1px solid #ddd;
+ padding: 0 8px 4px 30px;
}
-/*
-** the navigation portlet
-*/
+/* wr-infobox-family */
-#p-navigation {
- position: relative;
- z-index: 3;
-}
+.wr-infobox-family {
+ width: 99%;
+ margin-bottom: 0 !important;
+}
+.wr-infobox-family .wr-infobox-spouses {
+ margin: 4px 0;
+ width: 100%;
+}
+.wr-infobox-family .wr-infobox-spouses td {
+/* border-left: 1px solid #bfbfbf; */
+ border-left: 1px solid #eee;
+ padding: 4px 10px 0;
+ vertical-align: top;
+}
+.wr-infobox-family .wr-infobox-spouses td.first-child {
+ border-left: none;
+}
+.wr-infobox-family .wr-infobox-spouses .wr-infobox-parents {
+ padding-left: 32px;
+ font-size: 9px;
+ margin-top: -2px;
+}
+.wr-infobox-family .wr-infobox-spouses .wr-infobox-fullname {
+ font-size: 20px;
+ padding: 5px 0;
+}
+.wr-infobox-family .wr-infobox-event {
+ margin: 0 0 6px;
+ text-align: center;
+}
+.wr-infobox-family .wr-infobox-spouses .wr-infobox-event {
+ font-size: 13px;
+ padding: 4px 0;
+ margin: 0 0 0 16px;
+ text-align: left;
+}
+.wr-infobox-family .wr-infobox-heading {
+ border-top: 1px solid #ddd;
+ padding: 8px 10px 4px;
+ font-size: 9px;
+}
+.wr-infobox-family .wr-infobox-wrapper {
+ margin: 0 8px 8px;
+}
+.wr-infobox-family .addspouselink {
+ font-size: 18px;
+ margin-left: 8px;
+}
+/* wr-infobox-source , wr-infobox-mysource , wr-infobox-repository */
-#p-navigation .pBody {
- padding-right: 0;
+.wr-infobox-source,
+.wr-infobox-mysource,
+.wr-infobox-repository {
+ padding-top: 4px;
+}
+.wr-infobox-source .wr-infobox-heading,
+.wr-infobox-mysource .wr-infobox-heading,
+.wr-infobox-repository .wr-infobox-heading {
+ font-size: 11px;
+ margin-top: 8px;
+ margin-left: 8px;
+ margin-bottom: 2px;
+}
+.wr-infobox-source td.wr-infobox-label,
+.wr-infobox-mysource td.wr-infobox-label,
+.wr-infobox-repository td.wr-infobox-label {
+ width: 100px;
+}
+.wr-infobox-source .wr-infobox-title,
+.wr-infobox-mysource .wr-infobox-title,
+.wr-infobox-repository .wr-infobox-title {
+ font-size: 16px;
+}
+.wr-infobox-source table,
+.wr-infobox-mysource table,
+.wr-infobox-repository table {
+ margin: 0 8px;
+}
+.wr-infobox-source td,
+.wr-infobox-mysource td,
+.wr-infobox-repository td {
+ padding: 4px 8px;
}
-#p-navigation a {
- display: block;
+.sourcesource
+{
+ clear: right;
+ float: right;
+ margin: 4px 8px 0 0;
}
-#p-navigation li.active a, #p-navigation li.active a:hover {
- text-decoration: none;
- display: inline;
- font-weight: bold;
+/* wr-infobox-article, wr-infobox-name, wr-infobox-imagepage, wr-infobox-containedplaces, wr-infobox-userpage */
+.wr-infobox-userpage,
+.wr-infobox-article,
+.wr-infobox-name,
+.wr-infobox-imagepage,
+.wr-infobox-containedplaces {
+ float: right;
+ margin: 0 4px 12px 8px;
+ padding: 8px;
+}
+.wr-infobox-userpage {
+ width: 200px;
+}
+.wr-infobox-userpage dl,
+.wr-infobox-article dl,
+.wr-infobox-imagepage dl,
+.wr-infobox-containedplaces dl {
+ margin: 0;
+ padding: 0;
+}
+.wr-infobox-userpage dt,
+.wr-infobox-article dt,
+.wr-infobox-imagepage dt,
+.wr-infobox-containedplaces dt {
+ margin-top: 12px;
+}
+.wr-infobox-userpage dd,
+.wr-infobox-article dd,
+.wr-infobox-imagepage dd,
+.wr-infobox-containedplaces dd {
+ margin-bottom: 0;
+ margin-left: 12px;
+}
+.wr-infobox-name ul {
+ list-style: none none;
+ margin-bottom: 8px;
+}
+.wr-infobox-userpage .wr-infobox-heading,
+.wr-infobox-article .wr-infobox-heading,
+.wr-infobox-name .wr-infobox-heading,
+.wr-infobox-imagepage .wr-infobox-heading,
+.wr-infobox-containedplaces .wr-infobox-heading {
+ text-align: center;
+ font-size: 15px;
+ margin-bottom: 6px;
+ color: #ED5800;
+}
+.wr-infobox-imagepage .wr-infobox-fullname {
+ font-size: 13px;
+}
+.wr-infobox-imagepage .wr-infobox-yearrange {
+ display: block;
+ font-size: 11px;
+ padding-left: 8px;
+}
+.wr-infobox-userpage dd dd {
+ font-size: 11px;
+ line-height: 1;
+}
+.wr-infobox-userpage dd dt {
+ margin-top: 4px;
+}
+#filehistory {
+ clear: both;
}
-
-/*
-** Search portlet
-*/
-#p-search {
- position: relative;
- z-index: 3;
+/* wr-infobox-place */
+.wr-infobox-place {
+ width: 100%
}
-input.searchButton {
- margin-top: 1px;
- font-size: 95%;
+.wr-infobox-place .wr-infobox-map {
+ float: right;
+ margin: 2px;
+ text-align: center;
+ font-size: 11px;
}
-#searchGoButton {
- padding-left: .5em;
- padding-right: .5em;
- font-weight: bold;
+.wr-infobox-map {
+ clear: right;
}
-#searchInput {
- width: 10.9em;
- margin: 0;
- font-size: 95%;
+.wr-infobox-place #placemap {
+ width: 220px;
+ height: 120px;
+ margin-bottom: 4px;
}
-#p-search .pBody {
- padding: .5em .4em .4em .4em;
- text-align: center;
+.wr-infobox-place .wr-infobox-content {
+ margin: 4px 208px 4px 8px;
}
-
-/*
-** the personal toolbar
-*/
-
-#p-personal {
- width: 100%;
- white-space: nowrap;
- padding: 0;
- margin: 0;
- position: absolute;
- left: 0;
- top: 0;
- z-index: 0;
- border: none;
- background: none;
- overflow: visible;
- line-height: 1.2em;
+.wr-infobox-place .wr-infobox-title {
+ font-size: 18px;
}
-
-#p-personal h5 {
- display: none;
+.wr-infobox-place .wr-infobox-label {
+ width: 90px;
}
-#p-personal .portlet,
-#p-personal .pBody {
- padding: 0;
- margin: 0;
- border: none;
- z-index: 0;
- overflow: visible;
- background: none;
+.wr-infobox-place .wr-infobox-note {
+ font-size: 9px;
+ font-style: oblique;
}
-/* this is the ul contained in the portlet */
-#p-personal ul {
- border: none;
- line-height: 1.4em;
- color: #2f6fab;
- padding: 0 2em 0 3em;
- margin: 0;
- text-align: right;
- text-transform: lowercase;
- list-style: none;
- z-index: 0;
- background: none;
- cursor: default;
+.wr-infobox-place td {
+ line-height: 1.2;
}
-#p-personal li {
- z-index: 0;
- border: none;
- padding: 0;
- display: inline;
- color: #2f6fab;
- margin-left: 1em;
- line-height: 1.2em;
- background: none;
+.wr-infobox-place p {
+ display: none;
}
-#p-personal li.active {
- font-weight: bold;
+
+/* wr-timelineevents, wr-timeline */
+.wr-timelineevents td {
+ vertical-align: top;
+}
+.wr-timeline {
+ position: relative;
+ min-height: 20px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ width: 30px;
+ margin: 0 8px 0 0;
+ border: 1px solid #ddd;
+ background: #f7f9ff;
+}
+.wr-timeline-event {
+ position: absolute;
+ left: 0;
+}
+.wr-timeline-event div {
+ position: relative;
+ top: -1px;
+ left: 0;
+ height: 4px;
+ width: 30px;
+ z-index: 2;
+ -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)';
+ filter: alpha(opacity=50);
+ opacity: .5;
+ background: #efc4a1;
+}
+.wr-timeline-years div:first-child {
+ border-top: none !important;
+}
+.wr-timeline-years div {
+ text-align: center;
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ left: 0;
+ width: 28px;
+ font-size: 9px;
+ color: #444;
+ border-top: 1px solid #ddd;
+ line-height: 1;
}
-#p-personal li a {
- text-decoration: none;
- color: #005896;
- padding-bottom: .2em;
- background: none;
+
+/* wr-infotable */
+.wr-infotable {
+/* margin-top: 10px; */
+ width: auto;
}
-#p-personal li a:hover {
- background-color: white;
- padding-bottom: .2em;
- text-decoration: none;
+.wr-infotable {
+ border-collapse: collapse;
+ border-spacing: 0;
+ padding: 0;
+ margin: -2px 8px 8px;
}
-#p-personal li.active a:hover {
- background-color: transparent;
+.wr-infotable td {
+ border-top: 1px solid #eee;
}
-/* the icon in front of the user name, single quotes
-in bg url to hide it from iemac */
-li#pt-userpage,
-li#pt-anonuserpage,
-li#pt-login {
- background: url(user.gif) top left no-repeat;
- padding-left: 20px;
- text-transform: none;
+.wr-infotable td.first-child {
+ border-top: none;
}
-
-/*
-** the page-related actions- page/talk, edit etc
-*/
-#p-cactions {
- position: absolute;
- top: 1.3em;
- left: 11.5em;
- margin: 0;
- white-space: nowrap;
- width: 76%;
- line-height: 1.1em;
- overflow: visible;
- background: none;
- border-collapse: collapse;
- padding-left: 1em;
- list-style: none;
- font-size: 95%;
+.wr-infotable th,
+.wr-infotable td {
+ vertical-align: baseline;
+ padding: 0 12px;
}
-#p-cactions .hiddenStructure {
- display: none;
+.wr-infotable-children {
+ margin-top: -14px !important;
}
-#p-cactions ul {
- list-style: none;
+.wr-infotable-children .wr-infotable-id,
+.wr-infotable-factsevents .wr-infotable-type {
+ padding-left: 0;
}
-#p-cactions li {
- display: inline;
- border: 1px solid #aaa;
- border-bottom: none;
- padding: 0 0 .1em 0;
- margin: 0 .3em 0 0;
- overflow: visible;
- background: white;
+.wr-infotable-factsevents .wr-infotable-desc {
+ display: block;
}
-#p-cactions li.selected {
- border-color: #fabd23;
- padding: 0 0 .2em 0;
- font-weight: bold;
+.wr-infotable-children .wr-infotable-id {
+ padding-right: 0;
}
-#p-cactions li a {
- background-color: #fbfbfb;
- color: #002bb8;
- border: none;
- padding: 0 .8em .3em;
- text-decoration: none;
- text-transform: lowercase;
- position: relative;
- z-index: 0;
- margin: 0;
+.wr-infotable-children .wr-infotable-event {
}
-#p-cactions li.selected a {
- z-index: 3;
- background-color: #fff;
- padding: 0 1em .2em!important;
+.wr-infotable-children .wr-infotable-place {
+ display: block;
+ font-size: 11px;
}
-#p-cactions .new a {
- color: #ba0000;
+.wr-infotable-children th {
+ font-size: 9px;
+ text-align: left;
+ font-weight: normal;
+ padding-top: 0;
+ padding-bottom: 0;
}
-#p-cactions li a:hover {
- z-index: 3;
- text-decoration: none;
- background-color: #fff;
+.addchildlink {
+ font-size: 12px;
+ margin: -5px 8px 8px;
}
-#p-cactions h5 {
- display: none;
+
+/* wr-citation- */
+.wr-citation-text {
+ margin: 0 16px;
}
-#p-cactions li.istalk {
- margin-right: 0;
+.wr-citation-sourcenote {
+ margin: 0 16px;
}
-#p-cactions li.istalk a {
- padding-right: .5em;
+.wr-citation-images {
+ margin: 0 16px 0 24px;
}
-#p-cactions #ca-addsection a {
- padding-left: .4em;
- padding-right: .4em;
+.wr-citation-image {
+ padding: 0 8px;
}
-/* offsets to distinguish the tab groups */
-li#ca-talk {
- margin-right: 1.6em;
+/* make code blocks inside references look better */
+ol.references p code {
}
-li#ca-watch, li#ca-unwatch, li#ca-varlang-0, li#ca-print {
- margin-left: 1.6em;
+ol.references code {
+ display: block;
+ margin-top: -10px;
}
-
-/*
-** the remaining portlets
-*/
-#p-tbx,
-#p-lang {
- position: relative;
- z-index: 3;
+ol.references li {
+ margin-bottom: 6px;
+ text-indent: -8px;
+ padding-left: 8px;
+}
+ol.references p {
+ line-height: 1.2;
+ margin: 2px 0 8px;
+ padding-left: 0;
+ text-indent: 0;
}
-/* TODO: #t-iscite is only used by the Cite extension, come up with some
- * system which allows extensions to add to this file on the fly
- */
-#t-ispermalink, #t-iscite {
- color: #999;
+/* image gallery */
+.wr-gallery {
+ margin-top: 12px;
}
-/*
-** footer
-*/
-#footer {
- background-color: white;
- border-top: 1px solid #fabd23;
- border-bottom: 1px solid #fabd23;
- margin: .6em 0 1em 0;
- padding: .4em 0 1.2em 0;
- text-align: center;
- font-size: 90%;
+
+/* table input */
+#name_input .n_select {
+ width: 130px;
+ font-size: 11px;
}
-#footer li {
- display: inline;
- margin: 0 1.3em;
+#name_input .n_presuf {
+ width: 70px;
}
-/* hide from incapable browsers */
-head:first-child+body #footer li { white-space: nowrap; }
-#f-poweredbyico, #f-copyrightico {
- margin: 0 8px;
- position: relative;
- top: -2px; /* Bump it up just a tad */
+#name_input .n_given {
+ width: 160px;
}
-#f-poweredbyico {
- float: right;
- height: 1%;
+#name_input .n_surname {
+ width: 170px;
}
-#f-copyrightico {
- float: left;
- height: 1%;
+#name_input .n_plus {
+ width: 8px;
+ padding-left: 6px;
+ padding-right: 0;
+ font-size: 14px;
}
-
-/* js pref toc */
-#preftoc {
- margin: 0;
- padding: 0;
- width: 100%;
- clear: both;
+#name_input .n_ref {
+ width: 55px;
+ font-size: 12px;
+ padding: 3px 1px 2px;
}
-#preftoc li {
- margin: 1px -2px 1px 2px;
- float: left;
- padding: 2px 0 3px 0;
- background-color: #f0f0f0;
- color: #000;
- border: 1px solid #fff;
- border-right-color: #716f64;
- border-bottom: 0;
- position: relative;
- white-space: nowrap;
- list-style-type: none;
- list-style-image: none;
- z-index: 3;
+#name_input .ezpz-hint {
+ color: #999;
}
-#preftoc li.selected {
- font-weight: bold;
- background-color: #f9f9f9;
- border: 1px solid #aaa;
- border-bottom: none;
- cursor: default;
- top: 1px;
- padding-top: 2px;
- margin-right: -3px;
+
+/* spouse and child of family tables */
+#spouse_of_family_table, #child_of_family_table, #husband_table, #wife_table, #child_table {
+ margin: 0 0 8px;
+ border-collapse: collapse;
}
-#preftoc > li.selected {
- top: 2px;
+#spouse_of_family_table td, #child_of_family_table td, #husband_table td, #wife_table td, #child_table td {
+ padding: 2px 3px;
}
-#preftoc a,
-#preftoc a:active {
- display: block;
- color: #000;
- padding: 0 .7em;
- position: relative;
- text-decoration: none;
+.addMemberLink {
+ margin: -4px 4px 10px;
}
-#preftoc li.selected a {
- cursor: default;
- text-decoration: none;
+.addESINLink {
+ margin: 0 4px 10px;
}
-#prefcontrol {
- padding-top: 2em;
- clear: both;
+
+.tDnD_whileDrag {
+ background-color: #eee;
}
-#preferences {
- margin: 0;
- border: 1px solid #aaa;
- clear: both;
- padding: 1.5em;
- background-color: #F9F9F9;
+
+/* event-fact input */
+#event_fact_input .ef_select {
+ width: 140px;
+ font-size: 11px;
}
-.prefsection {
- border: none;
- padding: 0;
- margin: 0;
+#event_fact_input .ef_date {
+ width: 105px;
}
-.prefsection fieldset {
- border: 1px solid #aaa;
- float: left;
- margin-right: 2em;
+#event_fact_input .ef_place {
+ width: 360px;
}
-.prefsection legend {
- font-weight: bold;
+#event_fact_input .ef_desc {
+ width: 180px;
}
-.prefsection table, .prefsection legend {
- background-color: #F9F9F9;
+#event_fact_input .ef_ref a {
+ width: 8px;
+ font-size: 14px;
+ padding-right: 4px;
}
-.mainLegend {
- display: none;
+#event_fact_input .ef_ref input {
+ width: 55px;
+ padding: 1px;
+ font-size: 12px;
}
-div.prefsectiontip {
- font-size: 95%;
- margin-top: 0;
- background-color: #FFC1C1;
- padding: .2em .7em;
- clear: both;
+#event_fact_input .ef_ref {
+ text-align: right;
+ padding-top:0;
+ padding-bottom: 10px;
}
-.btnSavePrefs {
- font-weight: bold;
- padding-left: .3em;
- padding-right: .3em;
+#event_fact_input .ezpz-hint {
+ color: #999;
}
-
-.preferences-login {
- clear: both;
- margin-bottom: 1.5em;
+#event_fact_input .ef_ref .jTip {
+ font-size: 10px;
+}
+#event_fact_input .sin_heading {
+ font-size: 10px;
+ font-weight: bold;
+ margin-top: -6px;
+ margin-bottom: -2px;
+ padding-right: 2px;
+ text-align: right;
}
-.prefcache {
- font-size: 90%;
- margin-top: 2em;
+/* source input */
+#source_input .s_source {
+ width: 100px;
+}
+#source_input .s_select {
+ margin-right: 10px;
+}
+#source_input .s_title {
+ width: 475px;
+ margin-right: 6px;
+}
+#source_input .s_findadd {
+ width: 55px;
+}
+#source_input .s_recordname {
+ width: 443px;
+}
+#source_input .s_quality {
+ font-size: 10px;
+}
+#source_input .s_page {
+ width: 443px;
+}
+#source_input .s_date {
+ width: 172px;
+}
+#source_input .s_ref {
+ width: 50px;
+}
+#source_input .s_text {
+ width: 695px;
+}
+#source_input .s_label {
+ text-align: right;
+ padding-right: 8px;
+ padding-left: 16px;
+}
+#source_input .s_widelabel {
+ text-align: right;
+ padding-right: 8px;
+ padding-left: 42px;
}
-div#userloginForm form,
-div#userlogin form#userlogin2 {
- margin: 0 3em 1em 0;
- border: 1px solid #aaa;
- clear: both;
- padding: 1.5em 2em;
- background-color: #f9f9f9;
- float: left;
+/* inline-block */
+.inline-block {
+ display: inline-block;
+ vertical-align: middle;
}
+* html .inline-block { display: inline; } /* IE6 */
+*:first-child+html .inline-block { display: inline; } /* IE7 */
-div#userloginForm table,
-div#userlogin form#userlogin2 table {
- background-color: #f9f9f9;
+/* search sidebar */
+#wr-search-sidebar {
+ font-size: 11px;
+}
+#wr-search-sidebar input {
+ font-size: 11px;
+ padding: 0;
+ margin: 0;
+}
+#wr-search-sidebar ul {
+ list-style: none none;
+ margin: 0 0 16px 4px;
+ padding: 0;
+}
+#wr-search-sidebar h3 {
+ margin: 0;
+ padding: 0;
}
-div#userloginForm h2,
-div#userlogin form#userlogin2 h2 {
- padding-top: 0;
+/* wr-openclose */
+.wr-openclose {
+ font-size: 10px;
+ padding-right: 3px;
+ line-height: 19px;
+ vertical-align: middle;
+ cursor: default;
+}
+.wr-openclose-end {
+ height: 1px;
+ line-height: 1px;
}
-div#userlogin .captcha {
- border: 1px solid #bbb;
- padding: 1.5em 2em;
- width: 400px;
- background-color: white;
+/* wr-nameslog */
+.wr-nameslog {
+ margin-bottom: 0.5em;
+ margin-top: 0;
+}
+.wr-nameslog dt {
+ font-weight: normal;
+}
+.wr-nameslog dd {
+ margin-left: 0.4em;
+ margin-bottom: 0.3em;
+}
+.wr-nameslog-adds {
+ background: #cfc;
+}
+.wr-nameslog-deletes {
+ background: #ffa;
}
+/* cluetip */
-#userloginprompt, #languagelinks {
- font-size: 85%;
-}
+/* global */
+#cluetip-close img {
+ border: 0;
+}
+#cluetip-title {
+ overflow: hidden;
+}
+#cluetip-title #cluetip-close {
+ float: right;
+ position: relative;
+}
+#cluetip-close {
+ font-size: 12px;
+}
+#cluetip-waitimage {
+ width: 43px;
+ height: 11px;
+ position: absolute;
+ background-image: url(../common/images/wait.gif);
+}
+.cluetip-arrows {
+ display: none;
+ position: absolute;
+ top: 0;
+ left: -11px;
+ height: 22px;
+ width: 11px;
+ background-repeat: no-repeat;
+ background-position: 0 0;
+}
+#cluetip-extra {
+ display: none;
+}
+/***************************************
+ =cluetipClass: 'default'
+-------------------------------------- */
-#login-sectiontip {
- font-size: 85%;
- line-height: 1.2;
- padding-top: 2em;
+.cluetip-default {
+ background-color: #d9d9c2;
+}
+.cluetip-default #cluetip-outer {
+ position: relative;
+ margin: 0;
+ background-color: #d9d9c2;
+}
+.cluetip-default h3#cluetip-title {
+ margin: 0 0 5px;
+ padding: 8px 10px 4px;
+ font-size: 1.1em;
+ font-weight: normal;
+ background-color: #87876a;
+ color: #fff;
+}
+.cluetip-default #cluetip-title a {
+ color: #d9d9c2;
+ font-size: 0.95em;
+}
+.cluetip-default #cluetip-inner {
+ padding: 10px;
+}
+.cluetip-default div#cluetip-close {
+ text-align: right;
+ margin: 0 5px 5px;
+ color: #900;
}
-#userlogin .loginText, #userlogin .loginPassword {
- width: 12em;
+/* default arrows */
+
+.clue-right-default .cluetip-arrows {
+ background-image: url(../common/images/darrowleft.gif);
+}
+.clue-left-default .cluetip-arrows {
+ background-image: url(../common/images/darrowright.gif);
+ left: 100%;
+ margin-right: -11px;
+}
+.clue-top-default .cluetip-arrows {
+ background-image: url(../common/images/darrowdown.gif);
+ top: 100%;
+ left: 50%;
+ margin-left: -11px;
+ height: 11px;
+ width: 22px;
+}
+.clue-bottom-default .cluetip-arrows {
+ background-image: url(../common/images/darrowup.gif);
+ top: -11px;
+ left: 50%;
+ margin-left: -11px;
+ height: 11px;
+ width: 22px;
}
-#userloginlink a, #wpLoginattempt, #wpCreateaccount {
- font-weight: bold;
+/***************************************
+ =cluetipClass: 'jtip' and 'image'
+-------------------------------------- */
+.jTip {
+ margin-left: 2px;
+ font-size: 10px;
+ font-weight: normal;
+ vertical-align: top;
}
-/*
-** IE/Mac fixes, hope to find a validating way to move this
-** to a separate stylesheet. This would work but doesn't validate:
-** @import("IEMacFixes.css");
-*/
-/* tabs: border on the a, not the div */
-* > html #p-cactions li { border: none; }
-* > html #p-cactions li a {
- border: 1px solid #aaa;
- border-bottom: none;
+.cluetip-jtip,
+.cluetip-image {
+ background-color: transparent;
}
-* > html #p-cactions li.selected a { border-color: #fabd23; }
-/* footer icons need a fixed width */
-* > html #f-poweredbyico,
-* > html #f-copyrightico { width: 88px; }
-* > html #bodyContent,
-* > html #bodyContent pre {
- overflow-x: auto;
- width: 100%;
- padding-bottom: 25px;
+.cluetip-image {
+ width: auto !important;
}
-
-/* more IE fixes */
-/* float/negative margin brokenness */
-* html #footer {margin-top: 0;}
-* html #column-content {
- display: inline;
- margin-bottom: 0;
+.cluetip-jtip #cluetip-outer,
+.cluetip-image #cluetip-outer {
+ border: 2px solid #ccc;
+ position: relative;
+ background-color: #fff;
}
-* html div.editsection { font-size: smaller; }
-#pagehistory li.selected { position: relative; }
-/* Mac IE 5.0 fix; floated content turns invisible */
-* > html #column-content {
- float: none;
-}
-* > html #column-one {
- position: absolute;
- left: 0;
- top: 0;
+.cluetip-jtip h3#cluetip-title,
+.cluetip-image h3#cluetip-title {
+ padding: 2px 5px;
+ font-size: 16px;
+ font-weight: normal;
+ background-color: #ccc;
+ color: #333;
}
-* > html #footer {
- margin-left: 13.2em;
+.cluetip-jtip h3#cluetip-title {
+ margin: 0 0 5px;
}
-.redirectText {
- font-size: 150%;
- margin: 5px;
+.cluetip-image h3#cluetip-title {
+ margin: 0;
}
-.printfooter {
- display: none;
+.cluetip-jtip #cluetip-inner,
+.cluetip-image #cluetip-inner {
+ display: inline-block;
}
-
-.not-patrolled {
- background-color: #ffa;
+.cluetip-jtip #cluetip-inner {
+ padding: 0 5px 5px;
}
-div.patrollink {
- font-size: 75%;
- text-align: right;
+.cluetip-image #cluetip-inner {
+ padding: 0;
}
-span.newpage, span.minor, span.searchmatch, span.bot {
- font-weight: bold;
+
+.cluetip-jtip div#cluetip-close {
+ text-align: right;
+ margin: 0 5px 5px;
+ color: #900;
}
-span.unpatrolled {
- font-weight: bold;
- color: red;
+
+/* jtip arrows */
+
+.clue-right-jtip .cluetip-arrows {
+ background-image: url(../common/images/arrowleft.gif);
+}
+.clue-left-jtip .cluetip-arrows {
+ background-image: url(../common/images/arrowright.gif);
+ left: 100%;
+ margin-right: -11px;
+}
+.clue-top-jtip .cluetip-arrows {
+ background-image: url(../common/images/arrowdown.gif);
+ top: 100%;
+ left: 50%;
+ margin-left: -11px;
+ height: 11px;
+ width: 22px;
+}
+.clue-bottom-jtip .cluetip-arrows {
+ background-image: url(../common/images/arrowup.gif);
+ top: -11px;
+ left: 50%;
+ margin-left: -11px;
+ height: 11px;
+ width: 22px;
}
-span.searchmatch {
- color: red;
+/***************************************
+ =cluetipClass: 'rounded'
+-------------------------------------- */
+
+.cluetip-rounded {
+ background: transparent url(../common/images/bl.gif) no-repeat 0 100%;
+ margin-top: 10px;
+ margin-left: 12px;
}
-.sharedUploadNotice {
- font-style: italic;
+
+.cluetip-rounded #cluetip-outer {
+ background: transparent url(../common/images/tl.gif) no-repeat 0 0;
+ margin-top: -12px;
}
-span.updatedmarker {
- color: black;
- background-color: #0f0;
+.cluetip-rounded #cluetip-title {
+ background-color: transparent;
+ padding: 12px 12px 0;
+ margin: 0 -12px 0 0;
+ position: relative;
+}
+.cluetip-rounded #cluetip-extra {
+ position: absolute;
+ display: block;
+ background: transparent url(../common/images/tr.gif) no-repeat 100% 0;
+ top: 0;
+ right: 0;
+ width: 12px;
+ height: 30px;
+ margin: -12px -12px 0 0;
+}
+.cluetip-rounded #cluetip-inner {
+ background: url(../common/images/br.gif) no-repeat 100% 100%;
+ padding: 5px 12px 12px;
+ margin: -18px -12px 0 0;
+ position: relative;
}
-span.newpageletter {
- font-weight: bold;
- color: black;
- background-color: yellow;
+
+.cluetip-rounded div#cluetip-close {
+ text-align: right;
+ margin: 0 5px 5px;
+ color: #009;
+ background: transparent;
}
-span.minoreditletter {
- color: black;
- background-color: #c5ffe6;
+.cluetip-rounded div#cluetip-close a {
+ color: #777;
}
-table.gallery {
- border: 1px solid #ccc;
- margin: 2px;
- padding: 2px;
- background-color: white;
+/* rounded arrows */
+
+.clue-right-rounded .cluetip-arrows {
+ background-image: url(../common/images/rarrowleft.gif);
+}
+.clue-left-rounded .cluetip-arrows {
+ background-image: url(../common/images/rarrowright.gif);
+ left: 100%;
+ margin-left: 12px;
+}
+.clue-top-rounded .cluetip-arrows {
+ background-image: url(../common/images/rarrowdown.gif);
+ top: 100%;
+ left: 50%;
+ margin-left: -11px;
+ height: 11px;
+ width: 22px;
+}
+.clue-bottom-rounded .cluetip-arrows {
+ background-image: url(../common/images/rarrowup.gif);
+ top: -23px;
+ left: 50%;
+ margin-left: -11px;
+ height: 11px;
+ width: 22px;
}
-table.gallery tr {
- vertical-align: top;
+/* stupid IE6 HasLayout hack */
+.cluetip-rounded #cluetip-title,
+.cluetip-rounded #cluetip-inner {
+ zoom: 1;
}
-table.gallery td {
- vertical-align: top;
- background-color: #f9f9f9;
- border: solid 2px white;
+.ui-dialog {
+ font-size: 12px;
}
-table.gallery td.galleryheader {
- text-align: center;
- font-weight: bold;
+/*** multiselect ***/
+a.multiSelect {
+ background: #FFF url(../common/images/dropdown.blue.png) right center no-repeat;
+ border: solid 1px #BBB;
+ padding-right: 20px;
+ position: relative;
+ cursor: default;
+ text-decoration: none;
+ color: black;
+ display: -moz-inline-stack;
+ display: inline-block;
+ vertical-align: top;
}
-div.gallerybox {
- margin: 2px;
- width: 150px;
+a.multiSelect:link, a.multiSelect:visited, a.multiSelect:hover, a.multiSelect:active {
+ color: black;
+ text-decoration: none;
}
-div.gallerybox div.thumb {
- text-align: center;
- border: 1px solid #ccc;
- margin: 2px;
+a.multiSelect span
+{
+ margin: 1px 0px 1px 3px;
+ overflow: hidden;
+ display: -moz-inline-stack;
+ display: inline-block;
+ white-space: nowrap;
}
-div.gallerytext {
- font-size: 94%;
- padding: 2px 4px;
+a.multiSelect.hover {
+ background-image: url(../common/images/dropdown.blue.hover.png);
}
-span.comment {
- font-style: italic;
+a.multiSelect.active,
+a.multiSelect.focus {
+ border: inset 1px #000;
}
-span.changedby {
- font-size: 95%;
+a.multiSelect.active {
+ background-image: url(../common/images/dropdown.blue.active.png);
}
-.previewnote {
- text-indent: 3em;
- color: #c00;
- border-bottom: 1px solid #aaa;
- padding-bottom: 1em;
- margin-bottom: 1em;
+.multiSelectOptions {
+ margin-top: -1px;
+ overflow-y: auto;
+ overflow-x: hidden;
+ border: solid 1px #B2B2B2;
+ background: #FFF;
}
-.previewnote p {
- margin: 0;
- padding: 0;
+.multiSelectOptions LABEL {
+ padding: 0px 2px;
+ display: block;
+ white-space: nowrap;
}
-.editExternally {
- border: 1px solid gray;
- background-color: #ffffff;
- padding: 3px;
- margin-top: 0.5em;
- float: left;
- font-size: small;
- text-align: center;
+.multiSelectOptions LABEL.optGroup
+{
+ font-weight: bold;
}
-.editExternallyHelp {
- font-style: italic;
- color: gray;
+
+.multiSelectOptions .optGroupContainer LABEL
+{
+ padding-left: 10px;
}
-li span.deleted, span.history-deleted {
- text-decoration: line-through;
- color: #888;
- font-style: italic;
+.multiSelectOptions.optGroupHasCheckboxes .optGroupContainer LABEL
+{
+ padding-left: 18px;
}
-.toggle {
- margin-left: 2em;
- text-indent: -2em;
+.multiSelectOptions input{
+ vertical-align: middle;
}
-/* Classes for EXIF data display */
-table.mw_metadata {
- font-size: 0.8em;
- margin-left: 0.5em;
- margin-bottom: 0.5em;
- width: 300px;
+.multiSelectOptions LABEL.checked {
+ background-color: #dce5f8;
}
-table.mw_metadata caption {
- font-weight: bold;
+.multiSelectOptions LABEL.selectAll {
+ border-bottom: dotted 1px #CCC;
}
-table.mw_metadata th {
- font-weight: normal;
+.multiSelectOptions LABEL.hover {
+ background-color: #3399ff;
+ color: white;
}
-table.mw_metadata td {
- padding: 0.1em;
+/**********************
+* SlickGrid
+**********************/
+
+/*
+IMPORTANT:
+In order to preserve the uniform grid appearance, all cell styles need to have padding, margin and border sizes.
+No built-in (selected, editable, highlight, flashing, invalid, loading, :focus) or user-specified CSS
+classes should alter those!
+*/
+
+
+.slick-header.ui-state-default, .slick-headerrow.ui-state-default {
+ width: 100%;
+ overflow: hidden;
+ border-left: 0px;
}
-table.mw_metadata {
- border: none;
- border-collapse: collapse;
+.slick-header-columns, .slick-headerrow-columns {
+ width: 999999px;
+ position: relative;
+ white-space: nowrap;
+ cursor: default;
+ overflow: hidden;
}
-table.mw_metadata td, table.mw_metadata th {
- text-align: center;
- border: 1px solid #aaaaaa;
- padding-left: 0.1em;
- padding-right: 0.1em;
+.slick-header-column.ui-state-default {
+ position: relative;
+ display: inline-block;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ height: 16px;
+ line-height: 16px;
+ margin: 0;
+ padding: 4px;
+ border-right: 1px solid silver;
+ border-left: 0px;
+ border-top: 0px;
+ border-bottom: 0px;
+ float: left;
}
-table.mw_metadata th {
- background-color: #f9f9f9;
+.slick-headerrow-column.ui-state-default {
+ padding: 4px;
}
-table.mw_metadata td {
- background-color: #fcfcfc;
+.slick-header-column-sorted {
+ font-style: italic;
}
-table.collapsed tr.collapsable {
- display: none;
+.slick-sort-indicator {
+ display: inline-block;
+ width: 8px;
+ height: 5px;
+ margin-left: 4px;
}
+.slick-sort-indicator-desc {
+ background: url(../common/images/sort-desc.gif);
+}
-/* filetoc */
-ul#filetoc {
- text-align: center;
- border: 1px solid #aaaaaa;
- background-color: #f9f9f9;
- padding: 5px;
- font-size: 95%;
- margin-bottom: 0.5em;
- margin-left: 0;
- margin-right: 0;
+.slick-sort-indicator-asc {
+ background: url(../common/images/sort-asc.gif);
}
-#filetoc li {
- display: inline;
- list-style-type: none;
- padding-right: 2em;
+.slick-resizable-handle {
+ position: absolute;
+ font-size: 0.1px;
+ display: block;
+ cursor: col-resize;
+ width: 4px;
+ right: 0px;
+ top: 0;
+ height: 100%;
}
-/* @bug 1714 */
-input#wpSave, input#wpDiff {
- margin-right: 0.33em;
+.slick-sortable-placeholder {
+ background: silver;
}
-#editform .editOptions {
- display: inline;
+.grid-canvas {
+ position: relative;
+ outline: 0;
}
-#wpSave {
- font-weight: bold;
+.slick-row.ui-widget-content, .slick-row.ui-state-active {
+ position: absolute;
+ border: 0px;
}
-/* Classes for article validation */
+.slick-cell, .slick-headerrow-column {
+ position: absolute;
-table.revisionform_default {
- border: 1px solid #000000;
-}
+ border: 1px solid transparent;
+ border-right: 1px dotted silver;
+ border-bottom-color: silver;
-table.revisionform_focus {
- border: 1px solid #000000;
- background-color:#00BBFF;
-}
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ vertical-align: middle;
+/* z-index: 1; */
+ padding: 1px 2px 2px 1px;
+ margin: 0;
-tr.revision_tr_default {
- background-color:#EEEEEE;
+ white-space: nowrap;
+
+ cursor: default;
}
-tr.revision_tr_first {
- background-color:#DDDDDD;
+.slick-group {
}
-p.revision_saved {
- color: green;
- font-weight:bold;
+.slick-group-toggle {
+ display: inline-block;
}
-#mw_trackbacks {
- border: solid 1px #bbbbff;
- background-color: #eeeeff;
- padding: 0.2em;
+.slick-cell.highlighted {
+ background: lightskyblue;
+ background: rgba(0,0,255,0.2);
+ -webkit-transition: all 0.5s;
+ -moz-transition: all 0.5s;
+ transition: all 0.5s;
}
+.slick-cell.flashing {
+ border: 1px solid red !important;
+}
-/* Allmessages table */
+.slick-cell.editable {
+ z-index: 11;
+ overflow: visible;
+ background: white;
+ border-color: black;
+ border-style: solid;
+}
-#allmessagestable th {
- background-color: #b2b2ff;
+.slick-cell:focus {
+ outline: none;
}
-#allmessagestable tr.orig {
- background-color: #ffe2e2;
+.slick-reorder-proxy {
+ display: inline-block;
+ background: blue;
+ opacity: 0.15;
+ filter: alpha(opacity=15);
+ cursor: move;
}
-#allmessagestable tr.new {
- background-color: #e2ffe2;
+.slick-reorder-guide {
+ display: inline-block;
+ height: 2px;
+ background: blue;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
}
-#allmessagestable tr.def {
- background-color: #f0f0ff;
+.slick-selection {
+ z-index: 10;
+ position: absolute;
+ border: 2px dashed black;
}
+#myGrid {
+ background: none repeat scroll 0 0 white;
+ border: 1px solid gray;
+ outline: 0 none;
+}
-/* noarticletext */
-div.noarticletext {
- border: 1px solid #ccc;
- background: #fff;
- padding: .2em 1em;
- color: #000;
+.listPagesForm {
+ border: 1px #c0c0c0 solid;
+ background-color: #f5f5f5;
+ padding: 8px;
+ margin-bottom: 8px;
+}
+.listPagesFilter {
+ float: right;
+ line-height: 2em;
+}
+.listPagesFilter #rowCount {
+ margin-right: 10px;
+}
+.listPagesSearch {
+ float: left;
}
-div#searchTargetContainer {
- left: 10px;
- top: 10px;
- width: 90%;
- background: white;
+#myGrid .cell-title {
+ font-weight: bold;
+}
+#myGrid .cell-title a {
+ color: #1111CC !important;
+}
+#myGrid .cell-title a:visited {
+ color: #5a3696 !important;
}
-div#searchTarget {
- padding: 3px;
- margin: 5px;
- background: #F0F0F0;
- border: solid 1px blue;
+#wr-morelikethis h5 {
+ margin-bottom: 0 !important;
+ color: #333;
+ font-weight: normal;
+}
+.morelikethis {
+ line-height: 1.2em;
+ font-size: 11px;
+}
+.morelikethis ul {
+ margin-left: 8px;
+}
+.morelikethis li {
+ list-style: none;
}
-div#searchTarget ul li {
- list-style: none;
+/* misc changes */
+
+.columnedtable th {
+ border-style: solid;
+ padding: 0.4em;
}
-div#searchTarget ul li:before {
- color: orange;
- content: "\00BB \0020";
+.columnedtable td {
+ border-style: none solid;
+ padding: 0.4em;
}
+sup, sub {
+ line-height: 1;
+}