PageRenderTime 56ms CodeModel.GetById 29ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/Varien/Data/Form/Element/Link.php

https://bitbucket.org/kdms/sh-magento
PHP | 68 lines | 24 code | 3 blank | 41 comment | 0 complexity | 2ae88b33a455d5d5738b3760179e9db4 MD5 | raw file
  1. <?php
  2. /**
  3. * Magento Enterprise Edition
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Magento Enterprise Edition License
  8. * that is bundled with this package in the file LICENSE_EE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://www.magentocommerce.com/license/enterprise-edition
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Varien
  22. * @package Varien_Data
  23. * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
  24. * @license http://www.magentocommerce.com/license/enterprise-edition
  25. */
  26. /**
  27. * Varien Form element renderer to display link element
  28. *
  29. * @category Varien
  30. * @package Varien_Data
  31. * @author Magento Core Team <core@magentocommerce.com>
  32. */
  33. class Varien_Data_Form_Element_Link extends Varien_Data_Form_Element_Abstract
  34. {
  35. public function __construct($attributes=array())
  36. {
  37. parent::__construct($attributes);
  38. $this->setType('link');
  39. }
  40. /**
  41. * Generates element html
  42. *
  43. * @return string
  44. */
  45. public function getElementHtml()
  46. {
  47. $html = $this->getBeforeElementHtml();
  48. $html .= '<a id="'.$this->getHtmlId().'" '.$this->serialize($this->getHtmlAttributes()).'>'. $this->getEscapedValue() . "</a>\n";
  49. $html .= $this->getAfterElementHtml();
  50. return $html;
  51. }
  52. /**
  53. * Prepare array of anchor attributes
  54. *
  55. * @return array
  56. */
  57. public function getHtmlAttributes()
  58. {
  59. return array('charset', 'coords', 'href', 'hreflang', 'rel', 'rev', 'name',
  60. 'shape', 'target', 'accesskey', 'class', 'dir', 'lang', 'style',
  61. 'tabindex', 'title', 'xml:lang', 'onblur', 'onclick', 'ondblclick',
  62. 'onfocus', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover',
  63. 'onmouseup', 'onkeydown', 'onkeypress', 'onkeyup');
  64. }
  65. }