diff --git a/vandar.php b/vandar.php index fcda0eb..a3fba90 100644 --- a/vandar.php +++ b/vandar.php @@ -1,14 +1,15 @@ - 'gf_vandar', - 'tab_label' => __( 'درگاه وندار', 'gravityformsvandar' ), - 'title' => __( 'تنظیمات درگاه وندار ', 'gravityformsvandar' ), - 'handler' => array( __CLASS__, 'settings_page' ), + if (rgget("page") == "gf_settings") { + RGForms::add_settings_page( + array( + 'name' => 'gf_vandar', + 'tab_label' => __('درگاه وندار', 'gravityformsvandar'), + 'title' => __('تنظیمات درگاه وندار ', 'gravityformsvandar'), + 'handler' => array(__CLASS__, 'settings_page'), ) ); } - if ( self::is_vandar_page() ) { - wp_enqueue_script( array( "sack" ) ); + if (self::is_vandar_page()) { + wp_enqueue_script(array("sack")); self::setup(); } - add_action( 'wp_ajax_gf_vandar_update_feed_active', array( __CLASS__, 'update_feed_active' ) ); + add_action('wp_ajax_gf_vandar_update_feed_active', array(__CLASS__, 'update_feed_active')); } - if ( get_option( "gf_vandar_configured" ) ) { - add_filter( "gform_disable_post_creation", array( __CLASS__, "delay_posts" ), 10, 3 ); - add_filter( "gform_is_delayed_pre_process_feed", array( __CLASS__, "delay_addons" ), 10, 4 ); + if (get_option("gf_vandar_configured")) { + add_filter("gform_disable_post_creation", array(__CLASS__, "delay_posts"), 10, 3); + add_filter("gform_is_delayed_pre_process_feed", array(__CLASS__, "delay_addons"), 10, 4); - add_filter( "gform_confirmation", array( __CLASS__, "Request" ), 1000, 4 ); - add_action( 'wp', array( __CLASS__, 'Verify' ), 5 ); + add_filter("gform_confirmation", array(__CLASS__, "Request"), 1000, 4); + add_action('wp', array(__CLASS__, 'Verify'), 5); } - add_filter( "gform_logging_supported", array( __CLASS__, "set_logging_supported" ) ); + add_filter("gform_logging_supported", array(__CLASS__, "set_logging_supported")); // -------------------------------------------------------------------------------------------- - add_filter( 'gf_payment_gateways', array( __CLASS__, 'gravityformsvandar' ), 2 ); - do_action( 'gravityforms_gateways' ); - do_action( 'gravityforms_vandar' ); + add_filter('gf_payment_gateways', array(__CLASS__, 'gravityformsvandar'), 2); + do_action('gravityforms_gateways'); + do_action('gravityforms_vandar'); // -------------------------------------------------------------------------------------------- } // ------------------------GravityForms.IR------------------------- - public static function admin_notice_persian_gf() { - $class = 'notice notice-error'; - $message = sprintf( __( "برای استفاده از نسخه جدید درگاه های پرداخت گرویتی فرم نصب بسته فارسی ساز نسخه 2.3.1 به بالا الزامی است. برای نصب فارسی ساز %sکلیک کنید%s.", "gravityformsvandar" ), '', '' ); - printf( '

%2$s

', $class, $message ); + public static function admin_notice_persian_gf() + { + $class = 'notice notice-error'; + $message = sprintf(__("برای استفاده از نسخه جدید درگاه های پرداخت گرویتی فرم نصب بسته فارسی ساز نسخه 2.3.1 به بالا الزامی است. برای نصب فارسی ساز %sکلیک کنید%s.", "gravityformsvandar"), '', ''); + printf('

%2$s

', $class, $message); } // ------------------------GravityForms.IR------------------------- - public static function admin_notice_gf_support() { - $class = 'notice notice-error'; - $message = sprintf( __( "درگاه وندار نیاز به گرویتی فرم نسخه %s به بالا دارد. برای بروز رسانی هسته گرویتی فرم به %sسایت گرویتی فرم فارسی%s مراجعه نمایید .", "gravityformsvandar" ), self::$min_gravityforms_version, "", "" ); - printf( '

%2$s

', $class, $message ); + public static function admin_notice_gf_support() + { + $class = 'notice notice-error'; + $message = sprintf(__("درگاه وندار نیاز به گرویتی فرم نسخه %s به بالا دارد. برای بروز رسانی هسته گرویتی فرم به %sسایت گرویتی فرم فارسی%s مراجعه نمایید .", "gravityformsvandar"), self::$min_gravityforms_version, "", ""); + printf('

%2$s

', $class, $message); } // #1 // ------------------------GravityForms.IR------------------------- - public static function gravityformsvandar( $form, $entry ) { + public static function gravityformsvandar($form, $entry) + { $vandar = array( - 'class' => ( __CLASS__ . '|' . self::$author ), - 'title' => __( 'وندار - ', 'gravityformsvandar' ), + 'class' => (__CLASS__ . '|' . self::$author), + 'title' => __('وندار + ', 'gravityformsvandar'), 'param' => array( // 'name' => __('نام', 'gravityformsvandar'), // 'email' => __('ایمیل', 'gravityformsvandar'), @@ -110,49 +116,54 @@ public static function gravityformsvandar( $form, $entry ) { ) ); - return apply_filters( self::$author . '_gf_vandar_detail', apply_filters( self::$author . '_gf_gateway_detail', $vandar, $form, $entry ), $form, $entry ); + return apply_filters(self::$author . '_gf_vandar_detail', apply_filters(self::$author . '_gf_gateway_detail', $vandar, $form, $entry), $form, $entry); } // ------------------------GravityForms.IR------------------------- - public static function add_permissions() { + public static function add_permissions() + { global $wp_roles; $editable_roles = get_editable_roles(); - foreach ( (array) $editable_roles as $role => $details ) { - if ( $role == 'administrator' || in_array( 'gravityforms_edit_forms', $details['capabilities'] ) ) { - $wp_roles->add_cap( $role, 'gravityforms_vandar' ); - $wp_roles->add_cap( $role, 'gravityforms_vandar_uninstall' ); + foreach ((array)$editable_roles as $role => $details) { + if ($role == 'administrator' || in_array('gravityforms_edit_forms', $details['capabilities'])) { + $wp_roles->add_cap($role, 'gravityforms_vandar'); + $wp_roles->add_cap($role, 'gravityforms_vandar_uninstall'); } } } // ------------------------GravityForms.IR------------------------- - public static function members_get_capabilities( $caps ) { - return array_merge( $caps, array( "gravityforms_vandar", "gravityforms_vandar_uninstall" ) ); + public static function members_get_capabilities($caps) + { + return array_merge($caps, array("gravityforms_vandar", "gravityforms_vandar_uninstall")); } // ------------------------GravityForms.IR------------------------- - private static function setup() { - if ( get_option( "gf_vandar_version" ) != self::$version ) { + private static function setup() + { + if (get_option("gf_vandar_version") != self::$version) { GFPersian_DB_Vandar::update_table(); - update_option( "gf_vandar_version", self::$version ); + update_option("gf_vandar_version", self::$version); } } // ------------------------GravityForms.IR------------------------- - public static function tooltips( $tooltips ) { - $tooltips["gateway_name"] = __( "تذکر مهم : این قسمت برای نمایش به بازدید کننده می باشد و لطفا جهت جلوگیری از مشکل و تداخل آن را فقط یکبار تنظیم نمایید و از تنظیم مکرر آن خود داری نمایید .", "gravityformsvandar" ); + public static function tooltips($tooltips) + { + $tooltips["gateway_name"] = __("تذکر مهم : این قسمت برای نمایش به بازدید کننده می باشد و لطفا جهت جلوگیری از مشکل و تداخل آن را فقط یکبار تنظیم نمایید و از تنظیم مکرر آن خود داری نمایید .", "gravityformsvandar"); return $tooltips; } // ------------------------GravityForms.IR------------------------- - public static function menu( $menus ) { + public static function menu($menus) + { $permission = "gravityforms_vandar"; - if ( ! empty( $permission ) ) { + if (!empty($permission)) { $menus[] = array( - "name" => "gf_vandar", - "label" => __( "وندار", "gravityformsvandar" ), - "callback" => array( __CLASS__, "vandar_page" ), + "name" => "gf_vandar", + "label" => __("وندار", "gravityformsvandar"), + "callback" => array(__CLASS__, "vandar_page"), "permission" => $permission ); } @@ -161,19 +172,21 @@ public static function menu( $menus ) { } // ------------------------GravityForms.IR------------------------- - public static function toolbar( $menu_items ) { + public static function toolbar($menu_items) + { $menu_items[] = array( - 'name' => 'vandar', - 'label' => __( 'وندار', 'gravityformsvandar' ) + 'name' => 'vandar', + 'label' => __('وندار', 'gravityformsvandar') ); return $menu_items; } // ------------------------GravityForms.IR------------------------- - private static function is_gravityforms_supported() { - if ( class_exists( "GFCommon" ) ) { - $is_correct_version = version_compare( GFCommon::$version, self::$min_gravityforms_version, ">=" ); + private static function is_gravityforms_supported() + { + if (class_exists("GFCommon")) { + $is_correct_version = version_compare(GFCommon::$version, self::$min_gravityforms_version, ">="); return $is_correct_version; } else { @@ -182,139 +195,145 @@ private static function is_gravityforms_supported() { } // ------------------------GravityForms.IR------------------------- - protected static function has_access( $required_permission = 'gravityforms_vandar' ) { - if ( ! function_exists( 'wp_get_current_user' ) ) { - include( ABSPATH . "wp-includes/pluggable.php" ); + protected static function has_access($required_permission = 'gravityforms_vandar') + { + if (!function_exists('wp_get_current_user')) { + include(ABSPATH . "wp-includes/pluggable.php"); } - return GFCommon::current_user_can_any( $required_permission ); + return GFCommon::current_user_can_any($required_permission); } // ------------------------GravityForms.IR------------------------- - protected static function get_base_url() { - return plugins_url( null, __FILE__ ); + protected static function get_base_url() + { + return plugins_url(null, __FILE__); } // ------------------------GravityForms.IR------------------------- - protected static function get_base_path() { - $folder = basename( dirname( __FILE__ ) ); + protected static function get_base_path() + { + $folder = basename(dirname(__FILE__)); return WP_PLUGIN_DIR . "/" . $folder; } // ------------------------GravityForms.IR------------------------- - public static function set_logging_supported( $plugins ) { - $plugins[ basename( dirname( __FILE__ ) ) ] = "vandar"; + public static function set_logging_supported($plugins) + { + $plugins[basename(dirname(__FILE__))] = "vandar"; return $plugins; } // ------------------------GravityForms.IR------------------------- - public static function uninstall() { - if ( ! self::has_access( "gravityforms_vandar_uninstall" ) ) { - die( __( "شما مجوز کافی برای این کار را ندارید . سطح دسترسی شما پایین تر از حد مجاز است . ", "gravityformsvandar" ) ); + public static function uninstall() + { + if (!self::has_access("gravityforms_vandar_uninstall")) { + die(__("شما مجوز کافی برای این کار را ندارید . سطح دسترسی شما پایین تر از حد مجاز است . ", "gravityformsvandar")); } GFPersian_DB_Vandar::drop_tables(); - delete_option( "gf_vandar_settings" ); - delete_option( "gf_vandar_configured" ); - delete_option( "gf_vandar_version" ); - $plugin = basename( dirname( __FILE__ ) ) . "/index.php"; - deactivate_plugins( $plugin ); - update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) ); + delete_option("gf_vandar_settings"); + delete_option("gf_vandar_configured"); + delete_option("gf_vandar_version"); + $plugin = basename(dirname(__FILE__)) . "/index.php"; + deactivate_plugins($plugin); + update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated')); } // ------------------------GravityForms.IR------------------------- - private static function is_vandar_page() { - $current_page = in_array( trim( strtolower( rgget( "page" ) ) ), array( 'gf_vandar', 'vandar' ) ); - $current_view = in_array( trim( strtolower( rgget( "view" ) ) ), array( 'gf_vandar', 'vandar' ) ); - $current_subview = in_array( trim( strtolower( rgget( "subview" ) ) ), array( 'gf_vandar', 'vandar' ) ); + private static function is_vandar_page() + { + $current_page = in_array(trim(strtolower(rgget("page"))), array('gf_vandar', 'vandar')); + $current_view = in_array(trim(strtolower(rgget("view"))), array('gf_vandar', 'vandar')); + $current_subview = in_array(trim(strtolower(rgget("subview"))), array('gf_vandar', 'vandar')); return $current_page || $current_view || $current_subview; } // ------------------------GravityForms.IR------------------------- - public static function feed_page() { + public static function feed_page() + { GFFormSettings::page_header(); ?>

