Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1419 from mbabker/pagination

Add active flag to JPaginationObject, add coverage-legacy to build/.gitignore
  • Loading branch information...
commit fc189e3e0cc964cef238aeb0799c7c72c1c988da 2 parents 0c60f03 + 531e068
@realityking realityking authored
View
1  build/.gitignore
@@ -1,4 +1,5 @@
/coverage
+/coverage-legacy
/logs
/pdepend
/code-browser
View
10 libraries/joomla/pagination/object.php
@@ -43,20 +43,28 @@ class JPaginationObject
public $prefix;
/**
+ * @var boolean Flag whether the object is the 'active' page
+ * @since 12.2
+ */
+ public $active;
+
+ /**
* Class constructor.
*
* @param string $text The link text.
* @param integer $prefix The prefix used for request variables.
* @param integer $base The number of rows as a base offset.
* @param string $link The link URL.
+ * @param boolean $active Flag whether the object is the 'active' page
*
* @since 11.1
*/
- public function __construct($text, $prefix = '', $base = null, $link = null)
+ public function __construct($text, $prefix = '', $base = null, $link = null, $active = false)
{
$this->text = $text;
$this->prefix = $prefix;
$this->base = $base;
$this->link = $link;
+ $this->active = $active;
}
}
View
4 libraries/joomla/pagination/pagination.php
@@ -721,6 +721,10 @@ protected function _buildDataObject()
$data->pages[$i]->base = $offset;
$data->pages[$i]->link = JRoute::_($params . '&' . $this->prefix . 'limitstart=' . $offset);
}
+ elseif ($i = $this->pagesCurrent)
+ {
+ $data->pages[$i]->active = true;
+ }
}
return $data;
}

0 comments on commit fc189e3

Please sign in to comment.
Something went wrong with that request. Please try again.