X-Git-Url: https://projects.mako.cc/source/scuttle/blobdiff_plain/616df7459a1262dc55320ee60cc74dae9d878ab3..b35c59521deae7405997a24cefd523d9e3592665:/import.php?ds=sidebyside diff --git a/import.php b/import.php index 9f29728..9e1cdd4 100644 --- a/import.php +++ b/import.php @@ -20,8 +20,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once 'header.inc.php'; -$userservice =& ServiceFactory::getServiceInstance('UserService'); -$templateservice =& ServiceFactory::getServiceInstance('TemplateService'); +$sf = new ServiceFactory(); +$userservice =& $sf->getServiceInstance('UserService'); +$templateservice =& $sf->getServiceInstance('TemplateService'); $tplVars = array(); @@ -62,8 +63,9 @@ else { function startElement($parser, $name, $attrs) { global $depth, $status, $tplVars, $userservice; - $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService'); - $userservice =& ServiceFactory::getServiceInstance('UserService'); + $sf = new ServiceFactory(); + $bookmarkservice =& $sf->getServiceInstance('BookmarkService'); + $cacheservice =& $sf->getServiceInstance('CacheService'); if ($name == 'POST') { while(list($attrTitle, $attrVal) = each($attrs)) { @@ -80,6 +82,9 @@ function startElement($parser, $name, $attrs) { case 'TIME': $bDatetime = $attrVal; break; + case 'PRIVATE': + $bStatus = (strcasecmp('yes', $attrVal) == 0) ? 2 : $status ; + break; case 'TAG': $tags = strtolower($attrVal); break; @@ -96,7 +101,7 @@ function startElement($parser, $name, $attrs) { $bDatetime = gmdate('Y-m-d H:i:s'); } - if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $status, $tags, $bDatetime, true, true)) + if ($bookmarkservice->addBookmark($bAddress, $bTitle, $bDescription, $bStatus, $tags, $bDatetime, true, true)) $tplVars['msg'] = T_('Bookmark imported.'); else $tplVars['error'] = T_('There was an error saving your bookmark. Please try again or contact the administrator.');