diff --git a/lib/Cake/View/Helper/HtmlHelper.php b/lib/Cake/View/Helper/HtmlHelper.php index c4f6c76ff..eddff0e23 100644 --- a/lib/Cake/View/Helper/HtmlHelper.php +++ b/lib/Cake/View/Helper/HtmlHelper.php @@ -682,6 +682,11 @@ class HtmlHelper extends AppHelper { * similar to HtmlHelper::getCrumbs(), so it uses options which every * crumb was added with. * + * ### Options + * - 'separator' Separator content to insert in between breadcrumbs, defaults to '»' + * - 'firstClass' Class for wrapper tag on the first breadcrumb, defaults to 'first' + * - 'lastClass' Class for wrapper tag on current active page, defaults to 'last' + * * @param array $options Array of html attributes to apply to the generated list elements. * @param string|array|boolean $startText This will be the first crumb, if false it defaults to first crumb in array. Can * also be an array, see `HtmlHelper::getCrumbs` for details. @@ -689,6 +694,12 @@ class HtmlHelper extends AppHelper { * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#creating-breadcrumb-trails-with-htmlhelper */ public function getCrumbList($options = array(), $startText = false) { + $defaults = array('firstClass'=>'first', 'lastClass'=>'last', 'separator' => ''); + $options += $defaults; + $firstClass = $options['firstClass']; + $lastClass = $options['lastClass']; + $separator = $options['separator']; + unset($options['firstClass'], $options['lastClass'], $options['separator']); $crumbs = $this->_prepareCrumbs($startText); if (!empty($crumbs)) { $result = ''; @@ -701,10 +712,18 @@ class HtmlHelper extends AppHelper { } else { $elementContent = $this->link($crumb[0], $crumb[1], $crumb[2]); } +<<<<<<< HEAD if (!$which) { $options['class'] = 'first'; +======= + if ($which == 0) { + $options['class'] = $firstClass; +>>>>>>> 77886a9c5b62529e9af5368d40978bc1bf852e4f } elseif ($which == $crumbCount - 1) { - $options['class'] = 'last'; + $options['class'] = $lastClass; + } + if (!empty($separator) && ($crumbCount - $which >= 2)) { + $elementContent .= $separator; } $result .= $this->tag('li', $elementContent, $options); } diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php index 154cc6af4..e4ea24e19 100644 --- a/lib/Cake/View/Helper/PaginatorHelper.php +++ b/lib/Cake/View/Helper/PaginatorHelper.php @@ -471,10 +471,10 @@ class PaginatorHelper extends AppHelper { $url = array_merge(array('page' => $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url); if ($this->{$check}($model)) { - return $this->Html->tag($tag, $this->link($title, $url, array_merge($options, compact('escape', 'model'))), compact('class')); + return $this->Html->tag($tag, $this->link($title, $url, array_merge($options, compact('escape'))), compact('class')); } else { unset($options['rel']); - return $this->Html->tag($tag, $title, array_merge($options, compact('escape', 'class'))); + return $this->Html->tag($tag, ''.h($title).'', array_merge($options, compact('class'))); } } @@ -711,11 +711,15 @@ class PaginatorHelper extends AppHelper { if ($class) { $currentClass .= ' ' . $class; } +<<<<<<< HEAD if ($currentTag) { $out .= $this->Html->tag($tag, $this->Html->tag($currentTag, $params['page']), array('class' => $currentClass)); } else { $out .= $this->Html->tag($tag, $params['page'], array('class' => $currentClass)); } +======= + $out .= $this->Html->tag($tag, ''.$params['page'].'', array('class' => $currentClass)); +>>>>>>> 77886a9c5b62529e9af5368d40978bc1bf852e4f if ($i != $params['pageCount']) { $out .= $separator; } @@ -748,11 +752,15 @@ class PaginatorHelper extends AppHelper { if ($class) { $currentClass .= ' ' . $class; } +<<<<<<< HEAD if ($currentTag) { $out .= $this->Html->tag($tag, $this->Html->tag($currentTag, $i), array('class' => $currentClass)); } else { $out .= $this->Html->tag($tag, $i, array('class' => $currentClass)); } +======= + $out .= $this->Html->tag($tag, "$i", array('class' => $currentClass)); +>>>>>>> 77886a9c5b62529e9af5368d40978bc1bf852e4f } else { $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), compact('class')); }