Version Description
- Add and fix some feature...
Download this release
Release Info
Developer | hannanstd |
Plugin | گرویتی فرم فارسی |
Version | 1.7.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.0 to 1.7.0
Persian_Gravityforms_By_HANNANStd.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Persian Gravity Forms
|
4 |
Plugin URI: https://wordpress.org/plugins/persian-gravity-forms/
|
5 |
Description: Gravity Forms for Iranian
|
6 |
-
Version: 1.
|
7 |
Requires at least: 3.8
|
8 |
Author: HANNAN Ebrahimi Setoode
|
9 |
Author URI: http://www.gravityforms.ir/
|
@@ -11,19 +11,24 @@ Text Domain: Persian_Gravityforms_By_HANNANStd
|
|
11 |
Domain Path: /languages/
|
12 |
License: GPL 2
|
13 |
*/
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
-
require_once("include/
|
19 |
-
if(class_exists("
|
20 |
-
new
|
21 |
|
22 |
require_once("include/Pre_Submission.php");
|
23 |
if(class_exists("GFIR_PreSubmission"))
|
24 |
GFIR_PreSubmission::init();
|
25 |
|
26 |
-
require_once("include/
|
|
|
|
|
|
|
|
|
27 |
require_once("include/wp-session.php");
|
28 |
class GravityFormsPersian {
|
29 |
private $file;
|
@@ -63,7 +68,6 @@ class GravityFormsPersian {
|
|
63 |
add_filter('gform_field_validation', array( $this, 'Input_Valid_Checker_By_HANNANStd'), 10, 4);
|
64 |
add_filter('gform_noconflict_styles', array( $this, 'Register_Style_to_No_Conflict_By_HANNANStd'));
|
65 |
add_filter('gform_noconflict_scripts', array( $this, 'Register_Script_to_No_Conflict_By_HANNANStd'));
|
66 |
-
add_filter( 'gform_notification_events', array( $this, 'Add_Manual_Notification_Event') );
|
67 |
}
|
68 |
|
69 |
public function Activated_Plugin_By_HANNANStd() {
|
@@ -790,7 +794,7 @@ class GravityFormsPersian {
|
|
790 |
return plugins_url( '', __FILE__ );
|
791 |
}
|
792 |
public function version(){
|
793 |
-
return '1.
|
794 |
}
|
795 |
public function Add_HANNANStd_Field_By_HANNANStd( $field_groups ) {
|
796 |
foreach( $field_groups as &$group ){
|
@@ -1276,11 +1280,7 @@ class GravityFormsPersian {
|
|
1276 |
//else return result
|
1277 |
return $result;
|
1278 |
}
|
1279 |
-
|
1280 |
-
public function Add_Manual_Notification_Event( $events ) {
|
1281 |
-
$events['manual'] = __( 'ارسال دستی' );
|
1282 |
-
return $events;
|
1283 |
-
}
|
1284 |
}
|
1285 |
global $Persian_Gravityforms_By_HANNANStd_plugin;
|
1286 |
$Persian_Gravityforms_By_HANNANStd_plugin = new GravityFormsPersian( __FILE__ );
|
3 |
Plugin Name: Persian Gravity Forms
|
4 |
Plugin URI: https://wordpress.org/plugins/persian-gravity-forms/
|
5 |
Description: Gravity Forms for Iranian
|
6 |
+
Version: 1.7.0
|
7 |
Requires at least: 3.8
|
8 |
Author: HANNAN Ebrahimi Setoode
|
9 |
Author URI: http://www.gravityforms.ir/
|
11 |
Domain Path: /languages/
|
12 |
License: GPL 2
|
13 |
*/
|
14 |
+
add_action('plugins_loaded', 'Load_Live_Preview', 0);
|
15 |
+
function Load_Live_Preview() {
|
16 |
+
require_once("include/Live_Preview.php");
|
17 |
+
}
|
18 |
|
19 |
+
require_once("include/News_Letter.php");
|
20 |
+
if(class_exists("GFIR_NewsLetter"))
|
21 |
+
new GFIR_NewsLetter();
|
22 |
|
23 |
require_once("include/Pre_Submission.php");
|
24 |
if(class_exists("GFIR_PreSubmission"))
|
25 |
GFIR_PreSubmission::init();
|
26 |
|
27 |
+
require_once("include/Snippets.php");
|
28 |
+
if(class_exists("GFIR_PostPermalink"))
|
29 |
+
new GFIR_PostPermalink();
|
30 |
+
|
31 |
+
require_once("include/Multipage_Navigation.php");
|
32 |
require_once("include/wp-session.php");
|
33 |
class GravityFormsPersian {
|
34 |
private $file;
|
68 |
add_filter('gform_field_validation', array( $this, 'Input_Valid_Checker_By_HANNANStd'), 10, 4);
|
69 |
add_filter('gform_noconflict_styles', array( $this, 'Register_Style_to_No_Conflict_By_HANNANStd'));
|
70 |
add_filter('gform_noconflict_scripts', array( $this, 'Register_Script_to_No_Conflict_By_HANNANStd'));
|
|
|
71 |
}
|
72 |
|
73 |
public function Activated_Plugin_By_HANNANStd() {
|
794 |
return plugins_url( '', __FILE__ );
|
795 |
}
|
796 |
public function version(){
|
797 |
+
return '1.7.0';
|
798 |
}
|
799 |
public function Add_HANNANStd_Field_By_HANNANStd( $field_groups ) {
|
800 |
foreach( $field_groups as &$group ){
|
1280 |
//else return result
|
1281 |
return $result;
|
1282 |
}
|
1283 |
+
|
|
|
|
|
|
|
|
|
1284 |
}
|
1285 |
global $Persian_Gravityforms_By_HANNANStd_plugin;
|
1286 |
$Persian_Gravityforms_By_HANNANStd_plugin = new GravityFormsPersian( __FILE__ );
|
include/Live_Preview.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php
|
2 |
-
class
|
3 |
var $post_type = 'gf_live_preview';
|
4 |
function __construct( $args = array() ) {
|
5 |
if( ! property_exists( 'GFCommon', 'version' ) || ! version_compare( GFCommon::$version, '1.8', '>=' ) )
|
@@ -8,7 +8,7 @@ class GIRLivePreview {
|
|
8 |
'id' => 0,
|
9 |
'title' => true,
|
10 |
'description' => true,
|
11 |
-
'ajax' =>
|
12 |
) );
|
13 |
add_action( 'init', array( $this, 'register_preview_post_type' ) );
|
14 |
add_action( 'wp', array( $this, 'maybe_load_preview_functionality' ) );
|
@@ -98,4 +98,5 @@ class GIRLivePreview {
|
|
98 |
function is_live_preview() {
|
99 |
return is_post_type_archive( $this->post_type );
|
100 |
}
|
101 |
-
}
|
|
1 |
<?php
|
2 |
+
class GFIRLivePreview {
|
3 |
var $post_type = 'gf_live_preview';
|
4 |
function __construct( $args = array() ) {
|
5 |
if( ! property_exists( 'GFCommon', 'version' ) || ! version_compare( GFCommon::$version, '1.8', '>=' ) )
|
8 |
'id' => 0,
|
9 |
'title' => true,
|
10 |
'description' => true,
|
11 |
+
'ajax' => true
|
12 |
) );
|
13 |
add_action( 'init', array( $this, 'register_preview_post_type' ) );
|
14 |
add_action( 'wp', array( $this, 'maybe_load_preview_functionality' ) );
|
98 |
function is_live_preview() {
|
99 |
return is_post_type_archive( $this->post_type );
|
100 |
}
|
101 |
+
}
|
102 |
+
new GFIRLivePreview( array( 'title' => true, 'description' => true,'ajax' => true) );
|
include/{MultipageNavigation.php → Multipage_Navigation.php}
RENAMED
File without changes
|
include/News_Letter.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Post Permalink Merge Tag
|
4 |
+
* http://GravityForms.ir
|
5 |
+
*/
|
6 |
+
class GFIR_NewsLetter {
|
7 |
+
|
8 |
+
function __construct() {
|
9 |
+
add_filter('gform_notification_events', array( $this, 'Add_Manual_Notification_Event') );
|
10 |
+
add_filter('gform_before_resend_notifications', array( $this, 'Manual_Notification_Event_Conditional_Logic'), 10, 2);
|
11 |
+
}
|
12 |
+
|
13 |
+
public function Add_Manual_Notification_Event( $events ) {
|
14 |
+
$events['newsletter'] = __( 'خبرنامه' );
|
15 |
+
return $events;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function Manual_Notification_Event_Conditional_Logic($form, $leads) {
|
19 |
+
|
20 |
+
if ( empty( $leads ) || empty( $form ) ) {
|
21 |
+
_e( 'There was an error while resending the notifications.', 'gravityforms' );
|
22 |
+
die();
|
23 |
+
};
|
24 |
+
|
25 |
+
$notifications = json_decode( rgpost( 'notifications' ) );
|
26 |
+
if ( ! is_array( $notifications ) ) {
|
27 |
+
die( __( 'No notifications have been selected. Please select a notification to be sent.', 'gravityforms' ) );
|
28 |
+
}
|
29 |
+
|
30 |
+
if ( ! rgempty( 'sendTo', $_POST ) && ! GFCommon::is_valid_email_list( rgpost( 'sendTo' ) ) ) {
|
31 |
+
die( __( 'The <strong>Send To</strong> email address provided is not valid.', 'gravityforms' ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
foreach ( $leads as $lead_id ) {
|
35 |
+
$lead = RGFormsModel::get_lead( $lead_id );
|
36 |
+
foreach ( $notifications as $notification_id ) {
|
37 |
+
|
38 |
+
$notification = $form['notifications'][ $notification_id ];
|
39 |
+
if ( ! $notification ) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
+
//overriding To email if one was specified
|
44 |
+
if ( rgpost( 'sendTo' ) ) {
|
45 |
+
$notification['to'] = rgpost( 'sendTo' );
|
46 |
+
$notification['toType'] = 'email';
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( $notification['event'] == 'newsletter') {
|
50 |
+
GFCommon::send_notifications( $notification, $form, $lead, true, $notification['event'] );
|
51 |
+
}
|
52 |
+
else {
|
53 |
+
GFCommon::send_notification( $notification, $form, $lead );
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
die();
|
59 |
+
return;
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
}
|
include/Snippets.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Post Permalink Merge Tag
|
4 |
* http://GravityForms.ir
|
5 |
*/
|
6 |
-
class
|
7 |
function __construct() {
|
8 |
add_filter('gform_custom_merge_tags', array($this, 'add_custom_merge_tag'), 10, 4);
|
9 |
add_filter('gform_replace_merge_tags', array($this, 'replace_merge_tag'), 10, 3);
|
@@ -11,7 +11,7 @@ class GF_IR_PostPermalink {
|
|
11 |
function add_custom_merge_tag($merge_tags, $form_id, $fields, $element_id) {
|
12 |
if(!GFCommon::has_post_field($fields))
|
13 |
return $merge_tags;
|
14 |
-
$merge_tags[] = array('label' => '
|
15 |
return $merge_tags;
|
16 |
}
|
17 |
function replace_merge_tag($text, $form, $entry) {
|
3 |
* Post Permalink Merge Tag
|
4 |
* http://GravityForms.ir
|
5 |
*/
|
6 |
+
class GFIR_PostPermalink {
|
7 |
function __construct() {
|
8 |
add_filter('gform_custom_merge_tags', array($this, 'add_custom_merge_tag'), 10, 4);
|
9 |
add_filter('gform_replace_merge_tags', array($this, 'replace_merge_tag'), 10, 3);
|
11 |
function add_custom_merge_tag($merge_tags, $form_id, $fields, $element_id) {
|
12 |
if(!GFCommon::has_post_field($fields))
|
13 |
return $merge_tags;
|
14 |
+
$merge_tags[] = array('label' => 'لینک پست', 'tag' => '{post_permalink}');
|
15 |
return $merge_tags;
|
16 |
}
|
17 |
function replace_merge_tag($text, $form, $entry) {
|
languages/gravityforms1.9/fa_IR.mo
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: gravityforms,gravity forms,persian gravity forms,persian gravityforms,grav
|
|
4 |
Donate link: http://www.webforest.ir
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 1.
|
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 .
|
@@ -84,6 +84,8 @@ You can read complete documentations on the [GravityForms.ir](http://www.Gravity
|
|
84 |
19. Iranian National Code field Advanced setting
|
85 |
|
86 |
== Changelog ==
|
|
|
|
|
87 |
= 1.6.0 =
|
88 |
* Add and fix some feature...
|
89 |
= 1.5.0 =
|
@@ -146,6 +148,8 @@ You can read complete documentations on the [GravityForms.ir](http://www.Gravity
|
|
146 |
* First version
|
147 |
|
148 |
== Upgrade Notice ==
|
|
|
|
|
149 |
= 1.6.0 =
|
150 |
* Add and fix some feature...
|
151 |
= 1.5.0 =
|
4 |
Donate link: http://www.webforest.ir
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 1.7.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 .
|
84 |
19. Iranian National Code field Advanced setting
|
85 |
|
86 |
== Changelog ==
|
87 |
+
= 1.7.0 =
|
88 |
+
* Add and fix some feature...
|
89 |
= 1.6.0 =
|
90 |
* Add and fix some feature...
|
91 |
= 1.5.0 =
|
148 |
* First version
|
149 |
|
150 |
== Upgrade Notice ==
|
151 |
+
= 1.7.0 =
|
152 |
+
* Add and fix some feature...
|
153 |
= 1.6.0 =
|
154 |
* Add and fix some feature...
|
155 |
= 1.5.0 =
|