Skip to content

Commit

Permalink
CSS classes changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mklkj committed Aug 6, 2018
1 parent 7ca58c4 commit 0791391
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/component/Html/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ public function create()
$this->addContainerWithIcoIf(
$item['ico'],
$config['li_a_ico-container'],
$config['li_a_ico-class_base']
$config['li_a_ico-class_base'],
$config['icon_attribute']
),

# %8$s before text in li a
Expand Down Expand Up @@ -269,7 +270,8 @@ public function create()
$this->addContainerWithIcoIf(
$item['ico'],
$config['li_a_ico-container'],
$config['li_a_ico-class_base']
$config['li_a_ico-class_base'],
$config['icon_attribute']
),

# %8$s before text in li a
Expand Down Expand Up @@ -509,6 +511,7 @@ public function getConfig()
'li_a_text-container' => '',
'li_a_ico-container' => '',
'li_a_ico-class_base' => '',
'icon_attribute' => 'class'
],
$this->config
);
Expand Down Expand Up @@ -569,13 +572,13 @@ private function isActive($slug, $array)
return in_array($slug, $array);
}

private function addContainerWithIcoIf($ico, $selector, $classBase)
private function addContainerWithIcoIf($ico, $selector, $classBase, $attribute)
{
if (empty($ico) || empty($selector)) {
return false;
}

return '<'.$selector.' class="'.$classBase.' '.$ico.'"></'.$selector.'> ';
return '<'.$selector.' '.$attribute.'="'.implode(' ', [$classBase, $ico]).'"></'.$selector.'> ';
}

private function addContainerWithSelectorIf($inside, $selector)
Expand Down
4 changes: 2 additions & 2 deletions src/module/Appearance/Menu/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public function create()
else {
$html[] = sprintf(
'%1$s'.'<li>%2$s - <a'.'%3$s'.' href="'.'%4$s'.'">%5$s</a> – pozycja: %6$s'.
' <a href="'.DIR.'/admin/appearance/menu/edit-item/%2$s" class="btn btn-primary btn-xs">Edytuj</a>'.
' <a href="'.DIR.'/admin/appearance/menu/del-item/%2$s" class="btn btn-danger btn-xs">Usuń</a>',
' <a href="'.DIR.'/admin/appearance/menu/edit-item/%2$s" class="btn btn-primary btn-sm btn-xs">Edytuj</a>'.
' <a href="'.DIR.'/admin/appearance/menu/del-item/%2$s" class="btn btn-danger btn-sm btn-xs">Usuń</a>',

# %1$s tabulation
str_repeat("\t", (count($parent_stack) + 1) * 2 - 1 + $nesting),
Expand Down

0 comments on commit 0791391

Please sign in to comment.