123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- if (!defined('STATUSNET')) { exit(1); }
- class YammerImportPlugin extends Plugin
- {
-
- public function onRouterInitialized(URLMapper $m)
- {
- $m->connect('panel/yammer',
- array('action' => 'yammeradminpanel'));
- $m->connect('panel/yammer/auth',
- array('action' => 'yammerauth'));
- return true;
- }
-
- function onEndInitializeQueueManager(QueueManager $qm)
- {
- $qm->connect('yammer', 'YammerQueueHandler');
- return true;
- }
-
- function onCheckSchema()
- {
- $schema = Schema::get();
- $tables = array('Yammer_state',
- 'Yammer_user',
- 'Yammer_group',
- 'Yammer_notice',
- 'Yammer_notice_stub');
- foreach ($tables as $table) {
- $schemaDef = call_user_func(array($table, 'schemaDef'));
- $schema->ensureTable(strtolower($table), $schemaDef);
- }
- return true;
- }
-
- function onAdminPanelCheck($name, &$isOK)
- {
- if ($name == 'yammer') {
- $isOK = true;
- return false;
- }
- return true;
- }
-
- function onEndAdminPanelNav($nav)
- {
- if (AdminPanelAction::canAdmin('yammer')) {
- $action_name = $nav->action->trimmed('action');
- $nav->out->menuItem(common_local_url('yammeradminpanel'),
-
- _m('MENU','Yammer'),
-
- _m('Yammer import module.'),
- $action_name == 'yammeradminpanel',
- 'nav_yammer_admin_panel');
- }
- return true;
- }
- }
|