dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b6623ea
)
(bug 5167) Add SUBPAGENAMEE
author
Rob Church
<robchurch@users.mediawiki.org>
Sun, 2 Apr 2006 16:19:29 +0000
(16:19 +0000)
committer
Rob Church
<robchurch@users.mediawiki.org>
Sun, 2 Apr 2006 16:19:29 +0000
(16:19 +0000)
RELEASE-NOTES
patch
|
blob
|
history
includes/MagicWord.php
patch
|
blob
|
history
includes/Parser.php
patch
|
blob
|
history
includes/Title.php
patch
|
blob
|
history
languages/Language.php
patch
|
blob
|
history
diff --git
a/RELEASE-NOTES
b/RELEASE-NOTES
index
7940821
..
9e5917f
100644
(file)
--- a/
RELEASE-NOTES
+++ b/
RELEASE-NOTES
@@
-292,7
+292,7
@@
Parser:
* (bug 4783) : Fix for "{{ns:0}} does not render"
* Improved support for interwiki transclusion
* (bug 1850) Image link to nonexistent file fixed.
* (bug 4783) : Fix for "{{ns:0}} does not render"
* Improved support for interwiki transclusion
* (bug 1850) Image link to nonexistent file fixed.
-* (bug 5167) Add {{SUBPAGENAME}}
variable
+* (bug 5167) Add {{SUBPAGENAME}}
and {{SUBPAGENAMEE}} variables
Upload:
* (bug 2527) Always set destination filename when new file is selected
Upload:
* (bug 2527) Always set destination filename when new file is selected
diff --git
a/includes/MagicWord.php
b/includes/MagicWord.php
index
55edbc8
..
b48b574
100644
(file)
--- a/
includes/MagicWord.php
+++ b/
includes/MagicWord.php
@@
-71,6
+71,7
@@
$magicWords = array(
'MAG_FULLPAGENAMEE',
'MAG_RAW',
'MAG_SUBPAGENAME',
'MAG_FULLPAGENAMEE',
'MAG_RAW',
'MAG_SUBPAGENAME',
+ 'MAG_SUBPAGENAMEE',
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
@@
-103,7
+104,8
@@
$wgVariableIDs = array(
MAG_CURRENTWEEK,
MAG_CURRENTDOW,
MAG_REVISIONID,
MAG_CURRENTWEEK,
MAG_CURRENTDOW,
MAG_REVISIONID,
- MAG_SUBPAGENAME
+ MAG_SUBPAGENAME,
+ MAG_SUBPAGENAMEE
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );
diff --git
a/includes/Parser.php
b/includes/Parser.php
index
ac06185
..
1b8a462
100644
(file)
--- a/
includes/Parser.php
+++ b/
includes/Parser.php
@@
-2083,6
+2083,8
@@
class Parser
return $this->mTitle->getPrefixedURL();
case MAG_SUBPAGENAME:
return $this->mTitle->getSubpageText();
return $this->mTitle->getPrefixedURL();
case MAG_SUBPAGENAME:
return $this->mTitle->getSubpageText();
+ case MAG_SUBPAGENAMEE:
+ return $this->mTitle->getSubpageUrlForm();
case MAG_REVISIONID:
return $this->mRevisionId;
case MAG_NAMESPACE:
case MAG_REVISIONID:
return $this->mRevisionId;
case MAG_NAMESPACE:
diff --git
a/includes/Title.php
b/includes/Title.php
index
de575cb
..
9001c35
100644
(file)
--- a/
includes/Title.php
+++ b/
includes/Title.php
@@
-687,6
+687,17
@@
class Title {
return( $this->mTextform );
}
}
return( $this->mTextform );
}
}
+
+ /**
+ * Get a URL-encoded form of the subpage text
+ * @return string URL-encoded subpage name
+ */
+ function getSubpageUrlForm() {
+ $text = $this->getSubpageText();
+ $text = wfUrlencode( str_replace( ' ', '_', $text ) );
+ $text = str_replace( '%28', '(', str_replace( '%29', ')', $text ) ); # Clean up the URL; per below, this might not be safe
+ return( $text );
+ }
/**
* Get a URL-encoded title (not an actual URL) including interwiki
/**
* Get a URL-encoded title (not an actual URL) including interwiki
diff --git
a/languages/Language.php
b/languages/Language.php
index
3eb8fa2
..
465de23
100644
(file)
--- a/
languages/Language.php
+++ b/
languages/Language.php
@@
-229,7
+229,8
@@
$wgLanguageNamesEn =& $wgLanguageNames;
MAG_NAMESPACEE => array( 1, 'NAMESPACEE' ),
MAG_FULLPAGENAME => array( 1, 'FULLPAGENAME' ),
MAG_FULLPAGENAMEE => array( 1, 'FULLPAGENAMEE' ),
MAG_NAMESPACEE => array( 1, 'NAMESPACEE' ),
MAG_FULLPAGENAME => array( 1, 'FULLPAGENAME' ),
MAG_FULLPAGENAMEE => array( 1, 'FULLPAGENAMEE' ),
- MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),
+ MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),
+ MAG_SUBPAGENAMEE => array( 0, 'SUBPAGENAMEE' ),
MAG_MSG => array( 0, 'MSG:' ),
MAG_SUBST => array( 0, 'SUBST:' ),
MAG_MSGNW => array( 0, 'MSGNW:' ),
MAG_MSG => array( 0, 'MSG:' ),
MAG_SUBST => array( 0, 'SUBST:' ),
MAG_MSGNW => array( 0, 'MSGNW:' ),