AlexeyUna %!s(int64=5) %!d(string=hai) anos
pai
achega
b3c4cef598

+ 18 - 0
modules/boonex/dolphin_migration/classes/BxDolMConfig.php

@@ -304,6 +304,24 @@ class BxDolMConfig extends BxBaseModGeneralConfig
         $this -> _bTransferEmpty = getParam('bx_dolphin_migration_empty_albums');
         $this -> _bUseNickName = getParam('bx_dolphin_migration_use_nickname');
         $this -> _iDefaultPrivacyGroup = (int)getParam('bx_dolphin_migration_default_privacy');
+        $this -> _bMediaModulesContent = getParam('bx_dolphin_migration_media_modules') == 'on';
+
+        if ($this->_bMediaModulesContent){
+            if ((int)BxDolModuleQuery::getInstance()->isEnabled('photos'))
+                unset($this->_aMigrationModules['photos_albums']);
+            else
+                unset($this->_aMigrationModules['photos']);
+
+            if ((int)BxDolModuleQuery::getInstance()->isEnabled('videos'))
+                unset($this->_aMigrationModules['videos_albums']);
+            else
+                unset($this->_aMigrationModules['videos']);
+        }
+         else
+         {
+             unset($this->_aMigrationModules['photos']);
+             unset($this->_aMigrationModules['videos']);
+         }
 
         parent::__construct($aModule);
 	}

+ 12 - 2
modules/boonex/dolphin_migration/classes/BxDolMData.php

@@ -221,7 +221,10 @@ class BxDolMData
 	 */
     protected function transferCategory($sName, $sPrefix, $sCategory, $iValue = 0, $sData = '')
 	{
-		if (strpos($sName, ';') !== false)
+		if (!$sName)
+		    return false;
+
+	    if (strpos($sName, ';') !== false)
 			$sName = substr($sName, 0, strpos($sName, ';'));
 		
 		$sTitle = str_replace(' ', '_', $sName);
@@ -412,7 +415,15 @@ class BxDolMData
 							$sCmtsTable = 'bx_photos_cmts_albums';
 							$sTable = 'bx_albums_cmts';
 							break;
+            case 'photo_albums_items':
+                            $sCmtsTable = 'bx_photos_cmts';
+                            $sTable = 'bx_albums_cmts_media';
+                            break;
 			case 'videos': 
+							$sCmtsTable = 'bx_videos_cmts';
+							$sTable = 'bx_videos_cmts';
+							break;
+			case 'video_albums_items':
 							$sCmtsTable = 'bx_videos_cmts';
 							$sTable = 'bx_albums_cmts_media';
 							break;
@@ -474,7 +485,6 @@ class BxDolMData
 										));
 
 				$iLastInsertId = $this -> _oDb -> lastId();
-
 				$this -> addCmtsIds($sTable, $iLastInsertId, $aValue['cmt_rate'], $aValue['cmt_rate_count']);
 				$aCommentsArray[$aValue['cmt_id']] = array(
 																'id' => $iLastInsertId,

+ 7 - 7
modules/boonex/dolphin_migration/classes/BxDolMPhotoAlbums.php

@@ -22,13 +22,13 @@ class BxDolMPhotoAlbums extends BxDolMData
 	public function __construct(&$oMigrationModule, &$oDb)
 	{
         parent::__construct($oMigrationModule, $oDb);
-		$this -> _sModuleName = 'photo_albums';
+		$this -> _sModuleName = 'photos_albums';
 		$this -> _sTableWithTransKey = 'bx_albums_albums';
     }
 	
 	public function getTotalRecords()
 	{
-		$aResult = $this -> _mDb -> getRow("SELECT COUNT(*) as `count`, SUM(`ObjCount`) as `obj` FROM `" . $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['table_name_albums'] ."` WHERE `Type` = 'bx_photos' AND `Uri` <> 'Hidden'");
+        $aResult = $this -> _mDb -> getRow("SELECT COUNT(*) as `count`, SUM(`ObjCount`) as `obj` FROM `" . $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['table_name_albums'] ."` WHERE `Type` = 'bx_photos' AND `Uri` <> 'Hidden'");
 		return !(int)$aResult['count'] && !(int)$aResult['obj'] ? 0 : $aResult;
 	}
     
@@ -103,7 +103,7 @@ class BxDolMPhotoAlbums extends BxDolMData
        }        
 
         // set as finished;
