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 (file_exists($file)) require_once $file;
if (class_exists($class)) { if (class_exists($class) && is_subclass_of($class, "Plugin")) {
$plugin = new $class($this); $plugin = new $class($this);
$this->register_plugin($class, $plugin); $this->register_plugin($class, $plugin);

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save