Skip to content

Commit

Permalink
Merge pull request #119 from khairedweb/create_phing
Browse files Browse the repository at this point in the history
Fix media download path in redshop plugin
  • Loading branch information
khairedweb committed Jan 23, 2014
2 parents 9eef4c3 + e2ec344 commit fcac11e
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@

<table title="redSHOP Field value" tbl_key="" destination="redshop_fields_value" type="redshop" class="RedMigratorRedshopFieldValue">redshop_fields_value</table>

<table title="redSHOP Cron" tbl_key="" destination="redshop_cron" type="redshop" class="RedMigratorRedshopCron">redshop_cron</table>

<table title="redSHOP Giftcard" tbl_key="" destination="redshop_giftcard" type="redshop" class="RedMigratorRedshopGiftcard">redshop_giftcard</table>

<table title="redSHOP Mail" tbl_key="" destination="redshop_mail" type="redshop" class="RedMigratorRedshopMail">redshop_mail</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* @package RedMIGRATOR.Backend
* @subpackage Controller
*
* @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*
* redMIGRATOR is based on JUpgradePRO made by Matias Aguirre
*/

class RedMigratorRedshopMedia extends RedMigrator
{
public function dataHook($rows)
{
// Do some custom post processing on the list.
foreach ($rows as &$row)
{
$row = (array) $row;

if ($row['media_type'] == "download")
{
$arrMediaName = explode("/", $row['media_name']);

$filename = $arrMediaName[count($arrMediaName) - 1];

$row['media_name'] = JPATH_ROOT . '/components/com_redshop/assets/download/product/' . $filename;
}
}

return $rows;
}
}
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* @package RedMIGRATOR.Backend
* @subpackage Controller
*
* @copyright Copyright (C) 2005 - 2013 redCOMPONENT.com. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*
* redMIGRATOR is based on JUpgradePRO made by Matias Aguirre
*/

class RedMigratorRedshopMediaDownload extends RedMigrator
{
public function dataHook($rows)
{
// Do some custom post processing on the list.
foreach ($rows as &$row)
{
$row = (array) $row;

$arrName = explode("/", $row['name']);

$filename = $arrName[count($arrName) - 1];

$row['name'] = JPATH_ROOT . '/components/com_redshop/assets/download/product/' . $filename;
}

return $rows;
}
}
?>

0 comments on commit fcac11e

Please sign in to comment.