This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from blopa/develop
Develop
- Loading branch information
Showing
20 changed files
with
1,069 additions
and
442 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
40 changes: 40 additions & 0 deletions
40
...pp/code/Werules/Chatbot/Block/Adminhtml/System/Config/Form/Field/MessageQueueModeList.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,40 @@ | ||
<?php | ||
/** | ||
* Magento Chatbot Integration | ||
* Copyright (C) 2017 | ||
* | ||
* This file is part of Werules/Chatbot. | ||
* | ||
* Werules/Chatbot is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Werules\Chatbot\Block\Adminhtml\System\Config\Form\Field; | ||
|
||
class MessageQueueModeList implements \Magento\Framework\Option\ArrayInterface | ||
{ | ||
/** | ||
* Provide available options as a value/label array | ||
* | ||
* @return array | ||
*/ | ||
public function toOptionArray() | ||
{ | ||
return array( | ||
array('value' => 0, 'label' => __("None")), | ||
array('value' => 1, 'label' => __("Simple Restrictive")), | ||
array('value' => 2, 'label' => __("Restrictive")), | ||
array('value' => 3, 'label' => __("Non-restrictive")) | ||
); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
.../code/Werules/Chatbot/Block/Adminhtml/System/Config/Form/Field/MessageQueueModeSelect.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,53 @@ | ||
<?php | ||
/** | ||
* Magento Chatbot Integration | ||
* Copyright (C) 2017 | ||
* | ||
* This file is part of Werules/Chatbot. | ||
* | ||
* Werules/Chatbot is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
namespace Werules\Chatbot\Block\Adminhtml\System\Config\Form\Field; | ||
|
||
class MessageQueueModeSelect extends \Magento\Framework\View\Element\Html\Select | ||
{ | ||
/** | ||
* @var \Werules\Chatbot\Block\Adminhtml\System\Config\Form\Field\MessageQueueModeList | ||
*/ | ||
protected $_messageQueueModeList; | ||
|
||
public function __construct( | ||
\Werules\Chatbot\Block\Adminhtml\System\Config\Form\Field\MessageQueueModeList $messageQueueModeList, | ||
\Magento\Backend\Block\Template\Context $context, array $data = array()) | ||
{ | ||
parent::__construct($context, $data); | ||
$this->_messageQueueModeList = $messageQueueModeList; | ||
} | ||
|
||
public function _toHtml() | ||
{ | ||
if (!$this->getOptions()) { | ||
foreach ($this->_messageQueueModeList->toOptionArray() as $option) { | ||
$this->addOption($option['value'], $option['label']); | ||
} | ||
} | ||
return parent::_toHtml(); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return $this->getInputName(); | ||
} | ||
} |
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
Oops, something went wrong.