-        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_photos_finished', $this -> _iTransferredAlbums, $this -> _iTransferred));
+        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_photos_albums_finished', $this -> _iTransferredAlbums, $this -> _iTransferred));
         return BX_MIG_SUCCESSFUL;
     }
    	
@@ -126,11 +126,11 @@ class BxDolMPhotoAlbums extends BxDolMData
 				$sFileName = "{$aValue['ID']}.{$aValue['Ext']}";
 			    if ($this -> isFileExisted($iProfileId, $sFileName, $aValue['Date']))
 					continue;
-				
+
 				$sImagePath = $this -> _sImagePhotoFiles . $sFileName;
 				if (file_exists($sImagePath))
 				{
-					$oStorage = BxDolStorage::getObjectInstance('bx_albums_files');
+				    $oStorage = BxDolStorage::getObjectInstance('bx_albums_files');
 					$iId = $oStorage -> storeFileFromPath($sImagePath, false, $iProfileId, $iNewAlbumID);
 					if ($iId)
 					{ 
@@ -139,7 +139,7 @@ class BxDolMPhotoAlbums extends BxDolMData
 						$sQuery = $this -> _oDb -> prepare("INSERT INTO `bx_albums_files2albums` SET `content_id` = ?, `file_id` = ?, `data` = ?, `title` = ?", $iNewAlbumID, $iId, $aValue['Size'], $aValue['Title']);
 						$this -> _oDb -> query($sQuery);
 						
-						$iCmts = $this -> transferComments($iItemId = $this -> _oDb -> lastId(), $aValue['ID'], 'album_photo');
+						$iCmts = $this -> transferComments($iItemId = $this -> _oDb -> lastId(), $aValue['ID'], 'photo_albums_items');
 						if ($iCmts)
 							$this -> _oDb -> query("UPDATE `bx_albums_files2albums` SET `comments` = :comments WHERE `id` = :id", array('id' => $iItemId, 'comments' => $iCmts));
 						
@@ -168,7 +168,7 @@ class BxDolMPhotoAlbums extends BxDolMData
         return $this -> _oDb -> query($sQuery);
     }
 
-	private function isFileExisted($iAuthor, $sTitle, $iDate){    	
+	private function isFileExisted($iAuthor, $sTitle, $iDate){
     	$sQuery  = $this -> _oDb ->  prepare("SELECT COUNT(*) FROM `bx_albums_files` WHERE `profile_id` = ? AND `file_name` = ? AND `added` = ? LIMIT 1", $iAuthor, $sTitle, $iDate);
         return (bool)$this -> _oDb -> getOne($sQuery);
     }

+ 24 - 18
modules/boonex/dolphin_migration/classes/BxDolMPhotos.php

@@ -23,11 +23,9 @@ class BxDolMPhotos extends BxDolMData
 	
 	public function getTotalRecords()
 	{
-		$aResult = $this -> _mDb -> getRow("SELECT COUNT(*) as `count`, SUM(`ObjCount`) as `obj` 
+		return $this -> _mDb -> getOne("SELECT SUM(`ObjCount`) 
                                             FROM `" . $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['table_name_photos'] ."` 
                                             WHERE `Type` = 'bx_photos' AND `Uri` <> 'Hidden'");
-
-		return !(int)$aResult['count'] && !(int)$aResult['obj'] ? 0 : $aResult;
 	}
     
 	public function runMigration()
@@ -55,11 +53,10 @@ class BxDolMPhotos extends BxDolMData
 				continue;
 
 			$this -> migratePhoto($aValue['ID'], $iProfileId);
-			$this -> _iTransferredPhotos++;
-       }        
+       }
 
         // set as finished;
-        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_photos_finished', 0, $this -> _iTransferred));
+        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_photos_finished', $this -> _iTransferred));
         return BX_MIG_SUCCESSFUL;
     }
    	
@@ -129,13 +126,12 @@ class BxDolMPhotos extends BxDolMData
                         $this -> _iTransferred++;
 						$iTransferred++;
 
-                        $this->_oDb->query("UPDATE `bx_photos_entries` SET `thumb`=:thumb WHERE `id`=:id", array('thumb' => $iId, 'id' => $iPhotoId));
-
                         $this->updateExif($iPhotoId, array('thumb' => $iId, 'id' => $iPhotoId));
 						$this->transferTags((int)$aValue['ID'], $iId, $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['type'], $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['keywords']);
 						$this->transferFavorites((int)$aValue['ID'], $iId);
+						$this->transferSVotes((int)$aValue['ID'], $iId);
 
-                        $this->_oDb->query("UPDATE `bx_photos_entries` SET `comments` = :comments WHERE `id` = :id", array('id' => $iPhotoId, 'comments' => $this->transferComments($iPhotoId, $aValue['ID'])));
+                        $this->_oDb->query("UPDATE `bx_photos_entries` SET `comments` = :comments, `thumb`=:thumb WHERE `id` = :id", array('id' => $iPhotoId, 'thumb' => $iId, 'comments' => $this->transferComments($iPhotoId, $aValue['ID'])));
 
                     }
 				}
