summaryrefslogtreecommitdiff
path: root/plugins/SocialObject/SocialObjectPlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SocialObject/SocialObjectPlugin.php')
-rw-r--r--plugins/SocialObject/SocialObjectPlugin.php30
1 files changed, 28 insertions, 2 deletions
diff --git a/plugins/SocialObject/SocialObjectPlugin.php b/plugins/SocialObject/SocialObjectPlugin.php
index 6654b0045..7c63c8a70 100644
--- a/plugins/SocialObject/SocialObjectPlugin.php
+++ b/plugins/SocialObject/SocialObjectPlugin.php
@@ -47,13 +47,36 @@ class SocialObjectPlugin extends Plugin
private $slug_plural=null;
# Database class
private $dbclass=null;
+ # path to the plugin directory
+ private $plugin_path = null;
+
+ function initialize()
+ {
+ # set $this->plugin_path here.
+ }
+
+ function onAutoload($cls)
+ {
+ $actions = array();
+ foreach(array('Public', 'User', 'Group') as $a) {
+ $actions[] = $a.$this->slug_plural.'Action';
+ }
+ $actions[] = 'New'.$this->slug.'Action';
+ $actions[] = $this->dbclass;
+
+ if(in_array($cls, $actions)) {
+ require_once $this->plugin_path."/$cls.php";
+ return false;
+ }
+ return true;
+ }
# setup DB tables etc.
function onCheckSchema()
{
$schema = Schema::get();
$classname = $this->dbclass
- $schema->ensureTable($classname::tableDef());
+ $schema->ensureTable($classname::schemaDef());
return true;
}
@@ -71,6 +94,9 @@ class SocialObjectPlugin extends Plugin
$m->connect('group/:group/'.$this->slug_plural,
array('action' => 'group'.$this->slug_plural,
'group' => '[a-zA-Z0-9]{1,64}'));
+ # create new
+ $m->connect($this->slug.'/new',
+ array('action' => 'new'.$this->slug_plural));
# more to come in future: popular & lists.
return true;
}
@@ -124,7 +150,7 @@ class SocialObjectPlugin extends Plugin
array('href' => common_local_url('shownoticeform').'#social-'.$this->slug,
'title' => $this->name)
, $this->name);
- $form->out->elementEnd('ul');
+ $form->out->elementEnd('li');
}
# if the notice being shown has metadata for