|
@@ -174,17 +174,19 @@ class FormatHelper extends Helper {
|
|
|
/**
|
|
/**
|
|
|
* Displays gender icon
|
|
* Displays gender icon
|
|
|
*
|
|
*
|
|
|
- * @param mixed $value
|
|
|
|
|
|
|
+ * @param int|string $value
|
|
|
|
|
+ * @param array $options
|
|
|
|
|
+ * @param array $attributes
|
|
|
* @return string
|
|
* @return string
|
|
|
*/
|
|
*/
|
|
|
- public function genderIcon($value) {
|
|
|
|
|
|
|
+ public function genderIcon($value, array $options = [], array $attributes = []) {
|
|
|
$value = (int)$value;
|
|
$value = (int)$value;
|
|
|
if ($value == static::GENDER_FEMALE) {
|
|
if ($value == static::GENDER_FEMALE) {
|
|
|
- $icon = $this->icon('female');
|
|
|
|
|
|
|
+ $icon = $this->icon('female', $options, $attributes);
|
|
|
} elseif ($value == static::GENDER_MALE) {
|
|
} elseif ($value == static::GENDER_MALE) {
|
|
|
- $icon = $this->icon('male');
|
|
|
|
|
|
|
+ $icon = $this->icon('male', $options, $attributes);
|
|
|
} else {
|
|
} else {
|
|
|
- $icon = $this->icon('genderless', [], ['title' => __d('tools', 'Unknown')]);
|
|
|
|
|
|
|
+ $icon = $this->icon('genderless', $options, $attributes + ['title' => __d('tools', 'Unknown')]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return $icon;
|
|
return $icon;
|
|
@@ -376,10 +378,11 @@ class FormatHelper extends Helper {
|
|
|
|
|
|
|
|
if (!isset($attributes['title'])) {
|
|
if (!isset($attributes['title'])) {
|
|
|
$attributes['title'] = ucfirst($type);
|
|
$attributes['title'] = ucfirst($type);
|
|
|
- if (!isset($options['translate']) || $options['translate'] !== false) {
|
|
|
|
|
- $attributes['title'] = __($attributes['title']);
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!isset($options['translate']) || $options['translate'] !== false) {
|
|
|
|
|
+ $attributes['title'] = __($attributes['title']);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (isset($attributes['class'])) {
|
|
if (isset($attributes['class'])) {
|
|
|
$options['class'] .= ' ' . $attributes['class'];
|
|
$options['class'] .= ' ' . $attributes['class'];
|
|
|
unset($attributes['class']);
|
|
unset($attributes['class']);
|
|
@@ -501,14 +504,16 @@ class FormatHelper extends Helper {
|
|
|
$currentPage = $paginator['page'];
|
|
$currentPage = $paginator['page'];
|
|
|
$pageCount = $paginator['pageCount'];
|
|
$pageCount = $paginator['pageCount'];
|
|
|
$totalCount = $paginator['count'];
|
|
$totalCount = $paginator['count'];
|
|
|
- $limit = $paginator['limit'];
|
|
|
|
|
|
|
+ $limit = $paginator['perPage'];
|
|
|
$step = isset($paginator['step']) ? $paginator['step'] : 1;
|
|
$step = isset($paginator['step']) ? $paginator['step'] : 1;
|
|
|
|
|
|
|
|
if ($dir === 'DESC') {
|
|
if ($dir === 'DESC') {
|
|
|
|
|
+ $count = $limit - $count + 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($dir === 'DESC') {
|
|
|
$currentCount = $count + ($pageCount - $currentPage) * $limit * $step;
|
|
$currentCount = $count + ($pageCount - $currentPage) * $limit * $step;
|
|
|
- if ($currentPage != $pageCount && $pageCount > 1) {
|
|
|
|
|
- $currentCount -= $pageCount * $limit * $step - $totalCount;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $currentCount -= $pageCount * $limit * $step - $totalCount;
|
|
|
} else {
|
|
} else {
|
|
|
$currentCount = $count + ($currentPage - 1) * $limit * $step;
|
|
$currentCount = $count + ($currentPage - 1) * $limit * $step;
|
|
|
}
|
|
}
|