2004-11-19 04:14:59 +00:00
|
|
|
<?php
|
2006-01-07 12:31:39 +00:00
|
|
|
if ( ! defined( 'MEDIAWIKI' ) )
|
2006-06-07 04:15:58 +00:00
|
|
|
die( 1 );
|
2006-01-07 12:31:39 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
# 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.,
|
2006-04-05 07:43:17 +00:00
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-11-19 04:14:59 +00:00
|
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
|
|
|
|
|
/**
|
2004-11-19 12:44:51 +00:00
|
|
|
* Wrapper object for MediaWiki's localization functions,
|
|
|
|
|
* to be passed to the template engine.
|
|
|
|
|
*
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Skins
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
|
|
|
|
class MediaWiki_I18N {
|
|
|
|
|
var $_context = array();
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
function set( $varName, $value ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->_context[$varName] = $value;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
function translate( $value ) {
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
// Hack for i18n:attributes in PHPTAL 1.0.0 dev version as of 2004-10-23
|
|
|
|
|
$value = preg_replace( '/^string:/', '', $value );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
$value = wfMsg( $value );
|
|
|
|
|
// interpolate variables
|
Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to be like this: "list ($page, $archive) = $dbw->tableNamesN( 'page', 'archive' );".
Three reasons for this:
1) It's better for analysis tools [which want explicit variable declaration]
2) It's easier for a human to read, as it's completely explicit where the variables came from [which is something you don't get with extract() ]
3) It makes it easier to find everywhere where a variable is used with search/grep [which you can't currently do with $tbl_page variables from things like: "extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl');"].
Otherwise, from a functionality/efficiency perspective the two forms should be identical.
By doing this have been able run static analysis over the usages of these variables, thus eliminating 5 unneeded table names from calls, plus removing 3 unused calls entirely, and it just feels subjectively slightly nicer to me.
2006-11-27 08:36:57 +00:00
|
|
|
$m = array();
|
2009-03-29 12:46:11 +00:00
|
|
|
while( preg_match( '/\$([0-9]*?)/sm', $value, $m ) ) {
|
|
|
|
|
list( $src, $var ) = $m;
|
2004-11-19 04:14:59 +00:00
|
|
|
wfSuppressWarnings();
|
|
|
|
|
$varValue = $this->_context[$var];
|
|
|
|
|
wfRestoreWarnings();
|
2009-03-29 12:46:11 +00:00
|
|
|
$value = str_replace( $src, $varValue, $value );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2004-11-19 04:14:59 +00:00
|
|
|
return $value;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-11-19 12:44:51 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**
|
2007-04-24 06:53:31 +00:00
|
|
|
* Template-filler skin base class
|
|
|
|
|
* Formerly generic PHPTal (http://phptal.sourceforge.net/) skin
|
|
|
|
|
* Based on Brion's smarty skin
|
|
|
|
|
* @copyright Copyright © Gabriel Wicke -- http://www.aulinx.de/
|
|
|
|
|
*
|
|
|
|
|
* @todo Needs some serious refactoring into functions that correspond
|
|
|
|
|
* to the computations individual esi snippets need. Most importantly no body
|
|
|
|
|
* parsing for most of those of course.
|
|
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Skins
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
|
|
|
|
class SkinTemplate extends Skin {
|
|
|
|
|
/**#@+
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-07-20 00:33:23 +00:00
|
|
|
* Name of our skin, it probably needs to be all lower case. Child classes
|
|
|
|
|
* should override the default.
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2009-07-20 00:33:23 +00:00
|
|
|
var $skinname = 'monobook';
|
2004-11-19 04:14:59 +00:00
|
|
|
|
|
|
|
|
/**
|
2009-07-20 00:33:23 +00:00
|
|
|
* Stylesheets set to use. Subdirectory in skins/ where various stylesheets
|
|
|
|
|
* are located. Child classes should override the default.
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2009-07-20 00:33:23 +00:00
|
|
|
var $stylename = 'monobook';
|
2004-11-19 04:14:59 +00:00
|
|
|
|
|
|
|
|
/**
|
2009-07-20 00:33:23 +00:00
|
|
|
* For QuickTemplate, the name of the subclass which will actually fill the
|
|
|
|
|
* template. Child classes should override the default.
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2009-07-20 00:33:23 +00:00
|
|
|
var $template = 'QuickTemplate';
|
2008-08-04 18:07:36 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**#@-*/
|
|
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
/**
|
|
|
|
|
* Add specific styles for this skin
|
|
|
|
|
*
|
|
|
|
|
* @param $out OutputPage
|
|
|
|
|
*/
|
|
|
|
|
function setupSkinUserCss( OutputPage $out ){
|
|
|
|
|
$out->addStyle( 'common/shared.css', 'screen' );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
$out->addStyle( 'common/commonPrint.css', 'print' );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
/* add specific javascript the base Skin class */
|
|
|
|
|
function setupSkinUserJs( OutputPage $out ){
|
|
|
|
|
global $wgUseSiteJs;
|
|
|
|
|
//use site js:
|
|
|
|
|
if( $wgUseSiteJs ) {
|
|
|
|
|
$jsCache = $this->loggedin ? '&smaxage=0' : '';
|
|
|
|
|
$siteGenScriptFile = self::makeUrl( '-',
|
|
|
|
|
"action=raw$jsCache&gen=js&useskin=" .
|
|
|
|
|
urlencode( $this->getSkinName() ) ) ;
|
|
|
|
|
$this->jsvarurl = $siteGenScriptFile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**
|
2004-11-19 12:44:51 +00:00
|
|
|
* Create the template engine object; we feed it a bunch of data
|
|
|
|
|
* and eventually it spits out some HTML. Should have interface
|
|
|
|
|
* roughly equivalent to PHPTAL 0.7.
|
|
|
|
|
*
|
2008-08-21 14:09:57 +00:00
|
|
|
* @param $callback string (or file)
|
|
|
|
|
* @param $repository string: subdirectory where we keep template files
|
|
|
|
|
* @param $cache_dir string
|
2004-11-19 04:14:59 +00:00
|
|
|
* @return object
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2009-03-29 12:46:11 +00:00
|
|
|
function setupTemplate( $classname, $repository = false, $cache_dir = false ) {
|
2004-11-25 05:31:49 +00:00
|
|
|
return new $classname();
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**
|
|
|
|
|
* initialize various variables and generate the template
|
2004-11-19 12:44:51 +00:00
|
|
|
*
|
2008-08-21 14:09:57 +00:00
|
|
|
* @param $out OutputPage
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2008-08-21 14:09:57 +00:00
|
|
|
function outputPage( OutputPage $out ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgArticle, $wgUser, $wgLang, $wgContLang;
|
2006-05-31 20:39:14 +00:00
|
|
|
global $wgScript, $wgStylePath, $wgContLanguageCode;
|
2005-12-04 18:27:59 +00:00
|
|
|
global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest;
|
2007-01-07 22:31:07 +00:00
|
|
|
global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces;
|
2009-02-14 17:09:57 +00:00
|
|
|
global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks;
|
2004-11-19 04:14:59 +00:00
|
|
|
global $wgMaxCredits, $wgShowCreditsIfMax;
|
2004-12-18 03:47:11 +00:00
|
|
|
global $wgPageShowWatchingUsers;
|
2008-07-28 16:54:06 +00:00
|
|
|
global $wgUseTrackbacks, $wgUseSiteJs;
|
2009-04-10 11:55:25 +00:00
|
|
|
global $wgArticlePath, $wgScriptPath, $wgServer, $wgCanonicalNamespaceNames;
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2006-11-29 11:43:58 +00:00
|
|
|
$oldid = $wgRequest->getVal( 'oldid' );
|
|
|
|
|
$diff = $wgRequest->getVal( 'diff' );
|
2009-02-14 17:09:57 +00:00
|
|
|
$action = $wgRequest->getVal( 'action', 'view' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-init' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->initPage( $out );
|
2005-02-21 11:28:07 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
$this->setMembers();
|
2005-07-22 11:29:15 +00:00
|
|
|
$tpl = $this->setupTemplate( $this->template, 'skins' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
|
|
|
|
#if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->setTranslator( new MediaWiki_I18N() );
|
2004-11-19 04:14:59 +00:00
|
|
|
#}
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-init' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-stuff' );
|
|
|
|
|
$this->thispage = $this->mTitle->getPrefixedDBkey();
|
2005-02-21 11:28:07 +00:00
|
|
|
$this->thisurl = $this->mTitle->getPrefixedURL();
|
2009-07-15 06:43:42 +00:00
|
|
|
$query = $wgRequest->getValues();
|
2009-07-14 21:25:33 +00:00
|
|
|
unset( $query['title'] );
|
2009-07-26 10:34:03 +00:00
|
|
|
unset( $query['returnto'] );
|
|
|
|
|
unset( $query['returntoquery'] );
|
2009-07-15 10:22:56 +00:00
|
|
|
$this->thisquery = wfUrlencode( wfArrayToCGI( $query ) );
|
2005-02-21 12:23:52 +00:00
|
|
|
$this->loggedin = $wgUser->isLoggedIn();
|
2009-03-29 12:46:11 +00:00
|
|
|
$this->iscontent = ( $this->mTitle->getNamespace() != NS_SPECIAL );
|
|
|
|
|
$this->iseditable = ( $this->iscontent and !( $action == 'edit' or $action == 'submit' ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->username = $wgUser->getName();
|
2005-10-22 20:52:30 +00:00
|
|
|
|
|
|
|
|
if ( $wgUser->isLoggedIn() || $this->showIPinHeader() ) {
|
2006-09-22 13:07:06 +00:00
|
|
|
$this->userpageUrlDetails = self::makeUrlDetails( $this->userpage );
|
2005-10-22 20:52:30 +00:00
|
|
|
} else {
|
|
|
|
|
# This won't be used in the standard skins, but we define it to preserve the interface
|
|
|
|
|
# To save time, we check for existence
|
2006-09-22 13:07:06 +00:00
|
|
|
$this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
|
2005-10-22 20:52:30 +00:00
|
|
|
}
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
$this->userjs = $this->userjsprev = false;
|
|
|
|
|
$this->setupUserCss( $out );
|
2007-05-08 20:48:02 +00:00
|
|
|
$this->setupUserJs( $out->isUserJsAllowed() );
|
2005-02-21 11:28:07 +00:00
|
|
|
$this->titletxt = $this->mTitle->getPrefixedText();
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-stuff' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-stuff2' );
|
2008-12-31 17:02:23 +00:00
|
|
|
$tpl->set( 'title', $out->getPageTitle() );
|
2008-08-21 14:09:57 +00:00
|
|
|
$tpl->set( 'pagetitle', $out->getHTMLTitle() );
|
|
|
|
|
$tpl->set( 'displaytitle', $out->mPageLinkTitle );
|
2008-08-10 20:10:37 +00:00
|
|
|
$tpl->set( 'pageclass', $this->getPageClasses( $this->mTitle ) );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'skinnameclass', ( 'skin-' . Sanitizer::escapeClass( $this->getSkinName() ) ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2007-01-15 06:11:58 +00:00
|
|
|
$nsname = isset( $wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] ) ?
|
2009-03-29 12:46:11 +00:00
|
|
|
$wgCanonicalNamespaceNames[ $this->mTitle->getNamespace() ] :
|
|
|
|
|
$this->mTitle->getNsText();
|
2006-10-20 02:57:59 +00:00
|
|
|
|
2006-07-28 19:05:27 +00:00
|
|
|
$tpl->set( 'nscanonical', $nsname );
|
2006-08-23 13:57:16 +00:00
|
|
|
$tpl->set( 'nsnumber', $this->mTitle->getNamespace() );
|
2006-07-28 19:05:27 +00:00
|
|
|
$tpl->set( 'titleprefixeddbkey', $this->mTitle->getPrefixedDBKey() );
|
|
|
|
|
$tpl->set( 'titletext', $this->mTitle->getText() );
|
|
|
|
|
$tpl->set( 'articleid', $this->mTitle->getArticleId() );
|
2006-12-03 14:13:59 +00:00
|
|
|
$tpl->set( 'currevisionid', isset( $wgArticle ) ? $wgArticle->getLatest() : 0 );
|
2006-12-03 12:35:50 +00:00
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
$tpl->set( 'isarticle', $out->isArticle() );
|
2006-12-03 11:44:23 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->setRef( 'thispage', $this->thispage );
|
2008-10-27 18:03:47 +00:00
|
|
|
$subpagestr = $this->subPageSubtitle();
|
|
|
|
|
$tpl->set(
|
2009-03-29 12:46:11 +00:00
|
|
|
'subtitle', !empty( $subpagestr ) ?
|
|
|
|
|
'<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle() :
|
2008-10-27 18:03:47 +00:00
|
|
|
$out->getSubtitle()
|
|
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
$undelete = $this->getUndeleteLink();
|
|
|
|
|
$tpl->set(
|
2009-03-29 12:46:11 +00:00
|
|
|
'undelete', !empty( $undelete ) ?
|
|
|
|
|
'<span class="subpages">'.$undelete.'</span>' :
|
2004-11-19 04:14:59 +00:00
|
|
|
''
|
|
|
|
|
);
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'catlinks', $this->getCategories() );
|
2008-08-21 14:09:57 +00:00
|
|
|
if( $out->isSyndicated() ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$feeds = array();
|
2008-08-21 14:09:57 +00:00
|
|
|
foreach( $out->getSyndicationLinks() as $format => $link ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$feeds[$format] = array(
|
2008-01-12 00:13:53 +00:00
|
|
|
'text' => wfMsg( "feed-$format" ),
|
2009-03-29 12:46:11 +00:00
|
|
|
'href' => $link
|
|
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
$tpl->setRef( 'feeds', $feeds );
|
|
|
|
|
} else {
|
|
|
|
|
$tpl->set( 'feeds', false );
|
|
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $wgUseTrackbacks && $out->isArticleRelated() ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
$tpl->set( 'trackbackhtml', $out->getTitle()->trackbackRDF() );
|
2006-11-29 05:45:03 +00:00
|
|
|
} else {
|
|
|
|
|
$tpl->set( 'trackbackhtml', null );
|
|
|
|
|
}
|
2005-07-23 05:47:25 +00:00
|
|
|
|
2007-01-07 22:31:07 +00:00
|
|
|
$tpl->setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace );
|
|
|
|
|
$tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'mimetype', $wgMimeType );
|
2005-05-05 21:00:49 +00:00
|
|
|
$tpl->setRef( 'jsmimetype', $wgJsMimeType );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'charset', $wgOutputEncoding );
|
|
|
|
|
$tpl->set( 'headlinks', $out->getHeadLinks() );
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
|
|
|
|
//moved headscripts to near end of template header output
|
|
|
|
|
|
2008-08-21 14:09:57 +00:00
|
|
|
$tpl->set( 'csslinks', $out->buildCssLinks() );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'wgScript', $wgScript );
|
|
|
|
|
$tpl->setRef( 'skinname', $this->skinname );
|
2006-07-28 19:05:27 +00:00
|
|
|
$tpl->set( 'skinclass', get_class( $this ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'stylename', $this->stylename );
|
2005-06-22 22:59:39 +00:00
|
|
|
$tpl->set( 'printable', $wgRequest->getBool( 'printable' ) );
|
Start on some cleanup of how CSS stylesheets are loaded. Initially addressing only the SkinTemplate-based skins; would like to rip out some near-dupe code in the other skin types, with a little more refactoring...
* A skin can make calls to $this->addScript to much more cleanly list which style sheets it wants to load, for which media variants and which IE conditional versions. This replaces the 'cssfiles' array hack and giant pile of ugly conditionals in MonoBook's template.
* 'printable=yes' and 'handheld=yes' URL options are handled transparently -- 'screen' stylesheets are hidden, while those with no media specifier are left.
MediaWiki:Common.css is now listed without media -- so infoboxes are still formatted -- while the skin-specific eg MediaWiki:Monobook.css are listed for screen, as they're specific to the on-screen skin.
Note it should be a matter of one line of code to add a MediaWiki:Print.css and have it correctly handled now.
* All sheets are now loaded via <link rel="stylesheet"> instead of a mix of those and @import decls.
IIRC we had used @import originally to hide styles from Netscape 4, which tends to utterly break on MonoBook, but these days that's pretty much a non-issue.
@import also breaks some browsers' ability to save stylesheets with a file to disk, which sucks.
Confirmed that Firefox 3 can now save pages with their styles.
* 'screen, projection' media specifier has been changed to just 'screen' -- projection is something totally different.
* Added experimental options for specifying handheld stylesheets:
/**
* Optionally, we can specify a stylesheet to use for media="handheld".
* This is recognized by some, but not all, handheld/mobile/PDA browsers.
* If left empty, compliant handheld browsers won't pick up the skin
* stylesheet, which is specified for 'screen' media.
*
* Can be a complete URL, base-relative path, or $wgStylePath-relative path.
* Try 'chick/main.css' to apply the Chick styles to the MonoBook HTML.
*
* Will also be switched in when 'handheld=yes' is added to the URL, like
* the 'printable=yes' mode for print media.
*/
$wgHandheldStyle = false;
/**
* If set, 'screen' and 'handheld' media specifiers for stylesheets are
* transformed such that they apply to the iPhone/iPod Touch Mobile Safari,
* which doesn't recognize 'handheld' but does support media queries on its
* screen size.
*
* Consider only using this if you have a *really good* handheld stylesheet,
* as iPhone users won't have any way to disable it and use the "grown-up"
* styles instead.
*/
$wgHandheldForIPhone = false;
2008-07-28 05:09:08 +00:00
|
|
|
$tpl->set( 'handheld', $wgRequest->getBool( 'handheld' ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'loggedin', $this->loggedin );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'notspecialpage', $this->mTitle->getNamespace() != NS_SPECIAL );
|
2004-11-19 04:14:59 +00:00
|
|
|
/* XXX currently unused, might get useful later
|
2005-02-21 11:28:07 +00:00
|
|
|
$tpl->set( "editable", ($this->mTitle->getNamespace() != NS_SPECIAL ) );
|
|
|
|
|
$tpl->set( "exists", $this->mTitle->getArticleID() != 0 );
|
|
|
|
|
$tpl->set( "watch", $this->mTitle->userIsWatching() ? "unwatch" : "watch" );
|
|
|
|
|
$tpl->set( "protect", count($this->mTitle->isProtected()) ? "unprotect" : "protect" );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->set( "helppage", wfMsg('helppage'));
|
|
|
|
|
*/
|
|
|
|
|
$tpl->set( 'searchaction', $this->escapeSearchLink() );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'searchtitle', SpecialPage::getTitleFor( 'Search' )->getPrefixedDBKey() );
|
2005-01-07 03:25:49 +00:00
|
|
|
$tpl->set( 'search', trim( $wgRequest->getVal( 'search' ) ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'stylepath', $wgStylePath );
|
2006-07-28 19:05:27 +00:00
|
|
|
$tpl->setRef( 'articlepath', $wgArticlePath );
|
|
|
|
|
$tpl->setRef( 'scriptpath', $wgScriptPath );
|
|
|
|
|
$tpl->setRef( 'serverurl', $wgServer );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'logopath', $wgLogo );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->setRef( 'lang', $wgContLanguageCode );
|
|
|
|
|
$tpl->set( 'dir', $wgContLang->isRTL() ? 'rtl' : 'ltr' );
|
2006-05-31 20:39:14 +00:00
|
|
|
$tpl->set( 'rtl', $wgContLang->isRTL() );
|
2009-06-17 08:58:49 +00:00
|
|
|
$tpl->set( 'capitalizeallnouns', $wgLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->set( 'langname', $wgContLang->getLanguageName( $wgContLanguageCode ) );
|
2005-10-27 00:11:41 +00:00
|
|
|
$tpl->set( 'showjumplinks', $wgUser->getOption( 'showjumplinks' ) );
|
2006-07-28 19:05:27 +00:00
|
|
|
$tpl->set( 'username', $wgUser->isAnon() ? NULL : $this->username );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->setRef( 'userpage', $this->userpage );
|
|
|
|
|
$tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
|
2006-07-28 19:05:27 +00:00
|
|
|
$tpl->set( 'userlang', $wgLang->getCode() );
|
2009-06-04 03:14:27 +00:00
|
|
|
$tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '"' );
|
2005-09-29 07:55:46 +00:00
|
|
|
$tpl->set( 'pagecss', $this->setupPageCss() );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->setRef( 'usercss', $this->usercss );
|
|
|
|
|
$tpl->setRef( 'userjs', $this->userjs );
|
|
|
|
|
$tpl->setRef( 'userjsprev', $this->userjsprev );
|
2008-07-28 16:54:06 +00:00
|
|
|
if( $wgUseSiteJs ) {
|
2007-07-09 21:39:42 +00:00
|
|
|
$jsCache = $this->loggedin ? '&smaxage=0' : '';
|
|
|
|
|
$tpl->set( 'jsvarurl',
|
2009-03-29 12:46:11 +00:00
|
|
|
self::makeUrl( '-',
|
2007-07-09 21:39:42 +00:00
|
|
|
"action=raw$jsCache&gen=js&useskin=" .
|
|
|
|
|
urlencode( $this->getSkinName() ) ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'jsvarurl', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-06-07 15:02:12 +00:00
|
|
|
|
2006-02-14 21:20:38 +00:00
|
|
|
$newtalks = $wgUser->getNewMessageLinks();
|
2006-02-14 21:10:31 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
if( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
$usertitle = $this->mUser->getUserPage();
|
2004-11-19 04:14:59 +00:00
|
|
|
$usertalktitle = $usertitle->getTalkPage();
|
2009-06-07 15:02:12 +00:00
|
|
|
|
2005-02-21 11:28:07 +00:00
|
|
|
if( !$usertalktitle->equals( $this->mTitle ) ) {
|
2009-06-07 15:02:12 +00:00
|
|
|
$newmessageslink = $this->link(
|
|
|
|
|
$usertalktitle,
|
2009-08-10 19:03:33 +00:00
|
|
|
wfMsgHtml( 'newmessageslink' ),
|
2009-06-07 15:02:12 +00:00
|
|
|
array(),
|
|
|
|
|
array( 'redirect' => 'no' ),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$newmessagesdifflink = $this->link(
|
|
|
|
|
$usertalktitle,
|
2009-08-10 19:03:33 +00:00
|
|
|
wfMsgHtml( 'newmessagesdifflink' ),
|
2009-06-07 15:02:12 +00:00
|
|
|
array(),
|
|
|
|
|
array( 'diff' => 'cur' ),
|
|
|
|
|
array( 'known', 'noclasses' )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$ntl = wfMsg(
|
|
|
|
|
'youhavenewmessages',
|
|
|
|
|
$newmessageslink,
|
2009-08-08 17:34:12 +00:00
|
|
|
$newmessagesdifflink
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
# Disable Cache
|
2009-03-29 12:46:11 +00:00
|
|
|
$out->setSquidMaxage( 0 );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
} else if( count( $newtalks ) ) {
|
2009-07-13 10:34:31 +00:00
|
|
|
// _>" " for BC <= 1.16
|
2009-03-29 12:46:11 +00:00
|
|
|
$sep = str_replace( '_', ' ', wfMsgHtml( 'newtalkseparator' ) );
|
2006-02-14 21:10:31 +00:00
|
|
|
$msgs = array();
|
2009-03-29 12:46:11 +00:00
|
|
|
foreach( $newtalks as $newtalk ) {
|
|
|
|
|
$msgs[] = Xml::element('a',
|
|
|
|
|
array( 'href' => $newtalk['link'] ), $newtalk['wiki'] );
|
2006-02-14 21:10:31 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
$parts = implode( $sep, $msgs );
|
|
|
|
|
$ntl = wfMsgHtml( 'youhavenewmessagesmulti', $parts );
|
|
|
|
|
$out->setSquidMaxage( 0 );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
|
|
|
|
$ntl = '';
|
|
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-stuff2' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-stuff3' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'newtalk', $ntl );
|
2008-07-28 16:54:06 +00:00
|
|
|
$tpl->setRef( 'skin', $this );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->set( 'logo', $this->logoText() );
|
2009-03-29 12:46:11 +00:00
|
|
|
if ( $out->isArticle() and ( !isset( $oldid ) or isset( $diff ) ) and
|
|
|
|
|
$wgArticle and 0 != $wgArticle->getID() ){
|
2008-11-19 12:05:33 +00:00
|
|
|
if ( !$wgDisableCounters ) {
|
|
|
|
|
$viewcount = $wgLang->formatNum( $wgArticle->getCount() );
|
2004-11-19 04:14:59 +00:00
|
|
|
if ( $viewcount ) {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'viewcount', wfMsgExt( 'viewcount', array( 'parseinline' ), $viewcount ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'viewcount', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2005-03-18 07:56:28 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'viewcount', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2004-12-18 03:47:11 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $wgPageShowWatchingUsers ) {
|
2007-01-22 23:50:42 +00:00
|
|
|
$dbr = wfGetDB( DB_SLAVE );
|
Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to be like this: "list ($page, $archive) = $dbw->tableNamesN( 'page', 'archive' );".
Three reasons for this:
1) It's better for analysis tools [which want explicit variable declaration]
2) It's easier for a human to read, as it's completely explicit where the variables came from [which is something you don't get with extract() ]
3) It makes it easier to find everywhere where a variable is used with search/grep [which you can't currently do with $tbl_page variables from things like: "extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl');"].
Otherwise, from a functionality/efficiency perspective the two forms should be identical.
By doing this have been able run static analysis over the usages of these variables, thus eliminating 5 unneeded table names from calls, plus removing 3 unused calls entirely, and it just feels subjectively slightly nicer to me.
2006-11-27 08:36:57 +00:00
|
|
|
$watchlist = $dbr->tableName( 'watchlist' );
|
2009-03-29 12:46:11 +00:00
|
|
|
$res = $dbr->select( 'watchlist',
|
|
|
|
|
array( 'COUNT(*) AS n' ),
|
|
|
|
|
array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ),
|
|
|
|
|
__METHOD__
|
|
|
|
|
);
|
2004-12-18 03:47:11 +00:00
|
|
|
$x = $dbr->fetchObject( $res );
|
|
|
|
|
$numberofwatchingusers = $x->n;
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $numberofwatchingusers > 0 ) {
|
|
|
|
|
$tpl->set( 'numberofwatchingusers',
|
|
|
|
|
wfMsgExt( 'number_of_watching_users_pageview', array( 'parseinline' ),
|
|
|
|
|
$wgLang->formatNum( $numberofwatchingusers ) )
|
2007-11-10 14:52:56 +00:00
|
|
|
);
|
2004-12-18 03:47:11 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'numberofwatchingusers', false );
|
2004-12-18 03:50:47 +00:00
|
|
|
}
|
2004-12-18 03:47:11 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'numberofwatchingusers', false );
|
2004-12-18 03:47:11 +00:00
|
|
|
}
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'copyright', $this->getCopyright() );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
|
|
|
|
$this->credits = false;
|
|
|
|
|
|
2008-08-18 19:21:55 +00:00
|
|
|
if( $wgMaxCredits != 0 ){
|
|
|
|
|
$this->credits = Credits::getCredits( $wgArticle, $wgMaxCredits, $wgShowCreditsIfMax );
|
2005-05-28 06:56:30 +00:00
|
|
|
} else {
|
2008-08-18 19:21:55 +00:00
|
|
|
$tpl->set( 'lastmod', $this->lastModified() );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tpl->setRef( 'credits', $this->credits );
|
|
|
|
|
|
|
|
|
|
} elseif ( isset( $oldid ) && !isset( $diff ) ) {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'copyright', $this->getCopyright() );
|
|
|
|
|
$tpl->set( 'viewcount', false );
|
|
|
|
|
$tpl->set( 'lastmod', false );
|
|
|
|
|
$tpl->set( 'credits', false );
|
|
|
|
|
$tpl->set( 'numberofwatchingusers', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'copyright', false );
|
|
|
|
|
$tpl->set( 'viewcount', false );
|
|
|
|
|
$tpl->set( 'lastmod', false );
|
|
|
|
|
$tpl->set( 'credits', false );
|
|
|
|
|
$tpl->set( 'numberofwatchingusers', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-stuff3' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-stuff4' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->set( 'copyrightico', $this->getCopyrightIcon() );
|
|
|
|
|
$tpl->set( 'poweredbyico', $this->getPoweredBy() );
|
|
|
|
|
$tpl->set( 'disclaimer', $this->disclaimerLink() );
|
2005-11-29 20:25:20 +00:00
|
|
|
$tpl->set( 'privacy', $this->privacyLink() );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->set( 'about', $this->aboutLink() );
|
|
|
|
|
|
|
|
|
|
$tpl->setRef( 'debug', $out->mDebugtext );
|
2008-03-24 15:04:55 +00:00
|
|
|
$tpl->set( 'reporttime', wfReportTime() );
|
2005-03-27 16:56:11 +00:00
|
|
|
$tpl->set( 'sitenotice', wfGetSiteNotice() );
|
2006-07-29 22:34:22 +00:00
|
|
|
$tpl->set( 'bottomscripts', $this->bottomScripts() );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
|
|
|
|
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
|
2009-02-08 23:39:17 +00:00
|
|
|
$out->mBodytext .= $printfooter . $this->generateDebugHTML();
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->setRef( 'bodytext', $out->mBodytext );
|
|
|
|
|
|
|
|
|
|
# Language links
|
|
|
|
|
$language_urls = array();
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2005-05-28 06:56:30 +00:00
|
|
|
if ( !$wgHideInterlanguageLinks ) {
|
2008-08-21 14:09:57 +00:00
|
|
|
foreach( $out->getLanguageLinks() as $l ) {
|
2005-08-09 12:25:07 +00:00
|
|
|
$tmp = explode( ':', $l, 2 );
|
|
|
|
|
$class = 'interwiki-' . $tmp[0];
|
2009-03-29 12:46:11 +00:00
|
|
|
unset( $tmp );
|
2005-05-28 06:56:30 +00:00
|
|
|
$nt = Title::newFromText( $l );
|
2008-09-04 06:37:51 +00:00
|
|
|
if ( $nt ) {
|
|
|
|
|
$language_urls[] = array(
|
|
|
|
|
'href' => $nt->getFullURL(),
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => ( $wgContLang->getLanguageName( $nt->getInterwiki() ) != '' ?
|
|
|
|
|
$wgContLang->getLanguageName( $nt->getInterwiki() ) : $l ),
|
2009-01-17 08:56:27 +00:00
|
|
|
'class' => $class
|
2008-09-04 06:37:51 +00:00
|
|
|
);
|
|
|
|
|
}
|
2005-05-28 06:56:30 +00:00
|
|
|
}
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
if( count( $language_urls ) ) {
|
|
|
|
|
$tpl->setRef( 'language_urls', $language_urls );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'language_urls', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-stuff4' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-stuff5' );
|
2004-11-19 04:14:59 +00:00
|
|
|
# Personal toolbar
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'personal_urls', $this->buildPersonalUrls() );
|
2004-11-19 04:14:59 +00:00
|
|
|
$content_actions = $this->buildContentActionUrls();
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->setRef( 'content_actions', $content_actions );
|
2004-11-22 06:50:37 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
// XXX: attach this from javascript, same with section editing
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $this->iseditable && $wgUser->getOption( 'editondblclick' ) ){
|
2008-12-14 19:14:21 +00:00
|
|
|
$encEditUrl = Xml::escapeJsString( $this->mTitle->getLocalUrl( $this->editUrlOptions() ) );
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'body_ondblclick', 'document.location = "' . $encEditUrl . '";' );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'body_ondblclick', false );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2008-05-12 23:37:51 +00:00
|
|
|
$tpl->set( 'body_onload', false );
|
2005-05-24 20:06:52 +00:00
|
|
|
$tpl->set( 'sidebar', $this->buildSidebar() );
|
2004-11-19 04:14:59 +00:00
|
|
|
$tpl->set( 'nav_urls', $this->buildNavUrls() );
|
|
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
//set the head script near the end (in case above actions result in adding scripts)
|
|
|
|
|
$tpl->set( 'headscripts', $out->getScript() );
|
|
|
|
|
|
2007-01-10 15:23:32 +00:00
|
|
|
// original version by hansm
|
|
|
|
|
if( !wfRunHooks( 'SkinTemplateOutputPageBeforeExec', array( &$this, &$tpl ) ) ) {
|
2009-01-13 20:28:54 +00:00
|
|
|
wfDebug( __METHOD__ . ": Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!\n" );
|
2007-01-10 15:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
2008-08-08 15:53:49 +00:00
|
|
|
// allow extensions adding stuff after the page content.
|
|
|
|
|
// See Skin::afterContentHook() for further documentation.
|
2009-03-29 12:46:11 +00:00
|
|
|
$tpl->set( 'dataAfterContent', $this->afterContentHook() );
|
|
|
|
|
wfProfileOut( __METHOD__ . '-stuff5' );
|
2008-08-08 15:53:49 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
// execute template
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-execute' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$res = $tpl->execute();
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-execute' );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
// result may be an error
|
2004-11-19 07:37:46 +00:00
|
|
|
$this->printOrError( $res );
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 07:37:46 +00:00
|
|
|
/**
|
|
|
|
|
* Output the string, or print error message if it's
|
|
|
|
|
* an error object of the appropriate type.
|
2004-11-19 12:44:51 +00:00
|
|
|
* For the base class, assume strings all around.
|
2004-11-19 07:37:46 +00:00
|
|
|
*
|
|
|
|
|
* @param mixed $str
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 07:37:46 +00:00
|
|
|
*/
|
2007-01-12 10:03:51 +00:00
|
|
|
function printOrError( $str ) {
|
2004-11-19 07:37:46 +00:00
|
|
|
echo $str;
|
|
|
|
|
}
|
2004-11-19 04:14:59 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* build array of urls for personal toolbar
|
2004-11-19 12:44:51 +00:00
|
|
|
* @return array
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
|
|
|
|
function buildPersonalUrls() {
|
2009-08-10 19:03:33 +00:00
|
|
|
global $wgOut, $wgRequest;
|
2005-10-12 01:13:46 +00:00
|
|
|
|
2009-04-09 02:22:36 +00:00
|
|
|
$title = $wgOut->getTitle();
|
|
|
|
|
$pageurl = $title->getLocalURL();
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/* set up the default links for the personal toolbar */
|
|
|
|
|
$personal_urls = array();
|
2009-07-26 10:34:03 +00:00
|
|
|
$page = $wgRequest->getVal( 'returnto', $this->thisurl );
|
|
|
|
|
$query = $wgRequest->getVal( 'returntoquery', $this->thisquery );
|
|
|
|
|
$returnto = "returnto=$page";
|
|
|
|
|
if( $this->thisquery != '' )
|
|
|
|
|
$returnto .= "&returntoquery=$query";
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $this->loggedin ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$personal_urls['userpage'] = array(
|
2005-04-30 11:14:11 +00:00
|
|
|
'text' => $this->username,
|
|
|
|
|
'href' => &$this->userpageUrlDetails['href'],
|
2009-03-29 12:46:11 +00:00
|
|
|
'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
|
2005-10-12 01:13:46 +00:00
|
|
|
'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2009-03-29 12:46:11 +00:00
|
|
|
$usertalkUrlDetails = $this->makeTalkUrlDetails( $this->userpage );
|
2004-11-19 04:14:59 +00:00
|
|
|
$personal_urls['mytalk'] = array(
|
2009-08-10 19:03:33 +00:00
|
|
|
'text' => wfMsg( 'mytalk' ),
|
2005-04-30 11:14:11 +00:00
|
|
|
'href' => &$usertalkUrlDetails['href'],
|
2009-03-29 12:46:11 +00:00
|
|
|
'class' => $usertalkUrlDetails['exists'] ? false : 'new',
|
2005-10-12 01:13:46 +00:00
|
|
|
'active' => ( $usertalkUrlDetails['href'] == $pageurl )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2006-09-22 13:07:06 +00:00
|
|
|
$href = self::makeSpecialUrl( 'Preferences' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$personal_urls['preferences'] = array(
|
2006-09-22 13:07:06 +00:00
|
|
|
'text' => wfMsg( 'mypreferences' ),
|
2007-04-10 10:30:05 +00:00
|
|
|
'href' => $href,
|
2005-10-12 01:13:46 +00:00
|
|
|
'active' => ( $href == $pageurl )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2006-09-22 13:07:06 +00:00
|
|
|
$href = self::makeSpecialUrl( 'Watchlist' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$personal_urls['watchlist'] = array(
|
2007-04-20 15:04:50 +00:00
|
|
|
'text' => wfMsg( 'mywatchlist' ),
|
2005-10-12 01:13:46 +00:00
|
|
|
'href' => $href,
|
|
|
|
|
'active' => ( $href == $pageurl )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-04-02 06:27:55 +00:00
|
|
|
# We need to do an explicit check for Special:Contributions, as we
|
|
|
|
|
# have to match both the title, and the target (which could come
|
|
|
|
|
# from request values or be specified in "sub page" form. The plot
|
|
|
|
|
# thickens, because $wgTitle is altered for special pages, so doesn't
|
|
|
|
|
# contain the original alias-with-subpage.
|
2009-04-09 10:28:55 +00:00
|
|
|
$origTitle = Title::newFromText( $wgRequest->getText( 'title' ) );
|
|
|
|
|
if( $origTitle instanceof Title && $origTitle->getNamespace() == NS_SPECIAL ) {
|
2007-04-02 06:27:55 +00:00
|
|
|
list( $spName, $spPar ) =
|
2009-04-09 10:28:55 +00:00
|
|
|
SpecialPage::resolveAliasWithSubpage( $origTitle->getText() );
|
2007-04-02 06:27:55 +00:00
|
|
|
$active = $spName == 'Contributions'
|
|
|
|
|
&& ( ( $spPar && $spPar == $this->username )
|
|
|
|
|
|| $wgRequest->getText( 'target' ) == $this->username );
|
|
|
|
|
} else {
|
|
|
|
|
$active = false;
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-12-18 00:20:21 +00:00
|
|
|
$href = self::makeSpecialUrlSubpage( 'Contributions', $this->username );
|
2004-11-19 04:14:59 +00:00
|
|
|
$personal_urls['mycontris'] = array(
|
2006-09-22 13:07:06 +00:00
|
|
|
'text' => wfMsg( 'mycontris' ),
|
2006-11-29 05:45:03 +00:00
|
|
|
'href' => $href,
|
2007-04-02 06:27:55 +00:00
|
|
|
'active' => $active
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
$personal_urls['logout'] = array(
|
2006-09-22 13:07:06 +00:00
|
|
|
'text' => wfMsg( 'userlogout' ),
|
|
|
|
|
'href' => self::makeSpecialUrl( 'Userlogout',
|
2009-07-26 10:34:03 +00:00
|
|
|
$title->isSpecial( 'Preferences' ) ? '' : $returnto
|
2006-11-29 05:45:03 +00:00
|
|
|
),
|
|
|
|
|
'active' => false
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
} else {
|
2008-04-18 15:46:54 +00:00
|
|
|
global $wgUser;
|
|
|
|
|
$loginlink = $wgUser->isAllowed( 'createaccount' )
|
|
|
|
|
? 'nav-login-createaccount'
|
|
|
|
|
: 'login';
|
2007-02-05 21:42:48 +00:00
|
|
|
if( $this->showIPinHeader() ) {
|
2005-10-12 01:13:46 +00:00
|
|
|
$href = &$this->userpageUrlDetails['href'];
|
2004-11-19 04:14:59 +00:00
|
|
|
$personal_urls['anonuserpage'] = array(
|
2005-04-30 11:14:11 +00:00
|
|
|
'text' => $this->username,
|
2005-10-12 01:13:46 +00:00
|
|
|
'href' => $href,
|
2009-03-29 12:46:11 +00:00
|
|
|
'class' => $this->userpageUrlDetails['exists'] ? false : 'new',
|
2005-10-12 01:13:46 +00:00
|
|
|
'active' => ( $pageurl == $href )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2009-03-29 12:46:11 +00:00
|
|
|
$usertalkUrlDetails = $this->makeTalkUrlDetails( $this->userpage );
|
2005-10-12 01:13:46 +00:00
|
|
|
$href = &$usertalkUrlDetails['href'];
|
2005-04-30 11:14:11 +00:00
|
|
|
$personal_urls['anontalk'] = array(
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'anontalk' ),
|
2005-10-12 01:13:46 +00:00
|
|
|
'href' => $href,
|
2009-03-29 12:46:11 +00:00
|
|
|
'class' => $usertalkUrlDetails['exists'] ? false : 'new',
|
2005-10-12 01:13:46 +00:00
|
|
|
'active' => ( $pageurl == $href )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
$personal_urls['anonlogin'] = array(
|
2008-04-18 15:46:54 +00:00
|
|
|
'text' => wfMsg( $loginlink ),
|
2009-07-26 10:34:03 +00:00
|
|
|
'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
|
2009-04-09 02:22:36 +00:00
|
|
|
'active' => $title->isSpecial( 'Userlogin' )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
$personal_urls['login'] = array(
|
2008-04-18 15:46:54 +00:00
|
|
|
'text' => wfMsg( $loginlink ),
|
2009-07-26 10:34:03 +00:00
|
|
|
'href' => self::makeSpecialUrl( 'Userlogin', $returnto ),
|
2009-04-09 02:22:36 +00:00
|
|
|
'active' => $title->isSpecial( 'Userlogin' )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
|
2009-04-09 02:22:36 +00:00
|
|
|
wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title ) );
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2004-11-19 04:14:59 +00:00
|
|
|
return $personal_urls;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
function tabAction( $title, $message, $selected, $query = '', $checkEdit = false ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
$classes = array();
|
|
|
|
|
if( $selected ) {
|
|
|
|
|
$classes[] = 'selected';
|
|
|
|
|
}
|
2008-12-13 04:14:40 +00:00
|
|
|
if( $checkEdit && !$title->isKnown() ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
$classes[] = 'new';
|
2009-01-06 15:38:26 +00:00
|
|
|
$query = 'action=edit&redlink=1';
|
2005-02-21 11:28:07 +00:00
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2005-08-27 03:47:47 +00:00
|
|
|
$text = wfMsg( $message );
|
2006-09-11 12:22:35 +00:00
|
|
|
if ( wfEmptyMsg( $message, $text ) ) {
|
2006-04-02 22:59:26 +00:00
|
|
|
global $wgContLang;
|
2008-03-21 23:13:34 +00:00
|
|
|
$text = $wgContLang->getFormattedNsText( MWNamespace::getSubject( $title->getNamespace() ) );
|
2005-08-27 03:47:47 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-10-17 03:53:58 +00:00
|
|
|
$result = array();
|
2009-03-29 12:46:11 +00:00
|
|
|
if( !wfRunHooks( 'SkinTemplateTabAction', array( &$this,
|
2008-10-26 01:47:07 +00:00
|
|
|
$title, $message, $selected, $checkEdit,
|
2009-03-29 12:46:11 +00:00
|
|
|
&$classes, &$query, &$text, &$result ) ) ) {
|
2007-10-17 03:53:58 +00:00
|
|
|
return $result;
|
|
|
|
|
}
|
2007-10-16 20:29:11 +00:00
|
|
|
|
2005-02-21 11:28:07 +00:00
|
|
|
return array(
|
|
|
|
|
'class' => implode( ' ', $classes ),
|
2005-08-27 03:47:47 +00:00
|
|
|
'text' => $text,
|
2005-02-21 11:28:07 +00:00
|
|
|
'href' => $title->getLocalUrl( $query ) );
|
|
|
|
|
}
|
2005-04-30 11:14:11 +00:00
|
|
|
|
2006-09-22 13:18:51 +00:00
|
|
|
function makeTalkUrlDetails( $name, $urlaction = '' ) {
|
2005-04-30 11:14:11 +00:00
|
|
|
$title = Title::newFromText( $name );
|
2009-03-29 12:46:11 +00:00
|
|
|
if( !is_object( $title ) ) {
|
|
|
|
|
throw new MWException( __METHOD__ . " given invalid pagename $name" );
|
2007-02-23 04:45:23 +00:00
|
|
|
}
|
2005-04-30 11:14:11 +00:00
|
|
|
$title = $title->getTalkPage();
|
2006-09-22 13:18:51 +00:00
|
|
|
self::checkTitle( $title, $name );
|
2005-04-30 11:14:11 +00:00
|
|
|
return array(
|
|
|
|
|
'href' => $title->getLocalURL( $urlaction ),
|
2006-09-22 13:18:51 +00:00
|
|
|
'exists' => $title->getArticleID() != 0 ? true : false
|
2005-04-30 11:14:11 +00:00
|
|
|
);
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2006-09-22 13:18:51 +00:00
|
|
|
function makeArticleUrlDetails( $name, $urlaction = '' ) {
|
2005-04-30 11:14:11 +00:00
|
|
|
$title = Title::newFromText( $name );
|
|
|
|
|
$title= $title->getSubjectPage();
|
2006-09-22 13:07:06 +00:00
|
|
|
self::checkTitle( $title, $name );
|
2005-04-30 11:14:11 +00:00
|
|
|
return array(
|
|
|
|
|
'href' => $title->getLocalURL( $urlaction ),
|
2006-09-22 13:18:51 +00:00
|
|
|
'exists' => $title->getArticleID() != 0 ? true : false
|
2005-04-30 11:14:11 +00:00
|
|
|
);
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**
|
|
|
|
|
* an array of edit links by default used for the tabs
|
2004-11-19 12:44:51 +00:00
|
|
|
* @return array
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2008-08-21 14:09:57 +00:00
|
|
|
function buildContentActionUrls() {
|
2009-06-13 14:27:16 +00:00
|
|
|
global $wgContLang, $wgLang, $wgOut, $wgUser, $wgRequest, $wgArticle;
|
2009-02-14 17:09:57 +00:00
|
|
|
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2009-02-14 17:09:57 +00:00
|
|
|
$action = $wgRequest->getVal( 'action', 'view' );
|
|
|
|
|
$section = $wgRequest->getVal( 'section' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$content_actions = array();
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
$prevent_active_tabs = false;
|
|
|
|
|
wfRunHooks( 'SkinTemplatePreventOtherActiveTabs', array( &$this, &$prevent_active_tabs ) );
|
2005-12-11 13:06:10 +00:00
|
|
|
|
2004-12-04 05:03:19 +00:00
|
|
|
if( $this->iscontent ) {
|
2005-08-02 13:35:19 +00:00
|
|
|
$subjpage = $this->mTitle->getSubjectPage();
|
|
|
|
|
$talkpage = $this->mTitle->getTalkPage();
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2006-03-16 02:51:11 +00:00
|
|
|
$nskey = $this->mTitle->getNamespaceKey();
|
2005-02-21 11:28:07 +00:00
|
|
|
$content_actions[$nskey] = $this->tabAction(
|
2005-08-02 13:35:19 +00:00
|
|
|
$subjpage,
|
2005-02-21 11:28:07 +00:00
|
|
|
$nskey,
|
2005-12-11 13:06:10 +00:00
|
|
|
!$this->mTitle->isTalkPage() && !$prevent_active_tabs,
|
2009-03-29 12:46:11 +00:00
|
|
|
'', true
|
|
|
|
|
);
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2005-02-21 11:28:07 +00:00
|
|
|
$content_actions['talk'] = $this->tabAction(
|
2005-08-02 13:35:19 +00:00
|
|
|
$talkpage,
|
2005-02-21 11:28:07 +00:00
|
|
|
'talk',
|
2005-12-11 13:06:10 +00:00
|
|
|
$this->mTitle->isTalkPage() && !$prevent_active_tabs,
|
2005-02-21 11:28:07 +00:00
|
|
|
'',
|
2009-03-29 12:46:11 +00:00
|
|
|
true
|
|
|
|
|
);
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-edit' );
|
2007-01-20 17:58:38 +00:00
|
|
|
if ( $this->mTitle->quickUserCan( 'edit' ) && ( $this->mTitle->exists() || $this->mTitle->quickUserCan( 'create' ) ) ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
$istalk = $this->mTitle->isTalkPage();
|
2004-11-19 04:14:59 +00:00
|
|
|
$istalkclass = $istalk?' istalk':'';
|
|
|
|
|
$content_actions['edit'] = array(
|
2009-03-29 12:46:11 +00:00
|
|
|
'class' => ( ( ( $action == 'edit' or $action == 'submit' ) and $section != 'new' ) ? 'selected' : '' ) . $istalkclass,
|
2008-03-14 13:23:48 +00:00
|
|
|
'text' => $this->mTitle->exists()
|
|
|
|
|
? wfMsg( 'edit' )
|
|
|
|
|
: wfMsg( 'create' ),
|
2005-12-01 09:47:44 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2005-02-21 11:28:07 +00:00
|
|
|
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
// adds new section link if page is a current revision of a talk page or
|
2009-06-19 03:27:04 +00:00
|
|
|
if ( ( $wgArticle && $wgArticle->isCurrent() && $istalk ) || $wgOut->showNewSectionLink() ) {
|
2009-02-19 22:14:59 +00:00
|
|
|
if ( !$wgOut->forceHideNewSectionLink() ) {
|
|
|
|
|
$content_actions['addsection'] = array(
|
|
|
|
|
'class' => $section == 'new' ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'addsection' ),
|
2009-02-19 22:14:59 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=edit§ion=new' )
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
);
|
2009-02-19 22:14:59 +00:00
|
|
|
}
|
here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview
= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions
== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php
* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)
== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.
= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader
* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.
= js2 system / mwEmbed=
$wgEnableJS2system = false
* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)
* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.
= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)
== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.
== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
|
|
|
}
|
2008-12-13 04:14:40 +00:00
|
|
|
} elseif ( $this->mTitle->isKnown() ) {
|
2004-11-22 06:50:37 +00:00
|
|
|
$content_actions['viewsource'] = array(
|
|
|
|
|
'class' => ($action == 'edit') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'viewsource' ),
|
2005-12-01 09:47:44 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
|
2004-11-22 06:50:37 +00:00
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-edit' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileIn( __METHOD__ . '-live' );
|
2008-08-20 08:24:10 +00:00
|
|
|
if ( $this->mTitle->exists() ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2004-11-22 06:50:37 +00:00
|
|
|
$content_actions['history'] = array(
|
|
|
|
|
'class' => ($action == 'history') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'history_short' ),
|
2009-01-22 00:11:23 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=history' ),
|
|
|
|
|
'rel' => 'archives',
|
2004-11-22 06:50:37 +00:00
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $wgUser->isAllowed( 'delete' ) ) {
|
2007-12-11 09:51:56 +00:00
|
|
|
$content_actions['delete'] = array(
|
|
|
|
|
'class' => ($action == 'delete') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'delete' ),
|
2007-12-11 09:51:56 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=delete' )
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
if ( $this->mTitle->quickUserCan( 'move' ) ) {
|
|
|
|
|
$moveTitle = SpecialPage::getTitleFor( 'Movepage', $this->thispage );
|
|
|
|
|
$content_actions['move'] = array(
|
|
|
|
|
'class' => $this->mTitle->isSpecial( 'Movepage' ) ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'move' ),
|
2007-12-11 09:51:56 +00:00
|
|
|
'href' => $moveTitle->getLocalUrl()
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2005-12-08 17:44:35 +00:00
|
|
|
if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) {
|
2008-08-20 08:24:10 +00:00
|
|
|
if( !$this->mTitle->isProtected() ){
|
2004-11-19 04:14:59 +00:00
|
|
|
$content_actions['protect'] = array(
|
|
|
|
|
'class' => ($action == 'protect') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'protect' ),
|
2005-02-21 11:28:07 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=protect' )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$content_actions['unprotect'] = array(
|
|
|
|
|
'class' => ($action == 'unprotect') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'unprotect' ),
|
2005-02-21 11:28:07 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=unprotect' )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//article doesn't exist or is deleted
|
2007-12-31 21:09:43 +00:00
|
|
|
if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'undelete' ) ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
if( $n = $this->mTitle->isDeleted() ) {
|
2006-10-30 06:25:31 +00:00
|
|
|
$undelTitle = SpecialPage::getTitleFor( 'Undelete' );
|
2004-11-19 04:14:59 +00:00
|
|
|
$content_actions['undelete'] = array(
|
|
|
|
|
'class' => false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsgExt( 'undelete_short', array( 'parsemag' ), $wgLang->formatNum( $n ) ),
|
2006-04-17 17:18:26 +00:00
|
|
|
'href' => $undelTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
|
2006-09-22 13:07:06 +00:00
|
|
|
#'href' => self::makeSpecialUrl( "Undelete/$this->thispage" )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-12-11 09:51:56 +00:00
|
|
|
|
|
|
|
|
if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) {
|
2008-01-11 04:55:48 +00:00
|
|
|
if( !$this->mTitle->getRestrictions( 'create' ) ) {
|
2007-12-11 09:51:56 +00:00
|
|
|
$content_actions['protect'] = array(
|
|
|
|
|
'class' => ($action == 'protect') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'protect' ),
|
2007-12-11 09:51:56 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=protect' )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$content_actions['unprotect'] = array(
|
|
|
|
|
'class' => ($action == 'unprotect') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'unprotect' ),
|
2007-12-11 09:51:56 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=unprotect' )
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2007-12-11 09:51:56 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfProfileOut( __METHOD__ . '-live' );
|
2004-12-24 02:47:38 +00:00
|
|
|
|
2008-01-15 16:04:50 +00:00
|
|
|
if( $this->loggedin ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
if( !$this->mTitle->userIsWatching()) {
|
2004-11-22 06:50:37 +00:00
|
|
|
$content_actions['watch'] = array(
|
|
|
|
|
'class' => ($action == 'watch' or $action == 'unwatch') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'watch' ),
|
2005-02-21 11:28:07 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=watch' )
|
2004-11-22 06:50:37 +00:00
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2004-11-22 06:50:37 +00:00
|
|
|
$content_actions['unwatch'] = array(
|
|
|
|
|
'class' => ($action == 'unwatch' or $action == 'watch') ? 'selected' : false,
|
2009-03-29 12:46:11 +00:00
|
|
|
'text' => wfMsg( 'unwatch' ),
|
2005-02-21 11:28:07 +00:00
|
|
|
'href' => $this->mTitle->getLocalUrl( 'action=unwatch' )
|
2004-11-22 06:50:37 +00:00
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2005-05-23 21:01:02 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
wfRunHooks( 'SkinTemplateTabs', array( &$this, &$content_actions ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
|
|
|
|
/* show special page tab */
|
|
|
|
|
|
2006-10-16 00:37:18 +00:00
|
|
|
$content_actions[$this->mTitle->getNamespaceKey()] = array(
|
2004-11-22 06:50:37 +00:00
|
|
|
'class' => 'selected',
|
2007-01-15 06:11:58 +00:00
|
|
|
'text' => wfMsg('nstab-special'),
|
2005-06-25 00:50:34 +00:00
|
|
|
'href' => $wgRequest->getRequestURL(), // @bug 2457, 2510
|
2004-11-22 06:50:37 +00:00
|
|
|
);
|
2005-12-15 21:05:58 +00:00
|
|
|
|
|
|
|
|
wfRunHooks( 'SkinTemplateBuildContentActionUrlsAfterSpecialPage', array( &$this, &$content_actions ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
|
2004-12-24 02:47:38 +00:00
|
|
|
/* show links to different language variants */
|
2009-06-04 09:48:11 +00:00
|
|
|
global $wgDisableLangConversion;
|
2004-12-24 02:47:38 +00:00
|
|
|
$variants = $wgContLang->getVariants();
|
2009-06-04 09:48:11 +00:00
|
|
|
if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
|
2004-12-24 02:47:38 +00:00
|
|
|
$preferred = $wgContLang->getPreferredVariant();
|
|
|
|
|
$vcount=0;
|
|
|
|
|
foreach( $variants as $code ) {
|
|
|
|
|
$varname = $wgContLang->getVariantname( $code );
|
|
|
|
|
if( $varname == 'disable' )
|
|
|
|
|
continue;
|
|
|
|
|
$selected = ( $code == $preferred )? 'selected' : false;
|
|
|
|
|
$content_actions['varlang-' . $vcount] = array(
|
2009-03-29 12:46:11 +00:00
|
|
|
'class' => $selected,
|
|
|
|
|
'text' => $varname,
|
|
|
|
|
'href' => $this->mTitle->getLocalURL( '', $code )
|
|
|
|
|
);
|
2004-12-24 02:47:38 +00:00
|
|
|
$vcount ++;
|
|
|
|
|
}
|
2005-06-22 22:59:39 +00:00
|
|
|
}
|
2004-12-24 02:47:38 +00:00
|
|
|
|
2005-08-26 14:16:16 +00:00
|
|
|
wfRunHooks( 'SkinTemplateContentActions', array( &$content_actions ) );
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2004-11-19 04:14:59 +00:00
|
|
|
return $content_actions;
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**
|
|
|
|
|
* build array of common navigation links
|
2004-11-19 12:44:51 +00:00
|
|
|
* @return array
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2008-08-21 14:09:57 +00:00
|
|
|
function buildNavUrls() {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest;
|
2008-03-24 15:04:55 +00:00
|
|
|
global $wgEnableUploads, $wgUploadNavigationUrl;
|
2005-07-23 05:47:25 +00:00
|
|
|
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2009-02-14 17:09:57 +00:00
|
|
|
$action = $wgRequest->getVal( 'action', 'view' );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
$nav_urls = array();
|
2006-12-03 00:22:14 +00:00
|
|
|
$nav_urls['mainpage'] = array( 'href' => self::makeMainPageUrl() );
|
2009-05-24 20:45:31 +00:00
|
|
|
if( $wgUploadNavigationUrl ) {
|
|
|
|
|
$nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
|
|
|
|
|
} elseif( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
|
|
|
|
|
$nav_urls['upload'] = array( 'href' => self::makeSpecialUrl( 'Upload' ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-05-24 20:45:31 +00:00
|
|
|
$nav_urls['upload'] = false;
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2006-09-22 13:07:06 +00:00
|
|
|
$nav_urls['specialpages'] = array( 'href' => self::makeSpecialUrl( 'Specialpages' ) );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2006-11-29 05:45:03 +00:00
|
|
|
// default permalink to being off, will override it as required below.
|
|
|
|
|
$nav_urls['permalink'] = false;
|
2007-01-15 06:11:58 +00:00
|
|
|
|
2005-06-28 18:04:09 +00:00
|
|
|
// A print stylesheet is attached to all pages, but nobody ever
|
|
|
|
|
// figures that out. :) Add a link...
|
2009-02-14 17:09:57 +00:00
|
|
|
if( $this->iscontent && ( $action == 'view' || $action == 'purge' ) ) {
|
2009-07-02 09:27:33 +00:00
|
|
|
if ( !$wgRequest->getBool( 'printable' ) ) {
|
|
|
|
|
$nav_urls['print'] = array(
|
|
|
|
|
'text' => wfMsg( 'printableversion' ),
|
|
|
|
|
'href' => $wgRequest->appendQuery( 'printable=yes' )
|
|
|
|
|
);
|
|
|
|
|
}
|
2005-08-23 17:25:22 +00:00
|
|
|
|
|
|
|
|
// Also add a "permalink" while we're at it
|
2007-05-03 06:08:12 +00:00
|
|
|
if ( $this->mRevisionId ) {
|
2005-08-23 17:25:22 +00:00
|
|
|
$nav_urls['permalink'] = array(
|
|
|
|
|
'text' => wfMsg( 'permalink' ),
|
2009-04-09 02:22:36 +00:00
|
|
|
'href' => $wgOut->getTitle()->getLocalURL( "oldid=$this->mRevisionId" )
|
2005-09-28 13:52:22 +00:00
|
|
|
);
|
2005-08-23 17:25:22 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-05-03 06:08:12 +00:00
|
|
|
// Copy in case this undocumented, shady hook tries to mess with internals
|
|
|
|
|
$revid = $this->mRevisionId;
|
|
|
|
|
wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( &$this, &$nav_urls, &$revid, &$revid ) );
|
2005-06-28 18:04:09 +00:00
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2006-04-16 19:17:02 +00:00
|
|
|
if( $this->mTitle->getNamespace() != NS_SPECIAL ) {
|
2006-10-30 06:25:31 +00:00
|
|
|
$wlhTitle = SpecialPage::getTitleFor( 'Whatlinkshere', $this->thispage );
|
2005-05-07 07:23:46 +00:00
|
|
|
$nav_urls['whatlinkshere'] = array(
|
2006-10-30 06:25:31 +00:00
|
|
|
'href' => $wlhTitle->getLocalUrl()
|
2005-05-07 07:23:46 +00:00
|
|
|
);
|
2005-12-11 19:10:53 +00:00
|
|
|
if( $this->mTitle->getArticleId() ) {
|
2006-10-30 06:25:31 +00:00
|
|
|
$rclTitle = SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage );
|
2005-12-11 19:10:53 +00:00
|
|
|
$nav_urls['recentchangeslinked'] = array(
|
2006-10-30 06:25:31 +00:00
|
|
|
'href' => $rclTitle->getLocalUrl()
|
2005-12-11 19:10:53 +00:00
|
|
|
);
|
2006-11-29 05:45:03 +00:00
|
|
|
} else {
|
|
|
|
|
$nav_urls['recentchangeslinked'] = false;
|
2005-12-11 19:10:53 +00:00
|
|
|
}
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $wgUseTrackbacks )
|
2005-07-23 05:47:25 +00:00
|
|
|
$nav_urls['trackbacklink'] = array(
|
2009-04-09 02:22:36 +00:00
|
|
|
'href' => $wgOut->getTitle()->trackbackURL()
|
2005-07-23 05:47:25 +00:00
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
|
2005-02-21 11:28:07 +00:00
|
|
|
if( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
|
2009-03-29 12:46:11 +00:00
|
|
|
$id = User::idFromName( $this->mTitle->getText() );
|
|
|
|
|
$ip = User::isIP( $this->mTitle->getText() );
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
|
|
|
|
$id = 0;
|
|
|
|
|
$ip = false;
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-29 12:46:11 +00:00
|
|
|
if( $id || $ip ) { # both anons and non-anons have contribs list
|
2004-11-19 04:14:59 +00:00
|
|
|
$nav_urls['contributions'] = array(
|
2006-12-18 00:20:21 +00:00
|
|
|
'href' => self::makeSpecialUrlSubpage( 'Contributions', $this->mTitle->getText() )
|
2004-11-19 04:14:59 +00:00
|
|
|
);
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-07-11 01:26:27 +00:00
|
|
|
if( $id ) {
|
|
|
|
|
$logPage = SpecialPage::getTitleFor( 'Log' );
|
2009-06-15 12:32:59 +00:00
|
|
|
$nav_urls['log'] = array(
|
|
|
|
|
'href' => $logPage->getLocalUrl(
|
|
|
|
|
array(
|
|
|
|
|
'user' => $this->mTitle->getText()
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
2007-07-11 01:26:27 +00:00
|
|
|
} else {
|
|
|
|
|
$nav_urls['log'] = false;
|
|
|
|
|
}
|
2007-07-11 07:29:53 +00:00
|
|
|
|
2006-11-29 05:45:03 +00:00
|
|
|
if ( $wgUser->isAllowed( 'block' ) ) {
|
2005-10-24 00:31:02 +00:00
|
|
|
$nav_urls['blockip'] = array(
|
2006-12-18 00:20:21 +00:00
|
|
|
'href' => self::makeSpecialUrlSubpage( 'Blockip', $this->mTitle->getText() )
|
2007-01-15 06:11:58 +00:00
|
|
|
);
|
2006-11-29 05:45:03 +00:00
|
|
|
} else {
|
|
|
|
|
$nav_urls['blockip'] = false;
|
|
|
|
|
}
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
|
|
|
|
$nav_urls['contributions'] = false;
|
2007-07-11 01:26:27 +00:00
|
|
|
$nav_urls['log'] = false;
|
2006-11-29 05:45:03 +00:00
|
|
|
$nav_urls['blockip'] = false;
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
$nav_urls['emailuser'] = false;
|
2004-11-25 05:31:49 +00:00
|
|
|
if( $this->showEmailUser( $id ) ) {
|
|
|
|
|
$nav_urls['emailuser'] = array(
|
2006-12-18 00:20:21 +00:00
|
|
|
'href' => self::makeSpecialUrlSubpage( 'Emailuser', $this->mTitle->getText() )
|
2004-11-25 05:31:49 +00:00
|
|
|
);
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2004-11-19 04:14:59 +00:00
|
|
|
return $nav_urls;
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-20 08:25:34 +00:00
|
|
|
/**
|
|
|
|
|
* Generate strings used for xml 'id' names
|
|
|
|
|
* @return string
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2006-03-20 08:25:34 +00:00
|
|
|
*/
|
2008-08-21 14:09:57 +00:00
|
|
|
function getNameSpaceKey() {
|
2006-03-20 08:25:34 +00:00
|
|
|
return $this->mTitle->getNamespaceKey();
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-19 04:14:59 +00:00
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-19 04:14:59 +00:00
|
|
|
*/
|
2007-05-08 20:48:02 +00:00
|
|
|
function setupUserJs( $allowUserJs ) {
|
2009-02-14 17:09:57 +00:00
|
|
|
global $wgRequest, $wgJsMimeType;
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2009-02-14 17:09:57 +00:00
|
|
|
$action = $wgRequest->getVal( 'action', 'view' );
|
2004-11-19 04:14:59 +00:00
|
|
|
|
2007-05-08 20:48:02 +00:00
|
|
|
if( $allowUserJs && $this->loggedin ) {
|
2005-02-21 11:28:07 +00:00
|
|
|
if( $this->mTitle->isJsSubpage() and $this->userCanPreview( $action ) ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
# XXX: additional security check/prompt?
|
2009-03-29 12:46:11 +00:00
|
|
|
$this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText( 'wpTextbox1' ) . ' /*]]>*/';
|
2004-11-19 04:14:59 +00:00
|
|
|
} else {
|
2009-03-29 12:46:11 +00:00
|
|
|
$this->userjs = self::makeUrl( $this->userpage . '/' . $this->skinname . '.js', 'action=raw&ctype=' . $wgJsMimeType );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
}
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2005-09-27 19:40:14 +00:00
|
|
|
/**
|
|
|
|
|
* Code for extensions to hook into to provide per-page CSS, see
|
2005-11-15 11:13:14 +00:00
|
|
|
* extensions/PageCSS/PageCSS.php for an implementation of this.
|
2005-09-27 19:40:14 +00:00
|
|
|
*
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2005-09-27 19:40:14 +00:00
|
|
|
*/
|
|
|
|
|
function setupPageCss() {
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileIn( __METHOD__ );
|
2005-09-27 19:40:14 +00:00
|
|
|
$out = false;
|
2006-01-14 21:16:28 +00:00
|
|
|
wfRunHooks( 'SkinTemplateSetupPageCss', array( &$out ) );
|
2008-05-06 14:14:37 +00:00
|
|
|
wfProfileOut( __METHOD__ );
|
2005-09-27 19:40:14 +00:00
|
|
|
return $out;
|
|
|
|
|
}
|
2009-07-07 21:49:45 +00:00
|
|
|
|
|
|
|
|
public function commonPrintStylesheet() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
|
|
|
|
|
2004-11-19 12:44:51 +00:00
|
|
|
/**
|
|
|
|
|
* Generic wrapper for template functions, with interface
|
|
|
|
|
* compatible with what we use of PHPTAL 0.7.
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Skins
|
2004-11-19 12:44:51 +00:00
|
|
|
*/
|
2009-08-11 06:02:06 +00:00
|
|
|
abstract class QuickTemplate {
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2009-03-29 12:46:11 +00:00
|
|
|
* Constructor
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
2009-03-29 12:46:11 +00:00
|
|
|
public function QuickTemplate() {
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->data = array();
|
2004-11-25 06:04:16 +00:00
|
|
|
$this->translator = new MediaWiki_I18N();
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2009-03-29 12:46:11 +00:00
|
|
|
* Sets the value $value to $name
|
|
|
|
|
* @param $name
|
|
|
|
|
* @param $value
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
2009-03-29 12:46:11 +00:00
|
|
|
public function set( $name, $value ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->data[$name] = $value;
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2009-03-29 12:46:11 +00:00
|
|
|
* @param $name
|
|
|
|
|
* @param $value
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
2009-03-29 12:46:11 +00:00
|
|
|
public function setRef( $name, &$value ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->data[$name] =& $value;
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2009-03-29 12:46:11 +00:00
|
|
|
* @param $t
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
2009-03-29 12:46:11 +00:00
|
|
|
public function setTranslator( &$t ) {
|
2004-11-19 04:14:59 +00:00
|
|
|
$this->translator = &$t;
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2009-03-29 12:46:11 +00:00
|
|
|
* Main function, used by classes that subclass QuickTemplate
|
|
|
|
|
* to show the actual HTML output
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
2009-08-11 06:02:06 +00:00
|
|
|
abstract public function execute();
|
2004-11-25 05:31:49 +00:00
|
|
|
|
|
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
|
|
|
|
function text( $str ) {
|
|
|
|
|
echo htmlspecialchars( $this->data[$str] );
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2006-07-28 19:05:27 +00:00
|
|
|
/**
|
|
|
|
|
* @private
|
|
|
|
|
*/
|
|
|
|
|
function jstext( $str ) {
|
|
|
|
|
echo Xml::escapeJsString( $this->data[$str] );
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
|
|
|
|
function html( $str ) {
|
|
|
|
|
echo $this->data[$str];
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
|
|
|
|
function msg( $str ) {
|
|
|
|
|
echo htmlspecialchars( $this->translator->translate( $str ) );
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
|
|
|
|
function msgHtml( $str ) {
|
|
|
|
|
echo $this->translator->translate( $str );
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-12-23 11:43:24 +00:00
|
|
|
/**
|
|
|
|
|
* An ugly, ugly hack.
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-12-23 11:43:24 +00:00
|
|
|
*/
|
|
|
|
|
function msgWiki( $str ) {
|
2009-04-09 02:22:36 +00:00
|
|
|
global $wgParser, $wgOut;
|
2004-12-23 11:43:24 +00:00
|
|
|
|
|
|
|
|
$text = $this->translator->translate( $str );
|
2009-04-09 02:22:36 +00:00
|
|
|
$parserOutput = $wgParser->parse( $text, $wgOut->getTitle(),
|
2006-07-26 07:15:39 +00:00
|
|
|
$wgOut->parserOptions(), true );
|
2004-12-23 11:43:24 +00:00
|
|
|
echo $parserOutput->getText();
|
|
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
|
|
|
|
function haveData( $str ) {
|
2006-11-29 05:45:03 +00:00
|
|
|
return isset( $this->data[$str] );
|
2004-11-25 05:31:49 +00:00
|
|
|
}
|
2005-07-03 04:00:33 +00:00
|
|
|
|
2004-11-25 05:31:49 +00:00
|
|
|
/**
|
2006-04-20 20:43:38 +00:00
|
|
|
* @private
|
2004-11-25 05:31:49 +00:00
|
|
|
*/
|
|
|
|
|
function haveMsg( $str ) {
|
|
|
|
|
$msg = $this->translator->translate( $str );
|
2009-03-29 12:46:11 +00:00
|
|
|
return ( $msg != '-' ) && ( $msg != '' ); # ????
|
2004-11-19 04:14:59 +00:00
|
|
|
}
|
2009-06-13 14:27:16 +00:00
|
|
|
}
|