]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Administration/templates/ConfigureAjaxUI.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Administration / templates / ConfigureAjaxUI.tpl
1 {*
2 /*********************************************************************************
3  * SugarCRM Community Edition is a customer relationship management program developed by
4  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
5  * 
6  * This program is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License version 3 as published by the
8  * Free Software Foundation with the addition of the following permission added
9  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
10  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
11  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
12  * 
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
16  * details.
17  * 
18  * You should have received a copy of the GNU Affero General Public License along with
19  * this program; if not, see http://www.gnu.org/licenses or write to the Free
20  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21  * 02110-1301 USA.
22  * 
23  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
24  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
25  * 
26  * The interactive user interfaces in modified source and object code versions
27  * of this program must display Appropriate Legal Notices, as required under
28  * Section 5 of the GNU Affero General Public License version 3.
29  * 
30  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
31  * these Appropriate Legal Notices must retain the display of the "Powered by
32  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
33  * technical reasons, the Appropriate Legal Notices must display the words
34  * "Powered by SugarCRM".
35  ********************************************************************************/
36
37 *}
38 <script type="text/javascript" src="{sugar_getjspath file='cache/include/javascript/sugar_grp_yui_widgets.js'}"></script>
39 <form name="ConfigureAjaxUI" method="POST"  method="POST" action="index.php">
40         <input type="hidden" name="module" value="Administration">
41         <input type="hidden" name="action" value="UpdateAjaxUI">
42         <input type="hidden" id="enabled_modules" name="enabled_modules" value="">
43         <input type="hidden" id="disabled_modules" name="disabled_modules" value="">
44         <input type="hidden" name="return_module" value="{$RETURN_MODULE}">
45         <input type="hidden" name="return_action" value="{$RETURN_ACTION}">
46
47         {$title}<br/>
48         <p>{sugar_translate label="LBL_CONFIG_AJAX_DESC"}</p><br/>
49         <p>{sugar_translate label="LBL_CONFIG_AJAX_HELP"}</p><br/>
50         <input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button primary"
51                    onclick="SUGAR.saveConfigureTabs();" type="submit" name="saveButton"
52                    value="{$APP.LBL_SAVE_BUTTON_LABEL}" />
53         <input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button"
54                    onclick="this.form.action.value='index'; this.form.module.value='Administration';" type="submit" name="CancelButton"
55                    value="{$APP.LBL_CANCEL_BUTTON_LABEL}"/>
56         <div class='add_table' style='margin-bottom:5px'>
57                 <table id="ConfigureTabs" class="themeSettings edit view" style='margin-bottom:0px;' border="0" cellspacing="0" cellpadding="0">
58                         <tr>
59                                 <td width='1%'>
60                                         <div id="enabled_div" class="enabled_tab_workarea">
61                                         </div>
62                                 </td>
63                                 <td>
64                                         <div id="disabled_div" class="disabled_tab_workarea">
65                                         </div>
66                                 </td>
67                         </tr>
68                 </table>
69         </div>
70 </form>
71
72 <script type="text/javascript">
73         var enabled_modules = {$enabled_mods};
74         var disabled_modules = {$disabled_mods};
75         var lblEnabled = '{sugar_translate label="LBL_ACTIVE_MODULES"}';
76         var lblDisabled = '{sugar_translate label="LBL_DISABLED_MODULES"}';
77         {literal}
78         
79         SUGAR.enabledModsTable = new YAHOO.SUGAR.DragDropTable(
80                 "enabled_div",
81                 [{key:"label",  label: lblEnabled, width: 200, sortable: false},
82                  {key:"module", label: lblEnabled, hidden:true}],
83                 new YAHOO.util.LocalDataSource(enabled_modules, {
84                         responseSchema: {
85                            resultsList : "modules",
86                            fields : [{key : "module"}, {key : "label"}]
87                         }
88                 }), 
89                 {
90                         height: "300px",
91                         group: ["enabled_div", "disabled_div"]
92                 }
93         );
94         SUGAR.disabledModsTable = new YAHOO.SUGAR.DragDropTable(
95                 "disabled_div",
96                 [{key:"label",  label: lblDisabled, width: 200, sortable: false},
97                  {key:"module", label: lblDisabled, hidden:true}],
98                 new YAHOO.util.LocalDataSource(disabled_modules, {
99                         responseSchema: {
100                            resultsList : "modules",
101                            fields : [{key : "module"}, {key : "label"}]
102                         }
103                 }),
104                 {
105                         height: "300px",
106                         group: ["enabled_div", "disabled_div"]
107                  }
108         );
109         SUGAR.enabledModsTable.disableEmptyRows = true;
110     SUGAR.disabledModsTable.disableEmptyRows = true;
111     SUGAR.enabledModsTable.addRow({module: "", label: ""});
112     SUGAR.disabledModsTable.addRow({module: "", label: ""});
113         SUGAR.enabledModsTable.render();
114         SUGAR.disabledModsTable.render();
115
116         SUGAR.saveConfigureTabs = function()
117         {
118                 var disabledTable = SUGAR.disabledModsTable;
119                 var modules = [];
120                 for(var i=0; i < disabledTable.getRecordSet().getLength(); i++){
121                         var data = disabledTable.getRecord(i).getData();
122                         if (data.module && data.module != '')
123                             modules[i] = data.module;
124                 }
125                 YAHOO.util.Dom.get('disabled_modules').value = YAHOO.lang.JSON.stringify(modules);
126         }
127 {/literal}
128 </script>