1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Import: PHP-Nuke News items and Categories. PHPFusion userclasses added. Template added for easily adding other systems.

This commit is contained in:
Cameron
2017-04-01 13:56:09 -07:00
parent 68127bd72f
commit ebe903945f
10 changed files with 1425 additions and 372 deletions

View File

@@ -63,10 +63,18 @@ class base_import_class
case 'users' :
return $this->saveUserData($dataRecord);
break;
case 'userclass' :
return $this->saveUserClassData($dataRecord);
break;
case 'news' :
return $this->saveNewsData($dataRecord);
break;
case 'newscategory' :
return $this->saveNewsCategoryData($dataRecord);
break;
case 'page' :
return $this->savePageData($dataRecord);
@@ -130,11 +138,19 @@ class base_import_class
case 'users' :
return $this->copyUserData($initial, $result);
break;
case 'userclass' :
return $this->copyUserClassData($initial, $result);
break;
case 'news' :
return $this->copyNewsData($initial, $result);
break;
case 'newscategory' :
return $this->copyNewsCategoryData($initial, $result);
break;
case 'page' :
return $this->copyPageData($initial, $result);
break;
@@ -196,11 +212,21 @@ class base_import_class
{
return $target;
}
function copyUserClassData(&$target, &$source)
{
return $target;
}
function copyNewsData(&$target, &$source)
{
return $target;
}
function copyNewsCategoryData(&$target, &$source)
{
return $target;
}
function copyPageData(&$target, &$source)
{
@@ -242,7 +268,44 @@ class base_import_class
return $target;
}
/**
* @param $source
* @param $target
*/
public function debug($source,$target)
{
echo "<table style='width:100%'>
<tr><th>Source CMS</th><th>Target e107</th></tr>
<tr>
<td style='vertical-align:top'>".$this->renderTable($source)."</td>
<td style='vertical-align:top'>".$this->renderTable($target)."</td>
</tr>
</table>";
}
private function renderTable($source)
{
$text = "<table class='table table-striped table-bordered'>
<tr><th>Field</th><th>Data</th></tr>";
foreach($source as $k=>$v)
{
$text .= "<tr>
<td style='width:50%;'>".$k."</td>
<td>".htmlentities($v)."</td>
</tr>";
}
$text .= "
</table>
";
return $text;
}
//===========================================================
// UTILITY ROUTINES