2011-10-08 13:11:13 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2012-02-22 16:04:17 +01:00
|
|
|
* Copyright (c) 2011 Marvin Thomas Rabe <mrabe@marvinrabe.de>
|
2011-10-08 13:11:13 +02:00
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2012-07-03 15:55:51 +02:00
|
|
|
OCP\App::checkAppEnabled('bookmarks');
|
2011-10-08 13:11:13 +02:00
|
|
|
|
2012-07-03 15:55:51 +02:00
|
|
|
if (isset($_POST['bm_import'])) {
|
|
|
|
$error = array();
|
|
|
|
|
|
|
|
$file = $_FILES['bm_import']['tmp_name'];
|
|
|
|
if($_FILES['bm_import']['type'] =='text/html') {
|
|
|
|
$error = OC_Bookmarks_Bookmarks::importFile($file);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$error[]= array('error' => 'Unsupported file type for import',
|
|
|
|
'hint' => '');
|
|
|
|
}
|
|
|
|
|
2012-09-02 22:55:08 +02:00
|
|
|
$tmpl = new OCP\Template('bookmarks', 'settings');
|
2012-07-03 15:55:51 +02:00
|
|
|
// Any problems?
|
|
|
|
if(count($error)){
|
|
|
|
$tmpl->assign('error',$error);
|
|
|
|
}
|
2012-09-02 22:55:08 +02:00
|
|
|
return $tmpl->fetchPage();
|
2012-07-03 15:55:51 +02:00
|
|
|
} else {
|
|
|
|
$tmpl = new OCP\Template( 'bookmarks', 'settings');
|
|
|
|
return $tmpl->fetchPage();
|
|
|
|
}
|