Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
magenizr committed May 8, 2023
1 parent 60f84ed commit bffd904
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 55 deletions.
5 changes: 1 addition & 4 deletions Block/Adminhtml/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/

namespace Magenizr\AdminBranding\Block\Adminhtml;

/**
* Class Dashboard
*/
class Login extends \Magento\Framework\View\Element\Template
{
/**
Expand Down
24 changes: 14 additions & 10 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/

Expand All @@ -15,10 +15,10 @@
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
/* Section in core config data */
const SECTION = 'admin/magenizr_adminbranding';
private const SECTION = 'admin/magenizr_adminbranding';

/* Name of upload directory in ./media/ */
const UPLOAD_DIR = 'magenizr_adminbranding';
public const UPLOAD_DIR = 'magenizr_adminbranding';

/**
* @var \Magento\Framework\App\Filesystem\DirectoryList
Expand All @@ -36,7 +36,9 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper
private $fileSystem;

/**
* Data constructor.
* Init constructor
*
* @param \Magento\Framework\Filesystem\Driver\File $fileSystem
* @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param \Magento\Framework\App\Helper\Context $context
Expand All @@ -55,15 +57,17 @@ public function __construct(
}

/**
* @param $image
* @param $enabled
* @param $file
* Get path for new admin logo
*
* @param string $image
* @param boolean $enabled
* @param string $file
* @return bool|string
*/
public function getAdminLogoSrc($image, $enabled, $file)
{
// Return default image if not enabled
if (!$this->isSetFlag($enabled) || !$this->isEnabled()) {
if (!$this->isSetFlag($enabled) || !$this->isEnabled() || !$this->getScopeConfig($file)) {
return $image;
}

Expand Down Expand Up @@ -111,7 +115,7 @@ public function isEnabled()
/**
* Use isSetFlag to check boolean fields
*
* @param $field
* @param string $field
* @return mixed
*/
public function isSetFlag($field)
Expand All @@ -125,7 +129,7 @@ public function isSetFlag($field)
/**
* Get module configuration values from core_config_data
*
* @param $field
* @param string $field
* @return mixed
*/
public function getScopeConfig($field)
Expand Down
6 changes: 1 addition & 5 deletions Model/Config/Backend/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/

namespace Magenizr\AdminBranding\Model\Config\Backend;

/**
* Class Image
*
*/
class Image extends \Magento\Config\Model\Config\Backend\Image
{
// @codingStandardsIgnoreStart
Expand Down
36 changes: 13 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,17 @@ Create a unique Magento admin login by adding your company logo or a custom text

## System Requirements
- Magento 2.3.x, 2.4.x
- PHP 5.6.x, 7.x

## Installation (Composer)

1. Update your composer.json `composer require "magenizr/magento2-adminbranding":"1.0.1" --no-update`
2. Install dependencies and update your composer.lock `composer update --lock`

```
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing magenizr/magento2-adminbranding (1.0.1): Downloading (100%)
Writing lock file
Generating autoload files
```
- PHP 7.x

## Installation (Composer 2)

1. Update your composer.json `composer require "magenizr/magento2-adminbranding":"1.0.1" --no-update`
1. Update your composer.json `composer require "magenizr/magento2-adminbranding":"^1.0" --no-update`
2. Use `composer update magenizr/magento2-adminbranding --no-install` to update your composer.lock file.

```
Updating dependencies
Lock file operations: 1 install, 1 update, 0 removals
- Locking magenizr/magento2-adminbranding (1.0.1)
- Locking magenizr/magento2-adminbranding (1.0.2)
```

3. And then `composer install` to install the package.
Expand All @@ -39,25 +24,23 @@ Lock file operations: 1 install, 1 update, 0 removals
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 1 install, 0 update, 0 removals
- Installing magenizr/magento2-adminbranding (1.0.1): Extracting archive
- Installing magenizr/magento2-adminbranding (1.0.2): Extracting archive
```

4. Enable the module and clear static content.

```
php bin/magento module:enable Magenizr_AdminBranding --clear-static-content
php bin/magento setup:upgrade
```

## Installation (Manually)
1. Download the code.
2. Extract the downloaded tar.gz file. Example: `tar -xzf Magenizr_AdminBranding_1.0.1.tar.gz`.
2. Extract the downloaded tar.gz file. Example: `tar -xzf Magenizr_AdminBranding_1.0.2.tar.gz`.
3. Copy the code into `./app/code/Magenizr/AdminBranding/`.
4. Enable the module and clear static content.

```
php bin/magento module:enable Magenizr_AdminBranding --clear-static-content
php bin/magento setup:upgrade
```

## Features
Expand All @@ -69,7 +52,7 @@ php bin/magento setup:upgrade
Go to `Stores > Configuration > Advanced > Admin > Admin Branding` and enable the module. Upload your company logo for the login form or above the sidebar. An additional text can be added and enabled below the login form.

## Support
If you experience any issues, don't hesitate to open an issue on [Github](https://github.com/magenizr/Magenizr_AdminBranding/issues). For a custom build, contact us on [Magento Marketplace](https://marketplace.magento.com/partner/magenizr).
If you experience any issues, don't hesitate to open an issue on [Github](https://github.com/magenizr/Magenizr_AdminBranding/issues).

## Purchase
This module is available for free on [GitHub](https://github.com/magenizr).
Expand All @@ -78,6 +61,13 @@ This module is available for free on [GitHub](https://github.com/magenizr).
Follow us on [GitHub](https://github.com/magenizr), [Twitter](https://twitter.com/magenizr) and [Facebook](https://www.facebook.com/magenizr).

## History
===== 1.0.2 =====
* 2.4.6 compatibility tested
* Fix styling to support small logos
* Code improvements
* Setup version removed from module.xml
* PHP 5.6.x compatibility removed

===== 1.0.1 =====
* Cleanup various files to follow coding standard (EQP, ECG)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magenizr/magento2-adminbranding",
"description": "Admin Branding allows you to replace the Magento® logo on the admin login page as well as on the dashboard. In addition to that, you can display a custom text and link your clients directly to your issue tracking plattform like JIRA or Zendesk.",
"type": "magento2-module",
"version": "1.0.1",
"version": "1.0.2",
"license": [
"OSL-3.0"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/acl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->
Expand Down
3 changes: 2 additions & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->
Expand All @@ -15,6 +15,7 @@
<enabled>0</enabled>
<magento_admin_login_logo_file_enabled>0</magento_admin_login_logo_file_enabled>
<magento_admin_menu_logo_file_enabled>0</magento_admin_menu_logo_file_enabled>
<magento_admin_menu_logo_file></magento_admin_menu_logo_file>
<magento_adminlogin_additional_text_enabled>0</magento_adminlogin_additional_text_enabled>
<magento_adminlogin_additional_text><![CDATA[Implemented by <a href="https://www.yourcompany.tld">Your Company Ltd.</a>]]></magento_adminlogin_additional_text>
</magenizr_adminbranding>
Expand Down
4 changes: 2 additions & 2 deletions etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magenizr_AdminBranding" setup_version="1.0.1">
<module name="Magenizr_AdminBranding">
<sequence>
<module name="Magento_Backend"/>
</sequence>
Expand Down
2 changes: 1 addition & 1 deletion registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/

Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/layout/admin_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/layout/adminhtml_auth_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->
Expand Down
5 changes: 4 additions & 1 deletion view/adminhtml/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Magenizr_AdminBranding::css/style.css"/>
</head>
<body>
<referenceBlock name="logo">
<arguments>
Expand Down
4 changes: 2 additions & 2 deletions view/adminhtml/templates/login.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/
-->

<?php if ($block->isAdditionalTextEnabled() && $block->getHelper()->isEnabled()) : ?>
<?php if ($block->isAdditionalTextEnabled() && $block->getHelper()->isEnabled()): ?>
<div id="magenizr-adminbranding">
<p class="border-top"><?= $block->getAdditionalText(); ?></p>
</div>
Expand Down
18 changes: 17 additions & 1 deletion view/adminhtml/web/css/style.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Magenizr AdminBranding
*
* @copyright Copyright (c) 2021 Magenizr (https://www.magenizr.com)
* @copyright Copyright (c) 2021 - 2023 Magenizr (https://www.magenizr.com)
* @license https://www.magenizr.com/license Magenizr EULA
*/

Expand All @@ -20,3 +20,19 @@
padding-top: 15px;
}
}

.menu-wrapper {

.logo {
.logo-img {
height: auto !important;
}
}
}

.adminhtml-auth-login {

.login-header {
text-align: center;
}
}

0 comments on commit bffd904

Please sign in to comment.