summaryrefslogtreecommitdiff
path: root/classes/rpc.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-12-20 23:57:27 +0400
committerAndrew Dolgov <[email protected]>2011-12-20 23:59:37 +0400
commitf9ac31d6712b4400a616e49d6217d55edb0daf9c (patch)
tree453002094fe5070074581529a72fe1e083631b8f /classes/rpc.php
parent73621c56055eaff7d222183bfdb5d4fabeb4e209 (diff)
move tweet button to a plugin, implement basic support for article action button plugins
Diffstat (limited to 'classes/rpc.php')
-rw-r--r--classes/rpc.php23
1 files changed, 9 insertions, 14 deletions
diff --git a/classes/rpc.php b/classes/rpc.php
index dbdca8a78..45915b9dc 100644
--- a/classes/rpc.php
+++ b/classes/rpc.php
@@ -753,21 +753,16 @@ class RPC extends Protected_Handler {
return;
}
- function getTweetInfo() {
- $id = db_escape_string($_REQUEST['id']);
-
- $result = db_query($this->link, "SELECT title, link
- FROM ttrss_entries, ttrss_user_entries
- WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
- if (db_num_rows($result) != 0) {
- $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
- 100, '...');
- $article_link = db_fetch_result($result, 0, 'link');
+ function buttonPlugin() {
+ $pclass = basename($_REQUEST['plugin']) . "_button";
+ $method = $_REQUEST['plugin_method'];
+
+ if (class_exists($pclass)) {
+ $plugin = new $pclass($this->link);
+ if (method_exists($plugin, $method)) {
+ return $plugin->$method();
+ }
}
-
- print json_encode(array("title" => $title, "link" => $article_link,
- "id" => $id));
}
function setNote() {