add and check plugin base class

master
Andrew Dolgov 12 years ago
parent 7252abe3ea
commit 5a0e03923f

@ -0,0 +1,11 @@
<?php
class Plugin {
private $link;
private $host;
function __construct($host) {
$this->link = $host->get_link();
$this->host = $host;
}
}
?>

@ -59,7 +59,7 @@ class PluginHost {
if (file_exists($file)) require_once $file;
if (class_exists($class)) {
if (class_exists($class) && is_subclass_of($class, "Plugin")) {
$plugin = new $class($this);
$this->register_plugin($class, $plugin);

@ -1,5 +1,5 @@
<?php
class Flattr {
class Flattr extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class GooglePlus {
class GooglePlus extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class Identica {
class Identica extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class Mail {
class Mail extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class Note {
class Note extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class Pinterest {
class Pinterest extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class Pocket {
class Pocket extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class RedditImgur {
class RedditImgur extends Plugin {
private $link;
private $host;

@ -1,5 +1,5 @@
<?php
class Share {
class Share extends Plugin {
private $link;
private $host;

Loading…
Cancel
Save