From: Edward Date: Wed, 19 Feb 2014 08:36:28 +0000 (+0800) Subject: ConvertStyle.php X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=ac017f48607f2ffbe3a4ed9610b88d30274d79aa ConvertStyle.php --- diff --git a/ConvertStyle.php b/ConvertStyle.php index 55f2cdde..b3db910a 100644 --- a/ConvertStyle.php +++ b/ConvertStyle.php @@ -18,8 +18,7 @@ class Pman_Core_ConvertStyle extends Pman } function relPath($base, $url) - { - //var_dump(array($base,$url)); + { if (preg_match('/^(http|https|mailto):/',$url)) { return $url; } @@ -48,42 +47,6 @@ class Pman_Core_ConvertStyle extends Pman } - - function post() - { - // Import from URL - if(isset($_REQUEST['importUrl'])) - { - $this->checkHeader($_REQUEST['importUrl']); - $data = $this->convertStyle($_REQUEST['importUrl'], ''); - $this->jok($data); - } - - // Import from file - $htmlFile = DB_DataObject::factory('images'); - $htmlFile->setFrom(array( - 'onid' => 0, - 'ontable' =>'crm_mailing_list_message' - )); - $htmlFile->onUpload(false); - // print_r($htmlFile); - if($htmlFile->mimetype != 'text/html') - { - $this->jerr('accept html file only!'); - } - if(!file_exists($htmlFile->getStoreName())) - { - $this->jerr('update failed!'); - } - - $data = $this->convertStyle('', $htmlFile->getStoreName()); - - $htmlFile->delete(); - unlink($htmlFile->getStoreName()) or die('Unable to delete the file'); - - $this->jok($data); - } - function checkHeader($url) { if(strpos($url, 'https') !== false)