-
-
Notifications
You must be signed in to change notification settings - Fork 447
New feature: Upload logo from backend #2580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
warleyelias
wants to merge
18
commits into
OpenMage:main
Choose a base branch
from
warleyelias:upload_logo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+120
−4
Open
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
01eecb6
rebase
fballiano bb33faf
license
fballiano 19602b4
license
fballiano 02e319c
Merge branch 'main' into upload_logo
fballiano 0a6386a
Merge branch 'main' into upload_logo
kiatng 87190d0
removed lines from gitignore
fballiano 77a6b33
PHPCS
fballiano 1904b69
PHPCS
fballiano 2e4c018
whitespace
fballiano 10bb7a0
unneeded whitespace
fballiano 3c2309a
PHPCS
fballiano 4311b37
fixed copyright notes
fballiano 5e8b808
PHPCS
fballiano 6e864b2
PHPCS
fballiano 822ec0a
Merge branch 'main' into upload_logo
fballiano bc47072
Removed GIF logos
fballiano 0afa449
Merge branch 'main' into upload_logo
sreichel d912f69
Merge branch 'main' into upload_logo
sreichel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Logo.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
OpenMage | ||
|
||
This source file is subject to the Academic Free License (AFL 3.0) | ||
that is bundled with this package in the file LICENSE_AFL.txt. | ||
It is also available at https://opensource.org/license/afl-3-0-php | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* System config image field backend model for Zend PDF generator | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Adminhtml_Model_System_Config_Backend_Image_Logo extends Mage_Adminhtml_Model_System_Config_Backend_Image | ||
{ | ||
/** | ||
* The tail part of directory path for uploading | ||
*/ | ||
const UPLOAD_DIR = 'header/logo'; | ||
|
||
/** | ||
* Token for the root part of directory path for uploading | ||
*/ | ||
const UPLOAD_ROOT_TOKEN = 'system/filesystem/media'; | ||
|
||
/** | ||
* Upload max file size in kilobytes | ||
* | ||
* @var int | ||
*/ | ||
protected $_maxFileSize = 2048; | ||
|
||
/** | ||
* Return path to directory for upload file | ||
* | ||
* @return string | ||
*/ | ||
protected function _getUploadDir() { | ||
$uploadDir = $this->_appendScopeInfo(self::UPLOAD_DIR); | ||
$uploadRoot = $this->_getUploadRoot(self::UPLOAD_ROOT_TOKEN); | ||
$uploadDir = $uploadRoot . DS . $uploadDir; | ||
return $uploadDir; | ||
} | ||
|
||
/** | ||
* Makes a decision about whether to add info about the scope | ||
* | ||
* @return boolean | ||
*/ | ||
protected function _addWhetherScopeInfo() { | ||
return true; | ||
} | ||
} | ||
39 changes: 39 additions & 0 deletions
39
app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Logosmall.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
OpenMage | ||
|
||
This source file is subject to the Academic Free License (AFL 3.0) | ||
that is bundled with this package in the file LICENSE_AFL.txt. | ||
It is also available at https://opensource.org/license/afl-3-0-php | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
/** | ||
* System config image field backend model for Zend PDF generator | ||
* | ||
* @category Mage | ||
* @package Mage_Adminhtml | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Mage_Adminhtml_Model_System_Config_Backend_Image_Logosmall extends Mage_Adminhtml_Model_System_Config_Backend_Image_Logo | ||
{ | ||
const UPLOAD_DIR = 'header/logo_small'; | ||
fballiano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* Return path to directory for upload file | ||
* | ||
* @return string | ||
*/ | ||
protected function _getUploadDir() | ||
{ | ||
$uploadDir = $this->_appendScopeInfo(self::UPLOAD_DIR); | ||
$uploadRoot = $this->_getUploadRoot(self::UPLOAD_ROOT_TOKEN); | ||
$uploadDir = $uploadRoot . DS . $uploadDir; | ||
return $uploadDir; | ||
} | ||
} | ||
fballiano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.