diff --git a/src/Renderer/FlatMenuRenderer.php b/src/Renderer/FlatMenuRenderer.php index 776acd9..310e6e0 100644 --- a/src/Renderer/FlatMenuRenderer.php +++ b/src/Renderer/FlatMenuRenderer.php @@ -219,6 +219,7 @@ protected function renderItem(ItemInterface $item, array $options) { //$html .= $this->format($item->getUri() ? $item->renderLink() : $item->renderLabel(), 'link', $item->getLevel()); $html .= $this->renderLink($item, $options); + // renders the embedded ul $childrenClass = (array)$item->getChildrenAttribute('class'); $childrenClass[] = 'menu_level_' . $item->getLevel(); @@ -228,6 +229,7 @@ protected function renderItem(ItemInterface $item, array $options) { $html .= $this->renderList($item, $childrenAttributes, $options); + // closing li tag $html .= $this->format('', 'li', $item->getLevel(), $options); @@ -255,7 +257,6 @@ protected function applyUserRights(ItemInterface &$item, array $options) { $display_normal = false; if (!empty($rate_rights)) { //if one of item rate rights is in user rate right, then display item normaly - //prd($options['user_rate']); foreach ($rate_rights as $rate_right) { if (isset($options['user_rate'][$rate_right]) && $options['user_rate'][$rate_right] == 1) { $display_normal = true; @@ -269,11 +270,15 @@ protected function applyUserRights(ItemInterface &$item, array $options) { if (!empty($alt_uri)) { $item->setUri($alt_uri); } + else if (!empty($this->defaultOptions['default_rate_alt_uri'])) { + $item->setUri($this->defaultOptions['default_rate_alt_uri']); + } //set item class for css style if its unavailable for rate $item_class = $item->getAttribute('class'); if ($item_class != '') $item_class .= ' '; $item_class .= 'rate-unavailable'; $item->setAttribute('class',$item_class); + $item->setExtra('ext:rate-unavailable', true); } } } @@ -297,7 +302,6 @@ protected function renderLink(ItemInterface $item, array $options = array()) { } else { $text = $this->renderSpanElement($item, $options); } - return $this->format($text, 'link', $item->getLevel(), $options); } @@ -357,6 +361,9 @@ protected function renderLabel(ItemInterface $item, array $options) { $label .= $this->escape($item->getLabel()); } + if (!empty($extendedOptions['rate-unavailable'])) { + $label .= ''; + } return $label; }