forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
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 magento#343 from magento-ogre/PR_Branch
[Ogre's] Synonym Management, Public PRs and Bugs
- Loading branch information
Showing
67 changed files
with
3,308 additions
and
161 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
72 changes: 72 additions & 0 deletions
72
app/code/Magento/Search/Api/Data/SynonymGroupInterface.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,72 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Search\Api\Data; | ||
|
||
/** | ||
* @api | ||
*/ | ||
interface SynonymGroupInterface | ||
{ | ||
/** | ||
* Gets group id | ||
* | ||
* @return int | ||
*/ | ||
public function getGroupId(); | ||
|
||
/** | ||
* Sets group id | ||
* | ||
* @param int $groupId | ||
* @return $this | ||
*/ | ||
public function setGroupId($groupId); | ||
|
||
/** | ||
* Gets synonym group | ||
* | ||
* @return string | ||
*/ | ||
public function getSynonymGroup(); | ||
|
||
/** | ||
* Sets synonym group | ||
* | ||
* @param string $synonymGroup | ||
* @return $this | ||
*/ | ||
public function setSynonymGroup($synonymGroup); | ||
|
||
/** | ||
* Gets store id | ||
* | ||
* @return int | ||
*/ | ||
public function getStoreId(); | ||
|
||
/** | ||
* Sets store id | ||
* | ||
* @param int $id | ||
* @return $this | ||
*/ | ||
public function setStoreId($id); | ||
|
||
/** | ||
* Gets website id | ||
* | ||
* @return int | ||
*/ | ||
public function getWebsiteId(); | ||
|
||
/** | ||
* Sets website id | ||
* | ||
* @param int $id | ||
* @return $this | ||
*/ | ||
public function setWebsiteId($id); | ||
} |
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
28 changes: 28 additions & 0 deletions
28
app/code/Magento/Search/Api/SynonymGroupRepositoryInterface.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,28 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Search\Api; | ||
|
||
/** | ||
* @api | ||
*/ | ||
interface SynonymGroupRepositoryInterface | ||
{ | ||
/** | ||
* Save synonym group data | ||
* | ||
* @param \Magento\Search\Api\Data\SynonymGroupInterface $synonymGroup | ||
* @return \Magento\Search\Api\Data\SynonymGroupInterface saved attribute set | ||
*/ | ||
public function save(\Magento\Search\Api\Data\SynonymGroupInterface $synonymGroup); | ||
|
||
/** | ||
* Remove given synonym group data | ||
* | ||
* @param \Magento\Search\Api\Data\SynonymGroupInterface $synonymGroup | ||
* @return bool | ||
*/ | ||
public function delete(\Magento\Search\Api\Data\SynonymGroupInterface $synonymGroup); | ||
} |
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,25 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Search\Block\Adminhtml; | ||
|
||
|
||
/** | ||
* Adminhtml synonym group content block | ||
*/ | ||
class Synonyms extends \Magento\Backend\Block\Widget\Grid\Container | ||
{ | ||
/** | ||
* @return void | ||
*/ | ||
protected function _construct() | ||
{ | ||
$this->_blockGroup = 'Magento_Search'; | ||
$this->_controller = 'adminhtml_synonyms'; | ||
$this->_headerText = __('Search Synonyms'); | ||
$this->_addButtonLabel = __('New Synonym Group'); | ||
parent::_construct(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
app/code/Magento/Search/Block/Adminhtml/Synonyms/Edit/BackButton.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,37 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Search\Block\Adminhtml\Synonyms\Edit; | ||
|
||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface; | ||
|
||
/** | ||
* Class BackButton | ||
*/ | ||
class BackButton extends GenericButton implements ButtonProviderInterface | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getButtonData() | ||
{ | ||
return [ | ||
'label' => __('Back'), | ||
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()), | ||
'class' => 'back', | ||
'sort_order' => 10 | ||
]; | ||
} | ||
|
||
/** | ||
* Get URL for back (reset) button | ||
* | ||
* @return string | ||
*/ | ||
public function getBackUrl() | ||
{ | ||
return $this->getUrl('*/*/'); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
app/code/Magento/Search/Block/Adminhtml/Synonyms/Edit/DeleteButton.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,41 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Search\Block\Adminhtml\Synonyms\Edit; | ||
|
||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface; | ||
|
||
/** | ||
* Class DeleteButton | ||
*/ | ||
class DeleteButton extends GenericButton implements ButtonProviderInterface | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getButtonData() | ||
{ | ||
$data = []; | ||
if ($this->getGroupId()) { | ||
$data = [ | ||
'label' => __('Delete Synonym Group'), | ||
'class' => 'delete', | ||
'on_click' => 'deleteConfirm(\'' | ||
. __('Are you sure you want to delete this synonym group?') | ||
. '\', \'' . $this->getDeleteUrl() . '\')', | ||
'sort_order' => 20, | ||
]; | ||
} | ||
return $data; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDeleteUrl() | ||
{ | ||
return $this->getUrl('*/*/delete', ['group_id' => $this->getGroupId()]); | ||
} | ||
} |
Oops, something went wrong.