PageRenderTime 54ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/mod_menu/tmpl/default_component.php

https://github.com/joebushi/joomla
PHP | 35 lines | 19 code | 5 blank | 11 comment | 2 complexity | f556700f5f7ae2a75cb344efa65b52a5 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. <?php
  2. /**
  3. * @version $Id$
  4. * @package Joomla.Site
  5. * @subpackage mod_menu
  6. * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. // No direct access.
  10. defined('_JEXEC') or die;
  11. // Note. It is important to remove spaces between elements.
  12. $class = '';
  13. if ($item->active) :
  14. $class = 'active';
  15. endif;
  16. switch ($item->browserNav) :
  17. default:
  18. case 0:
  19. ?><a href="<?php echo $item->link; ?>" class="<?php echo $class;?>"><?php echo $item->title; ?></a><?php
  20. break;
  21. case 1:
  22. // _blank
  23. ?><a href="<?php echo $item->link; ?>" class="<?php echo $class;?>" target="_blank"><?php echo $item->title; ?></a><?php
  24. break;
  25. case 2:
  26. // window.open
  27. $attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$this->_params->get('window_open');
  28. ?><a href="<?php echo $item->link.'&tmpl=component'; ?>" class="<?php echo $class;?>" onclick="window.open(this.href,'targetWindow','<?php echo $attribs;?>');return false;"><?php echo $item->title; ?></a><?php
  29. break;
  30. endswitch;