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


PHP SugarFeed::getAllFeedModules方法代码示例

本文整理汇总了PHP中SugarFeed::getAllFeedModules方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarFeed::getAllFeedModules方法的具体用法?PHP SugarFeed::getAllFeedModules怎么用?PHP SugarFeed::getAllFeedModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SugarFeed的用法示例。


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

示例1: enableSugarFeeds

/**
 * Fully enable SugarFeeds, enabling the user feed and all available modules that have SugarFeed data.
 */
function enableSugarFeeds()
{
    $admin = new Administration();
    $admin->saveSetting('sugarfeed', 'enabled', '1');
    foreach (SugarFeed::getAllFeedModules() as $module) {
        SugarFeed::activateModuleFeed($module);
    }
    check_logic_hook_file('Users', 'after_login', array(1, 'SugarFeed old feed entry remover', 'modules/SugarFeed/SugarFeedFlush.php', 'SugarFeedFlush', 'flushStaleEntries'));
}
开发者ID:stefano6310,项目名称:SuiteCRM,代码行数:12,代码来源:install_utils.php

示例2: translate

            $db->query("UPDATE sugarfeed SET deleted = '1'");
            echo translate('LBL_RECORDS_DELETED', 'SugarFeed');
        }
    }
    if ($_REQUEST['process'] == 'true' || $_REQUEST['process'] == 'false') {
        header('Location: index.php?module=Administration&action=index');
        return;
    }
}
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('mod', $mod_strings);
$sugar_smarty->assign('app', $app_strings);
if (isset($admin->settings['sugarfeed_enabled']) && $admin->settings['sugarfeed_enabled'] == '1') {
    $sugar_smarty->assign('enabled_checkbox', 'checked');
}
$possible_feeds = SugarFeed::getAllFeedModules();
$module_list = array();
$userFeedEnabled = 0;
foreach ($possible_feeds as $module) {
    $currModule = array();
    if (isset($admin->settings['sugarfeed_module_' . $module]) && $admin->settings['sugarfeed_module_' . $module] == '1') {
        $currModule['enabled'] = 1;
    } else {
        $currModule['enabled'] = 0;
    }
    $currModule['module'] = $module;
    if ($module == 'UserFeed') {
        // Fake module, need to handle specially
        $userFeedEnabled = $currModule['enabled'];
        continue;
    } else {
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:31,代码来源:AdminSettings.php

示例3: display

 /** 
  * @see SugarView::display()
  */
 public function display()
 {
     global $mod_strings, $app_strings;
     $admin = new Administration();
     $admin->retrieveSettings();
     // Handle posts
     if (!empty($_REQUEST['process'])) {
         // Check the cleanup logic hook, make sure it is still there
         check_logic_hook_file('Users', 'after_login', array(1, 'SugarFeed old feed entry remover', 'modules/SugarFeed/SugarFeedFlush.php', 'SugarFeedFlush', 'flushStaleEntries'));
         // We have data posted
         if ($_REQUEST['process'] == 'true') {
             // They want us to process it, the false will just fall outside of this statement
             if ($_REQUEST['feed_enable'] == '1') {
                 // The feed is enabled, pay attention to what categories should be enabled or disabled
                 $db = DBManagerFactory::getInstance();
                 $ret = $db->query("SELECT * FROM config WHERE category = 'sugarfeed' AND name LIKE 'module_%'");
                 $current_modules = array();
                 while ($row = $db->fetchByAssoc($ret)) {
                     $current_modules[$row['name']] = $row['value'];
                 }
                 $active_modules = $_REQUEST['modules'];
                 if (!is_array($active_modules)) {
                     $active_modules = array();
                 }
                 foreach ($active_modules as $name => $is_active) {
                     $module = substr($name, 7);
                     if ($is_active == '1') {
                         // They are activating something that was disabled before
                         SugarFeed::activateModuleFeed($module);
                     } else {
                         // They are disabling something that was active before
                         SugarFeed::disableModuleFeed($module);
                     }
                 }
                 $admin->saveSetting('sugarfeed', 'enabled', '1');
             } else {
                 $admin->saveSetting('sugarfeed', 'enabled', '0');
                 // Now we need to remove all of the logic hooks, so they don't continue to run
                 // We also need to leave the database alone, so they can enable/disable modules with the system disabled
                 $modulesWithFeeds = SugarFeed::getAllFeedModules();
                 foreach ($modulesWithFeeds as $currFeedModule) {
                     SugarFeed::disableModuleFeed($currFeedModule, FALSE);
                 }
             }
             $admin->retrieveSettings(FALSE, TRUE);
             SugarFeed::flushBackendCache();
         } else {
             if ($_REQUEST['process'] == 'deleteRecords') {
                 if (!isset($db)) {
                     $db = DBManagerFactory::getInstance();
                 }
                 $db->query("UPDATE sugarfeed SET deleted = '1'");
                 echo translate('LBL_RECORDS_DELETED', 'SugarFeed');
             }
         }
         if ($_REQUEST['process'] == 'true' || $_REQUEST['process'] == 'false') {
             header('Location: index.php?module=Administration&action=index');
             return;
         }
     }
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('app', $app_strings);
     if (isset($admin->settings['sugarfeed_enabled']) && $admin->settings['sugarfeed_enabled'] == '1') {
         $sugar_smarty->assign('enabled_checkbox', 'checked');
     }
     $possible_feeds = SugarFeed::getAllFeedModules();
     $module_list = array();
     $userFeedEnabled = 0;
     foreach ($possible_feeds as $module) {
         $currModule = array();
         if (isset($admin->settings['sugarfeed_module_' . $module]) && $admin->settings['sugarfeed_module_' . $module] == '1') {
             $currModule['enabled'] = 1;
         } else {
             $currModule['enabled'] = 0;
         }
         $currModule['module'] = $module;
         if ($module == 'UserFeed') {
             // Fake module, need to handle specially
             $userFeedEnabled = $currModule['enabled'];
             continue;
         } else {
             $currModule['label'] = $GLOBALS['app_list_strings']['moduleList'][$module];
         }
         $module_list[] = $currModule;
     }
     $sugar_smarty->assign('module_list', $module_list);
     $sugar_smarty->assign('user_feed_enabled', $userFeedEnabled);
     echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_MODULE_NAME']), false);
     $sugar_smarty->display('modules/SugarFeed/tpls/AdminSettings.tpl');
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:94,代码来源:view.adminsettings.php

示例4: enableSugarFeeds

/**
 * Fully enable SugarFeeds, enabling the user feed and all available modules that have SugarFeed data.
 */
function enableSugarFeeds()
{
    $admin = new Administration();
    $admin->saveSetting('sugarfeed', 'enabled', '1');
    foreach (SugarFeed::getAllFeedModules() as $module) {
        SugarFeed::activateModuleFeed($module);
    }
}
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:11,代码来源:install_utils.php

示例5: testgetAllFeedModules

 public function testgetAllFeedModules()
 {
     $result = SugarFeed::getAllFeedModules();
     $expected = array('UserFeed' => 'UserFeed', 'Cases' => 'Cases', 'Contacts' => 'Contacts', 'Leads' => 'Leads', 'Opportunities' => 'Opportunities');
     $this->assertEquals($expected, $result);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:6,代码来源:SugarFeedTest.php


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