mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Import plugin - HTML import provider code clean-up
This commit is contained in:
@@ -6,12 +6,6 @@
|
|||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
*
|
|
||||||
*
|
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/import/wordpress_import_class.php,v $
|
|
||||||
* $Revision: 11315 $
|
|
||||||
* $Date: 2010-02-10 10:18:01 -0800 (Wed, 10 Feb 2010) $
|
|
||||||
* $Author: secretr $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//$import_class_names['html_import'] = 'HTML';
|
//$import_class_names['html_import'] = 'HTML';
|
||||||
@@ -87,14 +81,10 @@ class html_import extends base_import_class
|
|||||||
|
|
||||||
function doConversion($data)
|
function doConversion($data)
|
||||||
{
|
{
|
||||||
|
|
||||||
print_a($data);
|
print_a($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function config()
|
function config()
|
||||||
{
|
{
|
||||||
$var[0]['caption'] = "Website Home-page URL";
|
$var[0]['caption'] = "Website Home-page URL";
|
||||||
@@ -147,15 +137,12 @@ class html_import extends base_import_class
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function getAll($root = '')
|
private function getAll($root = '')
|
||||||
{
|
{
|
||||||
$html = $this->getRawHtml($root);
|
$html = $this->getRawHtml($root);
|
||||||
$pages = $this->findLinks($html);
|
$pages = $this->findLinks($html);
|
||||||
$c = 0;
|
$c = 0;
|
||||||
|
|
||||||
foreach($pages as $url=>$p)
|
foreach($pages as $url=>$p)
|
||||||
{
|
{
|
||||||
// echo "url=".$url;
|
// echo "url=".$url;
|
||||||
@@ -187,8 +174,6 @@ class html_import extends base_import_class
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function previewContent()
|
private function previewContent()
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
@@ -197,8 +182,8 @@ class html_import extends base_import_class
|
|||||||
|
|
||||||
$content = $this->getAll();
|
$content = $this->getAll();
|
||||||
|
|
||||||
|
$text = "
|
||||||
$text = "<form method='post' action='".e_SELF."?import_type=html_import' id='core-import-form'>
|
<form method='post' action='".e_SELF."?import_type=html_import' id='core-import-form'>
|
||||||
<fieldset id='core-import-select-type'>
|
<fieldset id='core-import-select-type'>
|
||||||
<legend class='e-hideme'>".DBLAN_10."</legend>
|
<legend class='e-hideme'>".DBLAN_10."</legend>
|
||||||
<table class='table adminlist'>
|
<table class='table adminlist'>
|
||||||
@@ -222,7 +207,6 @@ class html_import extends base_import_class
|
|||||||
|
|
||||||
foreach($content as $key=>$data)
|
foreach($content as $key=>$data)
|
||||||
{
|
{
|
||||||
|
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
|
|
||||||
<td>".$data['title']."</td>\n
|
<td>".$data['title']."</td>\n
|
||||||
@@ -240,7 +224,6 @@ class html_import extends base_import_class
|
|||||||
</tr>";
|
</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -258,8 +241,6 @@ class html_import extends base_import_class
|
|||||||
|
|
||||||
$ns->tablerender(LAN_PLUGIN_IMPORT_NAME.SEP.$this->feedUrl,$text);
|
$ns->tablerender(LAN_PLUGIN_IMPORT_NAME.SEP.$this->feedUrl,$text);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -288,6 +269,7 @@ class html_import extends base_import_class
|
|||||||
$tidy = new tidy();
|
$tidy = new tidy();
|
||||||
$options = array("output-xhtml" => true, "clean" => true);
|
$options = array("output-xhtml" => true, "clean" => true);
|
||||||
$parsed = tidy_parse_file(e_TEMP.$local_file,$options);
|
$parsed = tidy_parse_file(e_TEMP.$local_file,$options);
|
||||||
|
|
||||||
return $parsed->value;
|
return $parsed->value;
|
||||||
}
|
}
|
||||||
elseif(!$html = file_get_contents(e_TEMP.$local_file))
|
elseif(!$html = file_get_contents(e_TEMP.$local_file))
|
||||||
@@ -324,8 +306,6 @@ class html_import extends base_import_class
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
// Internal functions below here
|
// Internal functions below here
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
@@ -395,7 +375,6 @@ class html_import extends base_import_class
|
|||||||
// $target['news_sticky'] = '';
|
// $target['news_sticky'] = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $target; // comment out to debug
|
return $target; // comment out to debug
|
||||||
|
|
||||||
$this->renderDebug($source,$target);
|
$this->renderDebug($source,$target);
|
||||||
@@ -491,7 +470,6 @@ class html_import extends base_import_class
|
|||||||
// $target['link_sefurl'] = $source['post_password'];
|
// $target['link_sefurl'] = $source['post_password'];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $target; // comment out to debug
|
return $target; // comment out to debug
|
||||||
|
|
||||||
$this->renderDebug($source,$target);
|
$this->renderDebug($source,$target);
|
||||||
@@ -549,10 +527,6 @@ class html_import extends base_import_class
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function renderDebug($source,$target)
|
function renderDebug($source,$target)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user