From f90fda9a16d595a8f5883a7d356d8270d24ac88c Mon Sep 17 00:00:00 2001 From: david Date: Wed, 5 Oct 2011 11:15:38 +0000 Subject: [PATCH] =?UTF-8?q?Actualizaci=C3=B3n=20Contactforms=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.FundacionLQDVI_Web/trunk@43 77ab8c26-3d69-2c4d-86f2-786f4ba54905 --- .../plugins/contact-form-7/admin/admin.php | 370 ------- .../plugins/contact-form-7/admin/edit.php | 351 ------- .../plugins/contact-form-7/admin/scripts.js | 116 --- .../contact-form-7/admin/styles-rtl.css | 22 - .../plugins/contact-form-7/admin/styles.css | 248 ----- .../contact-form-7/admin/taggenerator.js | 262 ----- .../contact-form-7/images/ajax-loader.gif | Bin 847 -> 0 bytes .../contact-form-7/images/dropdown.gif | Bin 67 -> 0 bytes .../contact-form-7/includes/classes.php | 646 ------------- .../contact-form-7/includes/controller.php | 288 ------ .../contact-form-7/includes/formatting.php | 144 --- .../contact-form-7/includes/functions.php | 226 ----- .../plugins/contact-form-7/includes/pipe.php | 67 -- .../contact-form-7/includes/shortcodes.php | 185 ---- .../contact-form-7/includes/taggenerator.php | 49 - .../plugins/contact-form-7/jquery.form.js | 911 ------------------ .../contact-form-7/languages/readme.txt | 9 - .../contact-form-7/languages/wpcf7-af.mo | Bin 14535 -> 0 bytes .../contact-form-7/languages/wpcf7-ar.mo | Bin 17781 -> 0 bytes .../contact-form-7/languages/wpcf7-bg_BG.mo | Bin 5969 -> 0 bytes .../contact-form-7/languages/wpcf7-bn_BD.mo | Bin 10451 -> 0 bytes .../contact-form-7/languages/wpcf7-bs.mo | Bin 7278 -> 0 bytes .../contact-form-7/languages/wpcf7-ca.mo | Bin 10044 -> 0 bytes .../contact-form-7/languages/wpcf7-cs_CZ.mo | Bin 14428 -> 0 bytes .../contact-form-7/languages/wpcf7-da_DK.mo | Bin 15067 -> 0 bytes .../contact-form-7/languages/wpcf7-de_DE.mo | Bin 15515 -> 0 bytes .../contact-form-7/languages/wpcf7-el.mo | Bin 11506 -> 0 bytes .../contact-form-7/languages/wpcf7-es_ES.mo | Bin 7821 -> 0 bytes .../contact-form-7/languages/wpcf7-et.mo | Bin 14053 -> 0 bytes .../contact-form-7/languages/wpcf7-fa_IR.mo | Bin 12005 -> 0 bytes .../contact-form-7/languages/wpcf7-fi.mo | Bin 14328 -> 0 bytes .../contact-form-7/languages/wpcf7-fr_FR.mo | Bin 15486 -> 0 bytes .../contact-form-7/languages/wpcf7-gl_ES.mo | Bin 14679 -> 0 bytes .../contact-form-7/languages/wpcf7-he_IL.mo | Bin 10812 -> 0 bytes .../contact-form-7/languages/wpcf7-hi_IN.mo | Bin 21274 -> 0 bytes .../contact-form-7/languages/wpcf7-hr.mo | Bin 7313 -> 0 bytes .../contact-form-7/languages/wpcf7-hu_HU.mo | Bin 15443 -> 0 bytes .../contact-form-7/languages/wpcf7-hy_AM.mo | Bin 18925 -> 0 bytes .../contact-form-7/languages/wpcf7-id_ID.mo | Bin 11604 -> 0 bytes .../contact-form-7/languages/wpcf7-it_IT.mo | Bin 15486 -> 0 bytes .../contact-form-7/languages/wpcf7-ja.mo | Bin 17380 -> 0 bytes .../contact-form-7/languages/wpcf7-ka_GE.mo | Bin 5180 -> 0 bytes .../contact-form-7/languages/wpcf7-ko_KR.mo | Bin 8450 -> 0 bytes .../contact-form-7/languages/wpcf7-lt_LT.mo | Bin 9432 -> 0 bytes .../contact-form-7/languages/wpcf7-lv.mo | Bin 14765 -> 0 bytes .../contact-form-7/languages/wpcf7-mk_MK.mo | Bin 18685 -> 0 bytes .../contact-form-7/languages/wpcf7-ml_IN.mo | Bin 21032 -> 0 bytes .../contact-form-7/languages/wpcf7-ms_MY.mo | Bin 14623 -> 0 bytes .../contact-form-7/languages/wpcf7-nb_NO.mo | Bin 14412 -> 0 bytes .../contact-form-7/languages/wpcf7-nl_NL.mo | Bin 14739 -> 0 bytes .../contact-form-7/languages/wpcf7-pl_PL.mo | Bin 14827 -> 0 bytes .../contact-form-7/languages/wpcf7-pt_BR.mo | Bin 14789 -> 0 bytes .../contact-form-7/languages/wpcf7-pt_PT.mo | Bin 5130 -> 0 bytes .../contact-form-7/languages/wpcf7-ro_RO.mo | Bin 15316 -> 0 bytes .../contact-form-7/languages/wpcf7-ru_RU.mo | Bin 14735 -> 0 bytes .../contact-form-7/languages/wpcf7-si_LK.mo | Bin 22639 -> 0 bytes .../contact-form-7/languages/wpcf7-sk.mo | Bin 12424 -> 0 bytes .../contact-form-7/languages/wpcf7-sl_SI.mo | Bin 3786 -> 0 bytes .../contact-form-7/languages/wpcf7-sq.mo | Bin 5017 -> 0 bytes .../contact-form-7/languages/wpcf7-sr_RS.mo | Bin 18156 -> 0 bytes .../contact-form-7/languages/wpcf7-sv_SE.mo | Bin 8143 -> 0 bytes .../contact-form-7/languages/wpcf7-ta.mo | Bin 26093 -> 0 bytes .../contact-form-7/languages/wpcf7-th.mo | Bin 21109 -> 0 bytes .../contact-form-7/languages/wpcf7-tr_TR.mo | Bin 9570 -> 0 bytes .../contact-form-7/languages/wpcf7-uk.mo | Bin 14648 -> 0 bytes .../contact-form-7/languages/wpcf7-vi.mo | Bin 14084 -> 0 bytes .../contact-form-7/languages/wpcf7-zh_CN.mo | Bin 14227 -> 0 bytes .../contact-form-7/languages/wpcf7-zh_TW.mo | Bin 15342 -> 0 bytes .../contact-form-7/languages/wpcf7.pot | 846 ---------------- .../plugins/contact-form-7/license.txt | 339 ------- .../contact-form-7/modules/acceptance.php | 186 ---- .../contact-form-7/modules/captcha.php | 490 ---------- .../contact-form-7/modules/checkbox.php | 246 ----- .../plugins/contact-form-7/modules/file.php | 349 ------- .../plugins/contact-form-7/modules/icl.php | 79 -- .../plugins/contact-form-7/modules/quiz.php | 214 ---- .../contact-form-7/modules/response.php | 17 - .../plugins/contact-form-7/modules/select.php | 193 ---- .../modules/special-mail-tags.php | 73 -- .../plugins/contact-form-7/modules/submit.php | 97 -- .../plugins/contact-form-7/modules/text.php | 210 ---- .../contact-form-7/modules/textarea.php | 172 ---- .../plugins/contact-form-7/readme.txt | 160 --- .../plugins/contact-form-7/screenshot-1.png | Bin 121057 -> 0 bytes .../plugins/contact-form-7/scripts.js | 198 ---- .../plugins/contact-form-7/settings.php | 111 --- .../plugins/contact-form-7/styles-rtl.css | 12 - .../plugins/contact-form-7/styles.css | 65 -- .../plugins/contact-form-7/uninstall.php | 18 - .../contact-form-7/wp-contact-form-7.php | 69 -- 90 files changed, 8038 deletions(-) delete mode 100644 src/wp-content/plugins/contact-form-7/admin/admin.php delete mode 100644 src/wp-content/plugins/contact-form-7/admin/edit.php delete mode 100644 src/wp-content/plugins/contact-form-7/admin/scripts.js delete mode 100644 src/wp-content/plugins/contact-form-7/admin/styles-rtl.css delete mode 100644 src/wp-content/plugins/contact-form-7/admin/styles.css delete mode 100644 src/wp-content/plugins/contact-form-7/admin/taggenerator.js delete mode 100644 src/wp-content/plugins/contact-form-7/images/ajax-loader.gif delete mode 100644 src/wp-content/plugins/contact-form-7/images/dropdown.gif delete mode 100644 src/wp-content/plugins/contact-form-7/includes/classes.php delete mode 100644 src/wp-content/plugins/contact-form-7/includes/controller.php delete mode 100644 src/wp-content/plugins/contact-form-7/includes/formatting.php delete mode 100644 src/wp-content/plugins/contact-form-7/includes/functions.php delete mode 100644 src/wp-content/plugins/contact-form-7/includes/pipe.php delete mode 100644 src/wp-content/plugins/contact-form-7/includes/shortcodes.php delete mode 100644 src/wp-content/plugins/contact-form-7/includes/taggenerator.php delete mode 100644 src/wp-content/plugins/contact-form-7/jquery.form.js delete mode 100644 src/wp-content/plugins/contact-form-7/languages/readme.txt delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-af.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ar.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-bg_BG.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-bn_BD.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-bs.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ca.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-cs_CZ.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-da_DK.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-de_DE.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-el.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-es_ES.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-et.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-fa_IR.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-fi.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-fr_FR.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-gl_ES.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-he_IL.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-hi_IN.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-hr.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-hu_HU.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-hy_AM.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-id_ID.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-it_IT.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ja.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ka_GE.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ko_KR.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-lt_LT.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-lv.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-mk_MK.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ml_IN.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ms_MY.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-nb_NO.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-nl_NL.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-pl_PL.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_BR.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_PT.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ro_RO.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ru_RU.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-si_LK.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-sk.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-sl_SI.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-sq.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-sr_RS.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-sv_SE.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-ta.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-th.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-tr_TR.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-uk.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-vi.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_CN.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_TW.mo delete mode 100644 src/wp-content/plugins/contact-form-7/languages/wpcf7.pot delete mode 100644 src/wp-content/plugins/contact-form-7/license.txt delete mode 100644 src/wp-content/plugins/contact-form-7/modules/acceptance.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/captcha.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/checkbox.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/file.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/icl.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/quiz.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/response.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/select.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/special-mail-tags.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/submit.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/text.php delete mode 100644 src/wp-content/plugins/contact-form-7/modules/textarea.php delete mode 100644 src/wp-content/plugins/contact-form-7/readme.txt delete mode 100644 src/wp-content/plugins/contact-form-7/screenshot-1.png delete mode 100644 src/wp-content/plugins/contact-form-7/scripts.js delete mode 100644 src/wp-content/plugins/contact-form-7/settings.php delete mode 100644 src/wp-content/plugins/contact-form-7/styles-rtl.css delete mode 100644 src/wp-content/plugins/contact-form-7/styles.css delete mode 100644 src/wp-content/plugins/contact-form-7/uninstall.php delete mode 100644 src/wp-content/plugins/contact-form-7/wp-contact-form-7.php diff --git a/src/wp-content/plugins/contact-form-7/admin/admin.php b/src/wp-content/plugins/contact-form-7/admin/admin.php deleted file mode 100644 index e4596dd2..00000000 --- a/src/wp-content/plugins/contact-form-7/admin/admin.php +++ /dev/null @@ -1,370 +0,0 @@ -initial = true; - } - - $title = trim( $_POST['wpcf7-title'] ); - - $form = trim( $_POST['wpcf7-form'] ); - - $mail = array( - 'subject' => trim( $_POST['wpcf7-mail-subject'] ), - 'sender' => trim( $_POST['wpcf7-mail-sender'] ), - 'body' => trim( $_POST['wpcf7-mail-body'] ), - 'recipient' => trim( $_POST['wpcf7-mail-recipient'] ), - 'additional_headers' => trim( $_POST['wpcf7-mail-additional-headers'] ), - 'attachments' => trim( $_POST['wpcf7-mail-attachments'] ), - 'use_html' => - isset( $_POST['wpcf7-mail-use-html'] ) && 1 == $_POST['wpcf7-mail-use-html'] - ); - - $mail_2 = array( - 'active' => - isset( $_POST['wpcf7-mail-2-active'] ) && 1 == $_POST['wpcf7-mail-2-active'], - 'subject' => trim( $_POST['wpcf7-mail-2-subject'] ), - 'sender' => trim( $_POST['wpcf7-mail-2-sender'] ), - 'body' => trim( $_POST['wpcf7-mail-2-body'] ), - 'recipient' => trim( $_POST['wpcf7-mail-2-recipient'] ), - 'additional_headers' => trim( $_POST['wpcf7-mail-2-additional-headers'] ), - 'attachments' => trim( $_POST['wpcf7-mail-2-attachments'] ), - 'use_html' => - isset( $_POST['wpcf7-mail-2-use-html'] ) && 1 == $_POST['wpcf7-mail-2-use-html'] - ); - - $messages = $contact_form->messages; - foreach ( wpcf7_messages() as $key => $arr ) { - $field_name = 'wpcf7-message-' . strtr( $key, '_', '-' ); - if ( isset( $_POST[$field_name] ) ) - $messages[$key] = trim( $_POST[$field_name] ); - } - - $additional_settings = trim( $_POST['wpcf7-additional-settings'] ); - - $query = array(); - $query['message'] = ( $contact_form->initial ) ? 'created' : 'saved'; - - $contact_form->title = $title; - $contact_form->form = $form; - $contact_form->mail = $mail; - $contact_form->mail_2 = $mail_2; - $contact_form->messages = $messages; - $contact_form->additional_settings = $additional_settings; - - $contact_form->save(); - - $query['contactform'] = $contact_form->id; - $redirect_to = wpcf7_admin_url( $query ); - wp_redirect( $redirect_to ); - exit(); - } elseif ( isset( $_POST['wpcf7-copy'] ) && wpcf7_admin_has_edit_cap() ) { - $id = $_POST['wpcf7-id']; - check_admin_referer( 'wpcf7-copy_' . $id ); - - $query = array(); - - if ( $contact_form = wpcf7_contact_form( $id ) ) { - $new_contact_form = $contact_form->copy(); - $new_contact_form->save(); - - $query['contactform'] = $new_contact_form->id; - $query['message'] = 'created'; - } else { - $query['contactform'] = $contact_form->id; - } - - $redirect_to = wpcf7_admin_url( $query ); - wp_redirect( $redirect_to ); - exit(); - } elseif ( isset( $_POST['wpcf7-delete'] ) && wpcf7_admin_has_edit_cap() ) { - $id = $_POST['wpcf7-id']; - check_admin_referer( 'wpcf7-delete_' . $id ); - - if ( $contact_form = wpcf7_contact_form( $id ) ) - $contact_form->delete(); - - $redirect_to = wpcf7_admin_url( array( 'message' => 'deleted' ) ); - wp_redirect( $redirect_to ); - exit(); - } elseif ( isset( $_GET['wpcf7-create-table'] ) ) { - check_admin_referer( 'wpcf7-create-table' ); - - $query = array(); - - if ( ! wpcf7_table_exists() && current_user_can( 'activate_plugins' ) ) { - wpcf7_install(); - if ( wpcf7_table_exists() ) { - $query['message'] = 'table_created'; - } else { - $query['message'] = 'table_not_created'; - } - } - - wp_redirect( wpcf7_admin_url( $query ) ); - exit(); - } - - add_menu_page( __( 'Contact Form 7', 'wpcf7' ), __( 'Contact', 'wpcf7' ), - WPCF7_ADMIN_READ_CAPABILITY, 'wpcf7', 'wpcf7_admin_management_page' ); - - add_submenu_page( 'wpcf7', __( 'Edit Contact Forms', 'wpcf7' ), __( 'Edit', 'wpcf7' ), - WPCF7_ADMIN_READ_CAPABILITY, 'wpcf7', 'wpcf7_admin_management_page' ); -} - -add_action( 'admin_print_styles', 'wpcf7_admin_enqueue_styles' ); - -function wpcf7_admin_enqueue_styles() { - global $plugin_page; - - if ( ! isset( $plugin_page ) || 'wpcf7' != $plugin_page ) - return; - - wp_enqueue_style( 'thickbox' ); - - wp_enqueue_style( 'contact-form-7-admin', wpcf7_plugin_url( 'admin/styles.css' ), - array(), WPCF7_VERSION, 'all' ); - - if ( 'rtl' == get_bloginfo( 'text_direction' ) ) { - wp_enqueue_style( 'contact-form-7-admin-rtl', - wpcf7_plugin_url( 'admin/styles-rtl.css' ), array(), WPCF7_VERSION, 'all' ); - } -} - -add_action( 'admin_enqueue_scripts', 'wpcf7_admin_enqueue_scripts' ); - -function wpcf7_admin_enqueue_scripts() { - global $plugin_page; - - if ( ! isset( $plugin_page ) || 'wpcf7' != $plugin_page ) - return; - - wp_enqueue_script( 'thickbox' ); - - wp_enqueue_script( 'wpcf7-admin-taggenerator', wpcf7_plugin_url( 'admin/taggenerator.js' ), - array( 'jquery' ), WPCF7_VERSION, true ); - - wp_enqueue_script( 'wpcf7-admin', wpcf7_plugin_url( 'admin/scripts.js' ), - array( 'jquery', 'wpcf7-admin-taggenerator' ), WPCF7_VERSION, true ); - wp_localize_script( 'wpcf7-admin', '_wpcf7L10n', array( - 'generateTag' => __( 'Generate Tag', 'wpcf7' ), - 'show' => __( "Show", 'wpcf7' ), - 'hide' => __( "Hide", 'wpcf7' ) ) ); -} - -add_action( 'admin_footer', 'wpcf7_admin_footer' ); - -function wpcf7_admin_footer() { - global $plugin_page; - - if ( ! isset( $plugin_page ) || 'wpcf7' != $plugin_page ) - return; - -?> - -id; - $cf = wpcf7_contact_form( $current ); - } - - require_once WPCF7_PLUGIN_DIR . '/admin/edit.php'; -} - -/* Install and default settings */ - -add_action( 'activate_' . WPCF7_PLUGIN_BASENAME, 'wpcf7_install' ); - -function wpcf7_install() { - global $wpdb, $wpcf7; - - if ( wpcf7_table_exists() ) - return; // Exists already - - $charset_collate = ''; - if ( $wpdb->has_cap( 'collation' ) ) { - if ( ! empty( $wpdb->charset ) ) - $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; - if ( ! empty( $wpdb->collate ) ) - $charset_collate .= " COLLATE $wpdb->collate"; - } - - $wpdb->query( "CREATE TABLE IF NOT EXISTS $wpcf7->contactforms ( - cf7_unit_id bigint(20) unsigned NOT NULL auto_increment, - title varchar(200) NOT NULL default '', - form text NOT NULL, - mail text NOT NULL, - mail_2 text NOT NULL, - messages text NOT NULL, - additional_settings text NOT NULL, - PRIMARY KEY (cf7_unit_id)) $charset_collate;" ); - - if ( ! wpcf7_table_exists() ) - return false; // Failed to create - - $legacy_data = get_option( 'wpcf7' ); - if ( is_array( $legacy_data ) - && is_array( $legacy_data['contact_forms'] ) && $legacy_data['contact_forms'] ) { - foreach ( $legacy_data['contact_forms'] as $key => $value ) { - $wpdb->insert( $wpcf7->contactforms, array( - 'cf7_unit_id' => $key, - 'title' => $value['title'], - 'form' => maybe_serialize( $value['form'] ), - 'mail' => maybe_serialize( $value['mail'] ), - 'mail_2' => maybe_serialize( $value['mail_2'] ), - 'messages' => maybe_serialize( $value['messages'] ), - 'additional_settings' => maybe_serialize( $value['additional_settings'] ) - ), array( '%d', '%s', '%s', '%s', '%s', '%s', '%s' ) ); - } - } else { - wpcf7_load_plugin_textdomain(); - - $wpdb->insert( $wpcf7->contactforms, array( - 'title' => __( 'Contact form', 'wpcf7' ) . ' 1', - 'form' => maybe_serialize( wpcf7_default_form_template() ), - 'mail' => maybe_serialize( wpcf7_default_mail_template() ), - 'mail_2' => maybe_serialize ( wpcf7_default_mail_2_template() ), - 'messages' => maybe_serialize( wpcf7_default_messages_template() ) ) ); - } -} - -/* Misc */ - -add_filter( 'plugin_action_links', 'wpcf7_plugin_action_links', 10, 2 ); - -function wpcf7_plugin_action_links( $links, $file ) { - if ( $file != WPCF7_PLUGIN_BASENAME ) - return $links; - - $url = wpcf7_admin_url( array( 'page' => 'wpcf7' ) ); - - $settings_link = '' - . esc_html( __( 'Settings', 'wpcf7' ) ) . ''; - - array_unshift( $links, $settings_link ); - - return $links; -} - -add_action( 'wpcf7_admin_before_subsubsub', 'wpcf7_cf7com_links', 9 ); - -function wpcf7_cf7com_links( &$contact_form ) { - $links = ''; - - echo apply_filters( 'wpcf7_cf7com_links', $links ); -} - -add_action( 'wpcf7_admin_before_subsubsub', 'wpcf7_updated_message' ); - -function wpcf7_updated_message( &$contact_form ) { - if ( ! isset( $_GET['message'] ) ) - return; - - switch ( $_GET['message'] ) { - case 'created': - $updated_message = __( "Contact form created.", 'wpcf7' ); - break; - case 'saved': - $updated_message = __( "Contact form saved.", 'wpcf7' ); - break; - case 'deleted': - $updated_message = __( "Contact form deleted.", 'wpcf7' ); - break; - case 'table_created': - $updated_message = __( "Database table created.", 'wpcf7' ); - break; - case 'table_not_created': - $updated_message = __( "Failed to create database table.", 'wpcf7' ); - break; - } - - if ( ! $updated_message ) - return; - -?> -

-= 20 ) - $show_link = false; - - $show_link = apply_filters( 'wpcf7_show_donation_link', $show_link ); - - if ( ! $show_link ) - return; - - $texts = array( - __( "Contact Form 7 needs your support. Please donate today.", 'wpcf7' ), - __( "Your contribution is needed for making this plugin better.", 'wpcf7' ) ); - - $text = $texts[array_rand( $texts )]; - -?> -
-

