Skip to content

Commit

Permalink
And removed some apparently useless options from the linktree template
Browse files Browse the repository at this point in the history
Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Jan 11, 2014
1 parent 724d95d commit da775e2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions themes/default/index.template.php
Expand Up @@ -412,15 +412,17 @@ function template_html_below()
}

/**
* Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
* @param bool $force_show = false
* Show a linktree. This is that thing that shows
* "My Community | General Category | General Discussion"..
* @param string $default a string representing the index in $context where
* the linktree is stored (default value is 'linktree')
*/
function theme_linktree($force_show = false)
function theme_linktree($default = 'linktree')
{
global $context, $settings;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
if (empty($context[$default]))
return;

// @todo - Look at changing markup here slightly. Need to incorporate relevant aria roles.
Expand All @@ -429,10 +431,10 @@ function theme_linktree($force_show = false)

// Each tree item has a URL and name. Some may have extra_before and extra_after.
// Added a linktree class to make targeting dividers easy.
foreach ($context['linktree'] as $link_num => $tree)
foreach ($context[$default] as $link_num => $tree)
{
echo '
<li class="linktree', ($link_num == count($context['linktree']) - 1) ? '_last' : '', '">';
<li class="linktree', ($link_num == count($context[$default]) - 1) ? '_last' : '', '">';

// Dividers moved to pseudo-elements in CSS. @todo- rtl.css
// Show something before the link?
Expand Down

0 comments on commit da775e2

Please sign in to comment.