function install() { $this->loadSQL('./sql/install.sql'); if (!$this->hasErrors()) { require_once './inc/loader.inc.php'; require_once './inc/tree.inc.php'; $bm = new SB_Loader(false); $bm->loadFile('./sql/bookmarks_sitebar.xbel', 'xbel'); if ($bm->success) { $tree =& SB_Tree::staticInstance(); $tree->importTree(2, $bm->root, false, 'SB_cleanUpLink'); } $bm = new SB_Loader(false); $bm->loadFile('./sql/bookmarks_websearch.xbel', 'xbel'); if ($bm->success) { $tree =& SB_Tree::staticInstance(); $tree->importTree(2, $bm->root, false, 'SB_cleanUpLink'); } } }
function commandImportBookmarks() { require_once './inc/loader.inc.php'; if (!$this->checkFile('file')) { return; } $filename = $_FILES['file']['tmp_name']; $bm = new SB_Loader($this->um->getParam('config', 'use_conv_engine'), SB_reqVal('cp')); $type = SB_reqVal('loader'); $bm->loadFile($filename, $type == 'auto' ? null : $type); // If not loaded message will be recorded and we go out if (!$bm->success) { return; } $this->message = SB_T('Imported %s link(s) into %s folder(s) from the bookmark file.', array($bm->importedLinks, $bm->importedFolders)); $this->tree->importTree(SB_reqValInt('nid_acl'), $bm->root, SB_reqChk('rename')); $this->markHasLink(); }