Last active
September 22, 2022 19:52
-
-
Save katzueno/38e06de1d9e783f2e65b79b9642d9239 to your computer and use it in GitHub Desktop.
Disable Gravatar for Mautic
This file contains 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
<?php | |
/* | |
* @copyright 2014 Mautic Contributors. All rights reserved | |
* @author Mautic | |
* | |
* @link http://mautic.org | |
* | |
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
namespace Mautic\CoreBundle\Templating\Helper; | |
use Mautic\CoreBundle\Factory\MauticFactory; | |
use Mautic\CoreBundle\Helper\UrlHelper; | |
use Mautic\LeadBundle\Templating\Helper\AvatarHelper; | |
use Symfony\Component\Templating\Helper\Helper; | |
/** | |
* Class GravatarHelper. | |
*/ | |
class GravatarHelper extends Helper | |
{ | |
/** | |
* @var bool | |
*/ | |
private $devMode; | |
/** | |
* @var array | |
*/ | |
private $devHosts = []; | |
/** | |
* @var | |
*/ | |
private $imageDir; | |
/** | |
* @var AssetsHelper | |
*/ | |
private $assetHelper; | |
/** | |
* @var AvatarHelper | |
*/ | |
private $avatarHelper; | |
/** | |
* @var null|\Symfony\Component\HttpFoundation\Request | |
*/ | |
private $request; | |
/** | |
* @param MauticFactory $factory | |
*/ | |
public function __construct(MauticFactory $factory) | |
{ | |
$this->devMode = $factory->getEnvironment() == 'dev'; | |
$this->imageDir = $factory->getSystemPath('images'); | |
$this->assetHelper = $factory->getHelper('template.assets'); | |
$this->avatarHelper = $factory->getHelper('template.avatar'); | |
$this->request = $factory->getRequest(); | |
$this->devHosts = (array) $factory->getParameter('dev_hosts'); | |
} | |
/** | |
* @param string $email | |
* @param string $size | |
* @param string $default | |
* | |
* @return string | |
*/ | |
public function getImage($email, $size = '250', $default = null) | |
{ | |
return 'https://www.mautic.org/media/images/default_avatar.png' : | |
// 任意の人物アイコン画像ファイルに置き換え | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getName() | |
{ | |
return 'gravatar'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment