-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
norbert-feria-53
committed
Jul 27, 2017
1 parent
d812a28
commit 4907c39
Showing
7 changed files
with
490 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
61 changes: 61 additions & 0 deletions
61
app/code/Tawk/Widget/Controller/Adminhtml/StoreWidget/Index.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Tawk.to | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @copyright Copyright (c) 2016 Tawk.to | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
namespace Tawk\Widget\Controller\Adminhtml\StoreWidget; | ||
|
||
use Magento\Framework\Controller\Result\JsonFactory; | ||
use Magento\Backend\App\Action\Context; | ||
use Psr\Log\LoggerInterface; | ||
|
||
class Index extends \Magento\Backend\App\Action | ||
{ | ||
protected $resultJsonFactory; | ||
protected $logger; | ||
|
||
public function __construct(Context $context, JsonFactory $resultJsonFactory, LoggerInterface $logger) | ||
{ | ||
parent::__construct($context); | ||
$this->resultJsonFactory = $resultJsonFactory; | ||
$this->logger = $logger; | ||
} | ||
|
||
public function execute() | ||
{ | ||
$response = $this->resultJsonFactory->create(); | ||
$response->setHeader('Content-type', 'application/json'); | ||
|
||
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | ||
$model = $objectManager->get('Tawk\Widget\Model\Widget')->loadByForStoreId(filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING)); | ||
|
||
if(!$model->hasId()) { | ||
$model = $objectManager->get('Tawk\Widget\Model\Widget'); | ||
} | ||
|
||
$pageId = $model->getPageId(); | ||
$widgetId = $model->getWidgetId(); | ||
|
||
|
||
$alwaysdisplay = $model->getAlwaysDisplay(); | ||
$excludeurl = $model->getExcludeUrl(); | ||
|
||
$donotdisplay = $model->getDoNotDisplay(); | ||
$includeurl = $model->getIncludeUrl(); | ||
|
||
return $response->setData(['success' => TRUE,'pageid' => $pageId,'widgetid' => $widgetId,'alwaysdisplay' => $alwaysdisplay,'excludeurl' => $excludeurl,'donotdisplay' => $donotdisplay,'includeurl' => $includeurl]); | ||
} | ||
} |
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
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
Oops, something went wrong.