- - "> - "> + + "> + ">

- + $condition_field_ids ); + if (!is_array($condition_field_ids)) { + $condition_field_ids = array('1' => $condition_field_ids); } } else { return true; } - if ( ! empty( $config['meta']['vandar_conditional_value'] ) ) { + if (!empty($config['meta']['vandar_conditional_value'])) { $condition_values = $config['meta']['vandar_conditional_value']; - if ( ! is_array( $condition_values ) ) { - $condition_values = array( '1' => $condition_values ); + if (!is_array($condition_values)) { + $condition_values = array('1' => $condition_values); } } else { - $condition_values = array( '1' => '' ); + $condition_values = array('1' => ''); } - if ( ! empty( $config['meta']['vandar_conditional_operator'] ) ) { + if (!empty($config['meta']['vandar_conditional_operator'])) { $condition_operators = $config['meta']['vandar_conditional_operator']; - if ( ! is_array( $condition_operators ) ) { - $condition_operators = array( '1' => $condition_operators ); + if (!is_array($condition_operators)) { + $condition_operators = array('1' => $condition_operators); } } else { - $condition_operators = array( '1' => 'is' ); + $condition_operators = array('1' => 'is'); } - $type = ! empty( $config['meta']['vandar_conditional_type'] ) ? strtolower( $config['meta']['vandar_conditional_type'] ) : ''; + $type = !empty($config['meta']['vandar_conditional_type']) ? strtolower($config['meta']['vandar_conditional_type']) : ''; $type = $type == 'all' ? 'all' : 'any'; - foreach ( $condition_field_ids as $i => $field_id ) { + foreach ($condition_field_ids as $i => $field_id) { - if ( empty( $field_id ) ) { + if (empty($field_id)) { continue; } - $field = RGFormsModel::get_field( $form, $field_id ); - if ( empty( $field ) ) { + $field = RGFormsModel::get_field($form, $field_id); + if (empty($field)) { continue; } - $value = ! empty( $condition_values[ '' . $i . '' ] ) ? $condition_values[ '' . $i . '' ] : ''; - $operator = ! empty( $condition_operators[ '' . $i . '' ] ) ? $condition_operators[ '' . $i . '' ] : 'is'; + $value = !empty($condition_values['' . $i . '']) ? $condition_values['' . $i . ''] : ''; + $operator = !empty($condition_operators['' . $i . '']) ? $condition_operators['' . $i . ''] : 'is'; - $is_visible = ! RGFormsModel::is_field_hidden( $form, $field, array() ); - $field_value = RGFormsModel::get_field_value( $field, array() ); - $is_value_match = RGFormsModel::is_value_match( $field_value, $value, $operator ); - $check = $is_value_match && $is_visible; + $is_visible = !RGFormsModel::is_field_hidden($form, $field, array()); + $field_value = RGFormsModel::get_field_value($field, array()); + $is_value_match = RGFormsModel::is_value_match($field_value, $value, $operator); + $check = $is_value_match && $is_visible; - if ( $type == 'any' && $check ) { + if ($type == 'any' && $check) { return true; - } else if ( $type == 'all' && ! $check ) { + } else if ($type == 'all' && !$check) { return false; } } - if ( $type == 'any' ) { + if ($type == 'any') { return false; } else { return true; @@ -322,20 +341,22 @@ public static function has_vandar_condition( $form, $config ) { } // ------------------------GravityForms.IR------------------------- - public static function get_config_by_entry( $entry ) { - $feed_id = gform_get_meta( $entry["id"], "vandar_feed_id" ); - $feed = ! empty( $feed_id ) ? GFPersian_DB_Vandar::get_feed( $feed_id ) : ''; - $return = ! empty( $feed ) ? $feed : false; + public static function get_config_by_entry($entry) + { + $feed_id = gform_get_meta($entry["id"], "vandar_feed_id"); + $feed = !empty($feed_id) ? GFPersian_DB_Vandar::get_feed($feed_id) : ''; + $return = !empty($feed) ? $feed : false; - return apply_filters( self::$author . '_gf_vandar_get_config_by_entry', apply_filters( self::$author . '_gf_gateway_get_config_by_entry', $return, $entry ), $entry ); + return apply_filters(self::$author . '_gf_vandar_get_config_by_entry', apply_filters(self::$author . '_gf_gateway_get_config_by_entry', $return, $entry), $entry); } // ------------------------GravityForms.IR------------------------- - public static function delay_posts( $is_disabled, $form, $entry ) { + public static function delay_posts($is_disabled, $form, $entry) + { - $config = self::get_active_config( $form ); + $config = self::get_active_config($form); - if ( ! empty( $config ) && is_array( $config ) && $config ) { + if (!empty($config) && is_array($config) && $config) { return true; } @@ -343,25 +364,26 @@ public static function delay_posts( $is_disabled, $form, $entry ) { } // ------------------------GravityForms.IR------------------------- - public static function delay_addons( $is_delayed, $form, $entry, $slug ) { + public static function delay_addons($is_delayed, $form, $entry, $slug) + { - $config = self::get_active_config( $form ); + $config = self::get_active_config($form); - if ( ! empty( $config["meta"] ) && is_array( $config["meta"] ) && $config = $config["meta"] ) { + if (!empty($config["meta"]) && is_array($config["meta"]) && $config = $config["meta"]) { - $user_registration_slug = apply_filters( 'gf_user_registration_slug', 'gravityformsuserregistration' ); + $user_registration_slug = apply_filters('gf_user_registration_slug', 'gravityformsuserregistration'); - if ( $slug != $user_registration_slug && ! empty( $config["addon"] ) && $config["addon"] == 'true' ) { + if ($slug != $user_registration_slug && !empty($config["addon"]) && $config["addon"] == 'true') { $flag = true; - } elseif ( $slug == $user_registration_slug && ! empty( $config["type"] ) && $config["type"] == "subscription" ) { + } elseif ($slug == $user_registration_slug && !empty($config["type"]) && $config["type"] == "subscription") { $flag = true; } - if ( ! empty( $flag ) ) { - $fulfilled = gform_get_meta( $entry['id'], $slug . '_is_fulfilled' ); - $processed = gform_get_meta( $entry['id'], 'processed_feeds' ); + if (!empty($flag)) { + $fulfilled = gform_get_meta($entry['id'], $slug . '_is_fulfilled'); + $processed = gform_get_meta($entry['id'], 'processed_feeds'); - $is_delayed = empty( $fulfilled ) && rgempty( $slug, $processed ); + $is_delayed = empty($fulfilled) && rgempty($slug, $processed); } } @@ -369,265 +391,246 @@ public static function delay_addons( $is_delayed, $form, $entry, $slug ) { } // ------------------------GravityForms.IR------------------------- - private static function redirect_confirmation( $url, $ajax ) { + private static function redirect_confirmation($url, $ajax) + { - if ( headers_sent() || $ajax ) { - $confirmation = "'; + $confirmation .= apply_filters('gform_cdata_close', '') . ''; } else { - $confirmation = array( 'redirect' => $url ); - + $confirmation = array('redirect' => $url); } return $confirmation; } // ------------------------GravityForms.IR------------------------- - public static function get_active_config( $form ) { + public static function get_active_config($form) + { - if ( ! empty( self::$config ) ) { + if (!empty(self::$config)) { return self::$config; } - $configs = GFPersian_DB_Vandar::get_feed_by_form( $form["id"], true ); + $configs = GFPersian_DB_Vandar::get_feed_by_form($form["id"], true); - $configs = apply_filters( self::$author . '_gf_vandar_get_active_configs', apply_filters( self::$author . '_gf_gateway_get_active_configs', $configs, $form ), $form ); + $configs = apply_filters(self::$author . '_gf_vandar_get_active_configs', apply_filters(self::$author . '_gf_gateway_get_active_configs', $configs, $form), $form); $return = false; - if ( ! empty( $configs ) && is_array( $configs ) ) { + if (!empty($configs) && is_array($configs)) { - foreach ( $configs as $config ) { - if ( self::has_vandar_condition( $form, $config ) ) { + foreach ($configs as $config) { + if (self::has_vandar_condition($form, $config)) { $return = $config; } break; } } - self::$config = apply_filters( self::$author . '_gf_vandar_get_active_config', apply_filters( self::$author . '_gf_gateway_get_active_config', $return, $form ), $form ); + self::$config = apply_filters(self::$author . '_gf_vandar_get_active_config', apply_filters(self::$author . '_gf_gateway_get_active_config', $return, $form), $form); return self::$config; } // ------------------------GravityForms.IR------------------------- - public static function vandar_page() { - $view = rgget( "view" ); - if ( $view == "edit" ) { + public static function vandar_page() + { + $view = rgget("view"); + if ($view == "edit") { self::config_page(); - } else if ( $view == "stats" ) { + } else if ($view == "stats") { GFPersian_Chart_vandar::stats_page(); } else { - self::list_page( '' ); + self::list_page(''); } } // ------------------------GravityForms.IR------------------------- - private static function list_page( $arg ) { + private static function list_page($arg) + { - if ( ! self::is_gravityforms_supported() ) { - die( sprintf( __( "درگاه وندار نیاز به گرویتی فرم نسخه %s دارد. برای بروز رسانی هسته گرویتی فرم به %sسایت گرویتی فرم فارسی%s مراجعه نمایید .", "gravityformsvandar" ), self::$min_gravityforms_version, "", "" ) ); + if (!self::is_gravityforms_supported()) { + die(sprintf(__("درگاه وندار نیاز به گرویتی فرم نسخه %s دارد. برای بروز رسانی هسته گرویتی فرم به %sسایت گرویتی فرم فارسی%s مراجعه نمایید .", "gravityformsvandar"), self::$min_gravityforms_version, "", "")); } - if ( rgpost( 'action' ) == "delete" ) { - check_admin_referer( "list_action", "gf_vandar_list" ); - $id = absint( rgpost( "action_argument" ) ); - GFPersian_DB_Vandar::delete_feed( $id ); - ?> -
-
- +
+
+
- +

- - - + +

- - - + + +
- + '; + echo ''; ?> - +
- - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - 0 ) { - foreach ( $settings as $setting ) { + + + + 0) { + foreach ($settings as $setting) { ?> - + - + - + - - - - - + + + + - + + + + - - - - -
-
+ +
- ', "" ); ?> -
+ ', ""); ?> +
"/>" />.png" - alt="" - title="" - onclick="ToggleActive(this, ); "/>.png" alt="" title="" onclick="ToggleActive(this, ); " /> - -
+
+ + - - - " - title=""> - - + + + " title=""> + + + + + +
', ""); } else { - _e( "محصول معمولی یا فرم ارسال پست", "gravityformsvandar" ); + echo sprintf(__("شما هیچ فید ونداری ندارید . %sیکی بسازید%s .", "gravityformsvandar"), '', ""); } ?>
- ', "" ); - } else { - echo sprintf( __( "شما هیچ فید ونداری ندارید . %sیکی بسازید%s .", "gravityformsvandar" ), '', "" ); - } - ?> -
@@ -643,21 +646,20 @@ function ToggleActive(img, feed_id) { var is_active = img.src.indexOf("active1.png") >= 0; if (is_active) { img.src = img.src.replace("active1.png", "active0.png"); - jQuery(img).attr('title', '').attr('alt', ''); - } - else { + jQuery(img).attr('title', '').attr('alt', ''); + } else { img.src = img.src.replace("active0.png", "active1.png"); - jQuery(img).attr('title', '').attr('alt', ''); + jQuery(img).attr('title', '').attr('alt', ''); } var mysack = new sack(ajaxurl); mysack.execute = 1; mysack.method = 'POST'; mysack.setVar("action", "gf_vandar_update_feed_active"); - mysack.setVar("gf_vandar_update_feed_active", ""); + mysack.setVar("gf_vandar_update_feed_active", ""); mysack.setVar("feed_id", feed_id); mysack.setVar("is_active", is_active ? 0 : 1); - mysack.onError = function () { - alert('') + mysack.onError = function() { + alert('') }; mysack.runAJAX(); return true; @@ -667,86 +669,92 @@ function ToggleActive(img, feed_id) { } // ------------------------GravityForms.IR------------------------- - public static function update_feed_active() { - check_ajax_referer( 'gf_vandar_update_feed_active', 'gf_vandar_update_feed_active' ); - $id = absint( rgpost( 'feed_id' ) ); - $feed = GFPersian_DB_Vandar::get_feed( $id ); - GFPersian_DB_Vandar::update_feed( $id, $feed["form_id"], $_POST["is_active"], $feed["meta"] ); + public static function update_feed_active() + { + check_ajax_referer('gf_vandar_update_feed_active', 'gf_vandar_update_feed_active'); + $id = absint(rgpost('feed_id')); + $feed = GFPersian_DB_Vandar::get_feed($id); + GFPersian_DB_Vandar::update_feed($id, $feed["form_id"], $_POST["is_active"], $feed["meta"]); } // ------------------------GravityForms.IR------------------------- - private static function Return_URL( $form_id, $entry_id ) { + private static function Return_URL($form_id, $entry_id) + { $pageURL = GFCommon::is_ssl() ? 'https://' : 'http://'; - if ( $_SERVER['SERVER_PORT'] != '80' ) { + if ($_SERVER['SERVER_PORT'] != '80') { $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI']; } else { $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; } - $arr_params = array( 'id', 'entry', 'no' ); - $pageURL = esc_url( remove_query_arg( $arr_params, $pageURL ) ); + $arr_params = array('id', 'entry', 'no'); + $pageURL = esc_url(remove_query_arg($arr_params, $pageURL)); - $pageURL = str_replace( '#038;', '&', add_query_arg( array( - 'id' => $form_id, + $pageURL = str_replace('#038;', '&', add_query_arg(array( + 'id' => $form_id, 'entry' => $entry_id - ), $pageURL ) ); + ), $pageURL)); - return apply_filters( self::$author . '_vandar_return_url', apply_filters( self::$author . '_gateway_return_url', $pageURL, $form_id, $entry_id, __CLASS__ ), $form_id, $entry_id, __CLASS__ ); + return apply_filters(self::$author . '_vandar_return_url', apply_filters(self::$author . '_gateway_return_url', $pageURL, $form_id, $entry_id, __CLASS__), $form_id, $entry_id, __CLASS__); } // ------------------------GravityForms.IR------------------------- - private static function Return_URL_Vandar( $form_id = null, $entry_id = null ) { + private static function Return_URL_Vandar($form_id = null, $entry_id = null) + { $pageURL = GFCommon::is_ssl() ? 'https://' : 'http://'; - if ( $_SERVER['SERVER_PORT'] != '80' ) { + if ($_SERVER['SERVER_PORT'] != '80') { $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI']; } else { $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; } - $arr_params = array( 'id', 'entry', 'no' ); - $pageURL = esc_url( remove_query_arg( $arr_params, $pageURL ) ); + $arr_params = array('id', 'entry', 'no'); + $pageURL = esc_url(remove_query_arg($arr_params, $pageURL)); - $pageURL = str_replace( '#038;', '&', add_query_arg( array( - 'id' => $form_id, + $pageURL = str_replace('#038;', '&', add_query_arg(array( + 'id' => $form_id, 'entry' => $entry_id - ), $pageURL ) ); + ), $pageURL)); return $pageURL; } // ------------------------GravityForms.IR------------------------- - public static function URL_UTF8( $url ) { + public static function URL_UTF8($url) + { $encoded = ''; - $length = mb_strlen( $url ); - for ( $i = 0; $i < $length; $i ++ ) { - $encoded .= '%' . wordwrap( bin2hex( mb_substr( $url, $i, 1 ) ), 2, '%', true ); + $length = mb_strlen($url); + for ($i = 0; $i < $length; $i++) { + $encoded .= '%' . wordwrap(bin2hex(mb_substr($url, $i, 1)), 2, '%', true); } return $encoded; } // ------------------------GravityForms.IR------------------------- - public static function get_order_total( $form, $entry ) { + public static function get_order_total($form, $entry) + { - $total = GFCommon::get_order_total( $form, $entry ); - $total = ( ! empty( $total ) && $total > 0 ) ? $total : 0; + $total = GFCommon::get_order_total($form, $entry); + $total = (!empty($total) && $total > 0) ? $total : 0; - return apply_filters( self::$author . '_vandar_get_order_total', apply_filters( self::$author . '_gateway_get_order_total', $total, $form, $entry ), $form, $entry ); + return apply_filters(self::$author . '_vandar_get_order_total', apply_filters(self::$author . '_gateway_get_order_total', $total, $form, $entry), $form, $entry); } // ------------------------GravityForms.IR------------------------- - private static function get_mapped_field_list( $field_name, $selected_field, $fields ) { + private static function get_mapped_field_list($field_name, $selected_field, $fields) + { $str = ""; @@ -755,16 +763,17 @@ private static function get_mapped_field_list( $field_name, $selected_field, $fi } // ------------------------GravityForms.IR------------------------- - private static function get_form_fields( $form ) { + private static function get_form_fields($form) + { $fields = array(); - if ( is_array( $form["fields"] ) ) { - foreach ( $form["fields"] as $field ) { - if ( isset( $field["inputs"] ) && is_array( $field["inputs"] ) ) { - foreach ( $field["inputs"] as $input ) { - $fields[] = array( $input["id"], GFCommon::get_label( $field, $input["id"] ) ); + if (is_array($form["fields"])) { + foreach ($form["fields"] as $field) { + if (isset($field["inputs"]) && is_array($field["inputs"])) { + foreach ($field["inputs"] as $input) { + $fields[] = array($input["id"], GFCommon::get_label($field, $input["id"])); } - } else if ( ! rgar( $field, 'displayOnly' ) ) { - $fields[] = array( $field["id"], GFCommon::get_label( $field ) ); + } else if (!rgar($field, 'displayOnly')) { + $fields[] = array($field["id"], GFCommon::get_label($field)); } } } @@ -774,176 +783,178 @@ private static function get_form_fields( $form ) { // ------------------------GravityForms.IR--------------------------------------------------------------------- //desc - private static function get_customer_information_desc( $form, $config = null ) { - $form_fields = self::get_form_fields( $form ); - $selected_field = ! empty( $config["meta"]["customer_fields_desc"] ) ? $config["meta"]["customer_fields_desc"] : ''; + private static function get_customer_information_desc($form, $config = null) + { + $form_fields = self::get_form_fields($form); + $selected_field = !empty($config["meta"]["customer_fields_desc"]) ? $config["meta"]["customer_fields_desc"] : ''; - return self::get_mapped_field_list( 'vandar_customer_field_desc', $selected_field, $form_fields ); + return self::get_mapped_field_list('vandar_customer_field_desc', $selected_field, $form_fields); } //name - private static function get_customer_information_name( $form, $config = null ) { - $form_fields = self::get_form_fields( $form ); - $selected_field = ! empty( $config["meta"]["customer_fields_name"] ) ? $config["meta"]["customer_fields_name"] : ''; + private static function get_customer_information_name($form, $config = null) + { + $form_fields = self::get_form_fields($form); + $selected_field = !empty($config["meta"]["customer_fields_name"]) ? $config["meta"]["customer_fields_name"] : ''; - return self::get_mapped_field_list( 'vandar_customer_field_name', $selected_field, $form_fields ); + return self::get_mapped_field_list('vandar_customer_field_name', $selected_field, $form_fields); } //family - private static function get_customer_information_family( $form, $config = null ) { - $form_fields = self::get_form_fields( $form ); - $selected_field = ! empty( $config["meta"]["customer_fields_family"] ) ? $config["meta"]["customer_fields_family"] : ''; + private static function get_customer_information_family($form, $config = null) + { + $form_fields = self::get_form_fields($form); + $selected_field = !empty($config["meta"]["customer_fields_family"]) ? $config["meta"]["customer_fields_family"] : ''; - return self::get_mapped_field_list( 'vandar_customer_field_family', $selected_field, $form_fields ); + return self::get_mapped_field_list('vandar_customer_field_family', $selected_field, $form_fields); } //email - private static function get_customer_information_email( $form, $config = null ) { - $form_fields = self::get_form_fields( $form ); - $selected_field = ! empty( $config["meta"]["customer_fields_email"] ) ? $config["meta"]["customer_fields_email"] : ''; + private static function get_customer_information_email($form, $config = null) + { + $form_fields = self::get_form_fields($form); + $selected_field = !empty($config["meta"]["customer_fields_email"]) ? $config["meta"]["customer_fields_email"] : ''; - return self::get_mapped_field_list( 'vandar_customer_field_email', $selected_field, $form_fields ); + return self::get_mapped_field_list('vandar_customer_field_email', $selected_field, $form_fields); } // ------------------------GravityForms.IR------------------------- - public static function payment_entry_detail( $form_id, $entry ) { + public static function payment_entry_detail($form_id, $entry) + { - $payment_gateway = rgar( $entry, "payment_method" ); + $payment_gateway = rgar($entry, "payment_method"); - if ( ! empty( $payment_gateway ) && $payment_gateway == "vandar" ) { + if (!empty($payment_gateway) && $payment_gateway == "vandar") { - do_action( 'gf_gateway_entry_detail' ); + do_action('gf_gateway_entry_detail'); - ?> -
+ ?> +
- + -
-
+
+
sub( new DateInterval( 'P0DT' . $tzh . 'H' . $tzm . 'M' ) ); + if (intval($tzb) < 0) { + $date->sub(new DateInterval('P0DT' . $tzh . 'H' . $tzm . 'M')); } else { - $date->add( new DateInterval( 'P0DT' . $tzh . 'H' . $tzm . 'M' ) ); + $date->add(new DateInterval('P0DT' . $tzh . 'H' . $tzm . 'M')); } - $payment_date = $date->format( 'Y-m-d H:i:s' ); - $payment_date = GF_jdate( 'Y-m-d H:i:s', strtotime( $payment_date ), '', date_default_timezone_get(), 'en' ); + $payment_date = $date->format('Y-m-d H:i:s'); + $payment_date = GF_jdate('Y-m-d H:i:s', strtotime($payment_date), '', date_default_timezone_get(), 'en'); - if ( $payment_status == 'Paid' ) { - $payment_status_persian = __( 'موفق', 'gravityformsvandar' ); + if ($payment_status == 'Paid') { + $payment_status_persian = __('موفق', 'gravityformsvandar'); } - if ( $payment_status == 'Active' ) { - $payment_status_persian = __( 'موفق', 'gravityformsvandar' ); + if ($payment_status == 'Active') { + $payment_status_persian = __('موفق', 'gravityformsvandar'); } - if ( $payment_status == 'Cancelled' ) { - $payment_status_persian = __( 'منصرف شده', 'gravityformsvandar' ); + if ($payment_status == 'Cancelled') { + $payment_status_persian = __('منصرف شده', 'gravityformsvandar'); } - if ( $payment_status == 'Failed' ) { - $payment_status_persian = __( 'ناموفق', 'gravityformsvandar' ); + if ($payment_status == 'Failed') { + $payment_status_persian = __('ناموفق', 'gravityformsvandar'); } - if ( $payment_status == 'Processing' ) { - $payment_status_persian = __( 'معلق', 'gravityformsvandar' ); + if ($payment_status == 'Processing') { + $payment_status_persian = __('معلق', 'gravityformsvandar'); } - if ( ! strtolower( rgpost( "save" ) ) || RGForms::post( "screen_mode" ) != "edit" ) { - echo __( 'وضعیت پرداخت : ', 'gravityformsvandar' ) . $payment_status_persian . '

'; - echo __( 'تاریخ پرداخت : ', 'gravityformsvandar' ) . '' . $payment_date . '

'; - echo __( 'مبلغ پرداختی : ', 'gravityformsvandar' ) . GFCommon::to_money( $payment_amount, rgar( $entry, "currency" ) ) . '

'; - echo __( 'کد رهگیری : ', 'gravityformsvandar' ) . $transaction_id . '

'; - echo __( 'درگاه پرداخت : وندار', 'gravityformsvandar' ); + if (!strtolower(rgpost("save")) || RGForms::post("screen_mode") != "edit") { + echo __('وضعیت پرداخت : ', 'gravityformsvandar') . $payment_status_persian . '

'; + echo __('تاریخ پرداخت : ', 'gravityformsvandar') . '' . $payment_date . '

'; + echo __('مبلغ پرداختی : ', 'gravityformsvandar') . GFCommon::to_money($payment_amount, rgar($entry, "currency")) . '

'; + echo __('کد رهگیری : ', 'gravityformsvandar') . $transaction_id . '

'; + echo __('درگاه پرداخت : وندار', 'gravityformsvandar'); } else { $payment_string = ''; $payment_string .= ''; - echo __( 'وضعیت پرداخت :', 'gravityformsvandar' ) . $payment_string . '

'; - ?> + echo __('وضعیت پرداخت :', 'gravityformsvandar') . $payment_string . '

'; + ?>
- - + + - - + + - - + +
-
+
- '; @@ -951,222 +962,239 @@ public static function payment_entry_detail( $form_id, $entry ) { } // ------------------------GravityForms.IR------------------------- - public static function update_payment_entry( $form, $entry_id ) { - - check_admin_referer( 'gforms_save_entry', 'gforms_save_entry' ); + public static function update_payment_entry($form, $entry_id) + { + check_admin_referer('gforms_save_entry', 'gforms_save_entry'); - do_action( 'gf_gateway_update_entry' ); + do_action('gf_gateway_update_entry'); - $entry = GFPersian_payments::get_entry( $entry_id ); + $entry = GFPersian_payments::get_entry($entry_id); - $payment_gateway = rgar( $entry, "payment_method" ); + $payment_gateway = rgar($entry, "payment_method"); - if ( empty( $payment_gateway ) ) { + if (empty($payment_gateway)) { return; } - if ( $payment_gateway != "vandar" ) { + if ($payment_gateway != "vandar") { return; } - $payment_status = rgpost( "payment_status" ); - if ( empty( $payment_status ) ) { - $payment_status = rgar( $entry, "payment_status" ); + $payment_status = rgpost("payment_status"); + if (empty($payment_status)) { + $payment_status = rgar($entry, "payment_status"); } - $payment_amount = rgpost( "payment_amount" ); - $payment_transaction = rgpost( "vandar_transaction_id" ); - $payment_date_Checker = $payment_date = rgpost( "payment_date" ); - - list( $date, $time ) = explode( " ", $payment_date ); - list( $Y, $m, $d ) = explode( "-", $date ); - list( $H, $i, $s ) = explode( ":", $time ); - $miladi = GF_jalali_to_gregorian( $Y, $m, $d ); - - $date = new DateTime( "$miladi[0]-$miladi[1]-$miladi[2] $H:$i:$s" ); - $payment_date = $date->format( 'Y-m-d H:i:s' ); + $payment_amount = rgpost("payment_amount"); + $payment_transaction = rgpost("vandar_transaction_id"); + $payment_date_Checker = $payment_date = rgpost("payment_date"); + + // Validate and sanitize the payment date + if (!empty($payment_date)) { + $datetime_parts = explode(" ", $payment_date); + if (count($datetime_parts) == 2) { + list($date, $time) = $datetime_parts; + $date_parts = explode("-", $date); + $time_parts = explode(":", $time); + + if (count($date_parts) == 3 && count($time_parts) == 3) { + list($Y, $m, $d) = $date_parts; + list($H, $i, $s) = $time_parts; + + // Convert Jalali date to Gregorian + $miladi = GF_jalali_to_gregorian($Y, $m, $d); + + // Validate the converted date and time + if (checkdate($miladi[1], $miladi[2], $miladi[0]) && $H >= 0 && $H < 24 && $i >= 0 && $i < 60 && $s >= 0 && $s < 60) { + $date = new DateTime("$miladi[0]-$miladi[1]-$miladi[2] $H:$i:$s"); + $payment_date = $date->format('Y-m-d H:i:s'); + } else { + // Handle invalid date-time + $payment_date = null; + } + } else { + // Handle invalid date-time + $payment_date = null; + } + } else { + // Handle invalid date-time + $payment_date = null; + } + } - if ( empty( $payment_date_Checker ) ) { - if ( ! empty( $entry["payment_date"] ) ) { + if (empty($payment_date)) { + if (!empty($entry["payment_date"])) { $payment_date = $entry["payment_date"]; } else { - $payment_date = rgar( $entry, "date_created" ); + $payment_date = rgar($entry, "date_created"); } } else { - $payment_date = date( "Y-m-d H:i:s", strtotime( $payment_date ) ); - $date = new DateTime( $payment_date ); - $tzb = get_option( 'gmt_offset' ); - $tzn = abs( $tzb ) * 3600; - $tzh = intval( gmdate( "H", $tzn ) ); - $tzm = intval( gmdate( "i", $tzn ) ); - if ( intval( $tzb ) < 0 ) { - $date->add( new DateInterval( 'P0DT' . $tzh . 'H' . $tzm . 'M' ) ); + $payment_date = date("Y-m-d H:i:s", strtotime($payment_date)); + $date = new DateTime($payment_date); + $tzb = get_option('gmt_offset'); + $tzn = abs($tzb) * 3600; + $tzh = intval(gmdate("H", $tzn)); + $tzm = intval(gmdate("i", $tzn)); + if (intval($tzb) < 0) { + $date->add(new DateInterval('P0DT' . $tzh . 'H' . $tzm . 'M')); } else { - $date->sub( new DateInterval( 'P0DT' . $tzh . 'H' . $tzm . 'M' ) ); + $date->sub(new DateInterval('P0DT' . $tzh . 'H' . $tzm . 'M')); } - $payment_date = $date->format( 'Y-m-d H:i:s' ); + $payment_date = $date->format('Y-m-d H:i:s'); } global $current_user; - $user_id = 0; - $user_name = __( "مهمان", 'gravityformsvandar' ); - if ( $current_user && $user_data = get_userdata( $current_user->ID ) ) { - $user_id = $current_user->ID; + $user_id = 0; + $user_name = __("مهمان", 'gravityformsvandar'); + if ($current_user && $user_data = get_userdata($current_user->ID)) { + $user_id = $current_user->ID; $user_name = $user_data->display_name; } $entry["payment_status"] = $payment_status; $entry["payment_amount"] = $payment_amount; - $entry["payment_date"] = $payment_date; + $entry["payment_date"] = $payment_date; $entry["transaction_id"] = $payment_transaction; - if ( $payment_status == 'Paid' || $payment_status == 'Active' ) { + if ($payment_status == 'Paid' || $payment_status == 'Active') { $entry["is_fulfilled"] = 1; } else { $entry["is_fulfilled"] = 0; } - GFAPI::update_entry( $entry ); + GFAPI::update_entry($entry); $new_status = ''; - switch ( rgar( $entry, "payment_status" ) ) { - case "Active" : - $new_status = __( 'موفق', 'gravityformsvandar' ); + switch (rgar($entry, "payment_status")) { + case "Active": + $new_status = __('موفق', 'gravityformsvandar'); break; - case "Paid" : - $new_status = __( 'موفق', 'gravityformsvandar' ); + case "Paid": + $new_status = __('موفق', 'gravityformsvandar'); break; - case "Cancelled" : - $new_status = __( 'منصرف شده', 'gravityformsvandar' ); + case "Cancelled": + $new_status = __('منصرف شده', 'gravityformsvandar'); break; - case "Failed" : - $new_status = __( 'ناموفق', 'gravityformsvandar' ); + case "Failed": + $new_status = __('ناموفق', 'gravityformsvandar'); break; - case "Processing" : - $new_status = __( 'معلق', 'gravityformsvandar' ); + case "Processing": + $new_status = __('معلق', 'gravityformsvandar'); break; } - RGFormsModel::add_note( $entry["id"], $user_id, $user_name, sprintf( __( "اطلاعات تراکنش به صورت دستی ویرایش شد . وضعیت : %s - مبلغ : %s - کد رهگیری : %s - تاریخ : %s", "gravityformsvandar" ), $new_status, GFCommon::to_money( $entry["payment_amount"], $entry["currency"] ), $payment_transaction, $entry["payment_date"] ) ); - + RGFormsModel::add_note($entry["id"], $user_id, $user_name, sprintf(__("اطلاعات تراکنش به صورت دستی ویرایش شد . وضعیت : %s - مبلغ : %s - کد رهگیری : %s - تاریخ : %s", "gravityformsvandar"), $new_status, GFCommon::to_money($entry["payment_amount"], $entry["currency"]), $payment_transaction, $entry["payment_date"])); } + // #2 // ------------------------GravityForms.IR------------------------- - public static function settings_page() { + public static function settings_page() + { - if ( ! extension_loaded( 'curl' ) ) { - _e( 'ماژول curl بر روی سرور شما فعال نیست. برای استفاده از درگاه باید آن را فعال نمایید. با مدیر هاست تماس بگیرید.', 'gravityformsvandar' ); + if (!extension_loaded('curl')) { + _e('ماژول curl بر روی سرور شما فعال نیست. برای استفاده از درگاه باید آن را فعال نمایید. با مدیر هاست تماس بگیرید.', 'gravityformsvandar'); return; } - if ( rgpost( "uninstall" ) ) { - check_admin_referer( "uninstall", "gf_vandar_uninstall" ); + if (rgpost("uninstall")) { + check_admin_referer("uninstall", "gf_vandar_uninstall"); self::uninstall(); - echo '
' . __( "درگاه با موفقیت غیرفعال شد و اطلاعات مربوط به آن نیز از بین رفت برای فعالسازی مجدد میتوانید از طریق افزونه های وردپرس اقدام نمایید .", "gravityformsvandar" ) . '
'; + echo '
' . __("درگاه با موفقیت غیرفعال شد و اطلاعات مربوط به آن نیز از بین رفت برای فعالسازی مجدد میتوانید از طریق افزونه های وردپرس اقدام نمایید .", "gravityformsvandar") . '
'; return; - } else if ( isset( $_POST["gf_vandar_submit"] ) ) { + } else if (isset($_POST["gf_vandar_submit"])) { - check_admin_referer( "update", "gf_vandar_update" ); + check_admin_referer("update", "gf_vandar_update"); $settings = array( - "api_p" => rgpost( 'gf_vandar_api_p' ), -// "mode" => rgpost( 'gf_vandar_mode' ), - "gname" => rgpost( 'gf_vandar_gname' ), + "api_p" => rgpost('gf_vandar_api_p'), + // "mode" => rgpost( 'gf_vandar_mode' ), + "gname" => rgpost('gf_vandar_gname'), ); - update_option( "gf_vandar_settings", array_map( 'sanitize_text_field', $settings ) ); - if ( isset( $_POST["gf_vandar_configured"] ) ) { - update_option( "gf_vandar_configured", sanitize_text_field( $_POST["gf_vandar_configured"] ) ); + update_option("gf_vandar_settings", array_map('sanitize_text_field', $settings)); + if (isset($_POST["gf_vandar_configured"])) { + update_option("gf_vandar_configured", sanitize_text_field($_POST["gf_vandar_configured"])); } else { - delete_option( "gf_vandar_configured" ); + delete_option("gf_vandar_configured"); } } else { - $settings = get_option( "gf_vandar_settings" ); + $settings = get_option("gf_vandar_settings"); } - if ( ! empty( $_POST ) ) { + if (!empty($_POST)) { - if ( isset( $_POST["gf_vandar_configured"] ) && ( $Response = self::Request( 'valid_checker', '', '', '' ) ) && $Response != false ) { + if (isset($_POST["gf_vandar_configured"]) && ($Response = self::Request('valid_checker', '', '', '')) && $Response != false) { - if ( $Response === true ) { - echo '
' . __( "ارتباط با درگاه برقرار شد و اطلاعات وارد شده صحیح است .", "gravityformsvandar" ) . '
'; - } else if ( $Response == 'sandbox' ) { - echo '
' . __( "در حالت تستی نیاز به ورود اطلاعات صحیح نمی باشد .", "gravityformsvandar" ) . '
'; + if ($Response === true) { + echo '
' . __("ارتباط با درگاه برقرار شد و اطلاعات وارد شده صحیح است .", "gravityformsvandar") . '
'; + } else if ($Response == 'sandbox') { + echo '
' . __("در حالت تستی نیاز به ورود اطلاعات صحیح نمی باشد .", "gravityformsvandar") . '
'; } else { echo '
' . $Response . '
'; } - } else { - echo '
' . __( "تنظیمات ذخیره شدند .", "gravityformsvandar" ) . '
'; + echo '
' . __("تنظیمات ذخیره شدند .", "gravityformsvandar") . '
'; } - } else if ( isset( $_GET['subview'] ) && $_GET['subview'] == 'gf_vandar' && isset( $_GET['updated'] ) ) { - echo '
' . __( "تنظیمات ذخیره شدند .", "gravityformsvandar" ) . '
'; + } else if (isset($_GET['subview']) && $_GET['subview'] == 'gf_vandar' && isset($_GET['updated'])) { + echo '
' . __("تنظیمات ذخیره شدند .", "gravityformsvandar") . '
'; } ?>
- +

- - - - + + + +

- + - - +
- /> - + /> +
+ - +
- +
"/>" />
@@ -1176,59 +1204,61 @@ class="button-primary" + ?>

- +

-
+
'; - echo apply_filters( "gform_vandar_uninstall_button", $uninstall_button ); + $uninstall_button = ''; + echo apply_filters("gform_vandar_uninstall_button", $uninstall_button); ?>
- + wp_register_style('gform_admin_vandar', GFCommon::get_base_url() . '/css/admin.css'); + wp_print_styles(array('jquery-ui-styles', 'gform_admin_vandar', 'wp-pointer')); ?> - +