remove incomplete and unmaintained bookmarks ext, see #532
This commit is contained in:
parent
06ee5347c7
commit
0fd96fcdae
@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Name: Bookmarks
|
|
||||||
* Author: Shish <webmaster@shishnet.org>
|
|
||||||
* Link: http://code.shishnet.org/shimmie2/
|
|
||||||
* License: GPLv2
|
|
||||||
* Description: Allow users to bookmark searches
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Bookmarks extends Extension {
|
|
||||||
public function onInitExt(InitExtEvent $event) {
|
|
||||||
$this->install();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onPageRequest(PageRequestEvent $event) {
|
|
||||||
global $page;
|
|
||||||
|
|
||||||
if($event->page_matches("bookmark")) {
|
|
||||||
if($event->get_arg(0) == "add") {
|
|
||||||
if(isset($_POST['url'])) {
|
|
||||||
$page->set_mode("redirect");
|
|
||||||
$page->set_redirect(make_link("user"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if($event->get_arg(0) == "remove") {
|
|
||||||
if(isset($_POST['id'])) {
|
|
||||||
$page->set_mode("redirect");
|
|
||||||
$page->set_redirect(make_link("user"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function install() {
|
|
||||||
global $database, $config;
|
|
||||||
|
|
||||||
// shortcut to latest
|
|
||||||
if($config->get_int("ext_bookmarks_version") < 1) {
|
|
||||||
$database->create_table("bookmark", "
|
|
||||||
id SCORE_AIPK,
|
|
||||||
owner_id INTEGER NOT NULL,
|
|
||||||
url TEXT NOT NULL,
|
|
||||||
title TEXT NOT NULL,
|
|
||||||
FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE
|
|
||||||
");
|
|
||||||
$database->execute("CREATE INDEX bookmark_owner_id_idx ON bookmark(owner_id)", array());
|
|
||||||
$config->set_int("ext_bookmarks_version", 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function get_bookmarks() {
|
|
||||||
global $database;
|
|
||||||
$bms = $database->get_all("
|
|
||||||
SELECT *
|
|
||||||
FROM bookmark
|
|
||||||
WHERE bookmark.owner_id = ?
|
|
||||||
");
|
|
||||||
if($bms) {return $bms;}
|
|
||||||
else {return array();}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function add_bookmark(/*string*/ $url, /*string*/ $title) {
|
|
||||||
global $database, $user;
|
|
||||||
$sql = "INSERT INTO bookmark(owner_id, url, title) VALUES (?, ?, ?)";
|
|
||||||
$database->Execute($sql, array($user->id, $url, $title));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
class BookmarksTest extends ShimmiePHPUnitTestCase {
|
|
||||||
public function testBookmarks() {
|
|
||||||
$this->get_page("bookmark/add");
|
|
||||||
$this->get_page("bookmark/remove");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class BookmarksTheme extends Themelet {
|
|
||||||
}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user