گرویتی فرم فارسی - Version 1.0.0

Version Description

  • First version

=

Download this release

Release Info

Developer hannanstd
Plugin Icon 128x128 گرویتی فرم فارسی
Version 1.0.0
Comparing to
See all releases

Version 1.0.0

Persian_Gravityforms_By_HANNANStd.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Persian Gravity Forms
4
+ Plugin URI: http://www.gravityforms.ir
5
+ Description: Gravity Forms for Iranian
6
+ Version: 1.0.0
7
+ Requires at least: 3.0
8
+ Author: HANNAN Ebrahimi Setoode
9
+ Author URI: http://www.webforest.ir
10
+ Text Domain: Persian_Gravityforms_By_HANNANStd
11
+ Domain Path: /languages/
12
+ License: GPL 2
13
+ */
14
+ class GravityFormsPersian {
15
+ private $file;
16
+ private $language;
17
+ private $is_persian;
18
+ public function __construct( $file ) {
19
+ $this->file = $file;
20
+ add_action('init', array( $this, 'init' ), 8 );
21
+ add_filter('update_footer', array( $this, 'GravityForms_Footer_Left_By_HANNANStd'), 11);
22
+ add_action('gform_post_status_options', array( $this, 'Add_Private_Post_Status_By_HANNANStd'));
23
+ add_filter('load_textdomain_mofile', array( $this, 'Load_Textdomain_Mo_File_By_HANNANStd'), 10, 2 );
24
+ add_filter('gform_currencies', array( $this, 'Update_Currency_By_HANNANStd' ) );
25
+ add_filter('gform_address_types', array( $this, 'Gform_IRAN_By_HANNANStd' ) );
26
+ add_action('activated_plugin', array( $this, 'Activated_Plugin_By_HANNANStd' ) );
27
+ add_action('gform_admin_pre_render', array( $this, 'Add_Merge_Tags_To_List_By_HANNANStd'));
28
+ add_filter('gform_replace_merge_tags', array( $this, 'GformReplaceMergeTags_CSS_By_HANNANStd'), 10, 7);
29
+ add_filter('gform_replace_merge_tags', array( $this, 'GformReplaceMergeTags_Simple_By_HANNANStd'), 10, 7);
30
+ add_filter('gform_replace_merge_tags', array( $this, 'GformReplaceMergeTags_Pack_By_HANNANStd'), 10, 7);
31
+ add_action('wp_dashboard_setup', array( $this, 'Persian_GravityForms_Dashboard_By_HANNANStd'));
32
+ add_filter('gform_print_styles', array( $this, 'Add_Styles_Print_By_HANNANStd'), 10, 2);
33
+ add_action('admin_print_scripts', array( $this, 'GravityForms_Admin_CSS_By_HANNANStd' ));
34
+ add_filter('gform_predefined_choices', array( $this, 'Add_Iran_Predefined_Choice_By_HANNANStd' ),1);
35
+ }
36
+ public function Activated_Plugin_By_HANNANStd() {
37
+ $path = str_replace( WP_PLUGIN_DIR . '/', '', $this->file );
38
+ if ( $plugins = get_option( 'active_plugins' ) ) {
39
+ if ( $key = array_search( $path, $plugins ) ) {
40
+ array_splice( $plugins, $key, 1 );
41
+ array_unshift( $plugins, $path );
42
+ update_option( 'active_plugins', $plugins );
43
+ }
44
+ }
45
+ if ( $plugins = get_site_option( 'active_sitewide_plugins' ) ) {
46
+ if ( $key = array_search( $path, $plugins ) ) {
47
+ array_splice( $plugins, $key, 1 );
48
+ array_unshift( $plugins, $path );
49
+ update_site_option( 'active_sitewide_plugins', $plugins );
50
+ }
51
+ }
52
+ }
53
+ public function init() {
54
+ $rel_path = dirname( plugin_basename( $this->file ) ) . '/languages/';
55
+ if ( $this->language == null ) {
56
+ $this->language = get_option( 'WPLANG', WPLANG );
57
+ $this->is_persian = ( $this->language == 'fa' || $this->language == 'fa_IR' );
58
+ }
59
+ if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
60
+ $this->is_persian = ( ICL_LANGUAGE_CODE == 'fa' );
61
+ }
62
+ load_plugin_textdomain( 'Persian_Gravityforms_By_HANNANStd', false, $rel_path );
63
+ load_plugin_textdomain( 'gravityformsuserregistration', false, $rel_path );
64
+ }
65
+ public function Load_Textdomain_Mo_File_By_HANNANStd( $mo_file, $domain ) {
66
+ if ( strpos( $mo_file, 'fa_IR.mo' ) !== false ) {
67
+ $domains = array(
68
+ 'gravityforms' => array(
69
+ 'languages/gravityforms-fa_IR.mo' => 'gravityforms/fa_IR.mo'
70
+ ),
71
+ 'gravityformscoupons' => array(
72
+ 'languages/gravityformscoupons-fa_IR.mo' => 'gravityformscoupons/fa_IR.mo'
73
+ ),
74
+ 'gravityformsmailchimp' => array(
75
+ 'languages/gravityformsmailchimp-fa_IR.mo' => 'gravityformsmailchimp/fa_IR.mo'
76
+ ),
77
+ 'gravityformspolls' => array(
78
+ 'languages/gravityformspolls-fa_IR.mo' => 'gravityformspolls/fa_IR.mo'
79
+ ),
80
+ 'gravityformsquiz' => array(
81
+ 'languages/gravityformsquiz-fa_IR.mo' => 'gravityformsquiz/fa_IR.mo'
82
+ ),
83
+ 'gravityformssignature' => array(
84
+ 'languages/gravityformssignature-fa_IR.mo' => 'gravityformssignature/fa_IR.mo'
85
+ ),
86
+ 'gravityformssurvey' => array(
87
+ 'languages/gravityformssurvey-fa_IR.mo' => 'gravityformssurvey/fa_IR.mo'
88
+ ),
89
+ 'gravityformsuserregistration' => array(
90
+ 'languages/gravityformsuserregistration-fa_IR.mo' => 'gravityformsuserregistration/fa_IR.mo'
91
+ ),
92
+ 'gravityformsauthorizenet' => array(
93
+ 'languages/gravityformsauthorizenet-fa_IR.mo' => 'gravityformsauthorizenet/fa_IR.mo'
94
+ ),
95
+ 'gravityformsaweber' => array(
96
+ 'languages/gravityformsaweber-fa_IR.mo' => 'gravityformsaweber/fa_IR.mo'
97
+ ),
98
+ 'gravityformscampaignmonitor' => array(
99
+ 'languages/gravityformscampaignmonitor-fa_IR.mo' => 'gravityformscampaignmonitor/fa_IR.mo'
100
+ ),
101
+ 'gravityformsfreshbooks' => array(
102
+ 'languages/gravityformsfreshbooks-fa_IR.mo' => 'gravityformsfreshbooks/fa_IR.mo'
103
+ ),
104
+ 'gravityformspaypal' => array(
105
+ 'languages/gravityformspaypal-fa_IR.mo' => 'gravityformspaypal/fa_IR.mo'
106
+ ),
107
+ 'gravityformspaypalpro' => array(
108
+ 'languages/gravityformspaypalpro-fa_IR.mo' => 'gravityformspaypalpro/fa_IR.mo'
109
+ ),
110
+ 'gravityformspaypalpaymentspro' => array(
111
+ 'languages/gravityformspaypalpaymentspro-fa_IR.mo' => 'gravityformspaypalpaymentspro/fa_IR.mo'
112
+ ),
113
+ 'gravityformstwilio' => array(
114
+ 'languages/gravityformstwilio-fa_IR.mo' => 'gravityformstwilio/fa_IR.mo'
115
+ ),
116
+ 'gravityformsstripe' => array(
117
+ 'languages/gravityformsstripe-fa_IR.mo' => 'gravityformsstripe/fa_IR.mo'
118
+ ),
119
+ 'gravityformszapier' => array(
120
+ 'languages/gravityformszapier-fa_IR.mo' => 'gravityformszapier/fa_IR.mo'
121
+ )
122
+ );
123
+ if ( isset( $domains[$domain] ) ) {
124
+ $paths = $domains[$domain];
125
+ foreach ( $paths as $path => $file ) {
126
+ if ( substr( $mo_file, -strlen( $path ) ) == $path ) {
127
+ $new_file = dirname( $this->file ) . '/languages/' . $file;
128
+ if ( is_readable( $new_file ) ) {
129
+ $mo_file = $new_file;
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
135
+ return $mo_file;
136
+ }
137
+
138
+ public function GravityForms_Footer_Left_By_HANNANStd($text) {
139
+ $text = sprintf(__("%sGravity Forms%s for WordPress is a full featured contact form plugin .", "Persian_Gravityforms_By_HANNANStd"), '<a href="http://gravityforms.ir" target="_blank">', "</a>");return $text;
140
+ }
141
+ public function Add_Private_Post_Status_By_HANNANStd($post_status_options) {
142
+ $post_status_options['private'] = __("Private", "Persian_Gravityforms_By_HANNANStd");
143
+ return $post_status_options;
144
+ }
145
+ public function Update_Currency_By_HANNANStd($currencies) {
146
+ $currencies['IRR'] = array("name" => __("Iranian Rial", "Persian_Gravityforms_By_HANNANStd"), "symbol_left" => '', "symbol_right" => " ریال ", "symbol_padding" => "", "thousand_separator" => ',', "decimal_separator" => '.', "decimals" => 0);
147
+ $currencies['IRT'] = array("name" => __("Toman", "Persian_Gravityforms_By_HANNANStd"), "symbol_left" => '', "symbol_right" => " تومان ", "symbol_padding" => " ", "thousand_separator" => ',', "decimal_separator" => '.', "decimals" => 0);
148
+ return $currencies;
149
+ }
150
+ public function Gform_IRAN_By_HANNANStd( $address_types ) {
151
+ $address_types['persian'] = array(
152
+ 'label' => __( 'IRAN', 'Persian_Gravityforms_By_HANNANStd' ),
153
+ 'country' => __( 'IRAN', 'Persian_Gravityforms_By_HANNANStd' ),
154
+ 'zip_label' => __( 'Postal Code', 'Persian_Gravityforms_By_HANNANStd' ),
155
+ 'state_label' => __( 'Province', 'Persian_Gravityforms_By_HANNANStd' ),
156
+ 'states' => array( '',
157
+ __( 'Azarbaijan - East', 'Persian_Gravityforms_By_HANNANStd' ),
158
+ __( 'Azarbaijan - West', 'Persian_Gravityforms_By_HANNANStd' ),
159
+ __( 'Ardabil', 'Persian_Gravityforms_By_HANNANStd' ),
160
+ __( 'Isfahan', 'Persian_Gravityforms_By_HANNANStd' ),
161
+ __( 'Alborz', 'Persian_Gravityforms_By_HANNANStd' ),
162
+ __( 'Ilam', 'Persian_Gravityforms_By_HANNANStd' ),
163
+ __( 'Bushehr', 'Persian_Gravityforms_By_HANNANStd' ),
164
+ __( 'Tehran', 'Persian_Gravityforms_By_HANNANStd' ),
165
+ __( 'Chahar Mahaal and Bakhtiari', 'Persian_Gravityforms_By_HANNANStd' ),
166
+ __( 'Khorasan - South', 'Persian_Gravityforms_By_HANNANStd' ),
167
+ __( 'Khorasan - Razavi', 'Persian_Gravityforms_By_HANNANStd' ),
168
+ __( 'Khorasan - North', 'Persian_Gravityforms_By_HANNANStd' ),
169
+ __( 'Khuzestan', 'Persian_Gravityforms_By_HANNANStd' ),
170
+ __( 'Zanjan', 'Persian_Gravityforms_By_HANNANStd' ),
171
+ __( 'Semnan', 'Persian_Gravityforms_By_HANNANStd' ),
172
+ __( 'Sistan and Baluchistan', 'Persian_Gravityforms_By_HANNANStd' ),
173
+ __( 'Fars', 'Persian_Gravityforms_By_HANNANStd' ),
174
+ __( 'Qazvin', 'Persian_Gravityforms_By_HANNANStd' ),
175
+ __( 'Qom', 'Persian_Gravityforms_By_HANNANStd' ),
176
+ __( 'Kurdistan', 'Persian_Gravityforms_By_HANNANStd' ),
177
+ __( 'Kerman', 'Persian_Gravityforms_By_HANNANStd' ),
178
+ __( 'Kermanshah', 'Persian_Gravityforms_By_HANNANStd' ),
179
+ __( 'Kohgiluyeh and Boyer-Ahmad', 'Persian_Gravityforms_By_HANNANStd' ),
180
+ __( 'Golestan', 'Persian_Gravityforms_By_HANNANStd' ),
181
+ __( 'Gilan', 'Persian_Gravityforms_By_HANNANStd' ),
182
+ __( 'Lorestan', 'Persian_Gravityforms_By_HANNANStd' ),
183
+ __( 'Mazandaran', 'Persian_Gravityforms_By_HANNANStd' ),
184
+ __( 'Markazi', 'Persian_Gravityforms_By_HANNANStd' ),
185
+ __( 'Hormozgān', 'Persian_Gravityforms_By_HANNANStd' ),
186
+ __( 'Hamadan', 'Persian_Gravityforms_By_HANNANStd' ),
187
+ __( 'Yazd', 'Persian_Gravityforms_By_HANNANStd' )
188
+ )
189
+ );
190
+ return $address_types;
191
+ }
192
+ public function Add_Iran_Predefined_Choice_By_HANNANStd($choices){
193
+ $choices[__( 'Provinces of Iran', 'Persian_Gravityforms_By_HANNANStd' )] = array(__( 'Azarbaijan - East', 'Persian_Gravityforms_By_HANNANStd' ),
194
+ __( 'Azarbaijan - West', 'Persian_Gravityforms_By_HANNANStd' ),
195
+ __( 'Ardabil', 'Persian_Gravityforms_By_HANNANStd' ),
196
+ __( 'Isfahan', 'Persian_Gravityforms_By_HANNANStd' ),
197
+ __( 'Alborz', 'Persian_Gravityforms_By_HANNANStd' ),
198
+ __( 'Ilam', 'Persian_Gravityforms_By_HANNANStd' ),
199
+ __( 'Bushehr', 'Persian_Gravityforms_By_HANNANStd' ),
200
+ __( 'Tehran', 'Persian_Gravityforms_By_HANNANStd' ),
201
+ __( 'Chahar Mahaal and Bakhtiari', 'Persian_Gravityforms_By_HANNANStd' ),
202
+ __( 'Khorasan - South', 'Persian_Gravityforms_By_HANNANStd' ),
203
+ __( 'Khorasan - Razavi', 'Persian_Gravityforms_By_HANNANStd' ),
204
+ __( 'Khorasan - North', 'Persian_Gravityforms_By_HANNANStd' ),
205
+ __( 'Khuzestan', 'Persian_Gravityforms_By_HANNANStd' ),
206
+ __( 'Zanjan', 'Persian_Gravityforms_By_HANNANStd' ),
207
+ __( 'Semnan', 'Persian_Gravityforms_By_HANNANStd' ),
208
+ __( 'Sistan and Baluchistan', 'Persian_Gravityforms_By_HANNANStd' ),
209
+ __( 'Fars', 'Persian_Gravityforms_By_HANNANStd' ),
210
+ __( 'Qazvin', 'Persian_Gravityforms_By_HANNANStd' ),
211
+ __( 'Qom', 'Persian_Gravityforms_By_HANNANStd' ),
212
+ __( 'Kurdistan', 'Persian_Gravityforms_By_HANNANStd' ),
213
+ __( 'Kerman', 'Persian_Gravityforms_By_HANNANStd' ),
214
+ __( 'Kermanshah', 'Persian_Gravityforms_By_HANNANStd' ),
215
+ __( 'Kohgiluyeh and Boyer-Ahmad', 'Persian_Gravityforms_By_HANNANStd' ),
216
+ __( 'Golestan', 'Persian_Gravityforms_By_HANNANStd' ),
217
+ __( 'Gilan', 'Persian_Gravityforms_By_HANNANStd' ),
218
+ __( 'Lorestan', 'Persian_Gravityforms_By_HANNANStd' ),
219
+ __( 'Mazandaran', 'Persian_Gravityforms_By_HANNANStd' ),
220
+ __( 'Markazi', 'Persian_Gravityforms_By_HANNANStd' ),
221
+ __( 'Hormozgān', 'Persian_Gravityforms_By_HANNANStd' ),
222
+ __( 'Hamadan', 'Persian_Gravityforms_By_HANNANStd' ),
223
+ __( 'Yazd', 'Persian_Gravityforms_By_HANNANStd' )
224
+ ); return $choices;
225
+ }
226
+ public function Add_Merge_Tags_To_List_By_HANNANStd($form){ ?>
227
+ <script type="text/javascript">
228
+ gform.addFilter("gform_merge_tags", "add_merge_tags");
229
+ function add_merge_tags(mergeTags, elementId, hideAllFields, excludeFieldTypes, isPrepop, option){
230
+ mergeTags["custom"].tags.push({ tag: '{payment_gateway}', label: '<?php _e("Simple Payment Gateway", "Persian_Gravityforms_By_HANNANStd") ?>' });
231
+ mergeTags["custom"].tags.push({ tag: '{payment_status}', label: '<?php _e("Simple Payment Status", "Persian_Gravityforms_By_HANNANStd") ?>' });
232
+ mergeTags["custom"].tags.push({ tag: '{transaction_id}', label: '<?php _e("Simple Transaction ID", "Persian_Gravityforms_By_HANNANStd") ?>' });
233
+ mergeTags["custom"].tags.push({ tag: '{payment_gateway_css}', label: '<?php _e("Styled Payment Gateway", "Persian_Gravityforms_By_HANNANStd") ?>' });
234
+ mergeTags["custom"].tags.push({ tag: '{payment_status_css}', label: '<?php _e("Styled Payment Status", "Persian_Gravityforms_By_HANNANStd") ?>' });
235
+ mergeTags["custom"].tags.push({ tag: '{transaction_id_css}', label: '<?php _e("Styled Transaction ID", "Persian_Gravityforms_By_HANNANStd") ?>' });
236
+ mergeTags["custom"].tags.push({ tag: '{payment_pack}', label: '<?php _e("Styled Payment Pack", "Persian_Gravityforms_By_HANNANStd") ?>' });
237
+ return mergeTags;}
238
+ </script>
239
+ <?php return $form; }
240
+ public function GformReplaceMergeTags_Simple_By_HANNANStd($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format){
241
+ $price = $lead['payment_amount'];
242
+ $gateway = gform_get_meta($lead['id'], 'payment_gateway');
243
+ if ($lead['payment_status']=="Active" || $lead['payment_status']=="Paid")
244
+ $payment_status = __("Paid", "Persian_Gravityforms_By_HANNANStd");
245
+ if ($lead['payment_status']=="Failed")
246
+ $payment_status = __("Failed", "Persian_Gravityforms_By_HANNANStd");
247
+ if ($lead['payment_status']=="Cancelled")
248
+ $payment_status = __("Cancelled", "Persian_Gravityforms_By_HANNANStd");
249
+ $tags = array (
250
+ '{payment_gateway}',
251
+ '{transaction_id}',
252
+ '{payment_status}',
253
+ );
254
+ if ( ( $price < 0 ) || !isset($price) || !isset($gateway) ) {
255
+ $values = array (
256
+ '',
257
+ '',
258
+ '',
259
+ );}
260
+ else {
261
+ $values = array (
262
+ isset($gateway) ? $gateway : '',
263
+ isset($lead['transaction_id']) ? $lead['transaction_id'] : '',
264
+ isset($lead['payment_status']) ? $payment_status : '',
265
+ );
266
+ }
267
+ $text = str_replace($tags, $values, $text);
268
+ return $text;
269
+ }
270
+ public function GformReplaceMergeTags_CSS_By_HANNANStd($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format){
271
+ $price = $lead['payment_amount'];
272
+ $gateway = gform_get_meta($lead['id'], 'payment_gateway');
273
+ if ($lead['payment_status']=="Active" || $lead['payment_status']=="Paid")
274
+ $payment_status = __("Paid", "Persian_Gravityforms_By_HANNANStd");
275
+ if ($lead['payment_status']=="Failed")
276
+ $payment_status = __("Failed", "Persian_Gravityforms_By_HANNANStd");
277
+ if ($lead['payment_status']=="Cancelled")
278
+ $payment_status = __("Cancelled", "Persian_Gravityforms_By_HANNANStd");
279
+ $tags = array (
280
+ '{payment_gateway_css}',
281
+ '{transaction_id_css}',
282
+ '{payment_status_css}',
283
+ );
284
+ if ( ( $price < 0 ) || !isset($price) || !isset($gateway) ) {
285
+ $values = array (
286
+ '',
287
+ '',
288
+ '',
289
+ );}
290
+ else {
291
+ $values = array (
292
+ isset($gateway) ? '<table width="99%" border="0" cellpadding="1" cellspacing="0" bgcolor="#EAEAEA" style="border:1px solid #e9e9e9!important;">
293
+ <tr bgcolor="#EAF2FA">
294
+ <td colspan="2" style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px"><strong>'.__( 'Payment Gateway', 'Persian_Gravityforms_By_HANNANStd' ).'</strong></font></td>
295
+ </tr>
296
+ <tr bgcolor="#FFFFFF">
297
+ <td style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">'.$gateway.'</font></td>
298
+ </tr></table>' : '',
299
+ isset($lead['transaction_id']) ? '<table width="99%" border="0" cellpadding="1" cellspacing="0" bgcolor="#EAEAEA" style="border:1px solid #e9e9e9!important;">
300
+ <tr bgcolor="#EAF2FA">
301
+ <td colspan="2" style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">
302
+ <strong>'.__( 'Transaction ID', 'Persian_Gravityforms_By_HANNANStd' ).'</strong></font></td>
303
+ </tr>
304
+ <tr bgcolor="#FFFFFF">
305
+ <td style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">'.$lead['transaction_id'].'</font></td></tr>
306
+ </table>' : '',
307
+ isset($lead['payment_status']) ? '<table width="99%" border="0" cellpadding="1" cellspacing="0" bgcolor="#EAEAEA" style="border:1px solid #e9e9e9!important;"><tr bgcolor="#EAF2FA">
308
+ <td colspan="2" style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px"><strong>'.__( 'Payment Status', 'Persian_Gravityforms_By_HANNANStd' ).'</strong></font></td>
309
+ </tr>
310
+ <tr bgcolor="#FFFFFF">
311
+ <td style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">'.$payment_status.'</font></td></tr>
312
+ </table>' : '',
313
+ );
314
+ }
315
+ $text = str_replace($tags, $values, $text);
316
+ return $text;
317
+ }
318
+ function GformReplaceMergeTags_Pack_By_HANNANStd($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format){
319
+ $price = $lead['payment_amount'];
320
+ $gateway = gform_get_meta($lead['id'], 'payment_gateway');
321
+ if ($lead['payment_status']=="Active" || $lead['payment_status']=="Paid")
322
+ $payment_status = __("Paid", "Persian_Gravityforms_By_HANNANStd");
323
+ if ($lead['payment_status']=="Failed")
324
+ $payment_status = __("Failed", "Persian_Gravityforms_By_HANNANStd");
325
+ if ($lead['payment_status']=="Cancelled")
326
+ $payment_status = __("Cancelled", "Persian_Gravityforms_By_HANNANStd");
327
+ $tags = array (
328
+ '{payment_pack}',
329
+ );
330
+ if ( ( $price < 0 ) || !isset($price) || !isset($gateway) ) {
331
+ $values = array (
332
+ '',
333
+ );}
334
+ else {
335
+ $values = array (
336
+ (isset($lead['transaction_id']) && isset($gateway) && isset($lead['payment_status']) ) ? '<table width="99%" border="0" cellpadding="1" cellspacing="0" bgcolor="#EAEAEA" style="border:1px solid #e9e9e9!important;">
337
+ <tr>
338
+ <td style="font-size:14px;font-weight:bold;background-color:#eee;border-bottom:1px solid #dfdfdf;padding:7px 7px" colspan="2">'.__( 'Payment Information', 'Persian_Gravityforms_By_HANNANStd' ).'</td>
339
+ </tr>
340
+ <tr bgcolor="#EAF2FA">
341
+ <td colspan="2" style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px"><strong>'.__( 'Payment Gateway', 'Persian_Gravityforms_By_HANNANStd' ).'</strong></font></td>
342
+ </tr>
343
+ <tr bgcolor="#FFFFFF">
344
+ <td style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">'.$gateway.'</font></td>
345
+ </tr>
346
+ <tr bgcolor="#EAF2FA">
347
+ <td colspan="2" style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px"><strong>'.__( 'Payment Status', 'Persian_Gravityforms_By_HANNANStd' ).'</strong></font></td>
348
+ </tr>
349
+ <tr bgcolor="#FFFFFF">
350
+ <td style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">'.$payment_status.'</font></td>
351
+ </tr>
352
+ <tr bgcolor="#EAF2FA">
353
+ <td colspan="2" style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px"><strong>'.__( 'Transaction ID', 'Persian_Gravityforms_By_HANNANStd' ).'</strong></font></td>
354
+ </tr>
355
+ <tr bgcolor="#FFFFFF">
356
+ <td style="padding:5px !important"><font style="font-family:sans-serif;font-size:12px">'.$lead['transaction_id'].'</font></td></tr>
357
+ </table>' : '',
358
+ );
359
+ }
360
+ $text = str_replace($tags, $values, $text);
361
+ return $text;
362
+ }
363
+ public function Add_Styles_Print_By_HANNANStd($value, $form){
364
+ wp_register_style('print_entry', plugins_url ( '/assets/css/printer.css', __FILE__, true ) );
365
+ return array('print_entry');
366
+ }
367
+ public function GravityForms_Admin_CSS_By_HANNANStd() {
368
+ if(!class_exists('GFForms')){
369
+ return;
370
+ }
371
+ $current_page = trim(strtolower(RGForms::get("page")));
372
+ $page_prefix = explode("_", $current_page);
373
+ if ($page_prefix[0]=="gf" || $_SERVER['REQUEST_URI'] == '/wp-admin/' || $_SERVER['REQUEST_URI'] == '/wp-admin' || $_SERVER['REQUEST_URI'] == '/wp-admin/index.php' || $_SERVER['REQUEST_URI'] == '/wp-admin/index.php/') {
374
+ wp_enqueue_style('Persian_GravityForms', plugins_url ( '/assets/css/persiangravity.css', __FILE__, null, GFCommon::$version ) );
375
+ wp_print_styles( 'gform_tooltip','Persian_GravityForms' );
376
+ }
377
+ }
378
+ public function Persian_GravityForms_Dashboard_By_HANNANStd() {
379
+ if ( !current_user_can('manage_options') )
380
+ return;
381
+ global $wp_meta_boxes;
382
+ wp_add_dashboard_widget('persiangf_wd_hannanstd', __( 'Persian Gravity Forms Dashboard', 'Persian_Gravityforms_By_HANNANStd' ) , array( $this, 'Persian_GravityForms_Widget_By_HANNANStd'));
383
+ }
384
+ public static function Persian_GravityForms_Widget_By_HANNANStd() {
385
+ global $_wp_admin_css_colors;
386
+ $current_color = get_user_option( 'admin_color' );
387
+ $colors = array();
388
+ foreach ( $_wp_admin_css_colors as $color => $color_info ) {
389
+ if ($color == $current_color){
390
+ foreach ( $color_info->colors as $html_color ) {
391
+ $colors[] = esc_attr( $html_color ); }
392
+ }
393
+ }
394
+ if (get_bloginfo('version')>=3.8) {
395
+ ?>
396
+ <style>
397
+ #persiangf_wd_hannanstd h3{font-family:byekan !important;background:<?php echo $colors[1] ?> !important;color:#fff !important;}
398
+ #persiangf_wd_hannanstd .handlediv{color:#fff !important;}
399
+ #persiangf_wd_hannanstd .a1{font-family:byekan !important;}
400
+ #persiangf_wd_hannanstd .a2{font-family:byekan !important;font-size:12px !important;}
401
+ </style>
402
+ <?php
403
+ }
404
+ $rss = fetch_feed( "http://gravityforms.ir/rss" );
405
+ if ( is_wp_error($rss) ) {
406
+ if ( is_admin() || current_user_can('manage_options') ) {
407
+ printf(__('<strong>RSS Error</strong>', 'Persian_Gravityforms_By_HANNANStd'));
408
+ }
409
+ return;
410
+ }
411
+ if ( !$rss->get_item_quantity() ) {
412
+ printf(__( 'Apparently, There are no updates to show!', 'Persian_Gravityforms_By_HANNANStd' ));
413
+ $rss->__destruct();
414
+ unset($rss);
415
+ return;
416
+ }
417
+ echo "<ul>";
418
+ if ( !isset($items) )
419
+ $items = 5;
420
+ $i=1;
421
+ foreach ( $rss->get_items(0, $items) as $item ) {
422
+ $publisher = '';
423
+ $site_link = '';
424
+ $link = '';
425
+ $content = '';
426
+ $date = '';
427
+ $link = esc_url( strip_tags( $item->get_link() ) );
428
+ $title = esc_html( $item->get_title() );
429
+ $content = $item->get_content();
430
+ $content = wp_html_excerpt($content, 250) . ' ...';
431
+ echo "<li>";
432
+ if ($i==1)
433
+ echo "<a class='rsswidget a1' href='$link'>$title</a><div class='rssSummary'>$content</div><hr/>";
434
+ else
435
+ echo "<a class='rsswidget a2' href='$link'>$title</a>";
436
+ echo "<li>";
437
+ $i++;
438
+ }
439
+ echo "</ul>";
440
+ $rss->__destruct();
441
+ unset($rss);
442
+ }
443
+ }
444
+ global $Persian_Gravityforms_By_HANNANStd_plugin;
445
+ $Persian_Gravityforms_By_HANNANStd_plugin = new GravityFormsPersian( __FILE__ );
assets/css/persiangravity.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'BYekan';
3
+ src: url('../fonts/BYekan.eot');
4
+ src: url('../fonts/BYekan.woff') format('woff'), url('../fonts/BYekan.ttf') format('truetype');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+ *,body,html {
9
+ font-family:tahoma;
10
+ }
11
+ input,li,ul,select,textarea,#gf_merge_tag_list a{
12
+ font-family:tahoma !important;
13
+ }
14
+ #toplevel_page_gf_edit_forms a,#toplevel_page_gf_edit_forms .wp-menu-name,.newform_notice,.gatewayset p,.gatewayset td,h1,h2,h3,h4,h5,h6,h2 span,h3 span,label,#no-fields span,.group-header,#gf_form_toolbar a,.gform_tabs a,td a,td a strong,td strong a,th,.add-new-h2,.button,.stat b,.gresults-chart-wrapper *,div.gresults-results-filter-section-label,div.gresults-results-field-label,#gresults-results td,#gresults-results th,#gresults-results tr{
15
+ font-family:BYekan !important;
16
+ font-weight:normal !important;
17
+ }
18
+ .field_type li input,.add-buttons-title{
19
+ font-size:12px !important;
20
+ font-family:BYekan !important;
21
+ }
22
+ h4,h5,h6 {
23
+ font-size:16px !important;
24
+ }
25
+ .group-header {
26
+ font-size:16px !important;
27
+ font-weight:normal !important;
28
+ }
29
+ .row-title,#toplevel_page_gf_edit_forms .wp-menu-name,.newform_notice{
30
+ font-size:16px !important;
31
+ }
32
+ a.gf_toolbar_active ,.gform_tabs a,label{
33
+ font-size:13px !important;
34
+ }
35
+ div.gf_entry_detail_pagination {
36
+ top:-10px !important;
37
+ }
38
+ #TB_ajaxContent,#TB_title {
39
+ text-align:right !important;
40
+ }
41
+ #gresults-results{
42
+ margin-right:0px !important;
43
+ margin-left:300px !important;
44
+ }
45
+ div#gf_nofield_1_instructions, div#gf_nofield_2_instructions, div#gf_nofield_3_instructions, div#gf_nofield_4_instructions, div#gf_nofield_5_instructions {
46
+ background-image: url("../images/Gravity_Forms_fa.png") !important;
47
+ }
48
+ .gf_nofield_3_instructions_copy_bottom {
49
+ margin-left:-163px !important;
50
+ }
51
+ .gf_nofield_4_instructions_copy_bottom {
52
+ margin-top:13px !important;
53
+ margin-left:-220px !important;
54
+ }
55
+ #gf_user_form .left_header ,.metaname , .metavalue{
56
+ float:right !important;
57
+ }
58
+ .gf_dashboard_form_title_header{
59
+ text-align:right !important;
60
+ }
61
+ .gf_dashboard_view td i{
62
+ font-style:normal !important;
63
+ font-family:byekan !important;
64
+ }
assets/css/printer.css ADDED
@@ -0,0 +1 @@
 
