-
Notifications
You must be signed in to change notification settings - Fork 15
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 #119 from khairedweb/create_phing
Fix media download path in redshop plugin
- Loading branch information
Showing
3 changed files
with
65 additions
and
2 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
34 changes: 34 additions & 0 deletions
34
plugins/3rd_party/plg_redmigrator_redshop/schemas/joomla15/redshop_media.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,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; | ||
} | ||
} | ||
?> |
31 changes: 31 additions & 0 deletions
31
plugins/3rd_party/plg_redmigrator_redshop/schemas/joomla15/redshop_media_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,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; | ||
} | ||
} | ||
?> |