@@ -144,18 +140,28 @@ class BxDolMPhotos extends BxDolMData
 	  return $iTransferred;
    }
 
-    private function transferFavorites($iPhotoId, $iNewID){
-        $aData = $this->_mDb->getRow("SELECT * FROM `bx_photos_favorites` WHERE `ID`=:id LIMIT 1", array('id' => $iPhotoId));
-        if (empty($aData))
-            return false;
+   private function transferFavorites($iPhotoId, $iNewID){
+      $aData = $this->_mDb->getRow("SELECT * FROM `bx_photos_favorites` WHERE `ID`=:id LIMIT 1", array('id' => $iPhotoId));
+      if (empty($aData))
+          return false;
+
+      $iProfileId = $this->getProfileId((int)$aData['Profile']);
+      if (!$iProfileId)
+          return false;
 
-        $iProfileId = $this -> getProfileId((int)$aData['Profile']);
-        if (!$iProfileId)
+      $sQuery = $this->_oDb->prepare("INSERT INTO `bx_photos_favorites_track` SET `object_id` = ?, `author_id` = ?, `date` = ?", $iNewID, $iProfileId, ($aData['Date'] ? $aData['Date'] : time()));
+      return $this->_oDb->query($sQuery);
+   }
+
+   private function transferSVotes($iPhotoId, $iNewID){
+        $aData = $this->_mDb->getRow("SELECT * FROM `bx_photos_rating` WHERE `gal_id`=:id LIMIT 1", array('id' => $iPhotoId));
+        if (empty($aData))
             return false;
 
-        $sQuery = $this -> _oDb -> prepare("INSERT INTO `bx_photos_favorites_track` SET `object_id` = ?, `author_id` = ?, `date` = ?", $iNewID, $iProfileId, ($aData['Date'] ? $aData['Date'] : time()));
-        return $this -> _oDb -> query($sQuery);
-    }
+        $sQuery = $this->_oDb->prepare("INSERT INTO `bx_photos_svotes` SET `object_id` = ?, `count` = ?, `sum` = ?", $iNewID, $aData['gal_rating_count'], $aData['gal_rating_sum']);
+        $this->_oDb->query("UPDATE `bx_photos_entries` SET `svotes` = :votes WHERE `id` = :id", array('id' => $iPhotoId, 'votes' => $aData['gal_rating_count']));
+        return $this->_oDb->query($sQuery);
+   }
 
 	public function removeContent()
 	{

+ 3 - 3
modules/boonex/dolphin_migration/classes/BxDolMVideoAlbums.php

@@ -27,7 +27,7 @@ class BxDolMVideoAlbums extends BxDolMData {
 	public function __construct(&$oMigrationModule, &$oDb)
 	{
         parent::__construct($oMigrationModule, $oDb);
-		$this -> _sModuleName = 'videos';
+		$this -> _sModuleName = 'videos_albums';
 		$this -> _sTableWithTransKey = 'bx_albums_albums';
 		$this -> _sVideoFilesPath = $this -> _oDb -> getExtraParam('root') . 'flash' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . "video" . DIRECTORY_SEPARATOR . "files" . DIRECTORY_SEPARATOR;
     }
@@ -106,7 +106,7 @@ class BxDolMVideoAlbums extends BxDolMData {
 			$this -> _iTransferredAlbums++;
        }        
 
-        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_videos_finished', $this -> _iTransferredAlbums, $this -> _iTransferred));
+        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_videos_albums_finished', $this -> _iTransferredAlbums, $this -> _iTransferred));
         return BX_MIG_SUCCESSFUL;
     }
    	
@@ -142,7 +142,7 @@ class BxDolMVideoAlbums extends BxDolMData {
 						$sQuery = $this -> _oDb -> prepare("INSERT INTO `bx_albums_files2albums` SET `content_id` = ?, `file_id` = ?, `title` = ?", $iNewAlbumID, $iId, $aValue['Title']);
 						$this -> _oDb -> query($sQuery);
 						
-						$iCmts = $this -> transferComments($iItemId = $this -> _oDb -> lastId(), $aValue['ID'], 'videos');
+						$iCmts = $this -> transferComments($iItemId = $this -> _oDb -> lastId(), $aValue['ID'], 'video_albums_items');
 						if ($iCmts)
 							$this -> _oDb -> query("UPDATE `bx_albums_files2albums` SET `comments` = :comments WHERE `id` = :id", array('id' => $iItemId, 'comments' => $iCmts));
 						

+ 187 - 0
modules/boonex/dolphin_migration/classes/BxDolMVideos.php

@@ -0,0 +1,187 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    DolphinMigration  Dolphin Migration
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once('BxDolMData.php');
+bx_import('BxDolStorage');
+	
+class BxDolMVideos extends BxDolMData
+{
+	private $_sVideoFilesPath;
+
+    public function __construct(&$oMigrationModule, &$oDb)
+	{
+        parent::__construct($oMigrationModule, $oDb);
+		$this -> _sModuleName = 'videos';
+		$this -> _sTableWithTransKey = 'bx_videos_entries';
+        $this -> _sVideoFilesPath = $this -> _oDb -> getExtraParam('root') . 'flash' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . "video" . DIRECTORY_SEPARATOR . "files" . DIRECTORY_SEPARATOR;
+
+    }
+	
+	public function getTotalRecords()
+	{
+		return $this -> _mDb -> getOne("SELECT SUM(`ObjCount`) as `obj` 
+                                            FROM `" . $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['table_name_videos'] ."` 
+                                            WHERE `Type` = 'bx_videos' AND `Uri` <> 'Hidden'");
+	}
+    
+	public function runMigration()
+	{
+		if (!$this -> getTotalRecords())
+		{
+			  $this -> setResultStatus(_t('_bx_dolphin_migration_no_data_to_transfer'));
+	          return BX_MIG_SUCCESSFUL;
+		}
+
+		$sWhereCount = '';
+		if ($this -> _oConfig -> _bTransferEmpty)
+            $sWhereCount = " AND `ObjCount` <> 0";
+
+		$this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_videos'));
+		
+		$this -> createMIdField();
+		$aResult = $this -> _mDb -> getAll("SELECT * FROM `" . $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['table_name_videos'] ."` 
+		                                    WHERE `Type` = 'bx_videos' AND `Uri` <> 'Hidden' {$sWhereCount} ORDER BY `ID` ASC");
+
+		foreach($aResult as $iKey => $aValue)
+		{ 			
+			$iProfileId = $this -> getProfileId((int)$aValue['Owner']);
+			if (!$iProfileId) 
+				continue;
+
+			$this -> migrateVideo($aValue['ID'], $iProfileId);
+       }
+
+        // set as finished;
+        $this -> setResultStatus(_t('_bx_dolphin_migration_started_migration_videos_finished', $this -> _iTransferred));
+        return BX_MIG_SUCCESSFUL;
+    }
+   	
+   /**
+	* Migrates all photo albums and users photos
+	* @param int $iAlbumId original albums id
+	* @param int $iProfileId una profile ID
+	* @param int $iNewPhotoId created una Album
+	* @return Integer
+         */  
+   private function migrateVideo($iAlbumId, $iProfileId){
+          $aResult = $this -> _mDb -> getAll("SELECT  `m`.*, `a`.`AllowAlbumView`, `a`.`Status` as `admin_status`, `m`.`Status` as `status`
+													FROM  `sys_albums_objects` as `o`
+													LEFT JOIN `sys_albums` as `a` ON `o`.`id_album` = `a`.`ID`
+													LEFT JOIN `" . $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['table_name'] ."` as `m` ON `o`.`id_object` = `m`.`ID`
+													WHERE  `o`.`id_album` = :album ORDER BY `o`.`id_object` ASC", array('album' => $iAlbumId));
+
+          $iTransferred = 0;
+		  foreach($aResult as $iKey => $aValue)
+		  {
+                $iVideoId = $this -> isItemExisted($aValue['ID']);
+                if ($iVideoId)
+                    continue;
+
+                $sVideoTitle = $aValue['Title'];
+                $sQuery = $this -> _oDb -> prepare(
+                        "
+								INSERT INTO
+									`bx_videos_entries`
+								SET
+									`author`   			= ?,
+									`added`      		= ?,
+									`changed`   		= ?,
+									`video`				= 0,
+									`title`				= ?,
+									`allow_view_to` 	= ?,
+									`text`				= ?,
+									`status_admin`		= ?,
+                                    `status`            = ?,
+                                    `cat`               = ?
+							 ",
+                        $iProfileId,
+                        $aValue['Date'] ? $aValue['Date'] : time(),
+                        $aValue['Date'] ? $aValue['Date'] : time(),
+                        $sVideoTitle,
+                        $this -> getPrivacy($aValue['Owner'], (int)$aValue['AllowAlbumView'], 'videos', 'album_view'),
+                        $aValue['Description'],
+                        $aValue['admin_status'] == 'active' ? 'active' : 'hidden',
+                        $aValue['status'] == 'approved' ? 'active' : 'hidden',
+                        $this -> transferCategory($aValue['Categories'], 'bx_videos', 'bx_videos_cats')
+                    );
+
+                    $this -> _oDb -> query($sQuery);
+                    if ($iVideoId = $this -> _oDb -> lastId())
+                        $this -> setMID($iVideoId, $aValue['ID']);
+                    else
+                        continue;
+
+			    $sFileName = "{$aValue['ID']}.m4v";
+			    $sVideoPath = $this -> _sVideoFilesPath . $sFileName;
+				if (file_exists($sVideoPath))
+				{
+					$oStorage = BxDolStorage::getObjectInstance('bx_videos_videos');
+					$iId = $oStorage -> storeFileFromPath($sVideoPath, false, $iProfileId, $iVideoId);
+					if ($iId)
+					{ 
+                        $this -> _iTransferred++;
+               			$this->transferTags((int)$aValue['ID'], $iId, $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['type'], $this -> _oConfig -> _aMigrationModules[$this -> _sModuleName]['keywords']);
+						$this->transferFavorites((int)$aValue['ID'], $iId);
+						$this->transferSVotes((int)$aValue['ID'], $iId);
+
+                        $this->_oDb->query("UPDATE `bx_videos_entries` SET `comments` = :comments, `video`=:video WHERE `id` = :id", array('id' => $iVideoId, 'video' => $iId, 'comments' => $this->transferComments($iVideoId, $aValue['ID'], 'videos')));
+                    }
+				}
+			}	
+				  
+	  return $iTransferred;
+   }
+
+    private function transferFavorites($iItemId, $iNewID){
+        $aData = $this->_mDb->getRow("SELECT * FROM `bx_videos_favorites` WHERE `ID`=:id LIMIT 1", array('id' => $iItemId));
+        if (empty($aData))
+            return false;
+
+        $iProfileId = $this -> getProfileId((int)$aData['Profile']);
+        if (!$iProfileId)
+            return false;
+
+        $sQuery = $this -> _oDb -> prepare("INSERT INTO `bx_videos_favorites_track` SET `object_id` = ?, `author_id` = ?, `date` = ?", $iNewID, $iProfileId, ($aData['Date'] ? $aData['Date'] : time()));
+        return $this -> _oDb -> query($sQuery);
+    }
+
+    private function transferSVotes($iItemId, $iNewID){
+        $aData = $this->_mDb->getRow("SELECT * FROM `bx_videos_rating` WHERE `gal_id`=:id LIMIT 1", array('id' => $iItemId));
+        if (empty($aData))
+            return false;
+
+        $sQuery = $this->_oDb->prepare("INSERT INTO `bx_videos_svotes` SET `object_id` = ?, `count` = ?, `sum` = ?", $iNewID, $aData['gal_rating_count'], $aData['gal_rating_sum']);
+        $this->_oDb->query("UPDATE `bx_videos_entries` SET `svotes` = :votes WHERE `id` = :id", array('id' => $iItemId, 'votes' => $aData['gal_rating_count']));
+        return $this->_oDb->query($sQuery);
+    }
+
+	public function removeContent()
+	{
+		if (!$this -> _oDb -> isTableExists($this -> _sTableWithTransKey) || !$this -> _oDb -> isFieldExists($this -> _sTableWithTransKey, $this -> _sTransferFieldIdent))
+			return false;
+		
+		$aRecords = $this -> _oDb -> getAll("SELECT * FROM `{$this -> _sTableWithTransKey}` WHERE `{$this -> _sTransferFieldIdent}` !=0");
+		$iNumber = 0;		
+		if (!empty($aRecords))
+		{		
+			foreach($aRecords as $iKey => $aValue)
+			{
+				BxDolService::call('bx_videos', 'delete_entity', array($aValue['id']));
+				$iNumber++;
+			}
+		}
+
+		parent::removeContent();
+		return $iNumber;
+	}
+}
+
+/** @} */

+ 9 - 4
modules/boonex/dolphin_migration/install/langs/en.xml

@@ -31,8 +31,10 @@
 	<string name="_bx_dolphin_migration_started_migration_profile_field_can_not_be_transferred"><![CDATA[Custom Fields can not be transferred]]></string>  
 	<string name="_bx_dolphin_migration_started_migration_blogs"><![CDATA[Blogs Migration was started]]></string>
 	<string name="_bx_dolphin_migration_started_migration_photos"><![CDATA[Photos Migration was started]]></string>
-	<string name="_bx_dolphin_migration_started_migration_photos_finished"><![CDATA[{0} Albums and {1} Photos were transferred]]></string>
-	<string name="_bx_dolphin_migration_started_migration_videos_finished"><![CDATA[{0} Albums and {1} Video files were transferred]]></string>
+	<string name="_bx_dolphin_migration_started_migration_photos_finished"><![CDATA[{0} photos were transferred]]></string>
+	<string name="_bx_dolphin_migration_started_migration_videos_finished"><![CDATA[{0} videos were transferred]]></string>
+	<string name="_bx_dolphin_migration_started_migration_photos_albums_finished"><![CDATA[{0} Albums and {1} Photos were transferred]]></string>
+	<string name="_bx_dolphin_migration_started_migration_videos_albums_finished"><![CDATA[{0} Albums and {1} Video files were transferred]]></string>
 	<string name="_bx_dolphin_migration_started_migration_photos_album_error"><![CDATA[Database Error. Albums can not be created!]]></string>  
 	<string name="_bx_dolphin_migration_started_migration_videos"><![CDATA[Videos Migration was started]]></string>
 	<string name="_bx_dolphin_migration_friends_exports_error"><![CDATA[Database error: Friends can not be transferred]]></string>
@@ -44,8 +46,10 @@
 	<string name="_bx_dolphin_migration_data_profiles"><![CDATA[Profiles]]></string>
 	<string name="_bx_dolphin_migration_data_profile_fields"><![CDATA[Profile Fields]]></string>  
 	<string name="_bx_dolphin_migration_data_blogs"><![CDATA[Blogs]]></string>
-	<string name="_bx_dolphin_migration_data_photos"><![CDATA[Photo Albums, Photos]]></string>
-	<string name="_bx_dolphin_migration_data_videos"><![CDATA[Video Albums, Videos]]></string>
+	<string name="_bx_dolphin_migration_data_photos"><![CDATA[Photos]]></string>
+	<string name="_bx_dolphin_migration_data_videos"><![CDATA[Videos]]></string>
+	<string name="_bx_dolphin_migration_data_photos_albums"><![CDATA[Photo Albums, Photos]]></string>
+	<string name="_bx_dolphin_migration_data_videos_albums"><![CDATA[Video Albums, Videos]]></string>
 	<string name="_bx_dolphin_migration_data_groups"><![CDATA[Groups]]></string>
 	<string name="_bx_dolphin_migration_data_events"><![CDATA[Events]]></string>
 	<string name="_bx_dolphin_migration_data_polls"><![CDATA[Polls]]></string>
@@ -123,4 +127,5 @@
 	<string name="_bx_dolphin_migration_cpt_default_privacy"><![CDATA[This privacy group will be set in case if you have not standard privacy groups in Dolphin and transferring item's privacy doesn't exist in UNA]]></string>
 	<string name="_bx_dolphin_migration_cpt_clean_warning"><![CDATA[The all data from the table below will be removed. Continue?]]></string>
 	<string name="_bx_dolphin_migration_started_migration_conversations"><![CDATA[Migration has been started]]></string>
+	<string name="_bx_dolphin_migration_cpt_media_modules"><![CDATA[Transfer media content to suitable media modules (Dolphin <b>photos</b> to UNA <b>Photos</b> and <b>videos</b> to UNA <b>Videos</b> module). Otherwise photos and videos will be transferred to UNA <b>Albums</b> module.]]></string>
 </resources>

+ 2 - 1
modules/boonex/dolphin_migration/install/sql/enable.sql

@@ -15,7 +15,8 @@ INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `c
 ('bx_dolphin_migration_overwrite', '', @iCategId, '_bx_dolphin_migration_cpt_overwrite', 'checkbox', '', '', '', 2),
 ('bx_dolphin_migration_use_nickname', '', @iCategId, '_bx_dolphin_migration_cpt_use_nickname', 'checkbox', '', '', '', 3),
 ('bx_dolphin_migration_empty_albums', '', @iCategId, '_bx_dolphin_migration_cpt_empty_albums', 'checkbox', '', '', '', 4),
-('bx_dolphin_migration_default_privacy', '3', @iCategId, '_bx_dolphin_migration_cpt_default_privacy', 'select', '', '', 'a:2:{s:6:"module";s:20:"bx_dolphin_migration";s:6:"method";s:18:"get_privacy_groups";}', 5);
+('bx_dolphin_migration_default_privacy', '3', @iCategId, '_bx_dolphin_migration_cpt_default_privacy', 'select', '', '', 'a:2:{s:6:"module";s:20:"bx_dolphin_migration";s:6:"method";s:18:"get_privacy_groups";}', 5),
+('bx_dolphin_migration_media_modules', '', @iCategId, '_bx_dolphin_migration_cpt_media_modules', 'checkbox', '', '', '', 6);
 
 -- GRIDS:
 INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES