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

37 lines
905 B
PHP
Raw Normal View History

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' => '');
}
// Any problems?
if(count($error)){
$tmpl = new OCP\Template('bookmarks', 'settings');
$tmpl->assign('error',$error);
//return $tmpl->fetchPage();
} else {
// Went swimmingly!
$tmpl = new OCP\Template('bookmarks', 'settings');
//return $tmpl->fetchPage();
}
} else {
$tmpl = new OCP\Template( 'bookmarks', 'settings');
return $tmpl->fetchPage();
}