]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Studio/TabGroups/EditViewTabs.php
Release 6.4.0
[Github/sugarcrm.git] / modules / Studio / TabGroups / EditViewTabs.php
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39
40
41 global $app_list_strings, $app_strings, $mod_strings;
42
43 require_once('modules/Studio/TabGroups/TabGroupHelper.php');
44 require_once('modules/Studio/parsers/StudioParser.php');
45
46 $tabGroupSelected_lang = (!empty($_GET['lang'])?$_GET['lang']:$_SESSION['authenticated_user_language']);
47 $tg = new TabGroupHelper();
48 $smarty = new Sugar_Smarty();
49 if(empty($GLOBALS['tabStructure'])){
50         require_once('include/tabConfig.php');
51 }
52 $title=getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_CONFIGURE_GROUP_TABS']), false);
53
54 #30205
55 $selectedAppLanguages = return_application_language($tabGroupSelected_lang);
56 require_once('include/GroupedTabs/GroupedTabStructure.php');
57 $availableModules = $tg->getAvailableModules($tabGroupSelected_lang);
58 $smarty->assign('availableModuleList',$availableModules);
59 $modList = array_keys($availableModules);
60 $modList = array_combine($modList, $modList); // Bug #48693 We need full list of modules here instead of displayed modules
61 $groupedTabsClass = new GroupedTabStructure();
62 $groupedTabStructure = $groupedTabsClass->get_tab_structure($modList, '', true,true);
63 foreach($groupedTabStructure as $mainTab => $subModules){
64         $groupedTabStructure[$mainTab]['label'] = $mainTab;
65         $groupedTabStructure[$mainTab]['labelValue'] = $selectedAppLanguages[$mainTab];
66 }
67
68 $smarty->assign('tabs', $groupedTabStructure);
69 #end of 30205
70 $selectedLanguageModStrings = return_module_language($tabGroupSelected_lang , 'Studio');
71 $smarty->assign('TGMOD', $selectedLanguageModStrings);
72 $smarty->assign('MOD', $GLOBALS['mod_strings']);
73 $smarty->assign('otherLabel', 'LBL_TABGROUP_OTHER');
74 $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
75 if(empty($selected_lang)){
76     $selected_lang = $GLOBALS['sugar_config']['default_language'];
77 }
78
79 $smarty->assign('dropdown_languages', get_languages());
80
81
82 $imageSave = SugarThemeRegistry::current()->getImage( 'studio_save', '',null,null,'.gif',$mod_strings['LBL_SAVE']);
83
84 $buttons = array();
85 $buttons [] = array ( 'text' => $GLOBALS['mod_strings']['LBL_BTN_SAVEPUBLISH'],'actionScript'=>"onclick='studiotabs.generateForm(\"edittabs\");document.edittabs.submit()'" ) ;
86 $html = "" ;
87 foreach ( $buttons as $button )
88 {
89     $html .= "<td><input type='button' valign='center' class='button' style='cursor:pointer' onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}' ></td>" ;
90 }
91 $smarty->assign('buttons', $html);
92 $smarty->assign('title', $title);
93 $smarty->assign('dropdown_lang', $selected_lang);
94
95 $editImage = SugarThemeRegistry::current()->getImage( 'edit_inline', '',null,null,'.gif',$mod_strings['LBL_EDIT']);
96 $smarty->assign('editImage',$editImage);
97 $deleteImage = SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE']);
98 $recycleImage = SugarThemeRegistry::current()->getImage('icon_Delete','',48,48,'.gif',$mod_strings['LBL_MB_DELETE'] );
99 $smarty->assign('deleteImage',$deleteImage);
100 $smarty->assign('recycleImage',$recycleImage);  
101
102 //#30205
103 global $sugar_config;
104 if(isset($sugar_config['other_group_tab_displayed'])){
105         if($sugar_config['other_group_tab_displayed']){
106                 $value = 'checked';
107         }else{
108                 $value = null;
109         }
110         $smarty->assign('other_group_tab_displayed', $value);
111 }else{
112         $smarty->assign('other_group_tab_displayed', 'checked');
113 }
114 $smarty->assign('tabGroupSelected_lang', $tabGroupSelected_lang);
115
116 $smarty->assign('available_languages', get_languages());
117 $smarty->display("modules/Studio/TabGroups/EditViewTabs.tpl");
118 ?>