]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Configurator/tpls/fontmanager.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Configurator / tpls / fontmanager.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
39
40 *}
41 <script type="text/javascript" src='{sugar_getjspath file ='cache/include/javascript/sugar_grp_yui_widgets.js'}'></script>
42 <script type="text/javascript" src='{sugar_getjspath file ='include/javascript/yui/build/paginator/paginator-min.js'}'></script>
43 {literal}
44 <style type="text/css">
45     .yui-pg-container {
46         background: none;
47     }
48 </style>
49 {/literal}
50 <p>
51 {$MODULE_TITLE}
52 </p>
53 <form enctype="multipart/form-data" name="fontmanager" method="POST" action="index.php" id="fontmanager">
54 <input type="hidden" name="module" value="Configurator">
55 <input type="hidden" name="action" value="FontManager">
56 <input type="hidden" name="action_type" value="">
57 <input type="hidden" name="filename" value="">
58 <input type="hidden" name='return_action' value="{$RETURN_ACTION}">
59 <span class='error'>{$error}</span>
60 <br>
61 <table width="100%" cellpadding="0" cellspacing="0" border="0">
62     <tr>
63         <td align="left">
64             <input title="{$MOD.LBL_BACK}" accessKey="" class="button" type="button" name="gobackbutton" value="  {$MOD.LBL_BACK}  " id="gobackbutton">&nbsp;
65             <input title="{$MOD.LBL_ADD_FONT}" accessKey="" class="button" type="button" name="addFontbutton" value="  {$MOD.LBL_ADD_FONT}  " id="addFontbutton">
66         </td>
67     </tr>
68 </table>
69
70 <br>
71 <div id="YuiListMarkup"></div>
72 <br>
73
74 </form>
75 {literal}
76 <script type="text/javascript">
77 var removeFormatter = function (el, oRecord, oColumn, oData) {
78     if(oRecord._oData.type != "{/literal}{$MOD.LBL_FONT_TYPE_CORE}{literal}" && oRecord._oData.fontpath != "{/literal}{$K_PATH_FONTS}{literal}"){
79         el.innerHTML = '<a href="#" name="deleteButton" onclick="return false;">{sugar_getimage name="delete_inline" ext=".gif" alt=$mod_strings.LBL_DELETE other_attributes='align="absmiddle" border="0" '}{/literal} {$MOD.LBL_REMOVE}{literal}<\/a>';
80     }
81 };
82 YAHOO.util.Event.onDOMReady(function() {
83 {/literal}
84         var fontColumnDefs = {$COLUMNDEFS};
85     var fontData = {$DATASOURCE};
86 {literal}
87         var fontDataSource = new YAHOO.util.DataSource(fontData);
88         fontDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
89     fontDataSource.responseSchema = {/literal}{$RESPONSESCHEMA}{literal};
90     var oConfigs = {
91         paginator: new YAHOO.widget.Paginator({
92             rowsPerPage:15
93         })
94     };
95     var fontDataTable = new YAHOO.widget.DataTable("YuiListMarkup", fontColumnDefs, fontDataSource, oConfigs);
96
97     fontDataTable.subscribe("linkClickEvent", function(oArgs){
98         if(oArgs.target.name == "deleteButton"){
99             if(confirm('{/literal}{$MOD.LBL_JS_CONFIRM_DELETE_FONT}{literal}')){
100                    document.getElementById("fontmanager").action.value = "deleteFont";
101                    document.getElementById("fontmanager").filename.value = this.getRecord(oArgs.target)._oData.filename;
102                    document.getElementById("fontmanager").submit();
103             }
104         }
105     });
106     
107     document.getElementById('gobackbutton').onclick=function(){
108         if(document.getElementById("fontmanager").return_action.value != ""){
109                 document.location.href='index.php?module=Configurator&action=' + document.getElementById("fontmanager").return_action.value;
110         }else{
111                 document.location.href='index.php?module=Configurator&action=SugarpdfSettings';
112         }
113     };
114     document.getElementById('addFontbutton').onclick=function(){
115         document.location.href='index.php?module=Configurator&action=addFontView';
116     };
117     
118 });
119 {/literal}
120 </script>