-
- \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/admin/edit.php b/src/wp-content/plugins/contact-form-7/admin/edit.php deleted file mode 100644 index 2877fcc5..00000000 --- a/src/wp-content/plugins/contact-form-7/admin/edit.php +++ /dev/null @@ -1,351 +0,0 @@ - 1 ) ); - $create_table_link_url = wp_nonce_url( $create_table_link_url, 'wpcf7-create-table' ); - $message = sprintf( - __( 'The database table for Contact Form 7 does not exist. You must create the table for it to work.', 'wpcf7' ), - $create_table_link_url ); - } else { - $message = __( "The database table for Contact Form 7 does not exist.", 'wpcf7' ); - } -?> -
- -

-
-

-
-
-
- - - -

- - - - - -
- - - - -
- - - - - - - - - -
-
- /> - - -

-
- - -

- - - -
- -
- - - - - -
-
- - - - - - - - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - -
- -
-
- -
- -
-
- -
- -
-
- -
- -
- -
-
- -
- -
-
- -
- -
- -
- mail['use_html'] ) ? ' checked="checked"' : ''; ?> /> - -
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - -
- mail_2['active'] ) ? ' checked="checked"' : ''; ?> /> - -
- -
-
- -
- -
-
- -
- -
-
- -
- -
- -
-
- -
- -
-
- -
- -
- -
- mail_2['use_html'] ) ? ' checked="checked"' : ''; ?> /> - -
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - -
-
- - $arr ) : - $field_name = 'wpcf7-message-' . strtr( $key, '_', '-' ); -?> -
-
- -
- - - -
-
- - - - - - - - - - - - - - - -
-
- -
-
- - - - - - - - - - - - - -
-
- -
-
- - - -
- - - -
- - - - diff --git a/src/wp-content/plugins/contact-form-7/admin/scripts.js b/src/wp-content/plugins/contact-form-7/admin/scripts.js deleted file mode 100644 index dee427f5..00000000 --- a/src/wp-content/plugins/contact-form-7/admin/scripts.js +++ /dev/null @@ -1,116 +0,0 @@ -(function($) { - - $(function() { - try { - $.extend($.tgPanes, _wpcf7.tagGenerators); - $('#taggenerator').tagGenerator(_wpcf7L10n.generateTag, - { dropdownIconUrl: _wpcf7.pluginUrl + '/images/dropdown.gif' }); - - $('input#wpcf7-title:enabled').css({ - cursor: 'pointer' - }); - - $('input#wpcf7-title').mouseover(function() { - $(this).not('.focus').css({ - 'background-color': '#ffffdd' - }); - }); - - $('input#wpcf7-title').mouseout(function() { - $(this).css({ - 'background-color': '#fff' - }); - }); - - $('input#wpcf7-title').focus(function() { - $(this).addClass('focus'); - $(this).css({ - cursor: 'text', - color: '#333', - border: '1px solid #777', - font: 'normal 13px Verdana, Arial, Helvetica, sans-serif', - 'background-color': '#fff' - }); - }); - - $('input#wpcf7-title').blur(function() { - $(this).removeClass('focus'); - $(this).css({ - cursor: 'pointer', - color: '#555', - border: 'none', - font: 'bold 20px serif', - 'background-color': '#fff' - }); - }); - - $('input#wpcf7-title').change(function() { - updateTag(); - }); - - updateTag(); - - if ($.support.objectAll) { - if (! $('#wpcf7-mail-2-active').is(':checked')) - $('#mail-2-fields').hide(); - - $('#wpcf7-mail-2-active').click(function() { - if ($('#mail-2-fields').is(':hidden') - && $('#wpcf7-mail-2-active').is(':checked')) { - $('#mail-2-fields').slideDown('fast'); - } else if ($('#mail-2-fields').is(':visible') - && $('#wpcf7-mail-2-active').not(':checked')) { - $('#mail-2-fields').slideUp('fast'); - } - }); - } - - $('#message-fields-toggle-switch').text(_wpcf7L10n.show); - $('#message-fields').hide(); - - $('#message-fields-toggle-switch').click(function() { - if ($('#message-fields').is(':hidden')) { - $('#message-fields').slideDown('fast'); - $('#message-fields-toggle-switch').text(_wpcf7L10n.hide); - } else { - $('#message-fields').hide('fast'); - $('#message-fields-toggle-switch').text(_wpcf7L10n.show); - } - }); - - if ('' == $.trim($('#wpcf7-additional-settings').text())) { - $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.show); - $('#additional-settings-fields').hide(); - } else { - $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.hide); - $('#additional-settings-fields').show(); - } - - $('#additional-settings-fields-toggle-switch').click(function() { - if ($('#additional-settings-fields').is(':hidden')) { - $('#additional-settings-fields').slideDown('fast'); - $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.hide); - } else { - $('#additional-settings-fields').hide('fast'); - $('#additional-settings-fields-toggle-switch').text(_wpcf7L10n.show); - } - }); - - } catch (e) { - } - }); - - function updateTag() { - var title = $('input#wpcf7-title').val(); - - if (title) - title = title.replace(/["'\[\]]/g, ''); - - $('input#wpcf7-title').val(title); - var current = $('input#wpcf7-id').val(); - var tag = '[contact-form ' + current + ' "' + title + '"]'; - - $('input#contact-form-anchor-text').val(tag); - } - -})(jQuery); \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/admin/styles-rtl.css b/src/wp-content/plugins/contact-form-7/admin/styles-rtl.css deleted file mode 100644 index 831d02b9..00000000 --- a/src/wp-content/plugins/contact-form-7/admin/styles-rtl.css +++ /dev/null @@ -1,22 +0,0 @@ -ul.subsubsub li.addnew { - margin-left: 0; - margin-right: 0.5em; -} -div.save-contact-form { - direction: rtl; -} -div.actions-link { - right: auto; - left: 0; -} -span#message-fields-toggle-switch { - margin-left: 0; - margin-right: 1em; -} -div.tg-pane table caption { - text-align: right; -} -div.tg-dropdown { - left: auto; - right: 0; -} \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/admin/styles.css b/src/wp-content/plugins/contact-form-7/admin/styles.css deleted file mode 100644 index 958de7c9..00000000 --- a/src/wp-content/plugins/contact-form-7/admin/styles.css +++ /dev/null @@ -1,248 +0,0 @@ -div.wpcf7 div.cf7com-links { - text-align: right; - font-size: .8em; - margin-top: -1.6em; -} - -div.wpcf7 div.cf7com-links a { - text-decoration: none; -} - -div.wpcf7 div.donation { - border-width: 1px; - border-style: solid; - padding: 0 0.6em; - margin: 5px 0 15px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - background-color: #ffffe0; - border-color: #e6db55; - text-align: center; -} - -div.wpcf7 div.donation p { - margin: .7em 0; - line-height: 1; - padding: 2px; - font-size: 107%; -} - -div.wpcf7 div.donation p a { - font-weight: bold; - color: #3f3f3f; -} - -div.wpcf7 div.donation p a.button { - margin-left: 1em; -} - -div.wpcf7 ul.subsubsub { - white-space: normal; -} - -ul.subsubsub li.addnew { - margin-left: 0.5em; -} - -ul.subsubsub li.addnew a { - color: #e6255b; -} - -ul.subsubsub li.addnew a:hover, -ul.subsubsub li.addnew a:active { - color: #999; -} - -div.save-contact-form { - padding: 1.4em 0 0 0; - text-align: right; -} - -div.actions-link { - position: absolute; - top: 0; - right: 0; - margin: 0; - padding: 0; -} - -div.actions-link input { - padding: 0; - margin: 0; - border: none; - background-color: #fff; - font-size: 11px; - cursor: pointer; -} - -div.actions-link input.copy { - color: #006505; -} - -div.actions-link input.delete { - color: #bc0b0b; -} - -input#wpcf7-title { - color: #555; - background-color: #fff; - border: none; - font: bold 20px serif; -} - -p.tagcode { - color: #333; - margin: 2ex 0 1ex 1em; -} - -input#contact-form-anchor-text { - color: #fff; - background: #7e4e0b; - border: none; - width: 99%; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -span#message-fields-toggle-switch, span#additional-settings-fields-toggle-switch { - margin-left: 1em; - font-weight: normal; - font-size: smaller; - color: #2583ad; - cursor: pointer; -} - -div.pseudo-hr { - border-bottom: 1px solid #fff; - margin: 0.7em 0; -} - -input, textarea { - border: 1px solid #dfdfdf; -} - -input.wide { - width: 100%; -} - -textarea { - width: 100%; -} - -label.disabled { - color: #777; -} - -div.message-field { - margin: .2em 0 .4em; -} - -div.tag-generator { - position: relative; - background: #fff; - padding: 5px 0 5px 1px; -} - -div.tg-pane { - border: 1px dashed #999; - background: #f1f1f1; - margin: 1ex 0 0 0; - padding: 10px; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -div.tg-pane table { - width: 100%; - margin: 0 0 0.7em 0; -} - -div.tg-pane table caption { - text-align: left; - padding: 0 0 0.2em 0; - font-weight: bolder; - color: #777; -} - -div.tg-pane table code { - background-color: inherit; -} - -div.tg-pane table td { - vertical-align: top; - width: 50%; - border: none; -} - -div.tg-pane input.tag, div.tg-pane input.mail-tag { - width: 100%; - border: none; - color: #fff; - background-color: #7e4e0b; - -moz-border-radius: 6px; - -khtml-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; -} - -div.tg-pane input.mail-tag { - width: 50%; - background-color: #404f03; -} - -div.tg-mail-tag { - margin-top: 2.4em; - text-align: right; -} - -div.tg-pane span.arrow { - font-family: monospace; - font-size: 1.2em; - color: #333; -} - -div.tg-pane input.tg-name { - border-color: #555; -} - -div.tg-pane input.oneline { - width: 98%; - font-size: smaller; -} - -div.tg-pane textarea { - width: 98%; - height: 100px; - font-size: smaller; -} - -div.tg-pane div.tg-tag { - margin: .4em 0; -} - -div.tg-dropdown { - position: absolute; - top: 26px; - left: 0; - z-index: 10; - border: 1px solid #ddd; -} - -span.tg-closebutton { - color: #777; - font: bold 18px monospace; - padding: 1px 4px; - cursor: pointer; -} - -div.tg-panetitle { - font: bold 132% sans-serif; - margin: 0 0 10px; - color: #777; -} \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/admin/taggenerator.js b/src/wp-content/plugins/contact-form-7/admin/taggenerator.js deleted file mode 100644 index dc01fe9e..00000000 --- a/src/wp-content/plugins/contact-form-7/admin/taggenerator.js +++ /dev/null @@ -1,262 +0,0 @@ -(function($) { - - $.fn.tagGenerator = function(title, options) { - var menu = $('
'); - - var selector = $('' + title + ''); - - selector.css({ - border: '1px solid #ddd', - padding: '2px 4px', - background: '#fff url( ../wp-admin/images/fade-butt.png ) repeat-x 0 0', - '-moz-border-radius': '3px', - '-khtml-border-radius': '3px', - '-webkit-border-radius': '3px', - 'border-radius': '3px' - }); - - selector.mouseover(function() { - $(this).css({ 'border-color': '#bbb' }); - }); - selector.mouseout(function() { - $(this).css({ 'border-color': '#ddd' }); - }); - selector.mousedown(function() { - $(this).css({ background: '#ddd' }); - }); - selector.mouseup(function() { - $(this).css({ - background: '#fff url( ../wp-admin/images/fade-butt.png ) repeat-x 0 0' - }); - }); - selector.click(function() { - dropdown.slideDown('fast'); - return false; - }); - $('body').click(function() { - dropdown.hide(); - }); - - if (options.dropdownIconUrl) { - var dropdown_icon = $(''); - dropdown_icon.css({ 'vertical-align': 'bottom' }); - selector.append(dropdown_icon); - } - - menu.append(selector); - - var pane = $('
'); - pane.hide(); - menu.append(pane); - - var dropdown = $('
'); - dropdown.hide(); - menu.append(dropdown); - - $.each($.tgPanes, function(i, n) { - var submenu = $('
' + $.tgPanes[i].title + '
'); - submenu.css({ - margin: 0, - padding: '0 4px', - 'line-height': '180%', - background: '#fff' - }); - submenu.mouseover(function() { - $(this).css({ background: '#d4f2f2' }); - }); - submenu.mouseout(function() { - $(this).css({ background: '#fff' }); - }); - submenu.click(function() { - dropdown.hide(); - pane.hide(); - pane.empty(); - $.tgPane(pane, i); - pane.slideDown('fast'); - return false; - }); - dropdown.append(submenu); - }); - - this.append(menu); - }; - - $.tgPane = function(pane, tagType) { - var closeButtonDiv = $('
'); - closeButtonDiv.css({ float: 'right' }); - - var closeButton = $('×'); - closeButton.click(function() { - pane.slideUp('fast').empty(); - }); - closeButtonDiv.append(closeButton); - - pane.append(closeButtonDiv); - - var paneTitle = $('
' + $.tgPanes[tagType].title + '
'); - pane.append(paneTitle); - - pane.append($('#' + $.tgPanes[tagType].content).clone().contents()); - - pane.find(':checkbox.exclusive').change(function() { - if ($(this).is(':checked')) - $(this).siblings(':checkbox.exclusive').removeAttr('checked'); - }); - - if ($.isFunction($.tgPanes[tagType].change)) - $.tgPanes[tagType].change(pane, tagType); - else - $.tgCreateTag(pane, tagType); - - pane.find(':input').change(function() { - if ($.isFunction($.tgPanes[tagType].change)) - $.tgPanes[tagType].change(pane, tagType); - else - $.tgCreateTag(pane, tagType); - }); - } - - $.tgCreateTag = function(pane, tagType) { - pane.find('input[name="name"]').each(function(i) { - var val = $(this).val(); - val = val.replace(/[^0-9a-zA-Z:._-]/g, '').replace(/^[^a-zA-Z]+/, ''); - if ('' == val) { - var rand = Math.floor(Math.random() * 1000); - val = tagType + '-' + rand; - } - $(this).val(val); - }); - - pane.find(':input.numeric').each(function(i) { - var val = $(this).val(); - val = val.replace(/[^0-9]/g, ''); - $(this).val(val); - }); - - pane.find(':input.idvalue').each(function(i) { - var val = $(this).val(); - val = val.replace(/[^-0-9a-zA-Z_]/g, ''); - $(this).val(val); - }); - - pane.find(':input.classvalue').each(function(i) { - var val = $(this).val(); - val = $.map(val.split(' '), function(n) { - return n.replace(/[^-0-9a-zA-Z_]/g, ''); - }).join(' '); - val = $.trim(val.replace(/\s+/g, ' ')); - $(this).val(val); - }); - - pane.find(':input.color').each(function(i) { - var val = $(this).val(); - val = val.replace(/[^0-9a-fA-F]/g, ''); - $(this).val(val); - }); - - pane.find(':input.filesize').each(function(i) { - var val = $(this).val(); - val = val.replace(/[^0-9kKmMbB]/g, ''); - $(this).val(val); - }); - - pane.find(':input.filetype').each(function(i) { - var val = $(this).val(); - val = val.replace(/[^0-9a-zA-Z.\s]/g, ''); - $(this).val(val); - }); - - pane.find(':input.date').each(function(i) { - var val = $(this).val(); - if (! val.match(/^\d{4}-\d{1,2}-\d{1,2}$/)) // 'yyyy-mm-dd' ISO 8601 format - $(this).val(''); - }); - - pane.find(':input[name="values"]').each(function(i) { - var val = $(this).val(); - val = $.trim(val); - $(this).val(val); - }); - - pane.find('input.tag').each(function(i) { - var type = $(this).attr('name'); - - var scope = pane.find('.scope.' + type); - if (! scope.length) - scope = pane; - - if (pane.find(':input[name="required"]').is(':checked')) - type += '*'; - - var name = pane.find(':input[name="name"]').val(); - - var options = []; - - var size = scope.find(':input[name="size"]').val(); - var maxlength = scope.find(':input[name="maxlength"]').val(); - if (size || maxlength) - options.push(size + '/' + maxlength); - - var cols = scope.find(':input[name="cols"]').val(); - var rows = scope.find(':input[name="rows"]').val(); - if (cols || rows) - options.push(cols + 'x' + rows); - - scope.find('input:text.option').each(function(i) { - if (-1 < $.inArray($(this).attr('name'), ['size', 'maxlength', 'cols', 'rows'])) - return; - - var val = $(this).val(); - - if (! val) - return; - - if ($(this).hasClass('filetype')) - val = val.split(' ').join('|'); - - if ($(this).hasClass('color')) - val = '#' + val; - - if ('class' == $(this).attr('name')) { - $.each(val.split(' '), function(i, n) { options.push('class:' + n) }); - } else { - options.push($(this).attr('name') + ':' + val); - } - }); - - scope.find('input:checkbox.option').each(function(i) { - if ($(this).is(':checked')) - options.push($(this).attr('name')); - }); - - options = (options.length > 0) ? ' ' + options.join(' ') : ''; - - var value = ''; - - if (scope.find(':input[name="values"]').val()) { - $.each(scope.find(':input[name="values"]').val().split("\n"), function(i, n) { - value += ' "' + n.replace(/["]/g, '"') + '"'; - }); - } - - if ($.tgPanes[tagType].nameless) - var tag = '[' + type + options + value + ']'; - else - var tag = name ? '[' + type + ' ' + name + options + value + ']' : ''; - - $(this).val(tag); - }); - - pane.find('input.mail-tag').each(function(i) { - var name = pane.find(':input[name="name"]').val(); - - var tag = name ? '[' + name + ']' : ''; - - $(this).val(tag); - }); - - } - - $.tgPanes = {}; - -})(jQuery); \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/images/ajax-loader.gif b/src/wp-content/plugins/contact-form-7/images/ajax-loader.gif deleted file mode 100644 index f2cfafd67f4e200b13a75d7bd093bdee54c2f116..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 847 zcmZ?wbhEHb6krfw_`<;O|NsB;^73E5eodJ&W$)g-RaI5p-Q6!`KikeHQNk&~a8qL-PMmd~L0lZBHDs7eQ93&@cStN{uNeJPpqmKuoUC~CDNtXexm zYwdvp2d^Dv;^>*ukeVSP#B=a~ zf`cHJ&w+*y$${?8Oio*#ZVND-p0{bqWVZD*Xt=Aat;&6vAl3|g72d7x8jzOQ(6|TN)0k3Co zc|z??%b8hfRI+(vH2HbDv054g3DyRMDNKeUM;%r)JIk@H5kHpQ-86?$(dkKoJwxMm zrhOBXU7IYboB|^nl6U7WD&rPXTBz{y(Bg!~gf`w#w`Gz=cO?0i7QEK{oc6x~t2H3M z0b_541COhrz@d{8xv>(*cS?BlTxh$Y!7k9nV#1{GTti1?UUB0cu(i`VAUAy((BOjfYz50rVKh zG6xfeLz|8{DtS)i*f48h0*75*E32o0N{2+RoVWQVUJo7igPpo1&00;(u2LcbOAhN^ rOjyy8aDeHjfMF+x#D?h({d~^m865hCENQGUn%zBWiVW7EmYc?KqtIsGe7zvW*nyrnBM PaccN4{unit_tag == $_POST['_wpcf7_unit_tag'] ) - return true; - - return false; - } - - function clear_post() { - $fes = $this->form_scan_shortcode(); - - foreach ( $fes as $fe ) { - if ( ! isset( $fe['name'] ) || empty( $fe['name'] ) ) - continue; - - $name = $fe['name']; - - if ( isset( $_POST[$name] ) ) - unset( $_POST[$name] ); - } - } - - /* Generating Form HTML */ - - function form_html() { - $form = '
'; - - $url = wpcf7_get_request_uri(); - - if ( $frag = strstr( $url, '#' ) ) - $url = substr( $url, 0, -strlen( $frag ) ); - - $url .= '#' . $this->unit_tag; - - $url = apply_filters( 'wpcf7_form_action_url', $url ); - $enctype = apply_filters( 'wpcf7_form_enctype', '' ); - $class = apply_filters( 'wpcf7_form_class_attr', 'wpcf7-form' ); - - $form .= '
' . "\n"; - $form .= '
' . "\n"; - $form .= '' . "\n"; - $form .= '' . "\n"; - $form .= '' . "\n"; - $form .= '
' . "\n"; - $form .= $this->form_elements(); - - if ( ! $this->responses_count ) - $form .= $this->form_response_output(); - - $form .= '
'; - - $form .= '
'; - - return $form; - } - - function form_response_output() { - $class = 'wpcf7-response-output'; - $content = ''; - - if ( $this->is_posted() ) { // Post response output for non-AJAX - if ( isset( $_POST['_wpcf7_mail_sent'] ) && $_POST['_wpcf7_mail_sent']['id'] == $this->id ) { - if ( $_POST['_wpcf7_mail_sent']['ok'] ) { - $class .= ' wpcf7-mail-sent-ok'; - $content = $_POST['_wpcf7_mail_sent']['message']; - } else { - $class .= ' wpcf7-mail-sent-ng'; - if ( $_POST['_wpcf7_mail_sent']['spam'] ) - $class .= ' wpcf7-spam-blocked'; - $content = $_POST['_wpcf7_mail_sent']['message']; - } - } elseif ( isset( $_POST['_wpcf7_validation_errors'] ) && $_POST['_wpcf7_validation_errors']['id'] == $this->id ) { - $class .= ' wpcf7-validation-errors'; - $content = $this->message( 'validation_error' ); - } - } else { - $class .= ' wpcf7-display-none'; - } - - $class = ' class="' . $class . '"'; - - return '' . $content . ''; - } - - function validation_error( $name ) { - if ( ! $this->is_posted() ) - return ''; - - if ( ! isset( $_POST['_wpcf7_validation_errors']['messages'][$name] ) ) - return ''; - - $ve = trim( $_POST['_wpcf7_validation_errors']['messages'][$name] ); - - if ( ! empty( $ve ) ) { - $ve = '' . esc_html( $ve ) . ''; - return apply_filters( 'wpcf7_validation_error', $ve, $name, $this ); - } - - return ''; - } - - /* Form Elements */ - - function form_do_shortcode() { - global $wpcf7_shortcode_manager; - - $form = $this->form; - - if ( WPCF7_AUTOP ) { - $form = $wpcf7_shortcode_manager->normalize_shortcode( $form ); - $form = wpcf7_autop( $form ); - } - - $form = $wpcf7_shortcode_manager->do_shortcode( $form ); - $this->scanned_form_tags = $wpcf7_shortcode_manager->scanned_tags; - - return $form; - } - - function form_scan_shortcode( $cond = null ) { - global $wpcf7_shortcode_manager; - - if ( ! empty( $this->scanned_form_tags ) ) { - $scanned = $this->scanned_form_tags; - } else { - $scanned = $wpcf7_shortcode_manager->scan_shortcode( $this->form ); - $this->scanned_form_tags = $scanned; - } - - if ( empty( $scanned ) ) - return null; - - if ( ! is_array( $cond ) || empty( $cond ) ) - return $scanned; - - for ( $i = 0, $size = count( $scanned ); $i < $size; $i++ ) { - - if ( isset( $cond['type'] ) ) { - if ( is_string( $cond['type'] ) && ! empty( $cond['type'] ) ) { - if ( $scanned[$i]['type'] != $cond['type'] ) { - unset( $scanned[$i] ); - continue; - } - } elseif ( is_array( $cond['type'] ) ) { - if ( ! in_array( $scanned[$i]['type'], $cond['type'] ) ) { - unset( $scanned[$i] ); - continue; - } - } - } - - if ( isset( $cond['name'] ) ) { - if ( is_string( $cond['name'] ) && ! empty( $cond['name'] ) ) { - if ( $scanned[$i]['name'] != $cond['name'] ) { - unset ( $scanned[$i] ); - continue; - } - } elseif ( is_array( $cond['name'] ) ) { - if ( ! in_array( $scanned[$i]['name'], $cond['name'] ) ) { - unset( $scanned[$i] ); - continue; - } - } - } - } - - return array_values( $scanned ); - } - - function form_elements() { - return apply_filters( 'wpcf7_form_elements', $this->form_do_shortcode() ); - } - - /* Validate */ - - function validate() { - $fes = $this->form_scan_shortcode(); - - $result = array( 'valid' => true, 'reason' => array() ); - - foreach ( $fes as $fe ) { - $result = apply_filters( 'wpcf7_validate_' . $fe['type'], $result, $fe ); - } - - return $result; - } - - /* Acceptance */ - - function accepted() { - $accepted = true; - - return apply_filters( 'wpcf7_acceptance', $accepted ); - } - - /* Akismet */ - - function akismet() { - global $akismet_api_host, $akismet_api_port; - - if ( ! function_exists( 'akismet_http_post' ) || - ! ( get_option( 'wordpress_api_key' ) || $wpcom_api_key ) ) - return false; - - $akismet_ready = false; - $author = $author_email = $author_url = $content = ''; - $fes = $this->form_scan_shortcode(); - - foreach ( $fes as $fe ) { - if ( ! isset( $fe['name'] ) || ! is_array( $fe['options'] ) ) - continue; - - if ( preg_grep( '%^akismet:author$%', $fe['options'] ) && '' == $author ) { - $author = $_POST[$fe['name']]; - $akismet_ready = true; - } - - if ( preg_grep( '%^akismet:author_email$%', $fe['options'] ) && '' == $author_email ) { - $author_email = $_POST[$fe['name']]; - $akismet_ready = true; - } - - if ( preg_grep( '%^akismet:author_url$%', $fe['options'] ) && '' == $author_url ) { - $author_url = $_POST[$fe['name']]; - $akismet_ready = true; - } - - if ( '' != $content ) - $content .= "\n\n"; - - $content .= $_POST[$fe['name']]; - } - - if ( ! $akismet_ready ) - return false; - - $c['blog'] = get_option( 'home' ); - $c['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); - $c['user_agent'] = $_SERVER['HTTP_USER_AGENT']; - $c['referrer'] = $_SERVER['HTTP_REFERER']; - $c['comment_type'] = 'contactform7'; - if ( $permalink = get_permalink() ) - $c['permalink'] = $permalink; - if ( '' != $author ) - $c['comment_author'] = $author; - if ( '' != $author_email ) - $c['comment_author_email'] = $author_email; - if ( '' != $author_url ) - $c['comment_author_url'] = $author_url; - if ( '' != $content ) - $c['comment_content'] = $content; - - $ignore = array( 'HTTP_COOKIE' ); - - foreach ( $_SERVER as $key => $value ) - if ( ! in_array( $key, (array) $ignore ) ) - $c["$key"] = $value; - - $query_string = ''; - foreach ( $c as $key => $data ) - $query_string .= $key . '=' . urlencode( stripslashes( (string) $data ) ) . '&'; - - $response = akismet_http_post( $query_string, $akismet_api_host, - '/1.1/comment-check', $akismet_api_port ); - if ( 'true' == $response[1] ) - return true; - else - return false; - } - - /* Mail */ - - function mail() { - $fes = $this->form_scan_shortcode(); - - foreach ( $fes as $fe ) { - if ( empty( $fe['name'] ) ) - continue; - - $name = $fe['name']; - $pipes = $fe['pipes']; - $value = $_POST[$name]; - - if ( WPCF7_USE_PIPE && is_a( $pipes, 'WPCF7_Pipes' ) && ! $pipes->zero() ) { - if ( is_array( $value) ) { - $new_value = array(); - foreach ( $value as $v ) { - $new_value[] = $pipes->do_pipe( stripslashes( $v ) ); - } - $value = $new_value; - } else { - $value = $pipes->do_pipe( stripslashes( $value ) ); - } - } - - $this->posted_data[$name] = $value; - } - - if ( $this->in_demo_mode() ) - $this->skip_mail = true; - - do_action_ref_array( 'wpcf7_before_send_mail', array( &$this ) ); - - if ( $this->skip_mail ) - return true; - - if ( $this->compose_and_send_mail( $this->mail ) ) { - if ( $this->mail_2['active'] ) - $this->compose_and_send_mail( $this->mail_2 ); - - return true; - } - - return false; - } - - function compose_and_send_mail( $mail_template ) { - $regex = '/\[\s*([a-zA-Z_][0-9a-zA-Z:._-]*)\s*\]/'; - - $use_html = (bool) $mail_template['use_html']; - - if ( $use_html ) - $callback = array( &$this, 'mail_callback_html' ); - else - $callback = array( &$this, 'mail_callback' ); - - $subject = preg_replace_callback( $regex, $callback, $mail_template['subject'] ); - $sender = preg_replace_callback( $regex, $callback, $mail_template['sender'] ); - $recipient = preg_replace_callback( $regex, $callback, $mail_template['recipient'] ); - $additional_headers = - preg_replace_callback( $regex, $callback, $mail_template['additional_headers'] ); - $body = preg_replace_callback( $regex, $callback, $mail_template['body'] ); - - if ( $use_html ) - $body = wpautop( $body ); - - extract( apply_filters( 'wpcf7_mail_components', - compact( 'subject', 'sender', 'body', 'recipient', 'additional_headers' ) ) ); - - $headers = "From: $sender\n"; - - if ( $use_html ) - $headers .= "Content-Type: text/html\n"; - - $headers .= trim( $additional_headers ) . "\n"; - - if ( $this->uploaded_files ) { - $for_this_mail = array(); - foreach ( $this->uploaded_files as $name => $path ) { - if ( false === strpos( $mail_template['attachments'], "[${name}]" ) ) - continue; - $for_this_mail[] = $path; - } - - return @wp_mail( $recipient, $subject, $body, $headers, $for_this_mail ); - } else { - return @wp_mail( $recipient, $subject, $body, $headers ); - } - } - - function mail_callback_html( $matches ) { - return $this->mail_callback( $matches, true ); - } - - function mail_callback( $matches, $html = false ) { - if ( isset( $this->posted_data[$matches[1]] ) ) { - $submitted = $this->posted_data[$matches[1]]; - - if ( is_array( $submitted ) ) - $replaced = join( ', ', $submitted ); - else - $replaced = $submitted; - - if ( $html ) { - $replaced = strip_tags( $replaced ); - $replaced = wptexturize( $replaced ); - } - - $replaced = apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ); - - return stripslashes( $replaced ); - } - - if ( $special = apply_filters( 'wpcf7_special_mail_tags', '', $matches[1] ) ) - return $special; - - return $matches[0]; - } - - /* Message */ - - function message( $status ) { - $messages = $this->messages; - $message = $messages[$status]; - - return apply_filters( 'wpcf7_display_message', $message ); - } - - /* Additional settings */ - - function additional_setting( $name, $max = 1 ) { - $tmp_settings = (array) explode( "\n", $this->additional_settings ); - - $count = 0; - $values = array(); - - foreach ( $tmp_settings as $setting ) { - if ( preg_match('/^([a-zA-Z0-9_]+)\s*:(.*)$/', $setting, $matches ) ) { - if ( $matches[1] != $name ) - continue; - - if ( ! $max || $count < (int) $max ) { - $values[] = trim( $matches[2] ); - $count += 1; - } - } - } - - return $values; - } - - function in_demo_mode() { - $settings = $this->additional_setting( 'demo_mode', false ); - - foreach ( $settings as $setting ) { - if ( in_array( $setting, array( 'on', 'true', '1' ) ) ) - return true; - } - - return false; - } - - /* Upgrade */ - - function upgrade() { - if ( ! isset( $this->mail['recipient'] ) ) - $this->mail['recipient'] = get_option( 'admin_email' ); - - - if ( ! is_array( $this->messages ) ) - $this->messages = array(); - - - foreach ( wpcf7_messages() as $key => $arr ) { - if ( ! isset( $this->messages[$key] ) ) - $this->messages[$key] = $arr['default']; - } - } - - /* Save */ - - function save() { - global $wpdb, $wpcf7; - - $fields = array( - 'title' => maybe_serialize( stripslashes_deep( $this->title ) ), - 'form' => maybe_serialize( stripslashes_deep( $this->form ) ), - 'mail' => maybe_serialize( stripslashes_deep( $this->mail ) ), - 'mail_2' => maybe_serialize ( stripslashes_deep( $this->mail_2 ) ), - 'messages' => maybe_serialize( stripslashes_deep( $this->messages ) ), - 'additional_settings' => - maybe_serialize( stripslashes_deep( $this->additional_settings ) ) ); - - if ( $this->initial ) { - $result = $wpdb->insert( $wpcf7->contactforms, $fields ); - - if ( $result ) { - $this->initial = false; - $this->id = $wpdb->insert_id; - - do_action_ref_array( 'wpcf7_after_create', array( &$this ) ); - } else { - return false; // Failed to save - } - - } else { // Update - if ( ! (int) $this->id ) - return false; // Missing ID - - $result = $wpdb->update( $wpcf7->contactforms, $fields, - array( 'cf7_unit_id' => absint( $this->id ) ) ); - - if ( false !== $result ) { - do_action_ref_array( 'wpcf7_after_update', array( &$this ) ); - } else { - return false; // Failed to save - } - } - - do_action_ref_array( 'wpcf7_after_save', array( &$this ) ); - return true; // Succeeded to save - } - - function copy() { - $new = new WPCF7_ContactForm(); - $new->initial = true; - - $new->title = $this->title . '_copy'; - $new->form = $this->form; - $new->mail = $this->mail; - $new->mail_2 = $this->mail_2; - $new->messages = $this->messages; - $new->additional_settings = $this->additional_settings; - - return $new; - } - - function delete() { - global $wpdb, $wpcf7; - - if ( $this->initial ) - return; - - $query = $wpdb->prepare( - "DELETE FROM $wpcf7->contactforms WHERE cf7_unit_id = %d LIMIT 1", - absint( $this->id ) ); - - $wpdb->query( $query ); - - $this->initial = true; - $this->id = null; - } -} - -function wpcf7_contact_form( $id ) { - global $wpdb, $wpcf7; - - $query = $wpdb->prepare( "SELECT * FROM $wpcf7->contactforms WHERE cf7_unit_id = %d", $id ); - - if ( ! $row = $wpdb->get_row( $query ) ) - return false; // No data - - $contact_form = new WPCF7_ContactForm(); - $contact_form->id = $row->cf7_unit_id; - $contact_form->title = maybe_unserialize( $row->title ); - $contact_form->form = maybe_unserialize( $row->form ); - $contact_form->mail = maybe_unserialize( $row->mail ); - $contact_form->mail_2 = maybe_unserialize( $row->mail_2 ); - $contact_form->messages = maybe_unserialize( $row->messages ); - $contact_form->additional_settings = maybe_unserialize( $row->additional_settings ); - - $contact_form->upgrade(); - - return $contact_form; -} - -function wpcf7_contact_form_default_pack( $locale = null ) { - global $l10n; - - if ( $locale && $locale != get_locale() ) { - $mo_orig = $l10n['wpcf7']; - unset( $l10n['wpcf7'] ); - - if ( 'en_US' != $locale ) { - $mofile = wpcf7_plugin_path( 'languages/wpcf7-' . $locale . '.mo' ); - if ( ! load_textdomain( 'wpcf7', $mofile ) ) { - $l10n['wpcf7'] = $mo_orig; - unset( $mo_orig ); - } - } - } - - $contact_form = new WPCF7_ContactForm(); - $contact_form->initial = true; - - $contact_form->title = __( 'Untitled', 'wpcf7' ); - $contact_form->form = wpcf7_default_form_template(); - $contact_form->mail = wpcf7_default_mail_template(); - $contact_form->mail_2 = wpcf7_default_mail_2_template(); - $contact_form->messages = wpcf7_default_messages_template(); - - if ( isset( $mo_orig ) ) - $l10n['wpcf7'] = $mo_orig; - - return $contact_form; -} - -function wpcf7_get_current_contact_form() { - global $wpcf7_contact_form; - - if ( ! is_a( $wpcf7_contact_form, 'WPCF7_ContactForm' ) ) - return null; - - return $wpcf7_contact_form; -} - -function wpcf7_is_posted() { - if ( ! $contact_form = wpcf7_get_current_contact_form() ) - return false; - - return $contact_form->is_posted(); -} - -function wpcf7_get_validation_error( $name ) { - if ( ! $contact_form = wpcf7_get_current_contact_form() ) - return ''; - - return $contact_form->validation_error( $name ); -} - -function wpcf7_get_message( $status ) { - if ( ! $contact_form = wpcf7_get_current_contact_form() ) - return ''; - - return $contact_form->message( $status ); -} - -function wpcf7_scan_shortcode( $cond = null ) { - if ( ! $contact_form = wpcf7_get_current_contact_form() ) - return null; - - return $contact_form->form_scan_shortcode( $cond ); -} - -?> \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/includes/controller.php b/src/wp-content/plugins/contact-form-7/includes/controller.php deleted file mode 100644 index b18e607a..00000000 --- a/src/wp-content/plugins/contact-form-7/includes/controller.php +++ /dev/null @@ -1,288 +0,0 @@ -validate(); - - $items = array( - 'mailSent' => false, - 'into' => '#' . $unit_tag, - 'captcha' => null ); - - $items = apply_filters( 'wpcf7_ajax_json_echo', $items ); - - if ( ! $validation['valid'] ) { // Validation error occured - $invalids = array(); - foreach ( $validation['reason'] as $name => $reason ) { - $invalids[] = array( - 'into' => 'span.wpcf7-form-control-wrap.' . $name, - 'message' => $reason ); - } - - $items['message'] = wpcf7_get_message( 'validation_error' ); - $items['invalids'] = $invalids; - - } elseif ( ! $wpcf7_contact_form->accepted() ) { // Not accepted terms - $items['message'] = wpcf7_get_message( 'accept_terms' ); - - } elseif ( $wpcf7_contact_form->akismet() ) { // Spam! - $items['message'] = wpcf7_get_message( 'akismet_says_spam' ); - $items['spam'] = true; - - } elseif ( $wpcf7_contact_form->mail() ) { - $items['mailSent'] = true; - $items['message'] = wpcf7_get_message( 'mail_sent_ok' ); - - $on_sent_ok = $wpcf7_contact_form->additional_setting( 'on_sent_ok', false ); - if ( ! empty( $on_sent_ok ) ) { - $on_sent_ok = array_map( 'wpcf7_strip_quote', $on_sent_ok ); - } else { - $on_sent_ok = null; - } - $items['onSentOk'] = $on_sent_ok; - - do_action_ref_array( 'wpcf7_mail_sent', array( &$wpcf7_contact_form ) ); - - } else { - $items['message'] = wpcf7_get_message( 'mail_sent_ng' ); - } - - // remove upload files - foreach ( (array) $wpcf7_contact_form->uploaded_files as $name => $path ) { - @unlink( $path ); - } - - $wpcf7_contact_form = null; - } - } - - $echo = json_encode( $items ); - - if ( $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ) { - @header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); - echo $echo; - } else { - @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); - echo ''; - } -} - -function wpcf7_process_nonajax_submitting() { - global $wpcf7_contact_form; - - if ( ! isset($_POST['_wpcf7'] ) ) - return; - - $id = (int) $_POST['_wpcf7']; - - if ( $wpcf7_contact_form = wpcf7_contact_form( $id ) ) { - $validation = $wpcf7_contact_form->validate(); - - if ( ! $validation['valid'] ) { - $_POST['_wpcf7_validation_errors'] = array( 'id' => $id, 'messages' => $validation['reason'] ); - } elseif ( ! $wpcf7_contact_form->accepted() ) { // Not accepted terms - $_POST['_wpcf7_mail_sent'] = array( 'id' => $id, 'ok' => false, 'message' => wpcf7_get_message( 'accept_terms' ) ); - } elseif ( $wpcf7_contact_form->akismet() ) { // Spam! - $_POST['_wpcf7_mail_sent'] = array( 'id' => $id, 'ok' => false, 'message' => wpcf7_get_message( 'akismet_says_spam' ), 'spam' => true ); - } elseif ( $wpcf7_contact_form->mail() ) { - $_POST['_wpcf7_mail_sent'] = array( 'id' => $id, 'ok' => true, 'message' => wpcf7_get_message( 'mail_sent_ok' ) ); - - do_action_ref_array( 'wpcf7_mail_sent', array( &$wpcf7_contact_form ) ); - - $wpcf7_contact_form->clear_post(); - } else { - $_POST['_wpcf7_mail_sent'] = array( 'id' => $id, 'ok' => false, 'message' => wpcf7_get_message( 'mail_sent_ng' ) ); - } - - // remove upload files - foreach ( (array) $wpcf7_contact_form->uploaded_files as $name => $path ) { - @unlink( $path ); - } - - $wpcf7_contact_form = null; - } -} - -add_action( 'the_post', 'wpcf7_the_post' ); - -function wpcf7_the_post() { - global $wpcf7; - - $wpcf7->processing_within = 'p' . get_the_ID(); - $wpcf7->unit_count = 0; -} - -add_action( 'loop_end', 'wpcf7_loop_end' ); - -function wpcf7_loop_end() { - global $wpcf7; - - $wpcf7->processing_within = ''; -} - -add_filter( 'widget_text', 'wpcf7_widget_text_filter', 9 ); - -function wpcf7_widget_text_filter( $content ) { - global $wpcf7; - - $wpcf7->widget_count += 1; - $wpcf7->processing_within = 'w' . $wpcf7->widget_count; - $wpcf7->unit_count = 0; - - $regex = '/\[\s*contact-form\s+(\d+(?:\s+.*)?)\]/'; - $content = preg_replace_callback( $regex, 'wpcf7_widget_text_filter_callback', $content ); - - $wpcf7->processing_within = ''; - return $content; -} - -function wpcf7_widget_text_filter_callback( $matches ) { - return do_shortcode( $matches[0] ); -} - -add_shortcode( 'contact-form', 'wpcf7_contact_form_tag_func' ); - -function wpcf7_contact_form_tag_func( $atts ) { - global $wpcf7, $wpcf7_contact_form; - - if ( is_feed() ) - return '[contact-form]'; - - if ( is_string( $atts ) ) - $atts = explode( ' ', $atts, 2 ); - - $atts = (array) $atts; - - $id = (int) array_shift( $atts ); - - if ( ! ( $wpcf7_contact_form = wpcf7_contact_form( $id ) ) ) - return '[contact-form 404 "Not Found"]'; - - if ( $wpcf7->processing_within ) { // Inside post content or text widget - $wpcf7->unit_count += 1; - $unit_count = $wpcf7->unit_count; - $processing_within = $wpcf7->processing_within; - - } else { // Inside template - - if ( ! isset( $wpcf7->global_unit_count ) ) - $wpcf7->global_unit_count = 0; - - $wpcf7->global_unit_count += 1; - $unit_count = 1; - $processing_within = 't' . $wpcf7->global_unit_count; - } - - $unit_tag = 'wpcf7-f' . $id . '-' . $processing_within . '-o' . $unit_count; - $wpcf7_contact_form->unit_tag = $unit_tag; - - $form = $wpcf7_contact_form->form_html(); - - $wpcf7_contact_form = null; - - return $form; -} - -add_action( 'wp_head', 'wpcf7_head' ); - -function wpcf7_head() { - // Cached? - if ( wpcf7_script_is() && defined( 'WP_CACHE' ) && WP_CACHE ) : -?> - - \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/includes/formatting.php b/src/wp-content/plugins/contact-form-7/includes/formatting.php deleted file mode 100644 index 8584d5c1..00000000 --- a/src/wp-content/plugins/contact-form-7/includes/formatting.php +++ /dev/null @@ -1,144 +0,0 @@ -\s*
|', "\n\n", $pee ); - // Space things out a little - /* wpcf7: remove select and input */ - $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; - $pee = preg_replace( '!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee ); - $pee = preg_replace( '!()!', "$1\n\n", $pee ); - $pee = str_replace( array( "\r\n", "\r" ), "\n", $pee ); // cross-platform newlines - if ( strpos( $pee, ']*)>\s*|', "", $pee ); // no pee inside object/embed - $pee = preg_replace( '|\s*\s*|', '', $pee ); - } - $pee = preg_replace( "/\n\n+/", "\n\n", $pee ); // take care of duplicates - // make paragraphs, including one at the end - $pees = preg_split( '/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY ); - $pee = ''; - foreach ( $pees as $tinkle ) - $pee .= '

' . trim( $tinkle, "\n" ) . "

\n"; - $pee = preg_replace( '|

\s*

|', '', $pee ); // under certain strange conditions it could create a P of entirely whitespace - $pee = preg_replace( '!

([^<]+)!', "

$1

", $pee ); - $pee = preg_replace( '!

\s*(]*>)\s*

!', "$1", $pee ); // don't pee all over a tag - $pee = preg_replace( "|

(|", "$1", $pee ); // problem with nested lists - $pee = preg_replace( '|

]*)>|i', "

", $pee ); - $pee = str_replace( '

', '

', $pee ); - $pee = preg_replace( '!

\s*(]*>)!', "$1", $pee ); - $pee = preg_replace( '!(]*>)\s*

