This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Leo Friedrichs
committed
Jul 21, 2016
0 parents
commit ed1647b
Showing
15 changed files
with
1,226 additions
and
0 deletions.
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
app/code/community/Optimiseweb/Redirects/Block/Adminhtml/System/Config/Fieldset/Hint.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,92 @@ | ||
<?php | ||
|
||
/** | ||
* Optimiseweb Redirects Block Adminhtml System Config Fieldset Hint | ||
* | ||
* @package Optimiseweb_Redirects | ||
* @author Kathir Vel ([email protected]) | ||
* @copyright Copyright (c) 2015 Kathir Vel | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Optimiseweb_Redirects_Block_Adminhtml_System_Config_Fieldset_Hint extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface | ||
{ | ||
|
||
protected $_template = 'optimiseweb/redirects/system/config/fieldset/hint.phtml'; | ||
|
||
/** | ||
* Render fieldset html | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
public function render(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->toHtml(); | ||
} | ||
|
||
public function getModuleName() | ||
{ | ||
return 'Mass 301 Redirects'; | ||
} | ||
|
||
public function getModuleVersion() | ||
{ | ||
return (string) Mage::getConfig()->getNode('modules/Optimiseweb_Redirects/version'); | ||
} | ||
|
||
public function getOptimisewebRedirectsVersion() | ||
{ | ||
return $this->getModuleVersion(); | ||
} | ||
|
||
public function getCheckExtensions() | ||
{ | ||
return array(); | ||
} | ||
|
||
public function getOptimiseWebUrl() | ||
{ | ||
$url = 'https://optimiseweb.co.uk?'; | ||
$url .= 'utm_source=Magento_Extension&utm_medium=Extension_Settings&utm_campaign=Optimiseweb_Redirects'; | ||
return $url; | ||
} | ||
|
||
public function getOptimiseWebEmailLink() | ||
{ | ||
$email = '[email protected]'; | ||
$emailLink = 'mailto:' . $email; | ||
return $emailLink; | ||
} | ||
|
||
public function getKathirVelUrl() | ||
{ | ||
$url = 'http://www.kathirvel.com?'; | ||
$url .= 'utm_source=Magento_Extension&utm_medium=Extension_Settings&utm_campaign=Optimiseweb_Redirects'; | ||
return $url; | ||
} | ||
|
||
public function getHelpDeskUrl() | ||
{ | ||
$url = 'https://optimiseweb.co.uk/magento-extension-support/?'; | ||
$url .= $this->getPxParams(); | ||
return $url; | ||
} | ||
|
||
public function getPxUrl() | ||
{ | ||
$url = 'https://optimiseweb.co.uk/magento-connect/assets/logo/optimiseweb.jpg'; | ||
return $url; | ||
} | ||
|
||
public function getPxParams() | ||
{ | ||
$v = $this->getModuleVersion(); | ||
$ext = 'Optimiseweb_Redirects_' . $v; | ||
$modulesArray = (array) Mage::getConfig()->getNode('modules')->children(); | ||
$aux = (array_key_exists('Enterprise_Enterprise', $modulesArray)) ? 'EE' : 'CE'; | ||
$mageVersion = Mage::getVersion(); | ||
$mage = 'Magento_' . $aux . '_' . $mageVersion; | ||
return 'extension=' . $ext . '&magento=' . $mage; | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download.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,47 @@ | ||
<?php | ||
|
||
/** | ||
* Optimiseweb Redirects Block System Config Backend Download | ||
* | ||
* @package Optimiseweb_Redirects | ||
* @author Kathir Vel ([email protected]) | ||
* @copyright Copyright (c) 2015 Kathir Vel | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Optimiseweb_Redirects_Block_System_Config_Backend_Download extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
|
||
/** | ||
* Get the system config field and insert a HTML link | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$store = Mage::app()->getRequest()->getParam('store'); | ||
$website = Mage::app()->getRequest()->getParam('website'); | ||
if ($store) { | ||
$storeData = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store)->getFirstItem(); | ||
$storeId = $storeData->getStoreId(); | ||
$fileName = Mage::getStoreConfig('optimisewebredirects/general/upload', $storeId); | ||
} elseif ($website) { | ||
$websiteData = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', $website)->getFirstItem(); | ||
$websiteId = $websiteData->getWebsiteId(); | ||
$fileName = Mage::app()->getWebsite($websiteId)->getConfig('optimisewebredirects/general/upload'); | ||
} else { | ||
$fileName = Mage::getStoreConfig('optimisewebredirects/general/upload'); | ||
} | ||
|
||
$this->setElement($element); | ||
|
||
if ($fileName) { | ||
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . $fileName; | ||
$html = "<a href='" . $url . "'>Download</a>"; | ||
} else { | ||
$html = "No CSV file provided."; | ||
} | ||
return $html; | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
app/code/community/Optimiseweb/Redirects/Block/System/Config/Backend/Download1.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,47 @@ | ||
<?php | ||
|
||
/** | ||
* Optimiseweb Redirects Block System Config Backend Download1 | ||
* | ||
* @package Optimiseweb_Redirects | ||
* @author Kathir Vel ([email protected]) | ||
* @copyright Copyright (c) 2015 Kathir Vel | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Optimiseweb_Redirects_Block_System_Config_Backend_Download1 extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
|
||
/** | ||
* Get the system config field and insert a HTML link | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$store = Mage::app()->getRequest()->getParam('store'); | ||
$website = Mage::app()->getRequest()->getParam('website'); | ||
if ($store) { | ||
$storeData = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store)->getFirstItem(); | ||
$storeId = $storeData->getStoreId(); | ||
$fileName = Mage::getStoreConfig('optimisewebredirects/redirects1/upload', $storeId); | ||
} elseif ($website) { | ||
$websiteData = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', $website)->getFirstItem(); | ||
$websiteId = $websiteData->getWebsiteId(); | ||
$fileName = Mage::app()->getWebsite($websiteId)->getConfig('optimisewebredirects/redirects1/upload'); | ||
} else { | ||
$fileName = Mage::getStoreConfig('optimisewebredirects/redirects1/upload'); | ||
} | ||
|
||
$this->setElement($element); | ||
|
||
if ($fileName) { | ||
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . $fileName; | ||
$html = "<a href='" . $url . "'>Download</a>"; | ||
} else { | ||
$html = "No CSV file provided."; | ||
} | ||
return $html; | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
...e/community/Optimiseweb/Redirects/Block/System/Config/Backend/Downloadquerystringfile.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,47 @@ | ||
<?php | ||
|
||
/** | ||
* Optimiseweb Redirects Block System Config Backend Downloadquerystringfile | ||
* | ||
* @package Optimiseweb_Redirects | ||
* @author Kathir Vel ([email protected]) | ||
* @copyright Copyright (c) 2015 Kathir Vel | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Optimiseweb_Redirects_Block_System_Config_Backend_Downloadquerystringfile extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
|
||
/** | ||
* Get the system config field and insert a HTML link | ||
* | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$store = Mage::app()->getRequest()->getParam('store'); | ||
$website = Mage::app()->getRequest()->getParam('website'); | ||
if ($store) { | ||
$storeData = Mage::getModel('core/store')->getCollection()->addFieldToFilter('code', $store)->getFirstItem(); | ||
$storeId = $storeData->getStoreId(); | ||
$fileName = Mage::getStoreConfig('optimisewebredirects/querystring/upload', $storeId); | ||
} elseif ($website) { | ||
$websiteData = Mage::getModel('core/website')->getCollection()->addFieldToFilter('code', $website)->getFirstItem(); | ||
$websiteId = $websiteData->getWebsiteId(); | ||
$fileName = Mage::app()->getWebsite($websiteId)->getConfig('optimisewebredirects/querystring/upload'); | ||
} else { | ||
$fileName = Mage::getStoreConfig('optimisewebredirects/querystring/upload'); | ||
} | ||
|
||
$this->setElement($element); | ||
|
||
if ($fileName) { | ||
$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'optimiseweb/redirects/' . $fileName; | ||
$html = "<a href='" . $url . "'>Download</a>"; | ||
} else { | ||
$html = "No CSV file provided."; | ||
} | ||
return $html; | ||
} | ||
|
||
} |
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,14 @@ | ||
<?php | ||
|
||
/** | ||
* Optimiseweb Redirects Data Helper | ||
* | ||
* @package Optimiseweb_Redirects | ||
* @author Kathir Vel ([email protected]) | ||
* @copyright Copyright (c) 2015 Kathir Vel | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Optimiseweb_Redirects_Helper_Data extends Mage_Core_Helper_Abstract | ||
{ | ||
|
||
} |
Oops, something went wrong.