} else { $keys = array_keys($dropdowns); $first_string = $dropdowns[$keys[0]]; $smarty->assign('dropdowns', $dropdowns); if (empty($_REQUEST['dropdown_name']) || !in_array($_REQUEST['dropdown_name'], $dropdowns)) { $_REQUEST['dropdown_name'] = $first_string; } $selected_dropdown = $my_list_strings[$_REQUEST['dropdown_name']]; foreach ($selected_dropdown as $key => $value) { if ($selected_lang != $_SESSION['authenticated_user_language'] && !empty($app_list_strings[$_REQUEST['dropdown_name']]) && isset($app_list_strings[$_REQUEST['dropdown_name']][$key])) { $selected_dropdown[$key] = array('lang' => $value, 'user_lang' => '[' . $app_list_strings[$_REQUEST['dropdown_name']][$key] . ']'); } else { $selected_dropdown[$key] = array('lang' => $value); } } $selected_dropdown = $dh->filterDropDown($_REQUEST['dropdown_name'], $selected_dropdown); $smarty->assign('dropdown', $selected_dropdown); $smarty->assign('dropdown_name', $_REQUEST['dropdown_name']); } $smarty->assign('dropdown_languages', get_languages()); if (strcmp($_REQUEST['dropdown_name'], 'moduleList') == 0) { $smarty->assign('disable_remove', true); $smarty->assign('disable_add', true); $smarty->assign('use_push', 1); } else { $smarty->assign('use_push', 0); } $imageSave = SugarThemeRegistry::current()->getImage('studio_save', '', null, null, '.gif', $mod_strings['LBL_SAVE']); $imageUndo = SugarThemeRegistry::current()->getImage('studio_undo', '', null, null, '.gif', $mod_strings['LBL_UNDO']); $imageRedo = SugarThemeRegistry::current()->getImage('studio_redo', '', null, null, '.gif', $mod_strings['LBL_REDO']); $buttons = array();
/** * Main display function. * * @return void */ protected function display() { global $app_list_strings, $mod_strings; require_once 'modules/Studio/parsers/StudioParser.php'; $dh = new DropDownHelper(); $smarty = new Sugar_Smarty(); $smarty->assign('MOD', $GLOBALS['mod_strings']); $title = getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array("<a href='index.php?module=Administration&action=index'>" . $mod_strings['LBL_MODULE_NAME'] . "</a>", $mod_strings['LBL_RENAME_TABS']), false); $smarty->assign('title', $title); $selected_lang = !empty($_REQUEST['dropdown_lang']) ? $_REQUEST['dropdown_lang'] : $_SESSION['authenticated_user_language']; if (empty($selected_lang)) { $selected_lang = $GLOBALS['sugar_config']['default_language']; } if ($selected_lang == $GLOBALS['current_language']) { $my_list_strings = $GLOBALS['app_list_strings']; } else { $my_list_strings = return_app_list_strings_language($selected_lang); } $selected_dropdown = $my_list_strings['moduleList']; $selected_dropdown_singular = $my_list_strings['moduleListSingular']; foreach ($selected_dropdown as $key => $value) { $singularValue = isset($selected_dropdown_singular[$key]) ? $selected_dropdown_singular[$key] : $value; if ($selected_lang != $_SESSION['authenticated_user_language'] && !empty($app_list_strings['moduleList']) && isset($app_list_strings['moduleList'][$key])) { $selected_dropdown[$key] = array('lang' => $value, 'user_lang' => '[' . $app_list_strings['moduleList'][$key] . ']', 'singular' => $singularValue); } else { $selected_dropdown[$key] = array('lang' => $value, 'singular' => $singularValue); } } $selected_dropdown = $dh->filterDropDown('moduleList', $selected_dropdown); $smarty->assign('dropdown', $selected_dropdown); $smarty->assign('dropdown_languages', get_languages()); $buttons = array(); $buttons[] = array('text' => $mod_strings['LBL_BTN_UNDO'], 'actionScript' => "onclick='jstransaction.undo()'"); $buttons[] = array('text' => $mod_strings['LBL_BTN_REDO'], 'actionScript' => "onclick='jstransaction.redo()'"); $buttons[] = array('text' => $mod_strings['LBL_BTN_SAVE'], 'actionScript' => "onclick='if(check_form(\"editdropdown\")){document.editdropdown.submit();}'"); $buttonTxt = StudioParser::buildImageButtons($buttons); $smarty->assign('buttons', $buttonTxt); $smarty->assign('dropdown_lang', $selected_lang); $editImage = SugarThemeRegistry::current()->getImage('edit_inline', ''); $smarty->assign('editImage', $editImage); $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', ''); $smarty->assign('deleteImage', $deleteImage); $smarty->display("modules/Studio/wizards/RenameModules.tpl"); }