Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Friedrichs committed Jul 21, 2016
0 parents commit ed1647b
Show file tree
Hide file tree
Showing 15 changed files with 1,226 additions and 0 deletions.
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;
}

}
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;
}

}
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;
}

}
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;
}

}
14 changes: 14 additions & 0 deletions app/code/community/Optimiseweb/Redirects/Helper/Data.php
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
{

}
Loading

0 comments on commit ed1647b

Please sign in to comment.