From: Aryeh Gregor Date: Sun, 24 Jun 2007 03:16:08 +0000 (+0000) Subject: Wrap comments at 79 characters, not the particular width the commenter happened to... X-Git-Tag: 1.31.0-rc.0~52426 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=ba9a3d4c60c16409d63fd56c6ac364784a2c909d;p=lhc%2Fweb%2Fwiklou.git Wrap comments at 79 characters, not the particular width the commenter happened to have his screen set to when writing it --- diff --git a/includes/Pager.php b/includes/Pager.php index a475dc16a1..7d8327a731 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -12,41 +12,42 @@ interface Pager { /** * IndexPager is an efficient pager which uses a (roughly unique) index in the * data set to implement paging, rather than a "LIMIT offset,limit" clause. - * In MySQL, such a limit/offset clause requires counting through the specified number - * of offset rows to find the desired data, which can be expensive for large offsets. + * In MySQL, such a limit/offset clause requires counting through the + * specified number of offset rows to find the desired data, which can be + * expensive for large offsets. * - * ReverseChronologicalPager is a child class of the abstract IndexPager, and contains - * some formatting and display code which is specific to the use of timestamps as - * indexes. Here is a synopsis of its operation: + * ReverseChronologicalPager is a child class of the abstract IndexPager, and + * contains some formatting and display code which is specific to the use of + * timestamps as indexes. Here is a synopsis of its operation: * - * * The query is specified by the offset, limit and direction (dir) parameters, in - * addition to any subclass-specific parameters. + * * The query is specified by the offset, limit and direction (dir) + * parameters, in addition to any subclass-specific parameters. + * * The offset is the non-inclusive start of the DB query. A row with an + * index value equal to the offset will never be shown. + * * The query may either be done backwards, where the rows are returned by + * the database in the opposite order to which they are displayed to the + * user, or forwards. This is specified by the "dir" parameter, dir=prev + * means backwards, anything else means forwards. The offset value + * specifies the start of the database result set, which may be either + * the start or end of the displayed data set. This allows "previous" + * links to be implemented without knowledge of the index value at the + * start of the previous page. + * * An additional row beyond the user-specified limit is always requested. + * This allows us to tell whether we should display a "next" link in the + * case of forwards mode, or a "previous" link in the case of backwards + * mode. Determining whether to display the other link (the one for the + * page before the start of the database result set) can be done + * heuristically by examining the offset. * - * * The offset is the non-inclusive start of the DB query. A row with an index value - * equal to the offset will never be shown. + * * An empty offset indicates that the offset condition should be omitted + * from the query. This naturally produces either the first page or the + * last page depending on the dir parameter. * - * * The query may either be done backwards, where the rows are returned by the database - * in the opposite order to which they are displayed to the user, or forwards. This is - * specified by the "dir" parameter, dir=prev means backwards, anything else means - * forwards. The offset value specifies the start of the database result set, which - * may be either the start or end of the displayed data set. This allows "previous" - * links to be implemented without knowledge of the index value at the start of the - * previous page. - * - * * An additional row beyond the user-specified limit is always requested. This allows - * us to tell whether we should display a "next" link in the case of forwards mode, - * or a "previous" link in the case of backwards mode. Determining whether to - * display the other link (the one for the page before the start of the database - * result set) can be done heuristically by examining the offset. - * - * * An empty offset indicates that the offset condition should be omitted from the query. - * This naturally produces either the first page or the last page depending on the - * dir parameter. - * - * Subclassing the pager to implement concrete functionality should be fairly simple, - * please see the examples in PageHistory.php and SpecialIpblocklist.php. You just need - * to override formatRow(), getQueryInfo() and getIndexField(). Don't forget to call the - * parent constructor if you override it. + * Subclassing the pager to implement concrete functionality should be fairly + * simple, please see the examples in PageHistory.php and + * SpecialIpblocklist.php. You just need to override formatRow(), + * getQueryInfo() and getIndexField(). Don't forget to call the parent + * constructor if you override it. * * @addtogroup Pager */ @@ -75,9 +76,9 @@ abstract class IndexPager implements Pager { global $wgRequest, $wgUser; $this->mRequest = $wgRequest; - # NB: the offset is quoted, not validated. It is treated as an arbitrary string - # to support the widest variety of index types. Be careful outputting it into - # HTML! + # NB: the offset is quoted, not validated. It is treated as an + # arbitrary string to support the widest variety of index types. Be + # careful outputting it into HTML! $this->mOffset = $this->mRequest->getText( 'offset' ); # Use consistent behavior for the limit options @@ -131,9 +132,10 @@ abstract class IndexPager implements Pager { $lastIndex = $row[$this->mIndexField]; } else { $this->mPastTheEndRow = null; - # Setting indexes to an empty string means that they will be omitted - # if they would otherwise appear in URLs. It just so happens that this - # is the right thing to do in the standard UI, in all the relevant cases. + # Setting indexes to an empty string means that they will be + # omitted if they would otherwise appear in URLs. It just so + # happens that this is the right thing to do in the standard + # UI, in all the relevant cases. $this->mPastTheEndIndex = ''; $res->seek( $numRows - 1 ); $row = $res->fetchRow(); @@ -160,7 +162,8 @@ abstract class IndexPager implements Pager { } /** - * Do a query with specified parameters, rather than using the object context + * Do a query with specified parameters, rather than using the object + * context * * @param string $offset Index offset, inclusive * @param integer $limit Exact query limit @@ -331,9 +334,10 @@ abstract class IndexPager implements Pager { } /** - * Get paging links. If a link is disabled, the item from $disabledTexts will - * be used. If there is no such item, the unlinked text from $linkTexts will - * be used. Both $linkTexts and $disabledTexts are arrays of HTML. + * Get paging links. If a link is disabled, the item from $disabledTexts + * will be used. If there is no such item, the unlinked text from + * $linkTexts will be used. Both $linkTexts and $disabledTexts are arrays + * of HTML. */ function getPagingLinks( $linkTexts, $disabledTexts = array() ) { $queries = $this->getPagingQueries(); @@ -667,20 +671,22 @@ abstract class TablePager extends IndexPager { } /** - * Return true if the named field should be sortable by the UI, false otherwise + * Return true if the named field should be sortable by the UI, false + * otherwise + * * @param string $field */ abstract function isFieldSortable( $field ); /** - * Format a table cell. The return value should be HTML, but use an empty string - * not   for empty cells. Do not include the and . + * Format a table cell. The return value should be HTML, but use an empty + * string not   for empty cells. Do not include the and . + * + * The current result row is available as $this->mCurrentRow, in case you + * need more context. * * @param string $name The database field name * @param string $value The value retrieved from the database - * - * The current result row is available as $this->mCurrentRow, in case you need - * more context. */ abstract function formatValue( $name, $value ); @@ -690,9 +696,9 @@ abstract class TablePager extends IndexPager { abstract function getDefaultSort(); /** - * An array mapping database field names to a textual description of the field - * name, for use in the table header. The description should be plain text, it - * will be HTML-escaped later. + * An array mapping database field names to a textual description of the + * field name, for use in the table header. The description should be plain + * text, it will be HTML-escaped later. */ abstract function getFieldNames(); }