1
+ *,html,body,table,thead,tr,th,td,div {direction: rtl !important;text-align: right !important;font-family:Tahoma !important;}
assets/fonts/BYekan.eot ADDED
Binary file
assets/fonts/BYekan.ttf ADDED
Binary file
assets/fonts/BYekan.woff ADDED
Binary file
assets/images/Gravity_Forms_fa.png ADDED
Binary file
languages/Persian_Gravityforms_By_HANNANStd-fa_IR.mo ADDED
Binary file
languages/gravityforms/fa_IR.mo ADDED
Binary file
languages/gravityformsauthorizenet/fa_IR.mo ADDED
Binary file
languages/gravityformsaweber/fa_IR.mo ADDED
Binary file
languages/gravityformscampaignmonitor/fa_IR.mo ADDED
Binary file
languages/gravityformscoupons/fa_IR.mo ADDED
Binary file
languages/gravityformsfreshbooks/fa_IR.mo ADDED
Binary file
languages/gravityformsmailchimp/fa_IR.mo ADDED
Binary file
languages/gravityformspaypal/fa_IR.mo ADDED
Binary file
languages/gravityformspaypalpaymentspro/fa_IR.mo ADDED
Binary file
languages/gravityformspaypalpro/fa_IR.mo ADDED
Binary file
languages/gravityformspolls/fa_IR.mo ADDED
Binary file
languages/gravityformsquiz/fa_IR.mo ADDED
Binary file
languages/gravityformssignature/fa_IR.mo ADDED
Binary file
languages/gravityformsstripe/fa_IR.mo ADDED
Binary file
languages/gravityformssurvey/fa_IR.mo ADDED
Binary file
languages/gravityformstwilio/fa_IR.mo ADDED
Binary file
languages/gravityformsuserregistration/fa_IR.mo ADDED
Binary file
languages/gravityformszapier/fa_IR.mo ADDED
Binary file
readme.txt ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Persian Gravity Forms ===
2
+ Contributors: hannanstd
3
+ Tags: gravityforms,gravity forms,persian gravity forms,persian gravityforms,gravityforms farsi,gravity forms farsi,rtl,fa_ir,iranian,iranian rials,iranian toman,iran state,gravityforms.ir,gravity forms payment,gravity forms gateway,gravity forms iran gateways
4
+ Donate link: http://www.gravityforms.ir
5
+ Requires at least: 3.5
6
+ Tested up to: 4.0.1
7
+ Stable tag: 1.0.0
8
+ License: GPL 2
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+ This WordPress plugin extends the Gravity Forms plugin and its addons with the Persian language .
11
+
12
+ == Description ==
13
+ **Persian Gravity Forms**
14
+ This plugin extends the Gravity Forms and its addons with Persian language
15
+
16
+ = Features =
17
+ * Translate Gravity Forms and its addons to Persian .
18
+ * Add Iran provinces (states) in Fields , Forms and predefined choice .
19
+ * Add Iranian Rial and Toman Currency .
20
+ * Add Yekan Font to Gravity Forms and make it attractive .
21
+ * Make it RTL .
22
+ * Add Private status option to post status .
23
+ * Add Iranian payment gateways transaction id , transaction status and ... to Merge Tags .
24
+ * and...
25
+
26
+ = Persian Description =
27
+ * ترجمه هسته افزونه و ادان های آن ...
28
+ * اضافه کردن استان های ایران برای استفاده در فیلد های آدرس و ...
29
+ * اضافه کردن واحد پولی ریال و تومان
30
+ * زیبا سازی محیط کاربری به وسیله استایل دهی و ...
31
+ * راستچین سازی افزونه و صفحه پرینت و ادان ها و ...
32
+ * اضافه کردن وضعیت پست خصوصی برای فیلد های ارسال پست .
33
+ * اضافه کردن برچسب وضعیت تراکنش ، کد رهگیری و ... به برچسب های ایمیل و صفحه تاییدیه که این برچسب در خود افزونه وجود نداشت .
34
+ * افزونه درگاه های ایرانی آن نیز به صورت جدا عرضه خواهد شد ....
35
+ * ....
36
+
37
+ = Compatibility =
38
+ * Wordpress 3.5
39
+ * Gravity Forms 1.8.x
40
+
41
+ = Support =
42
+ * [Persian Support in GravityForms.ir](http://GravityForms.ir/)
43
+
44
+ == Installation ==
45
+ 1. Install and Activate Gravity Forms 1.8.x .
46
+ 2. Upload `persian-gravity-forms` folder to the `/wp-content/plugins/` directory
47
+ 3. Activate the plugin through the 'Plugins' menu in WordPress
48
+ 4. Enjoy It :)
49
+
50
+ == Frequently asked questions ==
51
+
52
+ = Is Persian Gravity Forms compatible with future versions of gravity forms? =
53
+ Also yes .
54
+
55
+ = Where can I find more information and documentation about the plug-in? =
56
+ You can read complete documentations on the [GravityForms.ir](http://www.GravityForms.ir) .
57
+
58
+
59
+ == Screenshots ==
60
+
61
+ 01. Forms in wordpress dashboard.
62
+ 02. Forms list
63
+ 03. Adding new form
64
+ 04. Fields list
65
+ 05. Form setting page
66
+ 06. form confirmation actions
67
+ 07. form confirmation emails
68
+ 08. plugins setting page
69
+ 09. entries list
70
+ 10. entries detail
71
+ 11. coupons
72
+ 12. post fields
73
+ 13. front end.
74
+ 14. Iran states
75
+ 15. Iran states
76
+
77
+ == Changelog ==
78
+ = 1.0.0 =
79
+ * First version
80
+
81
+ == Upgrade Notice ==
82
+ = 1.0.0 =
83
+ * First version
84
+
85
+ ==Traducciones ==
86
+ You can read complete documentations on the [GravityForms.ir](http://www.GravityForms.ir)