OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / templates / _layout / html / mod_menu / default_component.php
1 <?php
2
3 defined('_JEXEC') or die;
4
5 // Note. It is important to remove spaces between elements.
6 $attributes = array(
7     'class' => array($item->params->get('menu-anchor_css', '')),
8     'title' => $item->params->get('menu-anchor_title', ''));
9 switch ($item->browserNav) {
10     default:
11     case 0:
12         $attributes['href'] = $item->flink;
13         break;
14     case 1:
15         // _blank
16         $attributes['href'] = $item->flink;
17         $attributes['target'] = '_blank';
18         break;
19     case 2:
20         // window.open
21         $attributes['href'] = $item->flink;
22         $attributes['onclick'] = 'window.open(this.href,\'targetWindow\','
23             . '\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes\');return false;';
24         break;
25 }
26
27 $linktype = $item->menu_image
28     ? ('<img class="art-menu-image" src="' . $item->menu_image . '" alt="' . $item->title . '" />'
29         . ($item->params->get('menu_text', 1) ? $item->title : ''))
30     : $item->title;
31
32 if ('horizontal' == $menutype || 'vertical' == $menutype) {
33     if (in_array($item->id, $path))
34         $attributes['class'][] = 'active';
35     if ($params->get('startLevel') == $item->level)
36         $linktype = '<span class="l"></span><span class="r"></span><span class="t">' . $linktype . '</span>';
37 }
38 echo artxTagBuilder('a', $attributes, $linktype);