本文整理汇总了PHP中PluginRegistrarWebapp::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistrarWebapp::getInstance方法的具体用法?PHP PluginRegistrarWebapp::getInstance怎么用?PHP PluginRegistrarWebapp::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginRegistrarWebapp
的用法示例。
在下文中一共展示了PluginRegistrarWebapp::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('googleplus', 'GooglePlusPlugin');
$_SERVER['SERVER_NAME'] = 'test';
}
示例2: adminControl
public function adminControl()
{
if (!$this->is_missing_param) {
// verify CSRF token
$this->validateCSRFToken();
$is_active = $_GET["a"] != 1 ? false : true;
$plugin_dao = DAOFactory::getDAO('PluginDAO');
$result = $plugin_dao->setActive($_GET["pid"], $is_active);
if ($result > 0) {
$plugin_folder = $plugin_dao->getPluginFolder($_GET["pid"]);
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
try {
$plugin_class_name = $webapp_plugin_registrar->getPluginObject($plugin_folder);
$p = new $plugin_class_name();
if ($is_active) {
$p->activate();
} else {
$p->deactivate();
}
} catch (Exception $e) {
//plugin object isn't registered, do nothing
//echo $e->getMessage();
}
}
$this->addToView('result', $result);
$this->view_mgr->clear_all_cache();
}
return $this->generateView();
}
示例3: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('youtube', 'YouTubePlugin');
$webapp_plugin_registrar->setActivePlugin('youtube');
}
示例4: loadView
/**
* Load the view with required variables
*/
private function loadView()
{
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
if ($this->view_name == 'default') {
$this->loadDefaultDashboard();
} else {
$menu_item = $webapp_plugin_registrar->getDashboardMenuItem($this->view_name, $this->instance);
if (isset($menu_item)) {
$this->addToView('data_template', $menu_item->view_template);
$this->addToView('display', $this->view_name);
$this->addToView('header', $menu_item->name);
$this->addToView('description', $menu_item->description);
$this->addToView('parent', $menu_item->parent);
$this->setPageTitle($this->instance->network_username . ' on ' . ucfirst($this->instance->network));
$page = isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1;
foreach ($menu_item->datasets as $dataset) {
if (array_search('#page_number#', $dataset->method_params) !== false) {
//there's paging
$this->addToView('next_page', $page + 1);
$this->addToView('last_page', $page - 1);
}
$this->addToView($dataset->name, $dataset->retrieveDataset($page));
if (Session::isLoggedIn() && $dataset->isSearchable()) {
$view_name = 'is_searchable';
$this->addToView($view_name, true);
}
$this->view_mgr->addHelp($this->view_name, $dataset->getHelp());
}
} else {
$this->loadDefaultDashboard();
}
}
}
示例5: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
$this->builders = self::buildData();
}
示例6: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
$this->config = Config::getInstance();
}
示例7: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
$webapp_plugin_registrar->registerPlugin('facebook', 'FacebookPlugin');
$webapp_plugin_registrar->registerPlugin('google+', 'GooglePlusPlugin');
}
示例8: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('geoencoder', 'GeoEncoderPlugin');
$_SERVER['SERVER_NAME'] = 'dev.thinkup.com';
$_SERVER['HTTP_HOST'] = 'dev.thinkup.com';
}
示例9: setUp
public function setUp()
{
parent::setUp();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
$this->builders = self::buildData();
$_SERVER['HTTP_HOST'] = "mytesthost";
$_SERVER['SERVER_NAME'] = 'dev.thinkup.com';
}
示例10: testWebappGetSetActivePlugin
/**
* Test activePlugin getter/setter
*/
public function testWebappGetSetActivePlugin()
{
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$this->assertEqual($webapp_plugin_registrar->getActivePlugin(), "twitter");
$webapp_plugin_registrar->setActivePlugin('facebook');
$this->assertEqual($webapp_plugin_registrar->getActivePlugin(), "facebook");
//make sure another instance reports back the same values
$webapp_plugin_registrar_two = PluginRegistrarWebapp::getInstance();
$this->assertEqual($webapp_plugin_registrar_two->getActivePlugin(), "facebook");
}
示例11: setUp
public function setUp()
{
parent::setUp();
$this->webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$this->webapp_plugin_registrar->registerPlugin('geoencoder', 'GeoEncoderPlugin');
$this->webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
$crawler_plugin_registrar = PluginRegistrarCrawler::getInstance();
$crawler_plugin_registrar->registerCrawlerPlugin('GeoEncoderPlugin');
$this->builders = self::buildData();
}
示例12: setUp
public function setUp()
{
parent::setUp();
$this->webapp = PluginRegistrarWebapp::getInstance();
$this->crawler = PluginRegistrarCrawler::getInstance();
$this->webapp->registerPlugin('twitter', 'TwitterPlugin');
$this->crawler->registerCrawlerPlugin('TwitterPlugin');
$this->webapp->setActivePlugin('twitter');
$this->logger = Logger::getInstance();
}
示例13: setUp
public function setUp()
{
parent::setUp();
$this->builders = array();
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$webapp_plugin_registrar->registerPlugin('facebook', 'FacebookPlugin');
$_SERVER['SERVER_NAME'] = 'dev.thinkup.com';
$_SERVER['HTTP_HOST'] = 'dev.thinkup.com';
$_SERVER['REQUEST_URI'] = '';
//Add owners
$owner_builder = FixtureBuilder::build('owners', array('id' => 1, 'full_name' => 'ThinkUp J. User', 'email' => 'me@example.com', 'is_activated' => 1));
array_push($this->builders, $owner_builder);
//Add second owner
$owner2_builder = FixtureBuilder::build('owners', array('id' => 2, 'full_name' => 'ThinkUp J. User 2', 'email' => 'me2@example.com', 'is_activated' => 1));
array_push($this->builders, $owner2_builder);
}
示例14: setUp
/**
* Initialize Config and Webapp objects, clear $_SESSION, $_POST, $_GET, $_REQUEST
*/
public function setUp()
{
parent::setUp();
Loader::register(array(THINKUP_ROOT_PATH . 'tests/', THINKUP_ROOT_PATH . 'tests/classes/', THINKUP_ROOT_PATH . 'tests/fixtures/'));
$config = Config::getInstance();
//disable caching for tests
$config->setValue('cache_pages', false);
//tests assume profiling is off
$config->setValue('enable_profiler', false);
if ($config->getValue('timezone')) {
date_default_timezone_set($config->getValue('timezone'));
}
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$crawler_plugin_registrar = PluginRegistrarCrawler::getInstance();
$this->DEBUG = getenv('TEST_DEBUG') !== false ? true : false;
self::isTestEnvironmentReady();
}
示例15: testMenuItemRegistration
public function testMenuItemRegistration()
{
$webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
$instance = new Instance();
$instance->network_user_id = 1;
$menus = $webapp_plugin_registrar->getDashboardMenu($instance);
// We only have one menu so far, the checkins
$this->assertEqual(sizeof($menus), 1);
$post_tab = $menus['posts'];
$this->assertEqual($post_tab->name, "Checkins");
$this->assertEqual($post_tab->description, "Your checkins");
$post_tab_datasets = $post_tab->getDatasets();
$this->assertEqual(count($post_tab_datasets), 1);
$post_tab_dataset = $post_tab_datasets[0];
$this->assertEqual($post_tab_dataset->name, "all_checkins");
$this->assertEqual($post_tab_dataset->dao_name, 'PostDAO');
$this->assertEqual($post_tab_dataset->dao_method_name, "getAllCheckins");
}