]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - modules/Configurator/tpls/addFontView.tpl
Release 6.4.0
[Github/sugarcrm.git] / modules / Configurator / tpls / addFontView.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
42 <script type='text/javascript' src="{sugar_getjspath file='include/javascript/overlibmws.js'}"></script>
43 <p>
44 {$MODULE_TITLE}
45 </p>
46 <form name="addFontView" enctype='multipart/form-data' method="POST" action="index.php?action=addFont&module=Configurator" onSubmit="return (check_form('addFontView'));">
47 <span class='error'>{$error}</span>
48 <br>
49 <table width="100%" cellpadding="0" cellspacing="0" border="0">
50     <tr>
51         <td style="padding-bottom: 2px;">
52             <input title="{$MOD.LBL_ADD_FONT_BUTTON}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button"  type="submit"  name="save" value="  {$MOD.LBL_ADD_FONT_BUTTON}  " >
53             &nbsp;<input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}"  onclick="document.location.href='index.php?module=Configurator&action=FontManager'" class="button"  type="button" name="cancel" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  " >
54         </td>
55     </tr>
56 </table>
57 <br>
58     <table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
59         <tr>
60             <td  scope="row">{$MOD.LBL_PDF_METRIC_FILE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_PDF_METRIC_FILE_INFO} </td>
61             <td>
62                 <input type='file' size='30' name='pdf_metric_file' id='pdf_metric_file'>
63             </td>
64             <td  scope="row"></td>
65             <td></td>
66         </tr>
67         <tr>
68             <td  scope="row">{$MOD.LBL_PDF_FONT_FILE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_PDF_FONT_FILE_INFO} </td>
69             <td>
70                 <input type='file' size='30' name='pdf_font_file' id='pdf_font_file'>
71             </td>
72             <td  scope="row"></td>
73             <td></td>
74         </tr>
75         <tr>
76             <td  scope="row">{$MOD.LBL_FONT_LIST_EMBEDDED}: <span class="required">*</span>{sugar_help text=$MOD.LBL_FONT_LIST_EMBEDDED_INFO} </td>
77             <td>
78                 <input type="hidden" name='pdf_embedded' value='false'>
79                 <input type='checkbox' name='pdf_embedded' value='true' id='pdf_embedded' onchange="showCidInfo()" CHECKED>
80             </td>
81             <td  scope="row"></td>
82             <td></td>
83         </tr>
84         <tr id="cidInfo" style="display:none">
85             <td  scope="row">{$MOD.LBL_FONT_LIST_CIDINFO}: <span class="required">*</span>{sugar_help text=$MOD.LBL_FONT_LIST_CIDINFO_INFO} </td>
86             <td>
87                 <textarea name='pdf_cidinfo' rows="4" cols="80" id="pdf_cidinfo"></textarea>
88             </td>
89             <td  scope="row"></td>
90             <td></td>
91         </tr>
92         <tr>
93             <td  scope="row">{$MOD.LBL_PDF_ENCODING_TABLE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_PDF_ENCODING_TABLE_INFO} </td>
94             <td>
95                 {html_options name="pdf_encoding_table" options=$ENCODING_TABLE}
96             </td>
97             <td  scope="row"></td>
98             <td></td>
99         </tr>
100         <tr>
101             <td  scope="row">{$MOD.LBL_PDF_PATCH}:{sugar_help text=$MOD.LBL_PDF_PATCH_INFO} </td>
102             <td>
103                 <textarea size='60' name='pdf_patch' id='pdf_patch' rows="4" cols="80"></textarea>
104             </td>
105             <td  scope="row"></td>
106             <td></td>
107         </tr>
108         <tr>
109             <td  scope="row">{$MOD.LBL_FONT_LIST_STYLE}: <span class="required">*</span>{sugar_help text=$MOD.LBL_FONT_LIST_STYLE_INFO} </td>
110             <td>
111                 {html_options name="pdf_style_list" options=$STYLE_LIST}
112             </td>
113             <td  scope="row"></td>
114             <td></td>
115         </tr>
116     </table>
117 <br>
118 <div style="padding-top: 2px;">
119 <input title="{$MOD.LBL_ADD_FONT_BUTTON}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button"  type="submit"  name="save" value="  {$MOD.LBL_ADD_FONT_BUTTON}  " >
120 &nbsp;<input title="{$MOD.LBL_CANCEL_BUTTON_TITLE}"  onclick="document.location.href='index.php?module=Configurator&action=FontManager'" class="button"  type="button" name="cancel" value="  {$APP.LBL_CANCEL_BUTTON_LABEL}  " />
121 </div>
122 </form>
123 {literal}
124 <script type='text/javascript'>
125 function checkFileExtension(metric){
126     if(metric){
127         var element = document.getElementById("pdf_metric_file");
128     }else{
129         var element = document.getElementById("pdf_font_file");
130     }
131     if(element.value != ""){
132         var error=true;
133                 var filename = element.value;
134             var dot = filename.lastIndexOf(".");
135             if( dot != -1 ){
136             var extension = filename.substr(dot,filename.length);
137             if(!metric){
138                     if(extension==".ttf" || extension==".otf" || extension==".pfb") error=false;
139             }else{
140                 if(extension==".afm" || extension==".ufm") error=false;
141             }
142             }
143         if(error){
144                 element.value="";
145             {/literal}
146             alert("{$MOD.JS_ALERT_PDF_WRONG_EXTENSION}");
147             {literal}
148         }
149         }
150 }
151 function showCidInfo(){
152     if(document.getElementById("pdf_embedded").checked == false){
153         document.getElementById("cidInfo").style.display = "";
154         addToValidate('addFontView', 'pdf_cidinfo', 'varchar', 1,'{/literal}{$MOD.LBL_FONT_LIST_CIDINFO}{literal}' );
155     }else{
156         document.getElementById("cidInfo").style.display = "none";
157         removeFromValidate('addFontView', 'pdf_cidinfo');
158     }
159 }
160 document.getElementById('pdf_metric_file').onchange=function(){checkFileExtension(true);};
161 document.getElementById('pdf_font_file').onchange=function(){checkFileExtension(false);};
162 {/literal}
163 addToValidate('addFontView', 'pdf_metric_file', 'varchar', 1,'{$MOD.LBL_PDF_METRIC_FILE}' );
164 addToValidate('addFontView', 'pdf_font_file', 'varchar', 1,'{$MOD.LBL_PDF_FONT_FILE}' );
165 showCidInfo();
166 </script>