!', "$1", $pee ); - if ( $br ) { - /* wpcf7: add textarea */ - $pee = preg_replace_callback( '/<(script|style|textarea).*?<\/\\1>/s', create_function( '$matches', 'return str_replace("\n", "", $matches[0]);' ), $pee ); - $pee = preg_replace( '|(?)\s*\n|', "
\n", $pee ); // optionally make line breaks - $pee = str_replace( '', "\n", $pee ); - } - $pee = preg_replace( '!(]*>)\s*
!', "$1", $pee ); - $pee = preg_replace( '!
(\s*]*>)!', '$1', $pee ); - if ( strpos( $pee, ']*>)(.*?)!is', 'clean_pre', $pee ); - $pee = preg_replace( "|\n

$|", '

', $pee ); - - return $pee; -} - -function wpcf7_strip_quote( $text ) { - $text = trim( $text ); - if ( preg_match( '/^"(.*)"$/', $text, $matches ) ) - $text = $matches[1]; - elseif ( preg_match( "/^'(.*)'$/", $text, $matches ) ) - $text = $matches[1]; - return $text; -} - -function wpcf7_strip_quote_deep( $arr ) { - if ( is_string( $arr ) ) - return wpcf7_strip_quote( $arr ); - - if ( is_array( $arr ) ) { - $result = array(); - foreach ( $arr as $key => $text ) { - $result[$key] = wpcf7_strip_quote( $text ); - } - return $result; - } -} - -function wpcf7_canonicalize( $text ) { - if ( function_exists( 'mb_convert_kana' ) && 'UTF-8' == get_option( 'blog_charset' ) ) - $text = mb_convert_kana( $text, 'asKV', 'UTF-8' ); - - $text = strtolower( $text ); - $text = trim( $text ); - return $text; -} - -function wpcf7_sanitize_file_name( $filename ) { - /* Memo: - // This function does sanitization introduced in http://core.trac.wordpress.org/ticket/11122 - // WordPress 2.8.6 will implement it in sanitize_file_name(). - // While Contact Form 7's file uploading function uses wp_unique_filename(), and - // it in turn calls sanitize_file_name(). Therefore this wpcf7_sanitize_file_name() will be - // redundant and unnecessary when you use Contact Form 7 on WordPress 2.8.6 or higher. - // This function is provided just for the sake of protecting who uses older WordPress. - */ - - // Split the filename into a base and extension[s] - $parts = explode( '.', $filename ); - - // Return if only one extension - if ( count( $parts ) <= 2 ) - return $filename; - - // Process multiple extensions - $filename = array_shift( $parts ); - $extension = array_pop( $parts ); - - $mimes = array( 'jpg|jpeg|jpe', 'gif', 'png', 'bmp', - 'tif|tiff', 'ico', 'asf|asx|wax|wmv|wmx', 'avi', - 'divx', 'mov|qt', 'mpeg|mpg|mpe', 'txt|c|cc|h', - 'rtx', 'css', 'htm|html', 'mp3|m4a', 'mp4|m4v', - 'ra|ram', 'wav', 'ogg', 'mid|midi', 'wma', 'rtf', - 'js', 'pdf', 'doc|docx', 'pot|pps|ppt|pptx', 'wri', - 'xla|xls|xlsx|xlt|xlw', 'mdb', 'mpp', 'swf', 'class', - 'tar', 'zip', 'gz|gzip', 'exe', - // openoffice formats - 'odt', 'odp', 'ods', 'odg', 'odc', 'odb', 'odf' ); - - // Loop over any intermediate extensions. - // Munge them with a trailing underscore if they are a 2 - 5 character - // long alpha string not in the extension whitelist. - foreach ( (array) $parts as $part) { - $filename .= '.' . $part; - - if ( preg_match( '/^[a-zA-Z]{2,5}\d?$/', $part ) ) { - $allowed = false; - foreach ( $mimes as $ext_preg ) { - $ext_preg = '!(^' . $ext_preg . ')$!i'; - if ( preg_match( $ext_preg, $part ) ) { - $allowed = true; - break; - } - } - if ( ! $allowed ) - $filename .= '_'; - } - } - $filename .= '.' . $extension; - - return $filename; -} - -function wpcf7_is_name( $string ) { - // See http://www.w3.org/TR/html401/types.html#h-6.2 - // ID and NAME tokens must begin with a letter ([A-Za-z]) - // and may be followed by any number of letters, digits ([0-9]), - // hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). - - return preg_match( '/^[A-Za-z][-A-Za-z0-9_:.]*$/', $string ); -} - -?> \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/includes/functions.php b/src/wp-content/plugins/contact-form-7/includes/functions.php deleted file mode 100644 index 604c04b2..00000000 --- a/src/wp-content/plugins/contact-form-7/includes/functions.php +++ /dev/null @@ -1,226 +0,0 @@ - array( - 'description' => __( "Sender's message was sent successfully", 'wpcf7' ), - 'default' => __( 'Your message was sent successfully. Thanks.', 'wpcf7' ) - ), - - 'mail_sent_ng' => array( - 'description' => __( "Sender's message was failed to send", 'wpcf7' ), - 'default' => __( 'Failed to send your message. Please try later or contact administrator by other way.', 'wpcf7' ) - ), - - 'akismet_says_spam' => array( - 'description' => __( "Akismet judged the sending activity as spamming", 'wpcf7' ), - 'default' => __( 'Failed to send your message. Please try later or contact administrator by other way.', 'wpcf7' ) - ), - - 'validation_error' => array( - 'description' => __( "Validation errors occurred", 'wpcf7' ), - 'default' => __( 'Validation errors occurred. Please confirm the fields and submit it again.', 'wpcf7' ) - ), - - 'accept_terms' => array( - 'description' => __( "There is a field of term that sender is needed to accept", 'wpcf7' ), - 'default' => __( 'Please accept the terms to proceed.', 'wpcf7' ) - ), - - 'invalid_email' => array( - 'description' => __( "Email address that sender entered is invalid", 'wpcf7' ), - 'default' => __( 'Email address seems invalid.', 'wpcf7' ) - ), - - 'invalid_required' => array( - 'description' => __( "There is a field that sender is needed to fill in", 'wpcf7' ), - 'default' => __( 'Please fill the required field.', 'wpcf7' ) - ) - ); - - return apply_filters( 'wpcf7_messages', $messages ); -} - -function wpcf7_default_form_template() { - $template = - '

