1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2024-12-02 06:24:11 +01:00
OwncloudBookmarksOfficial/settings.php
2012-10-10 19:05:34 +00:00

33 lines
785 B
PHP

<?php
/**
* Copyright (c) 2011 Marvin Thomas Rabe <mrabe@marvinrabe.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
OCP\App::checkAppEnabled('bookmarks');
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' => '');
}
$tmpl = new OCP\Template('bookmarks', 'settings');
// Any problems?
if(count($error)) {
$tmpl->assign('error', $error);
}
return $tmpl->fetchPage();
} else {
$tmpl = new OCP\Template( 'bookmarks', 'settings');
return $tmpl->fetchPage();
}