<?php
-
/**
- * Created on Sep 25, 2006
- *
* API for MediaWiki 1.8+
*
- * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Created on Sep 25, 2006
+ *
+ * Copyright © 2010 Yuri Astrakhan <Firstname><Lastname>@gmail.com
*
* 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
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
*/
if ( !defined( 'MEDIAWIKI' ) ) {
}
}
-
-
foreach ( $this->everything as $pageid => $title ) {
- $pageInfo = $this->extractPageInfo( $pageid, $title );
+ $pageInfo = $this->extractPageInfo( $pageid, $title, $this->params['prop'] );
$fit = $result->addValue( array(
'query',
'pages'
* @param $title Title object
* @return array
*/
- private function extractPageInfo( $pageid, $title ) {
+ private function extractPageInfo( $pageid, $title, $prop ) {
global $wgPageProps;
$pageInfo = array();
'continue' => 'When more results are available, use this to continue',
);
+ //This mess of code first gets the length of the biggest propname, and adds two onto it to make
+ //the number of characters should be used before the dash. If the biggest propname is shorter than 12 characters,
+ //the number of characters before the dash become 14.
$maxLen = max( array_map( 'strlen', array_keys( $wgPageProps ) ) );
$matchLen = $maxLen + 2;
if( $maxLen < 12 ) {