Logo.php 994 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Theme\Model\Design\Backend;
  7. class Logo extends Image
  8. {
  9. /**
  10. * The tail part of directory path for uploading
  11. *
  12. */
  13. const UPLOAD_DIR = 'logo';
  14. /**
  15. * Return path to directory for upload file
  16. *
  17. * @return string
  18. * @throw \Magento\Framework\Exception\LocalizedException
  19. */
  20. protected function _getUploadDir()
  21. {
  22. return $this->_mediaDirectory->getRelativePath($this->_appendScopeInfo(static::UPLOAD_DIR));
  23. }
  24. /**
  25. * Makes a decision about whether to add info about the scope.
  26. *
  27. * @return boolean
  28. */
  29. protected function _addWhetherScopeInfo()
  30. {
  31. return true;
  32. }
  33. /**
  34. * Getter for allowed extensions of uploaded files.
  35. *
  36. * @return string[]
  37. */
  38. public function getAllowedExtensions()
  39. {
  40. return ['jpg', 'jpeg', 'gif', 'png'];
  41. }
  42. }