#
# 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.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
/**
* Wrapper object for MediaWiki's localization functions,
* to be passed to the template engine.
*
- * @access private
+ * @private
* @package MediaWiki
*/
class MediaWiki_I18N {
*/
class SkinTemplate extends Skin {
/**#@+
- * @access private
+ * @private
*/
/**
* @param string $repository subdirectory where we keep template files
* @param string $cache_dir
* @return object
- * @access private
+ * @private
*/
function setupTemplate( $classname, $repository=false, $cache_dir=false ) {
return new $classname();
* initialize various variables and generate the template
*
* @param OutputPage $out
- * @access public
+ * @public
*/
function outputPage( &$out ) {
global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
wfProfileIn( "$fname-stuff2" );
$tpl->set( 'title', $wgOut->getPageTitle() );
$tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
+ $tpl->set( 'displaytitle', $wgOut->mPageLinkTitle );
$tpl->setRef( "thispage", $this->thispage );
$subpagestr = $this->subPageSubtitle();
if ( !$wgDisableCounters ) {
$viewcount = $wgLang->formatNum( $wgArticle->getCount() );
if ( $viewcount ) {
- $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
+ $tpl->set('viewcount', wfMsgExt( 'viewcount', array( 'parseinline' ), $viewcount ) );
} else {
$tpl->set('viewcount', false);
}
* For the base class, assume strings all around.
*
* @param mixed $str
- * @access private
+ * @private
*/
function printOrError( &$str ) {
echo $str;
/**
* build array of urls for personal toolbar
* @return array
- * @access private
+ * @private
*/
function buildPersonalUrls() {
global $wgTitle, $wgShowIPinHeader;
$text = wfMsg( $message );
if ( $text == "<$message>" ) {
- $text = html_entity_decode($text);
+ global $wgContLang;
+ $text = $wgContLang->getNsText( Namespace::getSubject( $title->getNamespace() ) );
}
return array(
/**
* an array of edit links by default used for the tabs
* @return array
- * @access private
+ * @private
*/
function buildContentActionUrls () {
- global $wgContLang;
+ global $wgContLang, $wgOut;
$fname = 'SkinTemplate::buildContentActionUrls';
wfProfileIn( $fname );
'href' => $this->mTitle->getLocalUrl( $this->editUrlOptions() )
);
- if ( $istalk ) {
+ if ( $istalk || $wgOut->showNewSectionLink() ) {
$content_actions['addsection'] = array(
'class' => $section == 'new'?'selected':false,
'text' => wfMsg('addsection'),
);
}
if ( $this->mTitle->userCanMove()) {
+ $moveTitle = Title::makeTitle( NS_SPECIAL, 'Movepage' );
$content_actions['move'] = array(
'class' => ($this->mTitle->getDbKey() == 'Movepage' and $this->mTitle->getNamespace == NS_SPECIAL) ? 'selected' : false,
'text' => wfMsg('move'),
- 'href' => $this->makeSpecialUrl("Movepage/$this->thispage" )
+ 'href' => $moveTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
);
}
} else {
//article doesn't exist or is deleted
- if($wgUser->isAllowed('delete')){
+ if( $wgUser->isAllowed( 'delete' ) ) {
if( $n = $this->mTitle->isDeleted() ) {
+ $undelTitle = Title::makeTitle( NS_SPECIAL, 'Undelete' );
$content_actions['undelete'] = array(
'class' => false,
'text' => ($n == 1) ? wfMsg( 'undelete_short1' ) : wfMsg('undelete_short', $n ),
- 'href' => $this->makeSpecialUrl("Undelete/$this->thispage")
+ 'href' => $undelTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
+ #'href' => $this->makeSpecialUrl("Undelete/$this->thispage")
);
}
}
/**
* build array of common navigation links
* @return array
- * @access private
+ * @private
*/
function buildNavUrls () {
global $wgUseTrackbacks, $wgTitle, $wgArticle;
wfRunHooks( 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink', array( &$this, &$nav_urls, &$oldid, &$revid ) );
}
- if( $this->mTitle->getNamespace() != NS_SPECIAL) {
+ if( $this->mTitle->getNamespace() != NS_SPECIAL ) {
+ $wlhTitle = Title::makeTitle( NS_SPECIAL, 'Whatlinkshere' );
$nav_urls['whatlinkshere'] = array(
- 'href' => $this->makeSpecialUrl("Whatlinkshere/$this->thispage")
+ 'href' => $wlhTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
);
if( $this->mTitle->getArticleId() ) {
+ $rclTitle = Title::makeTitle( NS_SPECIAL, 'Recentchangeslinked' );
$nav_urls['recentchangeslinked'] = array(
- 'href' => $this->makeSpecialUrl("Recentchangeslinked/$this->thispage")
+ 'href' => $rclTitle->getLocalUrl( 'target=' . urlencode( $this->thispage ) )
);
}
if ($wgUseTrackbacks)
/**
* Generate strings used for xml 'id' names
* @return string
- * @access private
+ * @private
*/
function getNameSpaceKey () {
return $this->mTitle->getNamespaceKey();
}
/**
- * @access private
+ * @private
*/
function setupUserCss() {
$fname = 'SkinTemplate::setupUserCss';
}
/**
- * @access private
+ * @private
*/
function setupUserJs() {
$fname = 'SkinTemplate::setupUserJs';
* Code for extensions to hook into to provide per-page CSS, see
* extensions/PageCSS/PageCSS.php for an implementation of this.
*
- * @access private
+ * @private
*/
function setupPageCss() {
$fname = 'SkinTemplate::setupPageCss';
/**
* returns css with user-specific options
- * @access public
+ * @public
*/
function getUserStylesheet() {
}
/**
- * @access public
+ * @public
*/
function getUserJs() {
$fname = 'SkinTemplate::getUserJs';
*/
class QuickTemplate {
/**
- * @access public
+ * @public
*/
function QuickTemplate() {
$this->data = array();
}
/**
- * @access public
+ * @public
*/
function set( $name, $value ) {
$this->data[$name] = $value;
}
/**
- * @access public
+ * @public
*/
function setRef($name, &$value) {
$this->data[$name] =& $value;
}
/**
- * @access public
+ * @public
*/
function setTranslator( &$t ) {
$this->translator = &$t;
}
/**
- * @access public
+ * @public
*/
function execute() {
echo "Override this function.";
/**
- * @access private
+ * @private
*/
function text( $str ) {
echo htmlspecialchars( $this->data[$str] );
}
/**
- * @access private
+ * @private
*/
function html( $str ) {
echo $this->data[$str];
}
/**
- * @access private
+ * @private
*/
function msg( $str ) {
echo htmlspecialchars( $this->translator->translate( $str ) );
}
/**
- * @access private
+ * @private
*/
function msgHtml( $str ) {
echo $this->translator->translate( $str );
/**
* An ugly, ugly hack.
- * @access private
+ * @private
*/
function msgWiki( $str ) {
global $wgParser, $wgTitle, $wgOut;
}
/**
- * @access private
+ * @private
*/
function haveData( $str ) {
return $this->data[$str];
}
/**
- * @access private
+ * @private
*/
function haveMsg( $str ) {
$msg = $this->translator->translate( $str );