* @todo document
*/
-/**
- *
- */
+/** */
define('DF_ALL', -1);
+/** */
define('DF_NONE', 0);
+/** */
define('DF_MDY', 1);
+/** */
define('DF_DMY', 2);
+/** */
define('DF_YMD', 3);
+/** */
define('DF_ISO1', 4);
+/** */
define('DF_LASTPREF', 4);
+/** */
define('DF_ISO2', 5);
+/** */
define('DF_YDM', 6);
+/** */
define('DF_DM', 7);
+/** */
define('DF_MD', 8);
+/** */
define('DF_LAST', 8);
/**
var $regexes, $pDays, $pMonths, $pYears;
var $rules, $xMonths;
- function DateFormatter()
- {
+ /**
+ * @todo document
+ */
+ function DateFormatter() {
global $wgMonthNamesEn, $wgInputEncoding;
$this->monthNames = $this->getMonthRegex();
$this->rules[DF_NONE][DF_ISO2] = DF_ISO1;
}
- function reformat( $preference, $text )
- {
+ /**
+ * @param $preference
+ * @param $text
+ */
+ function reformat( $preference, $text ) {
for ( $i=1; $i<=DF_LAST; $i++ ) {
$this->mSource = $i;
if ( @$this->rules[$preference][$i] ) {
return $text;
}
- function replace( $matches )
- {
+ /**
+ * @param $matches
+ */
+ function replace( $matches ) {
global $wgMonthNamesEn;
# Extract information from $matches
$bits = array();
return $text;
}
- function getMonthRegex()
- {
+ /**
+ * @todo document
+ */
+ function getMonthRegex() {
global $wgMonthNamesEn;
return implode( '|', $wgMonthNamesEn );
}
- # Makes an ISO month, e.g. 02, from a month name
- function makeIsoMonth( $monthName )
- {
+ /**
+ * Makes an ISO month, e.g. 02, from a month name
+ * @param string $monthName Month name
+ * @return string ISO month name
+ */
+ function makeIsoMonth( $monthName ) {
$n = $this->xMonths[strtolower( $monthName )];
return sprintf( '%02d', $n );
}
- function makeIsoYear( $year )
- {
+ /**
+ * @todo document
+ * @param string $year Year name
+ * @return string ISO year name
+ */
+ function makeIsoYear( $year ) {
# Assumes the year is in a nice format, as enforced by the regex
if ( substr( $year, -2 ) == 'BC' ) {
$num = IntVal(substr( $year, 0, -3 )) - 1;
return $text;
}
- function makeNormalYear( $iso )
- {
+ /**
+ * @todo document
+ */
+ function makeNormalYear( $iso ) {
if ( $iso{0} == '-' ) {
$text = (IntVal( substr( $iso, 1 ) ) - 1) . ' BC';
} else {
}
}
-function wfMainDateReplace( $matches )
-{
+/**
+ * @todo document
+ */
+function wfMainDateReplace( $matches ) {
global $wgDateFormatter;
return $wgDateFormatter->replace( $matches );
}
var $edittime = '', $section = '';
var $oldid = 0;
+ /**
+ * @todo document
+ * @param $article
+ */
function EditPage( $article ) {
$this->mArticle =& $article;
global $wgTitle;
$this->mTitle =& $wgTitle;
}
- # This is the function that gets called for "action=edit".
-
- function edit()
- {
+ /**
+ * This is the function that gets called for "action=edit".
+ */
+ function edit() {
global $wgOut, $wgUser, $wgWhitelistEdit, $wgRequest;
// this is not an article
$wgOut->setArticleFlag(false);
}
}
+ /**
+ * @todo document
+ */
function importFormData( &$request ) {
# These fields need to be checked for encoding.
# Also remove trailing whitespace, but don't remove _initial_
$this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
}
- # Since there is only one text field on the edit form,
- # pressing <enter> will cause the form to be submitted, but
- # the submit button value won't appear in the query, so we
- # Fake it here before going back to edit(). This is kind of
- # ugly, but it helps some old URLs to still work.
-
- function submit()
- {
+ /**
+ * Since there is only one text field on the edit form,
+ * pressing <enter> will cause the form to be submitted, but
+ * the submit button value won't appear in the query, so we
+ * Fake it here before going back to edit(). This is kind of
+ * ugly, but it helps some old URLs to still work.
+ */
+ function submit() {
if( !$this->preview ) $this->save = true;
$this->edit();
}
- # The edit form is self-submitting, so that when things like
- # preview and edit conflicts occur, we get the same form back
- # with the extra stuff added. Only when the final submission
- # is made and all is well do we actually save and redirect to
- # the newly-edited page.
-
- function editForm( $formtype )
- {
+ /**
+ * The edit form is self-submitting, so that when things like
+ * preview and edit conflicts occur, we get the same form back
+ * with the extra stuff added. Only when the final submission
+ * is made and all is well do we actually save and redirect to
+ * the newly-edited page.
+ *
+ * @param string $formtype Type of form either : save, initial or preview
+ */
+ function editForm( $formtype ) {
global $wgOut, $wgUser;
global $wgLang, $wgParser, $wgTitle;
global $wgAllowAnonymousMinor;
}
}
- function blockedIPpage()
- {
+ /**
+ * @todo document
+ */
+ function blockedIPpage() {
global $wgOut, $wgUser, $wgLang, $wgIP;
$wgOut->setPageTitle( wfMsg( 'blockedtitle' ) );
$wgOut->returnToMain( false );
}
-
-
- function userNotLoggedInPage()
- {
+ /**
+ * @todo document
+ */
+ function userNotLoggedInPage() {
global $wgOut, $wgUser, $wgLang;
$wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
$wgOut->returnToMain( false );
}
+ /**
+ * @todo document
+ */
function spamPage ( $matches = array() )
{
global $wgOut;
$wgOut->returnToMain( false );
}
- # Forks processes to scan the originating IP for an open proxy server
- # MemCached can be used to skip IPs that have already been scanned
- function proxyCheck()
- {
+ /**
+ * Forks processes to scan the originating IP for an open proxy server
+ * MemCached can be used to skip IPs that have already been scanned
+ */
+ function proxyCheck() {
global $wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath;
global $wgIP, $wgUseMemCached, $wgMemc, $wgDBname, $wgProxyMemcExpiry;
}
}
- /* private */ function mergeChangesInto( &$text ){
+ /**
+ * @access private
+ * @todo document
+ */
+ function mergeChangesInto( &$text ){
$fname = 'EditPage::mergeChangesInto';
$oldDate = $this->edittime;
$dbw =& wfGetDB( DB_MASTER );
# http://www.gnu.org/copyleft/gpl.html
/**
- * Contain class to build rss / atom ... feeds
+ * Contain a feed class as well as classes to build rss / atom ... feeds
*/
/**
* @todo document
*/
class FeedItem {
+ /**@#+
+ * @var string
+ * @access private
+ */
var $Title = 'Wiki';
var $Description = '';
var $Url = '';
var $Date = '';
var $Author = '';
+ /**@#-*/
+ /**
+ * @todo document
+ */
function FeedItem( $Title, $Description, $Url, $Date = '', $Author = '', $Comments = '' ) {
$this->Title = $Title;
$this->Description = $Description;
$this->Comments = $Comments;
}
- /* Static... */
+ /**
+ * @static
+ * @todo document
+ */
function xmlEncode( $string ) {
global $wgInputEncoding, $wgLang;
$string = str_replace( "\r\n", "\n", $string );
}
return htmlspecialchars( $string );
}
- function getTitle() {
- return $this->xmlEncode( $this->Title );
- }
- function getUrl() {
- return $this->xmlEncode( $this->Url );
- }
- function getDescription() {
- return $this->xmlEncode( $this->Description );
- }
+
+ /**
+ * @todo document
+ */
+ function getTitle() { return $this->xmlEncode( $this->Title ); }
+ /**
+ * @todo document
+ */
+ function getUrl() { return $this->xmlEncode( $this->Url ); }
+ /**
+ * @todo document
+ */
+ function getDescription() { return $this->xmlEncode( $this->Description ); }
+ /**
+ * @todo document
+ */
function getLanguage() {
global $wgLanguageCode;
return $wgLanguageCode;
}
- function getDate() {
- return $this->Date;
- }
- function getAuthor() {
- return $this->xmlEncode( $this->Author );
- }
- function getComments() {
- return $this->xmlEncode( $this->Comments );
- }
+ /**
+ * @todo document
+ */
+ function getDate() { return $this->Date; }
+ /**
+ * @todo document
+ */
+ function getAuthor() { return $this->xmlEncode( $this->Author ); }
+ /**
+ * @todo document
+ */
+ function getComments() { return $this->xmlEncode( $this->Comments ); }
}
/**
* @todo document
*/
class ChannelFeed extends FeedItem {
- /* Abstract functions, override! */
+ /**@#+
+ * Abstract function, override!
+ */
+
+ /**
+ * @todo document
+ */
function outHeader() {
# print "<feed>";
}
+
+ /**
+ * @todo document
+ */
function outItem( $item ) {
# print "<item>...</item>";
}
+
+ /**
+ * @todo document
+ */
function outFooter() {
# print "</feed>";
}
+ /**
+ * @todo document
+ */
function outXmlHeader( $mimetype='application/xml' ) {
global $wgServer, $wgStylePath, $wgOut;
print '<' . '?xml-stylesheet type="text/css" href="' .
htmlspecialchars( "$wgServer$wgStylePath/feed.css" ) . '"?' . ">\n";
}
+ /**@#-*/
}
/**
*/
class RSSFeed extends ChannelFeed {
+ /**
+ * @todo document
+ */
function formatTime( $ts ) {
return gmdate( 'D, d M Y H:i:s \G\M\T', wfTimestamp2Unix( $ts ) );
}
+ /**
+ * @todo document
+ */
function outHeader() {
global $wgVersion;
<?php
}
+ /**
+ * @todo document
+ */
function outItem( $item ) {
?>
<item>
<?php
}
+ /**
+ * @todo document
+ */
function outFooter() {
?>
</channel>
* @todo document
*/
class AtomFeed extends ChannelFeed {
+ /**
+ * @todo document
+ */
function formatTime( $ts ) {
// need to use RFC 822 time format at least for rss2.0
return gmdate( 'Y-m-d\TH:i:s', wfTimestamp2Unix( $ts ) );
}
+ /**
+ * @todo document
+ */
function outHeader() {
global $wgVersion, $wgOut;
<?php
}
+ /**
+ * @todo document
+ */
function outItem( $item ) {
global $wgMimeType;
?>
*/
}
+ /**
+ * @todo document
+ */
function outFooter() {?>
</feed><?php
}