http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84571
Revision: 84571
Author: hashar
Date: 2011-03-22 22:05:42 +0000 (Tue, 22 Mar 2011)
Log Message:
-----------
new SpecialPage->getFormAction() method
This will return a nice a nice URL based on Title->getLocalURL(). It could
then be used as a form action which is nicer than $wgScript.
Modified Paths:
--------------
branches/hashar/prettyURL/includes/SpecialPage.php
Modified: branches/hashar/prettyURL/includes/SpecialPage.php
===================================================================
--- branches/hashar/prettyURL/includes/SpecialPage.php 2011-03-22 21:59:13 UTC
(rev 84570)
+++ branches/hashar/prettyURL/includes/SpecialPage.php 2011-03-22 22:05:42 UTC
(rev 84571)
@@ -944,6 +944,15 @@
}
/**
+ * Get a local URL suitable for <form action="">
+ *
+ * @return Title local URL
+ */
+ function getFormAction( $subpage = false ) {
+ return self::getTitleFor( $this->mName, $subpage
)->getLocalURL();
+ }
+
+ /**
* Set whether this page is listed in Special:Specialpages, at run-time
*/
function setListed( $listed ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs