54 lines
1.7 KiB
PHP
Executable File
54 lines
1.7 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Magezon
|
|
*
|
|
* This source file is subject to the Magezon Software License, which is available at https://www.magezon.com/license/.
|
|
* Do not edit or add to this file if you wish to upgrade the to newer versions in the future.
|
|
* If you wish to customize this module for your needs.
|
|
* Please refer to https://www.magezon.com for more information.
|
|
*
|
|
* @category Magezon
|
|
* @package Magezon_QuickOrder
|
|
* @copyright Copyright (C) 2018 Magezon (https://www.magezon.com)
|
|
*/
|
|
|
|
namespace Magezon\QuickOrder\Block;
|
|
|
|
class Link extends \Magento\Framework\View\Element\Html\Link
|
|
{
|
|
/**
|
|
* @var \Magezon\QuickOrder\Helper\Data
|
|
*/
|
|
protected $dataHelper;
|
|
|
|
/**
|
|
* @param \Magento\Framework\View\Element\Template\Context $context
|
|
* @param \Magezon\QuickOrder\Helper\Data $dataHelper
|
|
* @param array $data
|
|
*/
|
|
public function __construct(
|
|
\Magento\Framework\View\Element\Template\Context $context,
|
|
\Magezon\QuickOrder\Helper\Data $dataHelper,
|
|
array $data = []
|
|
) {
|
|
parent::__construct($context, $data);
|
|
$this->dataHelper = $dataHelper;
|
|
}
|
|
|
|
/**
|
|
* Render block HTML
|
|
*
|
|
* @return string
|
|
*/
|
|
protected function _toHtml()
|
|
{
|
|
if (!$this->dataHelper->getConfig('general/show_toplinks')) {
|
|
return;
|
|
}
|
|
$route = $this->dataHelper->getConfig('general/route');
|
|
$title = $this->dataHelper->getTitle();
|
|
if ($route && $title && $this->dataHelper->isGroupValid()) {
|
|
return '<li><a href="' . $this->getUrl($route) . '" >' . $title . '</a></li>';
|
|
}
|
|
}
|
|
} |