-
Notifications
You must be signed in to change notification settings - Fork 116
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 #1127 from algolia/develop
Develop
- Loading branch information
Showing
46 changed files
with
586 additions
and
2,961 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
2 changes: 1 addition & 1 deletion
2
...asearch/Block/Adminhtml/IndexingQueue.php → ...asearch/Block/Adminhtml/Indexingqueue.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
2 changes: 1 addition & 1 deletion
2
...ch/Block/Adminhtml/IndexingQueue/Edit.php → ...ch/Block/Adminhtml/Indexingqueue/Edit.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
2 changes: 1 addition & 1 deletion
2
...ock/Adminhtml/IndexingQueue/Edit/Form.php → ...ock/Adminhtml/Indexingqueue/Edit/Form.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
2 changes: 1 addition & 1 deletion
2
...ch/Block/Adminhtml/IndexingQueue/Grid.php → ...ch/Block/Adminhtml/Indexingqueue/Grid.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
2 changes: 1 addition & 1 deletion
2
...html/IndexingQueue/Grid/Renderer/Json.php → ...html/Indexingqueue/Grid/Renderer/Json.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
2 changes: 1 addition & 1 deletion
2
.../Block/Adminhtml/IndexingQueue/Status.php → .../Block/Adminhtml/Indexingqueue/Status.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
2 changes: 1 addition & 1 deletion
2
...earch/Block/Adminhtml/ReindexSku/Edit.php → ...earch/Block/Adminhtml/Reindexsku/Edit.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
2 changes: 1 addition & 1 deletion
2
.../Block/Adminhtml/ReindexSku/Edit/Form.php → .../Block/Adminhtml/Reindexsku/Edit/Form.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
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
41 changes: 41 additions & 0 deletions
41
app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/ClickAnalytics.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 | ||
|
||
class Algolia_Algoliasearch_Block_System_Config_Form_Field_ClickAnalytics extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
protected $_showUpsell = false; | ||
|
||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
if (!$this->isClickAnalyticsEnabled($element)) { | ||
$element->setDisabled(true); | ||
$this->_showUpsell = true; | ||
} | ||
|
||
return parent::_getElementHtml($element); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isClickAnalyticsEnabled() | ||
{ | ||
$proxyHelper = Mage::helper('algoliasearch/proxyHelper'); | ||
$info = $proxyHelper->getClientConfigurationData(); | ||
|
||
return isset($info['click_analytics']) && $info['click_analytics'] == 1; | ||
} | ||
|
||
protected function _decorateRowHtml($element, $html) | ||
{ | ||
if (!$this->_showUpsell) { | ||
return parent::_decorateRowHtml($element, $html); | ||
} | ||
|
||
$additionalRow = '<tr class="algoliasearch-messages"><td colspan="3"><div class="algoliasearch-config-info icon-stars">'; | ||
$additionalRow .= $this->__('To get access to this Algolia feature, please consider <a href="%s" target="_blank">upgrading to a higher plan.</a>', | ||
'https://www.algolia.com/pricing/'); | ||
$additionalRow .= '</div></td></tr>'; | ||
|
||
return '<tr id="row_' . $element->getHtmlId() . '">' . $html . '</tr>' . $additionalRow; | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/Logo.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,42 @@ | ||
<?php | ||
|
||
class Algolia_Algoliasearch_Block_System_Config_Form_Field_Logo extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
protected $_showUpsell = false; | ||
|
||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
if ($this->showLogo($element)) { | ||
$element->setDisabled(true); | ||
$element->setValue(0); | ||
$this->_showUpsell = true; | ||
} | ||
|
||
return parent::_getElementHtml($element); | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function showLogo() | ||
{ | ||
$proxyHelper = Mage::helper('algoliasearch/proxyHelper'); | ||
$info = $proxyHelper->getClientConfigurationData(); | ||
|
||
return isset($info['require_logo']) && $info['require_logo'] == 1; | ||
} | ||
|
||
protected function _decorateRowHtml($element, $html) | ||
{ | ||
if (!$this->_showUpsell) { | ||
return parent::_decorateRowHtml($element, $html); | ||
} | ||
|
||
$additionalRow = '<tr class="algoliasearch-messages"><td></td><td colspan="3"><div class="algoliasearch-config-info icon-stars">'; | ||
$additionalRow .= $this->__('To be able to remove the Algolia logo, please consider <a href="%s" target="_blank">upgrading to a higher plan.</a>', | ||
'https://www.algolia.com/pricing/'); | ||
$additionalRow .= '</div></td></tr>'; | ||
|
||
return '<tr id="row_' . $element->getHtmlId() . '">' . $html . '</tr>' . $additionalRow; | ||
} | ||
} |
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.