From: Roan Kattouw Date: Mon, 10 Dec 2007 16:45:01 +0000 (+0000) Subject: API: X-Git-Tag: 1.31.0-rc.0~50465 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=87acd2f8b1f1a3550553d9f0770246b41529315c;p=lhc%2Fweb%2Fwiklou.git API: * Replacing Title::newFromText() by Title::makeTitle(), which is more efficient * Changing 'AtoZ' to 'ascending' throughout --- diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 04f4300935..9d616d21cd 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -78,11 +78,12 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { } // Normalize titles + $titleObj = Title::makeTitle(NS_CATEGORY, $row->cl_to); if(!is_null($resultPageSet)) - $titleObj = Title::newFromText('Category:' . $row->cl_to); + $pages[] = $titleObj->getPrefixedText(); else - $titleObj = Title::newFromText($row->cl_to); - $pages[] = $titleObj->getPrefixedText(); + // Don't show "Category:" everywhere in non-generator mode + $pages[] = $titleObj->getText(); } $db->freeResult($res); @@ -100,10 +101,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { 'from' => null, 'prefix' => null, 'dir' => array( - ApiBase :: PARAM_DFLT => 'AtoZ', + ApiBase :: PARAM_DFLT => 'ascending', ApiBase :: PARAM_TYPE => array( - 'AtoZ', - 'ZtoA' + 'ascending', + 'descending' ), ), 'limit' => array ( diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 8f7daecc24..0ede557ec5 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -186,10 +186,10 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2 ), 'dir' => array ( - ApiBase :: PARAM_DFLT => 'AtoZ', + ApiBase :: PARAM_DFLT => 'ascending', ApiBase :: PARAM_TYPE => array ( - 'AtoZ', - 'ZtoA' + 'ascending', + 'descending' ) ) );