Web UI for importing delicious backup files

This commit is contained in:
Evan Prodromou
2010-12-29 13:51:59 -08:00
parent 39cf2338c2
commit 4a9a5076ff
2 changed files with 323 additions and 0 deletions

View File

@@ -47,6 +47,16 @@ if (!defined('STATUSNET')) {
class BookmarkPlugin extends Plugin
{
const VERSION = '0.1';
const IMPORTDELICIOUS = 'BookmarkPlugin:IMPORTDELICIOUS';
function onUserRightsCheck($profile, $right, &$result)
{
if ($right == self::IMPORTDELICIOUS) {
$result = !$profile->isSilenced();
return false;
}
return true;
}
/**
* Database schema setup
@@ -158,6 +168,7 @@ class BookmarkPlugin extends Plugin
case 'NewbookmarkAction':
case 'BookmarkpopupAction':
case 'NoticebyurlAction':
case 'ImportdeliciousAction':
include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
return false;
case 'Bookmark':
@@ -190,6 +201,9 @@ class BookmarkPlugin extends Plugin
$m->connect('main/bookmark/popup',
array('action' => 'bookmarkpopup'));
$m->connect('main/bookmark/import',
array('action' => 'importdelicious'));
$m->connect('bookmark/:user/:created/:crc32',
array('action' => 'showbookmark'),
array('user' => '[0-9]+',