PasswordToggleButton.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /* * ********************************************************************
  3. * ZimbraEmail product developed. (May 7, 2018)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\Servers\ZimbraEmail\Core\UI\Widget\Others;
  20. use \ModulesGarden\Servers\ZimbraEmail\Core\UI\Builder\BaseContainer;
  21. /**
  22. * Description of PasswordHiddenButton
  23. *
  24. * @author Pawel Kopec <pawelk@modulesgardne.com>
  25. */
  26. class PasswordToggleButton extends BaseContainer
  27. {
  28. protected $iconOn = 'lu-zmdi lu-zmdi-eye';
  29. protected $iconOff = 'lu-zmdi lu-zmdi-eye-off';
  30. private $password;
  31. protected $vueComponent = true;
  32. protected $defaultVueComponentName = 'mg-passtoogle';
  33. public function getIconOn()
  34. {
  35. return $this->iconOn;
  36. }
  37. public function getIconOff()
  38. {
  39. return $this->iconOff;
  40. }
  41. public function setIconOn($iconOn)
  42. {
  43. $this->iconOn = $iconOn;
  44. return $this;
  45. }
  46. public function setIconOff($iconOff)
  47. {
  48. $this->iconOff = $iconOff;
  49. return $this;
  50. }
  51. public function getPassword()
  52. {
  53. return $this->password;
  54. }
  55. public function setPassword($password)
  56. {
  57. $this->password = $password;
  58. return $this;
  59. }
  60. public function getPasswordHidden(){
  61. return str_repeat('*', strlen($this->getPassword()));
  62. }
  63. }