Ejemplo n.º 1
0
 public function testgetModuleFeedFiles()
 {
     //test with invalid module
     $expected = array();
     $result = SugarFeed::getModuleFeedFiles('Accounts');
     $this->assertEquals($expected, $result);
     //test with valid module
     $expected = array('CaseFeed.php' => 'modules/Cases/SugarFeeds/CaseFeed.php');
     $result = SugarFeed::getModuleFeedFiles('Cases');
     $this->assertEquals($expected, $result);
 }
Ejemplo n.º 2
0
 static function disableModuleFeed($module, $updateDB = true)
 {
     if ($module != 'UserFeed') {
         // UserFeed is a fake module, used for the user postings to the feed
         // Don't try to load up any classes for it
         $fileList = SugarFeed::getModuleFeedFiles($module);
         foreach ($fileList as $fileName) {
             $feedClass = substr(basename($fileName), 0, -4);
             require_once $fileName;
             $tmpClass = new $feedClass();
             $tmpClass->removeHook($fileName, $feedClass);
         }
     }
     if ($updateDB == true) {
         $admin = new Administration();
         $admin->saveSetting('sugarfeed', 'module_' . $admin->db->quote($module), '0');
     }
 }