' . __( 'Your Name', 'wpcf7' ) . ' ' . __( '(required)', 'wpcf7' ) . '
' . "\n" - . ' [text* your-name]

' . "\n\n" - . '

' . __( 'Your Email', 'wpcf7' ) . ' ' . __( '(required)', 'wpcf7' ) . '
' . "\n" - . ' [email* your-email]

' . "\n\n" - . '

' . __( 'Subject', 'wpcf7' ) . '
' . "\n" - . ' [text your-subject]

' . "\n\n" - . '

' . __( 'Your Message', 'wpcf7' ) . '
' . "\n" - . ' [textarea your-message]

' . "\n\n" - . '

[submit "' . __( 'Send', 'wpcf7' ) . '"]

'; - - return $template; -} - -function wpcf7_default_mail_template() { - $subject = '[your-subject]'; - $sender = '[your-name] <[your-email]>'; - $body = sprintf( __( 'From: %s', 'wpcf7' ), '[your-name] <[your-email]>' ) . "\n" - . sprintf( __( 'Subject: %s', 'wpcf7' ), '[your-subject]' ) . "\n\n" - . __( 'Message Body:', 'wpcf7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n" - . sprintf( __( 'This mail is sent via contact form on %1$s %2$s', 'wpcf7' ), - get_bloginfo( 'name' ), get_bloginfo( 'url' ) ); - $recipient = get_option( 'admin_email' ); - $additional_headers = ''; - $attachments = ''; - $use_html = 0; - return compact( 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments', 'use_html' ); -} - -function wpcf7_default_mail_2_template() { - $active = false; - $subject = '[your-subject]'; - $sender = '[your-name] <[your-email]>'; - $body = __( 'Message body:', 'wpcf7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n" - . sprintf( __( 'This mail is sent via contact form on %1$s %2$s', 'wpcf7' ), - get_bloginfo( 'name' ), get_bloginfo( 'url' ) ); - $recipient = '[your-email]'; - $additional_headers = ''; - $attachments = ''; - $use_html = 0; - return compact( 'active', 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments', 'use_html' ); -} - -function wpcf7_default_messages_template() { - $messages = array(); - - foreach ( wpcf7_messages() as $key => $arr ) { - $messages[$key] = $arr['default']; - } - - return $messages; -} - -function wpcf7_is_multisite() { // will be removed when WordPress 2.9 is not supported - if ( function_exists( 'is_multisite' ) ) - return is_multisite(); - - return false; -} - -function wpcf7_is_main_site() { // will be removed when WordPress 2.9 is not supported - if ( function_exists( 'is_main_site' ) ) - return is_main_site(); - - return false; -} - -function wpcf7_upload_dir( $type = false ) { - global $switched; - - $siteurl = get_option( 'siteurl' ); - $upload_path = trim( get_option( 'upload_path' ) ); - - $main_override = wpcf7_is_multisite() && defined( 'MULTISITE' ) && wpcf7_is_main_site(); - - if ( empty( $upload_path ) ) { - $dir = WP_CONTENT_DIR . '/uploads'; - } else { - $dir = $upload_path; - - if ( 'wp-content/uploads' == $upload_path ) { - $dir = WP_CONTENT_DIR . '/uploads'; - } elseif ( 0 !== strpos( $dir, ABSPATH ) ) { - // $dir is absolute, $upload_path is (maybe) relative to ABSPATH - $dir = path_join( ABSPATH, $dir ); - } - } - - if ( ! $url = get_option( 'upload_url_path' ) ) { - if ( empty( $upload_path ) - || ( 'wp-content/uploads' == $upload_path ) - || ( $upload_path == $dir ) ) - $url = WP_CONTENT_URL . '/uploads'; - else - $url = trailingslashit( $siteurl ) . $upload_path; - } - - if ( defined( 'UPLOADS' ) && ! $main_override - && ( ! isset( $switched ) || $switched === false ) ) { - $dir = ABSPATH . UPLOADS; - $url = trailingslashit( $siteurl ) . UPLOADS; - } - - if ( wpcf7_is_multisite() && ! $main_override - && ( ! isset( $switched ) || $switched === false ) ) { - - if ( defined( 'BLOGUPLOADDIR' ) ) - $dir = untrailingslashit( BLOGUPLOADDIR ); - - $url = str_replace( UPLOADS, 'files', $url ); - } - - $uploads = apply_filters( 'wpcf7_upload_dir', array( 'dir' => $dir, 'url' => $url ) ); - - if ( 'dir' == $type ) - return $uploads['dir']; - if ( 'url' == $type ) - return $uploads['url']; - - return $uploads; -} - -function wpcf7_l10n() { - $l10n = array( - 'af' => __( 'Afrikaans', 'wpcf7' ), - 'sq' => __( 'Albanian', 'wpcf7' ), - 'ar' => __( 'Arabic', 'wpcf7' ), - 'hy_AM' => __( 'Armenian', 'wpcf7' ), - 'bn_BD' => __( 'Bangla', 'wpcf7' ), - 'bs' => __( 'Bosnian', 'wpcf7' ), - 'pt_BR' => __( 'Brazilian Portuguese', 'wpcf7' ), - 'bg_BG' => __( 'Bulgarian', 'wpcf7' ), - 'ca' => __( 'Catalan', 'wpcf7' ), - 'zh_CN' => __( 'Chinese (Simplified)', 'wpcf7' ), - 'zh_TW' => __( 'Chinese (Traditional)', 'wpcf7' ), - 'hr' => __( 'Croatian', 'wpcf7' ), - 'cs_CZ' => __( 'Czech', 'wpcf7' ), - 'da_DK' => __( 'Danish', 'wpcf7' ), - 'nl_NL' => __( 'Dutch', 'wpcf7' ), - 'en_US' => __( 'English', 'wpcf7' ), - 'et' => __( 'Estonian', 'wpcf7' ), - 'fi' => __( 'Finnish', 'wpcf7' ), - 'fr_FR' => __( 'French', 'wpcf7' ), - 'gl_ES' => __( 'Galician', 'wpcf7' ), - 'ka_GE' => __( 'Georgian', 'wpcf7' ), - 'de_DE' => __( 'German', 'wpcf7' ), - 'el' => __( 'Greek', 'wpcf7' ), - 'he_IL' => __( 'Hebrew', 'wpcf7' ), - 'hi_IN' => __( 'Hindi', 'wpcf7' ), - 'hu_HU' => __( 'Hungarian', 'wpcf7' ), - 'id_ID' => __( 'Indonesian', 'wpcf7' ), - 'it_IT' => __( 'Italian', 'wpcf7' ), - 'ja' => __( 'Japanese', 'wpcf7' ), - 'ko_KR' => __( 'Korean', 'wpcf7' ), - 'lv' => __( 'Latvian', 'wpcf7' ), - 'lt_LT' => __( 'Lithuanian', 'wpcf7' ), - 'mk_MK' => __( 'Macedonian', 'wpcf7' ), - 'ms_MY' => __( 'Malay', 'wpcf7' ), - 'ml_IN' => __( 'Malayalam', 'wpcf7' ), - 'nb_NO' => __( 'Norwegian', 'wpcf7' ), - 'fa_IR' => __( 'Persian', 'wpcf7' ), - 'pl_PL' => __( 'Polish', 'wpcf7' ), - 'pt_PT' => __( 'Portuguese', 'wpcf7' ), - 'ru_RU' => __( 'Russian', 'wpcf7' ), - 'ro_RO' => __( 'Romanian', 'wpcf7' ), - 'sr_RS' => __( 'Serbian', 'wpcf7' ), - 'si_LK' => __( 'Sinhala', 'wpcf7' ), - 'sk' => __( 'Slovak', 'wpcf7' ), - 'sl_SI' => __( 'Slovene', 'wpcf7' ), - 'es_ES' => __( 'Spanish', 'wpcf7' ), - 'sv_SE' => __( 'Swedish', 'wpcf7' ), - 'ta' => __( 'Tamil', 'wpcf7' ), - 'th' => __( 'Thai', 'wpcf7' ), - 'tr_TR' => __( 'Turkish', 'wpcf7' ), - 'uk' => __( 'Ukrainian', 'wpcf7' ), - 'vi' => __( 'Vietnamese', 'wpcf7' ) - ); - - return $l10n; -} - -?> \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/includes/pipe.php b/src/wp-content/plugins/contact-form-7/includes/pipe.php deleted file mode 100644 index bd88ed9e..00000000 --- a/src/wp-content/plugins/contact-form-7/includes/pipe.php +++ /dev/null @@ -1,67 +0,0 @@ -before = $this->after = $text; - } else { - $this->before = substr( $text, 0, $pipe_pos ); - $this->after = substr( $text, $pipe_pos + 1 ); - } - } -} - -class WPCF7_Pipes { - - var $pipes = array(); - - function WPCF7_Pipes( $texts ) { - if ( ! is_array( $texts ) ) - return; - - foreach ( $texts as $text ) { - $this->add_pipe( $text ); - } - } - - function add_pipe( $text ) { - $pipe = new WPCF7_Pipe( $text ); - $this->pipes[] = $pipe; - } - - function do_pipe( $before ) { - foreach ( $this->pipes as $pipe ) { - if ( $pipe->before == $before ) - return $pipe->after; - } - return $before; - } - - function collect_befores() { - $befores = array(); - - foreach ( $this->pipes as $pipe ) { - $befores[] = $pipe->before; - } - - return $befores; - } - - function zero() { - return empty( $this->pipes ); - } - - function random_pipe() { - if ( $this->zero() ) - return null; - - return $this->pipes[array_rand( $this->pipes )]; - } -} - -?> \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/includes/shortcodes.php b/src/wp-content/plugins/contact-form-7/includes/shortcodes.php deleted file mode 100644 index 1dfab995..00000000 --- a/src/wp-content/plugins/contact-form-7/includes/shortcodes.php +++ /dev/null @@ -1,185 +0,0 @@ -shortcode_tags[$tag] = array( - 'function' => $func, - 'has_name' => (boolean) $has_name ); - } - - function remove_shortcode( $tag ) { - unset( $this->shortcode_tags[$tag] ); - } - - function normalize_shortcode( $content ) { - if ( empty( $this->shortcode_tags ) || ! is_array( $this->shortcode_tags ) ) - return $content; - - $pattern = $this->get_shortcode_regex(); - return preg_replace_callback( '/' . $pattern . '/s', - array( &$this, 'normalize_space_cb' ), $content ); - } - - function normalize_space_cb( $m ) { - // allow [[foo]] syntax for escaping a tag - if ( $m[1] == '[' && $m[6] == ']' ) - return $m[0]; - - $tag = $m[2]; - $attr = trim( preg_replace( '/\s+/', ' ', $m[3] ) ); - $content = trim( $m[5] ); - - $result = $m[1] . '[' . $tag - . ( $attr ? ' ' . $attr : '' ) - . ( $m[4] ? ' ' . $m[4] : '' ) - . ']' - . ( $content ? $content . '[/' . $tag . ']' : '' ) - . $m[6]; - - return $result; - } - - function do_shortcode( $content, $exec = true ) { - $this->exec = (bool) $exec; - $this->scanned_tags = array(); - - if ( empty( $this->shortcode_tags ) || ! is_array( $this->shortcode_tags ) ) - return $content; - - $pattern = $this->get_shortcode_regex(); - return preg_replace_callback( '/' . $pattern . '/s', - array( &$this, 'do_shortcode_tag' ), $content ); - } - - function scan_shortcode( $content ) { - $this->do_shortcode( $content, false ); - return $this->scanned_tags; - } - - function get_shortcode_regex() { - $tagnames = array_keys( $this->shortcode_tags ); - $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); - - return '(\[?)' - . '\[(' . $tagregexp . ')(?:\s(.*?))?(?:\s(\/))?\]' - . '(?:([^[]*?)\[\/\2\])?' - . '(\]?)'; - } - - function do_shortcode_tag( $m ) { - // allow [[foo]] syntax for escaping a tag - if ( $m[1] == '[' && $m[6] == ']' ) { - return substr( $m[0], 1, -1 ); - } - - $tag = $m[2]; - $attr = $this->shortcode_parse_atts( $m[3] ); - - $scanned_tag = array(); - $scanned_tag['type'] = $tag; - - if ( is_array( $attr ) ) { - if ( is_array( $attr['options'] ) ) { - if ( $this->shortcode_tags[$tag]['has_name'] && ! empty( $attr['options'] ) ) { - $scanned_tag['name'] = array_shift( $attr['options'] ); - - if ( ! wpcf7_is_name( $scanned_tag['name'] ) ) - return $m[0]; // Invalid name is used. Ignore this tag. - } - - $scanned_tag['options'] = (array) $attr['options']; - } - - $scanned_tag['raw_values'] = (array) $attr['values']; - - if ( WPCF7_USE_PIPE ) { - $pipes = new WPCF7_Pipes( $scanned_tag['raw_values'] ); - $scanned_tag['values'] = $pipes->collect_befores(); - $scanned_tag['pipes'] = $pipes; - } else { - $scanned_tag['values'] = $scanned_tag['raw_values']; - } - - $scanned_tag['labels'] = $scanned_tag['values']; - - } else { - $scanned_tag['attr'] = $attr; - } - - $content = trim( $m[5] ); - $content = preg_replace( "/$/m", '', $content ); - $scanned_tag['content'] = $content; - - $scanned_tag = apply_filters( 'wpcf7_form_tag', $scanned_tag, $this->exec ); - - $this->scanned_tags[] = $scanned_tag; - - if ( $this->exec ) { - $func = $this->shortcode_tags[$tag]['function']; - return $m[1] . call_user_func( $func, $scanned_tag ) . $m[6]; - } else { - return $m[0]; - } - } - - function shortcode_parse_atts( $text ) { - $atts = array( 'options' => array(), 'values' => array() ); - $text = preg_replace( "/[\x{00a0}\x{200b}]+/u", " ", $text ); - $text = stripcslashes( trim( $text ) ); - - $pattern = '%^([-+*=0-9a-zA-Z:.!?#$&@_/|\%\s]*?)((?:\s*"[^"]*"|\s*\'[^\']*\')*)$%'; - - if ( preg_match( $pattern, $text, $match ) ) { - if ( ! empty( $match[1] ) ) { - $atts['options'] = preg_split( '/[\s]+/', trim( $match[1] ) ); - } - if ( ! empty( $match[2] ) ) { - preg_match_all( '/"[^"]*"|\'[^\']*\'/', $match[2], $matched_values ); - $atts['values'] = wpcf7_strip_quote_deep( $matched_values[0] ); - } - } else { - $atts = $text; - } - - return $atts; - } - -} - -$wpcf7_shortcode_manager = new WPCF7_ShortcodeManager(); - -function wpcf7_add_shortcode( $tag, $func, $has_name = false ) { - global $wpcf7_shortcode_manager; - - return $wpcf7_shortcode_manager->add_shortcode( $tag, $func, $has_name ); -} - -function wpcf7_remove_shortcode( $tag ) { - global $wpcf7_shortcode_manager; - - return $wpcf7_shortcode_manager->remove_shortcode( $tag ); -} - -function wpcf7_do_shortcode( $content ) { - global $wpcf7_shortcode_manager; - - return $wpcf7_shortcode_manager->do_shortcode( $content ); -} - -function wpcf7_get_shortcode_regex() { - global $wpcf7_shortcode_manager; - - return $wpcf7_shortcode_manager->get_shortcode_regex(); -} - -?> \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/includes/taggenerator.php b/src/wp-content/plugins/contact-form-7/includes/taggenerator.php deleted file mode 100644 index beb41f8f..00000000 --- a/src/wp-content/plugins/contact-form-7/includes/taggenerator.php +++ /dev/null @@ -1,49 +0,0 @@ - $title, - 'content' => $elm_id, - 'options' => $options ); - - if ( is_callable( $callback ) ) - add_action( 'wpcf7_admin_footer', $callback ); - - return true; -} - -function wpcf7_print_tag_generators() { - global $wpcf7_tag_generators; - - $output = array(); - - foreach ( (array) $wpcf7_tag_generators as $name => $tg ) { - $pane = " " . esc_js( $name ) . ": { "; - $pane .= "title: '" . esc_js( $tg['title'] ) . "'"; - $pane .= ", content: '" . esc_js( $tg['content'] ) . "'"; - - foreach ( (array) $tg['options'] as $option_name => $option_value ) { - if ( is_int( $option_value ) ) - $pane .= ", $option_name: $option_value"; - else - $pane .= ", $option_name: '" . esc_js( $option_value ) . "'"; - } - - $pane .= " }"; - - $output[] = $pane; - } - - echo implode( ",\n", $output ) . "\n"; -} - -?> \ No newline at end of file diff --git a/src/wp-content/plugins/contact-form-7/jquery.form.js b/src/wp-content/plugins/contact-form-7/jquery.form.js deleted file mode 100644 index 66ac5142..00000000 --- a/src/wp-content/plugins/contact-form-7/jquery.form.js +++ /dev/null @@ -1,911 +0,0 @@ -/*! - * jQuery Form Plugin - * version: 2.83 (11-JUL-2011) - * @requires jQuery v1.3.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function(e) { - e.preventDefault(); // <-- important - $(this).ajaxSubmit({ - target: '#output' - }); - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - var method, action, url, $form = this; - - if (typeof options == 'function') { - options = { success: options }; - } - - method = this.attr('method'); - action = this.attr('action'); - url = (typeof action === 'string') ? $.trim(action) : ''; - url = url || window.location.href || ''; - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/)||[])[1]; - } - - options = $.extend(true, { - url: url, - success: $.ajaxSettings.success, - type: method || 'GET', - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var n,v,a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) { - a.push( { name: n, value: options.data[n][k] } ); - } - } - else { - v = options.data[n]; - v = $.isFunction(v) ? v() : v; // if value is fn, invoke it - a.push( { name: n, value: v } ); - } - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else { - options.data = q; // data is the query string for 'post' - } - - var callbacks = []; - if (options.resetForm) { - callbacks.push(function() { $form.resetForm(); }); - } - if (options.clearForm) { - callbacks.push(function() { $form.clearForm(); }); - } - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - var fn = options.replaceTarget ? 'replaceWith' : 'html'; - $(options.target)[fn](data).each(oldSuccess, arguments); - }); - } - else if (options.success) { - callbacks.push(options.success); - } - - options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg - var context = options.context || options; // jQuery 1.4+ supports scope context - for (var i=0, max=callbacks.length; i < max; i++) { - callbacks[i].apply(context, [data, status, xhr || $form, $form]); - } - }; - - // are there files to upload? - var fileInputs = $('input:file', this).length > 0; - var mp = 'multipart/form-data'; - var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if (options.iframe !== false && (fileInputs || options.iframe || multipart)) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) { - $.get(options.closeKeepAlive, function() { fileUpload(a); }); - } - else { - fileUpload(a); - } - } - else { - // IE7 massage (see issue 57) - if ($.browser.msie && method == 'get') { - var ieMeth = $form[0].getAttribute('method'); - if (typeof ieMeth === 'string') - options.type = ieMeth; - } - $.ajax(options); - } - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload(a) { - var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; - var useProp = !!$.fn.prop; - - if (a) { - // ensure that every serialized input is still enabled - for (i=0; i < a.length; i++) { - el = $(form[a[i].name]); - el[ useProp ? 'prop' : 'attr' ]('disabled', false); - } - } - - if ($(':input[name=submit],:input[id=submit]', form).length) { - // if there is an input with a name or id of 'submit' then we won't be - // able to invoke the submit fn on the form (at least not x-browser) - alert('Error: Form elements must not have name or id of "submit".'); - return; - } - - s = $.extend(true, {}, $.ajaxSettings, options); - s.context = s.context || s; - id = 'jqFormIO' + (new Date().getTime()); - if (s.iframeTarget) { - $io = $(s.iframeTarget); - n = $io.attr('name'); - if (n == null) - $io.attr('name', id); - else - id = n; - } - else { - $io = $('