function testGetInstalledPlugins() { global $THINKTANK_CFG; $dao = new PluginDAO($this->db, $this->logger); $plugins = $dao->getInstalledPlugins($THINKTANK_CFG["source_root_path"]); $this->assertTrue(count($plugins) == 3); $this->assertTrue($plugins[0]->name == "Facebook"); $this->assertTrue($plugins[0]->folder_name == "facebook"); $this->assertTrue($plugins[1]->name == "Hello ThinkTank"); $this->assertTrue($plugins[1]->folder_name == "testplugin"); $this->assertTrue($plugins[2]->name == "Twitter"); $this->assertTrue($plugins[2]->folder_name == "twitter"); }
function testGetInstalledPlugins() { global $THINKTANK_CFG; $dao = new PluginDAO($this->db, $this->logger); $plugins = $dao->getInstalledPlugins($THINKTANK_CFG["source_root_path"]); $this->assertTrue(count($plugins) == 5); $this->assertTrue($plugins[0]->name == "Expand URLs", "Ex-url 'name' Test"); $this->assertTrue($plugins[0]->folder_name == "expandurls", "Ex-url 'folder_name' test"); $this->assertTrue($plugins[1]->name == "Facebook", "Facebook 'name' Test"); $this->assertTrue($plugins[1]->folder_name == "facebook", "Facebook 'folder_name' test"); $this->assertTrue($plugins[2]->name == "Flickr Thumbnails", "Flickr 'name' Test"); $this->assertTrue($plugins[2]->folder_name == "flickrthumbnails", "Flickr 'folder_name' test"); $this->assertTrue($plugins[3]->name == "Hello ThinkTank", "Hello 'name' Test"); $this->assertTrue($plugins[3]->folder_name == "hellothinktank", "Hello 'folder_name' test"); }
$owners = $od->getAllOwners(); foreach ($owners as $o) { $instances = $id->getByOwner($o, true); $o->setInstances($instances); } $s->assign('owners', $owners); } /* Begin plugin-specific configuration handling */ $cmi = $webapp->getConfigMenu(); $s->assign('config_menu', $cmi); if (!isset($_GET['m']) && isset($_GET['p'])) { $active_plugin = $_GET['p']; } else { if (isset($_GET['m']) && $_GET['m'] == 'manage') { $pld = new PluginDAO($db); $installed_plugins = $pld->getInstalledPlugins($THINKTANK_CFG["source_root_path"]); $s->assign('installed_plugins', $installed_plugins); } else { //default to the first plugin on the stack $active_plugin = $cmi[0][0]; } } if (isset($active_plugin)) { $webapp->configuration($active_plugin); array_push($s->template_dir, 'plugins/' . $active_plugin); $s->assign('body', $THINKTANK_CFG['source_root_path'] . 'common/plugins/' . $active_plugin . '/templates/' . $active_plugin . '.account.index.tpl'); } /* End plugin-specific configuration handling */ # clean up $db->closeConnection($conn); if (isset($errormsg)) {
if ($owner->is_admin) { $owners = $od->getAllOwners(); foreach ($owners as $o) { $instances = $id->getByOwner($o, true); $o->setInstances($instances); } $s->assign('owners', $owners); } $s->assign('instances', $id->getByOwner($owner)); /* Begin plugin-specific configuration handling */ if (!isset($_GET['m']) && isset($_GET['p'])) { $active_plugin = $_GET['p']; } else { if (isset($_GET['m']) && $_GET['m'] == 'manage') { $pld = new PluginDAO($db); $installed_plugins = $pld->getInstalledPlugins($config->getValue("source_root_path")); $s->assign('installed_plugins', $installed_plugins); } else { //default to the first plugin on the stack $active_plugin = $cmi[0][0]; } } if (isset($active_plugin)) { $pobj = $webapp->getPluginObject($active_plugin); $p = new $pobj(); $s->assign('body', $p->renderConfiguration($owner)); } /* End plugin-specific configuration handling */ # clean up $db->closeConnection($conn); if (isset($errormsg)) {