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