diff --git a/información/LQDVI-mapa.jpg b/información/LQDVI-mapa.jpg
new file mode 100644
index 00000000..17cf3a32
Binary files /dev/null and b/información/LQDVI-mapa.jpg differ
diff --git a/información/guinea-1.JPG b/información/guinea-1.JPG
new file mode 100644
index 00000000..8d1b54aa
Binary files /dev/null and b/información/guinea-1.JPG differ
diff --git a/información/guinea-2.JPG b/información/guinea-2.JPG
new file mode 100644
index 00000000..632f982c
Binary files /dev/null and b/información/guinea-2.JPG differ
diff --git a/información/kliquers-1.JPG b/información/kliquers-1.JPG
new file mode 100644
index 00000000..13b1f135
Binary files /dev/null and b/información/kliquers-1.JPG differ
diff --git a/información/kliquers-2.JPG b/información/kliquers-2.JPG
new file mode 100644
index 00000000..b20032b6
Binary files /dev/null and b/información/kliquers-2.JPG differ
diff --git a/referencia/webcam/web-cam-capture-phpflash.zip b/referencia/webcam/web-cam-capture-phpflash.zip
new file mode 100644
index 00000000..24d91495
Binary files /dev/null and b/referencia/webcam/web-cam-capture-phpflash.zip differ
diff --git a/src/webcam/GUID.as b/src/webcam/GUID.as
new file mode 100644
index 00000000..be350800
--- /dev/null
+++ b/src/webcam/GUID.as
@@ -0,0 +1 @@
+package {
import flash.display.Sprite;
import flash.system.Capabilities;
public class GUID extends Sprite {
private static var counter:Number = 0;
function GUID(){
}
public static function create():String {
var dt:Date = new Date();
var id1:Number = dt.getTime();
var id2:Number = Math.random()*Number.MAX_VALUE;
var id3:String = Capabilities.serverString;
var rawID:String = calculate(id1+id3+id2+counter++).toUpperCase();
var finalString:String = rawID.substring(0, 8) + "-" + rawID.substring(8, 12) + "-" + rawID.substring(12, 16) + "-" + rawID.substring(16, 20) + "-" + rawID.substring(20, 32);
return finalString;
}
private static function calculate(src:String):String {
return hex_sha1(src);
}
private static function hex_sha1(src:String):String {
return binb2hex(core_sha1(str2binb(src), src.length*8));
}
private static function core_sha1(x:Array, len:Number):Array {
x[len >> 5] |= 0x80 << (24-len%32);
x[((len+64 >> 9) << 4)+15] = len;
var w:Array = new Array(80), a:Number = 1732584193;
var b:Number = -271733879, c:Number = -1732584194;
var d:Number = 271733878, e:Number = -1009589776;
for (var i:Number = 0; i> 16)+(y >> 16)+(lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
private static function rol(num:Number, cnt:Number):Number {
return (num << cnt) | (num >>> (32-cnt));
}
private static function str2binb(str:String):Array {
var bin:Array = new Array();
var mask:Number = (1 << 8)-1;
for (var i:Number = 0; i> 5] |= (str.charCodeAt(i/8) & mask) << (24-i%32);
}
return bin;
}
private static function binb2hex(binarray:Array):String {
var str:String = new String("");
var tab:String = new String("0123456789abcdef");
for (var i:Number = 0; i> 2] >> ((3-i%4)*8+4)) & 0xF) + tab.charAt((binarray[i >> 2] >> ((3-i%4)*8)) & 0xF);
}
return str;
}
}
}
\ No newline at end of file
diff --git a/src/webcam/ReadMe.pdf b/src/webcam/ReadMe.pdf
new file mode 100644
index 00000000..ac20c260
Binary files /dev/null and b/src/webcam/ReadMe.pdf differ
diff --git a/src/webcam/getwebcamdata.php b/src/webcam/getwebcamdata.php
new file mode 100644
index 00000000..10d36a91
--- /dev/null
+++ b/src/webcam/getwebcamdata.php
@@ -0,0 +1,111 @@
+pixelData from swf
+ /// Image Save Path
+ /// Image Width
+ /// Image Height
+ if ((!is_null($height)) && (!is_null($width)) &&
+ (!is_null($guid)) && (!is_null($pixels))) {
+ GetPixelAndSave($fileName, $pixels, $width, $height);
+ } else {
+ die ('ERROR');
+ }
+
+
+function GetPixelAndSave($fileName, $pixels, $width, $height)
+{
+ $pixelsLen = strlen($pixels);
+ $x = 0;
+ $y = 0;
+
+ $im = imagecreatetruecolor($width, $height);
+
+ for ($i = 0; $i < $pixelsLen / 6; $i++) {
+ $curPixelColor = substr($pixels, $i * 6, 6);
+ $rgb_arr = html2rgb ("#".$curPixelColor);
+ $color = imagecolorallocate( $im, $rgb_arr[0], $rgb_arr[1], $rgb_arr[2] );
+ imagesetpixel( $im, $x, $y, $color );
+
+ if ($x == $width - 1)
+ {
+ $x = 0;
+ $y++;
+ }
+ else
+ {
+ $x++;
+ }
+ }
+
+ // start buffering
+ ob_start();
+ // output jpeg (or any other chosen) format & quality
+ imagejpeg($im, NULL, 85);
+ // capture output to string
+ $contents = ob_get_contents();
+ // end capture
+ ob_end_clean();
+ // free up memory
+ imagedestroy($im);
+
+ $fh = fopen($fileName, "a+" );
+ fwrite( $fh, $contents );
+ fclose( $fh );
+
+ //$fh = fopen("images/cap-test.jpg", "w" );
+ //fwrite( $fh, $contents );
+ //fclose( $fh );
+
+}
+
+function html2rgb($color)
+{
+ if ($color[0] == '#')
+ $color = substr($color, 1);
+
+ if (strlen($color) == 6)
+ list($r, $g, $b) = array($color[0].$color[1],
+ $color[2].$color[3],
+ $color[4].$color[5]);
+ elseif (strlen($color) == 3)
+ list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
+ else
+ return false;
+
+ $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);
+
+ return array($r, $g, $b);
+}
+
+?>
\ No newline at end of file
diff --git a/src/webcam/webCamCapture.fla b/src/webcam/webCamCapture.fla
new file mode 100644
index 00000000..b9e24b73
Binary files /dev/null and b/src/webcam/webCamCapture.fla differ
diff --git a/src/webcam/webCamCapture.swf b/src/webcam/webCamCapture.swf
new file mode 100644
index 00000000..2020f67e
Binary files /dev/null and b/src/webcam/webCamCapture.swf differ
diff --git a/src/wp-content/plugins/contact-form-7-modules/hidden.php b/src/wp-content/plugins/contact-form-7-modules/hidden.php
new file mode 100644
index 00000000..714a68c4
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7-modules/hidden.php
@@ -0,0 +1,183 @@
+';
+ if(file_exists(WP_PLUGIN_DIR.'/contact-form-7/wp-contact-form-7.php')) {
+ $out .= 'The Contact Form 7 is installed, but you must activate Contact Form 7 below for the Hidden Fields Module to work.';
+ } else {
+ $out .= 'The Contact Form 7 plugin must be installed for the Hidden Fields Module to work. Install Now. ';
+ }
+ $out .= '
';
+ echo $out;
+ }
+ }
+}
+
+/**
+** A base module for [hidden], [hidden*]
+**/
+
+/* Shortcode handler */
+
+function wpcf7_hidden_shortcode_handler( $tag ) {
+ if ( ! is_array( $tag ) )
+ return '';
+
+ $type = $tag['type'];
+ $name = $tag['name'];
+ $options = (array) $tag['options'];
+ $values = (array) $tag['values'];
+
+ if ( empty( $name ) )
+ return '';
+
+ $atts = '';
+ $id_att = '';
+ $class_att = '';
+ $size_att = '';
+ $maxlength_att = '';
+ $tabindex_att = '';
+ $title_att = '';
+
+ $class_att .= ' wpcf7-hidden';
+
+ if ( 'hidden*' == $type )
+ $class_att .= ' wpcf7-validates-as-required';
+
+ foreach ( $options as $option ) {
+ if ( preg_match( '%^id:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
+ $id_att = $matches[1];
+
+ } elseif ( preg_match( '%^class:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
+ $class_att .= ' ' . $matches[1];
+ }
+ }
+
+ $value = (string) reset( $values );
+
+ if ( wpcf7_script_is() && $value && preg_grep( '%^watermark$%', $options ) ) {
+ $class_att .= ' wpcf7-use-title-as-watermark';
+ $title_att .= sprintf( ' %s', $value );
+ $value = '';
+ }
+
+ if ( wpcf7_is_posted() )
+ $value = stripslashes_deep( $_POST[$name] );
+
+ if ( $id_att ) {
+ $id_att = trim( $id_att );
+ $atts .= ' id="' . trim( $id_att ) . '"';
+ }
+ if ( $class_att )
+ $atts .= ' class="' . trim( $class_att ) . '"';
+
+ global $post;
+ if(is_object($post)) {
+ if (strtolower($value) == 'post_title' || strtolower($value) == 'post-title') { $value = $post->post_title; }
+ if (strtolower($value) == 'post_url') { $value = $post->guid; }
+ if (strtolower($value) == 'post_category') {
+ $categories = get_the_category();$catnames = array();
+ foreach($categories as $cat) { $catnames[] = $cat->cat_name; }
+ if(is_array($catnames)) { $value = implode(', ', $catnames); }
+ }
+ if (strtolower($value) == 'post_author') { $value = $post->post_author; }
+ if (strtolower($value) == 'post_date') { $value = $post->post_date; }
+ if (preg_match('/^custom_field\-(.*?)$/ism', $value)) {
+ $custom_field = preg_replace('/custom_field\-(.*?)/ism', '$1', $value);
+ $value = get_post_meta($post->ID, $custom_field, true) ? get_post_meta($post->ID, $custom_field, true) : '';
+ }
+ }
+
+ $value = apply_filters('wpcf7_hidden_field_value', apply_filters('wpcf7_hidden_field_value_'.$id_att, $value));
+
+ $html = ' ';
+
+ return $html;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_hidden', 30 );
+
+function wpcf7_add_tag_generator_hidden() {
+ if(function_exists('wpcf7_add_tag_generator')) {
+ wpcf7_add_tag_generator( 'hidden', __( 'Hidden field', 'wpcf7' ),
+ 'wpcf7-tg-pane-hidden', 'wpcf7_tg_pane_hidden' );
+ }
+}
+
+function wpcf7_tg_pane_hidden() {
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7-modules/readme.txt b/src/wp-content/plugins/contact-form-7-modules/readme.txt
new file mode 100644
index 00000000..5fedc715
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7-modules/readme.txt
@@ -0,0 +1,75 @@
+=== Contact Form 7 Modules ===
+Tags: form, forms, contact form 7, contactform7, contact form, hidden fields, hidden, cf7, cforms ii, cforms, Contact Forms 7, Contact Forms, contacted, contacts
+Requires at least: 2.8
+Tested up to: 3.1
+Stable tag: trunk
+Contributors: katzwebdesign
+Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zackkatz%40gmail%2ecom&item_name=Contact%20Form%207%20Modules&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
+
+Contact Form 7 - Add modules such as hidden fields to the Contact Form 7 plugin for more informative form contacts
+
+== Description ==
+
+### Add Hidden Fields to Contact Form 7
+
+The Contact Form 7 plugin has over 2.8 million downloads, yet the great plugin still lacks a simple feature: hidden fields. This plugin adds hidden fields to Contact Form 7 once and for all.
+
+#### Inserting dynamic values
+
+You can also choose to have the value of the hidden field dynamically populated in your form when you are contacted. To do so, choose the "Default value" to be:
+
+* `post_title` - Inserts the title of the post/page
+* `post_category` - The categories of the post or page
+* `post_url` - The URL of the post or page
+* `post_author` - The author of the post or page
+* `custom_field-[Name]` - The value of a post or page's custom field. If you had a custom field "Foo", you would use the following as the hidden field value: `custom_field-Foo`
+
+You can also use a filter: hook into the `wpcf7_hidden_field_value` filter to modify the value of the hidden field using add_filter() . If you know the ID of the input, you can also use the `wpcf7_hidden_field_value_[#ID]` filter.
+
+Now, when someone contacts you using your Contact Form 7 contact form, you can have lots more information about their visit - and you'll see it when you receive the email that tells you you've been contacted.
+
+
+
+== Installation ==
+
+1. Upload plugin files to your plugins folder, or install using WordPress' built-in Add New Plugin installer
+1. Activate the plugin
+1. Edit a form in Contact Form 7
+1. Choose "Hidden field" from the Generate Tag dropdown
+1. Follow the instructions on the page
+
+== Screenshots ==
+
+1. The new Hidden fields tag generator
+
+== Frequently Asked Questions ==
+
+= What is the plugin license? =
+
+* This plugin is released under a GPL license.
+
+== Changelog ==
+
+= 1.1.1 =
+* Fixed `Parameter 1 to wpcf7_add_tag_generator_hidden() expected to be a reference, value given` error, as reported by BDN Online
+
+= 1.1 =
+* Added support for using post titles as hidden fields
+* Added support for using custom field values as hidden fields
+* Added `wpcf7_hidden_field_value` filter to hook into using add_filter()
+
+= 1.0 =
+* Initial plugin release.
+
+== Upgrade Notice ==
+
+= 1.1.1 =
+* Fixed `Parameter 1 to wpcf7_add_tag_generator_hidden() expected to be a reference, value given` error, as reported by BDN Online
+
+= 1.1 =
+* Added support for using post titles as hidden fields
+* Added support for using custom field values as hidden fields
+* Added `wpcf7_hidden_field_value` filter to hook into using add_filter()
+
+= 1.0 =
+* Woot!
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7-modules/screenshot-1.jpg b/src/wp-content/plugins/contact-form-7-modules/screenshot-1.jpg
new file mode 100644
index 00000000..58cf2fae
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7-modules/screenshot-1.jpg differ
diff --git a/src/wp-content/plugins/contact-form-7/admin/admin.php b/src/wp-content/plugins/contact-form-7/admin/admin.php
new file mode 100644
index 00000000..e4596dd2
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/admin/admin.php
@@ -0,0 +1,370 @@
+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
new file mode 100644
index 00000000..2877fcc5
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/admin/edit.php
@@ -0,0 +1,351 @@
+ 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' );
+ }
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $locale ) : ?>
+
+
+
+
+
+
+
+
diff --git a/src/wp-content/plugins/contact-form-7/admin/scripts.js b/src/wp-content/plugins/contact-form-7/admin/scripts.js
new file mode 100644
index 00000000..dee427f5
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/admin/scripts.js
@@ -0,0 +1,116 @@
+(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
new file mode 100644
index 00000000..831d02b9
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/admin/styles-rtl.css
@@ -0,0 +1,22 @@
+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
new file mode 100644
index 00000000..958de7c9
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/admin/styles.css
@@ -0,0 +1,248 @@
+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
new file mode 100644
index 00000000..dc01fe9e
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/admin/taggenerator.js
@@ -0,0 +1,262 @@
+(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
new file mode 100644
index 00000000..f2cfafd6
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/images/ajax-loader.gif differ
diff --git a/src/wp-content/plugins/contact-form-7/images/dropdown.gif b/src/wp-content/plugins/contact-form-7/images/dropdown.gif
new file mode 100644
index 00000000..a342dfdf
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/images/dropdown.gif differ
diff --git a/src/wp-content/plugins/contact-form-7/includes/classes.php b/src/wp-content/plugins/contact-form-7/includes/classes.php
new file mode 100644
index 00000000..f372b24e
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/classes.php
@@ -0,0 +1,645 @@
+unit_tag == $_POST['_wpcf7_unit_tag'] )
+ return true;
+
+ return false;
+ }
+
+ function clear_post() {
+ $fes = $this->form_scan_shortcode();
+
+ foreach ( $fes as $fe ) {
+ $name = $fe['name'];
+
+ if ( empty( $name ) )
+ continue;
+
+ 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 ( ! 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
new file mode 100644
index 00000000..b18e607a
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/controller.php
@@ -0,0 +1,288 @@
+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 '' . $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
new file mode 100644
index 00000000..8584d5c1
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/formatting.php
@@ -0,0 +1,144 @@
+\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( '!(' . $allblocks . '>)!', "$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( '!([^<]+)(div|address|form|fieldset)>!', "
$1
$2>", $pee );
+ $pee = preg_replace( '!\s*(?' . $allblocks . '[^>]*>)\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*(?' . $allblocks . '[^>]*>)!', "$1", $pee );
+ $pee = preg_replace( '!(?' . $allblocks . '[^>]*>)\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( '!(?' . $allblocks . '[^>]*>)\s* !', "$1", $pee );
+ $pee = preg_replace( '! (\s*?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$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
new file mode 100644
index 00000000..604c04b2
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/functions.php
@@ -0,0 +1,226 @@
+ 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
new file mode 100644
index 00000000..bd88ed9e
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/pipe.php
@@ -0,0 +1,67 @@
+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
new file mode 100644
index 00000000..d4692f60
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/shortcodes.php
@@ -0,0 +1,185 @@
+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(\/))?\]'
+ . '(?:((?!.*?\[(?:' . $tagregexp . ')\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
new file mode 100644
index 00000000..beb41f8f
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/includes/taggenerator.php
@@ -0,0 +1,49 @@
+ $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
new file mode 100644
index 00000000..2be0471c
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/jquery.form.js
@@ -0,0 +1,825 @@
+/*!
+ * jQuery Form Plugin
+ * version: 2.72 (28-APR-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;
+ }
+
+ if (typeof options == 'function') {
+ options = { success: options };
+ }
+
+ var action = this.attr('action');
+ var url = (typeof action === 'string') ? $.trim(action) : '';
+ if (url) {
+ // clean url (don't include hash vaue)
+ url = (url.match(/^([^#]+)/)||[])[1];
+ }
+ url = url || window.location.href || '';
+
+ options = $.extend(true, {
+ url: url,
+ success: $.ajaxSettings.success,
+ type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
+ 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 $form = this, 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, fileUpload);
+ }
+ else {
+ fileUpload();
+ }
+ }
+ else {
+ $.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() {
+ var form = $form[0];
+
+ 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;
+ }
+
+ var s = $.extend(true, {}, $.ajaxSettings, options);
+ s.context = s.context || s;
+ var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id;
+ var $io = $('');
+ var io = $io[0];
+
+ $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
+
+ var xhr = { // mock object
+ aborted: 0,
+ responseText: null,
+ responseXML: null,
+ status: 0,
+ statusText: 'n/a',
+ getAllResponseHeaders: function() {},
+ getResponseHeader: function() {},
+ setRequestHeader: function() {},
+ abort: function(status) {
+ var e = (status === 'timeout' ? 'timeout' : 'aborted');
+ log('aborting upload... ' + e);
+ this.aborted = 1;
+ $io.attr('src', s.iframeSrc); // abort op in progress
+ xhr.error = e;
+ s.error && s.error.call(s.context, xhr, e, e);
+ g && $.event.trigger("ajaxError", [xhr, s, e]);
+ s.complete && s.complete.call(s.context, xhr, e);
+ }
+ };
+
+ var g = s.global;
+ // trigger ajax global events so that activity/block indicators work like normal
+ if (g && ! $.active++) {
+ $.event.trigger("ajaxStart");
+ }
+ if (g) {
+ $.event.trigger("ajaxSend", [xhr, s]);
+ }
+
+ if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
+ if (s.global) {
+ $.active--;
+ }
+ return;
+ }
+ if (xhr.aborted) {
+ return;
+ }
+
+ var timedOut = 0, timeoutHandle;
+
+ // add submitting element to data if we know it
+ var sub = form.clk;
+ if (sub) {
+ var n = sub.name;
+ if (n && !sub.disabled) {
+ s.extraData = s.extraData || {};
+ s.extraData[n] = sub.value;
+ if (sub.type == "image") {
+ s.extraData[n+'.x'] = form.clk_x;
+ s.extraData[n+'.y'] = form.clk_y;
+ }
+ }
+ }
+
+ // take a breath so that pending repaints get some cpu time before the upload starts
+ function doSubmit() {
+ // make sure form attrs are set
+ var t = $form.attr('target'), a = $form.attr('action');
+
+ // update form attrs in IE friendly way
+ form.setAttribute('target',id);
+ if (form.getAttribute('method') != 'POST') {
+ form.setAttribute('method', 'POST');
+ }
+ if (form.getAttribute('action') != s.url) {
+ form.setAttribute('action', s.url);
+ }
+
+ // ie borks in some cases when setting encoding
+ if (! s.skipEncodingOverride) {
+ $form.attr({
+ encoding: 'multipart/form-data',
+ enctype: 'multipart/form-data'
+ });
+ }
+
+ // support timout
+ if (s.timeout) {
+ timeoutHandle = setTimeout(function() { timedOut = true; cb(true); }, s.timeout);
+ }
+
+ // add "extra" data to form if provided in options
+ var extraInputs = [];
+ try {
+ if (s.extraData) {
+ for (var n in s.extraData) {
+ extraInputs.push(
+ $(' ')
+ .appendTo(form)[0]);
+ }
+ }
+
+ // add iframe to doc and submit the form
+ $io.appendTo('body');
+ io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
+ form.submit();
+ }
+ finally {
+ // reset attrs and remove "extra" input elements
+ form.setAttribute('action',a);
+ if(t) {
+ form.setAttribute('target', t);
+ } else {
+ $form.removeAttr('target');
+ }
+ $(extraInputs).remove();
+ }
+ }
+
+ if (s.forceSync) {
+ doSubmit();
+ }
+ else {
+ setTimeout(doSubmit, 10); // this lets dom updates render
+ }
+
+ var data, doc, domCheckCount = 50, callbackProcessed;
+
+ function cb(e) {
+ if (xhr.aborted || callbackProcessed) {
+ return;
+ }
+ if (e === true && xhr) {
+ xhr.abort('timeout');
+ return;
+ }
+
+ var doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
+ if (!doc || doc.location.href == s.iframeSrc) {
+ // response not received yet
+ if (!timedOut)
+ return;
+ }
+ io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
+
+ var ok = true;
+ try {
+ if (timedOut) {
+ throw 'timeout';
+ }
+
+ var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
+ log('isXml='+isXml);
+ if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
+ if (--domCheckCount) {
+ // in some browsers (Opera) the iframe DOM is not always traversable when
+ // the onload callback fires, so we loop a bit to accommodate
+ log('requeing onLoad callback, DOM not available');
+ setTimeout(cb, 250);
+ return;
+ }
+ // let this fall through because server response could be an empty document
+ //log('Could not access iframe DOM after mutiple tries.');
+ //throw 'DOMException: not available';
+ }
+
+ //log('response detected');
+ xhr.responseText = doc.body ? doc.body.innerHTML : doc.documentElement ? doc.documentElement.innerHTML : null;
+ xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
+ if (!xhr.responseText && xhr.responseXML && !s.dataType)
+ s.dataType = 'xml';
+ xhr.getResponseHeader = function(header){
+ var headers = {'content-type': s.dataType};
+ return headers[header];
+ };
+
+ var scr = /(json|script|text)/.test(s.dataType);
+ if (scr || s.textarea) {
+ // see if user embedded response in textarea
+ var ta = doc.getElementsByTagName('textarea')[0];
+ if (ta) {
+ xhr.responseText = ta.value;
+ }
+ else if (scr) {
+ // account for browsers injecting pre around json response
+ var pre = doc.getElementsByTagName('pre')[0];
+ var b = doc.getElementsByTagName('body')[0];
+ if (pre) {
+ xhr.responseText = pre.textContent;
+ }
+ else if (b) {
+ xhr.responseText = b.innerHTML;
+ }
+ }
+ }
+ else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
+ xhr.responseXML = toXml(xhr.responseText);
+ }
+
+ data = httpData(xhr, s.dataType, s);
+ }
+ catch(e){
+ log('error caught:',e);
+ ok = false;
+ xhr.error = e;
+ s.error && s.error.call(s.context, xhr, 'error', e);
+ g && $.event.trigger("ajaxError", [xhr, s, e]);
+ }
+
+ if (xhr.aborted) {
+ log('upload aborted');
+ ok = false;
+ }
+
+ // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
+ if (ok) {
+ s.success && s.success.call(s.context, data, 'success', xhr);
+ g && $.event.trigger("ajaxSuccess", [xhr, s]);
+ }
+
+ g && $.event.trigger("ajaxComplete", [xhr, s]);
+
+ if (g && ! --$.active) {
+ $.event.trigger("ajaxStop");
+ }
+
+ s.complete && s.complete.call(s.context, xhr, ok ? 'success' : 'error');
+
+ callbackProcessed = true;
+ if (s.timeout)
+ clearTimeout(timeoutHandle);
+
+ // clean up
+ setTimeout(function() {
+ $io.removeData('form-plugin-onload');
+ $io.remove();
+ xhr.responseXML = null;
+ }, 100);
+ }
+
+ var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
+ if (window.ActiveXObject) {
+ doc = new ActiveXObject('Microsoft.XMLDOM');
+ doc.async = 'false';
+ doc.loadXML(s);
+ }
+ else {
+ doc = (new DOMParser()).parseFromString(s, 'text/xml');
+ }
+ return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
+ };
+ var parseJSON = $.parseJSON || function(s) {
+ return window['eval']('(' + s + ')');
+ };
+
+ var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
+ var ct = xhr.getResponseHeader('content-type') || '',
+ xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if (xml && data.documentElement.nodeName === 'parsererror') {
+ $.error && $.error('parsererror');
+ }
+ if (s && s.dataFilter) {
+ data = s.dataFilter(data, type);
+ }
+ if (typeof data === 'string') {
+ if (type === 'json' || !type && ct.indexOf('json') >= 0) {
+ data = parseJSON(data);
+ } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
+ $.globalEval(data);
+ }
+ }
+ return data;
+ };
+ }
+};
+
+/**
+ * ajaxForm() provides a mechanism for fully automating form submission.
+ *
+ * The advantages of using this method instead of ajaxSubmit() are:
+ *
+ * 1: This method will include coordinates for elements (if the element
+ * is used to submit the form).
+ * 2. This method will include the submit element's name/value data (for the element that was
+ * used to submit the form).
+ * 3. This method binds the submit() method to the form for you.
+ *
+ * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
+ * passes the options argument along after properly binding events for submit elements and
+ * the form itself.
+ */
+$.fn.ajaxForm = function(options) {
+ // in jQuery 1.3+ we can fix mistakes with the ready state
+ if (this.length === 0) {
+ var o = { s: this.selector, c: this.context };
+ if (!$.isReady && o.s) {
+ log('DOM not ready, queuing ajaxForm');
+ $(function() {
+ $(o.s,o.c).ajaxForm(options);
+ });
+ return this;
+ }
+ // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
+ log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
+ return this;
+ }
+
+ return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
+ if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
+ e.preventDefault();
+ $(this).ajaxSubmit(options);
+ }
+ }).bind('click.form-plugin', function(e) {
+ var target = e.target;
+ var $el = $(target);
+ if (!($el.is(":submit,input:image"))) {
+ // is this a child element of the submit el? (ex: a span within a button)
+ var t = $el.closest(':submit');
+ if (t.length == 0) {
+ return;
+ }
+ target = t[0];
+ }
+ var form = this;
+ form.clk = target;
+ if (target.type == 'image') {
+ if (e.offsetX != undefined) {
+ form.clk_x = e.offsetX;
+ form.clk_y = e.offsetY;
+ } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
+ var offset = $el.offset();
+ form.clk_x = e.pageX - offset.left;
+ form.clk_y = e.pageY - offset.top;
+ } else {
+ form.clk_x = e.pageX - target.offsetLeft;
+ form.clk_y = e.pageY - target.offsetTop;
+ }
+ }
+ // clear form vars
+ setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
+ });
+};
+
+// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
+$.fn.ajaxFormUnbind = function() {
+ return this.unbind('submit.form-plugin click.form-plugin');
+};
+
+/**
+ * formToArray() gathers form element data into an array of objects that can
+ * be passed to any of the following ajax functions: $.get, $.post, or load.
+ * Each object in the array has both a 'name' and 'value' property. An example of
+ * an array for a simple login form might be:
+ *
+ * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
+ *
+ * It is this array that is passed to pre-submit callback functions provided to the
+ * ajaxSubmit() and ajaxForm() methods.
+ */
+$.fn.formToArray = function(semantic) {
+ var a = [];
+ if (this.length === 0) {
+ return a;
+ }
+
+ var form = this[0];
+ var els = semantic ? form.getElementsByTagName('*') : form.elements;
+ if (!els) {
+ return a;
+ }
+
+ var i,j,n,v,el,max,jmax;
+ for(i=0, max=els.length; i < max; i++) {
+ el = els[i];
+ n = el.name;
+ if (!n) {
+ continue;
+ }
+
+ if (semantic && form.clk && el.type == "image") {
+ // handle image inputs on the fly when semantic == true
+ if(!el.disabled && form.clk == el) {
+ a.push({name: n, value: $(el).val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ continue;
+ }
+
+ v = $.fieldValue(el, true);
+ if (v && v.constructor == Array) {
+ for(j=0, jmax=v.length; j < jmax; j++) {
+ a.push({name: n, value: v[j]});
+ }
+ }
+ else if (v !== null && typeof v != 'undefined') {
+ a.push({name: n, value: v});
+ }
+ }
+
+ if (!semantic && form.clk) {
+ // input type=='image' are not found in elements array! handle it here
+ var $input = $(form.clk), input = $input[0];
+ n = input.name;
+ if (n && !input.disabled && input.type == 'image') {
+ a.push({name: n, value: $input.val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ }
+ return a;
+};
+
+/**
+ * Serializes form data into a 'submittable' string. This method will return a string
+ * in the format: name1=value1&name2=value2
+ */
+$.fn.formSerialize = function(semantic) {
+ //hand off to jQuery.param for proper encoding
+ return $.param(this.formToArray(semantic));
+};
+
+/**
+ * Serializes all field elements in the jQuery object into a query string.
+ * This method will return a string in the format: name1=value1&name2=value2
+ */
+$.fn.fieldSerialize = function(successful) {
+ var a = [];
+ this.each(function() {
+ var n = this.name;
+ if (!n) {
+ return;
+ }
+ var v = $.fieldValue(this, successful);
+ if (v && v.constructor == Array) {
+ for (var i=0,max=v.length; i < max; i++) {
+ a.push({name: n, value: v[i]});
+ }
+ }
+ else if (v !== null && typeof v != 'undefined') {
+ a.push({name: this.name, value: v});
+ }
+ });
+ //hand off to jQuery.param for proper encoding
+ return $.param(a);
+};
+
+/**
+ * Returns the value(s) of the element in the matched set. For example, consider the following form:
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * var v = $(':text').fieldValue();
+ * // if no values are entered into the text inputs
+ * v == ['','']
+ * // if values entered into the text inputs are 'foo' and 'bar'
+ * v == ['foo','bar']
+ *
+ * var v = $(':checkbox').fieldValue();
+ * // if neither checkbox is checked
+ * v === undefined
+ * // if both checkboxes are checked
+ * v == ['B1', 'B2']
+ *
+ * var v = $(':radio').fieldValue();
+ * // if neither radio is checked
+ * v === undefined
+ * // if first radio is checked
+ * v == ['C1']
+ *
+ * The successful argument controls whether or not the field element must be 'successful'
+ * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
+ * The default value of the successful argument is true. If this value is false the value(s)
+ * for each element is returned.
+ *
+ * Note: This method *always* returns an array. If no valid value can be determined the
+ * array will be empty, otherwise it will contain one or more values.
+ */
+$.fn.fieldValue = function(successful) {
+ for (var val=[], i=0, max=this.length; i < max; i++) {
+ var el = this[i];
+ var v = $.fieldValue(el, successful);
+ if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
+ continue;
+ }
+ v.constructor == Array ? $.merge(val, v) : val.push(v);
+ }
+ return val;
+};
+
+/**
+ * Returns the value of the field element.
+ */
+$.fieldValue = function(el, successful) {
+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+ if (successful === undefined) {
+ successful = true;
+ }
+
+ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+ (t == 'checkbox' || t == 'radio') && !el.checked ||
+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+ tag == 'select' && el.selectedIndex == -1)) {
+ return null;
+ }
+
+ if (tag == 'select') {
+ var index = el.selectedIndex;
+ if (index < 0) {
+ return null;
+ }
+ var a = [], ops = el.options;
+ var one = (t == 'select-one');
+ var max = (one ? index+1 : ops.length);
+ for(var i=(one ? index : 0); i < max; i++) {
+ var op = ops[i];
+ if (op.selected) {
+ var v = op.value;
+ if (!v) { // extra pain for IE...
+ v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
+ }
+ if (one) {
+ return v;
+ }
+ a.push(v);
+ }
+ }
+ return a;
+ }
+ return $(el).val();
+};
+
+/**
+ * Clears the form data. Takes the following actions on the form's input fields:
+ * - input text fields will have their 'value' property set to the empty string
+ * - select elements will have their 'selectedIndex' property set to -1
+ * - checkbox and radio inputs will have their 'checked' property set to false
+ * - inputs of type submit, button, reset, and hidden will *not* be effected
+ * - button elements will *not* be effected
+ */
+$.fn.clearForm = function() {
+ return this.each(function() {
+ $('input,select,textarea', this).clearFields();
+ });
+};
+
+/**
+ * Clears the selected form elements.
+ */
+$.fn.clearFields = $.fn.clearInputs = function() {
+ return this.each(function() {
+ var t = this.type, tag = this.tagName.toLowerCase();
+ if (t == 'text' || t == 'password' || tag == 'textarea') {
+ this.value = '';
+ }
+ else if (t == 'checkbox' || t == 'radio') {
+ this.checked = false;
+ }
+ else if (tag == 'select') {
+ this.selectedIndex = -1;
+ }
+ });
+};
+
+/**
+ * Resets the form data. Causes all form elements to be reset to their original value.
+ */
+$.fn.resetForm = function() {
+ return this.each(function() {
+ // guard against an input with the name of 'reset'
+ // note that IE reports the reset function as an 'object'
+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
+ this.reset();
+ }
+ });
+};
+
+/**
+ * Enables or disables any matching elements.
+ */
+$.fn.enable = function(b) {
+ if (b === undefined) {
+ b = true;
+ }
+ return this.each(function() {
+ this.disabled = !b;
+ });
+};
+
+/**
+ * Checks/unchecks any matching checkboxes or radio buttons and
+ * selects/deselects and matching option elements.
+ */
+$.fn.selected = function(select) {
+ if (select === undefined) {
+ select = true;
+ }
+ return this.each(function() {
+ var t = this.type;
+ if (t == 'checkbox' || t == 'radio') {
+ this.checked = select;
+ }
+ else if (this.tagName.toLowerCase() == 'option') {
+ var $sel = $(this).parent('select');
+ if (select && $sel[0] && $sel[0].type == 'select-one') {
+ // deselect all other options
+ $sel.find('option').selected(false);
+ }
+ this.selected = select;
+ }
+ });
+};
+
+// helper fn for console logging
+// set $.fn.ajaxSubmit.debug to true to enable debug logging
+function log() {
+ if ($.fn.ajaxSubmit.debug) {
+ var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
+ if (window.console && window.console.log) {
+ window.console.log(msg);
+ }
+ else if (window.opera && window.opera.postError) {
+ window.opera.postError(msg);
+ }
+ }
+};
+
+})(jQuery);
diff --git a/src/wp-content/plugins/contact-form-7/languages/readme.txt b/src/wp-content/plugins/contact-form-7/languages/readme.txt
new file mode 100644
index 00000000..b6f0ce56
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/languages/readme.txt
@@ -0,0 +1,9 @@
+== For Translators ==
+
+Note: this folder contains MO files and POT file only. If you are looking for PO file, you can download it from here:
+
+http://plugins.svn.wordpress.org/contact-form-7/branches/languages/
+
+If you have created your own translation, or have an update of an existing one, please send it to Takayuki Miyoshi so that I can bundle it into the next release of Contact Form 7.
+
+Thank you.
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-af.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-af.mo
new file mode 100644
index 00000000..3d9ae885
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-af.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ar.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ar.mo
new file mode 100644
index 00000000..fc90c681
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ar.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-bg_BG.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-bg_BG.mo
new file mode 100644
index 00000000..bf34dae2
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-bg_BG.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-bn_BD.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-bn_BD.mo
new file mode 100644
index 00000000..5d521bc7
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-bn_BD.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-bs.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-bs.mo
new file mode 100644
index 00000000..3f80f1ed
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-bs.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ca.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ca.mo
new file mode 100644
index 00000000..6b27de6a
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ca.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-cs_CZ.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-cs_CZ.mo
new file mode 100644
index 00000000..eb975a79
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-cs_CZ.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-da_DK.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-da_DK.mo
new file mode 100644
index 00000000..16560ea4
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-da_DK.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-de_DE.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-de_DE.mo
new file mode 100644
index 00000000..a4f67d61
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-de_DE.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-el.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-el.mo
new file mode 100644
index 00000000..df99962c
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-el.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-es_ES.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-es_ES.mo
new file mode 100644
index 00000000..fdd3aa94
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-es_ES.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-et.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-et.mo
new file mode 100644
index 00000000..5bcc0c97
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-et.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-fa_IR.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-fa_IR.mo
new file mode 100644
index 00000000..152c6114
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-fa_IR.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-fi.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-fi.mo
new file mode 100644
index 00000000..f1b928fd
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-fi.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-fr_FR.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-fr_FR.mo
new file mode 100644
index 00000000..026bbdf1
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-fr_FR.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-gl_ES.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-gl_ES.mo
new file mode 100644
index 00000000..9a82f353
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-gl_ES.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-he_IL.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-he_IL.mo
new file mode 100644
index 00000000..18cf637f
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-he_IL.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-hi_IN.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hi_IN.mo
new file mode 100644
index 00000000..27cd7eaa
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hi_IN.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-hr.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hr.mo
new file mode 100644
index 00000000..8c04e2ac
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hr.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-hu_HU.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hu_HU.mo
new file mode 100644
index 00000000..1552a9f0
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hu_HU.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-hy_AM.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hy_AM.mo
new file mode 100644
index 00000000..36131836
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-hy_AM.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-id_ID.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-id_ID.mo
new file mode 100644
index 00000000..7a8e3e42
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-id_ID.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-it_IT.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-it_IT.mo
new file mode 100644
index 00000000..a40cc472
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-it_IT.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ja.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ja.mo
new file mode 100644
index 00000000..2628fab0
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ja.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ka_GE.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ka_GE.mo
new file mode 100644
index 00000000..ba081334
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ka_GE.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ko_KR.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ko_KR.mo
new file mode 100644
index 00000000..ba6029fe
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ko_KR.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-lt_LT.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-lt_LT.mo
new file mode 100644
index 00000000..c2b9fcbc
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-lt_LT.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-lv.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-lv.mo
new file mode 100644
index 00000000..f6e2bb28
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-lv.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-mk_MK.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-mk_MK.mo
new file mode 100644
index 00000000..bda6f81f
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-mk_MK.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ml_IN.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ml_IN.mo
new file mode 100644
index 00000000..612498aa
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ml_IN.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ms_MY.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ms_MY.mo
new file mode 100644
index 00000000..a291844f
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ms_MY.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-nb_NO.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-nb_NO.mo
new file mode 100644
index 00000000..7c2d89ff
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-nb_NO.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-nl_NL.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-nl_NL.mo
new file mode 100644
index 00000000..b5999460
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-nl_NL.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-pl_PL.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-pl_PL.mo
new file mode 100644
index 00000000..3d247b3a
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-pl_PL.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_BR.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_BR.mo
new file mode 100644
index 00000000..e4e35225
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_BR.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_PT.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_PT.mo
new file mode 100644
index 00000000..cbc795d6
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-pt_PT.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ro_RO.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ro_RO.mo
new file mode 100644
index 00000000..9de56b6c
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ro_RO.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ru_RU.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ru_RU.mo
new file mode 100644
index 00000000..0db0436e
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ru_RU.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-si_LK.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-si_LK.mo
new file mode 100644
index 00000000..59432e14
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-si_LK.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-sk.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sk.mo
new file mode 100644
index 00000000..bb7e489f
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sk.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-sl_SI.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sl_SI.mo
new file mode 100644
index 00000000..5fd348d0
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sl_SI.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-sq.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sq.mo
new file mode 100644
index 00000000..43dbcadc
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sq.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-sr_RS.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sr_RS.mo
new file mode 100644
index 00000000..db1e0183
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sr_RS.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-sv_SE.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sv_SE.mo
new file mode 100644
index 00000000..232ce820
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-sv_SE.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-ta.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ta.mo
new file mode 100644
index 00000000..f196e53a
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-ta.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-th.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-th.mo
new file mode 100644
index 00000000..eaeb7d6e
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-th.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-tr_TR.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-tr_TR.mo
new file mode 100644
index 00000000..d1d30c63
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-tr_TR.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-uk.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-uk.mo
new file mode 100644
index 00000000..58a7c62f
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-uk.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-vi.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-vi.mo
new file mode 100644
index 00000000..8d0f49b5
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-vi.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_CN.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_CN.mo
new file mode 100644
index 00000000..5cd17124
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_CN.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_TW.mo b/src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_TW.mo
new file mode 100644
index 00000000..4411f222
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/languages/wpcf7-zh_TW.mo differ
diff --git a/src/wp-content/plugins/contact-form-7/languages/wpcf7.pot b/src/wp-content/plugins/contact-form-7/languages/wpcf7.pot
new file mode 100644
index 00000000..c15e1098
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/languages/wpcf7.pot
@@ -0,0 +1,842 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Contact Form 7\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-01-06 09:35+0900\n"
+"PO-Revision-Date: 2011-01-06 09:35+0900\n"
+"Last-Translator: Takayuki Miyoshi \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-SourceCharset: utf-8\n"
+"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_c\n"
+"X-Poedit-Basepath: ../..\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Poedit-SearchPath-0: contact-form-7\n"
+
+#: contact-form-7/admin/admin.php:120
+#: contact-form-7/admin/edit.php:17
+#: contact-form-7/admin/edit.php:30
+msgid "Contact Form 7"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:120
+msgid "Contact"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:123
+msgid "Edit Contact Forms"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:123
+msgid "Edit"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:162
+msgid "Generate Tag"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:163
+msgid "Show"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:164
+msgid "Hide"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:261
+msgid "Contact form"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:280
+msgid "Settings"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:291
+msgid "http://contactform7.com/"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:292
+msgid "Contactform7.com"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:293
+msgid "http://contactform7.com/docs/"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:294
+msgid "Docs"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:295
+msgid "http://contactform7.com/faq/"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:296
+msgid "FAQ"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:297
+msgid "http://contactform7.com/support/"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:298
+msgid "Support"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:312
+msgid "Contact form created."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:315
+msgid "Contact form saved."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:318
+msgid "Contact form deleted."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:321
+msgid "Database table created."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:324
+msgid "Failed to create database table."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:358
+msgid "Contact Form 7 needs your support. Please donate today."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:359
+msgid "Your contribution is needed for making this plugin better."
+msgstr ""
+
+#: contact-form-7/admin/admin.php:365
+msgid "http://contactform7.com/donate/"
+msgstr ""
+
+#: contact-form-7/admin/admin.php:365
+msgid "Donate"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:9
+#, php-format
+msgid "The database table for Contact Form 7 does not exist. You must create the table for it to work."
+msgstr ""
+
+#: contact-form-7/admin/edit.php:12
+msgid "The database table for Contact Form 7 does not exist. "
+msgstr ""
+
+#: contact-form-7/admin/edit.php:45
+msgid "Add new"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:67
+msgid "Copy this code and paste it into your post, page or text widget content."
+msgstr ""
+
+#: contact-form-7/admin/edit.php:75
+#: contact-form-7/admin/edit.php:309
+msgid "Save"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:82
+msgid "Copy"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:87
+msgid "Delete"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:89
+msgid ""
+"You are about to delete this contact form.\n"
+" 'Cancel' to stop, 'OK' to delete."
+msgstr ""
+
+#: contact-form-7/admin/edit.php:104
+msgid "Form"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:128
+msgid "Mail"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:135
+#: contact-form-7/admin/edit.php:202
+msgid "To:"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:140
+#: contact-form-7/admin/edit.php:207
+msgid "From:"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:145
+#: contact-form-7/admin/edit.php:212
+msgid "Subject:"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:152
+#: contact-form-7/admin/edit.php:219
+msgid "Additional headers:"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:157
+#: contact-form-7/admin/edit.php:224
+msgid "File attachments:"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:165
+#: contact-form-7/admin/edit.php:232
+msgid "Use HTML content type"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:172
+#: contact-form-7/admin/edit.php:239
+#: contact-form-7/includes/functions.php:78
+msgid "Message body:"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:188
+msgid "Mail (2)"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:194
+msgid "Use mail (2)"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:255
+msgid "Messages"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:285
+msgid "Additional Settings"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:333
+#, php-format
+msgid "Use the default language (%s)"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:334
+#: contact-form-7/admin/edit.php:347
+msgid "Add New"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:337
+msgid "Or"
+msgstr ""
+
+#: contact-form-7/admin/edit.php:342
+msgid "(select language)"
+msgstr ""
+
+#: contact-form-7/includes/classes.php:596
+msgid "Untitled"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:6
+msgid "Sender's message was sent successfully"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:7
+msgid "Your message was sent successfully. Thanks."
+msgstr ""
+
+#: contact-form-7/includes/functions.php:11
+msgid "Sender's message was failed to send"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:12
+#: contact-form-7/includes/functions.php:17
+msgid "Failed to send your message. Please try later or contact administrator by other way."
+msgstr ""
+
+#: contact-form-7/includes/functions.php:16
+msgid "Akismet judged the sending activity as spamming"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:21
+msgid "Validation errors occurred"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:22
+msgid "Validation errors occurred. Please confirm the fields and submit it again."
+msgstr ""
+
+#: contact-form-7/includes/functions.php:26
+msgid "There is a field of term that sender is needed to accept"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:27
+msgid "Please accept the terms to proceed."
+msgstr ""
+
+#: contact-form-7/includes/functions.php:31
+msgid "Email address that sender entered is invalid"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:32
+msgid "Email address seems invalid."
+msgstr ""
+
+#: contact-form-7/includes/functions.php:36
+msgid "There is a field that sender is needed to fill in"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:37
+msgid "Please fill the required field."
+msgstr ""
+
+#: contact-form-7/includes/functions.php:46
+msgid "Your Name"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:46
+#: contact-form-7/includes/functions.php:48
+msgid "(required)"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:48
+msgid "Your Email"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:50
+msgid "Subject"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:52
+msgid "Your Message"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:54
+msgid "Send"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:62
+#, php-format
+msgid "From: %s"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:63
+#, php-format
+msgid "Subject: %s"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:64
+msgid "Message Body:"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:65
+#: contact-form-7/includes/functions.php:79
+#, php-format
+msgid "This mail is sent via contact form on %1$s %2$s"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:169
+msgid "Afrikaans"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:170
+msgid "Albanian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:171
+msgid "Arabic"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:172
+msgid "Armenian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:173
+msgid "Bangla"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:174
+msgid "Bosnian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:175
+msgid "Brazilian Portuguese"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:176
+msgid "Bulgarian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:177
+msgid "Catalan"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:178
+msgid "Chinese (Simplified)"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:179
+msgid "Chinese (Traditional)"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:180
+msgid "Croatian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:181
+msgid "Czech"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:182
+msgid "Danish"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:183
+msgid "Dutch"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:184
+msgid "English"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:185
+msgid "Estonian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:186
+msgid "Finnish"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:187
+msgid "French"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:188
+msgid "Galician"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:189
+msgid "Georgian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:190
+msgid "German"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:191
+msgid "Greek"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:192
+msgid "Hebrew"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:193
+msgid "Hindi"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:194
+msgid "Hungarian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:195
+msgid "Indonesian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:196
+msgid "Italian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:197
+msgid "Japanese"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:198
+msgid "Korean"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:199
+msgid "Latvian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:200
+msgid "Lithuanian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:201
+msgid "Macedonian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:202
+msgid "Malay"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:203
+msgid "Malayalam"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:204
+msgid "Norwegian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:205
+msgid "Persian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:206
+msgid "Polish"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:207
+msgid "Portuguese"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:208
+msgid "Russian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:209
+msgid "Romanian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:210
+msgid "Serbian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:211
+msgid "Slovak"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:212
+msgid "Slovene"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:213
+msgid "Spanish"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:214
+msgid "Swedish"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:215
+msgid "Tamil"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:216
+msgid "Thai"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:217
+msgid "Turkish"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:218
+msgid "Ukrainian"
+msgstr ""
+
+#: contact-form-7/includes/functions.php:219
+msgid "Vietnamese"
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:150
+msgid "Acceptance"
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:159
+#: contact-form-7/modules/captcha.php:202
+#: contact-form-7/modules/checkbox.php:208
+#: contact-form-7/modules/file.php:244
+msgid "Name"
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:164
+#: contact-form-7/modules/acceptance.php:167
+#: contact-form-7/modules/captcha.php:209
+#: contact-form-7/modules/captcha.php:212
+#: contact-form-7/modules/captcha.php:217
+#: contact-form-7/modules/captcha.php:220
+#: contact-form-7/modules/captcha.php:224
+#: contact-form-7/modules/captcha.php:235
+#: contact-form-7/modules/captcha.php:238
+#: contact-form-7/modules/captcha.php:243
+#: contact-form-7/modules/captcha.php:246
+#: contact-form-7/modules/checkbox.php:213
+#: contact-form-7/modules/checkbox.php:216
+#: contact-form-7/modules/file.php:249
+#: contact-form-7/modules/file.php:252
+#: contact-form-7/modules/file.php:257
+#: contact-form-7/modules/file.php:260
+msgid "optional"
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:173
+msgid "Make this checkbox checked by default?"
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:174
+msgid "Make this checkbox work inversely?"
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:175
+msgid "* That means visitor who accepts the term unchecks it."
+msgstr ""
+
+#: contact-form-7/modules/acceptance.php:180
+#: contact-form-7/modules/captcha.php:251
+#: contact-form-7/modules/checkbox.php:236
+#: contact-form-7/modules/file.php:265
+msgid "Copy this code and paste it into the form left."
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:66
+msgid "To use CAPTCHA, you need Really Simple CAPTCHA plugin installed."
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:177
+msgid "The code that sender entered does not match the CAPTCHA"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:178
+msgid "Your entered code is incorrect."
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:188
+msgid "CAPTCHA"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:199
+msgid "Note: To use CAPTCHA, you need Really Simple CAPTCHA plugin installed."
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:206
+msgid "Image settings"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:217
+msgid "Foreground color"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:220
+msgid "Background color"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:224
+msgid "Image size"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:225
+msgid "Small"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:226
+msgid "Medium"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:227
+msgid "Large"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:232
+msgid "Input field settings"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:252
+msgid "For image"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:254
+msgid "For input field"
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:284
+#, php-format
+msgid "This contact form contains CAPTCHA fields, but the temporary folder for the files (%s) does not exist or is not writable. You can create the folder or change its permission manually."
+msgstr ""
+
+#: contact-form-7/modules/captcha.php:290
+msgid "This contact form contains CAPTCHA fields, but the necessary libraries (GD and FreeType) are not available on your server."
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:181
+msgid "Checkboxes"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:184
+msgid "Radio buttons"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:205
+#: contact-form-7/modules/file.php:243
+msgid "Required field?"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:221
+msgid "Choices"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:223
+msgid "* One choice per line."
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:227
+msgid "Put a label first, a checkbox last?"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:228
+msgid "Wrap each item with tag?"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:230
+msgid "Make checkboxes exclusive?"
+msgstr ""
+
+#: contact-form-7/modules/checkbox.php:238
+msgid "And, put this code into the Mail fields below."
+msgstr ""
+
+#: contact-form-7/modules/file.php:207
+msgid "Uploading a file fails for any reason"
+msgstr ""
+
+#: contact-form-7/modules/file.php:208
+msgid "Failed to upload file."
+msgstr ""
+
+#: contact-form-7/modules/file.php:212
+msgid "Uploaded file is not allowed file type"
+msgstr ""
+
+#: contact-form-7/modules/file.php:213
+msgid "This file type is not allowed."
+msgstr ""
+
+#: contact-form-7/modules/file.php:217
+msgid "Uploaded file is too large"
+msgstr ""
+
+#: contact-form-7/modules/file.php:218
+msgid "This file is too large."
+msgstr ""
+
+#: contact-form-7/modules/file.php:222
+msgid "Uploading a file fails for PHP error"
+msgstr ""
+
+#: contact-form-7/modules/file.php:223
+msgid "Failed to upload file. Error occurred."
+msgstr ""
+
+#: contact-form-7/modules/file.php:234
+msgid "File upload"
+msgstr ""
+
+#: contact-form-7/modules/file.php:257
+msgid "File size limit"
+msgstr ""
+
+#: contact-form-7/modules/file.php:257
+msgid "bytes"
+msgstr ""
+
+#: contact-form-7/modules/file.php:260
+msgid "Acceptable file types"
+msgstr ""
+
+#: contact-form-7/modules/file.php:267
+msgid "And, put this code into the File Attachments field below."
+msgstr ""
+
+#: contact-form-7/modules/file.php:292
+#, php-format
+msgid "This contact form contains file uploading fields, but the temporary folder for the files (%s) does not exist or is not writable. You can create the folder or change its permission manually."
+msgstr ""
+
+#: contact-form-7/modules/icl.php:74
+msgid "This contact form contains [icl] tags, but they are obsolete and no longer functioning on this version of Contact Form 7. There is a simpler way for creating contact forms of other languages and you are recommended to use it."
+msgstr ""
+
+#: contact-form-7/modules/quiz.php:160
+msgid "Sender doesn't enter the correct answer to the quiz"
+msgstr ""
+
+#: contact-form-7/modules/quiz.php:161
+msgid "Your answer is not correct."
+msgstr ""
+
+#: contact-form-7/modules/quiz.php:171
+msgid "Quiz"
+msgstr ""
+
+#: contact-form-7/modules/quiz.php:201
+msgid "Quizzes"
+msgstr ""
+
+#: contact-form-7/modules/quiz.php:203
+msgid "* quiz|answer (e.g. 1+1=?|2)"
+msgstr ""
+
+#: contact-form-7/modules/select.php:150
+msgid "Drop-down menu"
+msgstr ""
+
+#: contact-form-7/modules/select.php:179
+msgid "Allow multiple selections?"
+msgstr ""
+
+#: contact-form-7/modules/select.php:180
+msgid "Insert a blank item as the first option?"
+msgstr ""
+
+#: contact-form-7/modules/submit.php:54
+msgid "Sending ..."
+msgstr ""
+
+#: contact-form-7/modules/submit.php:66
+msgid "Submit button"
+msgstr ""
+
+#: contact-form-7/modules/submit.php:84
+msgid "Label"
+msgstr ""
+
+#: contact-form-7/modules/text.php:138
+msgid "Text field"
+msgstr ""
+
+#: contact-form-7/modules/text.php:141
+msgid "Email field"
+msgstr ""
+
+#: contact-form-7/modules/text.php:183
+msgid "Akismet"
+msgstr ""
+
+#: contact-form-7/modules/text.php:185
+msgid "This field requires author's name"
+msgstr ""
+
+#: contact-form-7/modules/text.php:186
+msgid "This field requires author's URL"
+msgstr ""
+
+#: contact-form-7/modules/text.php:188
+msgid "This field requires author's email address"
+msgstr ""
+
+#: contact-form-7/modules/text.php:194
+#: contact-form-7/modules/textarea.php:156
+msgid "Default value"
+msgstr ""
+
+#: contact-form-7/modules/text.php:197
+#: contact-form-7/modules/textarea.php:159
+msgid "Use this text as watermark?"
+msgstr ""
+
+#: contact-form-7/modules/textarea.php:125
+msgid "Text area"
+msgstr ""
+
diff --git a/src/wp-content/plugins/contact-form-7/license.txt b/src/wp-content/plugins/contact-form-7/license.txt
new file mode 100644
index 00000000..d159169d
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/license.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/src/wp-content/plugins/contact-form-7/modules/acceptance.php b/src/wp-content/plugins/contact-form-7/modules/acceptance.php
new file mode 100644
index 00000000..8caff888
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/acceptance.php
@@ -0,0 +1,186 @@
+';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_acceptance', 'wpcf7_acceptance_validation_filter', 10, 2 );
+
+function wpcf7_acceptance_validation_filter( $result, $tag ) {
+ if ( ! wpcf7_acceptance_as_validation() )
+ return $result;
+
+ $name = $tag['name'];
+
+ if ( empty( $name ) )
+ return $result;
+
+ $options = (array) $tag['options'];
+
+ $value = $_POST[$name] ? 1 : 0;
+
+ $invert = (bool) preg_grep( '%^invert$%', $options );
+
+ if ( $invert && $value || ! $invert && ! $value ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'accept_terms' );
+ }
+
+ return $result;
+}
+
+
+/* Acceptance filter */
+
+add_filter( 'wpcf7_acceptance', 'wpcf7_acceptance_filter' );
+
+function wpcf7_acceptance_filter( $accepted ) {
+ $fes = wpcf7_scan_shortcode( array( 'type' => 'acceptance' ) );
+
+ foreach ( $fes as $fe ) {
+ $name = $fe['name'];
+ $options = (array) $fe['options'];
+
+ if ( empty( $name ) )
+ continue;
+
+ $value = $_POST[$name] ? 1 : 0;
+
+ $invert = (bool) preg_grep( '%^invert$%', $options );
+
+ if ( $invert && $value || ! $invert && ! $value )
+ $accepted = false;
+ }
+
+ return $accepted;
+}
+
+add_filter( 'wpcf7_form_class_attr', 'wpcf7_acceptance_form_class_attr' );
+
+function wpcf7_acceptance_form_class_attr( $class ) {
+ if ( wpcf7_acceptance_as_validation() )
+ return $class . ' wpcf7-acceptance-as-validation';
+
+ return $class;
+}
+
+function wpcf7_acceptance_as_validation() {
+ if ( ! $contact_form = wpcf7_get_current_contact_form() )
+ return false;
+
+ $settings = $contact_form->additional_setting( 'acceptance_as_validation', false );
+
+ foreach ( $settings as $setting ) {
+ if ( in_array( $setting, array( 'on', 'true', '1' ) ) )
+ return true;
+ }
+
+ return false;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_acceptance', 35 );
+
+function wpcf7_add_tag_generator_acceptance() {
+ wpcf7_add_tag_generator( 'acceptance', __( 'Acceptance', 'wpcf7' ),
+ 'wpcf7-tg-pane-acceptance', 'wpcf7_tg_pane_acceptance' );
+}
+
+function wpcf7_tg_pane_acceptance( &$contact_form ) {
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/captcha.php b/src/wp-content/plugins/contact-form-7/modules/captcha.php
new file mode 100644
index 00000000..e1247eeb
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/captcha.php
@@ -0,0 +1,490 @@
+' . __( 'To use CAPTCHA, you need Really Simple CAPTCHA plugin installed.', 'wpcf7' ) . '';
+ }
+
+ $op = array();
+ // Default
+ $op['img_size'] = array( 72, 24 );
+ $op['base'] = array( 6, 18 );
+ $op['font_size'] = 14;
+ $op['font_char_width'] = 15;
+
+ $op = array_merge( $op, wpcf7_captchac_options( $options ) );
+
+ if ( ! $filename = wpcf7_generate_captcha( $op ) )
+ return '';
+
+ if ( is_array( $op['img_size'] ) )
+ $atts .= ' width="' . $op['img_size'][0] . '" height="' . $op['img_size'][1] . '"';
+
+ $captcha_url = trailingslashit( wpcf7_captcha_tmp_url() ) . $filename;
+ $html = ' ';
+ $ref = substr( $filename, 0, strrpos( $filename, '.' ) );
+ $html = ' ' . $html;
+
+ return $html;
+
+ } elseif ( 'captchar' == $type ) {
+ if ( $size_att )
+ $atts .= ' size="' . $size_att . '"';
+ else
+ $atts .= ' size="40"'; // default size
+
+ if ( $maxlength_att )
+ $atts .= ' maxlength="' . $maxlength_att . '"';
+
+ if ( '' !== $tabindex_att )
+ $atts .= sprintf( ' tabindex="%d"', $tabindex_att );
+
+ $html = ' ';
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+ }
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_captchar', 'wpcf7_captcha_validation_filter', 10, 2 );
+
+function wpcf7_captcha_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+
+ $_POST[$name] = (string) $_POST[$name];
+
+ $captchac = '_wpcf7_captcha_challenge_' . $name;
+
+ if ( ! wpcf7_check_captcha( $_POST[$captchac], $_POST[$name] ) ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'captcha_not_match' );
+ }
+
+ wpcf7_remove_captcha( $_POST[$captchac] );
+
+ return $result;
+}
+
+
+/* Ajax echo filter */
+
+add_filter( 'wpcf7_ajax_onload', 'wpcf7_captcha_ajax_refill' );
+add_filter( 'wpcf7_ajax_json_echo', 'wpcf7_captcha_ajax_refill' );
+
+function wpcf7_captcha_ajax_refill( $items ) {
+ if ( ! is_array( $items ) )
+ return $items;
+
+ $fes = wpcf7_scan_shortcode( array( 'type' => 'captchac' ) );
+
+ if ( empty( $fes ) )
+ return $items;
+
+ $refill = array();
+
+ foreach ( $fes as $fe ) {
+ $name = $fe['name'];
+ $options = $fe['options'];
+
+ if ( empty( $name ) )
+ continue;
+
+ $op = wpcf7_captchac_options( $options );
+ if ( $filename = wpcf7_generate_captcha( $op ) ) {
+ $captcha_url = trailingslashit( wpcf7_captcha_tmp_url() ) . $filename;
+ $refill[$name] = $captcha_url;
+ }
+ }
+
+ if ( ! empty( $refill ) )
+ $items['captcha'] = $refill;
+
+ return $items;
+}
+
+
+/* Messages */
+
+add_filter( 'wpcf7_messages', 'wpcf7_captcha_messages' );
+
+function wpcf7_captcha_messages( $messages ) {
+ return array_merge( $messages, array( 'captcha_not_match' => array(
+ 'description' => __( "The code that sender entered does not match the CAPTCHA", 'wpcf7' ),
+ 'default' => __( 'Your entered code is incorrect.', 'wpcf7' )
+ ) ) );
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_captcha', 45 );
+
+function wpcf7_add_tag_generator_captcha() {
+ wpcf7_add_tag_generator( 'captcha', __( 'CAPTCHA', 'wpcf7' ),
+ 'wpcf7-tg-pane-captcha', 'wpcf7_tg_pane_captcha' );
+}
+
+function wpcf7_tg_pane_captcha( &$contact_form ) {
+?>
+
+form_scan_shortcode(
+ array( 'type' => array( 'captchac' ) ) );
+
+ if ( ! $has_tags )
+ return;
+
+ if ( ! class_exists( 'ReallySimpleCaptcha' ) )
+ return;
+
+ $uploads_dir = wpcf7_captcha_tmp_dir();
+ wpcf7_init_captcha();
+
+ if ( ! is_dir( $uploads_dir ) || ! is_writable( $uploads_dir ) ) {
+ $message = sprintf( __( 'This contact form contains CAPTCHA fields, but the temporary folder for the files (%s) does not exist or is not writable. You can create the folder or change its permission manually.', 'wpcf7' ), $uploads_dir );
+
+ echo '' . esc_html( $message ) . '
';
+ }
+
+ if ( ! function_exists( 'imagecreatetruecolor' ) || ! function_exists( 'imagettftext' ) ) {
+ $message = __( 'This contact form contains CAPTCHA fields, but the necessary libraries (GD and FreeType) are not available on your server.', 'wpcf7' );
+
+ echo '' . esc_html( $message ) . '
';
+ }
+}
+
+
+/* CAPTCHA functions */
+
+function wpcf7_init_captcha() {
+ global $wpcf7_captcha;
+
+ if ( ! class_exists( 'ReallySimpleCaptcha' ) )
+ return false;
+
+ if ( ! is_object( $wpcf7_captcha ) )
+ $wpcf7_captcha = new ReallySimpleCaptcha();
+ $captcha =& $wpcf7_captcha;
+
+ $captcha->tmp_dir = trailingslashit( wpcf7_captcha_tmp_dir() );
+ wp_mkdir_p( $captcha->tmp_dir );
+ return true;
+}
+
+function wpcf7_captcha_tmp_dir() {
+ if ( defined( 'WPCF7_CAPTCHA_TMP_DIR' ) )
+ return WPCF7_CAPTCHA_TMP_DIR;
+ else
+ return wpcf7_upload_dir( 'dir' ) . '/wpcf7_captcha';
+}
+
+function wpcf7_captcha_tmp_url() {
+ if ( defined( 'WPCF7_CAPTCHA_TMP_URL' ) )
+ return WPCF7_CAPTCHA_TMP_URL;
+ else
+ return wpcf7_upload_dir( 'url' ) . '/wpcf7_captcha';
+}
+
+function wpcf7_generate_captcha( $options = null ) {
+ global $wpcf7_captcha;
+
+ if ( ! wpcf7_init_captcha() )
+ return false;
+ $captcha =& $wpcf7_captcha;
+
+ if ( ! is_dir( $captcha->tmp_dir ) || ! is_writable( $captcha->tmp_dir ) )
+ return false;
+
+ $img_type = imagetypes();
+ if ( $img_type & IMG_PNG )
+ $captcha->img_type = 'png';
+ elseif ( $img_type & IMG_GIF )
+ $captcha->img_type = 'gif';
+ elseif ( $img_type & IMG_JPG )
+ $captcha->img_type = 'jpeg';
+ else
+ return false;
+
+ if ( is_array( $options ) ) {
+ if ( isset( $options['img_size'] ) )
+ $captcha->img_size = $options['img_size'];
+ if ( isset( $options['base'] ) )
+ $captcha->base = $options['base'];
+ if ( isset( $options['font_size'] ) )
+ $captcha->font_size = $options['font_size'];
+ if ( isset( $options['font_char_width'] ) )
+ $captcha->font_char_width = $options['font_char_width'];
+ if ( isset( $options['fg'] ) )
+ $captcha->fg = $options['fg'];
+ if ( isset( $options['bg'] ) )
+ $captcha->bg = $options['bg'];
+ }
+
+ $prefix = mt_rand();
+ $captcha_word = $captcha->generate_random_word();
+ return $captcha->generate_image( $prefix, $captcha_word );
+}
+
+function wpcf7_check_captcha( $prefix, $response ) {
+ global $wpcf7_captcha;
+
+ if ( ! wpcf7_init_captcha() )
+ return false;
+ $captcha =& $wpcf7_captcha;
+
+ return $captcha->check( $prefix, $response );
+}
+
+function wpcf7_remove_captcha( $prefix ) {
+ global $wpcf7_captcha;
+
+ if ( ! wpcf7_init_captcha() )
+ return false;
+ $captcha =& $wpcf7_captcha;
+
+ if ( preg_match( '/[^0-9]/', $prefix ) ) // Contact Form 7 generates $prefix with mt_rand()
+ return false;
+
+ $captcha->remove( $prefix );
+}
+
+function wpcf7_cleanup_captcha_files() {
+ global $wpcf7_captcha;
+
+ if ( ! wpcf7_init_captcha() )
+ return false;
+ $captcha =& $wpcf7_captcha;
+
+ if ( is_callable( array( $captcha, 'cleanup' ) ) )
+ return $captcha->cleanup();
+
+ $dir = trailingslashit( wpcf7_captcha_tmp_dir() );
+
+ if ( ! is_dir( $dir ) || ! is_readable( $dir ) || ! is_writable( $dir ) )
+ return false;
+
+ if ( $handle = @opendir( $dir ) ) {
+ while ( false !== ( $file = readdir( $handle ) ) ) {
+ if ( ! preg_match( '/^[0-9]+\.(php|png|gif|jpeg)$/', $file ) )
+ continue;
+
+ $stat = @stat( $dir . $file );
+ if ( $stat['mtime'] + 3600 < time() ) // 3600 secs == 1 hour
+ @unlink( $dir . $file );
+ }
+ closedir( $handle );
+ }
+}
+
+if ( ! is_admin() && 'GET' == $_SERVER['REQUEST_METHOD'] )
+ wpcf7_cleanup_captcha_files();
+
+function wpcf7_captchac_options( $options ) {
+ if ( ! is_array( $options ) )
+ return array();
+
+ $op = array();
+ $image_size_array = preg_grep( '%^size:[smlSML]$%', $options );
+
+ if ( $image_size = array_shift( $image_size_array ) ) {
+ preg_match( '%^size:([smlSML])$%', $image_size, $is_matches );
+ switch ( strtolower( $is_matches[1] ) ) {
+ case 's':
+ $op['img_size'] = array( 60, 20 );
+ $op['base'] = array( 6, 15 );
+ $op['font_size'] = 11;
+ $op['font_char_width'] = 13;
+ break;
+ case 'l':
+ $op['img_size'] = array( 84, 28 );
+ $op['base'] = array( 6, 20 );
+ $op['font_size'] = 17;
+ $op['font_char_width'] = 19;
+ break;
+ case 'm':
+ default:
+ $op['img_size'] = array( 72, 24 );
+ $op['base'] = array( 6, 18 );
+ $op['font_size'] = 14;
+ $op['font_char_width'] = 15;
+ }
+ }
+
+ $fg_color_array = preg_grep( '%^fg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%', $options );
+ if ( $fg_color = array_shift( $fg_color_array ) ) {
+ preg_match( '%^fg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%', $fg_color, $fc_matches );
+ if ( 3 == strlen( $fc_matches[1] ) ) {
+ $r = substr( $fc_matches[1], 0, 1 );
+ $g = substr( $fc_matches[1], 1, 1 );
+ $b = substr( $fc_matches[1], 2, 1 );
+ $op['fg'] = array( hexdec( $r . $r ), hexdec( $g . $g ), hexdec( $b . $b ) );
+ } elseif ( 6 == strlen( $fc_matches[1] ) ) {
+ $r = substr( $fc_matches[1], 0, 2 );
+ $g = substr( $fc_matches[1], 2, 2 );
+ $b = substr( $fc_matches[1], 4, 2 );
+ $op['fg'] = array( hexdec( $r ), hexdec( $g ), hexdec( $b ) );
+ }
+ }
+
+ $bg_color_array = preg_grep( '%^bg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%', $options );
+ if ( $bg_color = array_shift( $bg_color_array ) ) {
+ preg_match( '%^bg:#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$%', $bg_color, $bc_matches );
+ if ( 3 == strlen( $bc_matches[1] ) ) {
+ $r = substr( $bc_matches[1], 0, 1 );
+ $g = substr( $bc_matches[1], 1, 1 );
+ $b = substr( $bc_matches[1], 2, 1 );
+ $op['bg'] = array( hexdec( $r . $r ), hexdec( $g . $g ), hexdec( $b . $b ) );
+ } elseif ( 6 == strlen( $bc_matches[1] ) ) {
+ $r = substr( $bc_matches[1], 0, 2 );
+ $g = substr( $bc_matches[1], 2, 2 );
+ $b = substr( $bc_matches[1], 4, 2 );
+ $op['bg'] = array( hexdec( $r ), hexdec( $g ), hexdec( $b ) );
+ }
+ }
+
+ return $op;
+}
+
+$wpcf7_captcha = null;
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/checkbox.php b/src/wp-content/plugins/contact-form-7/modules/checkbox.php
new file mode 100644
index 00000000..21c30259
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/checkbox.php
@@ -0,0 +1,246 @@
+ $value ) {
+ $checked = false;
+
+ if ( $posted && ! empty( $_POST[$name] ) ) {
+ if ( $multiple && in_array( esc_sql( $value ), (array) $_POST[$name] ) )
+ $checked = true;
+ if ( ! $multiple && $_POST[$name] == esc_sql( $value ) )
+ $checked = true;
+ } else {
+ if ( in_array( $key + 1, (array) $defaults ) )
+ $checked = true;
+ }
+
+ $checked = $checked ? ' checked="checked"' : '';
+
+ if ( '' !== $tabindex_att ) {
+ $tabindex = sprintf( ' tabindex="%d"', $tabindex_att );
+ $tabindex_att += 1;
+ } else {
+ $tabindex = '';
+ }
+
+ if ( isset( $labels[$key] ) )
+ $label = $labels[$key];
+ else
+ $label = $value;
+
+ if ( $label_first ) { // put label first, input last
+ $item = '' . esc_html( $label ) . ' ';
+ $item .= ' ';
+ } else {
+ $item = ' ';
+ $item .= ' ' . esc_html( $label ) . ' ';
+ }
+
+ if ( $use_label_element )
+ $item = '' . $item . ' ';
+
+ $item = '' . $item . ' ';
+ $html .= $item;
+ }
+
+ $html = '' . $html . ' ';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_checkbox', 'wpcf7_checkbox_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_checkbox*', 'wpcf7_checkbox_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_radio', 'wpcf7_checkbox_validation_filter', 10, 2 );
+
+function wpcf7_checkbox_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+ $values = $tag['values'];
+
+ if ( ! empty( $_POST[$name] ) ) {
+ if ( is_array( $_POST[$name] ) ) {
+ foreach ( $_POST[$name] as $key => $value ) {
+ $value = stripslashes( $value );
+ if ( ! in_array( $value, (array) $values ) ) // Not in given choices.
+ unset( $_POST[$name][$key] );
+ }
+ } else {
+ $value = stripslashes( $_POST[$name] );
+ if ( ! in_array( $value, (array) $values ) ) // Not in given choices.
+ $_POST[$name] = '';
+ }
+ }
+
+ if ( 'checkbox*' == $type ) {
+ if ( empty( $_POST[$name] ) ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
+ }
+ }
+
+ return $result;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_checkbox_and_radio', 30 );
+
+function wpcf7_add_tag_generator_checkbox_and_radio() {
+ wpcf7_add_tag_generator( 'checkbox', __( 'Checkboxes', 'wpcf7' ),
+ 'wpcf7-tg-pane-checkbox', 'wpcf7_tg_pane_checkbox' );
+
+ wpcf7_add_tag_generator( 'radio', __( 'Radio buttons', 'wpcf7' ),
+ 'wpcf7-tg-pane-radio', 'wpcf7_tg_pane_radio' );
+}
+
+function wpcf7_tg_pane_checkbox( &$contact_form ) {
+ wpcf7_tg_pane_checkbox_and_radio( 'checkbox' );
+}
+
+function wpcf7_tg_pane_radio( &$contact_form ) {
+ wpcf7_tg_pane_checkbox_and_radio( 'radio' );
+}
+
+function wpcf7_tg_pane_checkbox_and_radio( $type = 'checkbox' ) {
+ if ( 'radio' != $type )
+ $type = 'checkbox';
+
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/file.php b/src/wp-content/plugins/contact-form-7/modules/file.php
new file mode 100644
index 00000000..cc997eb1
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/file.php
@@ -0,0 +1,349 @@
+';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Encode type filter */
+
+add_filter( 'wpcf7_form_enctype', 'wpcf7_file_form_enctype_filter' );
+
+function wpcf7_file_form_enctype_filter( $enctype ) {
+ $multipart = (bool) wpcf7_scan_shortcode( array( 'type' => array( 'file', 'file*' ) ) );
+
+ if ( $multipart )
+ $enctype = ' enctype="multipart/form-data"';
+
+ return $enctype;
+}
+
+
+/* Validation + upload handling filter */
+
+add_filter( 'wpcf7_validate_file', 'wpcf7_file_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_file*', 'wpcf7_file_validation_filter', 10, 2 );
+
+function wpcf7_file_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+ $options = (array) $tag['options'];
+
+ $file = $_FILES[$name];
+
+ if ( $file['error'] && UPLOAD_ERR_NO_FILE != $file['error'] ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'upload_failed_php_error' );
+ return $result;
+ }
+
+ if ( empty( $file['tmp_name'] ) && 'file*' == $type ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
+ return $result;
+ }
+
+ if ( ! is_uploaded_file( $file['tmp_name'] ) )
+ return $result;
+
+ $file_type_pattern = '';
+ $allowed_size = 1048576; // default size 1 MB
+
+ foreach ( $options as $option ) {
+ if ( preg_match( '%^filetypes:(.+)$%', $option, $matches ) ) {
+ $file_types = explode( '|', $matches[1] );
+ foreach ( $file_types as $file_type ) {
+ $file_type = trim( $file_type, '.' );
+ $file_type = str_replace(
+ array( '.', '+', '*', '?' ), array( '\.', '\+', '\*', '\?' ), $file_type );
+ $file_type_pattern .= '|' . $file_type;
+ }
+
+ } elseif ( preg_match( '/^limit:([1-9][0-9]*)([kKmM]?[bB])?$/', $option, $matches ) ) {
+ $allowed_size = (int) $matches[1];
+
+ $kbmb = strtolower( $matches[2] );
+ if ( 'kb' == $kbmb ) {
+ $allowed_size *= 1024;
+ } elseif ( 'mb' == $kbmb ) {
+ $allowed_size *= 1024 * 1024;
+ }
+
+ }
+ }
+
+ /* File type validation */
+
+ // Default file-type restriction
+ if ( '' == $file_type_pattern )
+ $file_type_pattern = 'jpg|jpeg|png|gif|pdf|doc|docx|ppt|pptx|odt|avi|ogg|m4a|mov|mp3|mp4|mpg|wav|wmv';
+
+ $file_type_pattern = trim( $file_type_pattern, '|' );
+ $file_type_pattern = '(' . $file_type_pattern . ')';
+ $file_type_pattern = '/\.' . $file_type_pattern . '$/i';
+
+ if ( ! preg_match( $file_type_pattern, $file['name'] ) ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'upload_file_type_invalid' );
+ return $result;
+ }
+
+ /* File size validation */
+
+ if ( $file['size'] > $allowed_size ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'upload_file_too_large' );
+ return $result;
+ }
+
+ $uploads_dir = wpcf7_upload_tmp_dir();
+ wpcf7_init_uploads(); // Confirm upload dir
+
+ $filename = $file['name'];
+
+ // If you get script file, it's a danger. Make it TXT file.
+ if ( preg_match( '/\.(php|pl|py|rb|cgi)\d?$/', $filename ) )
+ $filename .= '.txt';
+
+ // foo.php.jpg => foo.php_.jpg
+ $filename = wpcf7_sanitize_file_name( $filename );
+
+ $filename = wp_unique_filename( $uploads_dir, $filename );
+
+ $new_file = trailingslashit( $uploads_dir ) . $filename;
+
+ if ( false === @move_uploaded_file( $file['tmp_name'], $new_file ) ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'upload_failed' );
+ return $result;
+ }
+
+ // Make sure the uploaded file is only readable for the owner process
+ @chmod( $new_file, 0400 );
+
+ if ( $contact_form = wpcf7_get_current_contact_form() )
+ $contact_form->uploaded_files[$name] = $new_file;
+
+ if ( ! isset( $_POST[$name] ) )
+ $_POST[$name] = $filename;
+
+ return $result;
+}
+
+
+/* Messages */
+
+add_filter( 'wpcf7_messages', 'wpcf7_file_messages' );
+
+function wpcf7_file_messages( $messages ) {
+ return array_merge( $messages, array(
+ 'upload_failed' => array(
+ 'description' => __( "Uploading a file fails for any reason", 'wpcf7' ),
+ 'default' => __( 'Failed to upload file.', 'wpcf7' )
+ ),
+
+ 'upload_file_type_invalid' => array(
+ 'description' => __( "Uploaded file is not allowed file type", 'wpcf7' ),
+ 'default' => __( 'This file type is not allowed.', 'wpcf7' )
+ ),
+
+ 'upload_file_too_large' => array(
+ 'description' => __( "Uploaded file is too large", 'wpcf7' ),
+ 'default' => __( 'This file is too large.', 'wpcf7' )
+ ),
+
+ 'upload_failed_php_error' => array(
+ 'description' => __( "Uploading a file fails for PHP error", 'wpcf7' ),
+ 'default' => __( 'Failed to upload file. Error occurred.', 'wpcf7' )
+ )
+ ) );
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_file', 50 );
+
+function wpcf7_add_tag_generator_file() {
+ wpcf7_add_tag_generator( 'file', __( 'File upload', 'wpcf7' ),
+ 'wpcf7-tg-pane-file', 'wpcf7_tg_pane_file' );
+}
+
+function wpcf7_tg_pane_file( &$contact_form ) {
+?>
+
+form_scan_shortcode(
+ array( 'type' => array( 'file', 'file*' ) ) );
+
+ if ( ! $has_tags )
+ return;
+
+ $uploads_dir = wpcf7_upload_tmp_dir();
+ wpcf7_init_uploads();
+
+ if ( ! is_dir( $uploads_dir ) || ! is_writable( $uploads_dir ) ) {
+ $message = sprintf( __( 'This contact form contains file uploading fields, but the temporary folder for the files (%s) does not exist or is not writable. You can create the folder or change its permission manually.', 'wpcf7' ), $uploads_dir );
+
+ echo '' . esc_html( $message ) . '
';
+ }
+}
+
+
+/* File uploading functions */
+
+function wpcf7_init_uploads() {
+ $dir = wpcf7_upload_tmp_dir();
+ wp_mkdir_p( trailingslashit( $dir ) );
+ @chmod( $dir, 0733 );
+
+ $htaccess_file = trailingslashit( $dir ) . '.htaccess';
+ if ( file_exists( $htaccess_file ) )
+ return;
+
+ if ( $handle = @fopen( $htaccess_file, 'w' ) ) {
+ fwrite( $handle, "Deny from all\n" );
+ fclose( $handle );
+ }
+}
+
+function wpcf7_upload_tmp_dir() {
+ if ( defined( 'WPCF7_UPLOADS_TMP_DIR' ) )
+ return WPCF7_UPLOADS_TMP_DIR;
+ else
+ return wpcf7_upload_dir( 'dir' ) . '/wpcf7_uploads';
+}
+
+function wpcf7_cleanup_upload_files() {
+ $dir = trailingslashit( wpcf7_upload_tmp_dir() );
+
+ if ( ! is_dir( $dir ) )
+ return false;
+ if ( ! is_readable( $dir ) )
+ return false;
+ if ( ! is_writable( $dir ) )
+ return false;
+
+ if ( $handle = @opendir( $dir ) ) {
+ while ( false !== ( $file = readdir( $handle ) ) ) {
+ if ( $file == "." || $file == ".." || $file == ".htaccess" )
+ continue;
+
+ $stat = stat( $dir . $file );
+ if ( $stat['mtime'] + 60 < time() ) // 60 secs
+ @unlink( $dir . $file );
+ }
+ closedir( $handle );
+ }
+}
+
+if ( ! is_admin() && 'GET' == $_SERVER['REQUEST_METHOD'] )
+ wpcf7_cleanup_upload_files();
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/icl.php b/src/wp-content/plugins/contact-form-7/modules/icl.php
new file mode 100644
index 00000000..89b5d3ff
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/icl.php
@@ -0,0 +1,79 @@
+add_shortcode( 'icl', 'icl_wpcf7_shortcode_handler', true );
+
+ return $shortcode_manager->do_shortcode( $message );
+}
+
+
+/* Warning message */
+
+add_action( 'wpcf7_admin_before_subsubsub', 'icl_wpcf7_display_warning_message' );
+
+function icl_wpcf7_display_warning_message( &$contact_form ) {
+ if ( ! $contact_form )
+ return;
+
+ $has_icl_tags = (bool) $contact_form->form_scan_shortcode(
+ array( 'type' => array( 'icl' ) ) );
+
+ if ( ! $has_icl_tags ) {
+ $messages = (array) $contact_form->messages;
+
+ $shortcode_manager = new WPCF7_ShortcodeManager();
+ $shortcode_manager->add_shortcode( 'icl', create_function( '$tag', 'return null;' ), true );
+
+ foreach ( $messages as $message ) {
+ if ( $shortcode_manager->scan_shortcode( $message ) ) {
+ $has_icl_tags = true;
+ break;
+ }
+ }
+ }
+
+ if ( ! $has_icl_tags )
+ return;
+
+ $message = __( "This contact form contains [icl] tags, but they are obsolete and no longer functioning on this version of Contact Form 7. There is a simpler way for creating contact forms of other languages and you are recommended to use it.", 'wpcf7' );
+
+ echo '';
+}
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/quiz.php b/src/wp-content/plugins/contact-form-7/modules/quiz.php
new file mode 100644
index 00000000..c215cc97
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/quiz.php
@@ -0,0 +1,214 @@
+zero() ) {
+ $pipe = $pipes->random_pipe();
+ $question = $pipe->before;
+ $answer = $pipe->after;
+ } else {
+ // default quiz
+ $question = '1+1=?';
+ $answer = '2';
+ }
+
+ $answer = wpcf7_canonicalize( $answer );
+
+ $html = '' . esc_html( $question ) . ' ';
+ $html .= ' ';
+ $html .= ' ';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_quiz', 'wpcf7_quiz_validation_filter', 10, 2 );
+
+function wpcf7_quiz_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+
+ $answer = wpcf7_canonicalize( $_POST[$name] );
+ $answer_hash = wp_hash( $answer, 'wpcf7_quiz' );
+ $expected_hash = $_POST['_wpcf7_quiz_answer_' . $name];
+ if ( $answer_hash != $expected_hash ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'quiz_answer_not_correct' );
+ }
+
+ return $result;
+}
+
+
+/* Ajax echo filter */
+
+add_filter( 'wpcf7_ajax_onload', 'wpcf7_quiz_ajax_refill' );
+add_filter( 'wpcf7_ajax_json_echo', 'wpcf7_quiz_ajax_refill' );
+
+function wpcf7_quiz_ajax_refill( $items ) {
+ if ( ! is_array( $items ) )
+ return $items;
+
+ $fes = wpcf7_scan_shortcode( array( 'type' => 'quiz' ) );
+
+ if ( empty( $fes ) )
+ return $items;
+
+ $refill = array();
+
+ foreach ( $fes as $fe ) {
+ $name = $fe['name'];
+ $pipes = $fe['pipes'];
+
+ if ( empty( $name ) )
+ continue;
+
+ if ( is_a( $pipes, 'WPCF7_Pipes' ) && ! $pipes->zero() ) {
+ $pipe = $pipes->random_pipe();
+ $question = $pipe->before;
+ $answer = $pipe->after;
+ } else {
+ // default quiz
+ $question = '1+1=?';
+ $answer = '2';
+ }
+
+ $answer = wpcf7_canonicalize( $answer );
+
+ $refill[$name] = array( $question, wp_hash( $answer, 'wpcf7_quiz' ) );
+ }
+
+ if ( ! empty( $refill ) )
+ $items['quiz'] = $refill;
+
+ return $items;
+}
+
+
+/* Messages */
+
+add_filter( 'wpcf7_messages', 'wpcf7_quiz_messages' );
+
+function wpcf7_quiz_messages( $messages ) {
+ return array_merge( $messages, array( 'quiz_answer_not_correct' => array(
+ 'description' => __( "Sender doesn't enter the correct answer to the quiz", 'wpcf7' ),
+ 'default' => __( 'Your answer is not correct.', 'wpcf7' )
+ ) ) );
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_quiz', 40 );
+
+function wpcf7_add_tag_generator_quiz() {
+ wpcf7_add_tag_generator( 'quiz', __( 'Quiz', 'wpcf7' ),
+ 'wpcf7-tg-pane-quiz', 'wpcf7_tg_pane_quiz' );
+}
+
+function wpcf7_tg_pane_quiz( &$contact_form ) {
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/response.php b/src/wp-content/plugins/contact-form-7/modules/response.php
new file mode 100644
index 00000000..2d8a4531
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/response.php
@@ -0,0 +1,17 @@
+responses_count += 1;
+ return $contact_form->form_response_output();
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/select.php b/src/wp-content/plugins/contact-form-7/modules/select.php
new file mode 100644
index 00000000..721ac9cd
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/select.php
@@ -0,0 +1,195 @@
+ $value ) {
+ $selected = false;
+
+ if ( $posted && ! empty( $_POST[$name] ) ) {
+ if ( $multiple && in_array( esc_sql( $value ), (array) $_POST[$name] ) )
+ $selected = true;
+ if ( ! $multiple && $_POST[$name] == esc_sql( $value ) )
+ $selected = true;
+ } else {
+ if ( ! $empty_select && in_array( $key + 1, (array) $defaults ) )
+ $selected = true;
+ }
+
+ $selected = $selected ? ' selected="selected"' : '';
+
+ if ( isset( $labels[$key] ) )
+ $label = $labels[$key];
+ else
+ $label = $value;
+
+ $html .= '' . esc_html( $label ) . ' ';
+ }
+
+ if ( $multiple )
+ $atts .= ' multiple="multiple"';
+
+ $html = '' . $html . ' ';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_select', 'wpcf7_select_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_select*', 'wpcf7_select_validation_filter', 10, 2 );
+
+function wpcf7_select_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+ $values = $tag['values'];
+
+ if ( ! empty( $_POST[$name] ) ) {
+ if ( is_array( $_POST[$name] ) ) {
+ foreach ( $_POST[$name] as $key => $value ) {
+ $value = stripslashes( $value );
+ if ( ! in_array( $value, (array) $values ) ) // Not in given choices.
+ unset( $_POST[$name][$key] );
+ }
+ } else {
+ $value = stripslashes( $_POST[$name] );
+ if ( ! in_array( $value, (array) $values ) ) // Not in given choices.
+ $_POST[$name] = '';
+ }
+ }
+
+ if ( 'select*' == $type ) {
+ if ( empty( $_POST[$name] ) ||
+ ! is_array( $_POST[$name] ) && '---' == $_POST[$name] ||
+ is_array( $_POST[$name] ) && 1 == count( $_POST[$name] ) && '---' == $_POST[$name][0] ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
+ }
+ }
+
+ return $result;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_menu', 25 );
+
+function wpcf7_add_tag_generator_menu() {
+ wpcf7_add_tag_generator( 'menu', __( 'Drop-down menu', 'wpcf7' ),
+ 'wpcf7-tg-pane-menu', 'wpcf7_tg_pane_menu' );
+}
+
+function wpcf7_tg_pane_menu( &$contact_form ) {
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/special-mail-tags.php b/src/wp-content/plugins/contact-form-7/modules/special-mail-tags.php
new file mode 100644
index 00000000..52e2c881
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/special-mail-tags.php
@@ -0,0 +1,73 @@
+post_author );
+
+ // For backwards compat.
+ $name = preg_replace( '/^wpcf7\./', '_', $name );
+
+ if ( '_post_id' == $name )
+ $output = (string) $post->ID;
+
+ elseif ( '_post_name' == $name )
+ $output = $post->post_name;
+
+ elseif ( '_post_title' == $name )
+ $output = $post->post_title;
+
+ elseif ( '_post_url' == $name )
+ $output = get_permalink( $post->ID );
+
+ elseif ( '_post_author' == $name )
+ $output = $user->display_name;
+
+ elseif ( '_post_author_email' == $name )
+ $output = $user->user_email;
+
+ return $output;
+}
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/submit.php b/src/wp-content/plugins/contact-form-7/modules/submit.php
new file mode 100644
index 00000000..c5194e1e
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/submit.php
@@ -0,0 +1,97 @@
+';
+
+ if ( wpcf7_script_is() ) {
+ $src = apply_filters( 'wpcf7_ajax_loader', wpcf7_plugin_url( 'images/ajax-loader.gif' ) );
+ $html .= ' ';
+ }
+
+ return $html;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_submit', 55 );
+
+function wpcf7_add_tag_generator_submit() {
+ wpcf7_add_tag_generator( 'submit', __( 'Submit button', 'wpcf7' ),
+ 'wpcf7-tg-pane-submit', 'wpcf7_tg_pane_submit', array( 'nameless' => 1 ) );
+}
+
+function wpcf7_tg_pane_submit( &$contact_form ) {
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/text.php b/src/wp-content/plugins/contact-form-7/modules/text.php
new file mode 100644
index 00000000..bc8b0ac6
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/text.php
@@ -0,0 +1,210 @@
+';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_text', 'wpcf7_text_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_text*', 'wpcf7_text_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_email', 'wpcf7_text_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_email*', 'wpcf7_text_validation_filter', 10, 2 );
+
+function wpcf7_text_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+
+ $_POST[$name] = trim( strtr( (string) $_POST[$name], "\n", " " ) );
+
+ if ( 'text*' == $type ) {
+ if ( '' == $_POST[$name] ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
+ }
+ }
+
+ if ( 'email' == $type || 'email*' == $type ) {
+ if ( 'email*' == $type && '' == $_POST[$name] ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
+ } elseif ( '' != $_POST[$name] && ! is_email( $_POST[$name] ) ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_email' );
+ }
+ }
+
+ return $result;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_text_and_email', 15 );
+
+function wpcf7_add_tag_generator_text_and_email() {
+ wpcf7_add_tag_generator( 'text', __( 'Text field', 'wpcf7' ),
+ 'wpcf7-tg-pane-text', 'wpcf7_tg_pane_text' );
+
+ wpcf7_add_tag_generator( 'email', __( 'Email field', 'wpcf7' ),
+ 'wpcf7-tg-pane-email', 'wpcf7_tg_pane_email' );
+}
+
+function wpcf7_tg_pane_text( &$contact_form ) {
+ wpcf7_tg_pane_text_and_email( 'text' );
+}
+
+function wpcf7_tg_pane_email( &$contact_form ) {
+ wpcf7_tg_pane_text_and_email( 'email' );
+}
+
+function wpcf7_tg_pane_text_and_email( $type = 'text' ) {
+ if ( 'email' != $type )
+ $type = 'text';
+
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/modules/textarea.php b/src/wp-content/plugins/contact-form-7/modules/textarea.php
new file mode 100644
index 00000000..26236c18
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/modules/textarea.php
@@ -0,0 +1,172 @@
+' . esc_html( $value ) . '';
+
+ $validation_error = wpcf7_get_validation_error( $name );
+
+ $html = '' . $html . $validation_error . ' ';
+
+ return $html;
+}
+
+
+/* Validation filter */
+
+add_filter( 'wpcf7_validate_textarea', 'wpcf7_textarea_validation_filter', 10, 2 );
+add_filter( 'wpcf7_validate_textarea*', 'wpcf7_textarea_validation_filter', 10, 2 );
+
+function wpcf7_textarea_validation_filter( $result, $tag ) {
+ $type = $tag['type'];
+ $name = $tag['name'];
+
+ $_POST[$name] = (string) $_POST[$name];
+
+ if ( 'textarea*' == $type ) {
+ if ( '' == $_POST[$name] ) {
+ $result['valid'] = false;
+ $result['reason'][$name] = wpcf7_get_message( 'invalid_required' );
+ }
+ }
+
+ return $result;
+}
+
+
+/* Tag generator */
+
+add_action( 'admin_init', 'wpcf7_add_tag_generator_textarea', 20 );
+
+function wpcf7_add_tag_generator_textarea() {
+ wpcf7_add_tag_generator( 'textarea', __( 'Text area', 'wpcf7' ),
+ 'wpcf7-tg-pane-textarea', 'wpcf7_tg_pane_textarea' );
+}
+
+function wpcf7_tg_pane_textarea( &$contact_form ) {
+?>
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/readme.txt b/src/wp-content/plugins/contact-form-7/readme.txt
new file mode 100644
index 00000000..d1a7fa03
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/readme.txt
@@ -0,0 +1,153 @@
+=== Contact Form 7 ===
+Contributors: takayukister
+Donate link: http://contactform7.com/donate/
+Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
+Requires at least: 2.9
+Tested up to: 3.1.2
+Stable tag: 2.4.4
+
+Just another contact form plugin. Simple but flexible.
+
+== Description ==
+
+Contact Form 7 can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering and so on.
+
+= Plugin's Official Site =
+
+Contact Form 7 ([http://contactform7.com](http://contactform7.com/))
+
+* [Docs](http://contactform7.com/docs/) - [FAQ](http://contactform7.com/faq/) - [Support](http://contactform7.com/support/)
+
+= Contact Form 7 Needs Your Support =
+
+It is hard to continue development and support for this plugin without contributions from users like you. If you enjoy using Contact Form 7 and find it useful, please consider [__making a donation__](http://contactform7.com/donate/). Your donation will help encourage and support the plugin's continued development and better user support.
+
+= Translators =
+
+* Afrikaans (af) - [Schalk Burger](http://www.schalkburger.za.net/)
+* Albanian (sq) - [Olgi Zenullari](http://www.olgizenullari.com/)
+* Arabic (ar) - [Tarek Chaaban](http://www.chaaban.info/), Muhammed Lardi, [Yaser Mohammed](http://www.englize.com/)
+* Armenian (hy_AM) - [Emmanuelle Traduction](http://www.translatonline.com/)
+* Bangla (bn_BD) - [SM Mehdi Akram](http://www.shamokaldarpon.com/)
+* Bosnian (bs) - [Vedran](http://www.seorabbit.com/)
+* Brazilian Portuguese (pt_BR) - [Leonardo Pinheiro](http://www.eletrikabarbarella.com.br/), [Henrique Vianna](http://henriquevianna.com/), [Caciano Gabriel Batista](http://www.gn10.com.br/), [Gervásio Antônio](http://twitter.com/gervasioantonio)
+* Bulgarian (bg_BG) - [Iliyan Darganov](http://www.darganov.com/)
+* Catalan (ca) - [Jordi Sancho](http://www.qasolutions.net/blog), Robert Buj
+* Chinese, Simplified (zh_CN) - [Soz](http://www.webtoolol.com/), [Keefe Dunn](http://dengkefu.com/)
+* Chinese, Traditional (zh_TW) - [James Wu](http://jameswublog.com)
+* Croatian (hr) - [tolingo Translation Services](http://www.tolingo.com)
+* Czech (cs_CZ) - Korry, [Radovan Fiser](http://algymsa.cz/), [Tomas Vesely](http://www.mcmotylek.cz/)
+* Danish (da_DK) - [Jens Griebel](http://www.kompas-it.dk/), [Georg S. Adamsen](http://wordpress.blogos.dk/)
+* Dutch (nl_NL) - [Chris Devriese](http://www.100it.be/), [Martin Hein](http://www.split-a-pixel.nl/), [Rene](http://wpwebshop.com/)
+* Estonian (et) - [Peeter Rahuvarm](http://www.kraabus.ee), Egon Elbre
+* Finnish (fi) - [Miika Turunen](http://www.webwork.fi/), [Mediajalostamo](http://www.mediajalostamo.fi/)
+* French (fr_FR) - [Jillij](http://www.jillij.com/), [Oncle Tom](http://case.oncle-tom.net/), [Maître Mô](http://maitremo.fr/)
+* Galician (gl_ES) - [Arume Desenvolvementos Informáticos](http://www.arumeinformatica.es/)
+* Georgian (ka_GE) - [Nodar Davituri](http://omedia.ge/)
+* German (de_DE) - [Marcel Spitau](http://blog.spitau.de), [Ivan Graf](http://blog.bildergallery.com/)
+* Greek (el) - [Nick Mouratidis](http://www.kepik.gr/), [Pr. friedlich](http://friedlich.wordpress.com/)
+* Hebrew (he_IL) - [Yaron Ofer](http://www.gadgetguru.co.il/)
+* Hindi (hi_IN) - [Tarun Joshi](http://www.readers-cafe.net/), [Ashish](http://outshinesolutions.com/)
+* Hungarian (hu_HU) - [Andras Hirschler](http://hia.itblog.hu/), [János Csárdi-Braunstein](http://blogocska.org/), [Farkas Győző](http://www.sakraft.hu/)
+* Indonesian (id_ID) - [Hendry Lee](http://blogbuildingu.com/)
+* Italian (it_IT) - [Bruno](http://www.brunosalzano.com), [Gianni Diurno](http://gidibao.net/)
+* Japanese (ja) - [Takayuki Miyoshi](http://ideasilo.wordpress.com)
+* Korean (ko_KR) - Seong Eun Lee, [Jong-In Kim](http://incommunity.codex.kr/wordpress/)
+* Latvian (lv) - [Sandis Veinbergs](http://www.kleofass.lv/)
+* Lithuanian (lt_LT) - [Ernestas Kardzys](http://www.ernestas.info/)
+* Macedonian (mk_MK) - [Darko](http://www.findermind.com/)
+* Malay (ms_MY) - [Zairul Azmil](http://www.zairul.com/)
+* Malayalam (ml_IN) - [RAHUL.S.A](http://www.infution.co.cc/)
+* Norwegian (nb_NO) - Kjetil M. Bergem, [aanvik.net](http://www.aanvik.net), [Peter Holme](http://holme.se/nettsteder/)
+* Persian (Farsi; fa_IR) - [Mohammad Musavi](http://www.musavis.com/)
+* Polish (pl_PL) - [Zbigniew Czernik](http://zibik.jogger.pl/), [Daniel Fruzynski](http://www.poradnik-webmastera.com), [RafalDesign](http://www.rafaldesign.pl/)
+* Portuguese (pt_PT) - [Hugo Baeta](http://hugobaeta.com)
+* Russian (ru_RU) - Dmitry Volotovich, [Denis Voituk](http://artprima.cz/)
+* Romanian (ro_RO) - [Stas Sushkov](http://stas.nerd.ro/), [Anunturi Jibo](http://www.jibo.ro/)
+* Serbian (sr_RS) - [Vedran](http://www.seorabbit.com/), [Aleksandar Urošević](http://blog.urosevic.net/)
+* Sinhala (si_LK) - [Nitin Aggarwal](http://offshoreally.com/)
+* Slovak (sk) - [Patrik Bóna](http://www.mrhead.sk/)
+* Slovene (sl_SI) - [Mihael Simonič](http://smihael.bplaced.net)
+* Spanish (es_ES) - [Jordi Sancho](http://www.qasolutions.net/blog), [Vladimir Prieto](http://vladimir.prie.to/), [Federico Mikaelian](http://www.fedemika.com.ar/), [Matias Baldanza](http://matiasbaldanza.com/)
+* Swedish (sv_SE) - [Fredrik Jonsson](http://www.fredda-o-ac.se/), [the Swedish community](http://wp-support.se/)
+* Tamil (ta) - [Nitin Aggarwal](http://offshoreally.com/)
+* Thai (th) - [kazama](http://blog.wordthai.com/)
+* Turkish (tr_TR) - [Roman Neumuller](http://katpatuka.wordpress.com), [Hasan Yılmaz](http://hedefturkce.com/), [Emin Buğra Saral](http://www.rahmetli.info/)
+* Ukrainian (uk) - [Andrey Kovba](http://myserver.com.ua/), [Ukrainian WordPress localization team](http://wordpress.co.ua/plugins/contact-form-7.html)
+* Vietnamese (vi) - Thanh Hải, Hà
+
+If you have created your own language pack, or have an update of an existing one, you can send [gettext PO and MO files](http://codex.wordpress.org/Translating_WordPress) to [me](http://ideasilo.wordpress.com/about/) so that I can bundle it into Contact Form 7. You can [download the latest POT file from here](http://plugins.svn.wordpress.org/contact-form-7/trunk/languages/wpcf7.pot).
+
+== Installation ==
+
+1. Upload the entire `contact-form-7` folder to the `/wp-content/plugins/` directory.
+1. Activate the plugin through the 'Plugins' menu in WordPress.
+
+You will find 'Contact' menu in your WordPress admin panel.
+
+For basic usage, you can also have a look at the [plugin homepage](http://contactform7.com/).
+
+== Frequently Asked Questions ==
+
+Do you have questions or issues with Contact Form 7? Use these support channels appropriately.
+
+1. [Docs](http://contactform7.com/docs/)
+1. [FAQ](http://contactform7.com/faq/)
+1. [Support Forum](http://wordpress.org/tags/contact-form-7?forum_id=10)
+1. [WordPress HelpCenter](http://wphelpcenter.com/)
+
+[Support](http://contactform7.com/support/)
+
+== Screenshots ==
+
+1. screenshot-1.png
+
+== Changelog ==
+
+= 2.4.5 =
+
+* Fixed the bug that makes it not accept "0" value as watermark.
+* Fixed too much normalization to form-tag shortcode with content.
+* Fixed wrong regexp pattern for form-tag shortcode with content.
+* Check $_POST of checkboxes and select menus to avoid warnings.
+* Use proper action hook for enqueueing scripts: wp_enqueue_scripts and admin_enqueue_scripts.
+* Bundled jquery.form has been updated to 2.72.
+* Translations for Czech (Tomas Vesely) has been updated.
+
+= 2.4.4 =
+
+* Translation for Sinhala has been created by Nitin Aggarwal.
+* Translations for German (Ivan Graf), Russian (Denis Voituk), Simplified Chinese (Keefe Dunn) and Polish (RafalDesign) have been updated.
+* Fixed wrong [_url] special mail tag output.
+
+= 2.4.3 =
+
+* Translation for Armenian has been created by Emmanuelle Traduction.
+* Translation for Tamil has been created by Nitin Aggarwal.
+* Translations for German (Ivan Graf), Dutch (Rene), Arabic (Yaser Mohammed) and Romanian (Anunturi Jibo) have been updated.
+* Bundled jquery.form has been updated to 2.52.
+
+= 2.4.2 =
+
+* Translation for Macedonian has been created by Darko.
+* Translation for Malay has been created by Zairul Azmil.
+* Translations for Danish (Georg S. Adamsen), French (Maître Mô), German (Ivan Graf), Latvian (Sandis Veinbergs) and Persian (Mohammad Musavi) have been updated.
+
+= 2.4.1 =
+
+* Fixed a bug causing fatal error on WordPress 2.9.
+* Translations for Norwegian (Peter Holme) and Italian (Gianni Diurno) have been updated.
+
+= 2.4 =
+
+* Moved PO files to the external branch. They were space-consuming and enlarging the plugin package.
+* Added an option for size attribute of <input type="file">.
+* Added 'acceptance_as_validation' additional setting. This setting allows you to use acceptance checkbox as object of validation.
+* Added watermark support to text, email and textarea tags.
+* Use the latest jQuery Form plugin instead of the old one which WordPress bundles.
+
+[Releases](http://contactform7.com/category/releases/)
+
+== Upgrade Notice ==
+
+The required WordPress version has been changed and now requires WordPress 2.9 or higher. If you use WordPress 2.8, you will need to upgrade WordPress.
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/screenshot-1.png b/src/wp-content/plugins/contact-form-7/screenshot-1.png
new file mode 100644
index 00000000..2d9d3345
Binary files /dev/null and b/src/wp-content/plugins/contact-form-7/screenshot-1.png differ
diff --git a/src/wp-content/plugins/contact-form-7/scripts.js b/src/wp-content/plugins/contact-form-7/scripts.js
new file mode 100644
index 00000000..5368b813
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/scripts.js
@@ -0,0 +1,198 @@
+(function($) {
+
+ $(function() {
+ try {
+ if (typeof _wpcf7 == 'undefined' || _wpcf7 === null)
+ _wpcf7 = {};
+
+ _wpcf7 = $.extend({ cached: 0 }, _wpcf7);
+
+ $('div.wpcf7 > form').ajaxForm({
+ beforeSubmit: function(formData, jqForm, options) {
+ jqForm.wpcf7ClearResponseOutput();
+ jqForm.find('img.ajax-loader').css({ visibility: 'visible' });
+ return true;
+ },
+ beforeSerialize: function(jqForm, options) {
+ jqForm.find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
+ $(n).val('');
+ });
+ return true;
+ },
+ data: { '_wpcf7_is_ajax_call': 1 },
+ dataType: 'json',
+ success: function(data) {
+ var ro = $(data.into).find('div.wpcf7-response-output');
+ $(data.into).wpcf7ClearResponseOutput();
+
+ if (data.invalids) {
+ $.each(data.invalids, function(i, n) {
+ $(data.into).find(n.into).wpcf7NotValidTip(n.message);
+ });
+ ro.addClass('wpcf7-validation-errors');
+ }
+
+ if (data.captcha)
+ $(data.into).wpcf7RefillCaptcha(data.captcha);
+
+ if (data.quiz)
+ $(data.into).wpcf7RefillQuiz(data.quiz);
+
+ if (1 == data.spam)
+ ro.addClass('wpcf7-spam-blocked');
+
+ if (1 == data.mailSent) {
+ $(data.into).find('form').resetForm().clearForm();
+ ro.addClass('wpcf7-mail-sent-ok');
+
+ if (data.onSentOk)
+ $.each(data.onSentOk, function(i, n) { eval(n) });
+ } else {
+ ro.addClass('wpcf7-mail-sent-ng');
+ }
+
+ if (data.onSubmit)
+ $.each(data.onSubmit, function(i, n) { eval(n) });
+
+ $(data.into).find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
+ $(n).val($(n).attr('title'));
+ });
+
+ ro.append(data.message).slideDown('fast');
+ }
+ });
+
+ $('div.wpcf7 > form').each(function(i, n) {
+ if (_wpcf7.cached)
+ $(n).wpcf7OnloadRefill();
+
+ $(n).wpcf7ToggleSubmit();
+
+ $(n).find('.wpcf7-acceptance').click(function() {
+ $(n).wpcf7ToggleSubmit();
+ });
+
+ $(n).find('.wpcf7-exclusive-checkbox').each(function(i, n) {
+ $(n).find('input:checkbox').click(function() {
+ $(n).find('input:checkbox').not(this).removeAttr('checked');
+ });
+ });
+
+ $(n).find('.wpcf7-use-title-as-watermark').each(function(i, n) {
+ var input = $(n);
+ input.val(input.attr('title'));
+ input.addClass('watermark');
+
+ input.focus(function() {
+ if ($(this).hasClass('watermark'))
+ $(this).val('').removeClass('watermark');
+ });
+
+ input.blur(function() {
+ if ('' == $(this).val())
+ $(this).val($(this).attr('title')).addClass('watermark');
+ });
+ });
+ });
+
+ } catch (e) {
+ }
+ });
+
+ $.fn.wpcf7ToggleSubmit = function() {
+ return this.each(function() {
+ var form = $(this);
+ if (this.tagName.toLowerCase() != 'form')
+ form = $(this).find('form').first();
+
+ if (form.hasClass('wpcf7-acceptance-as-validation'))
+ return;
+
+ var submit = form.find('input:submit');
+ if (! submit.length) return;
+
+ var acceptances = form.find('input:checkbox.wpcf7-acceptance');
+ if (! acceptances.length) return;
+
+ submit.removeAttr('disabled');
+ acceptances.each(function(i, n) {
+ n = $(n);
+ if (n.hasClass('wpcf7-invert') && n.is(':checked')
+ || ! n.hasClass('wpcf7-invert') && ! n.is(':checked'))
+ submit.attr('disabled', 'disabled');
+ });
+ });
+ };
+
+ $.fn.wpcf7NotValidTip = function(message) {
+ return this.each(function() {
+ var into = $(this);
+ into.append('' + message + ' ');
+ $('span.wpcf7-not-valid-tip').mouseover(function() {
+ $(this).fadeOut('fast');
+ });
+ into.find(':input').mouseover(function() {
+ into.find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
+ });
+ into.find(':input').focus(function() {
+ into.find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
+ });
+ });
+ };
+
+ $.fn.wpcf7OnloadRefill = function() {
+ return this.each(function() {
+ var url = $(this).attr('action');
+ if (0 < url.indexOf('#'))
+ url = url.substr(0, url.indexOf('#'));
+
+ var id = $(this).find('input[name="_wpcf7"]').val();
+ var unitTag = $(this).find('input[name="_wpcf7_unit_tag"]').val();
+
+ $.getJSON(url,
+ { _wpcf7_is_ajax_call: 1, _wpcf7: id },
+ function(data) {
+ if (data && data.captcha)
+ $('#' + unitTag).wpcf7RefillCaptcha(data.captcha);
+
+ if (data && data.quiz)
+ $('#' + unitTag).wpcf7RefillQuiz(data.quiz);
+ }
+ );
+ });
+ };
+
+ $.fn.wpcf7RefillCaptcha = function(captcha) {
+ return this.each(function() {
+ var form = $(this);
+
+ $.each(captcha, function(i, n) {
+ form.find(':input[name="' + i + '"]').clearFields();
+ form.find('img.wpcf7-captcha-' + i).attr('src', n);
+ var match = /([0-9]+)\.(png|gif|jpeg)$/.exec(n);
+ form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[1]);
+ });
+ });
+ };
+
+ $.fn.wpcf7RefillQuiz = function(quiz) {
+ return this.each(function() {
+ var form = $(this);
+
+ $.each(quiz, function(i, n) {
+ form.find(':input[name="' + i + '"]').clearFields();
+ form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[0]);
+ form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[1]);
+ });
+ });
+ };
+
+ $.fn.wpcf7ClearResponseOutput = function() {
+ return this.each(function() {
+ $(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
+ $(this).find('span.wpcf7-not-valid-tip').remove();
+ $(this).find('img.ajax-loader').css({ visibility: 'hidden' });
+ });
+ };
+
+})(jQuery);
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/settings.php b/src/wp-content/plugins/contact-form-7/settings.php
new file mode 100644
index 00000000..7494497c
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/settings.php
@@ -0,0 +1,111 @@
+{$table} )
+ return false;
+
+ return strtolower( $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) ) == strtolower( $table );
+}
+
+function wpcf7() {
+ global $wpdb, $wpcf7;
+
+ if ( is_object( $wpcf7 ) )
+ return;
+
+ $wpcf7 = (object) array(
+ 'contactforms' => $wpdb->prefix . "contact_form_7",
+ 'processing_within' => '',
+ 'widget_count' => 0,
+ 'unit_count' => 0,
+ 'global_unit_count' => 0 );
+}
+
+wpcf7();
+
+require_once WPCF7_PLUGIN_DIR . '/includes/functions.php';
+require_once WPCF7_PLUGIN_DIR . '/includes/formatting.php';
+require_once WPCF7_PLUGIN_DIR . '/includes/pipe.php';
+require_once WPCF7_PLUGIN_DIR . '/includes/shortcodes.php';
+require_once WPCF7_PLUGIN_DIR . '/includes/classes.php';
+require_once WPCF7_PLUGIN_DIR . '/includes/taggenerator.php';
+
+if ( is_admin() )
+ require_once WPCF7_PLUGIN_DIR . '/admin/admin.php';
+else
+ require_once WPCF7_PLUGIN_DIR . '/includes/controller.php';
+
+function wpcf7_contact_forms() {
+ global $wpdb, $wpcf7;
+
+ return $wpdb->get_results( "SELECT cf7_unit_id as id, title FROM $wpcf7->contactforms" );
+}
+
+add_action( 'plugins_loaded', 'wpcf7_set_request_uri', 9 );
+
+function wpcf7_set_request_uri() {
+ global $wpcf7_request_uri;
+
+ $wpcf7_request_uri = add_query_arg( array() );
+}
+
+function wpcf7_get_request_uri() {
+ global $wpcf7_request_uri;
+
+ return (string) $wpcf7_request_uri;
+}
+
+/* Loading modules */
+
+add_action( 'plugins_loaded', 'wpcf7_load_modules', 1 );
+
+function wpcf7_load_modules() {
+ $dir = WPCF7_PLUGIN_MODULES_DIR;
+
+ if ( ! ( is_dir( $dir ) && $dh = opendir( $dir ) ) )
+ return false;
+
+ while ( ( $module = readdir( $dh ) ) !== false ) {
+ if ( substr( $module, -4 ) == '.php' )
+ include_once $dir . '/' . $module;
+ }
+}
+
+/* L10N */
+
+add_action( 'init', 'wpcf7_load_plugin_textdomain' );
+
+function wpcf7_load_plugin_textdomain() {
+ load_plugin_textdomain( 'wpcf7', false, 'contact-form-7/languages' );
+}
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/styles-rtl.css b/src/wp-content/plugins/contact-form-7/styles-rtl.css
new file mode 100644
index 00000000..0c28be76
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/styles-rtl.css
@@ -0,0 +1,12 @@
+span.wpcf7-not-valid-tip {
+ left: auto;
+ right: 20%;
+ direction: rtl;
+}
+span.wpcf7-not-valid-tip-no-ajax {
+ direction: rtl;
+}
+span.wpcf7-list-item {
+ margin-left: 0;
+ margin-right: 0.5em;
+}
diff --git a/src/wp-content/plugins/contact-form-7/styles.css b/src/wp-content/plugins/contact-form-7/styles.css
new file mode 100644
index 00000000..e92bb487
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/styles.css
@@ -0,0 +1,65 @@
+div.wpcf7 {
+ margin: 0;
+ padding: 0;
+}
+
+div.wpcf7-response-output {
+ margin: 2em 0.5em 1em;
+ padding: 0.2em 1em;
+}
+
+div.wpcf7-mail-sent-ok {
+ border: 2px solid #398f14;
+}
+
+div.wpcf7-mail-sent-ng {
+ border: 2px solid #ff0000;
+}
+
+div.wpcf7-spam-blocked {
+ border: 2px solid #ffa500;
+}
+
+div.wpcf7-validation-errors {
+ border: 2px solid #f7e700;
+}
+
+span.wpcf7-form-control-wrap {
+ position: relative;
+}
+
+span.wpcf7-not-valid-tip {
+ position: absolute;
+ top: 20%;
+ left: 20%;
+ z-index: 100;
+ background: #fff;
+ border: 1px solid #ff0000;
+ font-size: 10pt;
+ width: 280px;
+ padding: 2px;
+}
+
+span.wpcf7-not-valid-tip-no-ajax {
+ color: #f00;
+ font-size: 10pt;
+ display: block;
+}
+
+span.wpcf7-list-item {
+ margin-left: 0.5em;
+}
+
+.wpcf7-display-none {
+ display: none;
+}
+
+div.wpcf7 img.ajax-loader {
+ border: none;
+ vertical-align: middle;
+ margin-left: 4px;
+}
+
+div.wpcf7 .watermark {
+ color: #888;
+}
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/uninstall.php b/src/wp-content/plugins/contact-form-7/uninstall.php
new file mode 100644
index 00000000..3a3e7f88
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/uninstall.php
@@ -0,0 +1,18 @@
+prefix . "contact_form_7";
+
+ $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
+}
+
+wpcf7_delete_plugin();
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/contact-form-7/wp-contact-form-7.php b/src/wp-content/plugins/contact-form-7/wp-contact-form-7.php
new file mode 100644
index 00000000..1732f695
--- /dev/null
+++ b/src/wp-content/plugins/contact-form-7/wp-contact-form-7.php
@@ -0,0 +1,69 @@
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/delete-spam-daily/delete-spam-daily.php b/src/wp-content/plugins/delete-spam-daily/delete-spam-daily.php
new file mode 100644
index 00000000..2063ada6
--- /dev/null
+++ b/src/wp-content/plugins/delete-spam-daily/delete-spam-daily.php
@@ -0,0 +1,149 @@
+query("delete from $wpdb->comments where comment_approved='spam';");
+ $wpdb->query("OPTIMIZE TABLE $wpdb->comments;");
+}
+
+function get_spam_count() {
+ global $wpdb;
+ $dsd_spam_count = $wpdb->get_var("SELECT COUNT(*) from $wpdb->comments where comment_approved='spam';");
+
+ echo $dsd_spam_count;
+}
+
+function reschedule_delete_spam() {
+ wp_reschedule_event( (time()+60), 'daily', 'delete_spam_daily');
+}
+
+add_action('admin_menu', 'dsd_menu');
+
+function dsd_menu() {
+ add_options_page('Delete Spam Daily Options', 'Delete Spam Daily', 8, __FILE__, 'dsd_options');
+}
+
+function dsd_options() {
+ $valid_nonce = wp_verify_nonce($_REQUEST['_wpnonce'],'delete_spam_daily');
+ if ( $valid_nonce ) {
+ if(isset($_REQUEST['delete_spam_now_button'])) {
+ delete_spam_now();
+ }
+ if(isset($_REQUEST['delete_spam_daily_button'])) {
+ dsd_start_schedule();
+ }
+ if(isset($_REQUEST['stop_deleting_spam_button'])) {
+ dsd_stop_schedule();
+ }
+ if(isset($_REQUEST['reschedule_delete_spam_button'])) {
+ reschedule_delete_spam();
+ }
+ }
+
+ if ( !empty($_POST ) ) : ?>
+
+ Settings updated
+
+
+
+
+
Delete Spam Daily Options
+
+
+ Next Spam Delete:
+
+
Current Spam Count:
+
+ ';
+ if ( function_exists('wp_nonce_field') )
+ wp_nonce_field('delete_spam_daily');
+
+ echo '
';
+ echo '
';
+ echo "\n
";
+
+ if (wp_next_scheduled('delete_spam_daily') == NULL)
+ {
+ echo '
';
+ if ( function_exists('wp_nonce_field') )
+ wp_nonce_field('delete_spam_daily');
+
+ echo ' ';
+ echo '
';
+ echo " \n";
+ }
+ else
+ {
+ echo '
';
+ if ( function_exists('wp_nonce_field') )
+ wp_nonce_field('delete_spam_daily');
+
+ echo ' ';
+ echo '
';
+ echo " \n";
+
+
+ echo '
';
+ if ( function_exists('wp_nonce_field') )
+ wp_nonce_field('delete_spam_daily');
+
+ echo ' ';
+ echo ' Helpful for testing cron
';
+ echo " \n
";
+
+ }
+ ?>
+
+
+ Deactivating this plugin will stop the schedule.
+
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/delete-spam-daily/readme.txt b/src/wp-content/plugins/delete-spam-daily/readme.txt
new file mode 100644
index 00000000..3ccbd409
--- /dev/null
+++ b/src/wp-content/plugins/delete-spam-daily/readme.txt
@@ -0,0 +1,57 @@
+=== Delete Spam Daily ===
+Contributors: brockangelo
+Donate link: http://brockangelo.com/wordpress/plugins/delete-spam-daily
+Tags: comments, spam, cron, delete, database
+Requires at least: 2.1.0
+Tested up to: 2.7.1
+Stable tag: 1.0.2
+
+Uses wp_cron to delete comments each day that are marked "spam" in the database.
+
+== Description ==
+
+This plugin schedules a daily event using wp_cron that deletes all comments marked "spam" in the database, then optimizes the comments table.
+
+Brief reason why I made such a low-tech plugin:
+
+Akismet catches all the spam, but when I was looking at the size of my backups one day,
+I noticed that there were large numbers of comment spam across several sites that were undeleted and they
+made the databases fairly large. So I setup a cron job on my server that deletes the spam.
+
+Since I had never written a plugin, I thought this might be helpful for those who do not have
+a dedicated server, shell access to their site, or the knowledge of (or interest in ) cron to set this up.
+
+Spam is not deleted until you start the schedule after the plugin is activated. I created buttons
+to start and stop the schedule if you need that layer of control. There is also a button for deleting all spam manually.
+
+
+== Installation ==
+
+
+1. Upload the `delete-spam-daily` folder to the `/wp-content/plugins/` directory
+1. Activate the plugin through the 'Plugins' menu in WordPress
+1. Look under "Settings" --> "Delete Spam Daily" to activate the schedule.
+1. You can start and stop the schedule from the "Delete Spam Daily" menu.
+
+== Frequently Asked Questions ==
+
+= What time does comment spam get deleted? =
+
+The first time you start the schedule, spam gets deleted.
+Subsequent spam will be scheduled to delete every 24 hours after the first activation.
+
+= If I de-activate this plugin, will it continue to delete spam daily? =
+
+No. The cron job is cleared upon deactivation.
+
+== Screenshots ==
+
+1. Pretty simple.
+
+== Changelog ==
+
+* Version 1.0.2 - 5.28.09: Now optimizes the `wp_comments` table after spam is deleted. Updated DB call to allow for alternate wordpress table prefix.
+* Version 1.0.1 - 5.26.09: Minor update. `add_action` was added to the "Delete Spam Daily" button so it would actually delete spam once a day. :-) In addition to a "Stop Deleting Spam" button, a button was added that reschedules the cron to happen in 1 minute so you can be sure your crons are working right away.
+* Version 1.0 - 5.25.09: Initial Release. Included button to start deleting spam daily, and a button to delete spam immediately. Once the schedule was activated, it provided a button to stop the schedule. Shows current spam count and next scheduled delete.
+
+
diff --git a/src/wp-content/plugins/delete-spam-daily/screenshot-1.png b/src/wp-content/plugins/delete-spam-daily/screenshot-1.png
new file mode 100644
index 00000000..dcd5a08d
Binary files /dev/null and b/src/wp-content/plugins/delete-spam-daily/screenshot-1.png differ
diff --git a/src/wp-content/plugins/hello.php b/src/wp-content/plugins/hello.php
deleted file mode 100644
index d2287e24..00000000
--- a/src/wp-content/plugins/hello.php
+++ /dev/null
@@ -1,82 +0,0 @@
-Hello, Dolly in the upper right of your admin screen on every page.
-Author: Matt Mullenweg
-Version: 1.6
-Author URI: http://ma.tt/
-*/
-
-function hello_dolly_get_lyric() {
- /** These are the lyrics to Hello Dolly */
- $lyrics = "Hello, Dolly
-Well, hello, Dolly
-It's so nice to have you back where you belong
-You're lookin' swell, Dolly
-I can tell, Dolly
-You're still glowin', you're still crowin'
-You're still goin' strong
-We feel the room swayin'
-While the band's playin'
-One of your old favourite songs from way back when
-So, take her wrap, fellas
-Find her an empty lap, fellas
-Dolly'll never go away again
-Hello, Dolly
-Well, hello, Dolly
-It's so nice to have you back where you belong
-You're lookin' swell, Dolly
-I can tell, Dolly
-You're still glowin', you're still crowin'
-You're still goin' strong
-We feel the room swayin'
-While the band's playin'
-One of your old favourite songs from way back when
-Golly, gee, fellas
-Find her a vacant knee, fellas
-Dolly'll never go away
-Dolly'll never go away
-Dolly'll never go away again";
-
- // Here we split it into lines
- $lyrics = explode( "\n", $lyrics );
-
- // And then randomly choose a line
- return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
-}
-
-// This just echoes the chosen line, we'll position it later
-function hello_dolly() {
- $chosen = hello_dolly_get_lyric();
- echo "$chosen
";
-}
-
-// Now we set that function up to execute when the admin_notices action is called
-add_action( 'admin_notices', 'hello_dolly' );
-
-// We need some CSS to position the paragraph
-function dolly_css() {
- // This makes sure that the positioning is also good for right-to-left languages
- $x = is_rtl() ? 'left' : 'right';
-
- echo "
-
- ";
-}
-
-add_action( 'admin_head', 'dolly_css' );
-
-?>
diff --git a/src/wp-content/plugins/simple-lightbox/COPYING b/src/wp-content/plugins/simple-lightbox/COPYING
new file mode 100644
index 00000000..d159169d
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/src/wp-content/plugins/simple-lightbox/css/admin.css b/src/wp-content/plugins/simple-lightbox/css/admin.css
new file mode 100644
index 00000000..ef9d29f1
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/css/admin.css
@@ -0,0 +1,28 @@
+.subhead {
+ margin-bottom: .2em;
+}
+
+#slb_settings {
+ display: block;
+ padding: 2em 0 0;
+}
+
+.slb_option_item .block {
+ display: inline-block;
+}
+
+.slb_option_item label.title {
+ width: 200px;
+ padding: 10px;
+}
+
+.slb_option_item .input {
+ font-size: 11px;
+ line-height: 20px;
+ margin-bottom: 9px;
+ padding: 8px 10px;
+}
+
+.slb_option_item .input select {
+ min-width: 12em;
+}
diff --git a/src/wp-content/plugins/simple-lightbox/css/lb_black.css b/src/wp-content/plugins/simple-lightbox/css/lb_black.css
new file mode 100644
index 00000000..4815049f
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/css/lb_black.css
@@ -0,0 +1,138 @@
+.slb_dataCaption { font-weight: bold;}
+.slb_dataNumber { display: block; clear: left; }
+#slb_nav { display: block; clear: left; padding:0 0 10px 0;}
+.slb_navPrev { margin:0 8px 0 0; }
+.slb_navNext { margin:0 8px 0 0; }
+.slb_slbClose {
+ display:block;
+ margin:0;
+ padding:0 0 10px 0;
+ text-decoration:none;
+ float:right;
+ width:66px;
+ height:28px;
+ background:url("../images/closelabel_black.gif") no-repeat;
+ text-indent:-9999px;
+ overflow:hidden;
+}
+
+#slb_lightbox {
+ position: absolute;
+ top: 20px;
+ left: 0;
+ width: 100%;
+ z-index: 3100;
+ text-align: center;
+ line-height: 0;
+ color:#fff;
+}
+
+#slb_lightbox a, #slb_lightbox a:hover {
+ border-bottom:none;
+ color:#fff;
+ text-decoration:underline;
+}
+
+#slb_lightbox a img { border: none; }
+
+#slb_container {
+ position: relative;
+ background-color: #000;
+ width: 250px;
+ height: 250px;
+ margin: 0 auto;
+}
+
+#imageContainer {
+ padding: 10px;
+}
+
+#loading {
+ position: absolute;
+ top: 40%;
+ left: 0%;
+ height: 25%;
+ width: 100%;
+ text-align: center;
+ line-height: 0;
+}
+#slb_slbLoading {
+ display:block;
+ margin:0 auto;
+ padding:0;
+ width:32px;
+ height:32px;
+ background:url("../images/loading_black.gif") center center no-repeat;
+ text-indent:-9999px;
+}
+
+#nav_hover {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+ z-index: 10;
+ left: 0;
+}
+
+#nav_hover a { outline: none; }
+
+#nav_hover .slb_nav {
+ width: 47%;
+ height: 98%;
+ background: transparent url("../images/blank.gif") no-repeat; /* Trick IE into showing hover */
+ display: block;
+ text-indent: -9999px;
+}
+
+#nav_hover .slb_navPrev { left: 0; float: left;}
+#nav_hover .slb_navNext { right: 0; float: right;}
+#nav_hover .slb_navPrev:hover, #nav_hover .slb_navPrev:visited:hover { background: url("../images/prevlabel_black.gif") left 15% no-repeat; }
+#nav_hover .slb_navNext:hover, #nav_hover .slb_navNext:visited:hover { background: url("../images/nextlabel_black.gif") right 15% no-repeat; }
+
+#slb_details {
+ font: 10px Verdana, Helvetica, sans-serif;
+ background-color: #000;
+ margin: 0 auto;
+ line-height: 1.4em;
+}
+
+#imageData {
+ padding:0 10px;
+}
+#imageDetails { width: 70%; float: left; text-align: left; }
+
+#slb_overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 3090;
+ width: 100%;
+ height: 500px;
+ background-color: #151410;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+
+.clearfix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+* html>body .clearfix {
+ display: inline-block;
+ width: 100%;
+}
+
+* html .clearfix {
+ /* Hides from IE-mac \*/
+ height: 1%;
+ /* End hide from IE-mac */
+}
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/css/lightbox.css b/src/wp-content/plugins/simple-lightbox/css/lightbox.css
new file mode 100644
index 00000000..9f553bef
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/css/lightbox.css
@@ -0,0 +1,138 @@
+.slb_dataCaption { font-weight: bold;}
+.slb_dataNumber { display: block; clear: left; }
+#slb_nav { display: block; clear: left; padding:0 0 10px 0;}
+.slb_navPrev { margin:0 8px 0 0; }
+.slb_navNext { margin:0 8px 0 0; }
+.slb_slbClose {
+ display:block;
+ margin:0;
+ padding:0 0 10px 0;
+ text-decoration:none;
+ float:right;
+ width:66px;
+ height:28px;
+ background:url("../images/closelabel.gif") no-repeat;
+ text-indent:-9999px;
+ overflow:hidden;
+}
+
+#slb_lightbox {
+ position: absolute;
+ top: 20px;
+ left: 0;
+ width: 100%;
+ z-index: 3100;
+ text-align: center;
+ line-height: 0;
+ color:#151410;
+}
+
+#slb_lightbox a, #slb_lightbox a:hover {
+ border-bottom:none;
+ color:#151410;
+ text-decoration:underline;
+}
+
+#slb_lightbox a img { border: none; }
+
+#slb_container {
+ position: relative;
+ background-color: #fff;
+ width: 250px;
+ height: 250px;
+ margin: 0 auto;
+}
+
+#imageContainer {
+ padding: 10px;
+}
+
+#loading {
+ position: absolute;
+ top: 40%;
+ left: 0%;
+ height: 25%;
+ width: 100%;
+ text-align: center;
+ line-height: 0;
+}
+#slb_slbLoading {
+ display:block;
+ margin:0 auto;
+ padding:0;
+ width:32px;
+ height:32px;
+ background:url("../images/loading.gif") center center no-repeat;
+ text-indent:-9999px;
+}
+
+#nav_hover {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+ z-index: 10;
+ left: 0;
+}
+
+#nav_hover a { outline: none; }
+
+#nav_hover .slb_nav {
+ width: 47%;
+ height: 98%;
+ background: transparent url("../images/blank.gif") no-repeat; /* Trick IE into showing hover */
+ display: block;
+ text-indent: -9999px;
+}
+
+#nav_hover .slb_navPrev { left: 0; float: left;}
+#nav_hover .slb_navNext { right: 0; float: right;}
+#nav_hover .slb_navPrev:hover, #nav_hover .slb_navPrev:visited:hover { background: url("../images/prevlabel.gif") left 15% no-repeat; }
+#nav_hover .slb_navNext:hover, #nav_hover .slb_navNext:visited:hover { background: url("../images/nextlabel.gif") right 15% no-repeat; }
+
+#slb_details {
+ font: 10px Verdana, Helvetica, sans-serif;
+ background-color: #fff;
+ margin: 0 auto;
+ line-height: 1.4em;
+}
+
+#imageData {
+ padding:0 10px;
+}
+#imageDetails { width: 70%; float: left; text-align: left; }
+
+#slb_overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 3090;
+ width: 100%;
+ height: 500px;
+ background-color: #151410;
+ filter:alpha(opacity=60);
+ -moz-opacity: 0.6;
+ opacity: 0.6;
+}
+
+
+.clearfix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+* html>body .clearfix {
+ display: inline-block;
+ width: 100%;
+}
+
+* html .clearfix {
+ /* Hides from IE-mac \*/
+ height: 1%;
+ /* End hide from IE-mac */
+}
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/images/Thumbs.db b/src/wp-content/plugins/simple-lightbox/images/Thumbs.db
new file mode 100644
index 00000000..00e9db86
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/Thumbs.db differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/blank.gif b/src/wp-content/plugins/simple-lightbox/images/blank.gif
new file mode 100644
index 00000000..1d11fa9a
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/blank.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/closelabel.gif b/src/wp-content/plugins/simple-lightbox/images/closelabel.gif
new file mode 100644
index 00000000..af0cab2d
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/closelabel.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/closelabel_black.gif b/src/wp-content/plugins/simple-lightbox/images/closelabel_black.gif
new file mode 100644
index 00000000..e42ac03c
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/closelabel_black.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/loading.gif b/src/wp-content/plugins/simple-lightbox/images/loading.gif
new file mode 100644
index 00000000..6371884f
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/loading.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/loading_black.gif b/src/wp-content/plugins/simple-lightbox/images/loading_black.gif
new file mode 100644
index 00000000..7b8b8367
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/loading_black.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/nextlabel.gif b/src/wp-content/plugins/simple-lightbox/images/nextlabel.gif
new file mode 100644
index 00000000..7c66121f
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/nextlabel.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/nextlabel_black.gif b/src/wp-content/plugins/simple-lightbox/images/nextlabel_black.gif
new file mode 100644
index 00000000..6a523771
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/nextlabel_black.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/prevlabel.gif b/src/wp-content/plugins/simple-lightbox/images/prevlabel.gif
new file mode 100644
index 00000000..06418767
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/prevlabel.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/images/prevlabel_black.gif b/src/wp-content/plugins/simple-lightbox/images/prevlabel_black.gif
new file mode 100644
index 00000000..55286e3c
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/images/prevlabel_black.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/includes/class.base.php b/src/wp-content/plugins/simple-lightbox/includes/class.base.php
new file mode 100644
index 00000000..9cf98997
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/includes/class.base.php
@@ -0,0 +1,135 @@
+__construct();
+ }
+
+ /**
+ * Constructor
+ */
+ function __construct() {
+ $this->util =& new SLB_Utilities($this);
+ }
+
+ /*-** Init **-*/
+
+ /**
+ * Default initialization method
+ * To be overriden by child classes
+ */
+ function init() {
+ $func = 'register_hooks';
+ if ( isset($this) && method_exists($this, $func) ) {
+ call_user_method($func, $this);
+ }
+ }
+
+ function register_hooks() {
+ //Activation
+ $func_activate = 'activate';
+ if ( method_exists($this, $func_activate) )
+ register_activation_hook($this->util->get_plugin_base_file(), $this->m($func_activate));
+ //Deactivation
+ $func_deactivate = 'deactivate';
+ if ( method_exists($this, $func_deactivate) )
+ register_deactivation_hook($this->util->get_plugin_base_file(), $this->m($func_deactivate));
+ }
+
+ /*-** Reflection **-*/
+
+ /**
+ * Retrieve base object
+ * @return object|bool Base object (FALSE if object does not exist)
+ */
+ function &get_base() {
+ return ( isset($GLOBALS[$this->base]) ) ? $GLOBALS[$this->base] : false;
+ }
+
+ /*-** Method/Function calling **-*/
+
+ /**
+ * Returns callback to instance method
+ * @param string $method Method name
+ * @return array Callback array
+ */
+ function &m($method) {
+ return $this->util->m($this, $method);
+ }
+
+ /*-** Prefix **-*/
+
+ /**
+ * Retrieve class prefix (with separator if set)
+ * @param bool|string $sep Separator to append to class prefix (Default: no separator)
+ * @return string Class prefix
+ */
+ function get_prefix($sep = null) {
+ $args = func_get_args();
+ return call_user_func_array($this->util->m($this->util, 'get_prefix'), $args);
+ }
+
+ /**
+ * Check if a string is prefixed
+ * @param string $text Text to check for prefix
+ * @param string $sep (optional) Separator used
+ */
+ function has_prefix($text, $sep = null) {
+ $args = func_get_args();
+ return call_user_func_array($this->util->m($this->util, 'has_prefix'), $args);
+ }
+
+ /**
+ * Prepend plugin prefix to some text
+ * @param string $text Text to add to prefix
+ * @param string $sep (optional) Text used to separate prefix and text
+ * @param bool $once (optional) Whether to add prefix to text that already contains a prefix or not
+ * @return string Text with prefix prepended
+ */
+ function add_prefix($text, $sep = null, $once = true) {
+ $args = func_get_args();
+ return call_user_func_array($this->util->m($this->util, 'add_prefix'), $args);
+ }
+
+ /**
+ * Remove prefix from specified string
+ * @param string $text String to remove prefix from
+ * @param string $sep (optional) Separator used with prefix
+ */
+ function remove_prefix($text, $sep = null) {
+ $args = func_get_args();
+ return call_user_func_array($this->util->m($this->util, 'remove_prefix'), $args);
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/includes/class.fields.php b/src/wp-content/plugins/simple-lightbox/includes/class.fields.php
new file mode 100644
index 00000000..593db227
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/includes/class.fields.php
@@ -0,0 +1,2240 @@
+ Key (string): Format name
+ * > Val (array): Options
+ * @var array
+ */
+ var $id_formats_default = array(
+ 'attr_id' => array(
+ 'wrap' => array('open' => '_', 'segment_open' => '_'),
+ 'prefix' => array('get_container', 'get_id', 'add_prefix'),
+ 'recursive' => true
+ ),
+ 'attr_name' => array(
+ 'wrap' => array('open' => '[', 'close' => ']', 'segment_open' => '[', 'segment_close' => ']'),
+ 'recursive' => true,
+ 'prefix' => array('get_container', 'get_id', 'add_prefix')
+ )
+ );
+
+ /**
+ * Reference to parent object that current instance inherits from
+ * @var object
+ */
+ var $parent = null;
+
+ /**
+ * Title
+ * @var string
+ */
+ var $title = '';
+
+ /**
+ * @var string Short description
+ */
+ var $description = '';
+
+ /**
+ * @var array Object Properties
+ */
+ var $properties = array();
+
+ /**
+ * Initialization properties
+ * @var array
+ */
+ var $properties_init = null;
+
+ /**
+ * Structure: Property names stored as keys in group
+ * Root
+ * -> Group Name
+ * -> Property Name => Null
+ * Reason: Faster searching over large arrays
+ * @var array Groupings of Properties
+ */
+ var $property_groups = array();
+
+ /**
+ * Keys to filter out of properties array before setting properties
+ * @var array
+ */
+ var $property_filter = array('group');
+
+ /**
+ * Data for object
+ * May also contain data for nested objects
+ * @var mixed
+ */
+ var $data = null;
+
+ /**
+ * @var array Script resources to include for object
+ */
+ var $scripts = array();
+
+ /**
+ * @var array CSS style resources to include for object
+ */
+ var $styles = array();
+
+ /**
+ * Hooks (Filters/Actions) for object
+ * @var array
+ */
+ var $hooks = array();
+
+ /**
+ * Mapping of child properties to parent members
+ * Allows more flexibility when creating new instances of child objects using property arrays
+ * Associative array structure:
+ * > Key: Child property to map FROM
+ * > Val: Parent property to map TO
+ * @var array
+ */
+ var $map = null;
+
+ /**
+ * Legacy Constructor
+ */
+ function SLB_Field_Base($id = '', $parent = null) {
+ $args = func_get_args();
+ call_user_func_array(array(&$this, '__construct'), $args);
+ }
+
+ /**
+ * Constructor
+ */
+ function __construct($id = '', $parent = null) {
+ parent::__construct();
+ //Normalize Properties
+ $args = func_get_args();
+ if ( func_num_args() > 1 && empty($parent) ) {
+ unset($args[1]);
+ $args = array_values($args);
+ }
+ $properties = $this->make_properties($this->util->func_get_options($args), array('id' => $id, 'parent' => $parent));
+ //Remove empty variables
+ if ( empty($properties['parent']) )
+ unset($properties['parent']);
+ //Save init properties
+ $this->properties_init = $properties;
+ //Set Properties
+ $this->set_properties($properties);
+ }
+
+ /* Getters/Setters */
+
+ /**
+ * Checks if the specified path exists in the object
+ * @param array $path Path to check for
+ * @return bool TRUE if path exists in object, FALSE otherwise
+ */
+ function path_isset($path = '') {
+ //Stop execution if no path is supplied
+ if ( empty($path) )
+ return false;
+ $args = func_get_args();
+ $path = $this->util->build_path($args);
+ $item =& $this;
+ //Iterate over path and check if each level exists before moving on to the next
+ for ($x = 0; $x < count($path); $x++) {
+ if ( $this->util->property_exists($item, $path[$x]) ) {
+ //Set $item as reference to next level in path for next iteration
+ $item =& $this->util->get_property($item, $path[$x]);
+ //$item =& $item[ $path[$x] ];
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Retrieves a value from object using a specified path
+ * Checks to make sure path exists in object before retrieving value
+ * @param array $path Path to retrieve value from. Each item in array is a deeper dimension
+ * @return mixed Value at specified path
+ */
+ function &get_path_value($path = '') {
+ $ret = '';
+ $path = $this->util->build_path(func_get_args());
+ if ( $this->path_isset($path) ) {
+ $ret =& $this;
+ for ($x = 0; $x < count($path); $x++) {
+ if ( 0 == $x )
+ $ret =& $ret->{ $path[$x] };
+ else
+ $ret =& $ret[ $path[$x] ];
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * Search for specified member value in field type ancestors
+ * @param string $member Name of object member to search (e.g. properties, layout, etc.)
+ * @param string $name Value to retrieve from member
+ * @return mixed Member value if found (Default: empty string)
+ */
+ function get_parent_value($member, $name = '', $default = '') {
+ $parent =& $this->get_parent();
+ return $this->get_object_value($parent, $member, $name, $default, 'parent');
+ }
+
+ /**
+ * Retrieves specified member value
+ * Handles inherited values
+ * Merging corresponding parents if value is an array (e.g. for property groups)
+ * @param string|array $member Member to search. May also contain a path to the desired member
+ * @param string $name Value to retrieve from member
+ * @param mixed $default Default value if no value found (Default: empty string)
+ * @param string $dir Direction to move through hierarchy to find value
+ * Possible Values:
+ * parent (default) - Search through field parents
+ * current - Do not search through connected objects
+ * container - Search through field containers
+ * caller - Search through field callers
+ * @return mixed Specified member value
+ * @todo Return reference
+ */
+ function &get_member_value($member, $name = '', $default = '', $dir = 'parent') {
+ //Check if path to member is supplied
+ $path = array();
+ if ( is_array($member) && isset($member['tag']) ) {
+ if ( isset($member['attributes']['ref_base']) ) {
+ if ( 'root' != $member['attributes']['ref_base'] )
+ $path[] = $member['attributes']['ref_base'];
+ } else {
+ $path[] = 'properties';
+ }
+
+ $path[] = $member['tag'];
+ } else {
+ $path = $member;
+ }
+
+ $path = $this->util->build_path($path, $name);
+ //Set defaults and prepare data
+ $val = $default;
+ $inherit = false;
+ $inherit_tag = '{inherit}';
+
+ /* Determine whether the value must be retrieved from a parent/container object
+ * Conditions:
+ * > Path does not exist in current field
+ * > Path exists and is not an object, but at least one of the following is true:
+ * > Value at path is an array (e.g. properties, elements, etc. array)
+ * > Parent/container values should be merged with retrieved array
+ * > Value at path is a string that inherits from another field
+ * > Value from other field will be retrieved and will replace inheritance placeholder in retrieved value
+ */
+
+ $deeper = false;
+
+ if ( !$this->path_isset($path) )
+ $deeper = true;
+ else {
+ $val = $this->get_path_value($path);
+ if ( !is_object($val) && ( is_array($val) || ($inherit = strpos($val, $inherit_tag)) !== false ) )
+ $deeper = true;
+ else
+ $deeper = false;
+ }
+ if ( $deeper && 'current' != $dir ) {
+ //Get Parent value (recursive)
+ $ex_val = ( 'parent' != $dir ) ? $this->get_container_value($member, $name, $default) : $this->get_parent_value($member, $name, $default);
+ //Handle inheritance
+ if ( is_array($val) ) {
+ //Combine Arrays
+ if ( is_array($ex_val) )
+ $val = array_merge($ex_val, $val);
+ } elseif ( $inherit !== false ) {
+ //Replace placeholder with inherited string
+ $val = str_replace($inherit_tag, $ex_val, $val);
+ } else {
+ //Default: Set parent value as value
+ $val = $ex_val;
+ }
+ }
+
+ return $val;
+ }
+
+ /**
+ * Search for specified member value in an object
+ * @param object $object Reference to object to retrieve value from
+ * @param string $member Name of object member to search (e.g. properties, layout, etc.)
+ * @param string $name (optional) Value to retrieve from member
+ * @param mixed $default (optional) Default value to use if no value found (Default: empty string)
+ * @param string $dir Direction to move through hierarchy to find value @see SLB_Field_Type::get_member_value() for possible values
+ * @return mixed Member value if found (Default: $default)
+ */
+ function get_object_value(&$object, $member, $name = '', $default = '', $dir = 'parent') {
+ $ret = $default;
+ if ( is_object($object) && method_exists($object, 'get_member_value') )
+ $ret = $object->get_member_value($member, $name, $default, $dir);
+ return $ret;
+ }
+
+ /**
+ * Set item ID
+ * @param string $id Unique item ID
+ */
+ function set_id($id) {
+ if ( empty($id) || !is_string($id) )
+ return false;
+ $this->id = trim($id);
+ }
+
+ /**
+ * Retrieves field ID
+ * @param array|string $options (optional) Options or ID of format to use
+ * @return string item ID
+ */
+ function get_id($options = array()) {
+ $item_id = trim($this->id);
+
+ $formats = $this->get_id_formats();
+
+ //Setup options
+ $options_default = array(
+ 'format' => null,
+ 'wrap' => array('open' => '', 'close' => '', 'segment_open' => '', 'segment_close' => ''),
+ 'segments_pre' => null,
+ 'prefix' => '',
+ 'recursive' => false
+ );
+
+ //Load options based on format
+ if ( !is_array($options) )
+ $options = array('format' => $options);
+ if ( is_string($options['format']) && isset($formats[$options['format']]) )
+ $options_default = wp_parse_args($formats[$options['format']], $options_default);
+ else
+ unset($options['format']);
+ $options = wp_parse_args($options, $options_default);
+ extract($options);
+
+ //Validate options
+ $wrap = wp_parse_args($wrap, $options_default['wrap']);
+
+ if ( !is_array($segments_pre) )
+ $segments_pre = array($segments_pre);
+ $segments_pre = array_reverse($segments_pre);
+
+ //Format ID based on options
+
+ $item_id = array($item_id);
+
+ //Add parent objects to ID
+ if ( !!$recursive ) {
+ //Create array of ID components
+ $c = $this->get_caller();
+ while ( !!$c ) {
+ //Add ID of current caller to array
+ if ( method_exists($c, 'get_id') && ( $itemp = $c->get_id() ) && !empty($itemp) )
+ $item_id = $itemp;
+ //Get parent object
+ $c = ( method_exists($c, 'get_caller') ) ? $c->get_caller() : null;
+ $itemp = '';
+ }
+ unset($c);
+ }
+
+ //Additional segments (Pre)
+ foreach ( $segments_pre as $seg ) {
+ if ( is_null($seg) )
+ continue;
+ if ( is_object($seg) )
+ $seg = (array)$seg;
+ if ( is_array($seg) )
+ $item_id = array_merge($item_id, array_reverse($seg));
+ elseif ( '' != strval($seg) )
+ $item_id[] = strval($seg);
+ }
+
+ //Prefix
+ if ( is_array($prefix) ) {
+ //Array is sequence of instance methods to call on object
+ //Last array member can be an array of parameters to pass to methods
+ $count = count($prefix);
+ $args = ( $count > 1 && is_array($prefix[$count - 1]) ) ? array_pop($prefix) : array();
+ $p = $this;
+ $val = '';
+ //Iterate through methods
+ foreach ( $prefix as $m ) {
+ //Build callback
+ $m = $this->util->m($p, $m);
+ //Call callback
+ if ( is_callable($m) )
+ $val = call_user_func_array($m, $args);
+ //Process returned value
+ if ( is_object($val) )
+ $p = $val; //Use returned object in next round
+ else
+ array_unshift($args, $val); //Pass returned value as parameter to next method on using current object
+ }
+ $prefix = $val;
+ unset($p, $val);
+ }
+ if ( is_numeric($prefix) )
+ $prefix = strval($prefix);
+ if ( empty($prefix) || !is_string($prefix) )
+ $prefix = '';
+
+ //Convert array to string
+ $item_id = $prefix . $wrap['open'] . implode($wrap['segment_close'] . $wrap['segment_open'], array_reverse($item_id)) . $wrap['close'];
+ return $item_id;
+ }
+
+ /**
+ * Retrieve ID formatting options for class
+ * Format options arrays are merged together and saved to $id_formats
+ * @uses $id_formats
+ * @uses $id_formats_default
+ * @return array ID Formatting options
+ */
+ function &get_id_formats() {
+ if ( is_null($this->id_formats) ) {
+ $this->id_formats = wp_parse_args($this->id_formats, $this->id_formats_default);
+ }
+ return $this->id_formats;
+ }
+
+ /**
+ * Retrieve value from data member
+ * @param string $context Context to format data for
+ * @param bool $top (optional) Whether to traverse through the field hierarchy to get data for field (Default: TRUE)
+ * @return mixed Value at specified path
+ */
+ function get_data($context = '', $top = true) {
+ $opt_d = array('context' => '', 'top' => true);
+ $args = func_get_args();
+ $a = false;
+ if ( count($args) == 1 && is_array($args[0]) && !empty($args[0]) ) {
+ $a = true;
+ $args = wp_parse_args($args[0], $opt_d);
+ extract($args);
+ }
+
+ if ( is_string($top) ) {
+ if ( 'false' == $top )
+ $top = false;
+ elseif ( 'true' == $top )
+ $top = true;
+ elseif ( is_numeric($top) )
+ $top = intval($top);
+ }
+ $top = !!$top;
+ $obj =& $this;
+ $obj_path = array(&$this);
+ $path = array();
+ if ( $top ) {
+ //Iterate through hiearchy to get top-most object
+ while ( !empty($obj) ) {
+ $new = null;
+ //Try to get caller first
+ if ( method_exists($obj, 'get_caller') ) {
+ $checked = true;
+ $new =& $obj->get_caller();
+ }
+ //Try to get container if no caller found
+ if ( empty($new) && method_exists($obj, 'get_container') ) {
+ $checked = true;
+ $new =& $obj->get_container();
+ //Load data
+ if ( method_exists($new, 'load_data') ) {
+ $new->load_data();
+ }
+ }
+
+ $obj =& $new;
+ unset($new);
+ //Stop iteration
+ if ( !empty($obj) ) {
+ //Add object to path if it is valid
+ $obj_path[] =& $obj;
+ }
+ }
+ unset($obj);
+ }
+
+ //Check each object (starting with top-most) for matching data for current field
+
+ //Reverse array
+ $obj_path = array_reverse($obj_path);
+ //Build path for data location
+ foreach ( $obj_path as $obj ) {
+ if ( method_exists($obj, 'get_id') )
+ $path[] = $obj->get_id();
+ }
+ //Iterate through objects
+ while ( !empty($obj_path) ) {
+ //Get next object
+ $obj =& array_shift($obj_path);
+ //Shorten path
+ array_shift($path);
+ //Check for value in object and stop iteration if matching data found
+ $val = $this->get_object_value($obj, 'data', $path, null, 'current');
+ if ( !is_null($val) ) {
+ break;
+ }
+ }
+ return $this->format($val, $context);
+ }
+
+ /**
+ * Sets value in data member
+ * Sets value to data member itself by default
+ * @param mixed $value Value to set
+ * @param string|array $name Name of value to set (Can also be path to value)
+ */
+ function set_data($value, $name = '') {
+ $ref =& $this->get_path_value('data', $name);
+ $ref = $value;
+ }
+
+ /**
+ * Sets parent object of current instance
+ * Parent objects must be the same object type as current instance
+ * @uses SLB to get field type definition
+ * @uses SLB_Fields::has() to check if field type exists
+ * @uses SLB_Fields::get() to retrieve field type object reference
+ * @param string|object $parent Parent ID or reference
+ */
+ function set_parent($parent = null) {
+ //Stop processing if parent empty
+ if ( empty($parent) && !is_string($this->parent) )
+ return false;
+ //Parent passed as object reference wrapped in array
+ if ( is_array($parent) && is_object($parent[0]) )
+ $parent =& $parent[0];
+
+ //No parent set but parent ID (previously) set in object
+ if ( empty($parent) && is_string($this->parent) )
+ $parent = $this->parent;
+
+ //Retrieve reference object if ID was supplied
+ if ( is_string($parent) ) {
+ $parent = trim($parent);
+ //Get parent object reference
+ /**
+ * @var SLB
+ */
+ $b =& $this->get_base();
+ if ( $b && $b->fields->has($parent) ) {
+ $parent =& $b->fields->get($parent);
+ }
+ }
+
+ //Set parent value on object
+ if ( is_string($parent) || is_object($parent) )
+ $this->parent =& $parent;
+ }
+
+ /**
+ * Retrieve field type parent
+ * @return SLB_Field_Type Reference to parent field
+ */
+ function &get_parent() {
+ return $this->parent;
+ }
+
+ /**
+ * Set object title
+ * @param string $title Title for object
+ * @param string $plural Plural form of title
+ */
+ function set_title($title = '') {
+ $this->title = strip_tags(trim($title));
+ }
+
+ /**
+ * Retrieve object title
+ */
+ function get_title() {
+ return $this->get_member_value('title', '','', 'current');
+ }
+
+ /**
+ * Set object description
+ * @param string $description Description for object
+ */
+ function set_description($description = '') {
+ $this->description = strip_tags(trim($description));
+ }
+
+ /**
+ * Retrieve object description
+ * @return string Object description
+ */
+ function get_description() {
+ $dir = 'current';
+ return $this->get_member_value('description', '','', $dir);
+ return $desc;
+ }
+
+ /**
+ * Sets multiple properties on field type at once
+ * @param array $properties Properties. Each element is an array containing the arguments to set a new property
+ * @return boolean TRUE if successful, FALSE otherwise
+ */
+ function set_properties($properties) {
+ if ( !is_array($properties) )
+ return false;
+
+ //Set Member properties
+ foreach ( $properties as $prop => $val ) {
+ if ( ( $m = 'set_' . $prop ) && method_exists($this, $m) ) {
+ $this->{$m}($val);
+ //Remove member property from array
+ unset($properties[$prop]);
+ }
+ }
+
+ //Filter properties
+ $properties = $this->filter_properties($properties);
+
+ //Set additional instance properties
+ foreach ( $properties as $name => $val) {
+ $this->set_property($name, $val);
+ }
+ }
+
+ /**
+ * Remap properties based on $map
+ * @uses $map For determine how child properties should map to parent properties
+ * @uses SLB_Utlities::array_remap() to perform array remapping
+ * @param array $properties Associative array of properties
+ * @return array Remapped properties
+ */
+ function remap_properties($properties) {
+ //Return remapped properties
+ return $this->util->array_remap($properties, $this->map);
+ }
+
+ /**
+ * Build properties array
+ * Accepts a variable number of additional arrays of default properties
+ * that will be merged in order from last to first
+ * (e.g. first array overwrites duplicate members in last)
+ * @uses SLB_Field_Base::remap() to remap properties members if necessary
+ * @param array $props Instance properties
+ * @param array $defaults Default properties
+ * @return array Normalized properties
+ */
+ function make_properties($props, $defaults = array()) {
+ $args = func_get_args();
+ $args = array_reverse($args);
+ $props = array();
+ foreach ( $args as $arg ) {
+ $props = wp_parse_args($arg, $props);
+ }
+ return $this->remap_properties($props);
+ }
+
+ /**
+ * Filter property members
+ * @uses $property_filter to remove define members to remove from $properties
+ * @param array $props Properties
+ * @return array Filtered properties
+ */
+ function filter_properties($props = array()) {
+ return $this->util->array_filter_keys($props, $this->property_filter);
+ }
+
+ /**
+ * Add/Set a property on the field definition
+ * @param string $name Name of property
+ * @param mixed $value Default value for property
+ * @param string|array $group Group(s) property belongs to
+ * @return boolean TRUE if property is successfully added to field type, FALSE otherwise
+ */
+ function set_property($name, $value = '', $group = null) {
+ //Do not add if property name is not a string
+ if ( !is_string($name) )
+ return false;
+ //Create property array
+ $prop_arr = array();
+ $prop_arr['value'] = $value;
+ //Add to properties array
+ $this->properties[$name] = $value;
+ //Add property to specified groups
+ if ( !empty($group) ) {
+ $this->set_group_property($group, $name);
+ }
+ return true;
+ }
+
+ /**
+ * Retreives property from field type
+ * @param string $name Name of property to retrieve
+ * @return mixed Specified Property if exists (Default: Empty string)
+ */
+ function get_property($name) {
+ $val = $this->get_member_value('properties', $name);
+ return $val;
+ }
+
+ /**
+ * Removes a property from item
+ * @param string $name Property ID
+ */
+ function remove_property($name) {
+ //Remove property
+ if ( isset($this->properties[$name]) )
+ unset($this->properties[$name]);
+ //Remove from group
+ foreach ( array_keys($this->property_groups) as $g ) {
+ if ( isset($this->property_groups[$g][$name]) ) {
+ unset($this->property_groups[$g][$name]);
+ break;
+ }
+ }
+ }
+
+ /**
+ * Adds Specified Property to a Group
+ * @param string|array $group Group(s) to add property to
+ * @param string $property Property to add to group
+ */
+ function set_group_property($group, $property) {
+ if ( is_string($group) && isset($this->property_groups[$group][$property]) )
+ return;
+ if ( !is_array($group) ) {
+ $group = array($group);
+ }
+
+ foreach ($group as $g) {
+ $g = trim($g);
+ //Initialize group if it doesn't already exist
+ if ( !isset($this->property_groups[$g]) )
+ $this->property_groups[$g] = array();
+
+ //Add property to group
+ $this->property_groups[$g][$property] = null;
+ }
+ }
+
+ /**
+ * Retrieve property group
+ * @param string $group Group to retrieve
+ * @return array Array of properties in specified group
+ */
+ function get_group($group) {
+ return $this->get_member_value('property_groups', $group, array());
+ }
+
+ /**
+ * Save field data
+ * Child classes will define their own
+ * functionality for this method
+ * @return bool TRUE if save was successful (FALSE otherwise)
+ */
+ function save() {
+ return true;
+ }
+
+ /*-** Hooks **-*/
+
+ /**
+ * Retrieve hooks added to object
+ * @return array Hooks
+ */
+ function get_hooks() {
+ return $this->get_member_value('hooks', '', array());
+ }
+
+ /**
+ * Add hook for object
+ * @see add_filter() for parameter defaults
+ * @param $tag
+ * @param $function_to_add
+ * @param $priority
+ * @param $accepted_args
+ */
+ function add_hook($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
+ //Create new array for tag (if not already set)
+ if ( !isset($this->hooks[$tag]) )
+ $this->hooks[$tag] = array();
+ //Build Unique ID
+ if ( is_string($function_to_add) )
+ $id = $function_to_add;
+ elseif ( is_array($function_to_add) && !empty($function_to_add) )
+ $id = strval($function_to_add[count($function_to_add) - 1]);
+ else
+ $id = 'function_' . ( count($this->hooks[$tag]) + 1 );
+ //Add hook
+ $this->hooks[$tag][$id] = func_get_args();
+ }
+
+ /**
+ * Convenience method for adding an action for object
+ * @see add_filter() for parameter defaults
+ * @param $tag
+ * @param $function_to_add
+ * @param $priority
+ * @param $accepted_args
+ */
+ function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
+ $this->add_hook($tag, $function_to_add, $priority, $accepted_args);
+ }
+
+ /**
+ * Convenience method for adding a filter for object
+ * @see add_filter() for parameter defaults
+ * @param $tag
+ * @param $function_to_add
+ * @param $priority
+ * @param $accepted_args
+ */
+ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
+ $this->add_hook($tag, $function_to_add, $priority, $accepted_args);
+ }
+
+ /*-** Dependencies **-*/
+
+ /**
+ * Adds dependency to object
+ * @param string $type Type of dependency to add (script, style)
+ * @param array|string $context When dependency will be added (@see SLB_Utilities::get_action() for possible contexts)
+ * @see wp_enqueue_script for the following of the parameters
+ * @param $handle
+ * @param $src
+ * @param $deps
+ * @param $ver
+ * @param $ex
+ */
+ function add_dependency($type, $context, $handle, $src = false, $deps = array(), $ver = false, $ex = false) {
+ $args = func_get_args();
+ //Remove type/context from arguments
+ $args = array_slice($args, 2);
+
+ //Set context
+ if ( !is_array($context) ) {
+ //Wrap single contexts in an array
+ if ( is_string($context) )
+ $context = array($context);
+ else
+ $context = array();
+ }
+ //Add file to instance property
+ if ( isset($this->{$type}) && is_array($this->{$type}) )
+ $this->{$type}[$handle] = array('context' => $context, 'params' => $args);
+ }
+
+ /**
+ * Add script to object to be added in specified contexts
+ * @param array|string $context Array of contexts to add script to page
+ * @see wp_enqueue_script for the following of the parameters
+ * @param $handle
+ * @param $src
+ * @param $deps
+ * @param $ver
+ * @param $in_footer
+ */
+ function add_script( $context, $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
+ $args = func_get_args();
+ //Add file type to front of arguments array
+ array_unshift($args, 'scripts');
+ call_user_func_array($this->m('add_dependency'), $args);
+ }
+
+ /**
+ * Retrieve script dependencies for object
+ * @return array Script dependencies
+ */
+ function get_scripts() {
+ return $this->get_member_value('scripts', '', array());
+ }
+
+ /**
+ * Add style to object to be added in specified contexts
+ * @param array|string $context Array of contexts to add style to page
+ * @see wp_enqueue_style for the following of the parameters
+ * @param $handle
+ * @param $src
+ * @param $deps
+ * @param $ver
+ * @param $in_footer
+ */
+ function add_style( $handle, $src = false, $deps = array(), $ver = false, $media = false ) {
+ $args = func_get_args();
+ array_unshift($args, 'styles');
+ call_user_func_array($this->m('add_dependency'), $args);
+ }
+
+ /**
+ * Retrieve Style dependencies for object
+ * @return array Style dependencies
+ */
+ function get_styles() {
+ return $this->get_member_value('styles', '', array());
+ }
+
+ /* Helpers */
+
+ /**
+ * Format value based on specified context
+ * @param mixed $value Value to format
+ * @param string $context Current context
+ * @return mixed Formatted value
+ */
+ function format($value, $context = '') {
+ $handler = 'format_' . trim(strval($context));
+ //Only process if context is valid and has a handler
+ if ( !empty($context) && method_exists($this, $handler) ) {
+ //Pass value to handler
+ $value = $this->{$handler}($value, $context);
+ }
+ //Return formatted value
+ return $value;
+ }
+
+ /**
+ * Format value for output in form field
+ * @param mixed $value Value to format
+ * @return mixed Formatted value
+ */
+ function format_form($value) {
+ if ( is_string($value) )
+ $value = htmlentities($value);
+ return $value;
+ }
+}
+
+/**
+ * Field Types
+ * Stores properties for a specific field
+ * @package Simple Lightbox
+ * @subpackage Fields
+ * @author SM
+ */
+class SLB_Field_Type extends SLB_Field_Base {
+ /* Properties */
+
+ /**
+ * @var array Array of Field types that make up current Field type
+ */
+ var $elements = array();
+
+ /**
+ * @var array Field type layouts
+ */
+ var $layout = array();
+
+ /**
+ * @var SLB_Field_Type Parent field type (reference)
+ */
+ var $parent = null;
+
+ /**
+ * Object that field is in
+ * @var SLB_Field|SLB_Field_Type|SLB_Field_Collection
+ */
+ var $container = null;
+
+ /**
+ * Object that called field
+ * Used to determine field hierarchy/nesting
+ * @var SLB_Field|SLB_Field_Type|SLB_Field_Collection
+ */
+ var $caller = null;
+
+ /**
+ * Legacy Constructor
+ */
+ function SLB_Field_Type($id = '', $parent = null) {
+ $args = func_get_args();
+ call_user_func_array(array(&$this, '__construct'), $args);
+ }
+
+ function __construct($id = '', $parent = null) {
+ parent::__construct($id, $parent);
+ }
+
+ /* Getters/Setters */
+
+ /**
+ * Search for specified member value in field's container object (if exists)
+ * @param string $member Name of object member to search (e.g. properties, layout, etc.)
+ * @param string $name Value to retrieve from member
+ * @return mixed Member value if found (Default: empty string)
+ */
+ function get_container_value($member, $name = '', $default = '') {
+ $container =& $this->get_container();
+ return $this->get_object_value($container, $member, $name, $default, 'container');
+ }
+
+ /**
+ * Search for specified member value in field's container object (if exists)
+ * @param string $member Name of object member to search (e.g. properties, layout, etc.)
+ * @param string $name Value to retrieve from member
+ * @return mixed Member value if found (Default: empty string)
+ */
+ function get_caller_value($member, $name = '', $default = '') {
+ $caller =& $this->get_caller();
+ return $this->get_object_value($caller, $member, $name, $default, 'caller');
+ }
+
+ /**
+ * Sets reference to container object of current field
+ * Reference is cleared if no valid object is passed to method
+ * @param object $container
+ */
+ function set_container(&$container) {
+ if ( !empty($container) && is_object($container) ) {
+ //Set as param as container for current field
+ $this->container =& $container;
+ } else {
+ //Clear container member if argument is invalid
+ $this->clear_container();
+ }
+ }
+
+ /**
+ * Clears reference to container object of current field
+ */
+ function clear_container() {
+ $this->container = null;
+ }
+
+ /**
+ * Retrieves reference to container object of current field
+ * @return object Reference to container object
+ */
+ function &get_container() {
+ $ret = null;
+ if ( $this->has_container() )
+ $ret =& $this->container;
+ return $ret;
+ }
+
+ /**
+ * Checks if field has a container reference
+ * @return bool TRUE if field is contained, FALSE otherwise
+ */
+ function has_container() {
+ return !empty($this->container);
+ }
+
+ /**
+ * Sets reference to calling object of current field
+ * Any existing reference is cleared if no valid object is passed to method
+ * @param object $caller Calling object
+ */
+ function set_caller(&$caller) {
+ if ( !empty($caller) && is_object($caller) )
+ $this->caller =& $caller;
+ else
+ $this->clear_caller();
+ }
+
+ /**
+ * Clears reference to calling object of current field
+ */
+ function clear_caller() {
+ unset($this->caller);
+ }
+
+ /**
+ * Retrieves reference to caller object of current field
+ * @return object Reference to caller object
+ */
+ function &get_caller() {
+ $ret = null;
+ if ( $this->has_caller() )
+ $ret =& $this->caller;
+ return $ret;
+ }
+
+ /**
+ * Checks if field has a caller reference
+ * @return bool TRUE if field is called by another field, FALSE otherwise
+ */
+ function has_caller() {
+ return !empty($this->caller);
+ }
+
+
+
+ /**
+ * Sets an element for the field type
+ * @param string $name Name of element
+ * @param SLB_Field_Type $type Reference of field type to use for element
+ * @param array $properties Properties for element (passed as keyed associative array)
+ * @param string $id_prop Name of property to set $name to (e.g. ID, etc.)
+ */
+ function set_element($name, $type, $properties = array(), $id_prop = 'id') {
+ $name = trim(strval($name));
+ if ( empty($name) )
+ return false;
+ //Create new field for element
+ $el = new SLB_Field($name, $type);
+ //Set container to current field instance
+ $el->set_container($this);
+ //Add properties to element
+ $el->set_properties($properties);
+ //Save element to current instance
+ $this->elements[$name] =& $el;
+ }
+
+ /**
+ * Add a layout to the field
+ * @param string $name Name of layout
+ * @param string $value Layout text
+ */
+ function set_layout($name, $value = '') {
+ if ( !is_string($name) )
+ return false;
+ $name = trim($name);
+ $this->layout[$name] = $value;
+ return true;
+ }
+
+ /**
+ * Retrieve specified layout
+ * @param string $name Layout name
+ * @param bool $parse_nested (optional) Whether nested layouts should be expanded in retreived layout or not (Default: TRUE)
+ * @return string Specified layout text
+ */
+ function get_layout($name = 'form', $parse_nested = true) {
+ //Retrieve specified layout (use $name value if no layout by that name exists)
+ $layout = $this->get_member_value('layout', $name, $name);
+
+ //Find all nested layouts in current layout
+ if ( !empty($layout) && !!$parse_nested ) {
+ $ph = $this->get_placeholder_defaults();
+
+ while ($ph->match = $this->parse_layout($layout, $ph->pattern_layout)) {
+ //Iterate through the different types of layout placeholders
+ foreach ($ph->match as $tag => $instances) {
+ //Iterate through instances of a specific type of layout placeholder
+ foreach ($instances as $instance) {
+ //Get nested layout
+ $nested_layout = $this->get_member_value($instance);
+
+ //Replace layout placeholder with retrieved item data
+ if ( !empty($nested_layout) )
+ $layout = str_replace($ph->start . $instance['match'] . $ph->end, $nested_layout, $layout);
+ }
+ }
+ }
+ }
+
+ return $layout;
+ }
+
+ /**
+ * Checks if specified layout exists
+ * Finds layout if it exists in current object or any of its parents
+ * @param string $layout Name of layout to check for
+ * @return bool TRUE if layout exists, FALSE otherwise
+ */
+ function has_layout($layout) {
+ $ret = false;
+ if ( is_string($layout) && ($layout = trim($layout)) && !empty($layout) ) {
+ $layout = $this->get_member_value('layout', $layout, false);
+ if ( $layout !== false )
+ $ret = true;
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Checks if layout content is valid
+ * Layouts need to have placeholders to be valid
+ * @param string $layout_content Layout content (markup)
+ * @return bool TRUE if layout is valid, FALSE otherwise
+ */
+ function is_valid_layout($layout_content) {
+ $ph = $this->get_placeholder_defaults();
+ return preg_match($ph->pattern_general, $layout_content);
+ }
+
+ /**
+ * Parse field layout with a regular expression
+ * @param string $layout Layout data
+ * @param string $search Regular expression pattern to search layout for
+ * @return array Associative array containing all of the regular expression matches in the layout data
+ * Array Structure:
+ * root => placeholder tags
+ * => Tag instances (array)
+ * 'tag' => (string) tag name
+ * 'match' => (string) placeholder match
+ * 'attributes' => (array) attributes
+ */
+ function parse_layout($layout, $search) {
+ $ph_xml = '';
+ $parse_match = '';
+ $ph_root_tag = 'ph_root_element';
+ $ph_start_xml = '<';
+ $ph_end_xml = ' />';
+ $ph_wrap_start = '<' . $ph_root_tag . '>';
+ $ph_wrap_end = '' . $ph_root_tag . '>';
+ $parse_result = false;
+
+ //Find all nested layouts in layout
+ $match_value = preg_match_all($search, $layout, $parse_match, PREG_PATTERN_ORDER);
+
+ if ($match_value !== false && $match_value > 0) {
+ $parse_result = array();
+ //Get all matched elements
+ $parse_match = $parse_match[1];
+
+ //Build XML string from placeholders
+ foreach ($parse_match as $ph) {
+ $ph_xml .= $ph_start_xml . $ph . $ph_end_xml . ' ';
+ }
+ $ph_xml = $ph_wrap_start . $ph_xml . $ph_wrap_end;
+ //Parse XML data
+ $ph_prs = xml_parser_create();
+ xml_parser_set_option($ph_prs, XML_OPTION_SKIP_WHITE, 1);
+ xml_parser_set_option($ph_prs, XML_OPTION_CASE_FOLDING, 0);
+ $ret = xml_parse_into_struct($ph_prs, $ph_xml, $parse_result['values'], $parse_result['index']);
+ xml_parser_free($ph_prs);
+
+ //Build structured array with all parsed data
+
+ unset($parse_result['index'][$ph_root_tag]);
+
+ //Build structured array
+ $result = array();
+ foreach ($parse_result['index'] as $tag => $instances) {
+ $result[$tag] = array();
+ //Instances
+ foreach ($instances as $instance) {
+ //Skip instance if it doesn't exist in parse results
+ if (!isset($parse_result['values'][$instance]))
+ continue;
+
+ //Stop processing instance if a previously-saved instance with the same options already exists
+ foreach ($result[$tag] as $tag_match) {
+ if ($tag_match['match'] == $parse_match[$instance - 1])
+ continue 2;
+ }
+
+ //Init instance data array
+ $inst_data = array();
+
+ //Add Tag to array
+ $inst_data['tag'] = $parse_result['values'][$instance]['tag'];
+
+ //Add instance data to array
+ $inst_data['attributes'] = (isset($parse_result['values'][$instance]['attributes'])) ? $inst_data['attributes'] = $parse_result['values'][$instance]['attributes'] : '';
+
+ //Add match to array
+ $inst_data['match'] = $parse_match[$instance - 1];
+
+ //Add to result array
+ $result[$tag][] = $inst_data;
+ }
+ }
+ $parse_result = $result;
+ }
+
+ return $parse_result;
+ }
+
+ /**
+ * Retrieves default properties to use when evaluating layout placeholders
+ * @return object Object with properties for evaluating layout placeholders
+ */
+ function get_placeholder_defaults() {
+ $ph = new stdClass();
+ $ph->start = '{';
+ $ph->end = '}';
+ $ph->reserved = array('ref' => 'ref_base');
+ $ph->pattern_general = '/' . $ph->start . '([a-zA-Z0-9_].*?)' . $ph->end . '/i';
+ $ph->pattern_layout = '/' . $ph->start . '([a-zA-Z0-9].*?\s+' . $ph->reserved['ref'] . '="layout.*?".*?)' . $ph->end . '/i';
+ return $ph;
+ }
+
+ /**
+ * Build item output
+ * @param string $layout (optional) Layout to build
+ * @param string $data Data to pass to layout
+ * @return string Generated output
+ */
+ function build($layout = 'form', $data = null) {
+ $out = array(
+ $this->build_pre($layout, $data),
+ $this->build_layout($layout,$data),
+ $this->build_post($layout, $data)
+ );
+ return implode('', $out);
+ }
+
+ /**
+ * Content to add before layout output
+ * @return string
+ */
+ function build_pre($layout = 'form', $data = null) {
+ return '';
+ }
+
+ /**
+ * Content to add after layout output
+ * @return string
+ */
+ function build_post($layout = 'form', $data = null) {
+ return '';
+ }
+
+ /**
+ * Builds HTML for a field based on its properties
+ * @param string $layout (optional) Name of layout to build
+ * @param array $data Additional data for current item
+ */
+ function build_layout($layout = 'form', $data = null) {
+ $out_default = '';
+ //Get base layout
+ $out = $this->get_layout($layout);
+ //Only parse valid layouts
+ if ( $this->is_valid_layout($out) ) {
+ //Parse Layout
+ $ph = $this->get_placeholder_defaults();
+
+ //Search layout for placeholders
+ while ( $ph->match = $this->parse_layout($out, $ph->pattern_general) ) {
+ //Iterate through placeholders (tag, id, etc.)
+ foreach ( $ph->match as $tag => $instances ) {
+ //Iterate through instances of current placeholder
+ foreach ( $instances as $instance ) {
+ //Process value based on placeholder name
+ $target_property = apply_filters($this->add_prefix('process_placeholder_' . $tag), '', $this, $instance, $layout, $data);
+ //Process value using default processors (if necessary)
+ if ( '' == $target_property ) {
+ $target_property = apply_filters($this->add_prefix('process_placeholder'), $target_property, $this, $instance, $layout, $data);
+ }
+
+ //Clear value if value not a string
+ if ( !is_scalar($target_property) ) {
+ $target_property = '';
+ }
+ //Replace layout placeholder with retrieved item data
+ $out = str_replace($ph->start . $instance['match'] . $ph->end, $target_property, $out);
+ }
+ }
+ }
+ } else {
+ $out = $out_default;
+ }
+ /* Return generated value */
+ return implode('', array($this->build_pre(), $out, $this->build_post()));
+ }
+}
+
+class SLB_Field extends SLB_Field_Type {}
+
+/**
+ * Managed collection of fields
+ * @package Simple Lightbox
+ * @subpackage Fields
+ * @author SM
+ */
+class SLB_Field_Collection extends SLB_Field_Base {
+
+ /**
+ * Indexed array of items in collection
+ * @var array
+ */
+ var $items = array();
+
+ /**
+ * Associative array of groups in content type
+ * Key: Group name
+ * Value: object of group properties
+ * > title
+ * > description string Group description
+ * > items array Items in group
+ * @var array
+ */
+ var $groups = array();
+
+ /**
+ * Item type
+ * @var string
+ */
+ var $item_type = 'SLB_Field';
+
+ /* Constructors */
+
+ /**
+ * Legacy constructor
+ * @uses __construct() to init instance
+ * @param string $id Content type ID
+ */
+ function SLB_Field_Collection($id, $title = '', $properties = null) {
+ $args = func_get_args();
+ call_user_func_array(array(&$this, '__construct'), $args);
+ }
+
+ /**
+ * Class constructor
+ * @param string $id Content type ID
+ * @param array $properties (optional) Properties to set for content type (Default: none)
+ */
+ function __construct($id, $properties = null) {
+ //Parent constructor
+ parent::__construct($id, $properties);
+
+ //Init
+ $this->init();
+
+ //Setup object based on properties
+ if ( is_array($properties) && !empty($properties) ) {
+ //Groups
+ if ( isset($properties['groups']) )
+ $this->add_groups($properties['groups']);
+ //Items
+ if ( isset($properties['items']) )
+ $this->add_items($properties['items']);
+ }
+ }
+
+ /*-** Getters/Setters **-*/
+
+ /* Data */
+
+ /**
+ * Retrieve external data for items in collection
+ * Retrieved data is saved to the collection's $data property
+ * Uses class properties to determine how data is retrieved
+ * Examples:
+ * > DB
+ * > XML
+ * > JSON
+ * @return void
+ */
+ function load_data() {}
+
+ /**
+ * Set data for an item
+ * @param string|object $item Reference or ID of Field to set data for
+ * @param mixed $value Data to set
+ */
+ function set_data($item, $value = '', $save = true) {
+ //Set data for entire collection
+ if ( 1 == func_num_args() && is_array($item) )
+ $this->data = wp_parse_args($item, $this->data);
+ //Get $item's ID
+ elseif ( is_object($item) && method_exists($item, 'get_id') )
+ $item = $item->get_id();
+ //Set data
+ if ( is_string($item) && !empty($item) && isset($this->items[$item]) )
+ $this->data[$item] = $value;
+ if ( $save )
+ $this->save();
+ }
+
+ /* Item */
+
+ /**
+ * Adds item to collection
+ * @param string $id Unique name for item
+ * @param object|string $parent Field type that this item is based on
+ * @param array $properties (optional) Item properties
+ * @param string $group (optional) Group ID to add item to
+ * @return object Reference to new item
+ */
+ function &add($id, $parent = null, $properties = array(), $group = null) {
+ $args = func_get_args();
+ $properties = $this->make_properties($this->util->func_get_options($args), $properties, array('group' => $group));
+ $it = ( is_object($id) ) ? 'O:' . $id->get_id() . '(' . get_class($id) . ')' : $id;
+ //Check if previously created item is being added
+ if ( is_object($id) && strtolower(get_class($id)) == strtolower($this->item_type) ) {
+ $item =& $id;
+ } else {
+ //Create item
+ if ( !class_exists($this->item_type) )
+ return false;
+ $type = $this->item_type;
+ /**
+ * @var SLB_Field
+ */
+ $item =& new $type($id, $properties);
+ }
+ if ( strlen($item->get_id()) == 0 ) {
+ return false;
+ }
+
+ $item->set_container($this);
+
+ //Add item to collection
+ $this->items[$item->get_id()] =& $item;
+
+ //Add item to group
+ if ( empty($group) ) {
+ //Check properties array for group
+ if ( isset($properties['group']) ) {
+ $group = $properties['group'];
+ //Remove group property from array
+ unset($properties['group']);
+ }
+ }
+ $this->add_to_group($group, $item->id);
+ return $item;
+ }
+
+ /**
+ * Removes item from collection
+ * @param string|object $item Object or item ID to remove
+ */
+ function remove($item) {
+ if ( $this->has($item) ) {
+ $item = $this->get($item);
+ $item = $item->get_id();
+ //Remove from items array
+ unset($this->items[$item]);
+ //Remove item from groups
+ $this->remove_from_group($item);
+ }
+ }
+
+ /**
+ * Checks if item exists in the collection
+ * @param string $item Item ID
+ * @return bool TRUE if item exists, FALSE otherwise
+ */
+ function has($item) {
+ return ( !is_string($item) || empty($item) || is_null($this->get_member_value('items', $item, null)) ) ? false : true;
+ }
+
+ /**
+ * Retrieve specified item in collection
+ * @param string|object $item Item object or ID to retrieve
+ * @return object Specified item
+ */
+ function &get($item) {
+ if ( $this->has($item) ) {
+ if ( !is_object($item) || !is_a($item, $this->item_type) ) {
+ if ( is_string($item) ) {
+ $item = trim($item);
+ $item =& $this->items[$item];
+ }
+ else {
+ $item = false;
+ }
+ }
+ }
+
+ if ( empty($item) ) {
+ //Return empty item if no item exists
+ $item =& new $this->item_type;
+ }
+ return $item;
+ }
+
+ /**
+ * Retrieve item data
+ * @param $item
+ * @param $context
+ * @param $top
+ */
+ function get_data($item = null, $context = '', $top = true) {
+ $this->load_data();
+ $ret = null;
+ if ( $this->has($item) ) {
+ $item =& $this->get($item);
+ $ret = $item->get_data($context, $top);
+ } elseif ( is_null($item) ) {
+ $ret = parent::get_data($context, $top);
+ }
+ return $ret;
+ }
+
+ /* Items (Collection) */
+
+ /**
+ * Add multiple items to collection
+ * @param array $items Items to add to collection
+ * Array Structure:
+ * > Key (string): Item ID
+ * > Val (array): Item properties
+ * @return void
+ */
+ function add_items($items = array()) {
+ //Validate
+ if ( !is_array($items) || empty($items) )
+ return false;
+ //Iterate
+ foreach ( $items as $id => $props ) {
+ $this->add($id, $props);
+ }
+ }
+
+ /**
+ * Retrieve reference to items in collection
+ * @return array Collection items (reference)
+ */
+ function &get_items($group = null) {
+ if ( $this->group_exists($group) ) {
+ return $this->get_group_items($group);
+ }
+ return $this->items;
+ }
+
+ /**
+ * Default bulk item building method
+ * Children classes should implement their own functionality
+ * If no group specified, all items in collection are built
+ * @param string|object $group (optional) Group to build items for (ID or instance object)
+ * @return void
+ */
+ function build_items($group = null) {
+ $items =& $this->get_items($group);
+ $out = array();
+ foreach ( $items as $item ) {
+ $out[] = $item->build();
+ }
+ return implode('', $out);
+ }
+
+ /* Group */
+
+ /**
+ * Add groups to collection
+ * @param array $groups Associative array of group properties
+ * Array structure:
+ * > Key (string): group ID
+ * > Val (string): Group Title
+ */
+ function add_groups($groups = array()) {
+ //Validate
+ if ( !is_array($groups) || empty($groups) )
+ return false;
+ //Iterate
+ foreach ( $groups as $id => $props ) {
+ $this->add_group($id, $props);
+ }
+ }
+
+ /**
+ * Adds group to content type
+ * Groups are used to display related items in the UI
+ * @param string $id Unique name for group
+ * @param string $title Group title
+ * @param string $description Short description of group's purpose
+ * @param array $items (optional) ID's of existing items to add to group
+ * @return object Group object
+ */
+ function &add_group($id, $title = '', $description = '', $items = array()) {
+ //Create new group and set properties
+ $id = trim($id);
+ $this->groups[$id] =& $this->create_group($title, $description);
+ //Add items to group (if supplied)
+ if ( !empty($items) && is_array($items) )
+ $this->add_to_group($id, $items);
+ return $this->groups[$id];
+ }
+
+ /**
+ * Remove specified group from content type
+ * @param string $id Group ID to remove
+ */
+ function remove_group($id) {
+ $id = trim($id);
+ if ( $this->group_exists($id) ) {
+ unset($this->groups[$id]);
+ }
+ }
+
+ /**
+ * Standardized method to create a new item group
+ * @param string $title Group title (used in meta boxes, etc.)
+ * @param string $description Short description of group's purpose
+ * @return object Group object
+ */
+ function &create_group($title = '', $description = '') {
+ //Create new group object
+ $group = new stdClass();
+ /* Set group properties */
+
+ //Set Title
+ $title = ( is_scalar($title) ) ? trim($title) : '';
+ $group->title = $title;
+ //Set Description
+ $description = ( is_scalar($description) ) ? trim($description) : '';
+ $group->description = $description;
+ //Create array to hold items
+ $group->items = array();
+ return $group;
+ }
+
+ /**
+ * Checks if group exists in collection
+ * @param string $id Group name
+ * @return bool TRUE if group exists, FALSE otherwise
+ */
+ function group_exists($group) {
+ $ret = false;
+ if ( is_object($group) )
+ $ret = true;
+ elseif ( is_string($group) && ($group = trim($group)) && strlen($group) > 0 ) {
+ $group = trim($group);
+ //Check if group exists
+ $ret = !is_null($this->get_member_value('groups', $group, null));
+ }
+ return $ret;
+ }
+
+ /**
+ * Adds item to a group in the collection
+ * Group is created if it does not already exist
+ * @param string|array $group ID of group (or group parameters if new group) to add item to
+ * @param string|array $items Name or array of item(s) to add to group
+ */
+ function add_to_group($group, $items) {
+ //Validate parameters
+ $group_id = '';
+ if ( !empty($group) ) {
+ if ( !is_array($group) ) {
+ $group = array($group, $group);
+ }
+
+ $group[0] = $group_id = trim(sanitize_title_with_dashes($group[0]));
+ }
+ if ( empty($group_id) || empty($items) )
+ return false;
+ //Create group if it doesn't exist
+ if ( !$this->group_exists($group_id) ) {
+ call_user_func_array($this->m('add_group'), $group);
+ }
+ if ( ! is_array($items) )
+ $items = array($items);
+ foreach ( $items as $item ) {
+ if ( ! $this->has($item) )
+ continue;
+ $iref =& $this->get($item);
+ //Remove item from any other group it's in (items can only be in one group)
+ foreach ( array_keys($this->groups) as $group_name ) {
+ if ( isset($this->groups[$group_name]->items[$iref->id]) )
+ unset($this->groups[$group_name]->items[$iref->id]);
+ }
+ //Add reference to item in group
+ $this->groups[$group_id]->items[$iref->id] =& $iref;
+ unset($iref);
+ }
+ }
+
+ /**
+ * Remove item from a group
+ * If no group is specified, then item is removed from all groups
+ * @param string|object $item Object or ID of item to remove from group
+ * @param string $group (optional) Group ID to remove item from
+ */
+ function remove_from_group($item, $group = '') {
+ //Get ID of item to remove or stop execution if item invalid
+ $item = $this->get($item);
+ $item = $item->get_id();
+ if ( !$item )
+ return false;
+
+ //Remove item from group
+ if ( !empty($group) ) {
+ //Remove item from single group
+ if ( ($group =& $this->get_group($group)) && isset($group->items[$item]) ) {
+ unset($group->items[$item]);
+ }
+ } else {
+ //Remove item from all groups
+ foreach ( array_keys($this->groups) as $group ) {
+ if ( ($group =& $this->get_group($group)) && isset($group->items[$item]) ) {
+ unset($group->items[$item]);
+ }
+ }
+ }
+ }
+
+ /**
+ * Retrieve specified group
+ * @param string $group ID of group to retrieve
+ * @return object Reference to specified group
+ */
+ function &get_group($group) {
+ if ( is_object($group) )
+ return $group;
+ if ( is_string($group) )
+ $group = trim($group);
+ //Create group if it doesn't already exist
+ if ( ! $this->group_exists($group) )
+ $this->add_group($group);
+ return $this->get_member_value('groups', $group);
+ }
+
+ /**
+ * Retrieve a group's items
+ * @uses SLB_Field_Collection::get_group() to retrieve group object
+ * @param object|string $group Group object or group ID
+ * @return array Group's items
+ */
+ function &get_group_items($group) {
+ $group =& $this->get_group($group);
+ return $group->items;
+ }
+
+ /**
+ * Retrieve all groups in content type
+ * @return array Reference to group objects
+ */
+ function &get_groups() {
+ return $this->get_member_value('groups');
+ }
+
+ /**
+ * Output items in a group
+ * @param string $group ID of Group to output
+ * @return string Group output
+ * @todo Refactor to be general builder
+ */
+ function build_group($group) {
+ $out = array();
+ $classnames = (object) array(
+ 'multi' => 'multi_field',
+ 'single' => 'single_field',
+ 'elements' => 'has_elements'
+ );
+
+ //Stop execution if group does not exist
+ if ( $this->group_exists($group) && $group =& $this->get_group($group) ) {
+ $group_items = ( count($group->items) > 1 ) ? $classnames->multi : $classnames->single . ( ( ( $fs = array_keys($group->items) ) && ( $f =& $group->items[$fs[0]] ) && ( $els = $f->get_member_value('elements', '', null) ) && !empty($els) ) ? '_' . $classnames->elements : '' );
+ $classname = array($this->add_prefix('attributes_wrap'), $group_items);
+ $out[] = ''; //Wrap all items in group
+
+ //Build layout for each item in group
+ foreach ( array_keys($group->items) as $item_id ) {
+ $item =& $group->items[$item_id];
+ $item->set_caller($this);
+ //Start item output
+ $id = $this->add_prefix('field_' . $item->get_id());
+ $out[] = '
';
+ //Build item layout
+ $out[] = $item->build_layout();
+ //end item output
+ $out[] = '
';
+ $item->clear_caller();
+ }
+ $out[] = '
'; //Close items container
+ //Add description if exists
+ if ( !empty($group->description) )
+ $out[] = '' . $group->description . '
';
+ }
+
+ //Return group output
+ return implode($out);
+ }
+
+ /* Collection */
+
+ /**
+ * Build entire collection of items
+ */
+ function build() {
+ //Get Groups
+ $groups = array_keys($this->get_groups());
+ //Build groups
+ foreach ( $groups as $group ) {
+ $this->build_group($group);
+ }
+ }
+}
+
+/**
+ * Collection of default system-wide fields
+ * @package Simple Lightbox
+ * @subpackage Fields
+ * @author SM
+ *
+ */
+class SLB_Fields extends SLB_Field_Collection {
+
+ var $item_type = 'SLB_Field_Type';
+
+ /**
+ * Placeholder handlers
+ * @var array
+ */
+ var $placholders = null;
+
+ /* Constructor */
+
+ function SLB_Fields() {
+ $this->__construct();
+ }
+
+ function __construct() {
+ parent::__construct('fields');
+ }
+
+ function register_hooks() {
+ parent::register_hooks();
+
+ //Init fields
+ add_action('init', $this->m('register_types'));
+ //Init placeholders
+ add_action('init', $this->m('register_placeholders'));
+ }
+
+ /* Field Types */
+
+ /**
+ * Initialize fields and content types
+ */
+ function register_types() {
+ /* Field Types */
+
+ //Base
+ $base =& new SLB_Field_Type('base');
+ $base->set_description('Default Element');
+ $base->set_property('tag', 'span');
+ $base->set_property('class', '', 'attr');
+ $base->set_layout('form_attr', '{tag} name="{field_name}" id="{field_id}" {properties ref_base="root" group="attr"}');
+ $base->set_layout('form', '<{form_attr ref_base="layout"} />');
+ $base->set_layout('label', '{label} ');
+ $base->set_layout('display', '{data context="display"}');
+ $this->add($base);
+
+ //Base closed
+ $base_closed =& new SLB_Field_Type('base_closed');
+ $base_closed->set_parent('base');
+ $base_closed->set_description('Default Element (Closed Tag)');
+ $base_closed->set_layout('form_start', '<{tag} id="{field_id}" name="{field_name}" {properties ref_base="root" group="attr"}>');
+ $base_closed->set_layout('form_end', '{tag}>');
+ $base_closed->set_layout('form', '{form_start ref_base="layout"}{data}{form_end ref_base="layout"}');
+ $this->add($base_closed);
+
+ //Input
+ $input =& new SLB_Field_Type('input', 'base');
+ $input->set_description('Default Input Element');
+ $input->set_property('tag', 'input');
+ $input->set_property('type', 'text', 'attr');
+ $input->set_property('value', '{data}', 'attr');
+ $this->add($input);
+
+ //Text input
+ $text =& new SLB_Field_Type('text', 'input');
+ $text->set_description('Text Box');
+ $text->set_property('size', 15, 'attr');
+ $text->set_property('label');
+ $text->set_layout('form', '{label ref_base="layout"} {inherit}');
+ $this->add($text);
+
+ //Checkbox
+ $cb =& new SLB_Field_Type('checkbox', 'input');
+ $cb->set_property('type', 'checkbox');
+ $cb->set_property('value', null);
+ $cb->set_layout('form_attr', '{inherit} {checked}');
+ $cb->set_layout('form', '{label ref_base="layout"} <{form_attr ref_base="layout"} />');
+ $this->add($cb);
+
+ //Textarea
+ $ta =& new SLB_Field_Type('textarea', 'base_closed');
+ $ta->set_property('tag', 'textarea');
+ $ta->set_property('cols', 40, 'attr');
+ $ta->set_property('rows', 3, 'attr');
+ $this->add($ta);
+
+ //Rich Text
+ $rt =& new SLB_Field_Type('richtext', 'textarea');
+ $rt->set_property('class', 'theEditor {inherit}');
+ $rt->set_layout('form', '{inherit}
');
+ $rt->add_action('admin_print_footer_scripts', 'wp_tiny_mce', 25);
+ $this->add($rt);
+
+ //Hidden
+ $hidden =& new SLB_Field_Type('hidden');
+ $hidden->set_parent('input');
+ $hidden->set_description('Hidden Field');
+ $hidden->set_property('type', 'hidden');
+ $this->add($hidden);
+
+ //Select
+ $select =& new SLB_Field_Type('select', 'base_closed');
+ $select->set_description('Select tag');
+ $select->set_property('tag', 'select');
+ $select->set_property('tag_option', 'option');
+ $select->set_property('options', array());
+ $select->set_layout('form', '{label ref_base="layout"} {form_start ref_base="layout"}{option_loop ref_base="layout"}{form_end ref_base="layout"}');
+ $select->set_layout('option_loop', '{loop data="properties.options" layout="option" layout_data="option_data"}');
+ $select->set_layout('option', '<{tag_option} value="{data_ext id="option_value"}">{data_ext id="option_text"}{tag_option}>');
+ $select->set_layout('option_data', '<{tag_option} value="{data_ext id="option_value"}" selected="selected">{data_ext id="option_text"}{tag_option}>');
+ $this->add($select);
+
+ //Span
+ $span =& new SLB_Field_Type('span', 'base_closed');
+ $span->set_description('Inline wrapper');
+ $span->set_property('tag', 'span');
+ $span->set_property('value', 'Hello there!');
+ $this->add($span);
+
+ //Enable plugins to modify (add, remove, etc.) field types
+ do_action_ref_array($this->add_prefix('register_fields'), array(&$this));
+
+ //Signal completion of field registration
+ do_action_ref_array($this->add_prefix('fields_registered'), array(&$this));
+ }
+
+ /* Placeholder handlers */
+
+ function register_placeholders() {
+ //Default placeholder handlers
+ $this->register_placeholder('all', $this->m('process_placeholder_default'), 11);
+ $this->register_placeholder('field_id', $this->m('process_placeholder_id'));
+ $this->register_placeholder('field_name', $this->m('process_placeholder_name'));
+ $this->register_placeholder('data', $this->m('process_placeholder_data'));
+ $this->register_placeholder('data_ext',$this->m('process_placeholder_data_ext'));
+ $this->register_placeholder('loop', $this->m('process_placeholder_loop'));
+ $this->register_placeholder('label', $this->m('process_placeholder_label'));
+ $this->register_placeholder('checked', $this->m('process_placeholder_checked'));
+
+ //Allow other code to register placeholders
+ do_action_ref_array($this->add_prefix('register_field_placeholders'), array(&$this));
+
+ //Signal completion of field placeholder registration
+ do_action_ref_array($this->add_prefix('field_placeholders_registered'), array(&$this));
+ }
+
+ /**
+ * Register a function to handle a placeholder
+ * Multiple handlers may be registered for a single placeholder
+ * Adds filter hook to WP for handling specified placeholder
+ * Placeholders are in layouts and are replaced with data at runtime
+ * @uses add_filter()
+ * @param string $placeholder Name of placeholder to add handler for (Using 'all' will set the function as a handler for all placeholders
+ * @param callback $callback Function to set as a handler
+ * @param int $priority (optional) Priority of handler
+ * @return void
+ */
+ function register_placeholder($placeholder, $callback, $priority = 10) {
+ if ( 'all' == $placeholder )
+ $placeholder = '';
+ else
+ $placeholder = '_' . $placeholder;
+ $hook = $this->add_prefix('process_placeholder' . $placeholder);
+ add_filter($hook, $callback, $priority, 5);
+ }
+
+ /**
+ * Default placeholder processing
+ * To be executed when current placeholder has not been handled by another handler
+ * @param string $output Value to be used in place of placeholder
+ * @param SLB_Field $item Field containing placeholder
+ * @param array $placeholder Current placeholder
+ * @see SLB_Field::parse_layout for structure of $placeholder array
+ * @param string $layout Layout to build
+ * @param array $data Extended data for item
+ * @return string Value to use in place of current placeholder
+ */
+ function process_placeholder_default($output, $item, $placeholder, $layout, $data) {
+ //Validate parameters before processing
+ if ( empty($output) && is_a($item, 'SLB_Field_Type') && is_array($placeholder) ) {
+ //Build path to replacement data
+ $output = $item->get_member_value($placeholder);
+
+ //Check if value is group (properties, etc.)
+ //All groups must have additional attributes (beyond reserved attributes) that define how items in group are used
+ if (is_array($output)
+ && !empty($placeholder['attributes'])
+ && is_array($placeholder['attributes'])
+ && ($ph = $item->get_placeholder_defaults())
+ && $attribs = array_diff(array_keys($placeholder['attributes']), array_values($ph->reserved))
+ ) {
+ /* Targeted property is an array, but the placeholder contains additional options on how property is to be used */
+
+ //Find items matching criteria in $output
+ //Check for group criteria
+ if ( 'properties' == $placeholder['tag'] && ($prop_group = $item->get_group($placeholder['attributes']['group'])) && !empty($prop_group) ) {
+ /* Process group */
+ $group_out = array();
+ //Iterate through properties in group and build string
+ foreach ( array_keys($prop_group) as $prop_key ) {
+ $prop_val = $item->get_property($prop_key);
+ if ( !is_null($prop_val) )
+ $group_out[] = $prop_key . '="' . $prop_val . '"';
+ }
+ $output = implode(' ', $group_out);
+ }
+ } elseif ( is_object($output) && is_a($output, $item->base_class) ) {
+ /* Targeted property is actually a nested item */
+ //Set caller to current item
+ $output->set_caller($item);
+ //Build layout for nested element
+ $output = $output->build_layout($layout);
+ }
+ }
+
+ return $output;
+ }
+
+ /**
+ * Build Field ID attribute
+ * @see SLB_Field_Type::process_placeholder_default for parameter descriptions
+ * @return string Placeholder output
+ */
+ function process_placeholder_id($output, $item, $placeholder, $layout, $data) {
+ //Get attributes
+ $args = wp_parse_args($placeholder['attributes'], array('format' => 'attr_id'));
+ return $item->get_id($args);
+ }
+
+ /**
+ * Build Field name attribute
+ * Name is formatted as an associative array for processing by PHP after submission
+ * @see SLB_Field_Type::process_placeholder_default for parameter descriptions
+ * @return string Placeholder output
+ */
+ function process_placeholder_name($output, $item, $placeholder, $layout, $data) {
+ //Get attributes
+ $args = wp_parse_args($placeholder['attributes'], array('format' => 'attr_name'));
+ return $item->get_id($args);
+ }
+
+ /**
+ * Build item label
+ * @see SLB_Fields::process_placeholder_default for parameter descriptions
+ * @return string Field label
+ */
+ function process_placeholder_label($output, $item, $placeholder, $layout, $data) {
+ //Check if item has label property (e.g. sub-elements)
+ $out = $item->get_property('label');
+ //If property not set, use item title
+ if ( empty($out) )
+ $out = $item->get_title();
+ return $out;
+ }
+
+ /**
+ * Retrieve data for item
+ * @see SLB_Field_Type::process_placeholder_default for parameter descriptions
+ * @return string Placeholder output
+ */
+ function process_placeholder_data($output, $item, $placeholder, $layout) {
+ $attr_default = array (
+ 'context' => '',
+ );
+ $opts = wp_parse_args($placeholder['attributes'], $attr_default);
+ //Save context to separate variable
+ $context = $opts['context'];
+ unset($opts['context']);
+ //Get data
+ $out = $item->get_data($opts);
+ if ( !is_null($out) ) {
+ //Get specific member in value (e.g. value from a specific item element)
+ if ( isset($opts['element']) && is_array($out) && ( $el = $opts['element'] ) && isset($out[$el]) )
+ $out = $out[$el];
+ }
+
+ //Format data based on context
+ $out = $item->format($out, $context);
+ //Return data
+ return $out;
+ }
+
+ /**
+ * Set checked attribute on item
+ * Evaluates item's data to see if item should be checked or not
+ * @see SLB_Fields::process_placeholder_default for parameter descriptions
+ * @return string Appropriate checkbox attribute
+ */
+ function process_placeholder_checked($output, $item, $placeholder, $layout, $data) {
+ $out = '';
+ $c = $item->get_container();
+ $d = ( isset($c->data[$item->get_id()]) ) ? $c->data[$item->get_id()] : null;
+ $item->set_property('d', true);
+ if ( $item->get_data() )
+ $out = 'checked="checked"';
+ $item->set_property('d', false);
+ return $out;
+ }
+
+ /**
+ * Loops over data to build item output
+ * Options:
+ * data - Dot-delimited path in item that contains data to loop through
+ * layout - Name of layout to use for each data item in loop
+ * layout_data - Name of layout to use for data item that matches previously-saved item data
+ * @see SLB_Field_Type::process_placeholder_default for parameter descriptions
+ * @return string Placeholder output
+ */
+ function process_placeholder_loop($output, $item, $placeholder, $layout, $data) {
+ //Setup loop options
+ $attr_defaults = array (
+ 'layout' => '',
+ 'layout_data' => null,
+ 'data' => ''
+ );
+ $attr = wp_parse_args($placeholder['attributes'], $attr_defaults);
+ if ( is_null($attr['layout_data']) )
+ $attr['layout_data'] =& $attr['layout'];
+ //Get data for loop
+ $path = explode('.', $attr['data']);
+ $loop_data = $item->get_member_value($path);
+
+ //Check if data is callback
+ if ( is_callable($loop_data) )
+ $loop_data = call_user_func($loop_data);
+
+ //Get item data
+ $data = $item->get_data();
+
+ //Iterate over data and build output
+ $out = array();
+ if ( is_array($loop_data) && !empty($loop_data) ) {
+ foreach ( $loop_data as $value => $label ) {
+ //Load appropriate layout based on item value
+ $layout = ( ($data === 0 && $value === $data) xor $data == $value ) ? $attr['layout_data'] : $attr['layout'];
+ //Stop processing if no valid layout is returned
+ if ( empty($layout) )
+ continue;
+ //Prep extended item data
+ $data_ext = array('option_value' => $value, 'option_text' => $label);
+ $out[] = $item->build_layout($layout, $data_ext);
+ }
+ }
+
+ //Return output
+ return implode($out);
+ }
+
+ /**
+ * Returns specified value from extended data array for item
+ * @see SLB_Field_Type::process_placeholder_default for parameter descriptions
+ * @return string Placeholder output
+ */
+ function process_placeholder_data_ext($output, $item, $placeholder, $layout, $data) {
+ if ( isset($placeholder['attributes']['id']) && ($key = $placeholder['attributes']['id']) && isset($data[$key]) ) {
+ $output = strval($data[$key]);
+ }
+
+ return $output;
+ }
+}
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/includes/class.options.php b/src/wp-content/plugins/simple-lightbox/includes/class.options.php
new file mode 100644
index 00000000..b5db9df8
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/includes/class.options.php
@@ -0,0 +1,395 @@
+ 'data',
+ 'attr' => 'properties'
+ );
+
+ /* Init */
+
+ function SLB_Option($id, $title = '', $default = '') {
+ $args = func_get_args();
+ call_user_func_array(array(&$this, '__construct'), $args);
+ }
+
+ /**
+ * @see SLB_Field::__construct()
+ * @uses parent::__construct() to initialize instance
+ * @param $id
+ * @param $title
+ * @param $default
+ */
+ function __construct($id, $title = '', $default = '') {
+ //Normalize properties
+ $args = func_get_args();
+ $props = SLB_Utilities::func_get_options($args);
+ $props = wp_parse_args($props, array ('id' => $id, 'title' => $title, 'default' => $default));
+ //Send to parent constructor
+ parent::__construct($props);
+ }
+
+ /* Getters/Setters */
+
+ /**
+ * Retrieve default value for option
+ * @return mixed Default option value
+ */
+ function get_default($context = '') {
+ return $this->get_data($context, false);
+ }
+
+ /**
+ * Sets parent based on default value
+ */
+ function set_parent($parent = null) {
+ $p =& $this->get_parent();
+ if ( empty($parent) && empty($p) ) {
+ $parent = 'text';
+ $d = $this->get_default();
+ if ( is_bool($d) )
+ $parent = 'checkbox';
+ $parent = 'option_' . $parent;
+ } elseif ( !empty($p) && !is_object($p) ) {
+ $parent =& $p;
+ }
+ parent::set_parent($parent);
+ }
+
+ /* Formatting */
+
+ /**
+ * Format data as string for browser output
+ * @see SLB_Field_Base::format()
+ * @param mixed $value Data to format
+ * @param string $context (optional) Current context
+ * @return string Formatted value
+ */
+ function format_display($value, $context = '') {
+ if ( !is_string($value) ) {
+ if ( is_bool($value) )
+ $value = ( $value ) ? 'Enabled' : 'Disabled';
+ elseif ( is_null($value) )
+ $value = '';
+ else
+ $value = strval($value);
+ }
+ return htmlentities($value);
+ }
+}
+
+/**
+ * Options collection
+ * @package Simple Lightbox
+ * @subpackage Options
+ * @author SM
+ * @uses SLB_Field_Collection
+ */
+class SLB_Options extends SLB_Field_Collection {
+
+ /* Properties */
+
+ var $item_type = 'SLB_Option';
+
+ /* Init */
+
+ function SLB_Options($id, $props = array()) {
+ $args = func_get_args();
+ call_user_func_array(array(&$this, '__construct'), $args);
+ }
+
+ function __construct($id, $props = array()) {
+ parent::__construct($id, $props);
+ }
+
+ function register_hooks() {
+ parent::register_hooks();
+ //Register fields
+ add_action($this->add_prefix('register_fields'), $this->m('register_fields'));
+ //Set option parents
+ add_action($this->add_prefix('fields_registered'), $this->m('set_parents'));
+ }
+
+ /**
+ * Migrate options from old versions to current version
+ */
+ function migrate() {
+ //Legacy options
+ $oid = 'enabled_single';
+ $d = null;
+ $this->load_data();
+ if ( ($o = get_option($oid, $d)) && $o !== $d ) {
+ $this->set_data('enabled_post', $o, false);
+ $this->set_data('enabled_page', $o, false);
+ }
+ //Migrate separate options to unified option
+ $items =& $this->get_items();
+ foreach ( $items as $id => $opt ) {
+ $oid = $this->add_prefix($id);
+ $o = get_option($oid, $d);
+ if ( $o !== $d ) {
+ //Migrate value to data array
+ $this->set_data($id, $o, false);
+ //Delete legacy option
+ delete_option($oid);
+ }
+ }
+ //Remove any remaining legacy items
+ if ( is_array($this->properties_init) && isset($this->properties_init['legacy']) && is_array($this->properties_init['legacy']) ) {
+ foreach( $this->properties_init['legacy'] as $opt )
+ delete_option($this->add_prefix($opt));
+ }
+ //Save changes
+ $this->save();
+ }
+
+ /* Option setup */
+
+ /**
+ * Register option-specific fields
+ * @param SLB_Fields $fields Reference to global fields object
+ * @return void
+ */
+ function register_fields(&$fields) {
+ //Layouts
+ $layout_label = '{label} ';
+ $label_ref = '{label ref_base="layout"}';
+ $field_pre = '';
+ $field_post = '
';
+ $opt_pre = '';
+ $opt_post = '
';
+ $layout_form = '<{form_attr ref_base="layout"} /> (Default: {data context="display" top="0"})';
+
+ //Text input
+ $otxt =& new SLB_Field_Type('option_text', 'text');
+ $otxt->set_property('class', '{inherit} code');
+ $otxt->set_property('size', null);
+ $otxt->set_property('value', '{data context="form"}');
+ $otxt->set_layout('label', $layout_label);
+ $otxt->set_layout('form', $opt_pre . $label_ref . $field_pre . $layout_form . $field_post . $opt_post);
+ $fields->add($otxt);
+
+ //Checkbox
+ $ocb =& new SLB_Field_Type('option_checkbox', 'checkbox');
+ $ocb->set_layout('label', $layout_label);
+ $ocb->set_layout('form', $opt_pre . $label_ref . $field_pre . $layout_form . $field_post . $opt_post);
+ $fields->add($ocb);
+
+ //Theme
+ $othm =& new SLB_Field_Type('option_theme', 'select');
+ $othm->set_layout('label', $layout_label);
+ $othm->set_layout('form_start', $field_pre . '{inherit}');
+ $othm->set_layout('form_end', '{inherit}' . $field_post);
+ $othm->set_layout('form', $opt_pre . '{inherit}' . $opt_post);
+ $fields->add($othm);
+ }
+
+ /**
+ * Set parent field types for options
+ * Parent only set for Admin pages
+ * @uses SLB_Option::set_parent() to set parent field for each option item
+ * @uses is_admin() to determine if current request is admin page
+ * @param object $fields Collection of default field types
+ * @return void
+ */
+ function set_parents(&$fields) {
+ if ( !is_admin() )
+ return false;
+ $items =& $this->get_items();
+ foreach ( array_keys($items) as $opt ) {
+ $items[$opt]->set_parent();
+ }
+ foreach ( $this->items as $opt ) {
+ $p = $opt->parent;
+ if ( is_object($p) )
+ $p = 'o:' . $p->id;
+ }
+ }
+
+ /* Processing */
+
+ function validate($values) {
+ if ( is_array($values) ) {
+ //Get option group being validated
+ /*
+ $group = '';
+ $filter = 'sanitize_option_';
+ $option = str_replace($filter, '', current_filter());
+ if ( $this->get_id() == $this->remove_prefix($option) ) {
+ $group = '';
+ } else {
+ $group = substr($option, strlen($this->add_prefix($this->get_id())) + 1);
+ }
+ */
+ //Format data based on option type (bool, string, etc.)
+ foreach ( $values as $id => $val ) {
+ //Get default
+ $d = $this->get_default($id);
+ if ( is_bool($d) && !empty($val) )
+ $values[$id] = true;
+ }
+ //Merge in additional options that are not in post data
+ //Missing options (e.g. disabled checkboxes) & defaults
+ $items =& $this->get_items();
+ foreach ( $items as $id => $opt ) {
+ //Add options that were not included in form submission
+ if ( !array_key_exists($id, $values) ) {
+ if ( is_bool($opt->get_default()) )
+ $values[$id] = false;
+ else
+ $values[$id] = $opt->get_default();
+ }
+ }
+ }
+
+ //Return value
+ return $values;
+ }
+
+ /* Data */
+
+ /**
+ * Retrieve options from database
+ * @return array Options data
+ */
+ function fetch_data($sanitize = true) {
+ $data = get_option($this->get_key(), null);
+ if ( $sanitize && is_array($data) ) {
+ //Sanitize loaded data based on default values
+ foreach ( $data as $id => $val ) {
+ if ( $this->has($id) ) {
+ $opt = $this->get($id);
+ if ( is_bool($opt->get_default()) )
+ $data[$id] = !!$val;
+ } else {
+ unset($data[$id]);
+ }
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * Retrieves option data for collection
+ * @see SLB_Field_Collection::load_data()
+ */
+ function load_data() {
+ static $fetched = false;
+ if ( !$fetched ) {
+ $fetched = true;
+ //Retrieve data
+ $this->data = $this->fetch_data();
+ }
+ }
+
+ /**
+ * Resets option values to their default values
+ * @param bool $hard Reset all options if TRUE (default), Reset only unset options if FALSE
+ */
+ function reset($hard = true) {
+ $this->load_data();
+ //Reset data
+ if ( $hard ) {
+ $this->data = null;
+ }
+ //Save
+ $this->save();
+ }
+
+ /**
+ * Save options data to database
+ */
+ function save() {
+ $opts =& $this->get_items();
+ $data = array();
+ foreach ( $opts as $id => $opt ) {
+ $data[$id] = $opt->get_data();
+ }
+ $this->data = $data;
+ update_option($this->get_key(), $data);
+ }
+
+ /* Collection */
+
+ /**
+ * Build key for saving/retrieving data to options table
+ * @return string Key
+ */
+ function get_key() {
+ return $this->add_prefix($this->get_id());
+ }
+
+ /**
+ * Add option to collection
+ * @uses SLB_Field_Collection::add() to add item
+ * @param string $id Unique item ID
+ * @param string $title Item title
+ * @param mixed $default Default value
+ * @param string $group (optional) Group ID to add item to
+ * @return SLB_Option Option instance reference
+ */
+ function &add($id, $title = '', $default = '', $group = null) {
+ //Build properties array
+ $properties = $this->make_properties($title, array('title' => $title, 'group' => $group, 'default' => $default));
+
+ //Create item
+ /**
+ * @var SLB_Option
+ */
+ $item =& parent::add($id, $properties);
+
+ return $item;
+ }
+
+ /**
+ * Retrieve option value
+ * @uses get_data() to retrieve option data
+ * @param string $option Option ID to retrieve value for
+ * @param string $context (optional) Context for formatting data
+ * @return mixed Option value
+ */
+ function get_value($option, $context = '') {
+ return $this->get_data($option, $context);
+ }
+
+ /**
+ * Retrieve option's default value
+ * @uses get_data() to retrieve option data
+ * @param string $option Option ID to retrieve value for
+ * @param string $context (optional) Context for formatting data
+ * @return mixed Option's default value
+ */
+ function get_default($option, $context = '') {
+ return $this->get_data($option, $context, false);
+ }
+
+ /* Output */
+
+ function build_group($group) {
+ if ( !$this->group_exists($group) )
+ return false;
+ $group =& $this->get_group($group);
+ //Stop processing if group contains no items
+ if ( !count($this->get_items($group)) )
+ return false;
+
+ //Group header
+ echo '' . $group->title . ' ';
+ //Build items
+ echo $this->build_items($group);
+ }
+}
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/includes/class.utilities.php b/src/wp-content/plugins/simple-lightbox/includes/class.utilities.php
new file mode 100644
index 00000000..1f4def56
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/includes/class.utilities.php
@@ -0,0 +1,1032 @@
+ 'Plugin Name',
+ 'PluginURI' => 'Plugin URI',
+ 'Version' => 'Version',
+ 'Description' => 'Description',
+ 'Author' => 'Author',
+ 'AuthorURI' => 'Author URI',
+ 'TextDomain' => 'Text Domain',
+ 'DomainPath' => 'Domain Path',
+ 'Network' => 'Network',
+ );
+
+ /* Constructors */
+
+ function SLB_Utilities(&$obj) {
+ $this->__construct(&$obj);
+ }
+
+ function __construct(&$obj) {
+ if ( is_object($obj) )
+ $this->parent =& $obj;
+ }
+
+ /**
+ * Returns callback array to instance method
+ * @param object $obj Instance object
+ * @param string $method Name of method
+ * @return array Callback array
+ */
+ function &m(&$obj, $method = '') {
+ if ( $obj == null && isset($this) )
+ $obj =& $this;
+ $arr = array(&$obj, $method);
+ return $arr;
+ }
+
+ /* Helper Functions */
+
+ /*-** Prefix **-*/
+
+ /**
+ * Get valid separator
+ * @param string $sep (optional) Separator supplied
+ * @return string Separator
+ */
+ function get_sep($sep = false) {
+ if ( is_null($sep) )
+ $sep = '';
+ if ( !is_string($sep) )
+ $default = '_';
+ return ( is_string($sep) ) ? $sep : $default;
+ }
+
+ /**
+ * Retrieve class prefix (with separator if set)
+ * @param bool|string $sep Separator to append to class prefix (Default: no separator)
+ * @return string Class prefix
+ */
+ function get_prefix($sep = null) {
+ $sep = $this->get_sep($sep);
+ $prefix = ( !empty($this->parent->prefix) ) ? $this->parent->prefix . $sep : '';
+ return $prefix;
+ }
+
+ /**
+ * Check if a string is prefixed
+ * @param string $text Text to check for prefix
+ * @param string $sep (optional) Separator used
+ */
+ function has_prefix($text, $sep = null) {
+ return ( !empty($text) && strpos($text, $this->get_prefix($sep)) === 0 );
+ }
+
+ /**
+ * Prepend plugin prefix to some text
+ * @param string $text Text to add to prefix
+ * @param string $sep (optional) Text used to separate prefix and text
+ * @param bool $once (optional) Whether to add prefix to text that already contains a prefix or not
+ * @return string Text with prefix prepended
+ */
+ function add_prefix($text, $sep = '_', $once = true) {
+ if ( $this->has_prefix($text, $sep) )
+ return $text;
+ return $this->get_prefix($sep) . $text;
+ }
+
+ /**
+ * Remove prefix from specified string
+ * @param string $text String to remove prefix from
+ * @param string $sep (optional) Separator used with prefix
+ */
+ function remove_prefix($text, $sep = '_') {
+ if ( $this->has_prefix($text,$sep) )
+ $text = substr($text, strlen($this->get_prefix($sep)));
+ return $text;
+ }
+
+ /**
+ * Returns Database prefix for Cornerstone-related DB Tables
+ * @return string Database prefix
+ */
+ function get_db_prefix() {
+ global $wpdb;
+ return $wpdb->prefix . $this->get_prefix('_');
+ }
+
+ /*-** WP **-*/
+
+ /**
+ * Checks if $post is a valid Post object
+ * If $post is not valid, assigns global post object to $post (if available)
+ * @return bool TRUE if $post is valid object by end of function processing
+ * @param object $post Post object to evaluate
+ */
+ function check_post(&$post) {
+ if (empty($post)) {
+ if (isset($GLOBALS['post'])) {
+ $post = $GLOBALS['post'];
+ $GLOBALS['post'] =& $post;
+ }
+ else
+ return false;
+ }
+ if (is_array($post))
+ $post = (object) $post;
+ elseif (is_numeric($post))
+ $post = get_post($post);
+ if (!is_object($post))
+ return false;
+ return true;
+ }
+
+ /* Hooks */
+
+ function do_action($tag, $arg = '') {
+ do_action($this->add_prefix($tag), $arg);
+ }
+
+ function apply_filters($tag, $value) {
+ apply_filters($this->add_prefix($tag), $value);
+ }
+
+ function add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
+ return add_action($this->add_prefix($tag), $function_to_add, $priority, $accepted_args);
+ }
+
+ function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {
+ return add_filter($this->add_prefix(tag), $function_to_add, $priority, $accepted_args);
+ }
+
+ /* Meta */
+
+ /**
+ * Retrieves post metadata for internal methods
+ * Metadata set internally is wrapped in an array so it is unwrapped before returned the retrieved value
+ * @see get_post_meta()
+ * @param int $post_id Post ID
+ * @param string $key Name of metadata to retrieve
+ * @param boolean $single Whether or not to retrieve single value or not
+ * @return mixed Retrieved post metadata
+ */
+ function post_meta_get($post_id, $key, $single = false) {
+ $meta_value = get_post_meta($post_id, $this->post_meta_get_key($key), $single);
+ if (is_array($meta_value) && count($meta_value) == 1)
+ $meta_value = $meta_value[0];
+ return $meta_value;
+ }
+
+ /**
+ * Wraps metadata in array for storage in database
+ * @param mixed $meta_value Value to be set as metadata
+ * @return array Wrapped metadata value
+ */
+ function post_meta_prepare_value($meta_value) {
+ return array($meta_value);
+ }
+
+ /**
+ * Adds Metadata for a post to database
+ * For internal methods
+ * @see add_post_meta
+ * @param $post_id
+ * @param $meta_key
+ * @param $meta_value
+ * @param $unique
+ * @return boolean Result of operation
+ */
+ function post_meta_add($post_id, $meta_key, $meta_value, $unique = false) {
+ $meta_value = $this->post_meta_value_prepare($meta_value);
+ return add_post_meta($post_id, $meta_key, $meta_value, $unique);
+ }
+
+ /**
+ * Updates post metadata for internal data/methods
+ * @see update_post_meta()
+ * @param $post_id
+ * @param $meta_key
+ * @param $meta_value
+ * @param $prev_value
+ * @return boolean Result of operation
+ */
+ function post_meta_update($post_id, $meta_key, $meta_value, $prev_value = '') {
+ $meta_value = $this->post_meta_prepare_value($meta_value);
+ return update_post_meta($post_id, $meta_key, $meta_value, $prev_value);
+ }
+
+ /**
+ * Builds postmeta key for custom data set by plugin
+ * @param string $key Base key name
+ * @return string Formatted postmeta key
+ */
+ function post_meta_get_key($key) {
+ $sep = '_';
+ if ( strpos($key, $sep . $this->prefix) !== 0 ) {
+ $key_base = func_get_args();
+ if ( !empty($key_base) ) {
+ $key = array_merge((array)$this->prefix, $key_base);
+ return $sep . implode($sep, $key);
+ }
+ }
+
+ return $key;
+ }
+
+ /**
+ * Creates a meta key for storing post meta data
+ * Prefixes standard prefixed text with underscore to hide meta data on post edit forms
+ * @param string $text Text to use as base of meta key
+ * @return string Formatted meta key
+ */
+ function make_meta_key($text = '') {
+ return '_' . $this->add_prefix($text);
+ }
+
+ /*-** Request **-*/
+
+ /**
+ * Checks if the currently executing file matches specified file name
+ * @param string $filename Filename to check for
+ * @return bool TRUE if current page matches specified filename, FALSE otherwise
+ */
+ function is_file( $filename ) {
+ return ( $filename == basename( $_SERVER['SCRIPT_NAME'] ) );
+ }
+
+ /**
+ * Checks whether the current page is a management page
+ * @return bool TRUE if current page is a management page, FALSE otherwise
+ */
+ function is_admin_management_page() {
+ return ( is_admin()
+ && ( $this->is_file('edit.php')
+ || ( $this->is_file('admin.php')
+ && isset($_GET['page'])
+ && strpos($_GET['page'], 'cnr') === 0 )
+ )
+ );
+ }
+
+ /**
+ * Joins and normalizes the slashes in the paths passed to method
+ * All forward/back slashes are converted to forward slashes
+ * Multiple path segments can be passed as additional argments
+ * @param string $path Path to normalize
+ * @param bool $trailing_slash (optional) Whether or not normalized path should have a trailing slash or not (Default: FALSE)
+ * If multiple path segments are passed, $trailing_slash will be the LAST parameter (default value used if omitted)
+ */
+ function normalize_path($path, $trailing_slash = false) {
+ $sl_f = '/';
+ $sl_b = '\\';
+ $parts = func_get_args();
+ if ( func_num_args() > 1 ) {
+ if ( is_bool(($tr = $parts[count($parts) - 1])) ) {
+ $trailing_slash = $tr;
+ //Remove from args array
+ array_pop($parts);
+ } else {
+ $trailing_slash = false;
+ }
+ $first = true;
+ //Trim trailing slashes from path parts
+ foreach ( $parts as $key => $part ) {
+ $part = trim($part);
+ //Special Trim
+ $parts[$key] = trim($part, $sl_f . $sl_b);
+ //Verify path still contains value
+ if ( empty($parts[$key]) ) {
+ unset($parts[$key]);
+ continue;
+ }
+ //Only continue processing the first valid path segment
+ if ( $first )
+ $first = !$first;
+ else
+ continue;
+ //Add back leading slash if necessary
+ if ( $part[0] == $sl_f || $part[0] == $sl_b )
+ $parts[$key] = $sl_f . $parts[$key];
+
+ }
+ }
+ //Join path parts together
+ $parts = implode($sl_b, $parts);
+ $parts = str_replace($sl_b, $sl_f, $parts);
+ //Add trailing slash (if necessary)
+ if ( $trailing_slash )
+ $parts .= $sl_f;
+ return $parts;
+ }
+
+ /**
+ * Returns URL of file (assumes that it is in plugin directory)
+ * @param string $file name of file get URL
+ * @return string File URL
+ */
+ function get_file_url($file) {
+ if ( is_string($file) && '' != trim($file) ) {
+ $file = str_replace(' ', '%20', $this->normalize_path($this->get_url_base(), $file));
+ }
+ return $file;
+ }
+
+ /**
+ * Returns path to plugin file
+ * @param string $file file name
+ * @return string File path
+ */
+ function get_file_path($file) {
+ if ( is_string($file) && '' != trim($file) ) {
+ $file = $this->normalize_path($this->get_path_base(), $file);
+ }
+ return $file;
+ }
+
+ /**
+ * Retrieves file extension
+ * @param string $file file name/path
+ * @return string File's extension
+ */
+ function get_file_extension($file) {
+ $ret = '';
+ $sep = '.';
+ if ( ( $rpos = strrpos($file, $sep) ) !== false )
+ $ret = substr($file, $rpos + 1);
+ return $ret;
+ }
+
+ /**
+ * Checks if file has specified extension
+ * @uses get_file_extension()
+ * @param string $file File name/path
+ * @param string $extension File ending to check $file for
+ * @return bool TRUE if file has extension
+ */
+ function has_file_extension($file, $extension) {
+ return ( $this->get_file_extension($file) == $extension ) ? true : false;
+ }
+
+ /**
+ * Retrieve base URL for plugin-specific files
+ * @uses get_plugin_base()
+ * @uses normalize_path()
+ * @return string Base URL
+ */
+ function get_url_base() {
+ static $url_base = '';
+ if ( '' == $url_base ) {
+ $url_base = $this->normalize_path(plugins_url(), $this->get_plugin_base());
+ }
+ return $url_base;
+ }
+
+ /**
+ * Retrieve plugin's base path
+ * @uses WP_PLUGIN_DIR
+ * @uses get_plugin_base()
+ * @uses normalize_path()
+ * @return string Base path
+ */
+ function get_path_base() {
+ static $path_base = '';
+ if ( '' == $path_base ) {
+ $path_base = $this->normalize_path(WP_PLUGIN_DIR, $this->get_plugin_base());
+ }
+ return $path_base;
+ }
+
+ /**
+ * Retrieve plugin's base directory
+ * @uses WP_PLUGIN_DIR
+ * @uses normalize_path()
+ * @return string Base directory
+ */
+ function get_plugin_base() {
+ static $plugin_dir = '';
+ if ( '' == $plugin_dir ) {
+ $plugin_dir = str_replace($this->normalize_path(WP_PLUGIN_DIR), '', $this->normalize_path(dirname(dirname(__FILE__))));
+ }
+ return $plugin_dir;
+ }
+
+ /**
+ * Retrieve plugin's base file path
+ * @uses get_path_base()
+ * @uses get_file_path()
+ * @return string Base file path
+ */
+ function get_plugin_base_file() {
+ static $file = '';
+ global $cnr;
+ if ( empty($file) ) {
+ $dir = @ opendir($this->get_path_base());
+ if ( $dir ) {
+ while ( ($ftemp = readdir($dir)) !== false ) {
+ //Only process PHP files
+ $ftemp = $this->get_file_path($ftemp);
+ if ( !$this->has_file_extension($ftemp, 'php') || !is_readable($ftemp) )
+ continue;
+ //Check for data
+ $data = get_file_data($ftemp, $this->plugin_headers);
+ if ( !empty($data['Name']) ) {
+ //Set base file
+ $file = $ftemp;
+ break;
+ }
+ }
+ }
+ @closedir($dir);
+ }
+ //Return
+ return $file;
+ }
+
+ /**
+ * Retrieve plugin's internal name
+ * Internal name is used by WP core
+ * @uses get_plugin_base_file()
+ * @uses plugin_basename()
+ * @return string Internal plugin name
+ */
+ function get_plugin_base_name() {
+ $file = $this->get_plugin_base_file();
+ return plugin_basename($file);
+ }
+
+ /**
+ * Retrieve plugin info
+ * Parses info comment in main plugin file
+ * @uses get_plugin_base_file()
+ */
+ function get_plugin_info($field = '') {
+ static $data = array();
+ $ret = '';
+ //Get plugin data
+ if ( empty($data) ) {
+ $file = $this->get_plugin_base_file();
+ $data = get_file_data($file, $this->plugin_headers);
+ }
+ //Return specified field
+ if ( !empty($field) ) {
+ if ( isset($data[$field]) )
+ $ret = $data[$field];
+ } else {
+ $ret = $data;
+ }
+ return $ret;
+ }
+
+ /**
+ * Retrieve plugin version
+ * @uses get_plugin_info()
+ * @param bool $strip_desc Strip any additional version text
+ * @return string Plugin version
+ */
+ function get_plugin_version($strip_desc = true) {
+ static $v = '';
+ //Retrieve version
+ if ( empty($v) ) {
+ $field = 'Version';
+ $v = $this->get_plugin_info($field);
+ }
+ //Format
+ $ret = $v;
+ if ( $strip_desc ) {
+ $ret = explode(' ', $ret, 2);
+ $ret = $ret[0];
+ }
+ //Return
+ return $ret;
+ }
+
+ /**
+ * Retrieve current action based on URL query variables
+ * @param mixed $default (optional) Default action if no action exists
+ * @return string Current action
+ */
+ function get_action($default = null) {
+ $action = '';
+
+ //Check if action is set in URL
+ if ( isset($_GET['action']) )
+ $action = $_GET['action'];
+ //Otherwise, Determine action based on plugin plugin admin page suffix
+ elseif ( isset($_GET['page']) && ($pos = strrpos($_GET['page'], '-')) && $pos !== false && ( $pos != count($_GET['page']) - 1 ) )
+ $action = trim(substr($_GET['page'], $pos + 1), '-_');
+
+ //Determine action for core admin pages
+ if ( ! isset($_GET['page']) || empty($action) ) {
+ $actions = array(
+ 'add' => array('page-new', 'post-new'),
+ 'edit-item' => array('page', 'post'),
+ 'edit' => array('edit', 'edit-pages')
+ );
+ $page = basename($_SERVER['SCRIPT_NAME'], '.php');
+
+ foreach ( $actions as $act => $pages ) {
+ if ( in_array($page, $pages) ) {
+ $action = $act;
+ break;
+ }
+ }
+ }
+ if ( empty($action) )
+ $action = $default;
+ return $action;
+ }
+
+ /*-** General **-*/
+
+ /**
+ * Checks if last parameter sent to a function is an array of options and returns it
+ * Calling function should use `func_get_args()` and pass the value to this method
+ * @param array $args Parameters passed to calling function
+ * @return array Options array (Default: empty array)
+ */
+ function func_get_options($args) {
+ $r = array();
+ if ( is_array($args) && !empty($args) ) {
+ $last = count($args) - 1;
+ if ( is_array($args[$last]) )
+ $r = $args[$last];
+ }
+ return $r;
+ }
+
+ /**
+ * Checks if a property exists in a class or object
+ * (Compatibility method for PHP 4
+ * @param mixed $class Class or object to check
+ * @param string $property Name of property to look for in $class
+ */
+ function property_exists($class, $property) {
+ if ( !is_object($class) && !is_array($class) )
+ return false;
+ if ( function_exists('property_exists') && is_object($class) ) {
+ return property_exists($class, $property);
+ } else {
+ return array_key_exists($property, $class);
+ }
+ }
+
+ /**
+ * Retrieve specified property from object or array
+ * @param object|array $obj Object or array to get property from
+ * @param string $property Property name to retrieve
+ * @return mixed Property value
+ */
+ function &get_property(&$obj, $property) {
+ $property = trim($property);
+ //Object
+ if ( is_object($obj) )
+ return $obj->{$property};
+ //Array
+ if ( is_array($obj) )
+ return $obj[$property];
+ //Class
+ if ( is_string($obj) && class_exists($obj) ) {
+ $cvars = get_class_vars($obj);
+ if ( isset($cvars[$property]) )
+ return $cvars[$property];
+ }
+ }
+
+ /**
+ * Remap array members based on a
+ * mapping of source/destination keys
+ * @param array $properties Associative array of properties
+ * @param array $map Source/Destination mapping
+ * > Key: Source member
+ * > Val: Destination member
+ * @param bool $overwrite If TRUE, source value will be set in destination regardless of whether member already exists or not
+ * @return array Remapped properties
+ */
+ function array_remap($arr, $map = array(), $overwrite = false) {
+ if ( !empty($map) && is_array($map) ) {
+ //Iterate through mappings
+ foreach ( $map as $from => $to ) {
+ if ( !array_key_exists($from, $arr) )
+ continue;
+ $move = $overwrite;
+ //Only remap if parent property doesn't already exist in array
+ if ( !array_key_exists($to, $arr) )
+ $move = true;
+ if ( $move ) {
+ //Move member value to new key
+ $arr[$to] = $arr[$from];
+ //Remove source member
+ unset($arr[$from]);
+ }
+ }
+ }
+ //Return remapped properties
+ return $arr;
+ }
+
+ function array_filter_keys($arr, $keys) {
+ if ( is_array($arr) && !empty($arr) && is_array($keys) && !empty($keys) ) {
+ foreach ( $keys as $rem ) {
+ if ( array_key_exists($rem, $arr) )
+ unset($arr[$rem]);
+ }
+ }
+
+ return $arr;
+ }
+
+ /**
+ * Insert an item into an array at the specified position
+ * @param mixed $item Item to insert into array
+ * @param int $pos Index position to insert item into array
+ * @return array Modified array
+ */
+ function array_insert($array, $item, $pos = null) {
+ array_splice($array, $pos, 0, $item);
+ return $array;
+ }
+
+ /**
+ * Merges 1 or more arrays together
+ * Methodology
+ * - Set first parameter as base array
+ * - All other parameters will be merged into base array
+ * - Iterate through other parameters (arrays)
+ * - Skip all non-array parameters
+ * - Iterate though key/value pairs of current array
+ * - Merge item in base array with current item based on key name
+ * - If the current item's value AND the corresponding item in the base array are BOTH arrays, recursively merge the the arrays
+ * - If the current item's value OR the corresponding item in the base array is NOT an array, current item overwrites base item
+ * @param array Variable number of arrays
+ * @param array $arr1 Default array
+ * @return array Merged array
+ */
+ function array_merge_recursive_distinct($arr1) {
+ //Get all arrays passed to function
+ $args = func_get_args();
+ if ( empty($args) )
+ return false;
+ //Return empty array if first parameter is not an array
+ if ( !is_array($args[0]) )
+ return array();
+ //Set first array as base array
+ $merged = $args[0];
+ //Iterate through arrays to merge
+ $arg_length = count($args);
+ for ( $x = 1; $x < $arg_length; $x++ ) {
+ //Skip if argument is not an array (only merge arrays)
+ if ( !is_array($args[$x]) )
+ continue;
+ //Iterate through argument items
+ foreach ( $args[$x] as $key => $val ) {
+ //Generate key for numeric indexes
+ if ( is_int($key) ) {
+ //Add new item to merged array
+ $merged[] = null;
+ //Get key of new item
+ $key = array_pop(array_keys($merged));
+ }
+ if ( !isset($merged[$key]) || !is_array($merged[$key]) || !is_array($val) ) {
+ $merged[$key] = $val;
+ } elseif ( is_array($merged[$key]) && is_array($val) ) {
+ $merged[$key] = $this->array_merge_recursive_distinct($merged[$key], $val);
+ }
+ }
+ }
+ return $merged;
+ }
+
+ /**
+ * Replaces string value in one array with the value of the matching element in a another array
+ *
+ * @param string $search Text to search for in array
+ * @param array $arr_replace Array to use for replacing values
+ * @param array $arr_subject Array to search for specified value
+ * @return array Searched array with replacements made
+ */
+ function array_replace_recursive($search, $arr_replace, $arr_subject) {
+ foreach ($arr_subject as $key => $val) {
+ //Skip element if key does not exist in the replacement array
+ if (!isset($arr_replace[$key]))
+ continue;
+ //If element values for both arrays are strings, replace text
+ if (is_string($val) && strpos($val, $search) !== false && is_string($arr_replace[$key]))
+ $arr_subject[$key] = str_replace($search, $arr_replace[$key], $val);
+ //If value in both arrays are arrays, recursively replace text
+ if (is_array($val) && is_array($arr_replace[$key]))
+ $arr_subject[$key] = $this->array_replace_recursive($search, $arr_replace[$key], $val);
+ }
+
+ return $arr_subject;
+ }
+
+ /**
+ * Checks if item at specified path in array is set
+ * @param array $arr Array to check for item
+ * @param array $path Array of segments that form path to array (each array item is a deeper dimension in the array)
+ * @return boolean TRUE if item is set in array, FALSE otherwise
+ */
+ function array_item_isset(&$arr, &$path) {
+ $f_path = $this->get_array_path($path);
+ return eval('return isset($arr' . $f_path . ');');
+ }
+
+ /**
+ * Returns value of item at specified path in array
+ * @param array $arr Array to get item from
+ * @param array $path Array of segments that form path to array (each array item is a deeper dimension in the array)
+ * @return mixed Value of item in array (Default: empty string)
+ */
+ function &get_array_item(&$arr, &$path) {
+ $item = '';
+ if ($this->array_item_isset($arr, $path)) {
+ eval('$item =& $arr' . $this->get_array_path($path) . ';');
+ }
+ return $item;
+ }
+
+ /**
+ * Build formatted string based on array values
+ * Array values in formatted string will be ordered by index order
+ * @param array $attribute Values to build string with
+ * @param string $format (optional) Format name (Default: Multidimensional array representation > ['value1']['value2']['value3'], etc.)
+ * @return string Formatted string based on array values
+ */
+ function get_array_path($attribute = '', $format = null) {
+ //Formatted value
+ $fmtd = '';
+ if (!empty($attribute)) {
+ //Make sure attribute is array
+ if (!is_array($attribute)) {
+ $attribute = array($attribute);
+ }
+ //Format attribute
+ $format = strtolower($format);
+ switch ($format) {
+ case 'id':
+ $fmtd = array_shift($attribute) . '[' . implode('][', $attribute) . ']';
+ break;
+ case 'metadata':
+ case 'attribute':
+ //Join segments
+ $delim = '_';
+ $fmtd = implode($delim, $attribute);
+ //Replace white space and repeating delimiters
+ $fmtd = str_replace(' ', $delim, $fmtd);
+ while (strpos($fmtd, $delim.$delim) !== false)
+ $fmtd = str_replace($delim.$delim, $delim, $fmtd);
+ //Prefix formatted value with delimeter for metadata keys
+ if ('metadata' == $format)
+ $fmtd = $delim . $fmtd;
+ break;
+ case 'path':
+ case 'post':
+ default:
+ $fmtd = '["' . implode('"]["', $attribute) . '"]';
+ }
+ }
+ return $fmtd;
+ }
+
+ /**
+ * Builds array of path elements based on arguments
+ * Each item in path array represents a deeper level in structure path is for (object, array, filesystem, etc.)
+ * @param array|string Value to add to the path
+ * @return array 1-dimensional array of path elements
+ */
+ function build_path() {
+ $path = array();
+ $args = func_get_args();
+
+ //Iterate through parameters and build path
+ foreach ( $args as $arg ) {
+ if ( empty($arg) )
+ continue;
+
+ if (is_array($arg)) {
+ //Recurse through array items to pull out any more arrays
+ foreach ($arg as $key => $val) {
+ $path = array_merge($path, $this->build_path($val));
+ }
+ //$path = array_merge($path, array_values($arg));
+ } elseif ( is_scalar($arg) ) {
+ $path[] = $arg;
+ }
+ }
+
+ return $path;
+ }
+
+ /**
+ * Builds attribute string for HTML element
+ * @param array $attr Attributes
+ * @return string Formatted attribute string
+ */
+ function build_attribute_string($attr) {
+ $ret = '';
+ if ( is_object($attr) )
+ $attr = (array) $attr;
+ if ( is_array($attr) ) {
+ array_map('esc_attr', $attr);
+ $attr_str = array();
+ foreach ( $attr as $key => $val ) {
+ $attr_str[] = $key . '="' . $val . '"';
+ }
+ $ret = implode(' ', $attr_str);
+ }
+ return $ret;
+ }
+
+ /**
+ * Generate external stylesheet element
+ * @param $url Stylesheet URL
+ * @return string Stylesheet element
+ */
+ function build_stylesheet_element($url = '') {
+ $attributes = array('href' => $url, 'type' => 'text/css', 'rel' => 'stylesheet');
+ return $this->build_html_element(array('tag' => 'link', 'wrap' => false, 'attributes' => $attributes));
+ }
+
+ /**
+ * Generate external script element
+ * @param $url Script URL
+ * @return string Script element
+ */
+ function build_ext_script_element($url = '') {
+ $attributes = array('src' => $url, 'type' => 'text/javascript');
+ return $this->build_html_element(array('tag' => 'script', 'attributes' => $attributes));
+ }
+
+ /**
+ * Generate HTML element based on values
+ * @param $args Element arguments
+ * @return string Generated HTML element
+ */
+ function build_html_element($args) {
+ $defaults = array(
+ 'tag' => 'span',
+ 'wrap' => true,
+ 'content' => '',
+ 'attributes' => array()
+ );
+ $el_start = '<';
+ $el_end = '>';
+ $el_close = '/';
+ extract(wp_parse_args($args, $defaults), EXTR_SKIP);
+ $content = trim($content);
+
+ if ( !$wrap && strlen($content) > 0 )
+ $wrap = true;
+
+ $attributes = $this->build_attribute_string($attributes);
+ if ( strlen($attributes) > 0 )
+ $attributes = ' ' . $attributes;
+
+ $ret = $el_start . $tag . $attributes;
+
+ if ( $wrap )
+ $ret .= $el_end . $content . $el_start . $el_close . $tag;
+ else
+ $ret .= ' ' . $el_close;
+
+ $ret .= $el_end;
+ return $ret;
+ }
+
+ /*-** Admin **-*/
+
+ /**
+ * Add submenu page in the admin menu
+ * Adds ability to set the position of the page in the menu
+ * @see add_submenu_page (Wraps functionality)
+ *
+ * @param $parent
+ * @param $page_title
+ * @param $menu_title
+ * @param $access_level
+ * @param $file
+ * @param $function
+ * @param int $pos Index position of menu page
+ *
+ * @global array $submenu Admin page submenus
+ */
+ function add_submenu_page($parent, $page_title, $menu_title, $capability, $file, $function = '', $pos = false) {
+ //Add submenu page as usual
+ $args = func_get_args();
+ $hookname = call_user_func_array('add_submenu_page', $args);
+ if ( is_int($pos) ) {
+ global $submenu;
+ //Get last submenu added
+ $parent = $this->get_submenu_parent_file($parent);
+ if ( isset($submenu[$parent]) ) {
+ $subs =& $submenu[$parent];
+
+ //Make sure menu isn't already in the desired position
+ if ( $pos <= ( count($subs) - 1 ) ) {
+ //Get submenu that was just added
+ $sub = array_pop($subs);
+ //Insert into desired position
+ if ( 0 == $pos ) {
+ array_unshift($subs, $sub);
+ } else {
+ $top = array_slice($subs, 0, $pos);
+ $bottom = array_slice($subs, $pos);
+ array_push($top, $sub);
+ $subs = array_merge($top, $bottom);
+ }
+ }
+ }
+ }
+
+ return $hookname;
+ }
+
+ /**
+ * Remove admin submenu
+ * @param string $parent Submenu parent file
+ * @param string $file Submenu file name
+ * @return int|null Index of removed submenu (NULL if submenu not found)
+ *
+ * @global array $submenu
+ * @global array $_registered_pages
+ */
+ function remove_submenu_page($parent, $file) {
+ global $submenu, $_registered_pages;
+ $ret = null;
+
+ $parent = $this->get_submenu_parent_file($parent);
+ $file = plugin_basename($file);
+ $file_index = 2;
+
+ //Find submenu
+ if ( isset($submenu[$parent]) ) {
+ $subs =& $submenu[$parent];
+ for ($x = 0; $x < count($subs); $x++) {
+ if ( $subs[$x][$file_index] == $file ) {
+ //Remove matching submenu
+ $hookname = get_plugin_page_hookname($file, $parent);
+ remove_all_actions($hookname);
+ unset($_registered_pages[$hookname]);
+ unset($subs[$x]);
+ $subs = array_values($subs);
+ //Set index and stop processing
+ $ret = $x;
+ break;
+ }
+ }
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Replace a submenu page
+ * Adds a submenu page in the place of an existing submenu page that has the same $file value
+ *
+ * @param $parent
+ * @param $page_title
+ * @param $menu_title
+ * @param $access_level
+ * @param $file
+ * @param $function
+ * @return string Hookname
+ *
+ * @global array $submenu
+ */
+ function replace_submenu_page($parent, $page_title, $menu_title, $access_level, $file, $function = '') {
+ global $submenu;
+ //Remove matching submenu (if exists)
+ $pos = $this->remove_submenu_page($parent, $file);
+ //Insert submenu page
+ $hookname = $this->add_submenu_page($parent, $page_title, $menu_title, $access_level, $file, $function, $pos);
+ return $hookname;
+ }
+
+ /**
+ * Retrieves parent file for submenu
+ * @param string $parent Parent file
+ * @return string Formatted parent file name
+ *
+ * @global array $_wp_real_parent_file;
+ */
+ function get_submenu_parent_file($parent) {
+ global $_wp_real_parent_file;
+ $parent = plugin_basename($parent);
+ if ( isset($_wp_real_parent_file[$parent]) )
+ $parent = $_wp_real_parent_file[$parent];
+ return $parent;
+ }
+}
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/js/dev/lightbox.js b/src/wp-content/plugins/simple-lightbox/js/dev/lightbox.js
new file mode 100644
index 00000000..6613044c
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/js/dev/lightbox.js
@@ -0,0 +1,867 @@
+// -----------------------------------------------------------------------------------
+//
+// Simple Lightbox
+// by Archetyped - http://archetyped.com/tools/simple-lightbox/
+// Updated: 2011-01-27
+//
+// Originally based on Lightbox Slideshow v1.1
+// by Justin Barkhuff - http://www.justinbarkhuff.com/lab/lightbox_slideshow/
+// 2007/08/15
+//
+// Largely based on Lightbox v2.02
+// by Lokesh Dhakar - http://huddletogether.com/projects/lightbox2/
+// 2006/03/31
+//
+// Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
+//
+// The code inserts HTML at the bottom of the page for displaying content in a non-modal dialog
+//
+// -----------------------------------------------------------------------------------
+
+/**
+ * Lightbox object
+ */
+//var SLB = null;
+(function($) {
+SLB = {
+ activeImage : null,
+ badObjects : ['select','object','embed'],
+ container : null,
+ enableSlideshow : null,
+ groupName : null,
+ imageArray : [],
+ options : null,
+ overlayDuration : null,
+ overlayOpacity : null,
+ playSlides : null,
+ refTags : ['a'],
+ relAttribute : null,
+ resizeDuration : null,
+ slideShowTimer : null,
+ startImage : null,
+ prefix : 'slb',
+ checkedUrls : {},
+
+
+ /**
+ * Initialize lightbox instance
+ * @param object options Instance options
+ */
+ initialize: function(options) {
+ this.options = $.extend(true, {
+ animate : true, // resizing animations
+ validateLinks : false, //Validate links before adding them to lightbox
+ captionEnabled: true, //Display caption
+ captionSrc : true, //Use image source URI if title not set
+ autoPlay : true, // should slideshow start automatically
+ borderSize : 10, // if you adjust the padding in the CSS, you will need to update this variable
+ containerID : document, // lightbox container object
+ enableSlideshow : true, // enable slideshow feature
+ googleAnalytics : false, // track individual image views using Google Analytics
+ imageDataLocation : 'south', // location of image caption information
+ initImage : '', // ID of image link to automatically launch when upon script initialization
+ loop : true, // whether to continuously loop slideshow images
+ overlayDuration : .2, // time to fade in shadow overlay
+ overlayOpacity : .8, // transparency of shadow overlay
+ relAttribute : 'lightbox', // specifies the rel attribute value that triggers lightbox
+ resizeSpeed : 400, // controls the speed of the image resizing (milliseconds)
+ showGroupName : false, // show group name of images in image details
+ slideTime : 4, // time to display images during slideshow
+ altsrc : 'src',
+ strings : { // allows for localization
+ closeLink : 'close',
+ loadingMsg : 'loading',
+ nextLink : 'next »',
+ prevLink : '« prev',
+ startSlideshow : 'start slideshow',
+ stopSlideshow : 'stop slideshow',
+ numDisplayPrefix : 'Image',
+ numDisplaySeparator : 'of'
+ },
+ placeholders : {
+ slbContent: ' ',
+ slbLoading: 'loading ',
+ slbClose: 'close ',
+ navPrev: '« prev ',
+ navNext: '» next ',
+ navSlideControl: 'Stop ',
+ dataCaption: ' ',
+ dataNumber: ' '
+ },
+ layout : null
+ }, options);
+
+ //Stop if no layout is defined
+ if (!this.options.layout || this.options.layout.toString().length == 0)
+ this.end();
+
+ //Validate options
+ if ( this.options.animate ) {
+ this.overlayDuration = Math.max(this.options.overlayDuration,0);
+ this.resizeDuration = this.options.resizeSpeed;
+ } else {
+ this.overlayDuration = 0;
+ this.resizeDuration = 0;
+ }
+ this.enableSlideshow = this.options.enableSlideshow;
+ this.overlayOpacity = Math.max(Math.min(this.options.overlayOpacity,1),0);
+ this.playSlides = this.options.autoPlay;
+ this.container = $(this.options.containerID);
+ this.relAttribute = this.options.relAttribute;
+ this.updateImageList();
+ var t = this;
+ var objBody = $(this.container).get(0) != document ? this.container : $('body');
+
+ var objOverlay = $('
', {
+ 'id': this.getID('overlay'),
+ 'css': {'display': 'none'}
+ }).appendTo(objBody)
+ .click(function() {t.end()});
+
+ var objLightbox = $('
', {
+ 'id': this.getID('lightbox'),
+ 'css': {'display': 'none'}
+ }).appendTo(objBody)
+ .click(function() {t.end()});
+
+ //Build layout from template
+ var layout = this.getLayout();
+
+ //Append to container
+ $(layout).appendTo(objLightbox);
+
+ //Set UI
+ this.setUI();
+
+ //Add events
+ this.setEvents();
+
+ if (this.options.initImage != '') {
+ this.start($(this.options.initImage));
+ }
+ },
+
+ /**
+ * Build layout from template
+ * @uses options.layout
+ * @return string Layout markup (HTML)
+ */
+ getLayout: function() {
+ var l = this.options.layout;
+
+ //Expand placeholders
+ var ph, phs, phr;
+ for (ph in this.options.placeholders) {
+ phs = '{' + ph + '}';
+ //Continue to next placeholder if current one is not in layout
+ if (l.indexOf(phs) == -1)
+ continue;
+ phr = new RegExp(phs, "g");
+ l = l.replace(phr, this.options.placeholders[ph]);
+ }
+
+ //Return final layout
+ return l;
+
+ },
+
+ /**
+ * Set localized values for UI elements
+ */
+ setUI: function() {
+ var s = this.options.strings;
+ this.get('slbClose').html(s.closeLink);
+ this.get('navNext').html(s.nextLink);
+ this.get('navPrev').html(s.prevLink);
+ this.get('navSlideControl').html(((this.playSlides) ? s.stopSlideshow : s.startSlideshow));
+ },
+
+ /**
+ * Add events to various UI elements
+ */
+ setEvents: function() {
+ var t = this, delay = 500;
+ this.get('container,details').click(function(ev) {
+ ev.stopPropagation();
+ });
+
+ var clickP = function() {
+ t.get('navPrev').unbind('click').click(false);
+ setTimeout(function() {t.get('navPrev').click(clickP)}, delay);
+ t.showPrev();
+ return false;
+ };
+ this.get('navPrev').click(function(){
+ return clickP();
+ });
+
+ var clickN = function() {
+ t.get('navNext').unbind('click').click(false);
+ setTimeout(function() {t.get('navNext').click(clickN)}, delay);
+ t.showNext();
+ return false;
+ };
+ this.get('navNext').click(function() {
+ return clickN();
+ });
+
+ this.get('navSlideControl').click(function() {
+ t.toggleSlideShow();
+ return false;
+ });
+ this.get('slbClose').click(function() {
+ t.end();
+ return false;
+ });
+ },
+
+ /**
+ * Finds all compatible image links on page
+ */
+ updateImageList: function() {
+ var el, els, rel, t = this;
+ sel = [], selBase = '[href][rel*="' + this.relAttribute + '"]';
+
+ //Define event handler
+ var handler = function() {
+ //Check if element is valid for lightbox
+ t.start(this);
+ return false;
+ };
+
+ //Build selector
+ for (var i = 0; i < this.refTags.length; i++) {
+ sel.push(this.refTags[i] + selBase);
+ }
+ sel = sel.join(',');
+
+ //Add event handler to links
+ $(sel, $(this.container)).live('click', handler);
+ },
+
+ /**
+ * Build caption for displayed caption
+ * @param {Object} imageLink
+ */
+ getCaption: function(imageLink) {
+ imageLink = $(imageLink);
+ var caption = '';
+ if (this.options.captionEnabled) {
+ caption = imageLink.attr('title') || '';
+ if (caption == '') {
+ var inner = $(imageLink).find('img').first();
+ if ($(inner).length)
+ caption = $(inner).attr('title') || $(inner).attr('alt');
+ if (!caption) {
+ if (imageLink.text().length)
+ caption = imageLink.text();
+ else
+ if (this.options.captionSrc)
+ caption = imageLink.attr('href');
+ }
+ if (!caption)
+ caption = '';
+ }
+ }
+ return caption;
+ },
+
+ /**
+ * Display overlay and lightbox. If image is part of a set, add siblings to imageArray.
+ * @param node imageLink Link element containing image URL
+ */
+ start: function(imageLink) {
+ imageLink = $(imageLink);
+ this.hideBadObjects();
+
+ this.imageArray = [];
+ this.groupName = this.getGroup(imageLink);
+
+ var rel = $(imageLink).attr('rel') || '';
+ var imageTitle = '';
+ var t = this;
+ var groupTemp = {};
+ this.fileExists(this.getSourceFile(imageLink),
+ function() { //File exists
+ // Stretch overlay to fill page and fade in
+ t.get('overlay')
+ .height($(document).height())
+ .fadeTo(t.overlayDuration, t.overlayOpacity);
+
+ // Add image to array closure
+ var addLink = function(el, idx) {
+ groupTemp[idx] = el;
+ return groupTemp.length;
+ };
+
+ //Build final image array & launch lightbox
+ var proceed = function() {
+ t.startImage = 0;
+ //Sort links by document order
+ var order = [], el;
+ for (var x in groupTemp) {
+ order.push(x);
+ }
+ order.sort(function(a, b) { return (a - b); });
+ for (x = 0; x < order.length; x++) {
+ el = groupTemp[order[x]];
+ //Check if link being evaluated is the same as the clicked link
+ if ($(el).get(0) == $(imageLink).get(0)) {
+ t.startImage = x;
+ }
+ t.imageArray.push({'link':t.getSourceFile($(el)), 'title':t.getCaption(el)});
+ }
+ // Calculate top offset for the lightbox and display
+ var lightboxTop = $(document).scrollTop() + ($(window).height() / 15);
+
+ t.get('lightbox').css('top', lightboxTop + 'px').show();
+ t.changeImage(t.startImage);
+ }
+
+ // If image is NOT part of a group..
+ if (null == t.groupName) {
+ // Add single image to imageArray
+ addLink(imageLink, 0);
+ t.startImage = 0;
+ proceed();
+ } else {
+ // If image is part of a group
+ var els = $(t.container).find($(imageLink).get(0).tagName.toLowerCase());
+ // Loop through links on page & find other images in group
+ var grpLinks = [];
+ var i, el;
+ for (i = 0; i < els.length; i++) {
+ el = $(els[i]);
+ if (t.getSourceFile(el) && (t.getGroup(el) == t.groupName)) {
+ //Add links in same group to temp array
+ grpLinks.push(el);
+ }
+ }
+
+ //Loop through group links, validate, and add to imageArray
+ var processed = 0;
+ for (i = 0; i < grpLinks.length; i++) {
+ el = grpLinks[i];
+ t.fileExists(t.getSourceFile($(el)),
+ function(args) { //File exists
+ var el = args.els[args.idx];
+ var il = addLink(el, args.idx);
+ processed++;
+ if (processed == args.els.length)
+ proceed();
+ },
+ function(args) { //File does not exist
+ processed++;
+ if (args.idx == args.els.length)
+ proceed();
+ },
+ {'idx': i, 'els': grpLinks});
+ }
+ }
+ },
+ function() { //File does not exist
+ t.end();
+ });
+ },
+
+ /**
+ * Retrieve source URI in link
+ * @param {Object} el
+ * @return string Source file URI
+ */
+ getSourceFile: function(el) {
+ var src = $(el).attr('href');
+ var rel = $(el).attr('rel') || '';
+ var reSrc = new RegExp('\\b' + this.options.altsrc + '\\[(.+?)\\](?:\\b|$)');
+ if ( reSrc.test(rel) ) {
+ src = reSrc.exec(rel)[1];
+ }
+ return src;
+ },
+
+ /**
+ * Extract group name from
+ * @param obj el Element to extract group name from
+ * @return string Group name
+ */
+ getGroup: function(el) {
+ //Get full attribute value
+ var g = null;
+ var rel = $(el).attr('rel') || '';
+ if (rel != '') {
+ var gTmp = '';
+ var gSt = '[';
+ var gEnd = ']';
+ var search = this.relAttribute;
+ var searching = true;
+ var idx;
+ var prefix = ' ';
+ while (searching) {
+ idx = rel.indexOf(search);
+ //Stop processing if value is not found
+ if (idx == -1)
+ return g;
+ //Prefix with space to find whole word
+ if (prefix != search.charAt(0) && idx > 0) {
+ search = prefix + search;
+ }
+ else {
+ searching = false;
+ }
+ }
+ gTmp = $.trim(rel.substring(idx).replace(search, ''));
+ //Check if group defined
+ if (gTmp.length && gSt == gTmp.charAt(0) && gTmp.indexOf(gEnd) != -1) {
+ //Extract group name
+ g = gTmp.substring(1, gTmp.indexOf(gEnd));
+ }
+ }
+ return g;
+ },
+
+ /**
+ * Preload requested image prior to displaying it in lightbox
+ * @param int imageNum Index of image in imageArray property
+ * @uses imageArray to retrieve index at specified image
+ * @uses resizeImageContainer() to resize lightbox after image has loaded
+ */
+ changeImage: function(imageNum) {
+ this.activeImage = imageNum;
+
+ this.disableKeyboardNav();
+ this.pauseSlideShow();
+
+ // hide elements during transition
+ this.get('slbLoading').show();
+ this.get('slbContent').hide();
+ this.get('details').hide();
+ var imgPreloader = new Image();
+ var t = this;
+ // once image is preloaded, resize image container
+ $(imgPreloader).bind('load', function() {
+ t.get('slbContent').attr('src', imgPreloader.src);
+ t.resizeImageContainer(imgPreloader.width, imgPreloader.height);
+ //Restart slideshow if active
+ if ( t.isSlideShowActive() )
+ t.startSlideShow();
+ });
+
+ //Load image
+ imgPreloader.src = this.imageArray[this.activeImage].link;
+ },
+
+ /**
+ * Resizes lightbox to fit image
+ * @param int imgWidth Image width in pixels
+ * @param int imgHeight Image height in pixels
+ */
+ resizeImageContainer: function(imgWidth, imgHeight) {
+ // get current height and width
+ var el = this.get('container');
+ var borderSize = this.options.borderSize * 2;
+
+ this.get('container').animate({width: imgWidth + borderSize, height: imgHeight + borderSize}, this.resizeDuration)
+
+ this.showImage();
+ },
+
+ /**
+ * Display image and begin preloading neighbors.
+ */
+ showImage: function() {
+ this.get('slbLoading').hide();
+ var t = this;
+ this.get('slbContent').fadeIn(500, function() { t.updateDetails(); });
+ this.preloadNeighborImages();
+ },
+
+ /**
+ * Display caption, image number, and bottom nav
+ */
+ updateDetails: function() {
+ if (this.options.captionEnabled) {
+ this.get('dataCaption').text(this.imageArray[this.activeImage].title);
+ this.get('dataCaption').show();
+ } else {
+ this.get('dataCaption').hide();
+ }
+
+ // if image is part of set display 'Image x of y'
+ if (this.hasImages()) {
+ var num_display = this.options.strings.numDisplayPrefix + ' ' + (this.activeImage + 1) + ' ' + this.options.strings.numDisplaySeparator + ' ' + this.imageArray.length;
+ if (this.options.showGroupName && this.groupName != '') {
+ num_display += ' ' + this.options.strings.numDisplaySeparator + ' ' + this.groupName;
+ }
+ this.get('dataNumber')
+ .text(num_display)
+ .show();
+ }
+
+ this.get('details').width(this.get('slbContent').width() + (this.options.borderSize * 2));
+ this.updateNav();
+ var t = this;
+ this.get('details').animate({height: 'show', opacity: 'show'}, 650);
+ },
+
+ /**
+ * Display appropriate previous and next hover navigation.
+ */
+ updateNav: function() {
+ if (this.hasImages()) {
+ this.get('navPrev').show();
+ this.get('navNext').show();
+ if (this.enableSlideshow) {
+ this.get('navSlideControl').show();
+ if (this.playSlides) {
+ this.startSlideShow();
+ } else {
+ this.stopSlideShow();
+ }
+ } else {
+ this.get('navSlideControl').hide();
+ }
+ } else {
+ // Hide navigation controls when only one image exists
+ this.get('dataNumber').hide();
+ this.get('navPrev').hide();
+ this.get('navNext').hide();
+ this.get('navSlideControl').hide();
+ }
+ this.enableKeyboardNav();
+ },
+
+ /**
+ * Checks if slideshow is currently activated
+ * @return bool TRUE if slideshow is active, FALSE otherwise
+ * @uses playSlides to check slideshow activation status
+ */
+ isSlideShowActive: function() {
+ return this.playSlides;
+ },
+
+ /**
+ * Start the slideshow
+ */
+ startSlideShow: function() {
+ this.playSlides = true;
+ var t = this;
+ clearInterval(this.slideShowTimer);
+ this.slideShowTimer = setInterval(function() { t.showNext(); t.pauseSlideShow(); }, this.options.slideTime * 1000);
+ this.get('navSlideControl').text(this.options.strings.stopSlideshow);
+ },
+
+ /**
+ * Stop the slideshow
+ */
+ stopSlideShow: function() {
+ this.playSlides = false;
+ if (this.slideShowTimer) {
+ clearInterval(this.slideShowTimer);
+ }
+ this.get('navSlideControl').text(this.options.strings.startSlideshow);
+ },
+
+ /**
+ * Toggles the slideshow status
+ */
+ toggleSlideShow: function() {
+ if (this.playSlides) {
+ this.stopSlideShow();
+ }else{
+ this.startSlideShow();
+ }
+ },
+
+ /**
+ * Pauses the slideshow
+ * Stops the slideshow but does not change the slideshow's activation status
+ */
+ pauseSlideShow: function() {
+ if (this.slideShowTimer) {
+ clearInterval(this.slideShowTimer);
+ }
+ },
+
+ /**
+ * Check if there is at least one image to display in the lightbox
+ * @return bool TRUE if at least one image is found
+ * @uses imageArray to check for images
+ */
+ hasImage: function() {
+ return ( this.imageArray.length > 0 );
+ },
+
+ /**
+ * Check if there are multiple images to display in the lightbox
+ * @return bool TRUE if there are multiple images
+ * @uses imageArray to determine the number of images
+ */
+ hasImages: function() {
+ return ( this.imageArray.length > 1 );
+ },
+
+ /**
+ * Check if the current image is the first image in the list
+ * @return bool TRUE if image is first
+ * @uses activeImage to check index of current image
+ */
+ isFirstImage: function() {
+ return ( this.activeImage == 0 );
+ },
+
+ /**
+ * Check if the current image is the last image in the list
+ * @return bool TRUE if image is last
+ * @uses activeImage to check index of current image
+ * @uses imageArray to compare current image to total number of images
+ */
+ isLastImage: function() {
+ return ( this.activeImage == this.imageArray.length - 1 );
+ },
+
+ /**
+ * Show the next image in the list
+ */
+ showNext : function() {
+ if (this.hasImages()) {
+ if ( !this.options.loop && this.isLastImage() ) {
+ return this.end();
+ }
+ if ( this.isLastImage() ) {
+ this.showFirst();
+ } else {
+ this.changeImage(this.activeImage + 1);
+ }
+ }
+ },
+
+ /**
+ * Show the previous image in the list
+ */
+ showPrev : function() {
+ if (this.hasImages()) {
+ if ( !this.options.loop && this.isFirstImage() )
+ return this.end();
+ if (this.activeImage == 0) {
+ this.showLast();
+ } else {
+ this.changeImage(this.activeImage - 1);
+ }
+ }
+ },
+
+ /**
+ * Show the first image in the list
+ */
+ showFirst : function() {
+ if (this.hasImages()) {
+ this.changeImage(0);
+ }
+ },
+
+ /**
+ * Show the last image in the list
+ */
+ showLast : function() {
+ if (this.hasImages()) {
+ this.changeImage(this.imageArray.length - 1);
+ }
+ },
+
+ /**
+ * Enable image navigation via the keyboard
+ */
+ enableKeyboardNav: function() {
+ var t = this;
+ $(document).keydown(function(e) {
+ t.keyboardAction(e);
+ });
+ },
+
+ /**
+ * Disable image navigation via the keyboard
+ */
+ disableKeyboardNav: function() {
+ $(document).unbind('keydown');
+ },
+
+ /**
+ * Handler for keyboard events
+ * @param event e Keyboard event data
+ */
+ keyboardAction: function(e) {
+ if (e == null) { // ie
+ keycode = event.keyCode;
+ } else { // mozilla
+ keycode = e.which;
+ }
+
+ key = String.fromCharCode(keycode).toLowerCase();
+
+ if (keycode == 27 || key == 'x' || key == 'o' || key == 'c') { // close lightbox
+ this.end();
+ } else if (key == 'p' || key == '%') { // display previous image
+ this.showPrev();
+ } else if (key == 'n' || key =='\'') { // display next image
+ this.showNext();
+ } else if (key == 'f') { // display first image
+ this.showFirst();
+ } else if (key == 'l') { // display last image
+ this.showLast();
+ } else if (key == 's') { // toggle slideshow
+ if (this.hasImage() && this.options.enableSlideshow) {
+ this.toggleSlideShow();
+ }
+ }
+ },
+
+ /**
+ * Preloads images before/after current image
+ */
+ preloadNeighborImages: function() {
+ var nextImageID = this.imageArray.length - 1 == this.activeImage ? 0 : this.activeImage + 1;
+ nextImage = new Image();
+ nextImage.src = this.imageArray[nextImageID].link;
+
+ var prevImageID = this.activeImage == 0 ? this.imageArray.length - 1 : this.activeImage - 1;
+ prevImage = new Image();
+ prevImage.src = this.imageArray[prevImageID].link;
+ },
+
+ /**
+ * Close the lightbox
+ */
+ end: function() {
+ this.disableKeyboardNav();
+ this.pauseSlideShow();
+ this.get('lightbox').hide();
+ this.get('overlay').fadeOut(this.overlayDuration);
+ this.showBadObjects();
+ },
+
+ /**
+ * Displays objects that may conflict with the lightbox
+ * @param bool show (optional) Whether or not to show objects (Default: TRUE)
+ */
+ showBadObjects: function (show) {
+ show = ( typeof(show) == 'undefined' ) ? true : !!show;
+ var vis = (show) ? 'visible' : 'hidden';
+ $(this.badObjects.join(',')).css('visibility', vis);
+ },
+
+ /**
+ * Hides objects that may conflict with the lightbox
+ * @uses showBadObjects() to hide objects
+ */
+ hideBadObjects: function () {
+ this.showBadObjects(false);
+ },
+
+ /**
+ * Add prefix to text
+ * @param string txt Text to add prefix to
+ * @return string Prefixed text
+ */
+ addPrefix: function(txt) {
+ return this.prefix + '_' + txt;
+ },
+
+ /**
+ * Generate formatted ID for lightbox-specific elements
+ * @param string id Base ID of element
+ * @return string Formatted ID
+ */
+ getID: function(id) {
+ return this.addPrefix(id);
+ },
+
+ /**
+ * Generate formatted selector for lightbox-specific elements
+ * Compares specified ID to placeholders first, then named elements
+ * Multiple selectors can be included and separated by commas (',')
+ * @param string id Base ID of element
+ * @uses options.placeholders to compare id to placeholder names
+ * @return string Formatted selector
+ */
+ getSel: function(id) {
+ //Process multiple selectors
+ var delim = ',', prefix = '#', sel;
+ if (id.toString().indexOf(delim) != -1) {
+ //Split
+ var sels = id.toString().split(delim);
+ //Build selector
+ for (var x = 0; x < sels.length; x++) {
+ sels[x] = this.getSel($.trim(sels[x]));
+ }
+ //Join
+ sel = sels.join(delim);
+ } else {
+ //Single selector
+ if (id in this.options.placeholders) {
+ var ph = $(this.options.placeholders[id]);
+ if (!ph.attr('id')) {
+ //Class selector
+ prefix = '.';
+ }
+ }
+ sel = prefix + this.getID(id);
+ }
+
+ return sel;
+ },
+
+ /**
+ * Retrieve lightbox-specific element
+ * @param string id Base ID of element
+ * @uses getSel() to generate formatted selector for element
+ * @return object jQuery object of selected element(s)
+ */
+ get: function(id) {
+ return $(this.getSel(id));
+ },
+
+ /**
+ * Checks if file exists using AJAX request
+ * @param string url File URL
+ * @param callback success Callback to run if file exists
+ * @param callback failure Callback to run if file does not exist
+ * @param obj args Arguments for callback
+ */
+ fileExists: function(url, success, failure, args) {
+ if (!this.options.validateLinks)
+ return success(args);
+ var statusFail = 400;
+ var stateCheck = 4;
+ var t = this;
+ var proceed = function(res) {
+ if (res.status < statusFail) {
+ if ($.isFunction(success))
+ success(args);
+ } else {
+ if ($.isFunction(failure))
+ failure(args);
+ }
+ };
+
+ //Check if URL already processed
+ if (url in this.checkedUrls) {
+ proceed(this.checkedUrls[url]);
+ } else {
+ var req = new XMLHttpRequest();
+ req.open('HEAD', url, true);
+ req.onreadystatechange = function() {
+ if (stateCheck == this.readyState) {
+ t.addUrl(url, this);
+ proceed(this);
+ }
+ };
+ req.send();
+ }
+ },
+
+ addUrl: function(url, res) {
+ if (!(url in this.checkedUrls))
+ this.checkedUrls[url] = res;
+ }
+}
+})(jQuery);
\ No newline at end of file
diff --git a/src/wp-content/plugins/simple-lightbox/js/lib.js b/src/wp-content/plugins/simple-lightbox/js/lib.js
new file mode 100644
index 00000000..b6b036f1
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/js/lib.js
@@ -0,0 +1,21 @@
+(function(d){SLB={activeImage:null,badObjects:["select","object","embed"],container:null,enableSlideshow:null,groupName:null,imageArray:[],options:null,overlayDuration:null,overlayOpacity:null,playSlides:null,refTags:["a"],relAttribute:null,resizeDuration:null,slideShowTimer:null,startImage:null,prefix:"slb",checkedUrls:{},initialize:function(a){this.options=d.extend(true,{animate:true,validateLinks:false,captionEnabled:true,captionSrc:true,autoPlay:true,borderSize:10,containerID:document,enableSlideshow:true,
+googleAnalytics:false,imageDataLocation:"south",initImage:"",loop:true,overlayDuration:0.2,overlayOpacity:0.8,relAttribute:"lightbox",resizeSpeed:400,showGroupName:false,slideTime:4,altsrc:"src",strings:{closeLink:"close",loadingMsg:"loading",nextLink:"next »",prevLink:"« prev",startSlideshow:"start slideshow",stopSlideshow:"stop slideshow",numDisplayPrefix:"Image",numDisplaySeparator:"of"},placeholders:{slbContent:' ',slbLoading:'loading ',
+slbClose:'close ',navPrev:'« prev ',navNext:'» next ',navSlideControl:'Stop ',dataCaption:' ',dataNumber:' '},layout:null},a);if(!this.options.layout||this.options.layout.toString().length==0)this.end();if(this.options.animate){this.overlayDuration=Math.max(this.options.overlayDuration,
+0);this.resizeDuration=this.options.resizeSpeed}else this.resizeDuration=this.overlayDuration=0;this.enableSlideshow=this.options.enableSlideshow;this.overlayOpacity=Math.max(Math.min(this.options.overlayOpacity,1),0);this.playSlides=this.options.autoPlay;this.container=d(this.options.containerID);this.relAttribute=this.options.relAttribute;this.updateImageList();var b=this;a=d(this.container).get(0)!=document?this.container:d("body");d("
",{id:this.getID("overlay"),css:{display:"none"}}).appendTo(a).click(function(){b.end()});
+a=d("
",{id:this.getID("lightbox"),css:{display:"none"}}).appendTo(a).click(function(){b.end()});var c=this.getLayout();d(c).appendTo(a);this.setUI();this.setEvents();this.options.initImage!=""&&this.start(d(this.options.initImage))},getLayout:function(){var a=this.options.layout,b,c;for(b in this.options.placeholders){c="{"+b+"}";if(a.indexOf(c)!=-1){c=new RegExp(c,"g");a=a.replace(c,this.options.placeholders[b])}}return a},setUI:function(){var a=this.options.strings;this.get("slbClose").html(a.closeLink);
+this.get("navNext").html(a.nextLink);this.get("navPrev").html(a.prevLink);this.get("navSlideControl").html(this.playSlides?a.stopSlideshow:a.startSlideshow)},setEvents:function(){var a=this;this.get("container,details").click(function(g){g.stopPropagation()});var b=function(){a.get("navPrev").unbind("click").click(false);setTimeout(function(){a.get("navPrev").click(b)},500);a.showPrev();return false};this.get("navPrev").click(function(){return b()});var c=function(){a.get("navNext").unbind("click").click(false);
+setTimeout(function(){a.get("navNext").click(c)},500);a.showNext();return false};this.get("navNext").click(function(){return c()});this.get("navSlideControl").click(function(){a.toggleSlideShow();return false});this.get("slbClose").click(function(){a.end();return false})},updateImageList:function(){var a=this;sel=[];selBase='[href][rel*="'+this.relAttribute+'"]';for(var b=0;b0)c=" "+c;else g=false}c=d.trim(a.substring(h).replace(c,""));if(c.length&&"["==c.charAt(0)&&c.indexOf("]")!=-1)b=c.substring(1,c.indexOf("]"))}return b},changeImage:function(a){this.activeImage=a;this.disableKeyboardNav();this.pauseSlideShow();this.get("slbLoading").show();this.get("slbContent").hide();this.get("details").hide();var b=new Image,c=this;d(b).bind("load",
+function(){c.get("slbContent").attr("src",b.src);c.resizeImageContainer(b.width,b.height);c.isSlideShowActive()&&c.startSlideShow()});b.src=this.imageArray[this.activeImage].link},resizeImageContainer:function(a,b){this.get("container");var c=this.options.borderSize*2;this.get("container").animate({width:a+c,height:b+c},this.resizeDuration);this.showImage()},showImage:function(){this.get("slbLoading").hide();var a=this;this.get("slbContent").fadeIn(500,function(){a.updateDetails()});this.preloadNeighborImages()},
+updateDetails:function(){if(this.options.captionEnabled){this.get("dataCaption").text(this.imageArray[this.activeImage].title);this.get("dataCaption").show()}else this.get("dataCaption").hide();if(this.hasImages()){var a=this.options.strings.numDisplayPrefix+" "+(this.activeImage+1)+" "+this.options.strings.numDisplaySeparator+" "+this.imageArray.length;if(this.options.showGroupName&&this.groupName!="")a+=" "+this.options.strings.numDisplaySeparator+" "+this.groupName;this.get("dataNumber").text(a).show()}this.get("details").width(this.get("slbContent").width()+
+this.options.borderSize*2);this.updateNav();this.get("details").animate({height:"show",opacity:"show"},650)},updateNav:function(){if(this.hasImages()){this.get("navPrev").show();this.get("navNext").show();if(this.enableSlideshow){this.get("navSlideControl").show();this.playSlides?this.startSlideShow():this.stopSlideShow()}else this.get("navSlideControl").hide()}else{this.get("dataNumber").hide();this.get("navPrev").hide();this.get("navNext").hide();this.get("navSlideControl").hide()}this.enableKeyboardNav()},
+isSlideShowActive:function(){return this.playSlides},startSlideShow:function(){this.playSlides=true;var a=this;clearInterval(this.slideShowTimer);this.slideShowTimer=setInterval(function(){a.showNext();a.pauseSlideShow()},this.options.slideTime*1E3);this.get("navSlideControl").text(this.options.strings.stopSlideshow)},stopSlideShow:function(){this.playSlides=false;this.slideShowTimer&&clearInterval(this.slideShowTimer);this.get("navSlideControl").text(this.options.strings.startSlideshow)},toggleSlideShow:function(){this.playSlides?
+this.stopSlideShow():this.startSlideShow()},pauseSlideShow:function(){this.slideShowTimer&&clearInterval(this.slideShowTimer)},hasImage:function(){return this.imageArray.length>0},hasImages:function(){return this.imageArray.length>1},isFirstImage:function(){return this.activeImage==0},isLastImage:function(){return this.activeImage==this.imageArray.length-1},showNext:function(){if(this.hasImages()){if(!this.options.loop&&this.isLastImage())return this.end();this.isLastImage()?this.showFirst():this.changeImage(this.activeImage+
+1)}},showPrev:function(){if(this.hasImages()){if(!this.options.loop&&this.isFirstImage())return this.end();this.activeImage==0?this.showLast():this.changeImage(this.activeImage-1)}},showFirst:function(){this.hasImages()&&this.changeImage(0)},showLast:function(){this.hasImages()&&this.changeImage(this.imageArray.length-1)},enableKeyboardNav:function(){var a=this;d(document).keydown(function(b){a.keyboardAction(b)})},disableKeyboardNav:function(){d(document).unbind("keydown")},keyboardAction:function(a){keycode=
+a==null?event.keyCode:a.which;key=String.fromCharCode(keycode).toLowerCase();if(keycode==27||key=="x"||key=="o"||key=="c")this.end();else if(key=="p"||key=="%")this.showPrev();else if(key=="n"||key=="'")this.showNext();else if(key=="f")this.showFirst();else if(key=="l")this.showLast();else key=="s"&&this.hasImage()&&this.options.enableSlideshow&&this.toggleSlideShow()},preloadNeighborImages:function(){var a=this.imageArray.length-1==this.activeImage?0:this.activeImage+1;nextImage=new Image;nextImage.src=
+this.imageArray[a].link;a=this.activeImage==0?this.imageArray.length-1:this.activeImage-1;prevImage=new Image;prevImage.src=this.imageArray[a].link},end:function(){this.disableKeyboardNav();this.pauseSlideShow();this.get("lightbox").hide();this.get("overlay").fadeOut(this.overlayDuration);this.showBadObjects()},showBadObjects:function(a){d(this.badObjects.join(",")).css("visibility",(typeof a=="undefined"?true:!!a)?"visible":"hidden")},hideBadObjects:function(){this.showBadObjects(false)},addPrefix:function(a){return this.prefix+
+"_"+a},getID:function(a){return this.addPrefix(a)},getSel:function(a){var b="#";if(a.toString().indexOf(",")!=-1){a=a.toString().split(",");for(b=0;bis_enabled();
+}
+
+function slb_register_theme($name, $title, $stylesheet_url, $layout) {
+ global $slb;
+ $slb->register_theme($name, $title, $stylesheet_url, $layout);
+}
+
+?>
diff --git a/src/wp-content/plugins/simple-lightbox/model.php b/src/wp-content/plugins/simple-lightbox/model.php
new file mode 100644
index 00000000..90fd1774
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/model.php
@@ -0,0 +1,633 @@
+ array (
+ 'activation' => 'Activation',
+ 'grouping' => 'Grouping',
+ 'ui' => 'UI',
+ 'labels' => 'Labels'
+ ),
+ 'items' => array (
+ 'enabled' => array('title' => 'Enable Lightbox Functionality', 'default' => true, 'group' => 'activation'),
+ 'enabled_home' => array('title' => 'Enable on Home page', 'default' => true, 'group' => 'activation'),
+ 'enabled_post' => array('title' => 'Enable on Posts', 'default' => true, 'group' => 'activation'),
+ 'enabled_page' => array('title' => 'Enable on Pages', 'default' => true, 'group' => 'activation'),
+ 'enabled_archive' => array('title' => 'Enable on Archive Pages (tags, categories, etc.)', 'default' => true, 'group' => 'activation'),
+ 'activate_links' => array('title' => 'Activate all image links in item content', 'default' => true, 'group' => 'activation'),
+ 'activate_attachments' => array('title' => 'Activate all image attachment links', 'default' => true, 'group' => 'activation'),
+ 'validate_links' => array('title' => 'Validate links', 'default' => false, 'group' => 'activation'),
+ 'group_links' => array('title' => 'Group automatically activated links (for displaying as a slideshow)', 'default' => true, 'group' => 'grouping'),
+ 'group_post' => array('title' => 'Group image links by Post (e.g. on pages with multiple posts)', 'default' => true, 'group' => 'grouping'),
+ 'theme' => array('title' => 'Theme', 'default' => 'default', 'group' => 'ui', 'parent' => 'option_theme'),
+ 'animate' => array('title' => 'Animate lightbox resizing', 'default' => true, 'group' => 'ui'),
+ 'autostart' => array('title' => 'Automatically Start Slideshow', 'default' => true, 'group' => 'ui'),
+ 'duration' => array('title' => 'Slide Duration (Seconds)', 'default' => '6', 'attr' => array('size' => 3, 'maxlength' => 3), 'group' => 'ui'),
+ 'loop' => array('title' => 'Loop through images', 'default' => true, 'group' => 'ui'),
+ 'overlay_opacity' => array('title' => 'Overlay Opacity (0 - 1)', 'default' => '0.8', 'attr' => array('size' => 3, 'maxlength' => 3), 'group' => 'ui'),
+ 'enabled_caption' => array('title' => 'Enable caption', 'default' => true, 'group' => 'ui'),
+ 'caption_src' => array('title' => 'Use image URI as caption when link title not set', 'default' => true, 'group' => 'ui'),
+ 'txt_closeLink' => array('title' => 'Close link (for accessibility only, image used for button)', 'default' => 'close', 'group' => 'labels'),
+ 'txt_loadingMsg' => array('title' => 'Loading indicator', 'default' => 'loading', 'group' => 'labels'),
+ 'txt_nextLink' => array('title' => 'Next Image link', 'default' => 'next »', 'group' => 'labels'),
+ 'txt_prevLink' => array('title' => 'Previous Image link', 'default' => '« prev', 'group' => 'labels'),
+ 'txt_startSlideshow' => array('title' => 'Start Slideshow link', 'default' => 'start slideshow', 'group' => 'labels'),
+ 'txt_stopSlideshow' => array('title' => 'Stop Slideshow link', 'default' => 'stop slideshow', 'group' => 'labels'),
+ 'txt_numDisplayPrefix' => array('title' => 'Image number prefix (e.g. Image x of y)', 'default' => 'Image', 'group' => 'labels'),
+ 'txt_numDisplaySeparator' => array('title' => 'Image number separator (e.g. Image x of y)', 'default' => 'of', 'group' => 'labels')
+ ),
+ 'legacy' => array (
+ 'header_activation',
+ 'header_enabled',
+ 'header_strings',
+ 'header_ui',
+ 'enabled_single'
+ )
+ );
+
+ /* Instance members */
+
+ /**
+ * Options instance
+ * @var SLB_Options
+ */
+ var $options = null;
+
+ /**
+ * Fields
+ * @var SLB_Fields
+ */
+ var $fields = null;
+
+ /*-** Init **-*/
+
+ function SLB_Lightbox() {
+ $this->__construct();
+ }
+
+ function __construct() {
+ parent::__construct();
+ $this->init();
+
+ //Setup options
+ $opt_theme =& $this->options_config['items']['theme'];
+ $opt_theme['default'] = $this->theme_default = $this->add_prefix($this->theme_default);
+ $opt_theme['options'] = $this->m('get_theme_options');
+
+ //Init objects
+ $this->fields =& new SLB_Fields();
+ $this->options =& new SLB_Options('options', $this->options_config);
+ }
+
+ function register_hooks() {
+ parent::register_hooks();
+
+ /* Admin */
+
+ //Init lightbox admin
+ add_action('admin_init', $this->m('admin_settings'));
+ //Enqueue header files (CSS/JS)
+ add_action('admin_enqueue_scripts', $this->m('admin_enqueue_files'));
+ //Reset Settings
+ add_action('admin_action_' . $this->add_prefix('reset'), $this->m('admin_reset'));
+ add_action('admin_notices', $this->m('admin_notices'));
+ //Plugin listing
+ add_filter('plugin_action_links_' . $this->util->get_plugin_base_name(), $this->m('admin_plugin_action_links'), 10, 4);
+
+ /* Client-side */
+
+ //Init lightbox
+ add_action('wp_enqueue_scripts', $this->m('enqueue_files'));
+ add_action('wp_head', $this->m('client_init'));
+ add_filter('the_content', $this->m('activate_post_links'), 99);
+
+ /* Themes */
+ $this->util->add_action('init_themes', $this->m('init_default_themes'));
+ }
+
+ function activate() {
+ //Set default options (if not yet set)
+ $this->options->reset(false);
+ $this->options->migrate();
+ }
+
+ /*-** Helpers **-*/
+
+ /**
+ * Checks whether lightbox is currently enabled/disabled
+ * @return bool TRUE if lightbox is currently enabled, FALSE otherwise
+ */
+ function is_enabled($check_request = true) {
+ $ret = ( $this->options->get_value('enabled') ) ? true : false;
+ if ( $ret && $check_request ) {
+ $opt = '';
+ //Determine option to check
+ if ( is_home() )
+ $opt = 'home';
+ elseif ( is_singular() ) {
+ $opt = ( is_page() ) ? 'page' : 'post';
+ }
+ elseif ( is_archive() || is_search() )
+ $opt = 'archive';
+ //Check option
+ if ( !empty($opt) && ( $opt = 'enabled_' . $opt ) && $this->options->has($opt) ) {
+ $ret = ( $this->options->get_value($opt) ) ? true : false;
+ }
+ }
+ return $ret;
+ }
+
+ /*-** Theme **-*/
+
+ /**
+ * Retrieve themes
+ * @uses do_action() Calls 'slb_init_themes' hook to allow plugins to register themes
+ * @uses $themes to return registered themes
+ * @return array Retrieved themes
+ */
+ function get_themes() {
+ static $fetched = false;
+ if ( !$fetched ) {
+ $this->themes = array();
+ $this->util->do_action('init_themes');
+ $fetched = true;
+ }
+ return $this->themes;
+ }
+
+ /**
+ * Retrieve theme
+ * @param string $name Name of theme to retrieve
+ * @uses theme_exists() to check for existence of theme
+ * @return array Theme data
+ */
+ function get_theme($name = '') {
+ $name = strval($name);
+ //Default: Get current theme if no theme specified
+ if ( empty($name) ) {
+ $name = $this->options->get_value('theme');
+ }
+ if ( !$this->theme_exists($name) )
+ $name = $this->theme_default;
+ return $this->themes[$name];
+ }
+
+ /**
+ * Retrieve specific of theme data
+ * @uses get_theme() to retrieve theme data
+ * @param string $name Theme name
+ * @param string $field Theme field to retrieve
+ * @return mixed Field data
+ */
+ function get_theme_data($name = '', $field) {
+ $theme = $this->get_theme($name);
+ return ( isset($theme[$field]) ) ? $theme[$field] : '';
+ }
+
+ /**
+ * Retrieve theme stylesheet URL
+ * @param string $name Theme name
+ * @uses get_theme_data() to retrieve theme data
+ * @return string Stylesheet URL
+ */
+ function get_theme_style($name = '') {
+ return $this->get_theme_data($name, 'stylesheet_url');
+ }
+
+ /**
+ * Retrieve theme layout
+ * @uses get_theme_data() to retrieve theme data
+ * @param string $name Theme name
+ * @param bool $filter (optional) Filter layout based on user preferences
+ * @return string Theme layout HTML
+ */
+ function get_theme_layout($name = '', $filter = true) {
+ $l = $this->get_theme_data($name, 'layout');
+ //Filter
+ if ( !$this->options->get_value('enabled_caption') )
+ $l = str_replace($this->get_theme_placeholder('dataCaption'), '', $l);
+ return $l;
+ }
+
+ /**
+ * Check whether a theme exists
+ * @param string $name Theme to look for
+ * @uses get_themes() to intialize themes if not already performed
+ * @return bool TRUE if theme exists, FALSE otherwise
+ */
+ function theme_exists($name) {
+ $this->get_themes();
+ return ( isset($this->themes[trim(strval($name))]) );
+ }
+
+ /**
+ * Register lightbox theme
+ * @param string $name Unique theme name
+ * @param string $title Display name for theme
+ * @param string $stylesheet_url URL to stylesheet
+ * @param string $layout Layout HTML
+ * @uses $themes to store the registered theme
+ */
+ function register_theme($name, $title, $stylesheet_url, $layout) {
+ if ( !is_array($this->themes) ) {
+ $this->themes = array();
+ }
+
+ //Validate parameters
+ $name = trim(strval($name));
+ $title = trim(strval($title));
+ $stylesheet_url = trim(strval($stylesheet_url));
+ $layout = $this->format_theme_layout($layout);
+
+ $defaults = array(
+ 'name' => '',
+ 'title' => '',
+ 'stylesheet_url' => '',
+ 'layout' => ''
+ );
+
+ //Add theme to array
+ $this->themes[$name] = wp_parse_args(compact(array_keys($defaults), $defaults));
+ }
+
+ /**
+ * Build theme placeholder
+ * @param string $name Placeholder name
+ * @return string Placeholder
+ */
+ function get_theme_placeholder($name) {
+ return '{' . $name . '}';
+ }
+
+ /**
+ * Formats layout for usage in JS
+ * @param string $layout Layout to format
+ * @return string Formatted layout
+ */
+ function format_theme_layout($layout = '') {
+ //Remove line breaks
+ $layout = str_replace(array("\r\n", "\n", "\r", "\t"), '', $layout);
+
+ //Escape quotes
+ $layout = str_replace("'", "\'", $layout);
+
+ //Return
+ return "'" . $layout . "'";
+ }
+
+ /**
+ * Add default themes
+ * @uses register_theme() to register the theme(s)
+ */
+ function init_default_themes() {
+ $name = $this->theme_default;
+ $title = 'Default';
+ $stylesheet_url = $this->util->get_file_url('css/lightbox.css');
+ $layout = file_get_contents($this->util->normalize_path($this->util->get_path_base(), 'templates', 'default', 'layout.html'));
+ $this->register_theme($name, $title, $stylesheet_url, $layout);
+ //Testing: Additional themes
+ $this->register_theme('black', 'Black', $this->util->get_file_url('css/lb_black.css'), $layout);
+ }
+
+ /*-** Frontend **-*/
+
+ /**
+ * Scans post content for image links and activates them
+ *
+ * Lightbox will not be activated for feeds
+ * @param $content
+ */
+ function activate_post_links($content) {
+ //Check option
+ if ( ! is_feed() && $this->is_enabled() && $this->options->get_value('activate_links') ) {
+ $links = array();
+ //Get all links on page
+ $rgx = "/\]+href=.*?\>/i";
+ preg_match_all($rgx, $content, $links);
+ $links = $links[0];
+ $domain = str_replace(array('http://', 'https://'), '', get_bloginfo('url'));
+ //Process links
+ if ( count($links) > 0 ) {
+ global $post;
+ $types = (object) array('img' => 'image', 'att' => 'attachment');
+ $img_types = array('jpg', 'jpeg', 'gif', 'png');
+ $rgx = "/\b(\w+.*?)=\"(.*?)\"(?:\s|$)/i";
+ //Iterate through links & add lightbox if necessary
+ foreach ( $links as $link ) {
+ //Check if rel attribute exists
+ $link_new = $link;
+ //Parse link
+ $link_attr = substr($link_new, 2, strlen($link_new) - 3);
+ $attr_matches = $attr = array();
+ preg_match_all($rgx, $link_attr, $attr_matches);
+ foreach ( $attr_matches[1] as $key => $val ) {
+ if ( isset($attr_matches[2][$key]) )
+ $attr[trim($val)] = trim($attr_matches[2][$key]);
+ }
+ //Destroy parsing vars
+ unset($link_attr, $attr_matches);
+
+ //Set default attributes
+ $attr = array_map('trim', array_merge(array('rel' => '', 'href' => ''), $attr));
+ $h =& $attr['href'];
+ $r =& $attr['rel'];
+
+
+ //Stop processing link if lightbox attribute has already been set
+ $lb = 'lightbox';
+ if ( empty($h) || '#' == $h || ( !empty($r) && ( strpos($r, $lb) !== false || strpos($r, $this->add_prefix('off')) !== false ) ) )
+ continue;
+
+ //Determine link type
+ $type = false;
+ if ( in_array($this->util->get_file_extension($h), $img_types) )
+ $type = $types->img;
+ elseif ( strpos($h, $domain) !== false && is_local_attachment($h) && ( $pid = url_to_postid($h) ) && wp_attachment_is_image($pid) )
+ $type = $types->att;
+ if ( !$type )
+ continue;
+
+ if ( $type == $types->att && !$this->options->get_value('activate_attachments') )
+ continue;
+
+ //Process link
+ if ( empty($r) )
+ $r = array();
+ else
+ $r = array($r);
+
+ //Check if links should be grouped
+ if ( $this->options->get_value('group_links') ) {
+ $group = ( $this->options->get_value('group_post') ) ? $this->add_prefix($post->ID) : $this->get_prefix();
+ $lb .= '[' . $group . ']';
+ }
+ $r[] = $lb;
+
+ //Type specific processing
+ switch ($type) {
+ case $types->att:
+ //Get attachment URL
+ $src = wp_get_attachment_url($pid);
+ if ( !empty($src) )
+ $r[] = $this->add_prefix('src[' . $src . ']');
+ break;
+ }
+
+ //Convert rel attribute to string
+ $r = implode(' ', $r);
+
+ $link_new = ' util->build_attribute_string($attr) . '>';
+ //Insert modified link
+ $content = str_replace($link, $link_new, $content);
+ unset($h, $r);
+ }
+ }
+ }
+ return $content;
+ }
+
+ /**
+ * Enqueue files in template head
+ */
+ function enqueue_files() {
+ if ( ! $this->is_enabled() )
+ return;
+ wp_enqueue_script($this->add_prefix('lib'), $this->util->get_file_url('js/lib.js'), array('jquery'), $this->util->get_plugin_version());
+ wp_enqueue_style($this->add_prefix('style'), $this->get_theme_style(), array(), $this->util->get_plugin_version());
+ }
+
+ /**
+ * Sets options/settings to initialize lightbox functionality on page load
+ * @return void
+ */
+ function client_init() {
+ if ( ! $this->is_enabled() )
+ return;
+
+ $options = array();
+ $out = array();
+ $out['script_start'] = '';
+ $js_code = array();
+ //Get options
+ $options = array(
+ 'validateLinks' => $this->options->get_value('validate_links'),
+ 'autoPlay' => $this->options->get_value('autostart'),
+ 'slideTime' => $this->options->get_value('duration'),
+ 'loop' => $this->options->get_value('loop'),
+ 'overlayOpacity' => $this->options->get_value('overlay_opacity'),
+ 'animate' => $this->options->get_value('animate'),
+ 'captionEnabled' => $this->options->get_value('enabled_caption'),
+ 'captionSrc' => $this->options->get_value('caption_src'),
+ 'layout' => $this->get_theme_layout(),
+ 'altsrc' => $this->add_prefix('src')
+ );
+ $lb_obj = array();
+ foreach ($options as $option => $val) {
+ if ( is_bool($val) )
+ $val = ( $val ) ? 'true' : 'false';
+ elseif ( is_string($val) && "'" != $val[0] )
+ $val = "'" . $val . "'";
+ $lb_obj[] = "'{$option}':{$val}";
+ }
+ //Load UI Strings
+ if ( ($strings = $this->build_strings()) && !empty($strings) )
+ $lb_obj[] = $strings;
+ $js_code[] = 'SLB.initialize({' . implode(',', $lb_obj) . '});';
+ echo $out['script_start'] . implode('', $js_code) . $out['script_end'];
+ }
+
+ /**
+ * Build JS object of UI strings when initializing lightbox
+ * @return string JS object of UI strings
+ */
+ function build_strings() {
+ $ret = '';
+ $prefix = 'txt_';
+ $opt_strings = array_filter(array_keys($this->options->get_items()), create_function('$opt', 'return ( strpos($opt, "' . $prefix . '") === 0 );'));
+ if ( $opt_strings ) {
+ $strings = array();
+ foreach ( $opt_strings as $key ) {
+ $name = substr($key, strlen($prefix));
+ $strings[] = "'" . $name . "':'" . $this->options->get_value($key) . "'";
+ }
+ $ret = "'strings':{" . implode(',', $strings) . "}";
+ }
+ return $ret;
+ }
+
+ /*-** Admin **-*/
+
+ /**
+ * Adds custom links below plugin on plugin listing page
+ * @param $actions
+ * @param $plugin_file
+ * @param $plugin_data
+ * @param $context
+ */
+ function admin_plugin_action_links($actions, $plugin_file, $plugin_data, $context) {
+ //Add link to settings (only if active)
+ if ( is_plugin_active($this->util->get_plugin_base_name()) ) {
+ $settings = __('Settings');
+ $reset = __('Reset');
+ $reset_confirm = "'" . __('Are you sure you want to reset your settings?') . "'";
+ $action = $this->add_prefix('reset');
+ $reset_link = wp_nonce_url(add_query_arg('action', $action, remove_query_arg(array($this->add_prefix('action'), 'action'), $_SERVER['REQUEST_URI'])), $action);
+ array_unshift($actions, ' ' . $settings . ' ');
+ array_splice($actions, 1, 0, '' . $reset . ' ');
+ }
+ return $actions;
+ }
+
+ /**
+ * Reset plugin settings
+ * Redirects to referring page upon completion
+ */
+ function admin_reset() {
+ //Validate user
+ if ( ! current_user_can('activate_plugins') || ! check_admin_referer($this->add_prefix('reset')) )
+ wp_die(__('You do not have sufficient permissions to manage plugins for this blog.'));
+ $action = 'reset';
+ if ( isset($_REQUEST['action']) && $this->add_prefix($action) == $_REQUEST['action'] ) {
+ //Reset settings
+ $this->options->reset(true);
+ $uri = remove_query_arg(array('_wpnonce', 'action'), add_query_arg(array($this->add_prefix('action') => $action), $_SERVER['REQUEST_URI']));
+ //Redirect user
+ wp_redirect($uri);
+ exit;
+ }
+ }
+
+ /**
+ * Displays notices for admin operations
+ */
+ function admin_notices() {
+ if ( is_admin() && isset($_REQUEST[$this->add_prefix('action')]) ) {
+ $action = $_REQUEST[$this->add_prefix('action')];
+ $msg = null;
+ if ( $action ) {
+ switch ( $action ) {
+ case 'reset':
+ $msg = "Simple Lightbox's settings have been reset ";
+ break;
+ }
+ if ( ! is_null($msg) ) {
+ ?>
+
+ Media Admin menu
+ * @todo Move appropriate code to options class
+ */
+ function admin_settings() {
+ $page = $this->options_admin_page;
+ $form = $this->options_admin_form;
+ $curr = basename($_SERVER['SCRIPT_NAME']);
+ if ( $curr != $page && $curr != $form ) {
+ return;
+ }
+
+ $page = 'media';
+ $section = $this->get_prefix();
+ //Section
+ add_settings_section($section, '' . __('Lightbox Settings') . ' ', $this->m('admin_section'), $page);
+ //Register settings container
+ register_setting($page, $this->add_prefix('options'), $this->options->m('validate'));
+ }
+
+ /**
+ * Enqueues header files for admin pages
+ * @todo Separate and move options CSS to options class
+ */
+ function admin_enqueue_files() {
+ //Enqueue custom CSS for options page
+ if ( is_admin() && basename($_SERVER['SCRIPT_NAME']) == $this->options_admin_page ) {
+ wp_enqueue_style($this->add_prefix('admin'), $this->util->get_file_url('css/admin.css'), array(), $this->util->get_plugin_version());
+ }
+ }
+
+ /**
+ * Get ID of settings section on admin page
+ * @return string ID of settings section
+ * @todo Eval for moving to options class
+ */
+ function admin_get_settings_section() {
+ return $this->add_prefix('settings');
+ }
+
+ /**
+ * Placeholder function for lightbox admin settings
+ * Required because setting init function requires a callback
+ * @todo Evaluate for moving to options class
+ */
+ function admin_section() {
+ $this->options->build();
+ }
+
+ /* Custom fields */
+
+ function get_theme_options() {
+ //Get themes
+ $themes = $this->get_themes();
+
+ //Pop out default theme
+ $theme_default = $themes[$this->theme_default];
+ unset($themes[$this->theme_default]);
+
+ //Sort themes by title
+ uasort($themes, create_function('$a,$b', 'return strcmp($a[\'title\'], $b[\'title\']);'));
+
+ //Insert default theme at top of array
+ $themes = array($this->theme_default => $theme_default) + $themes;
+
+ //Build options
+ foreach ( $themes as $name => $props ) {
+ $themes[$name] = $props['title'];
+ }
+ return $themes;
+ }
+}
+
+?>
diff --git a/src/wp-content/plugins/simple-lightbox/readme.txt b/src/wp-content/plugins/simple-lightbox/readme.txt
new file mode 100644
index 00000000..a673a221
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/readme.txt
@@ -0,0 +1,146 @@
+=== Plugin Name ===
+Contributors: archetyped
+Donate link: http://archetyped.com/tools/simple-lightbox/#donate
+Tags: lightbox, gallery, photography, images, theme, template, style
+Requires at least: 3.1.2
+Tested up to: 3.2
+Stable tag: trunk
+
+A simple, themeable, and customizable Lightbox for Wordpress
+
+== Description ==
+Simple Lightbox is a very simple and customizable lightbox that is easy to add to your Wordpress website. It also [supports themes](http://archetyped.com/lab/slb-registering-themes/), so it can be fully integrated with your site's theme.
+
+### BETA NOTES
+The current release is a beta version. Please test and [provide feedback on the beta release page](http://archetyped.com/lab/slb-1-5-5-beta/).
+Main changes
+
+#### Beta 4
+* Add: Support for WordPress 3.2
+* Add: Support for links added after page load (e.g. via AJAX, etc.)
+* Add: Admin option to enable/disable attachment links
+* Optimize: Improved compatibility for older versions of PHP
+
+#### Beta 3
+* Add: Support for image attachment links
+* Optimize: Improved compatibility for older versions of PHP
+* Optimize: Internal optimizations
+
+#### Beta 2
+* Fix: Debug code removed (Fatal Seb)
+* Update: Improved URL handling
+* Update: Cache-management for enqueued files
+
+#### Beta 1
+* Update: Options management overhaul
+* Fix: XHTML Validation (Hajo Validation)
+
+#### Customization
+Options for customizing the lightbox behavior are located in the **Settings > Media** admin menu in the **Lightbox Settings** section (or just click the **Settings** link below the plugin's name when viewing the list of installed plugins)
+
+* **New: Link Validation** (Optional)
+* **New: Keyboard Navigation**
+* **New: Show/Hide Lightbox Caption**
+* Theme Support
+* Customizable UI Text
+* Enable/Disable Lightbox Functionality (Default: Enabled)
+* Enable Lightbox depending on Page Type (Home, Pages, Archive, etc.)
+* Automatically activate lightbox for links to images on page (no need to add `rel="lightbox"` attribute to link)
+* Group automatically-activated links (play as a slideshow)
+* Group image links by Post (separate slideshow for each Post on page)
+* Enable/Disable Lightbox resizing animation
+* Automatically Start Slideshow (Default: Enabled)
+* Slide Duration (Seconds) (Default: 6)
+* Loop through images (Default: Enabled)
+* Overlay Opacity (0 - 1) (Default: 0.8)
+
+#### Usage
+* The necessary Javascript and CSS files will be automatically added to the page as long as `wp_head()` is called in the theme
+* That's it!
+
+== Installation ==
+
+1. Verify that your theme uses the `wp_head()` template tag (this is where the necessary files will be added to your theme output)
+1. Let plugin automatically add lightbox functionality for links to images or manually add `rel="lightbox"` to any image links that you want to be displayed in a lightbox
+
+== Upgrade Notice ==
+
+No upgrade notices
+
+== Frequently Asked Questions ==
+
+Post your questions and comments on [Simple Lightbox's beta release page](http://archetyped.com/lab/slb-1-5-5-beta/)
+
+== Screenshots ==
+
+1. Lightbox Customization Options
+2. Customized UI Text
+
+== Changelog ==
+= 1.5.4 =
+* Add: Optional Link validation
+* Add: Keyboard Navigation
+* Add: Option to enable/disable image caption
+* Add: `rel` attribute supported again
+* Add: Use `slb_off` in link's `rel` attribute to disable automatic activation for link
+* Fix: HTTPS compatibility (Jürgen Protocol)
+* Fix: Enabling SLB on Pages issue
+* Fix: Zmanu is_single
+* Fix: Image order is sometimes incorrect
+* Optimize: Filter double clicks
+* Optimize: Separate options to enable/disable SLB on Posts and Pages
+* Optimize: Better grouping support
+
+= 1.5.3 =
+* Fix: Caption may not display under certain circumstances (Caption Erin)
+* Fix: Images not grouped when "separate by post" option is activated (Logical Ross)
+* Update: Lightbox will not be activated for links that already have `rel` attribute set
+
+= 1.5.2 =
+* Fix: Slideshow loops out of control (Mirage of Wallentin)
+* Fix: Lightbox fails when group by posts disabled (Lange Find)
+* Add: Option to use the image's URI as caption when link title not set (Under UI options)
+
+= 1.5.1 =
+* Add: WP Gallery support
+* Fix: Navigation hidden when only one image
+* Fix: Use user-defined UI text
+
+= 1.5 =
+* Add: Theme support
+* Optimize: Javascript cleanup and file size reductions
+* Optimize: CSS cleanup
+
+= 1.4 =
+* Update: Integrated with jQuery
+* Optimize: Javascript filesize 9x smaller
+* Add: Close lightbox by clicking to left/right outside of image (an oft-requested feature)
+
+= 1.3.2 =
+* Add: Option to enable/disable lightbox resizing animation (thanks Maria!)
+
+= 1.3.1 =
+* Update: Utilities code (internal)
+
+= 1.3 =
+* Add: Customizable UI label text (close, next, and prev button images can be replaced in `images` directory)
+* Add: Group image links by Post (separate slideshow for each post)
+* Add: Reset settings link on plugin listings page
+* Optimize: Organized settings page
+
+= 1.2.1 =
+* Fixed: Image title given higher precedence than Image alt (more compatible w/WP workflow)
+
+= 1.2 =
+* Added: Option to group automatically activated links
+* Optimized: Lightbox caption retrieval
+
+= 1.1 =
+* Added: Enable/disable lightbox functionality by page type (Home, Pages/Posts, Archive, etc.)
+* Added: Automatically activate lightbox functionality for image links
+* Added: Link to settings menu on plugin listing page
+* Optimized: Options menu field building
+* Optimized: Loading of default values for plugin options
+* Optimized: General code optimizations
+= 1.0 =
+* Initial release
diff --git a/src/wp-content/plugins/simple-lightbox/screenshot-1.gif b/src/wp-content/plugins/simple-lightbox/screenshot-1.gif
new file mode 100644
index 00000000..979af6e4
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/screenshot-1.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/screenshot-2.gif b/src/wp-content/plugins/simple-lightbox/screenshot-2.gif
new file mode 100644
index 00000000..36cddfcc
Binary files /dev/null and b/src/wp-content/plugins/simple-lightbox/screenshot-2.gif differ
diff --git a/src/wp-content/plugins/simple-lightbox/templates/default/layout.html b/src/wp-content/plugins/simple-lightbox/templates/default/layout.html
new file mode 100644
index 00000000..efc6f047
--- /dev/null
+++ b/src/wp-content/plugins/simple-lightbox/templates/default/layout.html
@@ -0,0 +1,28 @@
+
+
+ {slbContent}
+
+ {navPrev}
+ {navNext}
+
+
+ {slbLoading}
+
+
+
+
+
+
+ {dataCaption}
+ {dataNumber}
+
+ {navPrev}
+ {navNext}
+ {navSlideControl}
+
+
+
+ {slbClose}
+
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/wp-customer-reviews/button.png b/src/wp-content/plugins/wp-customer-reviews/button.png
new file mode 100644
index 00000000..c4c3f930
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/button.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/newstars.png b/src/wp-content/plugins/wp-customer-reviews/newstars.png
new file mode 100644
index 00000000..f0e8b59b
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/newstars.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/readme.txt b/src/wp-content/plugins/wp-customer-reviews/readme.txt
new file mode 100644
index 00000000..98f6920c
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/readme.txt
@@ -0,0 +1,83 @@
+=== WP Customer Reviews ===
+Contributors: bompus
+Donate link: http://www.gowebsolutions.com/plugins/wp-customer-reviews/
+Tags: hreview, microformat, microformats, rdfa, hcard, reviews, testimonials, plugin, google, rating, review, review box, seo, business, testimonial, ratings, review widget, widget, hproduct, product, snippet, snippets
+Requires at least: 3.0
+Tested up to: 3.1.2
+Stable tag: trunk
+
+WP Customer Reviews allows your customers and visitors to leave reviews or testimonials of your services. Reviews are Microformat enabled (hReview).
+
+== Description ==
+
+There are many sites that are crawling for user-generated reviews now, including Google Places and Google Local Search. WP Customer Reviews allows you to setup a specific page on your blog to receive customer testimonials for your business/service OR to write reviews about multiple products (using multiple pages).
+
+* WP Multisite and Multiuser (WPMU / WPMS / Wordpress MU) compatible.
+* All submissions are moderated, which means that YOU choose which reviews get shown.
+* Reviews are displayed to visitors in a friendly format, but search engines see the hReview microformat (and RDFa soon!)
+* Multiple anti-spam measures to prevent automated spambots from submitting reviews.
+* Provides a configurable `Business hCard`, to help identify all pages of your site as belonging to your business.
+* Completely customizable, including which fields to ask for, require, and show.
+* Works with caching plugins and all themes.
+* Includes an external stylesheet so you can modify it to better fit your theme.
+* Reviews can be edited by admin for content and date.
+* Support for adding your own custom fields with one click.
+* The plugin can be used on more than one page.
+* Supports both `Business` and `Product` hReview types.
+* Shows aggregate reviews microformat (`hReview-aggregate`).
+* Fast and lightweight, even including the star rating image. This plugin will not slow down your blog.
+* Validates as valid XHTML 1.1 (W3C) and valid Microformats (Rich Snippets Testing Tool).
+* And much more...
+
+This is a community-driven , donation-funded plugin. Almost every new feature that has been added was due to the generous support and suggestions of our users. If you have a suggestion or question, do not hesitate to ask in our forum.
+
+More information at: [**WP Customer Reviews**](http://www.gowebsolutions.com/plugins/wp-customer-reviews/)
+
+== Installation ==
+
+1. Upload contents of compressed file (wp-customer-reviews) to the `/wp-content/plugins/` directory.
+2. Activate the plugin through the `Plugins` menu in WordPress admin.
+3. Create a WordPress page to be used specifically for gathering reviews or testimonials.
+4. Go into settings for WP Customer Reviews and configure the plugin.
+
+== Screenshots ==
+
+1. Admin Moderation of Comments (v1.2.4)
+2. Admin Options #1 (v1.2.4)
+3. Admin Options #2 (v1.2.4)
+4. Example of what visitors will see (v1.2.4)
+5. A visitor submitting a review (v1.2.4)
+
+== Frequently Asked Questions ==
+* If you have any feedback, suggestions, questions, or issues, please: [**Visit our support forum**](http://wordpress.org/tags/wp-customer-reviews?forum_id=10)
+
+* If you have upgraded from a version prior to 2.2.8 and are in a multi-site configuration and lost your reviews, please contact us for the fix or refer to the second part of the first post here: wordpress.org/support/topic/heres-a-fix-for-multisite
+
+== Changelog ==
+
+= 2.2.9 (05-12-2011) =
+* [Fix] The plugin should no longer strip out double-spaces in sentences.
+
+= 2.2.8 (05-10-2011) =
+* [Update] Plugin should now be compatible with Wordpress Multisite / Multiuser (WPMS / WPMU / Wordpress MU)
+
+= 2.2.7 (05-05-2011) =
+* [Fix] Reviews will now be sorted by date, as they should, instead of by order of submission.
+
+= 2.2.3 (04-19-2011) =
+* [Fix] In admin, the number of approved reviews was not being shown, unless you were on that active tab.
+* [Update] In admin, text was added to better show you which tab you are on (Pending/Approved/Trash) when viewing reviews.
+
+= 2.2.2 (03-18-2011) =
+* [Fix] Fixed a reviews pagination issue with themes that used a tag.
+
+= 2.2.1 (03-07-2011) =
+* [Fix] Stars would disappear if the review form was placed above the review content. This has been corrected.
+
+= 2.2.0 (03-07-2011) =
+* [Fix] Some versions of jQuery were not returning location attributes correctly. We are no longer using jQuery for this action.
+
+== Upgrade Notice ==
+
+= 2.2.9 =
+Fixes some compatibility issues.
\ No newline at end of file
diff --git a/src/wp-content/plugins/wp-customer-reviews/red_pen.png b/src/wp-content/plugins/wp-customer-reviews/red_pen.png
new file mode 100644
index 00000000..13d633fe
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/red_pen.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/screenshot-1.png b/src/wp-content/plugins/wp-customer-reviews/screenshot-1.png
new file mode 100644
index 00000000..f65ce541
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/screenshot-1.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/screenshot-2.png b/src/wp-content/plugins/wp-customer-reviews/screenshot-2.png
new file mode 100644
index 00000000..08db9c0f
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/screenshot-2.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/screenshot-3.png b/src/wp-content/plugins/wp-customer-reviews/screenshot-3.png
new file mode 100644
index 00000000..d6e43b0f
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/screenshot-3.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/screenshot-4.png b/src/wp-content/plugins/wp-customer-reviews/screenshot-4.png
new file mode 100644
index 00000000..a568c8f0
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/screenshot-4.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/screenshot-5.png b/src/wp-content/plugins/wp-customer-reviews/screenshot-5.png
new file mode 100644
index 00000000..6c019197
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/screenshot-5.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/star.png b/src/wp-content/plugins/wp-customer-reviews/star.png
new file mode 100644
index 00000000..038b1555
Binary files /dev/null and b/src/wp-content/plugins/wp-customer-reviews/star.png differ
diff --git a/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.css b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.css
new file mode 100644
index 00000000..f6985516
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.css
@@ -0,0 +1,49 @@
+.best_in_place {
+ padding:0.1em !important;
+ cursor: hand;
+ cursor: pointer;
+ -moz-transition: background 0.5s linear;
+ -o-transition: background 0.5s linear;
+ -webkit-transition: background 0.5s linear;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -o-border-radius: 5px;
+ -ms-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ border-radius: 5px;
+}
+.best_in_place:hover {
+ padding:0.2em 1.5em 0.4em 0.1em !important;
+ background: url("red_pen.png") no-repeat right center;
+ background-color: #CCC;
+}
+.info_edit {
+ float: right;
+ cursor: hand;
+ cursor: pointer;
+}
+
+#wpcr_ad label {
+ vertical-align:inherit !important;
+}
+
+.purr {
+ position: fixed;
+ width: 324px;
+ top: 20px;
+ right: 15px;
+ padding: 20px;
+ background-color: #000000;
+ color: #FFFFFF;
+ border: 2px solid #FFFFFF;
+}
+.purr:hover .close {
+ position: absolute;
+ top: 5px;
+ right: 3px;
+ display: block;
+ width: 25px;
+ height: 25px;
+ text-indent: -9999px;
+ /*background: url("/images/close-button.gif") no-repeat;*/
+}
\ No newline at end of file
diff --git a/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.js b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.js
new file mode 100644
index 00000000..0b49be10
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.js
@@ -0,0 +1,765 @@
+jQuery(document).ready(function() {
+
+ jQuery(".best_in_place").best_in_place();
+
+ jQuery("#require_fname, #show_fname").click(function(){
+ if ( jQuery(this).is(":checked") ) {
+ jQuery("#ask_fname").attr('checked','checked');
+ }
+ else if ( jQuery("#ask_fname").not(":checked") ) {
+ jQuery("#show_fname").removeAttr('checked');
+ jQuery("#require_fname").removeAttr('checked');
+ }
+ });
+
+ jQuery("#require_femail, #show_femail").click(function(){
+ if ( jQuery(this).is(":checked") ) {
+ jQuery("#ask_femail").attr('checked','checked');
+ }
+ else if ( jQuery("#ask_femail").not(":checked") ) {
+ jQuery("#show_femail").removeAttr('checked');
+ jQuery("#require_femail").removeAttr('checked');
+ }
+ });
+
+ jQuery("#require_fwebsite, #show_fwebsite").click(function(){
+ if ( jQuery(this).is(":checked") ) {
+ jQuery("#ask_fwebsite").attr('checked','checked');
+ }
+ else if ( jQuery("#ask_fwebsite").not(":checked") ) {
+ jQuery("#show_fwebsite").removeAttr('checked');
+ jQuery("#require_fwebsite").removeAttr('checked');
+ }
+ });
+
+ jQuery("#require_ftitle, #show_ftitle").click(function(){
+ if ( jQuery(this).is(":checked") ) {
+ jQuery("#ask_ftitle").attr('checked','checked');
+ }
+ else if ( jQuery("#ask_ftitle").not(":checked") ) {
+ jQuery("#show_ftitle").removeAttr('checked');
+ jQuery("#require_ftitle").removeAttr('checked');
+ }
+ });
+
+ jQuery("#ask_fname, #ask_femail, #ask_fwebsite, #ask_ftitle").click(function(){
+ if ( jQuery(this).not(":checked") ) {
+ var datawhat = jQuery(this).attr('data-what');
+ jQuery("#show_"+datawhat).removeAttr('checked');
+ jQuery("#require_"+datawhat).removeAttr('checked');
+ }
+ });
+
+ jQuery(".custom_req, .custom_show").each(function(){
+ jQuery(this).click(function(){
+ var dataid = jQuery(this).attr('data-id');
+
+ if ( jQuery(this).is(":checked") ) {
+ jQuery("#ask_custom"+dataid).attr('checked','checked');
+ }
+ else if ( jQuery("#ask_custom"+dataid).not(":checked") ) {
+ jQuery("#show_custom"+dataid).removeAttr('checked');
+ jQuery("#require_custom"+dataid).removeAttr('checked');
+ }
+ });
+ });
+
+ jQuery(".custom_ask").click(function(){
+ if ( jQuery(this).not(":checked") ) {
+ var dataid = jQuery(this).attr('data-id');
+ jQuery("#show_custom"+dataid).removeAttr('checked');
+ jQuery("#require_custom"+dataid).removeAttr('checked');
+ }
+ });
+});
+
+function wpcr_strip_tags(html){
+
+ //PROCESS STRING
+ if(arguments.length < 3) {
+ html=html.replace(/<\/?(?!\!)[^>]*>/gi, '');
+ } else {
+ var allowed = arguments[1];
+ var specified = eval("["+arguments[2]+"]");
+ if(allowed){
+ var regex='?(?!(' + specified.join('|') + '))\b[^>]*>';
+ html=html.replace(new RegExp(regex, 'gi'), '');
+ } else{
+ var regex='?(' + specified.join('|') + ')\b[^>]*>';
+ html=html.replace(new RegExp(regex, 'gi'), '');
+ }
+ }
+
+ //CHANGE NAME TO CLEAN JUST BECAUSE
+ var clean_string = html;
+
+ //RETURN THE CLEAN STRING
+ return clean_string;
+}
+
+function wpcr_nl2br(str)
+{
+ return str.replace(/(\r|\n|\r\n)/ig, " ");
+}
+
+function wpcr_br2nl(str)
+{
+ return str.replace(/( | | | |)/ig, "\r\n");
+}
+
+function callback_review_text(me) {
+ var mehtml = jQuery(me).html();
+ mehtml = wpcr_nl2br(mehtml);
+ jQuery(me).html(mehtml);
+}
+
+function make_stars_from_rating(me) {
+
+ var w = '';
+
+ switch (me.html()) {
+ case 'Rated 1 Star':
+ w = '20';
+ break;
+ case 'Rated 2 Stars':
+ w = '40';
+ break;
+ case 'Rated 3 Stars':
+ w = '60';
+ break;
+ case 'Rated 4 Stars':
+ w = '80';
+ break;
+ case 'Rated 5 Stars':
+ w = '100';
+ break;
+ }
+
+ var out = '
';
+ me.html(out);
+}
+
+/**
+ * jquery.purr.js
+ * Copyright (c) 2008 Net Perspective (net-perspective.com)
+ * Licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
+ *
+ * @author R.A. Ray
+ * @projectDescription jQuery plugin for dynamically displaying unobtrusive messages in the browser. Mimics the behavior of the MacOS program "Growl."
+ * @version 0.1.0
+ *
+ * @requires jquery.js (tested with 1.2.6)
+ *
+ * @param fadeInSpeed int - Duration of fade in animation in miliseconds
+ * default: 500
+ * @param fadeOutSpeed int - Duration of fade out animationin miliseconds
+ default: 500
+ * @param removeTimer int - Timeout, in miliseconds, before notice is removed once it is the top non-sticky notice in the list
+ default: 4000
+ * @param isSticky bool - Whether the notice should fade out on its own or wait to be manually closed
+ default: false
+ * @param usingTransparentPNG bool - Whether or not the notice is using transparent .png images in its styling
+ default: false
+ */
+
+(function($) {
+
+ $.purr = function(notice, options)
+ {
+ // Convert notice to a jQuery object
+ notice = $(notice);
+
+ // Add a class to denote the notice as not sticky
+ notice.addClass('purr');
+
+ // Get the container element from the page
+ var cont = document.getElementById('purr-container');
+
+ // If the container doesn't yet exist, we need to create it
+ if (!cont)
+ {
+ cont = '
';
+ }
+
+ // Convert cont to a jQuery object
+ cont = $(cont);
+
+ // Add the container to the page
+ $('body').append(cont);
+
+ notify();
+
+ function notify ()
+ {
+ // Set up the close button
+ var close = document.createElement('a');
+ $(close).attr({
+ className: 'close',
+ href: '#close'
+ }).appendTo(notice).click(function() {
+ removeNotice();
+ return false;
+ });
+
+ // If ESC is pressed remove notice
+ $(document).keyup(function(e) {
+ if (e.keyCode == 27) {
+ removeNotice();
+ }
+ });
+
+ // Add the notice to the page and keep it hidden initially
+ notice.appendTo(cont).hide();
+
+ if (jQuery.browser.msie && options.usingTransparentPNG)
+ {
+ // IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
+ // notice style, we'll just skip the fading in.
+ notice.show();
+ }
+ else
+ {
+ //Fade in the notice we just added
+ notice.fadeIn(options.fadeInSpeed);
+ }
+
+ // Set up the removal interval for the added notice if that notice is not a sticky
+ if (!options.isSticky)
+ {
+ var topSpotInt = setInterval(function() {
+ // Check to see if our notice is the first non-sticky notice in the list
+ if (notice.prevAll('.purr').length == 0)
+ {
+ // Stop checking once the condition is met
+ clearInterval(topSpotInt);
+
+ // Call the close action after the timeout set in options
+ setTimeout(function() {
+ removeNotice();
+ }, options.removeTimer);
+ }
+ }, 200);
+ }
+ }
+
+ function removeNotice()
+ {
+ // IE7 and earlier can't handle the combination of opacity and transparent pngs, so if we're using transparent pngs in our
+ // notice style, we'll just skip the fading out.
+ if (jQuery.browser.msie && options.usingTransparentPNG)
+ {
+ notice.css({ opacity: 0 }).animate({ height: '0px'},
+ {
+ duration: options.fadeOutSpeed,
+ complete: function ()
+ {
+ notice.remove();
+ }
+ }
+ );
+ }
+ else
+ {
+ // Fade the object out before reducing its height to produce the sliding effect
+ notice.animate({ opacity: '0' },
+ {
+ duration: options.fadeOutSpeed,
+ complete: function ()
+ {
+ notice.animate({ height: '0px' },
+ {
+ duration: options.fadeOutSpeed,
+ complete: function()
+ {
+ notice.remove();
+ }
+ }
+ );
+ }
+ }
+ );
+ }
+ };
+ };
+
+ $.fn.purr = function(options)
+ {
+ options = options || {};
+ options.fadeInSpeed = options.fadeInSpeed || 500;
+ options.fadeOutSpeed = options.fadeOutSpeed || 500;
+ options.removeTimer = options.removeTimer || 4000;
+ options.isSticky = options.isSticky || false;
+ options.usingTransparentPNG = options.usingTransparentPNG || false;
+
+ this.each(function()
+ {
+ new $.purr( this, options );
+ }
+ );
+
+ return this;
+ };
+})( jQuery );
+
+/*
+ BestInPlace (for jQuery)
+ version: 0.1.9 (02/12/2011)
+ @requires jQuery >= v1.4
+ @requires jQuery.purr to display pop-up windows
+
+ By Bernat Farrero based on the work of Jan Varwig.
+ Examples at http://bernatfarrero.com
+
+ Licensed under the MIT:
+ http://www.opensource.org/licenses/mit-license.php
+
+ Usage:
+
+ Attention.
+ The format of the JSON object given to the select inputs is the following:
+ [["key", "value"],["key", "value"]]
+ The format of the JSON object given to the checkbox inputs is the following:
+ ["falseValue", "trueValue"]
+*/
+
+function BestInPlaceEditor(e) {
+ this.element = jQuery(e);
+ this.initOptions();
+ this.bindForm();
+ this.initNil();
+ jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
+}
+
+BestInPlaceEditor.prototype = {
+ // Public Interface Functions //////////////////////////////////////////////
+
+ activate : function() {
+ var elem = this.isNil ? "" : this.element.html();
+ this.oldValue = elem;
+ jQuery(this.activator).unbind("click", this.clickHandler);
+ this.activateForm();
+ },
+
+ abort : function() {
+ if (this.isNil) this.element.html(this.nil);
+ else this.element.html(this.oldValue);
+ jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
+ if (this.callback != '') { window[this.callback](this.element); } /* AQ */
+ },
+
+ update : function() {
+ var editor = this;
+ if (this.formType in {"input":1, "textarea":1} && this.getValue() == this.oldValue)
+ { // Avoid request if no change is made
+ this.abort();
+ return true;
+ }
+ this.isNil = false;
+ editor.ajax({
+ "type" : "post",
+ "dataType" : "text",
+ "data" : editor.requestData(),
+ "success" : function(data){ editor.loadSuccessCallback(data); },
+ "error" : function(request, error){ editor.loadErrorCallback(request, error); }
+ });
+ if (this.formType == "select") {
+ var value = this.getValue();
+ jQuery.each(this.values, function(i, v) {
+ if (value == v[0]) {
+ editor.element.html(v[1]);
+ }
+ }
+ );
+ } else if (this.formType == "checkbox") {
+ editor.element.html(this.getValue() ? this.values[1] : this.values[0]);
+ } else {
+ editor.element.html(this.getValue());
+ }
+ },
+
+ activateForm : function() {
+ alert("The form was not properly initialized. activateForm is unbound");
+ },
+
+ // Helper Functions ////////////////////////////////////////////////////////
+
+ initOptions : function() {
+ // Try parent supplied info
+ var self = this;
+ self.element.parents().each(function(){
+ self.url = self.url || jQuery(this).attr("data-url");
+ self.collection = self.collection || jQuery(this).attr("data-collection");
+ self.formType = self.formType || jQuery(this).attr("data-type");
+ self.objectName = self.objectName || jQuery(this).attr("data-object");
+ self.attributeName = self.attributeName || jQuery(this).attr("data-attribute");
+ self.nil = self.nil || jQuery(this).attr("data-nil");
+ self.callback = self.callback || jQuery(this).attr("data-callback");
+ });
+
+ // Try Rails-id based if parents did not explicitly supply something
+ self.element.parents().each(function(){
+ var res = this.id.match(/^(\w+)_(\d+)$/i);
+ if (res) {
+ self.objectName = self.objectName || res[1];
+ }
+ });
+
+ // Load own attributes (overrides all others)
+ self.url = self.element.attr("data-url") || self.url || document.location.pathname;
+ self.collection = self.element.attr("data-collection") || self.collection;
+ self.formType = self.element.attr("data-type") || self.formtype || "input";
+ self.objectName = self.element.attr("data-object") || self.objectName;
+ self.attributeName = self.element.attr("data-attribute") || self.attributeName;
+ self.activator = self.element.attr("data-activator") || self.element;
+ self.nil = self.element.attr("data-nil") || self.nil || "-";
+ self.callback = self.element.attr("data-callback") || self.callback || "";
+
+ if (!self.element.attr("data-sanitize")) {
+ self.sanitize = true;
+ }
+ else {
+ self.sanitize = (self.element.attr("data-sanitize") == "true");
+ }
+
+ if ((self.formType == "select" || self.formType == "checkbox") && self.collection !== null)
+ {
+ self.values = jQuery.parseJSON(self.collection);
+ }
+ },
+
+ bindForm : function() {
+ this.activateForm = BestInPlaceEditor.forms[this.formType].activateForm;
+ this.getValue = BestInPlaceEditor.forms[this.formType].getValue;
+ },
+
+ initNil: function() {
+ if (this.element.html() == "")
+ {
+ this.isNil = true
+ this.element.html(this.nil)
+ }
+ },
+
+ getValue : function() {
+ alert("The form was not properly initialized. getValue is unbound");
+ },
+
+ // Trim and Strips HTML from text
+ sanitizeValue : function(s) {
+ if (this.sanitize)
+ {
+ var news = wpcr_br2nl(s);
+ return jQuery.trim(wpcr_strip_tags(s));
+ }
+ return jQuery.trim(s);
+ },
+
+ /* Generate the data sent in the POST request */
+ requestData : function() {
+ // To prevent xss attacks, a csrf token must be defined as a meta attribute
+ csrf_token = jQuery('meta[name=csrf-token]').attr('content');
+ csrf_param = jQuery('meta[name=csrf-param]').attr('content');
+
+ var data = "_method=put";
+ data += "&" + this.objectName + '[' + this.attributeName + ']=' + encodeURIComponent(this.getValue());
+
+ if (csrf_param !== undefined && csrf_token !== undefined) {
+ data += "&" + csrf_param + "=" + encodeURIComponent(csrf_token);
+ }
+ return data;
+ },
+
+ ajax : function(options) {
+ options.url = this.url;
+ options.beforeSend = function(xhr){ xhr.setRequestHeader("Accept", "application/json"); };
+ return jQuery.ajax(options);
+ },
+
+ // Handlers ////////////////////////////////////////////////////////////////
+
+ loadSuccessCallback : function(data) {
+ this.element.html(data[this.objectName]);
+ // Binding back after being clicked
+ jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
+ if (this.callback != '') { window[this.callback](this.element); } /* AQ */
+ },
+
+ loadErrorCallback : function(request, error) {
+ this.element.html(this.oldValue);
+
+ // Display all error messages from server side validation
+ jQuery.each(jQuery.parseJSON(request.responseText), function(index, value) {
+ var container = jQuery(" ").html(value);
+ container.purr();
+ });
+
+ // Binding back after being clicked
+ jQuery(this.activator).bind('click', {editor: this}, this.clickHandler);
+ if (this.callback != '') { window[this.callback](this.element); } /* AQ */
+ },
+
+ clickHandler : function(event) {
+ event.data.editor.activate();
+ }
+};
+
+
+BestInPlaceEditor.forms = {
+ "input" : {
+ activateForm : function() {
+ var output = '';
+ output += ' ';
+ this.element.html(output);
+ this.element.find('input')[0].select();
+ this.element.find("form").bind('submit', {editor: this}, BestInPlaceEditor.forms.input.submitHandler);
+ this.element.find("input").bind('blur', {editor: this}, BestInPlaceEditor.forms.input.inputBlurHandler);
+ this.element.find("input").bind('keyup', {editor: this}, BestInPlaceEditor.forms.input.keyupHandler);
+ },
+
+ getValue : function() {
+ return this.sanitizeValue(this.element.find("input").val());
+ },
+
+ inputBlurHandler : function(event) {
+ event.data.editor.update();
+ },
+
+ submitHandler : function(event) {
+ event.data.editor.update();
+ },
+
+ keyupHandler : function(event) {
+ if (event.keyCode == 27) {
+ event.data.editor.abort();
+ }
+ }
+ },
+
+ "select" : {
+ activateForm : function() {
+ var output = "";
+ var selected = "";
+ var oldValue = this.oldValue;
+ jQuery.each(this.values, function(index, value) {
+ selected = (value[1] == oldValue ? "selected='selected'" : "");
+ output += "" + value[1] + " ";
+ });
+ output += " ";
+ this.element.html(output);
+ this.element.find("select").bind('change', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
+ this.element.find("select").bind('blur', {editor: this}, BestInPlaceEditor.forms.select.blurHandler);
+ this.element.find("select").bind('keyup', {editor: this}, BestInPlaceEditor.forms.select.keyupHandler);
+ this.element.find("select")[0].focus();
+ },
+
+ getValue : function() {
+ return this.sanitizeValue(this.element.find("select").val());
+ },
+
+ blurHandler : function(event) {
+ event.data.editor.update();
+ },
+
+ keyupHandler : function(event) {
+ if (event.keyCode == 27) event.data.editor.abort();
+ }
+ },
+
+ "checkbox" : {
+ activateForm : function() {
+ var newValue = Boolean(this.oldValue != this.values[1]);
+ var output = newValue ? this.values[1] : this.values[0];
+ this.element.html(output);
+ this.update();
+ },
+
+ getValue : function() {
+ return Boolean(this.element.html() == this.values[1]);
+ }
+ },
+
+ "textarea" : {
+ activateForm : function() {
+ // grab width and height of text
+ width = this.element.css('width');
+ height = this.element.css('height');
+
+ // construct the form
+ var output = '';
+ //output += this.sanitizeValue(this.oldValue); /* fix for IE 8 issues */
+ output += wpcr_br2nl(this.oldValue); /* fix for IE 8 issues */
+ output += ' ';
+ this.element.html(output);
+
+ // set width and height of textarea
+ jQuery(this.element.find("textarea")[0]).css({ 'min-width': width, 'min-height': height });
+ jQuery(this.element.find("textarea")[0]).elastic();
+
+ this.element.find("textarea")[0].focus();
+ this.element.find("textarea").bind('blur', {editor: this}, BestInPlaceEditor.forms.textarea.blurHandler);
+ this.element.find("textarea").bind('keyup', {editor: this}, BestInPlaceEditor.forms.textarea.keyupHandler);
+ },
+
+ getValue : function() {
+ //var sanval = this.sanitizeValue(this.element.find("textarea").val());
+ var sanval = this.sanitizeValue(this.element.find("textarea").val());
+ sanval = wpcr_nl2br(sanval);
+ return sanval;
+ },
+
+ blurHandler : function(event) {
+ event.data.editor.update();
+ },
+
+ keyupHandler : function(event) {
+ if (event.keyCode == 27) {
+ BestInPlaceEditor.forms.textarea.abort(event.data.editor);
+ }
+ },
+
+ abort : function(editor) {
+ if (confirm("Are you sure you want to discard your changes?")) {
+ editor.abort();
+ }
+ }
+ }
+};
+
+jQuery.fn.best_in_place = function() {
+ this.each(function(){
+ jQuery(this).data('bestInPlaceEditor', new BestInPlaceEditor(this));
+ });
+ return this;
+};
+
+/**
+* @name Elastic
+* @descripton Elastic is Jquery plugin that grow and shrink your textareas automaticliy
+* @version 1.6.5
+* @requires Jquery 1.2.6+
+*
+* @author Jan Jarfalk
+* @author-email jan.jarfalk@unwrongest.com
+* @author-website http://www.unwrongest.com
+*
+* @licens MIT License - http://www.opensource.org/licenses/mit-license.php
+*/
+
+(function(jQuery){
+ jQuery.fn.extend({
+ elastic: function() {
+ // We will create a div clone of the textarea
+ // by copying these attributes from the textarea to the div.
+ var mimics = [
+ 'paddingTop',
+ 'paddingRight',
+ 'paddingBottom',
+ 'paddingLeft',
+ 'fontSize',
+ 'lineHeight',
+ 'fontFamily',
+ 'width',
+ 'fontWeight'];
+
+ return this.each( function() {
+
+ // Elastic only works on textareas
+ if ( this.type != 'textarea' ) {
+ return false;
+ }
+
+ var $textarea = jQuery(this),
+ $twin = jQuery('
').css({'position': 'absolute','display':'none'}),
+ lineHeight = parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'),
+ minheight = parseInt($textarea.css('height'),10) || lineHeight*3,
+ maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE,
+ goalheight = 0,
+ i = 0;
+
+ // Opera returns max-height of -1 if not set
+ if (maxheight < 0) { maxheight = Number.MAX_VALUE; }
+
+ // Append the twin to the DOM
+ // We are going to meassure the height of this, not the textarea.
+ $twin.appendTo($textarea.parent());
+
+ // Copy the essential styles (mimics) from the textarea to the twin
+ var i = mimics.length;
+ while(i--){
+ $twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString()));
+ }
+
+
+ // Sets a given height and overflow state on the textarea
+ function setHeightAndOverflow(height, overflow){
+ curratedHeight = Math.floor(parseInt(height,10));
+ if($textarea.height() != curratedHeight){
+ $textarea.css({'height': curratedHeight + 'px','overflow':overflow});
+
+ }
+ }
+
+
+ // This function will update the height of the textarea if necessary
+ function update() {
+
+ // Get curated content from the textarea.
+ var textareaContent = $textarea.val().replace(/&/g,'&').replace(/ /g, ' ').replace(/<|>/g, '>').replace(/\n/g, ' ');
+
+ // Compare curated content with curated twin.
+ var twinContent = $twin.html().replace(/ /ig,' ');
+
+ if(textareaContent+' ' != twinContent){
+
+ // Add an extra white space so new rows are added when you are at the end of a row.
+ $twin.html(textareaContent+' ');
+
+ // Change textarea height if twin plus the height of one line differs more than 3 pixel from textarea height
+ if(Math.abs($twin.height() + lineHeight - $textarea.height()) > 3){
+
+ var goalheight = $twin.height()+lineHeight;
+ if(goalheight >= maxheight) {
+ setHeightAndOverflow(maxheight,'auto');
+ } else if(goalheight <= minheight) {
+ setHeightAndOverflow(minheight,'hidden');
+ } else {
+ setHeightAndOverflow(goalheight,'hidden');
+ }
+
+ }
+
+ }
+
+ }
+
+ // Hide scrollbars
+ $textarea.css({'overflow':'hidden'});
+
+ // Update textarea size on keyup, change, cut and paste
+ $textarea.bind('keyup change cut paste', function(){
+ update();
+ });
+
+ // Compact textarea on blur
+ // Lets animate this....
+ $textarea.bind('blur',function(){
+ if($twin.height() < maxheight){
+ if($twin.height() > minheight) {
+ $textarea.height($twin.height());
+ } else {
+ $textarea.height(minheight);
+ }
+ }
+ });
+
+ // And this line is to catch the browser paste event
+ $textarea.live('input paste',function(e){ setTimeout( update, 250); });
+
+ // Run update once when elastic is initialized
+ update();
+
+ });
+
+ }
+ });
+})(jQuery);
\ No newline at end of file
diff --git a/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.php b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.php
new file mode 100644
index 00000000..8a234365
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews-admin.php
@@ -0,0 +1,1042 @@
+parentClass = &$parentClass;
+ foreach ($this->parentClass as $col => $val) {
+ $this->$col = &$this->parentClass->$col;
+ }
+ /* end - haxish but it works */
+ }
+
+ function real_admin_init() {
+
+ $this->parentClass->init();
+ $this->enqueue_admin_stuff();
+
+ /* used for redirecting to settings page upon initial activation */
+ if (get_option('wpcr_gotosettings', false)) {
+ delete_option('wpcr_gotosettings');
+
+ if ($this->p->action == 'activate-plugin') { return false; } /* no auto settings redirect if upgrading */
+
+ $url = $this->get_admin_path().'options-general.php?page=wpcr_options';
+
+ if (headers_sent() == true) {
+ echo $this->parentClass->js_redirect($url); /* use JS redirect */
+ } else {
+ ob_end_clean();
+ wp_redirect($url); /* nice redirect */
+ }
+
+ exit();
+ }
+ }
+
+ function add_meta_box() {
+ global $meta_box;
+
+ $prefix = 'wpcr_';
+
+ $meta_box = array(
+ 'id' => 'wpcr-meta-box',
+ 'title' => ' WP Customer Reviews',
+ 'page' => 'page',
+ 'context' => 'normal',
+ 'priority' => 'high',
+ 'fields' => array(
+ array(
+ 'name' => 'Enable WP Customer Reviews for this page',
+ 'desc' => 'Plugin content will be displayed below your page contents',
+ 'id' => $prefix . 'enable',
+ 'type' => 'checkbox'
+ ),
+ array(
+ 'name' => 'Product Name',
+ 'desc' => 'This is where you need to enter in the product name. Only necessary if you are showing PRODUCT style reviews. This field will be ignored if you have the plugin setup for BUSINESS style reviews ',
+ 'id' => $prefix . 'product_name',
+ 'type' => 'text',
+ 'std' => ''
+ ),
+ array(
+ 'name' => 'Product Description',
+ 'desc' => '',
+ 'id' => $prefix . 'product_desc',
+ 'type' => 'text',
+ 'std' => ''
+ ),
+ array(
+ 'name' => 'Manufacturer/Brand of Product',
+ 'desc' => '',
+ 'id' => $prefix . 'product_brand',
+ 'type' => 'text',
+ 'std' => ''
+ ),
+ array(
+ 'name' => 'Model',
+ 'desc' => '',
+ 'id' => $prefix . 'product_model',
+ 'type' => 'text',
+ 'std' => ''
+ ),
+ array(
+ 'name' => 'SKU',
+ 'desc' => '',
+ 'id' => $prefix . 'product_sku',
+ 'type' => 'text',
+ 'std' => ''
+ ),
+ array(
+ 'name' => 'UPC',
+ 'desc' => '',
+ 'id' => $prefix . 'product_upc',
+ 'type' => 'text',
+ 'std' => ''
+ )
+ )
+ );
+
+ /* add for pages and posts */
+ add_meta_box($meta_box['id'], $meta_box['title'], array(&$this, 'wpcr_show_meta_box'), 'page', $meta_box['context'], $meta_box['priority']);
+ add_meta_box($meta_box['id'], $meta_box['title'], array(&$this, 'wpcr_show_meta_box'), 'post', $meta_box['context'], $meta_box['priority']);
+ }
+
+ function real_admin_save_post($post_id)
+ {
+ global $meta_box,$wpdb;
+
+ // verify nonce
+ if (!wp_verify_nonce($_POST['wpcr_show_meta_box_nonce'], basename(__FILE__))) {
+ return $post_id;
+ }
+
+ // check autosave
+ if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
+ return $post_id;
+ }
+
+ // check permissions
+ if ('page' == $_POST['post_type']) {
+ if (!current_user_can('edit_page', $post_id)) {
+ return $post_id;
+ }
+ } elseif (!current_user_can('edit_post', $post_id)) {
+ return $post_id;
+ }
+
+ foreach ($meta_box['fields'] as $field) {
+ $old = get_post_meta($post_id, $field['id'], true);
+ $new = $_POST[$field['id']];
+
+ if ($new && $new != $old) {
+ update_post_meta($post_id, $field['id'], $new);
+ } elseif ('' == $new && $old) {
+ delete_post_meta($post_id, $field['id'], $old);
+ }
+
+ /* disable comments, trackbacks on the selected WPCR page or post */
+ /*
+ if ($field['id'] == 'wpcr_enable' && $new == '1') {
+ $post->comment_status = 'closed';
+ $post->ping_status = 'closed';
+ $query = "UPDATE {$wpdb->prefix}posts SET comment_status = 'closed', ping_status = 'closed' WHERE ID = {$post_id}";
+ $wpdb->query($query);
+ }
+ */
+ }
+
+ return $post_id;
+ }
+
+ function wpcr_show_meta_box() {
+ global $meta_box, $post;
+
+ // Use nonce for verification
+ echo ' ';
+
+ echo '';
+ }
+
+ function createReviewTable() {
+ require_once( ABSPATH . '/wp-admin/includes/upgrade.php' );
+ dbDelta("CREATE TABLE IF NOT EXISTS `$this->dbtable` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `date_time` datetime NOT NULL,
+ `reviewer_name` varchar(50) DEFAULT NULL,
+ `reviewer_email` varchar(50) DEFAULT NULL,
+ `reviewer_ip` varchar(15) DEFAULT NULL,
+ `review_title` varchar(150) DEFAULT NULL,
+ `review_text` text,
+ `status` tinyint(1) DEFAULT '0',
+ `review_rating` tinyint(2) DEFAULT '0',
+ `reviewer_url` varchar(255) NOT NULL,
+ `page_id` int(11) NOT NULL DEFAULT '0',
+ `custom_fields` text,
+ PRIMARY KEY (`id`),
+ KEY `status` (`status`),
+ KEY `page_id` (`page_id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
+ }
+
+ function get_admin_path() { /* get the real wp-admin path, even if renamed */
+ $admin_path = $_SERVER['REQUEST_URI'];
+ $admin_path = substr($admin_path, 0, stripos($admin_path,'plugins.php'));
+
+ /* not in plugins.php, try again for admin.php */
+ if ($admin_path === false || $admin_path === '') {
+ $admin_path = $_SERVER['REQUEST_URI'];
+ $admin_path = substr($admin_path, 0, stripos($admin_path,'admin.php'));
+ }
+
+ return $admin_path;
+ }
+
+ function force_update_cache() {
+ /* update pages we are using, this will force it to update with caching plugins */
+
+ global $wpdb;
+
+ $pages = $wpdb->get_results( "SELECT `ID` FROM $wpdb->posts AS p, $wpdb->postmeta as pm
+ WHERE p.post_type = 'page' AND p.ID = pm.post_id
+ AND pm.meta_key = 'wpcr_enable' AND pm.meta_value = 1" );
+
+ foreach ($pages as $page) {
+ $post = get_post($page->ID);
+ if ($post) {
+ wp_update_post($post); /* the magic */
+ }
+ if (function_exists('wp_cache_post_change')) {
+ wp_cache_post_change( $page->ID ); /* just in case to help wp super cache */
+ }
+ }
+ }
+
+ /* some admin styles can override normal styles for inplace edits */
+ function enqueue_admin_stuff() {
+ $pluginurl = $this->parentClass->getpluginurl();
+
+ if (isset($this->p->page) && ( $this->p->page == 'wpcr_view_reviews' || $this->p->page == 'wpcr_options' ) ) {
+ wp_enqueue_script('jquery');
+ wp_register_script('wp-customer-reviews-admin',$pluginurl.'wp-customer-reviews-admin.js',array(),$this->plugin_version);
+ wp_enqueue_script('wp-customer-reviews-admin');
+ wp_register_style('wp-customer-reviews',$pluginurl.'wp-customer-reviews.css',array(),$this->plugin_version);
+ wp_enqueue_style('wp-customer-reviews');
+ wp_register_style('wp-customer-reviews-admin',$pluginurl.'wp-customer-reviews-admin.css',array(),$this->plugin_version);
+ wp_enqueue_style('wp-customer-reviews-admin');
+ }
+ }
+
+ /* v4 uuid */
+ function gen_uuid() {
+ return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
+ mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
+ mt_rand( 0, 0xffff ),
+ mt_rand( 0, 0x0fff ) | 0x4000,
+ mt_rand( 0, 0x3fff ) | 0x8000,
+ mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
+ );
+ }
+
+ /*
+ * This is used purely for analytics and for notification of critical security releases.
+ * And it gives us a chance to review who is using it and to verify theme and version compatibility
+ * None of this information will ever be shared, sold, or given away.
+ */
+ function notify_activate($act_flag) {
+ global $wp_version;
+
+ if ($this->options['act_uniq'] == '') {
+ $this->options['act_uniq'] = $this->gen_uuid();
+ update_option('wpcr_options', $this->options);
+ }
+
+ $request = 'doact='.$act_flag.'&email='.urlencode(stripslashes($this->options['act_email'])).'&version='.$this->plugin_version.'&support='.$this->options['support_us'].'&uuid='.$this->options['act_uniq'];
+ $host = "www.gowebsolutions.com";
+ $port = 80;
+ $wpurl = get_bloginfo('wpurl');
+
+ $http_request = "POST /plugin-activation/activate.php HTTP/1.0\r\n";
+ $http_request .= "Host: www.gowebsolutions.com\r\n";
+ $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=".get_option('blog_charset')."\r\n";
+ $http_request .= "Content-Length: ".strlen($request)."\r\n";
+ $http_request .= "Referer: $wpurl\r\n";
+ $http_request .= "User-Agent: WordPress/$wp_version\r\n\r\n";
+ $http_request .= $request;
+
+ $response = '';
+ if( false != ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
+ fwrite($fs, $http_request);
+ while ( !feof($fs) ) {
+ $response .= fgets($fs, 1160);
+ }
+ fclose($fs);
+ $response = explode("\r\n\r\n", $response, 2);
+ }
+
+ return $response;
+ }
+
+ function update_options() {
+ global $wpdb;
+ $msg ='';
+
+ if (isset($this->p->optin))
+ {
+ if ($this->options['activate'] == 0)
+ {
+ $this->options['activate'] = 1;
+ $this->options['act_email'] = $this->p->email;
+
+ update_option('wpcr_options', $this->options);
+ $this->notify_activate(1);
+ $msg = 'Thank you. Please configure the plugin below.';
+ }
+ }
+ else
+ {
+ $updated_options = $this->options;
+
+ /* reset these to 0 so we can grab the settings below */
+ $updated_options['ask_fields']['fname'] = 0;
+ $updated_options['ask_fields']['femail'] = 0;
+ $updated_options['ask_fields']['fwebsite'] = 0;
+ $updated_options['ask_fields']['ftitle'] = 0;
+ $updated_options['require_fields']['fname'] = 0;
+ $updated_options['require_fields']['femail'] = 0;
+ $updated_options['require_fields']['fwebsite'] = 0;
+ $updated_options['require_fields']['ftitle'] = 0;
+ $updated_options['show_fields']['fname'] = 0;
+ $updated_options['show_fields']['femail'] = 0;
+ $updated_options['show_fields']['fwebsite'] = 0;
+ $updated_options['show_fields']['ftitle'] = 0;
+ $updated_options['ask_custom'] = array();
+ $updated_options['field_custom'] = array();
+ $updated_options['require_custom'] = array();
+ $updated_options['show_custom'] = array();
+
+ /* quick update of all options needed */
+ foreach ($this->p as $col => $val)
+ {
+ if (isset($this->options[$col]))
+ {
+ switch($col)
+ {
+ case 'field_custom': /* we should always hit field_custom before ask_custom, etc */
+ foreach ($val as $i => $name) { $updated_options[$col][$i] = ucwords( strtolower( $name ) ); } /* we are so special */
+ break;
+ case 'ask_custom':
+ case 'require_custom':
+ case 'show_custom':
+ foreach ($val as $i => $v) { $updated_options[$col][$i] = 1; } /* checkbox array with ints */
+ break;
+ case 'ask_fields':
+ case 'require_fields':
+ case 'show_fields':
+ foreach ($val as $v) { $updated_options[$col]["$v"] = 1; } /* checkbox array with names */
+ break;
+ default:
+ $updated_options[$col] = $val; /* a non-array normal field */
+ break;
+ }
+ }
+ }
+
+ /* some int validation */
+ $updated_options['reviews_per_page'] = intval($this->p->reviews_per_page);
+ $updated_options['show_hcard_on'] = intval($this->p->show_hcard_on);
+ $updated_options['support_us'] = intval($this->p->support_us);
+ $updated_options['form_location'] = intval($this->p->form_location);
+ if ($updated_options['reviews_per_page'] < 1) { $updated_options['reviews_per_page'] = 10; }
+
+ if ($updated_options['show_hcard_on']) {
+ if (
+ empty($updated_options['business_name']) ||
+ empty($updated_options['business_url']) ||
+ empty($updated_options['business_email']) ||
+ empty($updated_options['business_street']) ||
+ empty($updated_options['business_city']) ||
+ empty($updated_options['business_state']) ||
+ empty($updated_options['business_zip']) ||
+ empty($updated_options['business_phone'])
+ ) {
+ $msg .= "* Notice: You must enter in ALL business information to use the hCard output * ";
+ $updated_options['show_hcard_on'] = 0;
+ }
+ }
+
+ $msg .= 'Your settings have been saved.';
+ update_option('wpcr_options', $updated_options);
+ $this->force_update_cache(); /* update any caches */
+ }
+
+ return $msg;
+ }
+
+ function show_activation() {
+ echo '
+
+
Notify me of new releases
+
+
';
+ }
+
+ function my_get_pages() { /* gets pages, even if hidden using a plugin */
+ global $wpdb;
+
+ $res = $wpdb->get_results("select ID, post_title from ". $wpdb->posts ." where post_status = 'publish' and post_type = 'page' order by ID");
+ return $res;
+ }
+
+ function show_options() {
+ $su_checked = '';
+ if ($this->options['support_us']) {
+ $su_checked = 'checked';
+ }
+
+ $af = array('fname' => '','femail' => '','fwebsite' => '','ftitle' => '');
+ if ($this->options['ask_fields']['fname'] == 1) { $af['fname'] = 'checked'; }
+ if ($this->options['ask_fields']['femail'] == 1) { $af['femail'] = 'checked'; }
+ if ($this->options['ask_fields']['fwebsite'] == 1) { $af['fwebsite'] = 'checked'; }
+ if ($this->options['ask_fields']['ftitle'] == 1) { $af['ftitle'] = 'checked'; }
+
+ $rf = array('fname' => '','femail' => '','fwebsite' => '','ftitle' => '');
+ if ($this->options['require_fields']['fname'] == 1) { $rf['fname'] = 'checked'; }
+ if ($this->options['require_fields']['femail'] == 1) { $rf['femail'] = 'checked'; }
+ if ($this->options['require_fields']['fwebsite'] == 1) { $rf['fwebsite'] = 'checked'; }
+ if ($this->options['require_fields']['ftitle'] == 1) { $rf['ftitle'] = 'checked'; }
+
+ $sf = array('fname' => '','femail' => '','fwebsite' => '','ftitle' => '');
+ if ($this->options['show_fields']['fname'] == 1) { $sf['fname'] = 'checked'; }
+ if ($this->options['show_fields']['femail'] == 1) { $sf['femail'] = 'checked'; }
+ if ($this->options['show_fields']['fwebsite'] == 1) { $sf['fwebsite'] = 'checked'; }
+ if ($this->options['show_fields']['ftitle'] == 1) { $sf['ftitle'] = 'checked'; }
+
+ echo '
+
+
Display Options
+
+
+
+ Business Information (for hidden hCard)
+
+
+
+ Review Page Settings
+
+
+
+
+
+
';
+ }
+
+ function real_admin_options() {
+ if (!current_user_can('manage_options'))
+ {
+ wp_die( __('You do not have sufficient permissions to access this page.') );
+ }
+
+ $msg = '';
+
+ if ($this->p->Submit == 'Save Changes')
+ {
+ $msg = $this->update_options();
+ $this->parentClass->get_options();
+ }
+
+ if (isset($this->p->email)) {
+ $msg = $this->update_options();
+ $this->parentClass->get_options();
+ }
+
+ echo '
+
+
WP Customer Reviews - Options ';
+ if ($msg) { echo '
'.$msg.' '; }
+ echo '
+
';
+ return;
+ }
+
+ $this->show_options();
+ echo '
';
+ }
+
+ function real_admin_view_reviews() {
+ global $wpdb;
+
+ /* begin - actions */
+ if (isset($this->p->action)) {
+
+ if (isset($this->p->r)) {
+ $this->p->r = intval($this->p->r);
+
+ switch ($this->p->action) {
+ case 'deletereview':
+ $wpdb->query("DELETE FROM `$this->dbtable` WHERE id={$this->p->r} LIMIT 1");
+ break;
+ case 'trashreview':
+ $wpdb->query("UPDATE `$this->dbtable` SET status=2 WHERE id={$this->p->r} LIMIT 1");
+ break;
+ case 'approvereview':
+ $wpdb->query("UPDATE `$this->dbtable` SET status=1 WHERE id={$this->p->r} LIMIT 1");
+ break;
+ case 'unapprovereview':
+ $wpdb->query("UPDATE `$this->dbtable` SET status=0 WHERE id={$this->p->r} LIMIT 1");
+ break;
+ case 'update_field':
+
+ ob_end_clean();
+
+ if (!is_array($this->p->json)) {
+ header('HTTP/1.1 403 Forbidden');
+ echo json_encode(array("errors" => 'Bad Request'));
+ exit();
+ }
+
+ $show_val = '';
+ $update_col = false;
+ $update_val = false;
+
+ foreach ($this->p->json as $col => $val) {
+
+ switch ($col) {
+ case 'date_time':
+ $d = date("m/d/Y g:i a",strtotime($val));
+ if (!$d || $d == '01/01/1970 12:00 am') {
+ header('HTTP/1.1 403 Forbidden');
+ echo json_encode(array("errors" => 'Bad Date Format'));
+ exit();
+ }
+
+ $show_val = $d;
+ $d2 = date("Y-m-d H:i:s",strtotime($val));
+ $update_col = mysql_real_escape_string($col);
+ $update_val = mysql_real_escape_string($d2);
+ break;
+
+ default:
+ if ($val == '') {
+ header('HTTP/1.1 403 Forbidden');
+ echo json_encode(array("errors" => 'Bad Value'));
+ exit();
+ }
+
+ /* for storing in DB - fix with IE 8 workaround */
+ $val = str_replace( array(" "," "," ") , "\n" , $val );
+
+ if (substr($col,0,7) == 'custom_') /* updating custom fields */
+ {
+ $custom_fields = array(); /* used for insert as well */
+ $custom_count = count($this->options['field_custom']); /* used for insert as well */
+ for ($i = 0; $i < $custom_count; $i++)
+ {
+ $custom_fields[$i] = $this->options['field_custom'][$i];
+ }
+
+ $custom_num = substr($col,7); /* gets the number after the _ */
+ /* get the old custom value */
+ $old_value = $wpdb->get_results("SELECT `custom_fields` FROM `$this->dbtable` WHERE `id`={$this->p->r} LIMIT 1");
+ if ($old_value && $wpdb->num_rows)
+ {
+ $old_value = @unserialize($old_value[0]->custom_fields);
+ if (!is_array($old_value)) { $old_value = array(); }
+ $custom_name = $custom_fields[$custom_num];
+ $old_value[$custom_name] = $val;
+ $new_value = serialize($old_value);
+ $update_col = mysql_real_escape_string('custom_fields');
+ $update_val = mysql_real_escape_string($new_value);
+ }
+ }
+ else /* updating regular fields */
+ {
+ $update_col = mysql_real_escape_string($col);
+ $update_val = mysql_real_escape_string($val);
+ }
+
+ $show_val = $val;
+ break;
+ }
+
+ }
+
+ if ($update_col !== false && $update_val !== false) {
+ $query = "UPDATE `$this->dbtable` SET `$update_col`='$update_val' WHERE `id`={$this->p->r} LIMIT 1";
+ $wpdb->query($query);
+ echo $show_val;
+ }
+
+ exit();
+ break;
+ }
+ }
+
+ if (is_array($this->p->delete_reviews) && count($this->p->delete_reviews)) {
+
+ foreach ($this->p->delete_reviews as $i => $rid) {
+ $this->p->delete_reviews[$i] = intval($rid);
+ }
+
+ if (isset($this->p->act2)) { $this->p->action = $this->p->action2; }
+
+ switch ($this->p->action) {
+ case 'bapprove':
+ $wpdb->query("UPDATE `$this->dbtable` SET status=1 WHERE id IN(".implode(',',$this->p->delete_reviews).")");
+ break;
+ case 'bunapprove':
+ $wpdb->query("UPDATE `$this->dbtable` SET status=0 WHERE id IN(".implode(',',$this->p->delete_reviews).")");
+ break;
+ case 'btrash':
+ $wpdb->query("UPDATE `$this->dbtable` SET status=2 WHERE id IN(".implode(',',$this->p->delete_reviews).")");
+ break;
+ case 'bdelete':
+ $wpdb->query("DELETE FROM `$this->dbtable` WHERE id IN(".implode(',',$this->p->delete_reviews).")");
+ break;
+ }
+ }
+
+ $this->force_update_cache(); /* update any caches */
+
+ echo $this->parentClass->js_redirect("?page=wpcr_view_reviews&review_status={$this->p->review_status}");
+ exit();
+ }
+ /* end - actions */
+
+ if (!isset($this->p->review_status)) { $this->p->review_status = 0; }
+ $this->p->review_status = intval($this->p->review_status);
+
+ /* begin - searching */
+ if ($this->p->review_status == -1) {
+ $sql_where = '-1=-1';
+ } else {
+ $sql_where = 'status='.$this->p->review_status;
+ }
+
+ $this->p->s_orig = $this->p->s;
+ $and_clause = '';
+ if ($this->p->s) { /* searching */
+ $this->p->s = '%'.$this->p->s.'%';
+ $sql_where = '-1=-1';
+ $this->p->review_status = -1;
+ $and_clause = "AND (reviewer_name LIKE %s OR reviewer_email LIKE %s OR reviewer_ip LIKE %s OR review_text LIKE %s OR reviewer_url LIKE %s)";
+ $and_clause = $wpdb->prepare($and_clause,$this->p->s,$this->p->s,$this->p->s,$this->p->s,$this->p->s);
+
+ $query = "SELECT
+ id,
+ date_time,
+ reviewer_name,
+ reviewer_email,
+ reviewer_ip,
+ review_title,
+ review_text,
+ review_rating,
+ reviewer_url,
+ status,
+ page_id,
+ custom_fields
+ FROM `$this->dbtable` WHERE $sql_where $and_clause ORDER BY id DESC";
+
+ $reviews = $wpdb->get_results($query);
+ $total_reviews = 0; /* no pagination for searches */
+ }
+ /* end - searching */
+ else
+ {
+ $arr_Reviews = $this->parentClass->get_reviews(-1,$this->page,$this->options['reviews_per_page'],$this->p->review_status);
+ $reviews = $arr_Reviews[0];
+ $total_reviews = $arr_Reviews[1];
+ }
+
+ $status_text = "";
+ switch ($this->p->review_status)
+ {
+ case -1:
+ $status_text = 'Submitted';
+ break;
+ case 0:
+ $status_text = 'Pending';
+ break;
+ case 1:
+ $status_text = 'Approved';
+ break;
+ case 2:
+ $status_text = 'Trashed';
+ break;
+ }
+
+ $pending_count = $wpdb->get_results("SELECT COUNT(*) AS count_pending FROM `$this->dbtable` WHERE status=0");
+ $pending_count = $pending_count[0]->count_pending;
+
+ $approved_count = $wpdb->get_results("SELECT COUNT(*) AS count_approved FROM `$this->dbtable` WHERE status=1");
+ $approved_count = $approved_count[0]->count_approved;
+
+ $trash_count = $wpdb->get_results("SELECT COUNT(*) AS count_trash FROM `$this->dbtable` WHERE status=2");
+ $trash_count = $trash_count[0]->count_trash;
+ ?>
+
+
+
Customer Reviews - Reviews
+
+
+
+
+
+ p->s_orig): ?>RESULTS FOR:
+ Search Reviews:
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.css b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.css
new file mode 100644
index 00000000..4ebd3de8
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.css
@@ -0,0 +1,185 @@
+/*
+ WP Customer Reviews
+ You can override any of these values in your theme CSS if you use !important
+ Example: #wpcr_respond_1 blockquote.description p { font-size:12px !important; font-weight:bold !important; }
+*/
+
+.wpcr_show { display:inline; }
+.wpcr_hide { display:none; }
+.wpcr_fl { float:left; }
+.wpcr_sc { padding:0px 10px 0px 0px; }
+.wpcr_rname { padding:0px 0px 0px 0px; line-height:20px; }
+.wpcr_clear { clear:both; }
+.wpcr_spacing1 { padding-bottom:5px; }
+.wpcr_lh30 { line-height:30px; }
+.wpcr_pb5 { padding-bottom:5px; }
+.wpcr_power { padding-top:30px !important; padding-bottom:5px !important; font-size:10px !important; }
+.wpcr_status_msg { color:#c00;font-weight:bold; }
+.wpcr_status_msg div { color:#c00;font-weight:bold;padding-bottom:15px;padding-top:15px; }
+
+/* title of review */
+#wpcr_respond_1 h2.summary { padding: 5px 0 5px 0; }
+#wpcr_respond_1 h3.summary { padding: 5px 0 5px 0; }
+#wpcr_respond_1 h4.summary { padding: 5px 0 5px 0; }
+#wpcr_respond_1 h5.summary { padding: 5px 0 5px 0; }
+#wpcr_respond_1 h6.summary { padding: 5px 0 5px 0; }
+
+/* review text */
+#wpcr_respond_1 blockquote.description { font-size:14px; font-weight:normal; }
+#wpcr_respond_1 blockquote.description p { font-size:14px; font-weight:normal; }
+
+#wpcr_postcomment { font-size:1.1em; font-weight:bold; }
+
+#wpcr_commentform label { display:inline !important; }
+#wpcr_commentform #fconfirm1, #wpcr_commentform #fconfirm3 { display:none; }
+#wpcr_ad { background:#ffffff; }
+#wpcr_ad label { font-weight:bold; }
+
+#wpcr_commentform #fconfirm2 { width:auto !important; }
+
+#wpcr_respond_1, #wpcr_respond_2 { margin:0 !important; padding:0 !important; clear:both !important; }
+#wpcr_respond_1 p, #wpcr_respond_2 p {
+ margin:0 !important;
+ padding:0 !important;
+ line-height:120% !important;
+ margin-top:2px !important;
+ margin-bottom:2px !important;
+}
+
+#wpcr_respond_1 .wpcr_rating, #wpcr_commentform .wpcr_rating {
+ border:0 !important;
+ margin:0 !important;
+ padding:0 !important;
+ margin-left:0px !important;
+ margin-top:0px !important;
+ overflow:hidden;
+ height:16px;
+}
+
+/* Thank you ColorRating for the inspiration and image */
+#wpcr_respond_1 .sp_rating { line-height:1.7em; display:block; }
+#wpcr_respond_1 .sp_rating * { border:0 none; margin:0; padding:0; }
+
+#wpcr_respond_1 .base { background:url(newstars.png) 0 0 no-repeat; width:85px; height:17px; float:left; padding-right:4px; overflow:hidden; display:block; }
+#wpcr_respond_1 .average { background:url(newstars.png) 0 -15px no-repeat; text-indent:-9999px; height:17px; }
+
+#wpcr_respond_2 { display:none; background-color:inherit; }
+
+#wpcr_commentform .sp_rating { line-height:1.7em; display:block; }
+#wpcr_commentform .sp_rating * { border:0 none; margin:0; padding:0; }
+
+#wpcr_commentform .status { height:16px; width:100px; overflow:hidden; position:relative; cursor:pointer; display:block; }
+
+#wpcr_commentform .base { display:none; }
+
+#wpcr_commentform .score { background:url(newstars.png) 0 0 no-repeat; width:85px; height:17px; float:left; position:relative; }
+#wpcr_commentform .score a {
+ display:block;
+ height:17px;
+ float:left;
+ text-indent:-9999px;
+ position:absolute;
+ overflow:hidden;
+ line-height:1em;
+}
+#wpcr_commentform .score a:hover { background:url(newstars.png) bottom right no-repeat; }
+#wpcr_commentform .score1 {width:20%; z-index:55;}
+#wpcr_commentform .score2 {width:40%; z-index:54;}
+#wpcr_commentform .score3 {width:60%; z-index:53;}
+#wpcr_commentform .score4 {width:80%; z-index:52;}
+#wpcr_commentform .score5 {width:100%; z-index:51;}
+
+#wpcr_div_2 { width:600px; }
+#wpcr_table_2 { text-align:left; width:100%; }
+#wpcr_table_2 td { text-align:left; }
+#wpcr_check_confirm { margin-top:10px;font-size:13px;color:#c00;margin-bottom:4px; }
+
+#wpcr_button_1, #wpcr_button_1:link, #wpcr_button_1:visited, #wpcr_submit_btn, #wpcr_submit_btn:link, #wpcr_submit_btn:visited {
+ -moz-border-radius: 3px !important;
+ -webkit-border-radius: 3px !important;
+ background: white url('button.png') 0 0 repeat-x !important;
+ background: -moz-linear-gradient(0% 170% 90deg, #c4c4c4, white) !important;
+ background: -webkit-gradient(linear, 0% 0%, 0% 170%, from(white), to(#c4c4c4)) !important;
+ border: 1px solid !important;
+ border-color: #e6e6e6 #cccccc #cccccc #e6e6e6 !important;
+ border-radius: 3px !important;
+ color: #404040 !important;
+ cursor:pointer !important;
+ display: inline-block !important;
+ font-size: 13px !important;
+ font-weight: normal !important;
+ outline: 0 !important;
+ padding: 5px 8px 5px !important;
+ text-align: center !important;
+ text-decoration: none !important;
+ text-shadow: 1px 1px 0 white !important;
+ white-space: nowrap !important;
+ float:none !important;
+ height:auto !important;
+ text-indent:0 !important;
+ }
+
+#wpcr_button_1:hover, #wpcr_submit_btn:hover {
+ background: -moz-linear-gradient(0% 170% 90deg, #b8b8b8, white) !important;
+ background: -webkit-gradient(linear, 0% 0%, 0% 170%, from(white), to(#b8b8b8)) !important;
+ border-color: #99ccff !important;
+ color: #333333 !important;
+ cursor:pointer !important;
+ font-weight: normal !important;
+}
+
+#wpcr_button_1:active, #wpcr_submit_btn:active {
+ position: relative !important;
+ top: 1px !important;
+}
+
+#wpcr_button_1:active, #wpcr_button_1:focus, #wpcr_submit_btn:active, #wpcr_submit_btn:focus {
+ background-position: 0 -25px !important;
+ background: -moz-linear-gradient(0% 170% 90deg, white, #dedede) !important;
+ background: -webkit-gradient(linear, 0% 0%, 0% 170%, from(#dedede), to(white)) !important;
+ border-color: #8fc7ff #94c9ff #94c9ff #8fc7ff !important;
+ color:#1a1a1a !important;
+ text-shadow: 1px -1px 0 rgba(255, 255, 255, 0.5) !important;
+}
+
+#wpcr_commentform input { padding:0; margin:0 !important; width:200px !important; }
+#wpcr_commentform textarea { padding:0 !important; margin:0 !important; width:400px !important; height:100px !important; }
+#wpcr_commentform small { padding:0 !important; margin:0 !important; }
+#wpcr_commentform table, #wpcr_commentform td { border:0 !important; border-style:none !important; }
+
+#wpcr_pagination {
+ clear:both;
+ padding:0px 0px 0px 0px;
+ position:relative;
+ font-size:11px;
+ line-height:13px;
+}
+
+#wpcr_pagination_page {
+ float:left;
+ display:block;
+ line-height:30px;
+ padding-right:5px;
+}
+
+#wpcr_pagination .wpcr_current, #wpcr_pagination a {
+ display:block;
+ float:left;
+ margin: 2px 2px 2px 0;
+ padding:6px 9px 5px 9px;
+ text-decoration:none;
+ width:auto;
+ color:#fff;
+ background: #555;
+}
+
+#wpcr_pagination a:hover{
+ color:#fff;
+ background: #3279BB;
+}
+
+#wpcr_pagination .wpcr_current{
+ padding:6px 9px 5px 9px;
+ background: #3279BB;
+ color:#fff;
+}
diff --git a/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.js b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.js
new file mode 100644
index 00000000..fd076da1
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.js
@@ -0,0 +1,148 @@
+var wpcr_old_btn_val = 'Click here to hide form';
+var wpcr_req = [];
+
+function wpcr_strpos (haystack, needle, offset) {
+ var i = (haystack+'').indexOf(needle, (offset || 0));
+ return i === -1 ? false : i;
+}
+
+function wpcr_ucfirst(str) {
+ var firstLetter = str.slice(0,1);
+ return firstLetter.toUpperCase() + str.substring(1);
+}
+
+function wpcr_del_cookie(name) {
+ document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT;';
+}
+
+function wpcr_jump_to() {
+ jQuery(document).ready(function(){
+ window.location.hash="wpcr_respond_1";
+ });
+}
+
+function valwpcrform_2(newid,oldid,err) {
+
+ var myval = '';
+ var patt = '';
+
+ for (var i in wpcr_req) {
+ var col = wpcr_req[i];
+ if (newid === col && jQuery("#"+oldid).val() === "") {
+ var nice_name = jQuery('label[for="'+oldid+'"]').html();
+ nice_name = nice_name.replace(":","");
+ nice_name = nice_name.replace("*","");
+ nice_name = jQuery.trim(nice_name);
+ err.push("You must include your "+nice_name+".");
+ }
+ }
+
+ if (newid === 'femail' && jQuery("#"+oldid).val() !== "") {
+ myval = jQuery("#"+oldid).val();
+ if (/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(myval) == false) {
+ err.push("The email address provided is not valid.");
+ }
+ }
+
+ if (newid === 'fwebsite' && jQuery("#"+oldid).val() !== "") {
+ myval = jQuery("#"+oldid).val();
+ if (/^\S+:\/\/\S+\.\S+.+$/.test(myval) == false) {
+ err.push("The website provided is not valid. Be sure to include http://");
+ }
+ }
+
+ if (newid === "ftext" && jQuery("#"+oldid).val().length < 30) {
+ err.push("You must include a review. Please make reviews at least a couple of sentences.");
+ }
+ if (newid === "fconfirm2" && jQuery("#fconfirm2").is(":checked") === false) {
+ err.push("You must confirm that you are human.");
+ }
+ if (newid === "fconfirm1" && jQuery("#fconfirm1").is(":checked") ) {
+ err.push("You must confirm that you are human. Code 2.");
+ }
+ if (newid === "fconfirm3" && jQuery("#fconfirm3").is(":checked") ) {
+ err.push("You must confirm that you are human. Code 3.");
+ }
+
+ return err;
+}
+
+function valwpcrform(me) {
+ var frating = parseInt(jQuery("#frating").val(), 10);
+ if (!frating) { frating = 0; }
+
+ var err = [];
+
+ jQuery("#wpcr_commentform").find('input, textarea').each(function(){
+ var oldid = jQuery(this).attr('name');
+ var pos = wpcr_strpos(oldid,'-',0) + 1;
+ if (pos > 1) {
+ var newid = oldid.substring(pos);
+ } else {
+ var newid = oldid;
+ }
+ err = valwpcrform_2(newid,oldid,err);
+ });
+
+ if (frating < 1 || frating > 5) {
+ err.push("Please select a star rating from 1 to 5.");
+ }
+
+ if (err.length) {
+ var err2 = err.join("\n");
+ alert(err2);
+ jQuery("#wpcr_table_2").find("input:text:visible:first").focus();
+ return false;
+ }
+
+ var f = jQuery("#wpcr_commentform");
+ var newact = document.location.pathname + document.location.search;
+ f.attr("action",newact).removeAttr("onsubmit");
+ return true;
+}
+
+function wpcr_set_hover() {
+ jQuery("#wpcr_commentform .wpcr_rating").unbind("click",wpcr_set_hover);
+ wpcr_onhover();
+}
+
+function wpcr_onhover() {
+ jQuery("#wpcr_commentform .wpcr_rating").unbind("click",wpcr_set_hover);
+ jQuery("#wpcr_commentform .base").hide();
+ jQuery("#wpcr_commentform .status").show();
+}
+
+function wpcr_showform() {
+ jQuery("#wpcr_respond_2").slideToggle();
+ if (wpcr_old_btn_val == 'Click here to hide form') {
+ wpcr_old_btn_val = jQuery("#wpcr_button_1").html();
+ jQuery("#wpcr_button_1").html('Click here to hide form');
+ } else {
+ jQuery("#wpcr_button_1").html(wpcr_old_btn_val);
+ wpcr_old_btn_val = 'Click here to hide form';
+ }
+ jQuery("#wpcr_table_2").find("input:text:visible:first").focus();
+}
+
+jQuery(document).ready(function(){
+ jQuery("#wpcr_button_1").click(wpcr_showform);
+ jQuery("#wpcr_commentform").submit(valwpcrform);
+
+ jQuery("#wpcr_commentform .wpcr_rating a").click(function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ var wpcr_rating = jQuery(this).html();
+ var new_w = 20 * wpcr_rating + "%";
+
+ jQuery("#frating").val(wpcr_rating);
+ jQuery("#wpcr_commentform .base").show();
+ jQuery("#wpcr_commentform .average").css("width",new_w);
+ jQuery("#wpcr_commentform .status").hide();
+
+ jQuery("#wpcr_commentform .wpcr_rating").unbind("mouseover",wpcr_onhover);
+ jQuery("#wpcr_commentform .wpcr_rating").bind("click",wpcr_set_hover);
+ });
+
+ jQuery("#wpcr_commentform .wpcr_rating").bind("mouseover",wpcr_onhover);
+});
\ No newline at end of file
diff --git a/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.php b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.php
new file mode 100644
index 00000000..400403ba
--- /dev/null
+++ b/src/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.php
@@ -0,0 +1,1043 @@
+dbtable = $wpdb->prefix.$this->dbtable;
+
+ add_action('the_content', array(&$this, 'do_the_content'), 10); /* 10 prevents a conflict with some odd themes */
+ add_action('init', array(&$this, 'init'));
+ add_action('admin_init', array(&$this, 'admin_init'));
+ add_action('wp_print_scripts', array(&$this, 'enqueue_scripts'), 11); /* try enqueueing scripts here */
+
+ add_filter('plugin_action_links_'.plugin_basename(__FILE__), array(&$this,'plugin_settings_link') );
+ add_action('admin_menu', array(&$this,'addmenu') );
+ add_action('wp_ajax_update_field', array(&$this,'admin_view_reviews') ); /* special ajax stuff */
+ add_action('save_post', array(&$this,'admin_save_post'), 10, 2); /* 2 arguments */
+ }
+
+ /* keep out of admin file */
+ function plugin_settings_link($links) {
+ $settings_link = ' Settings ';
+ array_unshift($links, $settings_link);
+ return $links;
+ }
+
+ /* keep out of admin file */
+ function addmenu() {
+ add_options_page('Customer Reviews', ' Customer Reviews', 'manage_options', 'wpcr_options', array(&$this, 'admin_options'));
+ add_menu_page('Customer Reviews', 'Customer Reviews', 'edit_others_posts', 'wpcr_view_reviews', array(&$this, 'admin_view_reviews'), $this->getpluginurl().'star.png', 50); /* 50 should be underneath comments */
+
+ global $WPCustomerReviewsAdmin;
+ $this->include_admin(); /* include admin functions */
+ $WPCustomerReviewsAdmin->add_meta_box();
+ }
+
+ /* forward to admin file */
+ function admin_options() {
+ global $WPCustomerReviewsAdmin;
+ $this->include_admin(); /* include admin functions */
+ $WPCustomerReviewsAdmin->real_admin_options();
+ }
+
+ /* forward to admin file */
+ function admin_save_post($post_id,$post) {
+ global $WPCustomerReviewsAdmin;
+ $this->include_admin(); /* include admin functions */
+ $WPCustomerReviewsAdmin->real_admin_save_post($post_id,$post);
+ }
+
+ /* forward to admin file */
+ function admin_view_reviews() {
+ global $WPCustomerReviewsAdmin;
+ $this->include_admin(); /* include admin functions */
+ $WPCustomerReviewsAdmin->real_admin_view_reviews();
+ }
+
+ function get_options() {
+ $home_domain = @parse_url(get_home_url());
+ $home_domain = $home_domain['scheme']."://".$home_domain['host'].'/';
+
+ $default_options = array(
+ 'act_email' => '',
+ 'act_uniq' => '',
+ 'activate' => 0,
+ 'ask_custom' => array(),
+ 'ask_fields' => array('fname' => 1, 'femail' => 1, 'fwebsite' => 1, 'ftitle' => 1, 'fage' => 0, 'fgender' => 0),
+ 'business_city' => '',
+ 'business_country' => 'USA',
+ 'business_email' => get_bloginfo('admin_email'),
+ 'business_name' => get_bloginfo('name'),
+ 'business_phone' => '',
+ 'business_state' => '',
+ 'business_street' => '',
+ 'business_url' => $home_domain,
+ 'business_zip' => '',
+ 'dbversion' => 0,
+ 'field_custom' => array(),
+ 'form_location' => 0,
+ 'goto_leave_text' => 'Click here to submit your review.',
+ 'hreview_type' => 'business',
+ 'leave_text' => 'Submit your review',
+ 'require_custom' => array(),
+ 'require_fields' => array('fname' => 1, 'femail' => 1, 'fwebsite' => 0, 'ftitle' => 0, 'fage' => 0, 'fgender' => 0),
+ 'reviews_per_page' => 10,
+ 'show_custom' => array(),
+ 'show_fields' => array('fname' => 1, 'femail' => 0, 'fwebsite' => 0, 'ftitle' => 1, 'fage' => 0, 'fgender' => 0),
+ 'show_hcard_on' => 1,
+ 'submit_button_text' => 'Submit your review',
+ 'support_us' => 1,
+ 'title_tag' => 'h2'
+ );
+ $this->options = get_option('wpcr_options',$default_options);
+
+ /* magically easy migrations to newer versions */
+ $has_new = false;
+ foreach ($default_options as $col => $def_val) {
+
+ if (!isset($this->options[$col])) {
+ $this->options[$col] = $def_val;
+ $has_new = true;
+ }
+
+ if (is_array($def_val)) {
+ foreach ($def_val as $acol => $aval) {
+ if (!isset($this->options[$col][$acol]))
+ {
+ $this->options[$col][$acol] = $aval;
+ $has_new = true;
+ }
+ }
+ }
+ }
+
+ if ($has_new) { update_option('wpcr_options', $this->options); }
+ }
+
+ function make_p_obj() {
+ $this->p = new stdClass();
+
+ foreach ($_GET as $c => $val) {
+ if (is_array($val)) {
+ $this->p->$c = $val;
+ }
+ else { $this->p->$c = trim( stripslashes( $val) ); }
+ }
+
+ foreach ($_POST as $c => $val) {
+ if (is_array($val)) {
+ $this->p->$c = $val;
+ }
+ else { $this->p->$c = trim( stripslashes( $val) ); }
+ }
+ }
+
+ function check_migrate() {
+ global $wpdb;
+ $migrated = false;
+
+ /* remove me after official release */
+ $current_dbversion = intval(str_replace('.','',$this->options['dbversion']));
+ $plugin_db_version = intval(str_replace('.','',$this->plugin_version));
+
+ if ($current_dbversion == $plugin_db_version) { return false; }
+
+ /* initial installation */
+ if ($current_dbversion == 0) {
+ $this->options['dbversion'] = $plugin_db_version;
+ $current_dbversion = $plugin_db_version;
+ update_option('wpcr_options', $this->options);
+ return false;
+ }
+
+ /* check for upgrades if needed */
+
+ /* upgrade to 2.0.0 */
+ if ($current_dbversion < 200)
+ {
+ /* add multiple page support to database */
+ /* using one query per field to prevent errors if a field already exists */
+ $wpdb->query("ALTER TABLE `$this->dbtable` ADD `page_id` INT(11) NOT NULL DEFAULT '0', ADD INDEX ( `page_id` )");
+ $wpdb->query("ALTER TABLE `$this->dbtable` ADD `custom_fields` text");
+
+ /* change all current reviews to use the selected page id */
+ $pageID = intval( $this->options['selected_pageid'] );
+ $wpdb->query("UPDATE `$this->dbtable` SET `page_id`=$pageID WHERE `page_id`=0");
+
+ /* add new meta to existing selected page */
+ update_post_meta($pageID, 'wpcr_enable', 1);
+
+ $this->options['dbversion'] = 200;
+ $current_dbversion = 200;
+ update_option('wpcr_options', $this->options);
+ $migrated = true;
+ }
+
+ /* done with all migrations, push dbversion to current version */
+ if ($current_dbversion != $plugin_db_version || $migrated == true)
+ {
+ $this->options['dbversion'] = $plugin_db_version;
+ $current_dbversion = $plugin_db_version;
+ update_option('wpcr_options', $this->options);
+
+ global $WPCustomerReviewsAdmin;
+ $this->include_admin(); /* include admin functions */
+ $WPCustomerReviewsAdmin->notify_activate(3);
+ $WPCustomerReviewsAdmin->force_update_cache(); /* update any caches */
+
+ return true;
+ }
+
+ return false;
+ }
+
+ function enqueue_scripts() {
+ global $post;
+
+ $is_active_page = get_post_meta($post->ID, 'wpcr_enable', true);
+ if ($is_active_page && is_singular()) /* make sure its a single page/post and not a list of posts */
+ {
+ wp_enqueue_script('jquery');
+ wp_register_script('wp-customer-reviews',$this->getpluginurl().'wp-customer-reviews.js',array(),$this->plugin_version);
+ wp_enqueue_script('wp-customer-reviews');
+
+ /* do this here so we can redirect cleanly */
+ $GET_P = "submitwpcr_$post->ID";
+
+ if (isset($this->p->$GET_P) && $this->p->$GET_P == $this->options['submit_button_text']) {
+ $msg = $this->add_review($post->ID);
+
+ $has_error = $msg[0];
+ $status_msg = $msg[1];
+ $cookie = array('wpcr_status_msg' => $status_msg);
+
+ $url = get_permalink($post->ID);
+
+ if (headers_sent() == true) {
+ echo $this->js_redirect($url,$cookie); /* use JS redirect and add cookie before redirect */
+ } else {
+ foreach ($cookie as $col => $val) {
+ setcookie($col,$val); /* add cookie via headers */
+ }
+ ob_end_clean();
+ wp_redirect($url); /* nice redirect */
+ }
+
+ exit();
+ }
+ }
+ }
+
+ function enqueue_styles() {
+ global $post;
+
+ /* styles needed for hidden hcard so we just include them everywhere */
+ wp_register_style('wp-customer-reviews',$this->getpluginurl().'wp-customer-reviews.css',array(),$this->plugin_version);
+ wp_enqueue_style('wp-customer-reviews');
+ }
+
+ function rand_string( $length ) {
+ $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ $size = strlen( $chars );
+ for( $i = 0; $i < $length; $i++ ) {
+ $str .= $chars[ rand( 0, $size - 1 ) ];
+ }
+
+ return $str;
+ }
+
+ function get_aggregate_reviews($pageID) {
+ if ($this->got_aggregate !== false) { return $this->got_aggregate; }
+
+ global $wpdb;
+
+ $pageID = intval($pageID);
+ $row = $wpdb->get_results( "SELECT COUNT(*) AS total,AVG(review_rating) AS aggregate_rating,MAX(review_rating) AS max_rating FROM `$this->dbtable` WHERE page_id=$pageID AND status=1" );
+
+ /* make sure we have at least one review before continuing below */
+ if ($wpdb->num_rows == 0 || $row[0]->total == 0) {
+ $this->got_aggregate = array("aggregate" => 0,"max" => 0,"total" => 0,"text" => 'Reviews for my site');
+ return false;
+ }
+
+ $aggregate_rating = $row[0]->aggregate_rating;
+ $max_rating = $row[0]->max_rating;
+ $total_reviews = $row[0]->total;
+
+ $row = $wpdb->get_results( "SELECT review_text FROM `$this->dbtable` WHERE page_id=$pageID AND status=1 ORDER BY date_time DESC LIMIT 1" );
+ $sample_text = substr($row[0]->review_text,0,180);
+
+ $this->got_aggregate = array("aggregate" => $aggregate_rating,"max" => $max_rating,"total" => $total_reviews,"text" => $sample_text);
+ return true;
+ }
+
+ function get_reviews($postID,$startpage,$perpage,$status) {
+ global $wpdb;
+
+ $startpage = $startpage - 1; /* mysql starts at 0 instead of 1, so reduce them all by 1 */
+ if ($startpage < 0) { $startpage = 0; }
+
+ $limit = 'LIMIT '.$startpage*$perpage.','.$perpage;
+
+ if ($status == -1) { $qry_status = '1=1'; } else { $qry_status = "status=$status"; }
+
+ $postID = intval($postID);
+ if ($postID == -1) { $and_post = ''; } else { $and_post = "AND `page_id`=$postID"; }
+
+ $reviews = $wpdb->get_results( "SELECT
+ id,
+ date_time,
+ reviewer_name,
+ reviewer_email,
+ review_title,
+ review_text,
+ review_rating,
+ reviewer_url,
+ reviewer_ip,
+ status,
+ page_id,
+ custom_fields
+ FROM `$this->dbtable` WHERE $qry_status $and_post ORDER BY date_time DESC $limit
+ " );
+
+ $total_reviews = $wpdb->get_results( "SELECT COUNT(*) AS total FROM `$this->dbtable` WHERE $qry_status $and_post" );
+ $total_reviews = $total_reviews[0]->total;
+
+ return array($reviews,$total_reviews);
+ }
+
+ function aggregate_footer()
+ {
+ if ($this->options['show_hcard_on'] != 0 && $this->shown_hcard === false)
+ {
+ /* may need to uncomment to validate */
+ /* remove_filter ('the_content', 'wpautop'); */
+
+ $this->shown_hcard = true;
+
+ /* start - make sure we should continue */
+ global $post;
+ $show = false;
+ $is_active_page = get_post_meta($post->ID, 'wpcr_enable', true);
+
+ if ($this->options['show_hcard_on'] == 1) { $show = true; }
+ else if ($this->options['show_hcard_on'] == 2 && ( is_home() || is_front_page() ) ) { $show = true; }
+ else if ($this->options['show_hcard_on'] == 3 && $is_active_page && is_singular() ) { $show = true; } /* show only on a single page with is_singular() */
+ /* end - make sure we should continue */
+
+ if ($show) { /* we append like this to prevent newlines and wpautop issues */
+ $output2 .= ''.
+ '
'.$this->options['business_name'].' '.
+ '
'.$this->options['business_email'].' '.
+ '
'.
+ ''.$this->options['business_street'].' '.
+ ''.$this->options['business_city'].' ,'.
+ ''.$this->options['business_state'].' ,'.
+ ''.$this->options['business_zip'].' '.
+ ''.$this->options['business_country'].' '.
+ ' '.
+ '
'.$this->options['business_phone'].' '.
+ '
';
+ }
+ }
+
+ return $output2;
+ }
+
+ function iso8601($time=false) {
+ if ($time === false) $time = time();
+ $date = date('Y-m-d\TH:i:sO', $time);
+ return (substr($date, 0, strlen($date)-2).':'.substr($date, -2));
+ }
+
+ function pagination($total_results = 0, $range = 2)
+ {
+ global $post; /* will exist if on a post */
+
+ $out = '';
+ $uri = false;
+ $pretty = false;
+
+ $showitems = ($range * 2) + 1;
+
+ $paged = $this->page;
+ if($paged == 0) { $paged = 1; }
+
+ $pages = ceil($total_results / $this->options['reviews_per_page']);
+
+ if($pages > 1)
+ {
+ if (is_admin()) { $url = '?page=wpcr_view_reviews&review_status='.$this->p->review_status.'&'; }
+ else
+ {
+ $uri = trailingslashit(get_permalink($post->ID));
+ if (strpos($uri,'?') === false) { $url = $uri.'?'; $pretty = true; } /* page is using pretty permalinks */
+ else { $url = $uri.'&'; $pretty = false; } /* page is using get variables for pageid */
+ }
+
+ $out .= '';
+ $out .= '
';
+
+ return $out;
+ }
+ }
+
+ function do_the_content($original_content) {
+ global $post;
+
+ $the_content = '';
+
+ $is_active_page = get_post_meta($post->ID, 'wpcr_enable', true);
+ /* return normal content if this is not an enabled page, or if this is a post not on single post view */
+ if (!$is_active_page || !is_singular())
+ {
+ $the_content .= $this->aggregate_footer(); /* check if we need to show something in the footer then */
+ return $original_content.$the_content;
+ }
+
+ $arr_Reviews = $this->get_reviews($post->ID,$this->page,$this->options['reviews_per_page'],1);
+
+ $reviews = $arr_Reviews[0];
+ $total_reviews = intval($arr_Reviews[1]);
+
+ $reviews_content = '';
+ $ftitle = '';
+ $hidesummary = '';
+ $title_tag = $this->options['title_tag'];
+
+ /* trying to access a page that does not exists -- send to main page */
+ if (isset($this->p->wpcrp) && count($reviews) == 0) {
+ $url = get_permalink($post->ID);
+ $the_content = $this->js_redirect($url);
+ return $original_content.$the_content;
+ }
+
+ $meta_product_name = get_post_meta($post->ID, 'wpcr_product_name', true);
+ if (!$meta_product_name) { $meta_product_name = get_the_title($post->ID); }
+
+ $meta_product_desc = get_post_meta($post->ID, 'wpcr_product_desc', true);
+ $meta_product_brand = get_post_meta($post->ID, 'wpcr_product_brand', true);
+ $meta_product_upc = get_post_meta($post->ID, 'wpcr_product_upc', true);
+ $meta_product_sku = get_post_meta($post->ID, 'wpcr_product_sku', true);
+ $meta_product_model = get_post_meta($post->ID, 'wpcr_product_model', true);
+
+ if (count($reviews) == 0)
+ {
+ $the_content .= 'There are no reviews yet. Be the first to leave yours!
';
+ }
+ else
+ {
+
+ $this->get_aggregate_reviews($post->ID);
+
+ $summary = $this->got_aggregate["text"];
+ $best_score = number_format($this->got_aggregate["max"],1);
+ $average_score = number_format($this->got_aggregate["aggregate"],1);
+
+ if ($this->options['hreview_type'] == 'product')
+ {
+ $reviews_content .= '
+
+
+ '.$meta_product_brand.'
+ '.$meta_product_name.'
+ '.$meta_product_desc.'
+
+ SKU
+ '.$meta_product_sku.'
+
+
+ UPC
+ '.$meta_product_upc.'
+
+
+ Model
+ '.$meta_product_model.'
+
+
+ ';
+ }
+
+ foreach ($reviews as $review)
+ {
+ $review->review_text .= ' ';
+
+ $hide_name = '';
+ if ($this->options['show_fields']['fname'] == 0) {
+ $review->reviewer_name = 'Anonymous';
+ $hide_name = 'wpcr_hide';
+ }
+ if ($review->reviewer_name == '') { $review->reviewer_name = 'Anonymous'; }
+
+ if ($this->options['show_fields']['fwebsite'] == 1 && $review->reviewer_url != '') {
+ $review->review_text .= ''.$review->reviewer_url.' ';
+ }
+ if ($this->options['show_fields']['femail'] == 1 && $review->reviewer_email != '') {
+ $review->review_text .= ''.$review->reviewer_email.' ';
+ }
+ if ($this->options['show_fields']['ftitle'] == 1) {
+ /* do nothing */
+ } else {
+ $review->review_title = substr($review->review_text,0,150);
+ $hidesummary = 'wpcr_hide';
+ }
+
+ $review->review_text = nl2br($review->review_text);
+
+ $custom_fields_unserialized = @unserialize($review->custom_fields);
+ if (!is_array($custom_fields_unserialized)) { $custom_fields_unserialized = array(); }
+
+ $custom_shown = '';
+ foreach ($this->options['field_custom'] as $i => $val) {
+ $show = $this->options['show_custom'][$i];
+ if ($show == 1 && $custom_fields_unserialized[$val] != '') {
+ if ($custom_shown == '') { $custom_shown = ' '; }
+ $custom_i = "custom_$i";
+ $custom_shown .= $val.': '.$custom_fields_unserialized[$val].' | ';
+ }
+ }
+
+ $custom_shown = rtrim($custom_shown,"| ");
+
+ $name_block = ''.
+ ''.
+ '
'.date("M d, Y",strtotime($review->date_time)).' '.
+ '
by '.
+ '
'.
+ ''.$review->reviewer_name.' '.
+ ' '.
+ $custom_shown.
+ '
';
+
+ if ($this->options['hreview_type'] == 'product')
+ {
+ $reviews_content .= '
+
+ <'.$title_tag.' class="summary '.$hidesummary.'">'.$review->review_title.''.$title_tag.'>
+
+ '.$meta_product_name.'
+
+
+
+
+ '.$this->output_rating($review->review_rating,false).'
+
+
+ '.$name_block.'
+
+
'.$review->review_text.'
+
product
+
0.3
+
+ ';
+ }
+ else if ($this->options['hreview_type'] == 'business')
+ {
+ $reviews_content .= '
+
+ <'.$title_tag.' class="summary '.$hidesummary.'">'.$review->review_title.''.$title_tag.'>
+
+
+
+ '.$this->output_rating($review->review_rating,false).'
+
+
+ '.$name_block.'
+
+
+ '.$this->options['business_name'].'
+ '.$this->options['business_phone'].'
+
+ '.$this->options['business_street'].'
+ '.$this->options['business_city'].'
+ '.$this->options['business_state'].' , '.$this->options['business_zip'].'
+ '.$this->options['business_country'].'
+
+
+
'.$review->review_text.'
+
business
+
0.3
+
+ ';
+ }
+ }
+
+ if ($this->options['hreview_type'] == 'product')
+ {
+ $reviews_content .= '
+
+
+
+ '.$average_score.'
+ '.$best_score.'
+
+ '.$this->got_aggregate["total"].'
+ '.$this->got_aggregate["total"].'
+ '.$summary.'
+
+ '.$meta_product_name.'
+
+
+ ';
+ $reviews_content .= ' '; /* end hProduct */
+ }
+ else if ($this->options['hreview_type'] == 'business')
+ {
+ $reviews_content .= '
+
+
+
+ '.$this->options['business_name'].'
+ '.$this->options['business_phone'].'
+
+ '.$this->options['business_street'].'
+ '.$this->options['business_city'].'
+ '.$this->options['business_state'].' , '.$this->options['business_zip'].'
+ '.$this->options['business_country'].'
+
+
+
+ '.$average_score.'
+ '.$best_score.'
+
+ '.$this->got_aggregate["total"].'
+ '.$this->got_aggregate["total"].'
+ '.$summary.'
+
+
+ ';
+ }
+ }
+
+ $the_content .= ''; /* start the div */
+
+ if ($this->options['form_location'] == 0)
+ {
+ $the_content .= $this->show_reviews_form();
+ }
+
+ $the_content .= $reviews_content;
+ $the_content .= $this->pagination($total_reviews);
+
+ if ($this->options['form_location'] == 1)
+ {
+ $the_content .= $this->show_reviews_form();
+ }
+
+ if ($this->options['support_us'] == 1) {
+ $the_content .= '
';
+ }
+ $the_content .= '
';
+
+ $the_content .= $this->aggregate_footer(); /* check if we need to show something in the footer also */
+
+ //$the_content = preg_replace('/\n\r|\r\n|\n|\r|\t|\s{2}/', '', $the_content); /* minify to prevent automatic line breaks */
+ $the_content = preg_replace('/\n\r|\r\n|\n|\r|\t/', '', $the_content); /* minify to prevent automatic line breaks, not removing double spaces */
+
+ return $original_content.$the_content;
+ }
+
+ function output_rating($rating,$enable_hover) {
+ $out = '';
+
+ $rating_width = 20 * $rating; /* 20% for each star if having 5 stars */
+
+ $out .= '';
+
+ if ($enable_hover) {
+ $out .= '
';
+ }
+
+ $out .= '
';
+ $out .= '
';
+
+ return $out;
+ }
+
+ function show_reviews_form() {
+ global $post, $current_user;
+
+ $fields = '';
+
+ $script_block = '';
+ $status_msg = '';
+ if ( isset( $_COOKIE['wpcr_status_msg'] ) ) {
+ $status_msg = $_COOKIE['wpcr_status_msg'];
+ $script_block = '';
+ }
+
+ echo $script_block; /* to prevent filtering , we just echo it */
+
+ /* a silly yet crazy and possibly effective antispam measure.. bots won't have a clue */
+ $rand_prefixes = array();
+ for ($i=0; $i<15; $i++) {
+ $rand_prefixes[] = $this->rand_string(mt_rand(1,8));
+ }
+
+ if ($this->options['ask_fields']['fname'] == 1) {
+ if ($this->options['require_fields']['fname'] == 1) { $req = '*'; } else { $req = ''; }
+ $fields .= ' ';
+ }
+ if ($this->options['ask_fields']['femail'] == 1) {
+ if ($this->options['require_fields']['femail'] == 1) { $req = '*'; } else { $req = ''; }
+ $fields .= ' ';
+ }
+ if ($this->options['ask_fields']['fwebsite'] == 1) {
+ if ($this->options['require_fields']['fwebsite'] == 1) { $req = '*'; } else { $req = ''; }
+ $fields .= ' ';
+ }
+ if ($this->options['ask_fields']['ftitle'] == 1) {
+ if ($this->options['require_fields']['ftitle'] == 1) { $req = '*'; } else { $req = ''; }
+ $fields .= ' ';
+ }
+
+ $custom_fields = array(); /* used for insert as well */
+ $custom_count = count($this->options['field_custom']); /* used for insert as well */
+ for ($i = 0; $i < $custom_count; $i++)
+ {
+ $custom_fields[$i] = $this->options['field_custom'][$i];
+ }
+
+ foreach ($this->options['ask_custom'] as $i => $val) {
+ if ($val == 1) {
+ if ($this->options['require_custom'][$i] == 1) { $req = '*'; } else { $req = ''; }
+ $custom_i = "custom_$i";
+ $fields .= ' ';
+ }
+ }
+
+ $some_required = '';
+ $req_js = "\n";
+
+ $out = '';
+
+ $button_html = ''.$status_msg.'
'; /* show errors or thank you message here */
+ $button_html .= ''.$this->options['goto_leave_text'].'
';
+
+ $out .= $button_html.' ';
+
+ /* different output variables make it easier to debug this section */
+ $out .= ''.$req_js.'
+ ';
+
+ $out4 = '
';
+ $out4 .= '
';
+
+ return $out.$out2.$out3.$out4;
+ }
+
+ function add_review($pageID) {
+ global $wpdb;
+
+ /* begin - some antispam magic */
+ $this->newp = new stdClass();
+
+ foreach ($this->p as $col => $val) {
+ $pos = strpos($col,'-');
+ if ($pos !== false) {
+ $col = substr($col,$pos + 1); /* off by one */
+ }
+ $this->newp->$col = $val;
+ }
+
+ $this->p = $this->newp;
+ unset($this->newp);
+ /* end - some antispam magic */
+
+ /* some sanitation */
+ $date_time = date('Y-m-d H:i:s');
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $this->p->fname = trim(strip_tags($this->p->fname));
+ $this->p->femail = trim(strip_tags($this->p->femail));
+ $this->p->ftitle = trim(strip_tags($this->p->ftitle));
+ $this->p->ftext = trim(strip_tags($this->p->ftext));
+ $this->p->frating = intval($this->p->frating);
+
+ /* begin - server-side validation */
+ $errors = '';
+
+ foreach ($this->options['require_fields'] as $col => $val) {
+ if ($val == 1) {
+ if ($this->p->$col == '') {
+ $nice_name = ucfirst(substr($col,1));
+ $errors .= 'You must include your '.$nice_name.'. ';
+ }
+ }
+ }
+
+ $custom_fields = array(); /* used for insert as well */
+ $custom_count = count($this->options['field_custom']); /* used for insert as well */
+ for ($i = 0; $i < $custom_count; $i++)
+ {
+ $custom_fields[$i] = $this->options['field_custom'][$i];
+ }
+
+ foreach ($this->options['require_custom'] as $i => $val) {
+ if ($val == 1) {
+ $custom_i = "custom_$i";
+ if ($this->p->$custom_i == '') {
+ $nice_name = $custom_fields[$i];
+ $errors .= 'You must include your '.$nice_name.'. ';
+ }
+ }
+ }
+
+ /* only do regex matching if not blank */
+ if ($this->p->femail != '' && $this->options['ask_fields']['femail'] == 1) {
+ if (!preg_match('/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/', $this->p->femail)) {
+ $errors .= 'The email address provided is not valid. ';
+ }
+ }
+
+ /* only do regex matching if not blank */
+ if ($this->p->fwebsite != '' && $this->options['ask_fields']['fwebsite'] == 1) {
+ if (!preg_match('/^\S+:\/\/\S+\.\S+.+$/', $this->p->fwebsite)) {
+ $errors .= 'The website provided is not valid. Be sure to include http:// ';
+ }
+ }
+
+ if (intval($this->p->fconfirm1) == 1 || intval($this->p->fconfirm3) == 1) {
+ $errors .= 'You have triggered our anti-spam system. Please try again. Code 001. ';
+ }
+
+ if (intval($this->p->fconfirm2) != 1) {
+ $errors .= 'You have triggered our anti-spam system. Please try again. Code 002 ';
+ }
+
+ if ($this->p->frating < 1 || $this->p->frating > 5) {
+ $errors .= 'You have triggered our anti-spam system. Please try again. Code 003 ';
+ }
+
+ if (strlen(trim($this->p->ftext)) < 30) {
+ $errors .= 'You must include a review. Please make reviews at least a couple of sentences. ';
+ }
+
+ /* returns true for errors */
+ if ($errors) { return array(true,"$errors
"); }
+ /* end - server-side validation */
+
+ $custom_insert = array();
+ for ($i = 0; $i < $custom_count; $i++)
+ {
+ if ($this->options['ask_custom'][$i] == 1) {
+ $name = $custom_fields[$i];
+ $custom_i = "custom_$i";
+ $custom_insert["$name"] = ucfirst($this->p->$custom_i);
+ }
+ }
+ $custom_insert = serialize($custom_insert);
+
+ $query = $wpdb->prepare("INSERT INTO `$this->dbtable`
+ (date_time, reviewer_name, reviewer_email, reviewer_ip, review_title, review_text, status, review_rating, reviewer_url, custom_fields, page_id)
+ VALUES (%s, %s, %s, %s, %s, %s, %d, %d, %s, %s, %d)",
+ $date_time, $this->p->fname, $this->p->femail, $ip, $this->p->ftitle, $this->p->ftext, 0, $this->p->frating, $this->p->fwebsite, $custom_insert, $pageID);
+
+ $wpdb->query($query);
+
+ $wpurl = get_bloginfo('wpurl');
+ $admin_link = trailingslashit($wpurl).'wp-admin/admin.php?page=wpcr_view_reviews';
+ $admin_link = "Link to admin approval page: $admin_link";
+
+ @wp_mail( get_bloginfo('admin_email'), "WP Customer Reviews: New Review Posted on ".date('m/d/Y h:i'), "A new review has been posted for ".$this->options['business_name']." via WP Customer Reviews. \n\nYou will need to login to the admin area and approve this review before it will appear on your site.\n\n{$admin_link}");
+
+ /* returns false for no error */
+ return array(false,'Thank you for your comments. All submissions are moderated and if approved, yours will appear soon.
');
+ }
+
+ function deactivate() {
+ /* do not fire on upgrading plugin or upgrading WP - only on true manual deactivation */
+ if ($this->p->action == 'deactivate')
+ {
+ $this->options['activate'] = 0;
+ update_option('wpcr_options', $this->options);
+ global $WPCustomerReviewsAdmin;
+ $this->include_admin(); /* include admin functions */
+ $WPCustomerReviewsAdmin->notify_activate(2);
+ }
+ }
+
+ function js_redirect($url,$cookie = array()) {
+ /* we do not html comment script blocks here - to prevent any issues with other plugins adding content to newlines, etc */
+ $out = "".
+ "Processing... Please wait...".
+ "";
+ $out .= "