本文整理汇总了PHP中TabController::get_system_tabs方法的典型用法代码示例。如果您正苦于以下问题:PHP TabController::get_system_tabs方法的具体用法?PHP TabController::get_system_tabs怎么用?PHP TabController::get_system_tabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabController
的用法示例。
在下文中一共展示了TabController::get_system_tabs方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
if (!($this->from_flavor == 'ce' && $this->toFlavor('pro'))) {
return;
}
//check to see if there are any new files that need to be added to systems tab
//retrieve old modules list
$this->log('check to see if new modules exist');
if (empty($this->state['old_modules'])) {
$this->log('No old modules info, skipping it');
return;
} else {
$oldModuleList = $this->state['old_modules'];
}
$newModuleList = array();
include 'include/modules.php';
$newModuleList = $moduleList;
//include tab controller
require_once 'modules/MySettings/TabController.php';
$newTB = new TabController();
//make sure new modules list has a key we can reference directly
$newModuleList = $newTB->get_key_array($newModuleList);
$oldModuleList = $newTB->get_key_array($oldModuleList);
//iterate through list and remove commonalities to get new modules
foreach ($newModuleList as $remove_mod) {
if (in_array($remove_mod, $oldModuleList)) {
unset($newModuleList[$remove_mod]);
}
}
$must_have_modules = array('Activities' => 'Activities', 'Calendar' => 'Calendar', 'Reports' => 'Reports', 'Quotes' => 'Quotes', 'Products' => 'Products', 'Forecasts' => 'Forecasts', 'Contracts' => 'Contracts', 'KBDocuments' => 'KBDocuments');
$newModuleList = array_merge($newModuleList, $must_have_modules);
//new modules list now has left over modules which are new to this install, so lets add them to the system tabs
$this->log('new modules to add are ' . var_export($newModuleList, true));
//grab the existing system tabs
$tabs = $newTB->get_system_tabs();
//add the new tabs to the array
foreach ($newModuleList as $nm) {
$tabs[$nm] = $nm;
}
//now assign the modules to system tabs
$newTB->set_system_tabs($tabs);
$this->log('module tabs updated');
}
示例2: run
public function run()
{
if ($this->fromFlavor('ent') && version_compare($this->from_version, '7.6.0', '>=')) {
return;
}
//include tab controller
require_once 'modules/MySettings/TabController.php';
$newTB = new TabController();
$must_have_modules = array('pmse_Project', 'pmse_Inbox', 'pmse_Business_Rules', 'pmse_Emails_Templates');
//grab the existing system tabs
$tabs = $newTB->get_system_tabs();
//add the new tabs to the array
foreach ($must_have_modules as $nm) {
$tabs[$nm] = $nm;
}
//now assign the modules to system tabs
$newTB->set_system_tabs($tabs);
$this->log('module tabs updated with pmse');
}
示例3: TabController
$newTB = new TabController();
//make sure new modules list has a key we can reference directly
$newModuleList = $newTB->get_key_array($newModuleList);
$oldModuleList = $newTB->get_key_array($oldModuleList);
//iterate through list and remove commonalities to get new modules
foreach ($newModuleList as $remove_mod) {
if (in_array($remove_mod, $oldModuleList)) {
unset($newModuleList[$remove_mod]);
}
}
$must_have_modules = array('Activities' => 'Activities', 'Calendar' => 'Calendar', 'Reports' => 'Reports', 'Quotes' => 'Quotes', 'Products' => 'Products', 'Forecasts' => 'Forecasts', 'Contracts' => 'Contracts', 'KBDocuments' => 'KBDocuments');
$newModuleList = array_merge($newModuleList, $must_have_modules);
//new modules list now has left over modules which are new to this install, so lets add them to the system tabs
logThis('new modules to add are ' . var_export($newModuleList, true), $path);
//grab the existing system tabs
$tabs = $newTB->get_system_tabs();
//add the new tabs to the array
foreach ($newModuleList as $nm) {
$tabs[$nm] = $nm;
}
//now assign the modules to system tabs
$newTB->set_system_tabs($tabs);
logThis('module tabs updated', $path);
}
//Also set the tracker settings if flavor conversion ce->pro or ce->ent
if (isset($_SESSION['current_db_version']) && isset($_SESSION['target_db_version'])) {
if ($_SESSION['current_db_version'] == $_SESSION['target_db_version']) {
$_REQUEST['upgradeWizard'] = true;
ob_start();
include 'include/Smarty/internals/core.write_file.php';
ob_end_clean();
示例4: addNewSystemTabsFromUpgrade
function addNewSystemTabsFromUpgrade($from_dir)
{
global $path;
if (isset($_SESSION['upgrade_from_flavor'])) {
//check to see if there are any new files that need to be added to systems tab
//retrieve old modules list
logThis('check to see if new modules exist', $path);
$oldModuleList = array();
$newModuleList = array();
include $from_dir . '/include/modules.php';
$oldModuleList = $moduleList;
include 'include/modules.php';
$newModuleList = $moduleList;
//include tab controller
require_once 'modules/MySettings/TabController.php';
$newTB = new TabController();
//make sure new modules list has a key we can reference directly
$newModuleList = $newTB->get_key_array($newModuleList);
$oldModuleList = $newTB->get_key_array($oldModuleList);
//iterate through list and remove commonalities to get new modules
foreach ($newModuleList as $remove_mod) {
if (in_array($remove_mod, $oldModuleList)) {
unset($newModuleList[$remove_mod]);
}
}
//new modules list now has left over modules which are new to this install, so lets add them to the system tabs
logThis('new modules to add are ' . var_export($newModuleList, true), $path);
if (!empty($newModuleList)) {
//grab the existing system tabs
$tabs = $newTB->get_system_tabs();
//add the new tabs to the array
foreach ($newModuleList as $nm) {
$tabs[$nm] = $nm;
}
$newTB->set_system_tabs($tabs);
}
logThis('module tabs updated', $path);
}
}
示例5: UpdateSystemTabs
function UpdateSystemTabs($action, $installed_modules)
{
require_once "modules/MySettings/TabController.php";
$controller = new TabController();
$isSystemTabsInDB = $controller->is_system_tabs_in_db();
if ($isSystemTabsInDB && !empty($installed_modules)) {
global $moduleList;
switch ($action) {
case 'Restore':
$currentTabs = $controller->get_system_tabs();
foreach ($installed_modules as $module) {
if (in_array($module, $currentTabs)) {
unset($currentTabs[$module]);
}
}
$controller->set_system_tabs($currentTabs);
break;
case 'Add':
$currentTabs = $controller->get_system_tabs();
foreach ($installed_modules as $module) {
if (!in_array($module, $currentTabs)) {
$currentTabs[$module] = $module;
}
}
$controller->set_system_tabs($currentTabs);
default:
break;
}
}
}
示例6: getTabList
/**
* Get tabs for the navigation bar of this application
*
* @return array An array of module names
*/
public function getTabList()
{
$controller = new TabController();
return array_keys($controller->get_system_tabs());
}
示例7: updateSystemTabs
/**
* Updates systems tabs
*
* @param string $action The action to take
* @param array $installed_modules The list of modules to add for this action
*/
protected function updateSystemTabs($action, $installed_modules)
{
global $moduleList;
$controller = new TabController();
$isSystemTabsInDB = $controller->is_system_tabs_in_db();
if ($isSystemTabsInDB && !empty($installed_modules)) {
switch ($action) {
case 'Restore':
$currentTabs = $controller->get_system_tabs();
foreach ($installed_modules as $module) {
if (in_array($module, $currentTabs)) {
unset($currentTabs[$module]);
}
}
$controller->set_system_tabs($currentTabs);
break;
case 'Add':
$currentTabs = $controller->get_system_tabs();
foreach ($installed_modules as $module) {
if (!in_array($module, $currentTabs)) {
$currentTabs[$module] = $module;
}
}
$controller->set_system_tabs($currentTabs);
break;
}
if (isset($_SESSION['get_workflow_admin_modules_for_user'])) {
return $_SESSION['get_workflow_admin_modules_for_user'];
}
}
}
示例8: setRevenueLineItemTab
protected function setRevenueLineItemTab($show)
{
SugarAutoLoader::load('modules/MySettings/TabController.php');
$newTB = new TabController();
//grab the existing system tabs
$tabs = $newTB->get_system_tabs();
if ($show) {
$tabs['RevenueLineItems'] = 'RevenueLineItems';
} else {
unset($tabs['RevenueLineItems']);
}
//now assign the modules to system tabs
$newTB->set_system_tabs($tabs);
}