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
|
||||
* 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';
|
||||
@@ -87,14 +81,10 @@ class html_import extends base_import_class
|
||||
|
||||
function doConversion($data)
|
||||
{
|
||||
|
||||
print_a($data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function config()
|
||||
{
|
||||
$var[0]['caption'] = "Website Home-page URL";
|
||||
@@ -147,15 +137,12 @@ class html_import extends base_import_class
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private function getAll($root = '')
|
||||
{
|
||||
$html = $this->getRawHtml($root);
|
||||
$pages = $this->findLinks($html);
|
||||
$c = 0;
|
||||
|
||||
foreach($pages as $url=>$p)
|
||||
{
|
||||
// echo "url=".$url;
|
||||
@@ -187,8 +174,6 @@ class html_import extends base_import_class
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function previewContent()
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
@@ -197,8 +182,8 @@ class html_import extends base_import_class
|
||||
|
||||
$content = $this->getAll();
|
||||
|
||||
|
||||
$text = "<form method='post' action='".e_SELF."?import_type=html_import' id='core-import-form'>
|
||||
$text = "
|
||||
<form method='post' action='".e_SELF."?import_type=html_import' id='core-import-form'>
|
||||
<fieldset id='core-import-select-type'>
|
||||
<legend class='e-hideme'>".DBLAN_10."</legend>
|
||||
<table class='table adminlist'>
|
||||
@@ -220,9 +205,8 @@ class html_import extends base_import_class
|
||||
<tbody>\n";
|
||||
|
||||
|
||||
foreach ($content as $key=>$data)
|
||||
foreach($content as $key=>$data)
|
||||
{
|
||||
|
||||
$text .= "<tr>
|
||||
|
||||
<td>".$data['title']."</td>\n
|
||||
@@ -240,7 +224,6 @@ class html_import extends base_import_class
|
||||
</tr>";
|
||||
}
|
||||
|
||||
|
||||
$text .= "
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -258,8 +241,6 @@ class html_import extends base_import_class
|
||||
|
||||
$ns->tablerender(LAN_PLUGIN_IMPORT_NAME.SEP.$this->feedUrl,$text);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -288,6 +269,7 @@ class html_import extends base_import_class
|
||||
$tidy = new tidy();
|
||||
$options = array("output-xhtml" => true, "clean" => true);
|
||||
$parsed = tidy_parse_file(e_TEMP.$local_file,$options);
|
||||
|
||||
return $parsed->value;
|
||||
}
|
||||
elseif(!$html = file_get_contents(e_TEMP.$local_file))
|
||||
@@ -324,8 +306,6 @@ class html_import extends base_import_class
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//------------------------------------
|
||||
// Internal functions below here
|
||||
//------------------------------------
|
||||
@@ -395,7 +375,6 @@ class html_import extends base_import_class
|
||||
// $target['news_sticky'] = '';
|
||||
|
||||
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
$this->renderDebug($source,$target);
|
||||
@@ -491,7 +470,6 @@ class html_import extends base_import_class
|
||||
// $target['link_sefurl'] = $source['post_password'];
|
||||
|
||||
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
$this->renderDebug($source,$target);
|
||||
@@ -549,10 +527,6 @@ class html_import extends base_import_class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function renderDebug($source,$target)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user