OSDN Git Service

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