-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
d0d0df5
commit 7fa6278
Showing
96 changed files
with
5,181 additions
and
5,135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
62 changes: 62 additions & 0 deletions
62
app/code/community/Mollie/Mpm/Block/Adminhtml/Render/Heading.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,62 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
* DAMAGE. | ||
* | ||
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. (info@mollie.nl) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
class Mollie_Mpm_Block_Adminhtml_Render_Heading extends Mage_Adminhtml_Block_Abstract | ||
implements Varien_Data_Form_Element_Renderer_Interface | ||
{ | ||
|
||
/** | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* | ||
* @return string | ||
*/ | ||
public function render(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$html = sprintf( | ||
'<tr id="row_%s"> | ||
<td colspan="5"> | ||
<h4 id="%s" style="border-bottom: 1px solid #dddddd;padding: 20px 5px 5px 5px;">%s</h4> | ||
<div class="comment"> | ||
<span>%s</span> | ||
</div> | ||
</td> | ||
</tr>', | ||
$element->getHtmlId(), | ||
$element->getHtmlId(), | ||
$element->getLabel(), | ||
$element->getComment() | ||
); | ||
|
||
return $html; | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
app/code/community/Mollie/Mpm/Block/Adminhtml/Render/Note.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 | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
* DAMAGE. | ||
* | ||
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. (info@mollie.nl) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
class Mollie_Mpm_Block_Adminhtml_Render_Note extends Mage_Adminhtml_Block_Abstract | ||
implements Varien_Data_Form_Element_Renderer_Interface | ||
{ | ||
|
||
/** | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* | ||
* @return string | ||
*/ | ||
public function render(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return sprintf( | ||
'<tr id="row_%s"> | ||
<td colspan="5" class="label" style="margin-bottom: 10px;">%s</td> | ||
</tr>', | ||
$element->getHtmlId(), | ||
$element->getLabel() | ||
); | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
app/code/community/Mollie/Mpm/Block/Adminhtml/Render/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
* DAMAGE. | ||
* | ||
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. (info@mollie.nl) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
class Mollie_Mpm_Block_Adminhtml_Render_Status extends Mage_Adminhtml_Block_Abstract | ||
implements Varien_Data_Form_Element_Renderer_Interface | ||
{ | ||
|
||
/** | ||
* Mollie Payments Model. | ||
* | ||
* @var Mollie_Mpm_Model_Payments | ||
*/ | ||
public $molliePaymentsModel; | ||
/** | ||
* Mollie Methods Model. | ||
* | ||
* @var Mollie_Mpm_Model_Methods | ||
*/ | ||
public $mollieMethodsModel; | ||
/** | ||
* Mollie API Model. | ||
* | ||
* @var Mollie_Mpm_Model_Api | ||
*/ | ||
public $mollieModel; | ||
/** | ||
* Mollie Helper. | ||
* | ||
* @var Mollie_Mpm_Helper_Api | ||
*/ | ||
public $mollieHelper; | ||
/** | ||
* Path to template file in theme. | ||
* | ||
* @var string | ||
*/ | ||
protected $_template = 'mollie/mpm/system/config/status.phtml'; | ||
|
||
/** | ||
* Mollie_Mpm_Block_Adminhtml_System_Config_Status constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->mollieHelper = Mage::helper('mpm/api'); | ||
} | ||
|
||
/** | ||
* Render fieldset html. | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* | ||
* @return string | ||
*/ | ||
public function render(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$apiCheck = $this->mollieHelper->checkApiInstalled(); | ||
if ($apiCheck) { | ||
return $this->toHtml(); | ||
} else { | ||
return $this->mollieHelper->getPhpApiErrorMessage(); | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
app/code/community/Mollie/Mpm/Block/Adminhtml/Render/Version.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,62 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
* DAMAGE. | ||
* | ||
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. (info@mollie.nl) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
class Mollie_Mpm_Block_Adminhtml_Render_Version extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
|
||
/** | ||
* Mollie Helper. | ||
* | ||
* @var Mollie_Mpm_Helper_Data | ||
*/ | ||
public $mollieHelper; | ||
|
||
/** | ||
* Mollie_Mpm_Block_Adminhtml_Render_Version constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->mollieHelper = Mage::helper('mpm'); | ||
} | ||
|
||
/** | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* | ||
* @return mixed | ||
*/ | ||
public function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->mollieHelper->getModuleVersion(); | ||
} | ||
} |
93 changes: 93 additions & 0 deletions
93
app/code/community/Mollie/Mpm/Block/Adminhtml/System/Config/Form/Apitest/Button.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,93 @@ | ||
<?php | ||
/** | ||
* Copyright (c) 2012-2018, Mollie B.V. | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* | ||
* - Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* - Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY | ||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
* DAMAGE. | ||
* | ||
* @category Mollie | ||
* @package Mollie_Mpm | ||
* @author Mollie B.V. (info@mollie.nl) | ||
* @copyright Copyright (c) 2012-2018 Mollie B.V. (https://www.mollie.nl) | ||
* @license http://www.opensource.org/licenses/bsd-license.php BSD-License 2 | ||
*/ | ||
|
||
class Mollie_Mpm_Block_Adminhtml_System_Config_Form_Apitest_Button | ||
extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
|
||
/** | ||
* @var Mage_Adminhtml_Helper_Data | ||
*/ | ||
public $helper; | ||
|
||
/** | ||
* @inheritdoc. | ||
*/ | ||
public function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('mollie/mpm/system/config/apitest_button.phtml'); | ||
$this->helper = Mage::helper('adminhtml'); | ||
} | ||
|
||
/** | ||
* Return element html | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* | ||
* @return string | ||
*/ | ||
public function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->_toHtml(); | ||
} | ||
|
||
/** | ||
* Return ajax url for button | ||
* | ||
* @return string | ||
*/ | ||
public function getAjaxCheckUrl() | ||
{ | ||
return $this->helper->getUrl('adminhtml/adminhtml_mollie/apitest'); | ||
} | ||
|
||
/** | ||
* Generate button html | ||
* | ||
* @return string | ||
*/ | ||
public function getButtonHtml() | ||
{ | ||
$button = $this->getLayout()->createBlock('adminhtml/widget_button') | ||
->setData( | ||
array( | ||
'id' => 'apitest_check_button', | ||
'label' => $this->helper('adminhtml')->__('Test API key'), | ||
'onclick' => 'javascript:checkApikey(); return false;' | ||
) | ||
); | ||
|
||
return $button->toHtml(); | ||
} | ||
} |
Oops, something went wrong.