Index: trunk/extensions/CentralNotice/TemplatePager.php |
— | — | @@ -1,5 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +/** |
| 5 | + * Provides pagination functionality for viewing banner lists in the CentralNotice admin interface. |
| 6 | + */ |
4 | 7 | class TemplatePager extends ReverseChronologicalPager { |
5 | 8 | var $onRemoveChange, $viewPage, $special; |
6 | 9 | var $editable; |
— | — | @@ -18,8 +21,11 @@ |
19 | 22 | $this->viewPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'view' ); |
20 | 23 | } |
21 | 24 | |
| 25 | + /** |
| 26 | + * Set the database query to retrieve all the banners in the database |
| 27 | + * @return array of query settings |
| 28 | + */ |
22 | 29 | function getQueryInfo() { |
23 | | - // Return all the banners in the database |
24 | 30 | return array( |
25 | 31 | 'tables' => 'cn_templates', |
26 | 32 | 'fields' => array( 'tmp_name', 'tmp_id' ), |
— | — | @@ -27,7 +33,8 @@ |
28 | 34 | } |
29 | 35 | |
30 | 36 | /** |
31 | | - * Sort the banner list by tmp_id |
| 37 | + * Sort the banner list by tmp_id (generally equals reverse chronological) |
| 38 | + * @return string |
32 | 39 | */ |
33 | 40 | function getIndexField() { |
34 | 41 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -36,6 +43,8 @@ |
37 | 44 | |
38 | 45 | /** |
39 | 46 | * Generate the content of each table row (1 row = 1 banner) |
| 47 | + * @param $row object: database row |
| 48 | + * @return string HTML |
40 | 49 | */ |
41 | 50 | function formatRow( $row ) { |
42 | 51 | |
— | — | @@ -81,6 +90,7 @@ |
82 | 91 | |
83 | 92 | /** |
84 | 93 | * Specify table headers |
| 94 | + * @return string HTML |
85 | 95 | */ |
86 | 96 | function getStartBody() { |
87 | 97 | $htmlOut = ''; |
— | — | @@ -100,6 +110,7 @@ |
101 | 111 | |
102 | 112 | /** |
103 | 113 | * Close table and add Submit button |
| 114 | + * @return string HTML |
104 | 115 | */ |
105 | 116 | function getEndBody() { |
106 | 117 | global $wgUser; |