本文整理汇总了PHP中TabController::get_users_can_edit方法的典型用法代码示例。如果您正苦于以下问题:PHP TabController::get_users_can_edit方法的具体用法?PHP TabController::get_users_can_edit怎么用?PHP TabController::get_users_can_edit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabController
的用法示例。
在下文中一共展示了TabController::get_users_can_edit方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings;
global $app_list_strings;
global $app_strings;
require_once "modules/MySettings/TabController.php";
$controller = new TabController();
$tabs = $controller->get_tabs_system();
$enabled = [];
foreach ($tabs[0] as $key => $value) {
$enabled[] = ["module" => $key, 'label' => translate($key)];
}
$disabled = [];
foreach ($tabs[1] as $key => $value) {
$disabled[] = ["module" => $key, 'label' => translate($key)];
}
$user_can_edit = $controller->get_users_can_edit();
$this->ss->assign('APP', $GLOBALS['app_strings']);
$this->ss->assign('MOD', $GLOBALS['mod_strings']);
$this->ss->assign('user_can_edit', $user_can_edit);
$this->ss->assign('enabled_tabs', json_encode($enabled));
$this->ss->assign('disabled_tabs', json_encode($disabled));
$this->ss->assign('title', $this->getModuleTitle(false));
//get list of all subpanels and panels to hide
$mod_list_strings_key_to_lower = array_change_key_case($app_list_strings['moduleList']);
$panels_arr = SubPanelDefinitions::get_all_subpanels();
$hidpanels_arr = SubPanelDefinitions::get_hidden_subpanels();
if (!$hidpanels_arr || !is_array($hidpanels_arr)) {
$hidpanels_arr = [];
}
//create array of subpanels to show, used to create Drag and Drop widget
$enabled = [];
foreach ($panels_arr as $key) {
if (empty($key)) {
continue;
}
$key = strtolower($key);
$enabled[] = ["module" => $key, "label" => $mod_list_strings_key_to_lower[$key]];
}
//now create array of subpanels to hide for use in Drag and Drop widget
$disabled = [];
foreach ($hidpanels_arr as $key) {
if (empty($key)) {
continue;
}
$key = strtolower($key);
$disabled[] = ["module" => $key, "label" => $mod_list_strings_key_to_lower[$key]];
}
$this->ss->assign('enabled_panels', json_encode($enabled));
$this->ss->assign('disabled_panels', json_encode($disabled));
echo $this->ss->fetch('modules/Administration/templates/ConfigureTabs.tpl');
}
示例2: TemplateGroupChooser
}
$xtpl->assign('REPORTS_TO_CHANGE_BUTTON', $reports_to_change_button_html);
/* Module Tab Chooser */
require_once 'include/templates/TemplateGroupChooser.php';
require_once 'modules/MySettings/TabController.php';
$chooser = new TemplateGroupChooser();
$controller = new TabController();
echo "<script>SUGAR.tabChooser.freezeOptions('display_tabs', 'hide_tabs', 'Home');</script>";
if (is_admin($current_user)) {
$chooser->display_hide_tabs = true;
$chooser->display_third_tabs = true;
$chooser->args['third_name'] = 'remove_tabs';
$chooser->args['third_label'] = $mod_strings['LBL_REMOVED_TABS'];
//$xtpl->parse("main.tabchooser");
}
if (is_admin($current_user) || $controller->get_users_can_edit()) {
$chooser->display_hide_tabs = true;
} else {
$chooser->display_hide_tabs = false;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($focus);
foreach ($chooser->args['values_array'][0] as $key => $value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][1] as $key => $value) {
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][2] as $key => $value) {
$chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key];
}
示例3: setupAdvancedTabNavSettings
protected function setupAdvancedTabNavSettings()
{
global $app_list_strings;
/* Module Tab Chooser */
require_once 'include/templates/TemplateGroupChooser.php';
require_once 'modules/MySettings/TabController.php';
$chooser = new TemplateGroupChooser();
$controller = new TabController();
if ($this->is_current_admin || $controller->get_users_can_edit()) {
$chooser->display_hide_tabs = true;
} else {
$chooser->display_hide_tabs = false;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($this->bean);
//Remove 'Home' module from tab configuration UI (we add it back in at top of display tabs on save)
if (isset($chooser->args['values_array'][0]['Home'])) {
unset($chooser->args['values_array'][0]['Home']);
}
if (isset($chooser->args['values_array'][1]['Home'])) {
unset($chooser->args['values_array'][1]['Home']);
}
if (isset($chooser->args['values_array'][2]['Home'])) {
unset($chooser->args['values_array'][2]['Home']);
}
foreach ($chooser->args['values_array'][0] as $key => $value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][1] as $key => $value) {
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][2] as $key => $value) {
$chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key];
}
$chooser->args['left_name'] = 'display_tabs';
$chooser->args['right_name'] = 'hide_tabs';
$chooser->args['left_label'] = translate('LBL_DISPLAY_TABS', 'Users');
$chooser->args['right_label'] = translate('LBL_HIDE_TABS', 'Users');
require_once 'include/SugarSmarty/plugins/function.sugar_help.php';
$chooser->args['title'] = translate('LBL_EDIT_TABS', 'Users') . smarty_function_sugar_help(array("text" => translate('LBL_CHOOSE_WHICH', 'Users')), $ss);
$this->ss->assign('TAB_CHOOSER', $chooser->display());
$this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();');
$this->ss->assign('CHOOSE_WHICH', translate('LBL_CHOOSE_WHICH', 'Users'));
}
示例4: TemplateGroupChooser
$buttons .= "<input type='button' class='button' onclick='if(confirm(\"{$reset_pref_warning}\"))window.location=\"" . $_SERVER['PHP_SELF'] . '?' . $the_query_string . "&reset_preferences=true\";' value='" . $mod_strings['LBL_RESET_PREFERENCES'] . "' />";
$buttons .= " <input type='button' class='button' onclick='if(confirm(\"{$reset_home_warning}\"))window.location=\"" . $_SERVER['PHP_SELF'] . '?' . $the_query_string . "&reset_homepage=true\";' value='" . $mod_strings['LBL_RESET_HOMEPAGE'] . "' />";
}
if (isset($buttons)) {
$sugar_smarty->assign("BUTTONS", $buttons);
}
require_once "include/templates/TemplateGroupChooser.php";
require_once "modules/MySettings/TabController.php";
$chooser = new TemplateGroupChooser();
$controller = new TabController();
//if(is_admin($current_user) || $controller->get_users_can_edit())
if (is_admin($current_user) || $GLOBALS['current_user']->isAdminForModule('Users')) {
$chooser->display_third_tabs = true;
$chooser->args['third_name'] = 'remove_tabs';
$chooser->args['third_label'] = $mod_strings['LBL_REMOVED_TABS'];
} elseif (!$controller->get_users_can_edit()) {
$chooser->display_hide_tabs = false;
} else {
$chooser->display_hide_tabs = true;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($focus);
$chooser->args['left_name'] = 'display_tabs';
$chooser->args['right_name'] = 'hide_tabs';
$chooser->args['left_label'] = $mod_strings['LBL_DISPLAY_TABS'];
$chooser->args['right_label'] = $mod_strings['LBL_HIDE_TABS'];
$chooser->args['title'] = $mod_strings['LBL_EDIT_TABS'];
$chooser->args['disable'] = true;
foreach ($chooser->args['values_array'][0] as $key => $value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
示例5: TemplateGroupChooser
$encoded_popup_request_data = $json->encode($popup_request_data);
$sugar_smarty->assign('encoded_popup_request_data', $encoded_popup_request_data);
//
///////////////////////////////////////
$reports_to_change_button_html = '<input type="button"' . " title=\"{$app_strings['LBL_SELECT_BUTTON_TITLE']}\"" . " accesskey=\"{$app_strings['LBL_SELECT_BUTTON_KEY']}\"" . " value=\"{$app_strings['LBL_SELECT_BUTTON_LABEL']}\"" . ' tabindex="5" class="button" name="btn1"' . " onclick='open_popup(\"Users\", 600, 400, \"\", true, false, {$encoded_popup_request_data});'" . "' />";
} else {
$sugar_smarty->assign('IS_ADMIN_DISABLED', 'disabled="disabled"');
}
$sugar_smarty->assign('REPORTS_TO_CHANGE_BUTTON', $reports_to_change_button_html);
/* Module Tab Chooser */
require_once 'include/templates/TemplateGroupChooser.php';
require_once 'modules/MySettings/TabController.php';
$chooser = new TemplateGroupChooser();
$controller = new TabController();
echo "<script>SUGAR.tabChooser.freezeOptions('display_tabs', 'hide_tabs', 'Home');</script>";
if ($is_current_admin || $controller->get_users_can_edit()) {
$chooser->display_hide_tabs = true;
} else {
$chooser->display_hide_tabs = false;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($focus);
foreach ($chooser->args['values_array'][0] as $key => $value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][1] as $key => $value) {
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][2] as $key => $value) {
$chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key];
}
示例6: setupAdvancedTabNavSettings
protected function setupAdvancedTabNavSettings()
{
global $app_list_strings;
// Grouped tabs?
$useGroupTabs = $this->bean->getPreference('navigation_paradigm');
if (!isset($useGroupTabs)) {
if (!isset($GLOBALS['sugar_config']['default_navigation_paradigm'])) {
$GLOBALS['sugar_config']['default_navigation_paradigm'] = 'gm';
}
$useGroupTabs = $GLOBALS['sugar_config']['default_navigation_paradigm'];
}
$this->ss->assign("USE_GROUP_TABS", $useGroupTabs == 'gm' ? 'checked' : '');
$user_subpanel_tabs = $this->bean->getPreference('subpanel_tabs');
if (isset($user_subpanel_tabs)) {
$this->ss->assign("SUBPANEL_TABS", $user_subpanel_tabs ? 'checked' : '');
} else {
$this->ss->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs'] ? 'checked' : '');
}
/* Module Tab Chooser */
require_once 'include/templates/TemplateGroupChooser.php';
require_once 'modules/MySettings/TabController.php';
$chooser = new TemplateGroupChooser();
$controller = new TabController();
if ($this->is_current_admin || $controller->get_users_can_edit()) {
$chooser->display_hide_tabs = true;
} else {
$chooser->display_hide_tabs = false;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($this->bean);
foreach ($chooser->args['values_array'][0] as $key => $value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][1] as $key => $value) {
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][2] as $key => $value) {
$chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key];
}
$chooser->args['left_name'] = 'display_tabs';
$chooser->args['right_name'] = 'hide_tabs';
$chooser->args['left_label'] = translate('LBL_DISPLAY_TABS', 'Users');
$chooser->args['right_label'] = translate('LBL_HIDE_TABS', 'Users');
require_once 'include/Smarty/plugins/function.sugar_help.php';
$chooser->args['title'] = translate('LBL_EDIT_TABS', 'Users') . smarty_function_sugar_help(array("text" => translate('LBL_CHOOSE_WHICH', 'Users')), $ss);
$this->ss->assign('TAB_CHOOSER', $chooser->display());
$this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();');
$this->ss->assign('CHOOSE_WHICH', translate('LBL_CHOOSE_WHICH', 'Users'));
}
示例7: TabController
sugar_die("Unauthorized access to administration.");
}
$title = get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'] . ": " . $mod_strings['LBL_CONFIGURE_TABS'], true);
global $theme;
global $currentModule;
$GLOBALS['log']->info("Administration ConfigureTabs view");
require_once "modules/MySettings/TabController.php";
$controller = new TabController();
$tabs = $controller->get_tabs_system();
$groups = array();
$groups[$mod_strings['LBL_DISPLAY_TABS']] = array();
foreach ($tabs[0] as $key => $value) {
$groups[$mod_strings['LBL_DISPLAY_TABS']][$key] = array('label' => '<span>' . $app_list_strings['moduleList'][$key] . '</span>');
}
$groups[$mod_strings['LBL_HIDE_TABS']] = array();
foreach ($tabs[1] as $key => $value) {
$groups[$mod_strings['LBL_HIDE_TABS']][$key] = array('label' => $app_list_strings['moduleList'][$key]);
}
global $app_list_strings, $app_strings;
$smarty = new Sugar_Smarty();
$user_can_edit = $controller->get_users_can_edit();
$smarty->assign('APP', $GLOBALS['app_strings']);
$smarty->assign('MOD', $GLOBALS['mod_strings']);
$smarty->assign('title', $title);
$smarty->assign('user_can_edit', $user_can_edit);
$smarty->assign('hideKeys', true);
$smarty->assign('groups', $groups);
$smarty->assign('description', $mod_strings['LBL_CONFIG_TABS']);
$buttons = $smarty->fetch("modules/Administration/ConfigureTabForm.tpl");
$smarty->assign('buttons', $buttons);
$smarty->display("modules/Studio/ListViewEditor/EditView.tpl");
示例8: setupAdvancedTabNavSettings
protected function setupAdvancedTabNavSettings()
{
global $app_list_strings;
// Grouped tabs?
$useGroupTabs = $this->bean->getPreference('navigation_paradigm');
if (!isset($useGroupTabs)) {
if (!isset($GLOBALS['sugar_config']['default_navigation_paradigm'])) {
$GLOBALS['sugar_config']['default_navigation_paradigm'] = 'gm';
}
$useGroupTabs = $GLOBALS['sugar_config']['default_navigation_paradigm'];
}
$this->ss->assign("USE_GROUP_TABS", $useGroupTabs == 'gm' ? 'checked' : '');
$user_max_tabs = $this->bean->getPreference('max_tabs');
if (isset($user_max_tabs) && $user_max_tabs > 0) {
$this->ss->assign("MAX_TAB", $user_max_tabs);
} elseif (SugarThemeRegistry::current()->maxTabs > 0) {
$this->ss->assign("MAX_TAB", SugarThemeRegistry::current()->maxTabs);
} else {
$this->ss->assign("MAX_TAB", $GLOBALS['sugar_config']['default_max_tabs']);
}
$this->ss->assign("MAX_TAB_OPTIONS", range(1, !empty($GLOBALS['sugar_config']['default_max_tabs']) && $GLOBALS['sugar_config']['default_max_tabs'] > 10 ? $GLOBALS['sugar_config']['default_max_tabs'] : 10));
$user_subpanel_tabs = $this->bean->getPreference('subpanel_tabs');
if (isset($user_subpanel_tabs)) {
$this->ss->assign("SUBPANEL_TABS", $user_subpanel_tabs ? 'checked' : '');
} else {
$this->ss->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs'] ? 'checked' : '');
}
/* Module Tab Chooser */
require_once 'include/templates/TemplateGroupChooser.php';
require_once 'modules/MySettings/TabController.php';
$chooser = new TemplateGroupChooser();
$controller = new TabController();
if ($this->is_current_admin || $controller->get_users_can_edit()) {
$chooser->display_hide_tabs = true;
} else {
$chooser->display_hide_tabs = false;
}
$chooser->args['id'] = 'edit_tabs';
$chooser->args['values_array'] = $controller->get_tabs($this->bean);
foreach ($chooser->args['values_array'][0] as $key => $value) {
$chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][1] as $key => $value) {
$chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key];
}
foreach ($chooser->args['values_array'][2] as $key => $value) {
$chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key];
}
$chooser->args['left_name'] = 'display_tabs';
$chooser->args['right_name'] = 'hide_tabs';
$chooser->args['left_label'] = translate('LBL_DISPLAY_TABS', 'Users');
$chooser->args['right_label'] = translate('LBL_HIDE_TABS', 'Users');
$chooser->args['title'] = translate('LBL_EDIT_TABS', 'Users') . ' <!--not_in_theme!--><img border="0" src="themes/default/images/helpInline.gif" onmouseover="return overlib(\'Choose which tabs are displayed.\', FGCLASS, \'olFgClass\', CGCLASS, \'olCgClass\', BGCLASS, \'olBgClass\', TEXTFONTCLASS, \'olFontClass\', CAPTIONFONTCLASS, \'olCapFontClass\', CLOSEFONTCLASS, \'olCloseFontClass\', WIDTH, -1, NOFOLLOW, \'ol_nofollow\' );" onmouseout="return nd();"/>';
$this->ss->assign('TAB_CHOOSER', $chooser->display());
$this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();');
$this->ss->assign('CHOOSE_WHICH', translate('LBL_CHOOSE_WHICH', 'Users'));
}
示例9: display
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings;
global $app_list_strings;
global $app_strings;
require_once "modules/MySettings/TabController.php";
$controller = new TabController();
$tabs = $controller->get_tabs_system();
// Remove Home module from UI. We add it back to front of display tab list on save.
if (isset($tabs[0]['Home'])) {
unset($tabs[0]['Home']);
}
if (isset($tabs[1]['Home'])) {
unset($tabs[1]['Home']);
}
$enabled = array();
foreach ($tabs[0] as $key => $value) {
$enabled[] = array("module" => $key, 'label' => translate($key));
}
$disabled = array();
foreach ($tabs[1] as $key => $value) {
$disabled[] = array("module" => $key, 'label' => translate($key));
}
$user_can_edit = $controller->get_users_can_edit();
$this->ss->assign('APP', $GLOBALS['app_strings']);
$this->ss->assign('MOD', $GLOBALS['mod_strings']);
$this->ss->assign('user_can_edit', $user_can_edit);
$this->ss->assign('enabled_tabs', json_encode($enabled));
$this->ss->assign('disabled_tabs', json_encode($disabled));
$this->ss->assign('title', $this->getModuleTitle(false));
//get list of all subpanels and panels to hide
$mod_list_strings_key_to_lower = array_change_key_case($app_list_strings['moduleList']);
$panels_arr = SubPanelDefinitions::get_all_subpanels();
$hidpanels_arr = SubPanelDefinitions::get_hidden_subpanels();
if (!$hidpanels_arr || !is_array($hidpanels_arr)) {
$hidpanels_arr = array();
}
//create array of subpanels to show, used to create Drag and Drop widget
$enabled = array();
foreach ($panels_arr as $key) {
if (empty($key)) {
continue;
}
$key = strtolower($key);
$enabled[] = array("module" => $key, "label" => $mod_list_strings_key_to_lower[$key]);
}
//now create array of subpanels to hide for use in Drag and Drop widget
$disabled = array();
foreach ($hidpanels_arr as $key) {
if (empty($key)) {
continue;
}
$key = strtolower($key);
// we need this here for with RLI's are disabled as they shouldn't be seen in the list
if ($key == 'revenuelineitems' && in_array('RevenueLineItems', $GLOBALS['modInvisList'])) {
continue;
}
$disabled[] = array("module" => $key, "label" => $mod_list_strings_key_to_lower[$key]);
}
$this->ss->assign('enabled_panels', json_encode($enabled));
$this->ss->assign('disabled_panels', json_encode($disabled));
echo $this->ss->fetch('modules/Administration/templates/ConfigureTabs.tpl');
}