当前位置: 首页>>代码示例>>PHP>>正文


PHP PluginRegistrarWebapp类代码示例

本文整理汇总了PHP中PluginRegistrarWebapp的典型用法代码示例。如果您正苦于以下问题:PHP PluginRegistrarWebapp类的具体用法?PHP PluginRegistrarWebapp怎么用?PHP PluginRegistrarWebapp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PluginRegistrarWebapp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('youtube', 'YouTubePlugin');
     $_SERVER['SERVER_NAME'] = 'test';
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:7,代码来源:TestOfYouTubePluginConfigurationController.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('expandurls', 'ExpandURLsPlugin');
     $this->builders = self::buildData();
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:7,代码来源:TestOfExpandURLsPluginConfigurationController.php

示例3: 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();
         }
     }
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:36,代码来源:class.DashboardController.php

示例4: 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();
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:29,代码来源:class.ToggleActivePluginController.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('youtube', 'YouTubePlugin');
     $webapp_plugin_registrar->setActivePlugin('youtube');
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:7,代码来源:TestOfYouTubePlugin.php

示例6: tearDown

 /**
  * Destroy Config, Webapp, $_SESSION, $_POST, $_GET, $_REQUEST
  */
 public function tearDown()
 {
     Config::destroyInstance();
     PluginRegistrarWebapp::destroyInstance();
     PluginRegistrarCrawler::destroyInstance();
     if (isset($_SESSION)) {
         $this->unsetArray($_SESSION);
     }
     $this->unsetArray($_POST);
     $this->unsetArray($_GET);
     $this->unsetArray($_REQUEST);
     $this->unsetArray($_SERVER);
     $this->unsetArray($_FILES);
     Loader::unregister();
     $backup_dir = FileDataManager::getBackupPath();
     if (file_exists($backup_dir)) {
         try {
             @exec('cd ' . $backup_dir . '; rm -rf *');
             rmdir($backup_dir);
             // won't delete if has files
         } catch (Exception $e) {
         }
     }
     $data_dir = FileDataManager::getDataPath();
     if (file_exists($data_dir . 'compiled_view')) {
         try {
             @exec('cd ' . $data_dir . '; rm -rf compiled_view');
         } catch (Exception $e) {
         }
     }
     parent::tearDown();
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:35,代码来源:class.ThinkUpBasicUnitTestCase.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $webapp_plugin_registrar = PluginRegistrarWebapp::getInstance();
     $webapp_plugin_registrar->registerPlugin('twitter', 'TwitterPlugin');
     $this->config = Config::getInstance();
 }
开发者ID:73sl4,项目名称:ThinkUp,代码行数:7,代码来源:TestOfPostController.php

示例8: 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');
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:8,代码来源:TestOfDashboardController.php

示例9: 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';
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:8,代码来源:TestOfGeoEncoderPluginConfigurationController.php

示例10: 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';
 }
开发者ID:pepeleproso,项目名称:ThinkUp,代码行数:9,代码来源:TestOfAccountConfigurationController.php

示例11: 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");
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:13,代码来源:TestOfWebapp.php

示例12: 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();
 }
开发者ID:dgw,项目名称:ThinkUp,代码行数:10,代码来源:TestOfGeoEncoderPlugin.php

示例13: 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();
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:10,代码来源:TestOfTwitterPlugin.php

示例14: 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);
 }
开发者ID:pepeleproso,项目名称:ThinkUp,代码行数:16,代码来源:TestOfFacebookPluginConfigurationController.php

示例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");
 }
开发者ID:73sl4,项目名称:ThinkUp,代码行数:18,代码来源:TestOfFoursquarePlugin.php


注:本文中的PluginRegistrarWebapp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。