12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- function template_button_strip($button_strip, $direction = 'top', $strip_options = array())
- {
- global $context, $txt, $scripturl;
-
- if (!is_array($strip_options))
- $strip_options = array();
-
- $buttons = array();
- foreach ($button_strip as $key => $value)
- {
- if (!isset($value['test']) || !empty($context[$value['test']]))
- $buttons[] = '
- <li><a' . (isset($value['id']) ? ' id="button_strip_' . $value['id'] . '"' : '') . ' class="button_strip_' . $key . (isset($value['active']) ? ' active' : '') . '" href="' . $value['url'] . '"' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a></li>';
- }
-
- if (empty($buttons))
- return;
-
- $buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);
- echo '
- <div class="buttonlist', $direction != 'top' ? '_bottom' : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '>
- <ul class="reset clearfix">
- ', implode('', $buttons), '
- </ul>
- </div>';
- }
- ?>
|