Created
August 28, 2015 16:25
-
-
Save aaronsilber/08d6c2411b25c88d4cfb to your computer and use it in GitHub Desktop.
Diff against Seamless Donations 4.0.7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -uar /home/brandthropology/Downloads/seamless-donations/dgx-donate-paypalstd-ipn.php ./seamless-donations/dgx-donate-paypalstd-ipn.php | |
--- /home/brandthropology/Downloads/seamless-donations/dgx-donate-paypalstd-ipn.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/dgx-donate-paypalstd-ipn.php 2015-08-28 11:44:21.268488535 -0400 | |
@@ -1,244 +1,244 @@ | |
-<?php | |
-/* | |
- Seamless Donations by David Gewirtz, adopted from Allen Snook | |
- | |
- Lab Notes: http://zatzlabs.com/lab-notes/ | |
- Plugin Page: http://zatzlabs.com/seamless-donations/ | |
- Contact: http://zatzlabs.com/contact-us/ | |
- | |
- Copyright (c) 2015 by David Gewirtz | |
- */ | |
- | |
-// Load WordPress | |
-include "../../../wp-config.php"; | |
- | |
-// Load Seamless Donations Core | |
-require_once './inc/geography.php'; | |
-require_once './inc/currency.php'; | |
-require_once './inc/utilities.php'; | |
-require_once './inc/legacy.php'; | |
-require_once './inc/donations.php'; | |
- | |
-require_once './legacy/dgx-donate.php'; | |
-require_once './legacy/dgx-donate-admin.php'; | |
-require_once './seamless-donations-admin.php'; | |
-require_once './seamless-donations-form.php'; | |
-require_once './dgx-donate-paypalstd.php'; | |
- | |
-class Dgx_Donate_IPN_Handler { | |
- | |
- var $chat_back_url = "tls://www.paypal.com"; | |
- var $host_header = "Host: www.paypal.com\r\n"; | |
- var $post_data = array(); | |
- var $session_id = ''; | |
- var $transaction_id = ''; | |
- | |
- public function __construct () { | |
- | |
- dgx_donate_debug_log ( '----------------------------------------' ); | |
- dgx_donate_debug_log ( 'PROCESSING PAYPAL IPN TRANSACTION' ); | |
- dgx_donate_debug_log ( "Seamless Donations Version: " . dgx_donate_get_version () ); | |
- | |
- // Grab all the post data | |
- $post = file_get_contents ( 'php://input' ); | |
- parse_str ( $post, $data ); | |
- $this->post_data = $data; | |
- | |
- // Set up for production or test | |
- $this->configure_for_production_or_test (); | |
- | |
- // Extract the session and transaction IDs from the POST | |
- $this->get_ids_from_post (); | |
- | |
- if( ! empty( $this->session_id ) ) { | |
- $response = $this->reply_to_paypal (); | |
- | |
- if( "VERIFIED" == $response ) { | |
- $this->handle_verified_ipn (); | |
- } else if( "INVALID" == $response ) { | |
- $this->handle_invalid_ipn (); | |
- } else { | |
- $this->handle_unrecognized_ipn ( $response ); | |
- } | |
- } else { | |
- dgx_donate_debug_log ( 'Null IPN (Empty session id). Nothing to do.' ); | |
- } | |
- | |
- do_action( 'seamless_donations_paypal_ipn_processing_complete', $this->session_id, $this->transaction_id ); | |
- dgx_donate_debug_log ( 'IPN processing complete.' ); | |
- } | |
- | |
- function configure_for_production_or_test () { | |
- | |
- if( "SANDBOX" == get_option ( 'dgx_donate_paypal_server' ) ) { | |
- $this->chat_back_url = "tls://www.sandbox.paypal.com"; | |
- $this->host_header = "Host: www.sandbox.paypal.com\r\n"; | |
- } | |
- } | |
- | |
- function get_ids_from_post () { | |
- | |
- $this->session_id = isset( $this->post_data["custom"] ) ? $this->post_data["custom"] : ''; | |
- $this->transaction_id = isset( $this->post_data["txn_id"] ) ? $this->post_data["txn_id"] : ''; | |
- } | |
- | |
- function reply_to_paypal () { | |
- | |
- $request_data = $this->post_data; | |
- $request_data['cmd'] = '_notify-validate'; | |
- $request = http_build_query ( $request_data ); | |
- | |
- $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; | |
- $header .= $this->host_header; | |
- $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; | |
- $header .= "Content-Length: " . strlen ( $request ) . "\r\n\r\n"; | |
- | |
- $response = ''; | |
- | |
- $fp = fsockopen ( $this->chat_back_url, 443, $errno, $errstr, 30 ); | |
- if( $fp ) { | |
- fputs ( $fp, $header . $request ); | |
- | |
- $done = false; | |
- do { | |
- if( feof ( $fp ) ) { | |
- $done = true; | |
- } else { | |
- $response = fgets ( $fp, 1024 ); | |
- $done = in_array ( $response, array( "VERIFIED", "INVALID" ) ); | |
- } | |
- } while( ! $done ); | |
- } else { | |
- dgx_donate_debug_log ( "IPN failed: unable to establish network chatback connection to PayPal" ); | |
- dgx_donate_debug_log ( "==> url = {$this->chat_back_url}, errno = $errno, errstr = $errstr" ); | |
- } | |
- fclose ( $fp ); | |
- | |
- return $response; | |
- } | |
- | |
- function handle_verified_ipn () { | |
- | |
- $sd4_mode = get_option ( 'dgx_donate_start_in_sd4_mode' ); | |
- $payment_status = $this->post_data["payment_status"]; | |
- | |
- dgx_donate_debug_log ( "IPN VERIFIED for session ID {$this->session_id}" ); | |
- dgx_donate_debug_log ( "PayPal reports payment status: {$payment_status}" ); | |
- | |
- if( "Completed" == $payment_status ) { | |
- // Check if we've already logged a transaction with this same transaction id | |
- $donation_id = get_donations_by_meta ( '_dgx_donate_transaction_id', $this->transaction_id, 1 ); | |
- | |
- if( 0 == count ( $donation_id ) ) { | |
- // We haven't seen this transaction ID already | |
- | |
- // See if a donation for this session ID already exists | |
- $donation_id = get_donations_by_meta ( '_dgx_donate_session_id', $this->session_id, 1 ); | |
- | |
- if( 0 == count ( $donation_id ) ) { | |
- // We haven't seen this session ID already | |
- | |
- // Retrieve the data | |
- if( $sd4_mode == false ) { | |
- // retrieve from transient | |
- $donation_form_data = get_transient ( $this->session_id ); | |
- } else { | |
- // retrieve from audit db table | |
- $donation_form_data = seamless_donations_get_audit_option ( $this->session_id); | |
- } | |
- | |
- if( ! empty( $donation_form_data ) ) { | |
- // Create a donation record | |
- if( $sd4_mode == false ) { | |
- dgx_donate_debug_log ( | |
- "Creating donation from transient data in pre-4.x mode." ); | |
- $donation_id = dgx_donate_create_donation_from_transient_data ( $donation_form_data ); | |
- } else { | |
- dgx_donate_debug_log ( "Creating donation from transaction audit data in 4.x mode." ); | |
- $donation_id = seamless_donations_create_donation_from_transient_data ( | |
- $donation_form_data ); | |
- } | |
- dgx_donate_debug_log ( | |
- "Created donation {$donation_id} for session ID {$this->session_id}"); | |
- | |
- if( $sd4_mode == false ) { | |
- // Clear the transient | |
- delete_transient ( $this->session_id ); | |
- } | |
- } else { | |
- // We have a session_id but no transient (the admin might have | |
- // deleted all previous donations in a recurring donation for | |
- // some reason) - so we will have to create a donation record | |
- // from the data supplied by PayPal | |
- if( $sd4_mode == false ) { | |
- $donation_id = dgx_donate_create_donation_from_paypal_data ( $this->post_data ); | |
- dgx_donate_debug_log ( | |
- "Created donation {$donation_id} " . | |
- "from PayPal data (no transient data found) in pre-4.x mode." ); | |
- } else { | |
- $donation_id = seamless_donations_create_donation_from_paypal_data ( $this->post_data ); | |
- dgx_donate_debug_log ( | |
- "Created donation {$donation_id} " . | |
- "from PayPal data (no audit db data found) in 4.x mode." ); | |
- } | |
- } | |
- } else { | |
- // We have seen this session ID already, create a new donation record for this new transaction | |
- | |
- // But first, flatten the array returned by get_donations_by_meta for _dgx_donate_session_id | |
- $donation_id = $donation_id[0]; | |
- | |
- $old_donation_id = $donation_id; | |
- if( $sd4_mode == false ) { | |
- $donation_id = dgx_donate_create_donation_from_donation ( $old_donation_id ); | |
- } else { | |
- $donation_id = seamless_donations_create_donation_from_donation ( $old_donation_id ); | |
- } | |
- dgx_donate_debug_log ( | |
- "Created donation {$donation_id} (recurring donation, donor data copied from donation {$old_donation_id}" ); | |
- } | |
- } else { | |
- // We've seen this transaction ID already - ignore it | |
- $donation_id = ''; | |
- dgx_donate_debug_log ( "Transaction ID {$this->transaction_id} already handled - ignoring" ); | |
- } | |
- | |
- if( ! empty( $donation_id ) ) { | |
- // Update the raw paypal data | |
- update_post_meta ( $donation_id, '_dgx_donate_transaction_id', $this->transaction_id ); | |
- update_post_meta ( $donation_id, '_dgx_donate_payment_processor', 'PAYPALSTD' ); | |
- update_post_meta ( $donation_id, '_dgx_donate_payment_processor_data', $this->post_data ); | |
- // save the currency of the transaction | |
- $currency_code = $this->post_data['mc_currency']; | |
- dgx_donate_debug_log ( "Payment currency = {$currency_code}" ); | |
- update_post_meta ( $donation_id, '_dgx_donate_donation_currency', $currency_code ); | |
- } | |
- | |
- // @todo - send different notification for recurring? | |
- | |
- // Send admin notification | |
- dgx_donate_send_donation_notification ( $donation_id ); | |
- // Send donor notification | |
- dgx_donate_send_thank_you_email ( $donation_id ); | |
- } | |
- } | |
- | |
- function handle_invalid_ipn () { | |
- | |
- dgx_donate_debug_log ( "IPN failed (INVALID) for sessionID {$this->session_id}" ); | |
- } | |
- | |
- function handle_unrecognized_ipn ( $paypal_response ) { | |
- | |
- dgx_donate_debug_log ( "IPN failed (unrecognized response) for sessionID {$this->session_id}" ); | |
- dgx_donate_debug_log ( "==> " . $paypal_response ); | |
- } | |
-} | |
- | |
-$dgx_donate_ipn_responder = new Dgx_Donate_IPN_Handler(); | |
- | |
-/** | |
- * We cannot send nothing, so send back just a simple content-type message | |
- */ | |
- | |
-echo "content-type: text/plain\n\n"; | |
+<?php | |
+/* | |
+ Seamless Donations by David Gewirtz, adopted from Allen Snook | |
+ | |
+ Lab Notes: http://zatzlabs.com/lab-notes/ | |
+ Plugin Page: http://zatzlabs.com/seamless-donations/ | |
+ Contact: http://zatzlabs.com/contact-us/ | |
+ | |
+ Copyright (c) 2015 by David Gewirtz | |
+ */ | |
+ | |
+// Load WordPress | |
+include "../../../wp-config.php"; | |
+ | |
+// Load Seamless Donations Core | |
+require_once './inc/geography.php'; | |
+require_once './inc/currency.php'; | |
+require_once './inc/utilities.php'; | |
+require_once './inc/legacy.php'; | |
+require_once './inc/donations.php'; | |
+ | |
+require_once './legacy/dgx-donate.php'; | |
+require_once './legacy/dgx-donate-admin.php'; | |
+require_once './seamless-donations-admin.php'; | |
+require_once './seamless-donations-form.php'; | |
+require_once './dgx-donate-paypalstd.php'; | |
+ | |
+class Dgx_Donate_IPN_Handler { | |
+ | |
+ var $chat_back_url = "tls://www.paypal.com"; | |
+ var $host_header = "Host: www.paypal.com\r\n"; | |
+ var $post_data = array(); | |
+ var $session_id = ''; | |
+ var $transaction_id = ''; | |
+ | |
+ public function __construct () { | |
+ | |
+ dgx_donate_debug_log ( '----------------------------------------' ); | |
+ dgx_donate_debug_log ( 'PROCESSING PAYPAL IPN TRANSACTION' ); | |
+ dgx_donate_debug_log ( "Seamless Donations Version: " . dgx_donate_get_version () ); | |
+ | |
+ // Grab all the post data | |
+ $post = file_get_contents ( 'php://input' ); | |
+ parse_str ( $post, $data ); | |
+ $this->post_data = $data; | |
+ | |
+ // Set up for production or test | |
+ $this->configure_for_production_or_test (); | |
+ | |
+ // Extract the session and transaction IDs from the POST | |
+ $this->get_ids_from_post (); | |
+ | |
+ if( ! empty( $this->session_id ) ) { | |
+ $response = $this->reply_to_paypal (); | |
+ | |
+ if( "VERIFIED" == $response ) { | |
+ $this->handle_verified_ipn (); | |
+ } else if( "INVALID" == $response ) { | |
+ $this->handle_invalid_ipn (); | |
+ } else { | |
+ $this->handle_unrecognized_ipn ( $response ); | |
+ } | |
+ } else { | |
+ dgx_donate_debug_log ( 'Null IPN (Empty session id). Nothing to do.' ); | |
+ } | |
+ | |
+ do_action( 'seamless_donations_paypal_ipn_processing_complete', $this->session_id, $this->transaction_id ); | |
+ dgx_donate_debug_log ( 'IPN processing complete.' ); | |
+ } | |
+ | |
+ function configure_for_production_or_test () { | |
+ | |
+ if( "SANDBOX" == get_option ( 'dgx_donate_paypal_server' ) ) { | |
+ $this->chat_back_url = "tls://www.sandbox.paypal.com"; | |
+ $this->host_header = "Host: www.sandbox.paypal.com\r\n"; | |
+ } | |
+ } | |
+ | |
+ function get_ids_from_post () { | |
+ | |
+ $this->session_id = isset( $this->post_data["custom"] ) ? $this->post_data["custom"] : ''; | |
+ $this->transaction_id = isset( $this->post_data["txn_id"] ) ? $this->post_data["txn_id"] : ''; | |
+ } | |
+ | |
+ function reply_to_paypal () { | |
+ | |
+ $request_data = $this->post_data; | |
+ $request_data['cmd'] = '_notify-validate'; | |
+ $request = http_build_query ( $request_data ); | |
+ | |
+ $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; | |
+ $header .= $this->host_header; | |
+ $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; | |
+ $header .= "Content-Length: " . strlen ( $request ) . "\r\n\r\n"; | |
+ | |
+ $response = ''; | |
+ | |
+ $fp = fsockopen ( $this->chat_back_url, 443, $errno, $errstr, 30 ); | |
+ if( $fp ) { | |
+ fputs ( $fp, $header . $request ); | |
+ | |
+ $done = false; | |
+ do { | |
+ if( feof ( $fp ) ) { | |
+ $done = true; | |
+ } else { | |
+ $response = fgets ( $fp, 1024 ); | |
+ $done = in_array ( $response, array( "VERIFIED", "INVALID" ) ); | |
+ } | |
+ } while( ! $done ); | |
+ } else { | |
+ dgx_donate_debug_log ( "IPN failed: unable to establish network chatback connection to PayPal" ); | |
+ dgx_donate_debug_log ( "==> url = {$this->chat_back_url}, errno = $errno, errstr = $errstr" ); | |
+ } | |
+ fclose ( $fp ); | |
+ | |
+ return $response; | |
+ } | |
+ | |
+ function handle_verified_ipn () { | |
+ | |
+ $sd4_mode = get_option ( 'dgx_donate_start_in_sd4_mode' ); | |
+ $payment_status = $this->post_data["payment_status"]; | |
+ | |
+ dgx_donate_debug_log ( "IPN VERIFIED for session ID {$this->session_id}" ); | |
+ dgx_donate_debug_log ( "PayPal reports payment status: {$payment_status}" ); | |
+ | |
+ if( "Completed" == $payment_status ) { | |
+ // Check if we've already logged a transaction with this same transaction id | |
+ $donation_id = get_donations_by_meta ( '_dgx_donate_transaction_id', $this->transaction_id, 1 ); | |
+ | |
+ if( 0 == count ( $donation_id ) ) { | |
+ // We haven't seen this transaction ID already | |
+ | |
+ // See if a donation for this session ID already exists | |
+ $donation_id = get_donations_by_meta ( '_dgx_donate_session_id', $this->session_id, 1 ); | |
+ | |
+ if( 0 == count ( $donation_id ) ) { | |
+ // We haven't seen this session ID already | |
+ | |
+ // Retrieve the data | |
+ if( $sd4_mode == false ) { | |
+ // retrieve from transient | |
+ $donation_form_data = get_transient ( $this->session_id ); | |
+ } else { | |
+ // retrieve from audit db table | |
+ $donation_form_data = seamless_donations_get_audit_option ( $this->session_id); | |
+ } | |
+ | |
+ if( ! empty( $donation_form_data ) ) { | |
+ // Create a donation record | |
+ if( $sd4_mode == false ) { | |
+ dgx_donate_debug_log ( | |
+ "Creating donation from transient data in pre-4.x mode." ); | |
+ $donation_id = dgx_donate_create_donation_from_transient_data ( $donation_form_data ); | |
+ } else { | |
+ dgx_donate_debug_log ( "Creating donation from transaction audit data in 4.x mode." ); | |
+ $donation_id = seamless_donations_create_donation_from_transient_data ( | |
+ $donation_form_data ); | |
+ } | |
+ dgx_donate_debug_log ( | |
+ "Created donation {$donation_id} for session ID {$this->session_id}"); | |
+ | |
+ if( $sd4_mode == false ) { | |
+ // Clear the transient | |
+ delete_transient ( $this->session_id ); | |
+ } | |
+ } else { | |
+ // We have a session_id but no transient (the admin might have | |
+ // deleted all previous donations in a recurring donation for | |
+ // some reason) - so we will have to create a donation record | |
+ // from the data supplied by PayPal | |
+ if( $sd4_mode == false ) { | |
+ $donation_id = dgx_donate_create_donation_from_paypal_data ( $this->post_data ); | |
+ dgx_donate_debug_log ( | |
+ "Created donation {$donation_id} " . | |
+ "from PayPal data (no transient data found) in pre-4.x mode." ); | |
+ } else { | |
+ $donation_id = seamless_donations_create_donation_from_paypal_data ( $this->post_data ); | |
+ dgx_donate_debug_log ( | |
+ "Created donation {$donation_id} " . | |
+ "from PayPal data (no audit db data found) in 4.x mode." ); | |
+ } | |
+ } | |
+ } else { | |
+ // We have seen this session ID already, create a new donation record for this new transaction | |
+ | |
+ // But first, flatten the array returned by get_donations_by_meta for _dgx_donate_session_id | |
+ $donation_id = $donation_id[0]; | |
+ | |
+ $old_donation_id = $donation_id; | |
+ if( $sd4_mode == false ) { | |
+ $donation_id = dgx_donate_create_donation_from_donation ( $old_donation_id ); | |
+ } else { | |
+ $donation_id = seamless_donations_create_donation_from_donation ( $old_donation_id ); | |
+ } | |
+ dgx_donate_debug_log ( | |
+ "Created donation {$donation_id} (recurring donation, donor data copied from donation {$old_donation_id}" ); | |
+ } | |
+ } else { | |
+ // We've seen this transaction ID already - ignore it | |
+ $donation_id = ''; | |
+ dgx_donate_debug_log ( "Transaction ID {$this->transaction_id} already handled - ignoring" ); | |
+ } | |
+ | |
+ if( ! empty( $donation_id ) ) { | |
+ // Update the raw paypal data | |
+ update_post_meta ( $donation_id, '_dgx_donate_transaction_id', $this->transaction_id ); | |
+ update_post_meta ( $donation_id, '_dgx_donate_payment_processor', 'PAYPALSTD' ); | |
+ update_post_meta ( $donation_id, '_dgx_donate_payment_processor_data', $this->post_data ); | |
+ // save the currency of the transaction | |
+ $currency_code = $this->post_data['mc_currency']; | |
+ dgx_donate_debug_log ( "Payment currency = {$currency_code}" ); | |
+ update_post_meta ( $donation_id, '_dgx_donate_donation_currency', $currency_code ); | |
+ } | |
+ | |
+ // @todo - send different notification for recurring? | |
+ | |
+ // Send admin notification | |
+ dgx_donate_send_donation_notification ( $donation_id ); | |
+ // Send donor notification | |
+ dgx_donate_send_thank_you_email ( $donation_id ); | |
+ } | |
+ } | |
+ | |
+ function handle_invalid_ipn () { | |
+ | |
+ dgx_donate_debug_log ( "IPN failed (INVALID) for sessionID {$this->session_id}" ); | |
+ } | |
+ | |
+ function handle_unrecognized_ipn ( $paypal_response ) { | |
+ | |
+ dgx_donate_debug_log ( "IPN failed (unrecognized response) for sessionID {$this->session_id}" ); | |
+ dgx_donate_debug_log ( "==> " . $paypal_response ); | |
+ } | |
+} | |
+ | |
+$dgx_donate_ipn_responder = new Dgx_Donate_IPN_Handler(); | |
+ | |
+/** | |
+ * We cannot send nothing, so send back just a simple content-type message | |
+ */ | |
+ | |
+echo "content-type: text/plain\n\n"; | |
diff -uar /home/brandthropology/Downloads/seamless-donations/dgx-donate-paypalstd.php ./seamless-donations/dgx-donate-paypalstd.php | |
--- /home/brandthropology/Downloads/seamless-donations/dgx-donate-paypalstd.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/dgx-donate-paypalstd.php 2015-08-28 11:57:47.916177953 -0400 | |
@@ -343,116 +343,83 @@ | |
dgx_donate_debug_log ( 'Duplicate session data not found. Payment process data assembly can proceed.' ); | |
- // all of this no longer necessary for transfer to PayPal, just for storage in local audit table | |
- $referringUrl = $_POST['referringUrl']; | |
- $donationAmount = $_POST['donationAmount']; | |
- $userAmount = $_POST['userAmount']; | |
- $repeating = $_POST['repeating']; | |
- $designated = $_POST['designated']; | |
- $designatedFund = $_POST['designatedFund']; | |
- $tributeGift = $_POST['tributeGift']; | |
- $memorialGift = $_POST['memorialGift']; | |
- $honoreeName = $_POST['honoreeName']; | |
- $honorByEmail = $_POST['honorByEmail']; | |
- $honoreeEmail = $_POST['honoreeEmail']; | |
- $honoreeAddress = $_POST['honoreeAddress']; | |
- $honoreeCity = $_POST['honoreeCity']; | |
- $honoreeState = $_POST['honoreeState']; | |
- $honoreeProvince = $_POST['honoreeProvince']; | |
- $honoreeCountry = $_POST['honoreeCountry']; | |
- | |
- if( 'US' == $honoreeCountry ) { | |
- $honoreeProvince = ''; | |
- } else if( 'CA' == $honoreeCountry ) { | |
- $honoreeState = ''; | |
- } else { | |
- $honoreeState = ''; | |
- $honoreeProvince = ''; | |
- } | |
- | |
- $honoreeZip = $_POST['honoreeZip']; | |
- $honoreeEmailName = $_POST['honoreeEmailName']; | |
- $honoreePostName = $_POST['honoreePostName']; | |
- $firstName = $_POST['firstName']; | |
- $lastName = $_POST['lastName']; | |
- $phone = $_POST['phone']; | |
- $email = $_POST['email']; | |
- $addToMailingList = $_POST['addToMailingList']; | |
- $address = $_POST['address']; | |
- $address2 = $_POST['address2']; | |
- $city = $_POST['city']; | |
- $state = $_POST['state']; | |
- $province = $_POST['province']; | |
- $country = $_POST['country']; | |
- | |
- if( 'US' == $country ) { | |
- $province = ''; | |
- } else if( 'CA' == $country ) { | |
- $state = ''; | |
- } else { | |
- $state = ''; | |
- $province = ''; | |
- } | |
- | |
- $zip = $_POST['zip']; | |
- $increaseToCover = $_POST['increaseToCover']; | |
- $anonymous = $_POST['anonymous']; | |
- $employerMatch = $_POST['employerMatch']; | |
- $employerName = $_POST['employerName']; | |
- $occupation = $_POST['occupation']; | |
- $ukGiftAid = $_POST['ukGiftAid']; | |
+ if( $_POST['honoreeCountry'] == 'US' ) { | |
+ $_POST['honoreeProvince'] = ''; | |
+ } else if( $_POST['honoreeCountry'] == 'CA' ) { | |
+ $_POST['honoreeState'] = ''; | |
+ } else if ( $_POST['honoreeCountry'] == '' ) { | |
+ //default to US if country blank | |
+ $_POST['honoreeCountry'] = 'US'; | |
+ } else { | |
+ $_POST['honoreeState'] = ''; | |
+ $_POST['honoreeProvince'] = ''; | |
+ } | |
+ | |
+ if( $_POST['country'] == 'US' ) { | |
+ $_POST['province'] = ''; | |
+ } else if( 'CA' == $_POST['country'] ) { | |
+ $_POST['state'] = ''; | |
+ } else if ( $_POST['country'] == '' ) { | |
+ $_POST['country'] = 'US'; | |
+ } else { | |
+ $_POST['state'] = ''; | |
+ $_POST['province'] = ''; | |
+ } | |
// Resolve the donation amount | |
- if( strcasecmp ( $donationAmount, "OTHER" ) == 0 ) { | |
- $amount = floatval ( $userAmount ); | |
+ if( strcasecmp ( $_POST['donationAmount'], "OTHER" ) == 0 ) { | |
+ $_POST['amount'] = floatval ( $_POST['userAmount'] ); | |
} else { | |
- $amount = floatval ( $donationAmount ); | |
+ $_POST['amount'] = floatval ( $_POST['donationAmount'] ); | |
} | |
- if( $amount < 1.00 ) { | |
- $amount = 1.00; | |
+ if( $_POST['amount'] < 1.00 ) { | |
+ $_POST['amount'] = 1.00; | |
} | |
// Repack the POST | |
- $post_data = array(); | |
- $post_data['REFERRINGURL'] = $referringUrl; | |
- $post_data['SESSIONID'] = $session_id; | |
- $post_data['AMOUNT'] = $amount; | |
- $post_data['REPEATING'] = $repeating; | |
- $post_data['DESIGNATED'] = $designated; | |
- $post_data['DESIGNATEDFUND'] = $designatedFund; | |
- $post_data['TRIBUTEGIFT'] = $tributeGift; | |
- $post_data['MEMORIALGIFT'] = $memorialGift; | |
- $post_data['HONOREENAME'] = $honoreeName; | |
- $post_data['HONORBYEMAIL'] = $honorByEmail; | |
- $post_data['HONOREEEMAIL'] = $honoreeEmail; | |
- $post_data['HONOREEADDRESS'] = $honoreeAddress; | |
- $post_data['HONOREECITY'] = $honoreeCity; | |
- $post_data['HONOREESTATE'] = $honoreeState; | |
- $post_data['HONOREEPROVINCE'] = $honoreeProvince; | |
- $post_data['HONOREECOUNTRY'] = $honoreeCountry; | |
- $post_data['HONOREEZIP'] = $honoreeZip; | |
- $post_data['HONOREEEMAILNAME'] = $honoreeEmailName; | |
- $post_data['HONOREEPOSTNAME'] = $honoreePostName; | |
- $post_data['FIRSTNAME'] = $firstName; | |
- $post_data['LASTNAME'] = $lastName; | |
- $post_data['PHONE'] = $phone; | |
- $post_data['EMAIL'] = $email; | |
- $post_data['ADDTOMAILINGLIST'] = $addToMailingList; | |
- $post_data['ADDRESS'] = $address; | |
- $post_data['ADDRESS2'] = $address2; | |
- $post_data['CITY'] = $city; | |
- $post_data['STATE'] = $state; | |
- $post_data['PROVINCE'] = $province; | |
- $post_data['COUNTRY'] = $country; | |
- $post_data['ZIP'] = $zip; | |
- $post_data['INCREASETOCOVER'] = $increaseToCover; | |
- $post_data['ANONYMOUS'] = $anonymous; | |
- $post_data['PAYMENTMETHOD'] = "PayPal"; | |
- $post_data['EMPLOYERMATCH'] = $employerMatch; | |
- $post_data['EMPLOYERNAME'] = $employerName; | |
- $post_data['OCCUPATION'] = $occupation; | |
- $post_data['UKGIFTAID'] = $ukGiftAid; | |
- $post_data['SDVERSION'] = dgx_donate_get_version (); | |
+ $acceptedFields = apply_filters( 'seamless_donations_accepted_fields', array( 'referringUrl', | |
+ 'sessionID', | |
+ 'amount', | |
+ 'repeating', | |
+ 'designated', | |
+ 'designatedFund', | |
+ 'tributeGift', | |
+ 'memorialGift', | |
+ 'honoreeName', | |
+ 'honoreeEmail', | |
+ 'honoreeAddress', | |
+ 'honoreeCity', | |
+ 'honoreeState', | |
+ 'honoreeProvince', | |
+ 'honoreeCountry', | |
+ 'honoreeZip', | |
+ 'honoreeEmailName', | |
+ 'honoreePostName', | |
+ 'firstName', | |
+ 'lastName', | |
+ 'phone', | |
+ 'email', | |
+ 'addToMailingList', | |
+ 'address', | |
+ 'address2', | |
+ 'city', | |
+ 'state', | |
+ 'province', | |
+ 'country', | |
+ 'zip', | |
+ 'increaseToCover', | |
+ 'anonymous', | |
+ 'paymentMethod', | |
+ 'employerMatch', | |
+ 'employerName', | |
+ 'occupation', | |
+ 'ukGiftAid', | |
+ )); | |
+ foreach ($acceptedFields as $key => $value) { | |
+ $upper = strtoupper($value); | |
+ $post_data[$upper] = $_POST[$value]; | |
+ } | |
+ $post_data['PAYMENTMETHOD'] = 'PayPal'; | |
// Sanitize the data (remove leading, trailing spaces quotes, brackets) | |
foreach( $post_data as $key => $value ) { | |
@@ -465,7 +432,14 @@ | |
if( $sd4_mode == false ) { | |
// Save it all in a transient | |
$transient_token = $post_data['SESSIONID']; | |
- set_transient ( $transient_token, $post_data, 7 * 24 * 60 * 60 ); // 7 days | |
+ // Capture the result of the transient update call | |
+ $transient_status = set_transient ( $transient_token, $post_data, 7 * 24 * 60 * 60 ); // 7 days | |
+ // if transient could not be set, fail and die | |
+ if ($transient_status===false) { | |
+ $returnMessage = '1|Failed to save transient'; | |
+ echo $returnMessage; | |
+ wp_die(); | |
+ } | |
dgx_donate_debug_log ( 'Saving transaction data using legacy mode' ); | |
} else { | |
seamless_donations_update_audit_option ( $session_id, $post_data ); | |
@@ -485,7 +459,7 @@ | |
echo $returnMessage; | |
- die(); // this is required to return a proper result | |
+ wp_die(); // this is required to return a proper result | |
} | |
} | |
Only in /home/brandthropology/Downloads/seamless-donations: .idea | |
diff -uar /home/brandthropology/Downloads/seamless-donations/inc/form-engine.php ./seamless-donations/inc/form-engine.php | |
--- /home/brandthropology/Downloads/seamless-donations/inc/form-engine.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/inc/form-engine.php 2015-08-28 12:05:48.306493840 -0400 | |
@@ -188,6 +188,7 @@ | |
$element_html = ''; | |
$element_type = ''; // preload the element attributes | |
$element_id = ''; | |
+ $element_placeholder= ''; | |
$element_value = ''; | |
$element_class = ''; | |
$element_style = ''; | |
@@ -275,6 +276,9 @@ | |
case 'source': | |
$element_source = trim ( $form_array[ $element_name ]['source'] ); | |
break; | |
+ case 'placeholder': | |
+ $element_placeholder = trim ( $form_array[ $element_name ]['placeholder'] ); | |
+ break; | |
case 'wrapper': | |
$element_wrapper = strtolower ( ( $form_array[ $element_name ]['wrapper'] ) ); | |
if( $element_wrapper != 'div' and $element_wrapper != 'span' ) { | |
@@ -366,6 +370,9 @@ | |
if( $element_id != '' ) { | |
$element_html .= "id='" . $element_id . "' "; // ID | |
} | |
+ if ( $element_placeholder != '' ) { | |
+ $element_html .= "placeholder='" . $element_placeholder . "' "; // placeholder | |
+ } | |
if( $element_reveal != '' ) { | |
$element_html .= "data-reveal='."; // jQuery will look for classes with this name | |
$element_html .= $element_reveal; | |
@@ -427,6 +434,9 @@ | |
if( $element_id != '' ) { | |
$element_html .= "id='" . $element_id . "' "; | |
} | |
+ if ( $element_placeholder != '') { | |
+ $element_html .= "placeholder='" . $element_placeholder . "' "; | |
+ } | |
if( $element_class != '' ) { | |
$element_html .= "class='" . $element_class . "' "; | |
} | |
diff -uar /home/brandthropology/Downloads/seamless-donations/js/seamless-donations.js ./seamless-donations/js/seamless-donations.js | |
--- /home/brandthropology/Downloads/seamless-donations/js/seamless-donations.js 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/js/seamless-donations.js 2015-08-28 12:05:46.578461308 -0400 | |
@@ -601,6 +601,7 @@ | |
function SeamlessDonationsAjaxCallback(data) { | |
// Submit the hidden form to take the user to PayPal | |
+ console.log(data); | |
console.log("Inside SeamlessDonationsAjaxCallback"); | |
//jQuery('#seamless-donations-form').submit(); | |
} | |
diff -uar /home/brandthropology/Downloads/seamless-donations/legacy/admin-views/export.php ./seamless-donations/legacy/admin-views/export.php | |
--- /home/brandthropology/Downloads/seamless-donations/legacy/admin-views/export.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/legacy/admin-views/export.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,168 +1,168 @@ | |
-<?php | |
- | |
-/* Copyright 2013 Allen Snook (email: [email protected]) */ | |
- | |
-include( '../../../../wp-config.php' ); | |
- | |
-if ( ! current_user_can( 'manage_options' ) ) { | |
- | |
- header( "Content-Type: text/html" ); | |
- echo "<html>\n"; | |
- echo "<head>\n"; | |
- echo "<title>Unauthorized</title>\n"; | |
- echo "</head>\n"; | |
- echo "<body>\n"; | |
- echo "<h1>Unauthorized</h1>\n"; | |
- echo "<p>You do not have permission to access this page. Did you forget to log in?</p>"; | |
- echo "</body>\n"; | |
- echo "</html>\n"; | |
-} | |
-else | |
-{ | |
- $startDate = $_POST['startdate']; | |
- $endDate = $_POST['enddate']; | |
- | |
- $startTimeStamp = strtotime( $startDate ); | |
- $endTimeStamp = strtotime( $endDate ); | |
- $countries = dgx_donate_get_countries(); | |
- | |
- $firstOne = true; | |
- $post_type = 'dgx-donation'; | |
- | |
- $args = array( | |
- 'numberposts' => '-1', | |
- 'post_type' => $post_type, | |
- 'orderby' => 'post_date', | |
- 'order' => 'DESC' | |
- ); | |
- | |
- $myDonations = get_posts( $args ); | |
- | |
- foreach ( (array) $myDonations as $myDonation ) | |
- { | |
- $donationID = $myDonation->ID; | |
- | |
- // Make sure this donation's date falls in the range | |
- $okToAdd = true; | |
- $year = get_post_meta( $donationID, '_dgx_donate_year', true ); | |
- $month = get_post_meta( $donationID, '_dgx_donate_month', true ); | |
- $day = get_post_meta( $donationID, '_dgx_donate_day', true ); | |
- $donationDate = $month . "/" . $day . "/" . $year; | |
- $donationTimeStamp = strtotime( $donationDate ); | |
- | |
- if ( $donationTimeStamp < $startTimeStamp ) | |
- { | |
- $okToAdd = false; | |
- } | |
- | |
- if ( $donationTimeStamp > $endTimeStamp ) | |
- { | |
- $okToAdd = false; | |
- } | |
- | |
- if ( $okToAdd ) | |
- { | |
- // Order in CSV | |
- // Date (MM/DD/YYYY), Time (HH:MM:SS A), First Name, Last Name, Amount, Repeating (YES/NO), | |
- // Designated Fund, Gift Item, Donor Phone, Donor Email, Donor Address, Donor Address2, | |
- // Donor City, Donor State, Donor Zip, OK to Add to Mailing List (YES/NO) | |
- | |
- if ( $firstOne ) | |
- { | |
- header( "Content-type: text/csv" ); | |
- header( "Content-Disposition: attachment; filename=export.csv" ); | |
- | |
- echo "\"Date\",\"Time\",\"First Name\",\"Last Name\",\"Amount\",\"Currency\",\"Repeating\","; | |
- echo "\"Designated Fund\",\"Gift Item\",\"Phone\",\"Email\",\"Address\",\"Address 2\","; | |
- echo "\"City\",\"State/Prov\",\"Postal Code\",\"Country\",\"Employer\",\"Occupation\","; | |
- echo "\"OK to Add to Mailing List\"\n"; | |
- | |
- $firstOne = false; | |
- } | |
- | |
- $time = get_post_meta( $donationID, '_dgx_donate_time', true ); | |
- $firstName = get_post_meta( $donationID, '_dgx_donate_donor_first_name', true ); | |
- $lastName = get_post_meta( $donationID, '_dgx_donate_donor_last_name', true ); | |
- $amount = get_post_meta( $donationID, '_dgx_donate_amount', true ); | |
- | |
- $currency_code = dgx_donate_get_donation_currency_code( $donationID ); | |
- $formatted_amount = dgx_donate_get_plain_formatted_amount( $amount, 2, $currency_code, false ); | |
- $repeating = get_post_meta( $donationID, '_dgx_donate_repeating', true ); | |
- if ( empty( $repeating ) ) | |
- { | |
- $repeating = "No"; | |
- } | |
- else | |
- { | |
- $repeating = "Yes"; | |
- } | |
- $designatedFundName = "Undesignated"; | |
- $designated = get_post_meta( $donationID, '_dgx_donate_designated', true ); | |
- if ( ! empty( $designated ) ) | |
- { | |
- $designatedFundName = get_post_meta( $donationID, '_dgx_donate_designated_fund', true ); | |
- } | |
- $gift_item_id = get_post_meta( $donationID, '_dgx_donate_gift_item_id', true ); | |
- $gift_item_title = ""; | |
- if ( !empty( $gift_item_id ) ) { | |
- $gift_item_title = get_the_title( $gift_item_id ); | |
- } | |
- $phone = get_post_meta( $donationID, '_dgx_donate_donor_phone', true ); | |
- $email = get_post_meta( $donationID, '_dgx_donate_donor_email', true ); | |
- $address = get_post_meta( $donationID, '_dgx_donate_donor_address', true ); | |
- $address2 = get_post_meta( $donationID, '_dgx_donate_donor_address2', true ); | |
- $city = get_post_meta( $donationID, '_dgx_donate_donor_city', true ); | |
- $state = get_post_meta( $donationID, '_dgx_donate_donor_state', true ); | |
- $province = get_post_meta( $donationID, '_dgx_donate_donor_province', true ); | |
- $country_code = get_post_meta( $donationID, '_dgx_donate_donor_country', true ); | |
- | |
- if ( empty( $country_code ) ) { /* older versions only did US */ | |
- $country_code = 'US'; | |
- update_post_meta( $donationID, '_dgx_donate_donor_country', 'US' ); | |
- } | |
- | |
- if ( 'US' == $country_code ) { | |
- $state_or_prov = $state; | |
- } else if ( 'CA' == $country_code ) { | |
- $state_or_prov = $province; | |
- } else { | |
- $state_or_prov = ''; | |
- } | |
- | |
- $country = $countries[$country_code]; | |
- | |
- $zip = get_post_meta( $donationID, '_dgx_donate_donor_zip', true ); | |
- $addToMailingList = get_post_meta( $donationID, '_dgx_donate_add_to_mailing_list', true ); | |
- if ( strcasecmp( $addToMailingList, 'on' ) == 0 ) | |
- { | |
- $addToMailingList = "Yes"; | |
- } | |
- else | |
- { | |
- $addToMailingList = "No"; | |
- } | |
- | |
- $employer = get_post_meta( $donationID, '_dgx_donate_employer_name', true ); | |
- $occupation = get_post_meta( $donationID, '_dgx_donate_occupation', true ); | |
- | |
- echo "\"$donationDate\",\"$time\",\"$firstName\",\"$lastName\",\"$formatted_amount\",\"$currency_code\",\"$repeating\","; | |
- echo "\"$designatedFundName\",\"$gift_item_title\",\"$phone\",\"$email\",\"$address\",\"$address2\","; | |
- echo "\"$city\",\"$state_or_prov\",\"$zip\",\"$country\",\"$employer\",\"$occupation\","; | |
- echo "\"$addToMailingList\"\n"; | |
- } | |
- } | |
- | |
- if ( $firstOne ) // We never got any data | |
- { | |
- header( "Content-Type: text/html" ); | |
- echo "<html>\n"; | |
- echo "<head>\n"; | |
- echo "<title>Error</title>\n"; | |
- echo "</head>\n"; | |
- echo "<body>\n"; | |
- echo "<h1>Error</h1>\n"; | |
- echo "<p>No data was found for that date range ($startDate - $endDate). Please try a wider date range.</p>"; | |
- echo "</body>\n"; | |
- echo "</html>\n"; | |
- } | |
-} | |
+<?php | |
+ | |
+/* Copyright 2013 Allen Snook (email: [email protected]) */ | |
+ | |
+include( '../../../../wp-config.php' ); | |
+ | |
+if ( ! current_user_can( 'manage_options' ) ) { | |
+ | |
+ header( "Content-Type: text/html" ); | |
+ echo "<html>\n"; | |
+ echo "<head>\n"; | |
+ echo "<title>Unauthorized</title>\n"; | |
+ echo "</head>\n"; | |
+ echo "<body>\n"; | |
+ echo "<h1>Unauthorized</h1>\n"; | |
+ echo "<p>You do not have permission to access this page. Did you forget to log in?</p>"; | |
+ echo "</body>\n"; | |
+ echo "</html>\n"; | |
+} | |
+else | |
+{ | |
+ $startDate = $_POST['startdate']; | |
+ $endDate = $_POST['enddate']; | |
+ | |
+ $startTimeStamp = strtotime( $startDate ); | |
+ $endTimeStamp = strtotime( $endDate ); | |
+ $countries = dgx_donate_get_countries(); | |
+ | |
+ $firstOne = true; | |
+ $post_type = 'dgx-donation'; | |
+ | |
+ $args = array( | |
+ 'numberposts' => '-1', | |
+ 'post_type' => $post_type, | |
+ 'orderby' => 'post_date', | |
+ 'order' => 'DESC' | |
+ ); | |
+ | |
+ $myDonations = get_posts( $args ); | |
+ | |
+ foreach ( (array) $myDonations as $myDonation ) | |
+ { | |
+ $donationID = $myDonation->ID; | |
+ | |
+ // Make sure this donation's date falls in the range | |
+ $okToAdd = true; | |
+ $year = get_post_meta( $donationID, '_dgx_donate_year', true ); | |
+ $month = get_post_meta( $donationID, '_dgx_donate_month', true ); | |
+ $day = get_post_meta( $donationID, '_dgx_donate_day', true ); | |
+ $donationDate = $month . "/" . $day . "/" . $year; | |
+ $donationTimeStamp = strtotime( $donationDate ); | |
+ | |
+ if ( $donationTimeStamp < $startTimeStamp ) | |
+ { | |
+ $okToAdd = false; | |
+ } | |
+ | |
+ if ( $donationTimeStamp > $endTimeStamp ) | |
+ { | |
+ $okToAdd = false; | |
+ } | |
+ | |
+ if ( $okToAdd ) | |
+ { | |
+ // Order in CSV | |
+ // Date (MM/DD/YYYY), Time (HH:MM:SS A), First Name, Last Name, Amount, Repeating (YES/NO), | |
+ // Designated Fund, Gift Item, Donor Phone, Donor Email, Donor Address, Donor Address2, | |
+ // Donor City, Donor State, Donor Zip, OK to Add to Mailing List (YES/NO) | |
+ | |
+ if ( $firstOne ) | |
+ { | |
+ header( "Content-type: text/csv" ); | |
+ header( "Content-Disposition: attachment; filename=export.csv" ); | |
+ | |
+ echo "\"Date\",\"Time\",\"First Name\",\"Last Name\",\"Amount\",\"Currency\",\"Repeating\","; | |
+ echo "\"Designated Fund\",\"Gift Item\",\"Phone\",\"Email\",\"Address\",\"Address 2\","; | |
+ echo "\"City\",\"State/Prov\",\"Postal Code\",\"Country\",\"Employer\",\"Occupation\","; | |
+ echo "\"OK to Add to Mailing List\"\n"; | |
+ | |
+ $firstOne = false; | |
+ } | |
+ | |
+ $time = get_post_meta( $donationID, '_dgx_donate_time', true ); | |
+ $firstName = get_post_meta( $donationID, '_dgx_donate_donor_first_name', true ); | |
+ $lastName = get_post_meta( $donationID, '_dgx_donate_donor_last_name', true ); | |
+ $amount = get_post_meta( $donationID, '_dgx_donate_amount', true ); | |
+ | |
+ $currency_code = dgx_donate_get_donation_currency_code( $donationID ); | |
+ $formatted_amount = dgx_donate_get_plain_formatted_amount( $amount, 2, $currency_code, false ); | |
+ $repeating = get_post_meta( $donationID, '_dgx_donate_repeating', true ); | |
+ if ( empty( $repeating ) ) | |
+ { | |
+ $repeating = "No"; | |
+ } | |
+ else | |
+ { | |
+ $repeating = "Yes"; | |
+ } | |
+ $designatedFundName = "Undesignated"; | |
+ $designated = get_post_meta( $donationID, '_dgx_donate_designated', true ); | |
+ if ( ! empty( $designated ) ) | |
+ { | |
+ $designatedFundName = get_post_meta( $donationID, '_dgx_donate_designated_fund', true ); | |
+ } | |
+ $gift_item_id = get_post_meta( $donationID, '_dgx_donate_gift_item_id', true ); | |
+ $gift_item_title = ""; | |
+ if ( !empty( $gift_item_id ) ) { | |
+ $gift_item_title = get_the_title( $gift_item_id ); | |
+ } | |
+ $phone = get_post_meta( $donationID, '_dgx_donate_donor_phone', true ); | |
+ $email = get_post_meta( $donationID, '_dgx_donate_donor_email', true ); | |
+ $address = get_post_meta( $donationID, '_dgx_donate_donor_address', true ); | |
+ $address2 = get_post_meta( $donationID, '_dgx_donate_donor_address2', true ); | |
+ $city = get_post_meta( $donationID, '_dgx_donate_donor_city', true ); | |
+ $state = get_post_meta( $donationID, '_dgx_donate_donor_state', true ); | |
+ $province = get_post_meta( $donationID, '_dgx_donate_donor_province', true ); | |
+ $country_code = get_post_meta( $donationID, '_dgx_donate_donor_country', true ); | |
+ | |
+ if ( empty( $country_code ) ) { /* older versions only did US */ | |
+ $country_code = 'US'; | |
+ update_post_meta( $donationID, '_dgx_donate_donor_country', 'US' ); | |
+ } | |
+ | |
+ if ( 'US' == $country_code ) { | |
+ $state_or_prov = $state; | |
+ } else if ( 'CA' == $country_code ) { | |
+ $state_or_prov = $province; | |
+ } else { | |
+ $state_or_prov = ''; | |
+ } | |
+ | |
+ $country = $countries[$country_code]; | |
+ | |
+ $zip = get_post_meta( $donationID, '_dgx_donate_donor_zip', true ); | |
+ $addToMailingList = get_post_meta( $donationID, '_dgx_donate_add_to_mailing_list', true ); | |
+ if ( strcasecmp( $addToMailingList, 'on' ) == 0 ) | |
+ { | |
+ $addToMailingList = "Yes"; | |
+ } | |
+ else | |
+ { | |
+ $addToMailingList = "No"; | |
+ } | |
+ | |
+ $employer = get_post_meta( $donationID, '_dgx_donate_employer_name', true ); | |
+ $occupation = get_post_meta( $donationID, '_dgx_donate_occupation', true ); | |
+ | |
+ echo "\"$donationDate\",\"$time\",\"$firstName\",\"$lastName\",\"$formatted_amount\",\"$currency_code\",\"$repeating\","; | |
+ echo "\"$designatedFundName\",\"$gift_item_title\",\"$phone\",\"$email\",\"$address\",\"$address2\","; | |
+ echo "\"$city\",\"$state_or_prov\",\"$zip\",\"$country\",\"$employer\",\"$occupation\","; | |
+ echo "\"$addToMailingList\"\n"; | |
+ } | |
+ } | |
+ | |
+ if ( $firstOne ) // We never got any data | |
+ { | |
+ header( "Content-Type: text/html" ); | |
+ echo "<html>\n"; | |
+ echo "<head>\n"; | |
+ echo "<title>Error</title>\n"; | |
+ echo "</head>\n"; | |
+ echo "<body>\n"; | |
+ echo "<h1>Error</h1>\n"; | |
+ echo "<p>No data was found for that date range ($startDate - $endDate). Please try a wider date range.</p>"; | |
+ echo "</body>\n"; | |
+ echo "</html>\n"; | |
+ } | |
+} | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_PostType/view/AdminPageFramework_PageLoadInfo_PostType.php ./seamless-donations/library/apf/factory/AdminPageFramework_PostType/view/AdminPageFramework_PageLoadInfo_PostType.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_PostType/view/AdminPageFramework_PageLoadInfo_PostType.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_PostType/view/AdminPageFramework_PageLoadInfo_PostType.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,25 +1,25 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_PageLoadInfo_PostType extends SeamlessDonationsAdminPageFramework_PageLoadInfo_Base { | |
- private static $_oInstance; | |
- private static $aClassNames = array(); | |
- public static function instantiate($oProp, $oMsg) { | |
- if (in_array($oProp->sClassName, self::$aClassNames)) return self::$_oInstance; | |
- self::$aClassNames[] = $oProp->sClassName; | |
- self::$_oInstance = new SeamlessDonationsAdminPageFramework_PageLoadInfo_PostType($oProp, $oMsg); | |
- return self::$_oInstance; | |
- } | |
- public function _replyToSetPageLoadInfoInFooter() { | |
- if (isset($_GET['page']) && $_GET['page']) { | |
- return; | |
- } | |
- if (SeamlessDonationsAdminPageFramework_WPUtility::getCurrentPostType() == $this->oProp->sPostType || SeamlessDonationsAdminPageFramework_WPUtility::isPostDefinitionPage($this->oProp->sPostType) || SeamlessDonationsAdminPageFramework_WPUtility::isCustomTaxonomyPage($this->oProp->sPostType)) { | |
- add_filter('update_footer', array($this, '_replyToGetPageLoadInfo'), 999); | |
- } | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_PageLoadInfo_PostType extends SeamlessDonationsAdminPageFramework_PageLoadInfo_Base { | |
+ private static $_oInstance; | |
+ private static $aClassNames = array(); | |
+ public static function instantiate($oProp, $oMsg) { | |
+ if (in_array($oProp->sClassName, self::$aClassNames)) return self::$_oInstance; | |
+ self::$aClassNames[] = $oProp->sClassName; | |
+ self::$_oInstance = new SeamlessDonationsAdminPageFramework_PageLoadInfo_PostType($oProp, $oMsg); | |
+ return self::$_oInstance; | |
+ } | |
+ public function _replyToSetPageLoadInfoInFooter() { | |
+ if (isset($_GET['page']) && $_GET['page']) { | |
+ return; | |
+ } | |
+ if (SeamlessDonationsAdminPageFramework_WPUtility::getCurrentPostType() == $this->oProp->sPostType || SeamlessDonationsAdminPageFramework_WPUtility::isPostDefinitionPage($this->oProp->sPostType) || SeamlessDonationsAdminPageFramework_WPUtility::isCustomTaxonomyPage($this->oProp->sPostType)) { | |
+ add_filter('update_footer', array($this, '_replyToGetPageLoadInfo'), 999); | |
+ } | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Controller.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Controller.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Controller.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Controller.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,11 +1,11 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_Controller extends SeamlessDonationsAdminPageFramework_TaxonomyField_View { | |
- public function setUp() { | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_Controller extends SeamlessDonationsAdminPageFramework_TaxonomyField_View { | |
+ public function setUp() { | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Model.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Model.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Model.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Model.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,61 +1,61 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_Model extends SeamlessDonationsAdminPageFramework_TaxonomyField_Router { | |
- public function validate($aInput, $aOldInput, $oFactory) { | |
- return $aInput; | |
- } | |
- public function _replyToManageColumns($aColumns) { | |
- return $this->_getFilteredColumnsByFilterPrefix($this->oUtil->getAsArray($aColumns), 'columns_', isset($_GET['taxonomy']) ? $_GET['taxonomy'] : ''); | |
- } | |
- public function _replyToSetSortableColumns($aSortableColumns) { | |
- return $this->_getFilteredColumnsByFilterPrefix($this->oUtil->getAsArray($aSortableColumns), 'sortable_columns_', isset($_GET['taxonomy']) ? $_GET['taxonomy'] : ''); | |
- } | |
- private function _getFilteredColumnsByFilterPrefix(array $aColumns, $sFilterPrefix, $sTaxonomy) { | |
- if ($sTaxonomy) { | |
- $aColumns = $this->oUtil->addAndApplyFilter($this, "{$sFilterPrefix}{$_GET['taxonomy']}", $aColumns); | |
- } | |
- return $this->oUtil->addAndApplyFilter($this, "{$sFilterPrefix}{$this->oProp->sClassName}", $aColumns); | |
- } | |
- public function _replyToRegisterFormElements($oScreen) { | |
- $this->_loadFieldTypeDefinitions(); | |
- $this->oForm->format(); | |
- $this->oForm->applyConditions(); | |
- $this->_registerFields($this->oForm->aConditionedFields); | |
- } | |
- protected function _setOptionArray($iTermID = null, $sOptionKey) { | |
- $aOptions = get_option($sOptionKey, array()); | |
- $this->oProp->aOptions = isset($iTermID, $aOptions[$iTermID]) ? $aOptions[$iTermID] : array(); | |
- } | |
- public function _replyToValidateOptions($iTermID) { | |
- if (!$this->_verifyFormSubmit()) { | |
- return; | |
- } | |
- $aTaxonomyFieldOptions = get_option($this->oProp->sOptionKey, array()); | |
- $_aOldOptions = $this->oUtil->getElementAsArray($aTaxonomyFieldOptions, $iTermID, array()); | |
- $_aSubmittedOptions = array(); | |
- foreach ($this->oForm->aFields as $_sSectionID => $_aFields) { | |
- foreach ($_aFields as $_sFieldID => $_aField) { | |
- if (isset($_POST[$_sFieldID])) { | |
- $_aSubmittedOptions[$_sFieldID] = $_POST[$_sFieldID]; | |
- } | |
- } | |
- } | |
- $_aSubmittedOptions = $this->oUtil->addAndApplyFilters($this, 'validation_' . $this->oProp->sClassName, $_aSubmittedOptions, $_aOldOptions, $this); | |
- $aTaxonomyFieldOptions[$iTermID] = $this->oUtil->uniteArrays($_aSubmittedOptions, $_aOldOptions); | |
- update_option($this->oProp->sOptionKey, $aTaxonomyFieldOptions); | |
- } | |
- private function _verifyFormSubmit() { | |
- if (!isset($_POST[$this->oProp->sClassHash])) { | |
- return false; | |
- } | |
- if (!wp_verify_nonce($_POST[$this->oProp->sClassHash], $this->oProp->sClassHash)) { | |
- return false; | |
- } | |
- return true; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_Model extends SeamlessDonationsAdminPageFramework_TaxonomyField_Router { | |
+ public function validate($aInput, $aOldInput, $oFactory) { | |
+ return $aInput; | |
+ } | |
+ public function _replyToManageColumns($aColumns) { | |
+ return $this->_getFilteredColumnsByFilterPrefix($this->oUtil->getAsArray($aColumns), 'columns_', isset($_GET['taxonomy']) ? $_GET['taxonomy'] : ''); | |
+ } | |
+ public function _replyToSetSortableColumns($aSortableColumns) { | |
+ return $this->_getFilteredColumnsByFilterPrefix($this->oUtil->getAsArray($aSortableColumns), 'sortable_columns_', isset($_GET['taxonomy']) ? $_GET['taxonomy'] : ''); | |
+ } | |
+ private function _getFilteredColumnsByFilterPrefix(array $aColumns, $sFilterPrefix, $sTaxonomy) { | |
+ if ($sTaxonomy) { | |
+ $aColumns = $this->oUtil->addAndApplyFilter($this, "{$sFilterPrefix}{$_GET['taxonomy']}", $aColumns); | |
+ } | |
+ return $this->oUtil->addAndApplyFilter($this, "{$sFilterPrefix}{$this->oProp->sClassName}", $aColumns); | |
+ } | |
+ public function _replyToRegisterFormElements($oScreen) { | |
+ $this->_loadFieldTypeDefinitions(); | |
+ $this->oForm->format(); | |
+ $this->oForm->applyConditions(); | |
+ $this->_registerFields($this->oForm->aConditionedFields); | |
+ } | |
+ protected function _setOptionArray($iTermID = null, $sOptionKey) { | |
+ $aOptions = get_option($sOptionKey, array()); | |
+ $this->oProp->aOptions = isset($iTermID, $aOptions[$iTermID]) ? $aOptions[$iTermID] : array(); | |
+ } | |
+ public function _replyToValidateOptions($iTermID) { | |
+ if (!$this->_verifyFormSubmit()) { | |
+ return; | |
+ } | |
+ $aTaxonomyFieldOptions = get_option($this->oProp->sOptionKey, array()); | |
+ $_aOldOptions = $this->oUtil->getElementAsArray($aTaxonomyFieldOptions, $iTermID, array()); | |
+ $_aSubmittedOptions = array(); | |
+ foreach ($this->oForm->aFields as $_sSectionID => $_aFields) { | |
+ foreach ($_aFields as $_sFieldID => $_aField) { | |
+ if (isset($_POST[$_sFieldID])) { | |
+ $_aSubmittedOptions[$_sFieldID] = $_POST[$_sFieldID]; | |
+ } | |
+ } | |
+ } | |
+ $_aSubmittedOptions = $this->oUtil->addAndApplyFilters($this, 'validation_' . $this->oProp->sClassName, $_aSubmittedOptions, $_aOldOptions, $this); | |
+ $aTaxonomyFieldOptions[$iTermID] = $this->oUtil->uniteArrays($_aSubmittedOptions, $_aOldOptions); | |
+ update_option($this->oProp->sOptionKey, $aTaxonomyFieldOptions); | |
+ } | |
+ private function _verifyFormSubmit() { | |
+ if (!isset($_POST[$this->oProp->sClassHash])) { | |
+ return false; | |
+ } | |
+ if (!wp_verify_nonce($_POST[$this->oProp->sClassHash], $this->oProp->sClassHash)) { | |
+ return false; | |
+ } | |
+ return true; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,20 +1,20 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_TaxonomyField extends SeamlessDonationsAdminPageFramework_TaxonomyField_Controller { | |
- static protected $_sFieldsType = 'taxonomy'; | |
- function __construct($asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework') { | |
- if (empty($asTaxonomySlug)) { | |
- return; | |
- } | |
- $this->oProp = new SeamlessDonationsAdminPageFramework_Property_TaxonomyField($this, get_class($this), $sCapability, $sTextDomain, self::$_sFieldsType); | |
- $this->oProp->aTaxonomySlugs = ( array )$asTaxonomySlug; | |
- $this->oProp->sOptionKey = $sOptionKey ? $sOptionKey : $this->oProp->sClassName; | |
- parent::__construct($this->oProp); | |
- $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}"); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_TaxonomyField extends SeamlessDonationsAdminPageFramework_TaxonomyField_Controller { | |
+ static protected $_sFieldsType = 'taxonomy'; | |
+ function __construct($asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework') { | |
+ if (empty($asTaxonomySlug)) { | |
+ return; | |
+ } | |
+ $this->oProp = new SeamlessDonationsAdminPageFramework_Property_TaxonomyField($this, get_class($this), $sCapability, $sTextDomain, self::$_sFieldsType); | |
+ $this->oProp->aTaxonomySlugs = ( array )$asTaxonomySlug; | |
+ $this->oProp->sOptionKey = $sOptionKey ? $sOptionKey : $this->oProp->sClassName; | |
+ parent::__construct($this->oProp); | |
+ $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}"); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Router.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Router.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Router.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_Router.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,45 +1,45 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_Router extends SeamlessDonationsAdminPageFramework_Factory { | |
- public function __construct($oProp) { | |
- parent::__construct($oProp); | |
- if ($this->oProp->bIsAdmin) { | |
- add_action('wp_loaded', array($this, '_replyToDetermineToLoad')); | |
- } | |
- } | |
- public function _isInThePage() { | |
- if ('admin-ajax.php' == $this->oProp->sPageNow) { | |
- return true; | |
- } | |
- if ('edit-tags.php' != $this->oProp->sPageNow) { | |
- return false; | |
- } | |
- if (isset($_GET['taxonomy']) && !in_array($_GET['taxonomy'], $this->oProp->aTaxonomySlugs)) { | |
- return false; | |
- } | |
- return true; | |
- } | |
- public function _replyToDetermineToLoad($oScreen) { | |
- if (!$this->_isInThePage()) { | |
- return; | |
- } | |
- $this->_setUp(); | |
- $this->oUtil->addAndDoAction($this, "set_up_{$this->oProp->sClassName}", $this); | |
- $this->oProp->_bSetupLoaded = true; | |
- add_action('current_screen', array($this, '_replyToRegisterFormElements'), 20); | |
- foreach ($this->oProp->aTaxonomySlugs as $__sTaxonomySlug) { | |
- add_action("created_{$__sTaxonomySlug}", array($this, '_replyToValidateOptions'), 10, 2); | |
- add_action("edited_{$__sTaxonomySlug}", array($this, '_replyToValidateOptions'), 10, 2); | |
- add_action("{$__sTaxonomySlug}_add_form_fields", array($this, '_replyToPrintFieldsWOTableRows')); | |
- add_action("{$__sTaxonomySlug}_edit_form_fields", array($this, '_replyToPrintFieldsWithTableRows')); | |
- add_filter("manage_edit-{$__sTaxonomySlug}_columns", array($this, '_replyToManageColumns'), 10, 1); | |
- add_filter("manage_edit-{$__sTaxonomySlug}_sortable_columns", array($this, '_replyToSetSortableColumns')); | |
- add_action("manage_{$__sTaxonomySlug}_custom_column", array($this, '_replyToPrintColumnCell'), 10, 3); | |
- } | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_Router extends SeamlessDonationsAdminPageFramework_Factory { | |
+ public function __construct($oProp) { | |
+ parent::__construct($oProp); | |
+ if ($this->oProp->bIsAdmin) { | |
+ add_action('wp_loaded', array($this, '_replyToDetermineToLoad')); | |
+ } | |
+ } | |
+ public function _isInThePage() { | |
+ if ('admin-ajax.php' == $this->oProp->sPageNow) { | |
+ return true; | |
+ } | |
+ if ('edit-tags.php' != $this->oProp->sPageNow) { | |
+ return false; | |
+ } | |
+ if (isset($_GET['taxonomy']) && !in_array($_GET['taxonomy'], $this->oProp->aTaxonomySlugs)) { | |
+ return false; | |
+ } | |
+ return true; | |
+ } | |
+ public function _replyToDetermineToLoad($oScreen) { | |
+ if (!$this->_isInThePage()) { | |
+ return; | |
+ } | |
+ $this->_setUp(); | |
+ $this->oUtil->addAndDoAction($this, "set_up_{$this->oProp->sClassName}", $this); | |
+ $this->oProp->_bSetupLoaded = true; | |
+ add_action('current_screen', array($this, '_replyToRegisterFormElements'), 20); | |
+ foreach ($this->oProp->aTaxonomySlugs as $__sTaxonomySlug) { | |
+ add_action("created_{$__sTaxonomySlug}", array($this, '_replyToValidateOptions'), 10, 2); | |
+ add_action("edited_{$__sTaxonomySlug}", array($this, '_replyToValidateOptions'), 10, 2); | |
+ add_action("{$__sTaxonomySlug}_add_form_fields", array($this, '_replyToPrintFieldsWOTableRows')); | |
+ add_action("{$__sTaxonomySlug}_edit_form_fields", array($this, '_replyToPrintFieldsWithTableRows')); | |
+ add_filter("manage_edit-{$__sTaxonomySlug}_columns", array($this, '_replyToManageColumns'), 10, 1); | |
+ add_filter("manage_edit-{$__sTaxonomySlug}_sortable_columns", array($this, '_replyToSetSortableColumns')); | |
+ add_action("manage_{$__sTaxonomySlug}_custom_column", array($this, '_replyToPrintColumnCell'), 10, 3); | |
+ } | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_View.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_View.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_View.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/AdminPageFramework_TaxonomyField_View.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,35 +1,35 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_View extends SeamlessDonationsAdminPageFramework_TaxonomyField_Model { | |
- public function _replyToPrintFieldsWOTableRows($oTerm) { | |
- echo $this->_getFieldsOutput(isset($oTerm->term_id) ? $oTerm->term_id : null, false); | |
- } | |
- public function _replyToPrintFieldsWithTableRows($oTerm) { | |
- echo $this->_getFieldsOutput(isset($oTerm->term_id) ? $oTerm->term_id : null, true); | |
- } | |
- private function _getFieldsOutput($iTermID, $bRenderTableRow) { | |
- $_aOutput = array(); | |
- $_aOutput[] = wp_nonce_field($this->oProp->sClassHash, $this->oProp->sClassHash, true, false); | |
- $this->_setOptionArray($iTermID, $this->oProp->sOptionKey); | |
- $this->oForm->format(); | |
- $_oFieldsTable = new SeamlessDonationsAdminPageFramework_FormTable($this->oProp->aFieldTypeDefinitions, $this->_getFieldErrors(), $this->oMsg); | |
- $_aOutput[] = $bRenderTableRow ? $_oFieldsTable->getFieldRows($this->oForm->aFields['_default'], array($this, '_replyToGetFieldOutput')) : $_oFieldsTable->getFields($this->oForm->aFields['_default'], array($this, '_replyToGetFieldOutput')); | |
- $_sOutput = $this->oUtil->addAndApplyFilters($this, 'content_' . $this->oProp->sClassName, implode(PHP_EOL, $_aOutput)); | |
- $this->oUtil->addAndDoActions($this, 'do_' . $this->oProp->sClassName, $this); | |
- return $_sOutput; | |
- } | |
- public function _replyToPrintColumnCell($vValue, $sColumnSlug, $sTermID) { | |
- $_sCellHTML = ''; | |
- if (isset($_GET['taxonomy']) && $_GET['taxonomy']) { | |
- $_sCellHTML = $this->oUtil->addAndApplyFilter($this, "cell_{$_GET['taxonomy']}", $vValue, $sColumnSlug, $sTermID); | |
- } | |
- $_sCellHTML = $this->oUtil->addAndApplyFilter($this, "cell_{$this->oProp->sClassName}", $_sCellHTML, $sColumnSlug, $sTermID); | |
- $_sCellHTML = $this->oUtil->addAndApplyFilter($this, "cell_{$this->oProp->sClassName}_{$sColumnSlug}", $_sCellHTML, $sTermID); | |
- echo $_sCellHTML; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_TaxonomyField_View extends SeamlessDonationsAdminPageFramework_TaxonomyField_Model { | |
+ public function _replyToPrintFieldsWOTableRows($oTerm) { | |
+ echo $this->_getFieldsOutput(isset($oTerm->term_id) ? $oTerm->term_id : null, false); | |
+ } | |
+ public function _replyToPrintFieldsWithTableRows($oTerm) { | |
+ echo $this->_getFieldsOutput(isset($oTerm->term_id) ? $oTerm->term_id : null, true); | |
+ } | |
+ private function _getFieldsOutput($iTermID, $bRenderTableRow) { | |
+ $_aOutput = array(); | |
+ $_aOutput[] = wp_nonce_field($this->oProp->sClassHash, $this->oProp->sClassHash, true, false); | |
+ $this->_setOptionArray($iTermID, $this->oProp->sOptionKey); | |
+ $this->oForm->format(); | |
+ $_oFieldsTable = new SeamlessDonationsAdminPageFramework_FormTable($this->oProp->aFieldTypeDefinitions, $this->_getFieldErrors(), $this->oMsg); | |
+ $_aOutput[] = $bRenderTableRow ? $_oFieldsTable->getFieldRows($this->oForm->aFields['_default'], array($this, '_replyToGetFieldOutput')) : $_oFieldsTable->getFields($this->oForm->aFields['_default'], array($this, '_replyToGetFieldOutput')); | |
+ $_sOutput = $this->oUtil->addAndApplyFilters($this, 'content_' . $this->oProp->sClassName, implode(PHP_EOL, $_aOutput)); | |
+ $this->oUtil->addAndDoActions($this, 'do_' . $this->oProp->sClassName, $this); | |
+ return $_sOutput; | |
+ } | |
+ public function _replyToPrintColumnCell($vValue, $sColumnSlug, $sTermID) { | |
+ $_sCellHTML = ''; | |
+ if (isset($_GET['taxonomy']) && $_GET['taxonomy']) { | |
+ $_sCellHTML = $this->oUtil->addAndApplyFilter($this, "cell_{$_GET['taxonomy']}", $vValue, $sColumnSlug, $sTermID); | |
+ } | |
+ $_sCellHTML = $this->oUtil->addAndApplyFilter($this, "cell_{$this->oProp->sClassName}", $_sCellHTML, $sColumnSlug, $sTermID); | |
+ $_sCellHTML = $this->oUtil->addAndApplyFilter($this, "cell_{$this->oProp->sClassName}_{$sColumnSlug}", $_sCellHTML, $sTermID); | |
+ echo $_sCellHTML; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_HelpPane_TaxonomyField.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_HelpPane_TaxonomyField.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_HelpPane_TaxonomyField.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_HelpPane_TaxonomyField.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,12 +1,12 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_HelpPane_TaxonomyField extends SeamlessDonationsAdminPageFramework_HelpPane_MetaBox { | |
- public function _replyToRegisterHelpTabTextForMetaBox() { | |
- $this->_setHelpTab($this->oProp->sMetaBoxID, $this->oProp->sTitle, $this->oProp->aHelpTabText, $this->oProp->aHelpTabTextSide); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_HelpPane_TaxonomyField extends SeamlessDonationsAdminPageFramework_HelpPane_MetaBox { | |
+ public function _replyToRegisterHelpTabTextForMetaBox() { | |
+ $this->_setHelpTab($this->oProp->sMetaBoxID, $this->oProp->sTitle, $this->oProp->aHelpTabText, $this->oProp->aHelpTabTextSide); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_Resource_TaxonomyField.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_Resource_TaxonomyField.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_Resource_TaxonomyField.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/controller/AdminPageFramework_Resource_TaxonomyField.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,60 +1,60 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Resource_TaxonomyField extends SeamlessDonationsAdminPageFramework_Resource_MetaBox { | |
- public function _enqueueStyles($aSRCs, $aCustomArgs = array(), $_deprecated = null) { | |
- $_aHandleIDs = array(); | |
- foreach (( array )$aSRCs as $_sSRC) { | |
- $_aHandleIDs[] = $this->_enqueueStyle($_sSRC, $aCustomArgs); | |
- } | |
- return $_aHandleIDs; | |
- } | |
- public function _enqueueStyle($sSRC, $aCustomArgs = array(), $_deprecated = null) { | |
- $sSRC = trim($sSRC); | |
- if (empty($sSRC)) { | |
- return ''; | |
- } | |
- $sSRC = $this->oUtil->resolveSRC($sSRC); | |
- $_sSRCHash = md5($sSRC); | |
- if (isset($this->oProp->aEnqueuingStyles[$_sSRCHash])) { | |
- return ''; | |
- } | |
- $this->oProp->aEnqueuingStyles[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'style', 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedStyleIndex),), self::$_aStructure_EnqueuingResources); | |
- $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingStyles[$_sSRCHash]['attributes']; | |
- return $this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']; | |
- } | |
- public function _enqueueScripts($aSRCs, $aCustomArgs = array(), $_deprecated = null) { | |
- $_aHandleIDs = array(); | |
- foreach (( array )$aSRCs as $_sSRC) { | |
- $_aHandleIDs[] = $this->_enqueueScript($_sSRC, $aCustomArgs); | |
- } | |
- return $_aHandleIDs; | |
- } | |
- public function _enqueueScript($sSRC, $aCustomArgs = array(), $_deprecated = null) { | |
- $sSRC = trim($sSRC); | |
- if (empty($sSRC)) { | |
- return ''; | |
- } | |
- $sSRC = $this->oUtil->resolveSRC($sSRC); | |
- $_sSRCHash = md5($sSRC); | |
- if (isset($this->oProp->aEnqueuingScripts[$_sSRCHash])) { | |
- return ''; | |
- } | |
- $this->oProp->aEnqueuingScripts[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'script', 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedScriptIndex),), self::$_aStructure_EnqueuingResources); | |
- $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingScripts[$_sSRCHash]['attributes']; | |
- return $this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']; | |
- } | |
- public function _forceToEnqueueStyle($sSRC, $aCustomArgs = array()) { | |
- return $this->_enqueueStyle($sSRC, $aCustomArgs); | |
- } | |
- public function _forceToEnqueueScript($sSRC, $aCustomArgs = array()) { | |
- return $this->_enqueueScript($sSRC, $aCustomArgs); | |
- } | |
- protected function _enqueueSRCByConditoin($aEnqueueItem) { | |
- return $this->_enqueueSRC($aEnqueueItem); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Resource_TaxonomyField extends SeamlessDonationsAdminPageFramework_Resource_MetaBox { | |
+ public function _enqueueStyles($aSRCs, $aCustomArgs = array(), $_deprecated = null) { | |
+ $_aHandleIDs = array(); | |
+ foreach (( array )$aSRCs as $_sSRC) { | |
+ $_aHandleIDs[] = $this->_enqueueStyle($_sSRC, $aCustomArgs); | |
+ } | |
+ return $_aHandleIDs; | |
+ } | |
+ public function _enqueueStyle($sSRC, $aCustomArgs = array(), $_deprecated = null) { | |
+ $sSRC = trim($sSRC); | |
+ if (empty($sSRC)) { | |
+ return ''; | |
+ } | |
+ $sSRC = $this->oUtil->resolveSRC($sSRC); | |
+ $_sSRCHash = md5($sSRC); | |
+ if (isset($this->oProp->aEnqueuingStyles[$_sSRCHash])) { | |
+ return ''; | |
+ } | |
+ $this->oProp->aEnqueuingStyles[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'style', 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedStyleIndex),), self::$_aStructure_EnqueuingResources); | |
+ $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingStyles[$_sSRCHash]['attributes']; | |
+ return $this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']; | |
+ } | |
+ public function _enqueueScripts($aSRCs, $aCustomArgs = array(), $_deprecated = null) { | |
+ $_aHandleIDs = array(); | |
+ foreach (( array )$aSRCs as $_sSRC) { | |
+ $_aHandleIDs[] = $this->_enqueueScript($_sSRC, $aCustomArgs); | |
+ } | |
+ return $_aHandleIDs; | |
+ } | |
+ public function _enqueueScript($sSRC, $aCustomArgs = array(), $_deprecated = null) { | |
+ $sSRC = trim($sSRC); | |
+ if (empty($sSRC)) { | |
+ return ''; | |
+ } | |
+ $sSRC = $this->oUtil->resolveSRC($sSRC); | |
+ $_sSRCHash = md5($sSRC); | |
+ if (isset($this->oProp->aEnqueuingScripts[$_sSRCHash])) { | |
+ return ''; | |
+ } | |
+ $this->oProp->aEnqueuingScripts[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'script', 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedScriptIndex),), self::$_aStructure_EnqueuingResources); | |
+ $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingScripts[$_sSRCHash]['attributes']; | |
+ return $this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']; | |
+ } | |
+ public function _forceToEnqueueStyle($sSRC, $aCustomArgs = array()) { | |
+ return $this->_enqueueStyle($sSRC, $aCustomArgs); | |
+ } | |
+ public function _forceToEnqueueScript($sSRC, $aCustomArgs = array()) { | |
+ return $this->_enqueueScript($sSRC, $aCustomArgs); | |
+ } | |
+ protected function _enqueueSRCByConditoin($aEnqueueItem) { | |
+ return $this->_enqueueSRC($aEnqueueItem); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/model/AdminPageFramework_Property_TaxonomyField.php ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/model/AdminPageFramework_Property_TaxonomyField.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/model/AdminPageFramework_Property_TaxonomyField.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_TaxonomyField/model/AdminPageFramework_Property_TaxonomyField.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,12 +1,12 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Property_TaxonomyField extends SeamlessDonationsAdminPageFramework_Property_MetaBox { | |
- public $_sPropertyType = 'taxonomy_field'; | |
- public $aTaxonomySlugs; | |
- public $sOptionKey; | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Property_TaxonomyField extends SeamlessDonationsAdminPageFramework_Property_MetaBox { | |
+ public $_sPropertyType = 'taxonomy_field'; | |
+ public $aTaxonomySlugs; | |
+ public $sOptionKey; | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Controller.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Controller.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Controller.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Controller.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,23 +1,23 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_UserMeta_Controller extends SeamlessDonationsAdminPageFramework_UserMeta_View { | |
- public function setUp() { | |
- } | |
- public function enqueueStyles($aSRCs, $aPostTypes = array(), $aCustomArgs = array()) { | |
- return $this->oResource->_enqueueStyles($aSRCs, $aPostTypes, $aCustomArgs); | |
- } | |
- public function enqueueStyle($sSRC, $aPostTypes = array(), $aCustomArgs = array()) { | |
- return $this->oResource->_enqueueStyle($sSRC, $aPostTypes, $aCustomArgs); | |
- } | |
- public function enqueueScripts($aSRCs, $aPostTypes = array(), $aCustomArgs = array()) { | |
- return $this->oResource->_enqueueScripts($aSRCs, $aPostTypes, $aCustomArgs); | |
- } | |
- public function enqueueScript($sSRC, $aPostTypes = array(), $aCustomArgs = array()) { | |
- return $this->oResource->_enqueueScript($sSRC, $aPostTypes, $aCustomArgs); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_UserMeta_Controller extends SeamlessDonationsAdminPageFramework_UserMeta_View { | |
+ public function setUp() { | |
+ } | |
+ public function enqueueStyles($aSRCs, $aPostTypes = array(), $aCustomArgs = array()) { | |
+ return $this->oResource->_enqueueStyles($aSRCs, $aPostTypes, $aCustomArgs); | |
+ } | |
+ public function enqueueStyle($sSRC, $aPostTypes = array(), $aCustomArgs = array()) { | |
+ return $this->oResource->_enqueueStyle($sSRC, $aPostTypes, $aCustomArgs); | |
+ } | |
+ public function enqueueScripts($aSRCs, $aPostTypes = array(), $aCustomArgs = array()) { | |
+ return $this->oResource->_enqueueScripts($aSRCs, $aPostTypes, $aCustomArgs); | |
+ } | |
+ public function enqueueScript($sSRC, $aPostTypes = array(), $aCustomArgs = array()) { | |
+ return $this->oResource->_enqueueScript($sSRC, $aPostTypes, $aCustomArgs); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Model.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Model.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Model.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Model.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,53 +1,53 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_UserMeta_Model extends SeamlessDonationsAdminPageFramework_UserMeta_Router { | |
- public function _replyToRegisterFormElements($oScreen) { | |
- $this->_loadFieldTypeDefinitions(); | |
- $this->oForm->format(); | |
- $this->oForm->applyConditions(); | |
- $this->_registerFields($this->oForm->aConditionedFields); | |
- } | |
- protected function _setOptionArray($iUserID) { | |
- if (!$iUserID) { | |
- return; | |
- } | |
- $_aOptions = array(); | |
- foreach ($this->oForm->aConditionedFields as $_sSectionID => $_aFields) { | |
- if ('_default' == $_sSectionID) { | |
- foreach ($_aFields as $_aField) { | |
- $_aOptions[$_aField['field_id']] = get_user_meta($iUserID, $_aField['field_id'], true); | |
- } | |
- } | |
- $_aOptions[$_sSectionID] = get_user_meta($iUserID, $_sSectionID, true); | |
- } | |
- $_aOptions = $this->oUtil->addAndApplyFilter($this, 'options_' . $this->oProp->sClassName, $_aOptions); | |
- $_aLastInput = isset($_GET['field_errors']) && $_GET['field_errors'] ? $this->oProp->aLastInput : array(); | |
- $_aOptions = $_aLastInput + $this->oUtil->getAsArray($_aOptions); | |
- $this->oProp->aOptions = $_aOptions; | |
- } | |
- public function _replyToSaveFieldValues($iUserID) { | |
- if (!current_user_can('edit_user', $iUserID)) { | |
- return; | |
- } | |
- $_aInput = $this->oForm->getUserSubmitDataFromPOST($this->oForm->aConditionedFields, $this->oForm->aConditionedSections); | |
- $_aInputRaw = $_aInput; | |
- $_aSavedMeta = $iUserID ? $this->_getSavedMetaArray($iUserID, array_keys($_aInput)) : array(); | |
- $_aInput = $this->oUtil->addAndApplyFilters($this, "validation_{$this->oProp->sClassName}", call_user_func_array(array($this, 'validate'), array($_aInput, $_aSavedMeta, $this)), $_aSavedMeta, $this); | |
- if ($this->hasFieldError()) { | |
- $this->_setLastInput($_aInputRaw); | |
- } | |
- $this->oForm->updateMetaDataByType($iUserID, $_aInput, $this->oForm->dropRepeatableElements($_aSavedMeta), $this->oForm->sFieldsType); | |
- } | |
- private function _getSavedMetaArray($iUserID, array $aKeys) { | |
- $_aSavedMeta = array(); | |
- foreach ($aKeys as $_sKey) { | |
- $_aSavedMeta[$_sKey] = get_post_meta($iUserID, $_sKey, true); | |
- } | |
- return $_aSavedMeta; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_UserMeta_Model extends SeamlessDonationsAdminPageFramework_UserMeta_Router { | |
+ public function _replyToRegisterFormElements($oScreen) { | |
+ $this->_loadFieldTypeDefinitions(); | |
+ $this->oForm->format(); | |
+ $this->oForm->applyConditions(); | |
+ $this->_registerFields($this->oForm->aConditionedFields); | |
+ } | |
+ protected function _setOptionArray($iUserID) { | |
+ if (!$iUserID) { | |
+ return; | |
+ } | |
+ $_aOptions = array(); | |
+ foreach ($this->oForm->aConditionedFields as $_sSectionID => $_aFields) { | |
+ if ('_default' == $_sSectionID) { | |
+ foreach ($_aFields as $_aField) { | |
+ $_aOptions[$_aField['field_id']] = get_user_meta($iUserID, $_aField['field_id'], true); | |
+ } | |
+ } | |
+ $_aOptions[$_sSectionID] = get_user_meta($iUserID, $_sSectionID, true); | |
+ } | |
+ $_aOptions = $this->oUtil->addAndApplyFilter($this, 'options_' . $this->oProp->sClassName, $_aOptions); | |
+ $_aLastInput = isset($_GET['field_errors']) && $_GET['field_errors'] ? $this->oProp->aLastInput : array(); | |
+ $_aOptions = $_aLastInput + $this->oUtil->getAsArray($_aOptions); | |
+ $this->oProp->aOptions = $_aOptions; | |
+ } | |
+ public function _replyToSaveFieldValues($iUserID) { | |
+ if (!current_user_can('edit_user', $iUserID)) { | |
+ return; | |
+ } | |
+ $_aInput = $this->oForm->getUserSubmitDataFromPOST($this->oForm->aConditionedFields, $this->oForm->aConditionedSections); | |
+ $_aInputRaw = $_aInput; | |
+ $_aSavedMeta = $iUserID ? $this->_getSavedMetaArray($iUserID, array_keys($_aInput)) : array(); | |
+ $_aInput = $this->oUtil->addAndApplyFilters($this, "validation_{$this->oProp->sClassName}", call_user_func_array(array($this, 'validate'), array($_aInput, $_aSavedMeta, $this)), $_aSavedMeta, $this); | |
+ if ($this->hasFieldError()) { | |
+ $this->_setLastInput($_aInputRaw); | |
+ } | |
+ $this->oForm->updateMetaDataByType($iUserID, $_aInput, $this->oForm->dropRepeatableElements($_aSavedMeta), $this->oForm->sFieldsType); | |
+ } | |
+ private function _getSavedMetaArray($iUserID, array $aKeys) { | |
+ $_aSavedMeta = array(); | |
+ foreach ($aKeys as $_sKey) { | |
+ $_aSavedMeta[$_sKey] = get_post_meta($iUserID, $_sKey, true); | |
+ } | |
+ return $_aSavedMeta; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,15 +1,15 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_UserMeta extends SeamlessDonationsAdminPageFramework_UserMeta_Controller { | |
- static protected $_sFieldsType = 'user_meta'; | |
- public function __construct($sCapability = 'edit_user', $sTextDomain = 'admin-page-framework') { | |
- $this->oProp = new SeamlessDonationsAdminPageFramework_Property_UserMeta($this, get_class($this), $sCapability, $sTextDomain, self::$_sFieldsType); | |
- parent::__construct($this->oProp); | |
- $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}"); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_UserMeta extends SeamlessDonationsAdminPageFramework_UserMeta_Controller { | |
+ static protected $_sFieldsType = 'user_meta'; | |
+ public function __construct($sCapability = 'edit_user', $sTextDomain = 'admin-page-framework') { | |
+ $this->oProp = new SeamlessDonationsAdminPageFramework_Property_UserMeta($this, get_class($this), $sCapability, $sTextDomain, self::$_sFieldsType); | |
+ parent::__construct($this->oProp); | |
+ $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}"); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Router.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Router.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Router.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_Router.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,36 +1,36 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_UserMeta_Router extends SeamlessDonationsAdminPageFramework_Factory { | |
- public function __construct($oProp) { | |
- parent::__construct($oProp); | |
- if ($this->oProp->bIsAdmin) { | |
- add_action('wp_loaded', array($this, '_replyToDetermineToLoad')); | |
- } | |
- } | |
- public function _isInThePage() { | |
- if (!$this->oProp->bIsAdmin) { | |
- return false; | |
- } | |
- return in_array($this->oProp->sPageNow, array('user-new.php', 'user-edit.php', 'profile.php')); | |
- } | |
- public function _replyToDetermineToLoad() { | |
- if (!$this->_isInThePage()) { | |
- return; | |
- } | |
- $this->_setUp(); | |
- $this->oUtil->addAndDoAction($this, "set_up_{$this->oProp->sClassName}", $this); | |
- $this->oProp->_bSetupLoaded = true; | |
- add_action('current_screen', array($this, '_replyToRegisterFormElements'), 20); | |
- add_action('show_user_profile', array($this, '_replyToPrintFields')); | |
- add_action('edit_user_profile', array($this, '_replyToPrintFields')); | |
- add_action('user_new_form', array($this, '_replyToPrintFields')); | |
- add_action('personal_options_update', array($this, '_replyToSaveFieldValues')); | |
- add_action('edit_user_profile_update', array($this, '_replyToSaveFieldValues')); | |
- add_action('user_register', array($this, '_replyToSaveFieldValues')); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_UserMeta_Router extends SeamlessDonationsAdminPageFramework_Factory { | |
+ public function __construct($oProp) { | |
+ parent::__construct($oProp); | |
+ if ($this->oProp->bIsAdmin) { | |
+ add_action('wp_loaded', array($this, '_replyToDetermineToLoad')); | |
+ } | |
+ } | |
+ public function _isInThePage() { | |
+ if (!$this->oProp->bIsAdmin) { | |
+ return false; | |
+ } | |
+ return in_array($this->oProp->sPageNow, array('user-new.php', 'user-edit.php', 'profile.php')); | |
+ } | |
+ public function _replyToDetermineToLoad() { | |
+ if (!$this->_isInThePage()) { | |
+ return; | |
+ } | |
+ $this->_setUp(); | |
+ $this->oUtil->addAndDoAction($this, "set_up_{$this->oProp->sClassName}", $this); | |
+ $this->oProp->_bSetupLoaded = true; | |
+ add_action('current_screen', array($this, '_replyToRegisterFormElements'), 20); | |
+ add_action('show_user_profile', array($this, '_replyToPrintFields')); | |
+ add_action('edit_user_profile', array($this, '_replyToPrintFields')); | |
+ add_action('user_new_form', array($this, '_replyToPrintFields')); | |
+ add_action('personal_options_update', array($this, '_replyToSaveFieldValues')); | |
+ add_action('edit_user_profile_update', array($this, '_replyToSaveFieldValues')); | |
+ add_action('user_register', array($this, '_replyToSaveFieldValues')); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_View.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_View.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_View.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/AdminPageFramework_UserMeta_View.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,28 +1,28 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_UserMeta_View extends SeamlessDonationsAdminPageFramework_UserMeta_Model { | |
- public function content($sContent) { | |
- return $sContent; | |
- } | |
- public function _replyToPrintFields($oUser) { | |
- $_iUserID = isset($oUser->ID) ? $oUser->ID : 0; | |
- $this->_setOptionArray($_iUserID); | |
- echo $this->_getFieldsOutput($_iUserID); | |
- } | |
- private function _getFieldsOutput($iUserID) { | |
- $_aOutput = array(); | |
- $_oFieldsTable = new SeamlessDonationsAdminPageFramework_FormTable($this->oProp->aFieldTypeDefinitions, $this->_getFieldErrors(), $this->oMsg); | |
- $_aOutput[] = $_oFieldsTable->getFormTables($this->oForm->aConditionedSections, $this->oForm->aConditionedFields, array($this, '_replyToGetSectionHeaderOutput'), array($this, '_replyToGetFieldOutput')); | |
- $_sOutput = $this->oUtil->addAndApplyFilters($this, 'content_' . $this->oProp->sClassName, $this->content(implode(PHP_EOL, $_aOutput))); | |
- $this->oUtil->addAndDoActions($this, 'do_' . $this->oProp->sClassName, $this); | |
- return $_sOutput; | |
- } | |
- public function _replyToGetSectionHeaderOutput($sSectionDescription, $aSection) { | |
- return $this->oUtil->addAndApplyFilters($this, array('section_head_' . $this->oProp->sClassName . '_' . $aSection['section_id']), $sSectionDescription); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_UserMeta_View extends SeamlessDonationsAdminPageFramework_UserMeta_Model { | |
+ public function content($sContent) { | |
+ return $sContent; | |
+ } | |
+ public function _replyToPrintFields($oUser) { | |
+ $_iUserID = isset($oUser->ID) ? $oUser->ID : 0; | |
+ $this->_setOptionArray($_iUserID); | |
+ echo $this->_getFieldsOutput($_iUserID); | |
+ } | |
+ private function _getFieldsOutput($iUserID) { | |
+ $_aOutput = array(); | |
+ $_oFieldsTable = new SeamlessDonationsAdminPageFramework_FormTable($this->oProp->aFieldTypeDefinitions, $this->_getFieldErrors(), $this->oMsg); | |
+ $_aOutput[] = $_oFieldsTable->getFormTables($this->oForm->aConditionedSections, $this->oForm->aConditionedFields, array($this, '_replyToGetSectionHeaderOutput'), array($this, '_replyToGetFieldOutput')); | |
+ $_sOutput = $this->oUtil->addAndApplyFilters($this, 'content_' . $this->oProp->sClassName, $this->content(implode(PHP_EOL, $_aOutput))); | |
+ $this->oUtil->addAndDoActions($this, 'do_' . $this->oProp->sClassName, $this); | |
+ return $_sOutput; | |
+ } | |
+ public function _replyToGetSectionHeaderOutput($sSectionDescription, $aSection) { | |
+ return $this->oUtil->addAndApplyFilters($this, array('section_head_' . $this->oProp->sClassName . '_' . $aSection['section_id']), $sSectionDescription); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_HelpPane_UserMeta.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_HelpPane_UserMeta.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_HelpPane_UserMeta.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_HelpPane_UserMeta.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,9 +1,9 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_HelpPane_UserMeta extends SeamlessDonationsAdminPageFramework_HelpPane_MetaBox { | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_HelpPane_UserMeta extends SeamlessDonationsAdminPageFramework_HelpPane_MetaBox { | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_Resource_UserMeta.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_Resource_UserMeta.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_Resource_UserMeta.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/controller/AdminPageFramework_Resource_UserMeta.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,9 +1,9 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Resource_UserMeta extends SeamlessDonationsAdminPageFramework_Resource_MetaBox { | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Resource_UserMeta extends SeamlessDonationsAdminPageFramework_Resource_MetaBox { | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/model/AdminPageFramework_Property_UserMeta.php ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/model/AdminPageFramework_Property_UserMeta.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/model/AdminPageFramework_Property_UserMeta.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_UserMeta/model/AdminPageFramework_Property_UserMeta.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,13 +1,13 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Property_UserMeta extends SeamlessDonationsAdminPageFramework_Property_MetaBox { | |
- public $_sPropertyType = 'user_meta'; | |
- protected function _getOptions() { | |
- return array(); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Property_UserMeta extends SeamlessDonationsAdminPageFramework_Property_MetaBox { | |
+ public $_sPropertyType = 'user_meta'; | |
+ protected function _getOptions() { | |
+ return array(); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Controller.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Controller.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Controller.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Controller.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,46 +1,46 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_Widget_Controller extends SeamlessDonationsAdminPageFramework_Widget_View { | |
- function __construct($oProp) { | |
- parent::__construct($oProp); | |
- if ($this->_isInThePage()): | |
- if (did_action('widgets_init')) { | |
- $this->setup_pre(); | |
- } { | |
- add_action('widgets_init', array($this, 'setup_pre')); | |
- } | |
- endif; | |
- } | |
- public function setUp() { | |
- } | |
- public function load($oAdminWidget) { | |
- } | |
- public function enqueueStyles($aSRCs, $aCustomArgs = array()) { | |
- if (method_exists($this->oResource, '_enqueueStyles')) { | |
- return $this->oResource->_enqueueStyles($aSRCs, array($this->oProp->sPostType), $aCustomArgs); | |
- } | |
- } | |
- public function enqueueStyle($sSRC, $aCustomArgs = array()) { | |
- if (method_exists($this->oResource, '_enqueueStyle')) { | |
- return $this->oResource->_enqueueStyle($sSRC, array($this->oProp->sPostType), $aCustomArgs); | |
- } | |
- } | |
- public function enqueueScripts($aSRCs, $aCustomArgs = array()) { | |
- if (method_exists($this->oResource, '_enqueueScripts')) { | |
- return $this->oResource->_enqueueScripts($aSRCs, array($this->oProp->sPostType), $aCustomArgs); | |
- } | |
- } | |
- public function enqueueScript($sSRC, $aCustomArgs = array()) { | |
- if (method_exists($this->oResource, '_enqueueScript')) { | |
- return $this->oResource->_enqueueScript($sSRC, array($this->oProp->sPostType), $aCustomArgs); | |
- } | |
- } | |
- protected function setArguments(array $aArguments = array()) { | |
- $this->oProp->aWidgetArguments = $aArguments; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_Widget_Controller extends SeamlessDonationsAdminPageFramework_Widget_View { | |
+ function __construct($oProp) { | |
+ parent::__construct($oProp); | |
+ if ($this->_isInThePage()): | |
+ if (did_action('widgets_init')) { | |
+ $this->setup_pre(); | |
+ } { | |
+ add_action('widgets_init', array($this, 'setup_pre')); | |
+ } | |
+ endif; | |
+ } | |
+ public function setUp() { | |
+ } | |
+ public function load($oAdminWidget) { | |
+ } | |
+ public function enqueueStyles($aSRCs, $aCustomArgs = array()) { | |
+ if (method_exists($this->oResource, '_enqueueStyles')) { | |
+ return $this->oResource->_enqueueStyles($aSRCs, array($this->oProp->sPostType), $aCustomArgs); | |
+ } | |
+ } | |
+ public function enqueueStyle($sSRC, $aCustomArgs = array()) { | |
+ if (method_exists($this->oResource, '_enqueueStyle')) { | |
+ return $this->oResource->_enqueueStyle($sSRC, array($this->oProp->sPostType), $aCustomArgs); | |
+ } | |
+ } | |
+ public function enqueueScripts($aSRCs, $aCustomArgs = array()) { | |
+ if (method_exists($this->oResource, '_enqueueScripts')) { | |
+ return $this->oResource->_enqueueScripts($aSRCs, array($this->oProp->sPostType), $aCustomArgs); | |
+ } | |
+ } | |
+ public function enqueueScript($sSRC, $aCustomArgs = array()) { | |
+ if (method_exists($this->oResource, '_enqueueScript')) { | |
+ return $this->oResource->_enqueueScript($sSRC, array($this->oProp->sPostType), $aCustomArgs); | |
+ } | |
+ } | |
+ protected function setArguments(array $aArguments = array()) { | |
+ $this->oProp->aWidgetArguments = $aArguments; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Factory.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Factory.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Factory.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Factory.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,39 +1,39 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Widget_Factory extends WP_Widget { | |
- public function __construct($oCaller, $sWidgetTitle, array $aArguments = array()) { | |
- $aArguments = $aArguments + array('classname' => 'admin_page_framework_widget', 'description' => '',); | |
- parent::__construct($oCaller->oProp->sClassName, $sWidgetTitle, $aArguments); | |
- $this->oCaller = $oCaller; | |
- } | |
- public function widget($aArguments, $aFormData) { | |
- echo $aArguments['before_widget']; | |
- $_sTitle = apply_filters('widget_title', isset($aFormData['title']) ? $aFormData['title'] : '', $aFormData, $this->id_base); | |
- if ($_sTitle) { | |
- echo $aArguments['before_title'] . $_sTitle . $aArguments['after_title']; | |
- } | |
- $this->oCaller->oUtil->addAndDoActions($this->oCaller, 'do_' . $this->oCaller->oProp->sClassName, $this->oCaller); | |
- echo $this->oCaller->oUtil->addAndApplyFilters($this->oCaller, "content_{$this->oCaller->oProp->sClassName}", $this->oCaller->content('', $aArguments, $aFormData), $aArguments, $aFormData); | |
- echo $aArguments['after_widget']; | |
- } | |
- public function update($aSubmittedFormData, $aSavedFormData) { | |
- return $this->oCaller->oUtil->addAndApplyFilters($this->oCaller, "validation_{$this->oCaller->oProp->sClassName}", call_user_func_array(array($this->oCaller, 'validate'), array($aSubmittedFormData, $aSavedFormData, $this->oCaller)), $aSavedFormData, $this->oCaller); | |
- } | |
- public function form($aFormData) { | |
- $this->oCaller->load($this->oCaller); | |
- $this->oCaller->oUtil->addAndDoActions($this->oCaller, 'load_' . $this->oCaller->oProp->sClassName, $this->oCaller); | |
- $this->oCaller->_registerFormElements($aFormData); | |
- $this->oCaller->oProp->aFieldCallbacks = array('hfID' => array($this, 'get_field_id'), 'hfTagID' => array($this, 'get_field_id'), 'hfName' => array($this, 'get_field_name'),); | |
- $this->oCaller->_printWidgetForm(); | |
- $this->oCaller->oForm = new SeamlessDonationsAdminPageFramework_FormElement($this->oCaller->oProp->sFieldsType, $this->oCaller->oProp->sCapability, $this->oCaller); | |
- } | |
- public function _replyToAddClassSelector($sClassSelectors) { | |
- $sClassSelectors.= ' widefat'; | |
- return trim($sClassSelectors); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Widget_Factory extends WP_Widget { | |
+ public function __construct($oCaller, $sWidgetTitle, array $aArguments = array()) { | |
+ $aArguments = $aArguments + array('classname' => 'admin_page_framework_widget', 'description' => '',); | |
+ parent::__construct($oCaller->oProp->sClassName, $sWidgetTitle, $aArguments); | |
+ $this->oCaller = $oCaller; | |
+ } | |
+ public function widget($aArguments, $aFormData) { | |
+ echo $aArguments['before_widget']; | |
+ $_sTitle = apply_filters('widget_title', isset($aFormData['title']) ? $aFormData['title'] : '', $aFormData, $this->id_base); | |
+ if ($_sTitle) { | |
+ echo $aArguments['before_title'] . $_sTitle . $aArguments['after_title']; | |
+ } | |
+ $this->oCaller->oUtil->addAndDoActions($this->oCaller, 'do_' . $this->oCaller->oProp->sClassName, $this->oCaller); | |
+ echo $this->oCaller->oUtil->addAndApplyFilters($this->oCaller, "content_{$this->oCaller->oProp->sClassName}", $this->oCaller->content('', $aArguments, $aFormData), $aArguments, $aFormData); | |
+ echo $aArguments['after_widget']; | |
+ } | |
+ public function update($aSubmittedFormData, $aSavedFormData) { | |
+ return $this->oCaller->oUtil->addAndApplyFilters($this->oCaller, "validation_{$this->oCaller->oProp->sClassName}", call_user_func_array(array($this->oCaller, 'validate'), array($aSubmittedFormData, $aSavedFormData, $this->oCaller)), $aSavedFormData, $this->oCaller); | |
+ } | |
+ public function form($aFormData) { | |
+ $this->oCaller->load($this->oCaller); | |
+ $this->oCaller->oUtil->addAndDoActions($this->oCaller, 'load_' . $this->oCaller->oProp->sClassName, $this->oCaller); | |
+ $this->oCaller->_registerFormElements($aFormData); | |
+ $this->oCaller->oProp->aFieldCallbacks = array('hfID' => array($this, 'get_field_id'), 'hfTagID' => array($this, 'get_field_id'), 'hfName' => array($this, 'get_field_name'),); | |
+ $this->oCaller->_printWidgetForm(); | |
+ $this->oCaller->oForm = new SeamlessDonationsAdminPageFramework_FormElement($this->oCaller->oProp->sFieldsType, $this->oCaller->oProp->sCapability, $this->oCaller); | |
+ } | |
+ public function _replyToAddClassSelector($sClassSelectors) { | |
+ $sClassSelectors.= ' widefat'; | |
+ return trim($sClassSelectors); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Model.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Model.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Model.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Model.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,32 +1,32 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_Widget_Model extends SeamlessDonationsAdminPageFramework_Widget_Router { | |
- function __construct($oProp) { | |
- parent::__construct($oProp); | |
- if (did_action('widgets_init')) { | |
- add_action("set_up_{$this->oProp->sClassName}", array($this, '_replyToRegisterWidget'), 20); | |
- } else { | |
- add_action('widgets_init', array($this, '_replyToRegisterWidget'), 20); | |
- } | |
- } | |
- public function _replyToRegisterWidget() { | |
- global $wp_widget_factory; | |
- if (!is_object($wp_widget_factory)) { | |
- return; | |
- } | |
- $wp_widget_factory->widgets[$this->oProp->sClassName] = new SeamlessDonationsAdminPageFramework_Widget_Factory($this, $this->oProp->sWidgetTitle, is_array($this->oProp->aWidgetArguments) ? $this->oProp->aWidgetArguments : array()); | |
- } | |
- public function _registerFormElements($aOptions) { | |
- $this->_loadFieldTypeDefinitions(); | |
- $this->oProp->aOptions = $aOptions; | |
- $this->oForm->format(); | |
- $this->oForm->applyConditions(); | |
- $this->oForm->setDynamicElements($this->oProp->aOptions); | |
- $this->_registerFields($this->oForm->aConditionedFields); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_Widget_Model extends SeamlessDonationsAdminPageFramework_Widget_Router { | |
+ function __construct($oProp) { | |
+ parent::__construct($oProp); | |
+ if (did_action('widgets_init')) { | |
+ add_action("set_up_{$this->oProp->sClassName}", array($this, '_replyToRegisterWidget'), 20); | |
+ } else { | |
+ add_action('widgets_init', array($this, '_replyToRegisterWidget'), 20); | |
+ } | |
+ } | |
+ public function _replyToRegisterWidget() { | |
+ global $wp_widget_factory; | |
+ if (!is_object($wp_widget_factory)) { | |
+ return; | |
+ } | |
+ $wp_widget_factory->widgets[$this->oProp->sClassName] = new SeamlessDonationsAdminPageFramework_Widget_Factory($this, $this->oProp->sWidgetTitle, is_array($this->oProp->aWidgetArguments) ? $this->oProp->aWidgetArguments : array()); | |
+ } | |
+ public function _registerFormElements($aOptions) { | |
+ $this->_loadFieldTypeDefinitions(); | |
+ $this->oProp->aOptions = $aOptions; | |
+ $this->oForm->format(); | |
+ $this->oForm->applyConditions(); | |
+ $this->oForm->setDynamicElements($this->oProp->aOptions); | |
+ $this->_registerFields($this->oForm->aConditionedFields); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,20 +1,20 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_Widget extends SeamlessDonationsAdminPageFramework_Widget_Controller { | |
- static protected $_sFieldsType = 'widget'; | |
- public function __construct($sWidgetTitle, $aWidgetArguments = array(), $sCapability = 'edit_theme_options', $sTextDomain = 'admin-page-framework') { | |
- if (empty($sWidgetTitle)) { | |
- return; | |
- } | |
- $this->oProp = new SeamlessDonationsAdminPageFramework_Property_Widget($this, null, get_class($this), $sCapability, $sTextDomain, self::$_sFieldsType); | |
- $this->oProp->sWidgetTitle = $sWidgetTitle; | |
- $this->oProp->aWidgetArguments = $aWidgetArguments; | |
- parent::__construct($this->oProp); | |
- $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}", $this); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_Widget extends SeamlessDonationsAdminPageFramework_Widget_Controller { | |
+ static protected $_sFieldsType = 'widget'; | |
+ public function __construct($sWidgetTitle, $aWidgetArguments = array(), $sCapability = 'edit_theme_options', $sTextDomain = 'admin-page-framework') { | |
+ if (empty($sWidgetTitle)) { | |
+ return; | |
+ } | |
+ $this->oProp = new SeamlessDonationsAdminPageFramework_Property_Widget($this, null, get_class($this), $sCapability, $sTextDomain, self::$_sFieldsType); | |
+ $this->oProp->sWidgetTitle = $sWidgetTitle; | |
+ $this->oProp->aWidgetArguments = $aWidgetArguments; | |
+ parent::__construct($this->oProp); | |
+ $this->oUtil->addAndDoAction($this, "start_{$this->oProp->sClassName}", $this); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Router.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Router.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Router.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_Router.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,12 +1,12 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_Widget_Router extends SeamlessDonationsAdminPageFramework_Factory { | |
- public function _isInThePage() { | |
- return true; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_Widget_Router extends SeamlessDonationsAdminPageFramework_Factory { | |
+ public function _isInThePage() { | |
+ return true; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_View.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_View.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_View.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/AdminPageFramework_Widget_View.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,19 +1,19 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_Widget_View extends SeamlessDonationsAdminPageFramework_Widget_Model { | |
- public function content($sContent, $aArguments, $aFormData) { | |
- return $sContent; | |
- } | |
- public function _printWidgetForm() { | |
- $_oFieldsTable = new SeamlessDonationsAdminPageFramework_FormTable($this->oProp->aFieldTypeDefinitions, $this->_getFieldErrors(), $this->oMsg); | |
- echo $_oFieldsTable->getFormTables($this->oForm->aConditionedSections, $this->oForm->aConditionedFields, array($this, '_replyToGetSectionHeaderOutput'), array($this, '_replyToGetFieldOutput')); | |
- } | |
- public function _replyToGetSectionHeaderOutput($sSectionDescription, $aSection) { | |
- return $this->oUtil->addAndApplyFilters($this, array('section_head_' . $this->oProp->sClassName . '_' . $aSection['section_id']), $sSectionDescription); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_Widget_View extends SeamlessDonationsAdminPageFramework_Widget_Model { | |
+ public function content($sContent, $aArguments, $aFormData) { | |
+ return $sContent; | |
+ } | |
+ public function _printWidgetForm() { | |
+ $_oFieldsTable = new SeamlessDonationsAdminPageFramework_FormTable($this->oProp->aFieldTypeDefinitions, $this->_getFieldErrors(), $this->oMsg); | |
+ echo $_oFieldsTable->getFormTables($this->oForm->aConditionedSections, $this->oForm->aConditionedFields, array($this, '_replyToGetSectionHeaderOutput'), array($this, '_replyToGetFieldOutput')); | |
+ } | |
+ public function _replyToGetSectionHeaderOutput($sSectionDescription, $aSection) { | |
+ return $this->oUtil->addAndApplyFilters($this, array('section_head_' . $this->oProp->sClassName . '_' . $aSection['section_id']), $sSectionDescription); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_HelpPane_Widget.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_HelpPane_Widget.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_HelpPane_Widget.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_HelpPane_Widget.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,9 +1,9 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_HelpPane_Widget extends SeamlessDonationsAdminPageFramework_HelpPane_MetaBox { | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_HelpPane_Widget extends SeamlessDonationsAdminPageFramework_HelpPane_MetaBox { | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_Resource_Widget.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_Resource_Widget.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_Resource_Widget.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/controller/AdminPageFramework_Resource_Widget.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,57 +1,57 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Resource_Widget extends SeamlessDonationsAdminPageFramework_Resource_Base { | |
- public function _enqueueStyles($aSRCs, $aCustomArgs = array()) { | |
- $_aHandleIDs = array(); | |
- foreach (( array )$aSRCs as $_sSRC) { | |
- $_aHandleIDs[] = $this->_enqueueStyle($_sSRC, $aCustomArgs); | |
- } | |
- return $_aHandleIDs; | |
- } | |
- public function _enqueueStyle($sSRC, $aCustomArgs = array()) { | |
- $sSRC = trim($sSRC); | |
- if (empty($sSRC)) { | |
- return ''; | |
- } | |
- $sSRC = $this->oUtil->resolveSRC($sSRC); | |
- $_sSRCHash = md5($sSRC); | |
- if (isset($this->oProp->aEnqueuingStyles[$_sSRCHash])) { | |
- return ''; | |
- } | |
- $this->oProp->aEnqueuingStyles[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'style', 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedStyleIndex),), self::$_aStructure_EnqueuingResources); | |
- $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingStyles[$_sSRCHash]['attributes']; | |
- return $this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']; | |
- } | |
- public function _enqueueScripts($aSRCs, $aCustomArgs = array()) { | |
- $_aHandleIDs = array(); | |
- foreach (( array )$aSRCs as $_sSRC) { | |
- $_aHandleIDs[] = $this->_enqueueScript($_sSRC, $aCustomArgs); | |
- } | |
- return $_aHandleIDs; | |
- } | |
- public function _enqueueScript($sSRC, $aCustomArgs = array()) { | |
- $sSRC = trim($sSRC); | |
- if (empty($sSRC)) { | |
- return ''; | |
- } | |
- $sSRC = $this->oUtil->resolveSRC($sSRC); | |
- $_sSRCHash = md5($sSRC); | |
- if (isset($this->oProp->aEnqueuingScripts[$_sSRCHash])) { | |
- return ''; | |
- } | |
- $this->oProp->aEnqueuingScripts[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'script', 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedScriptIndex),), self::$_aStructure_EnqueuingResources); | |
- $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingScripts[$_sSRCHash]['attributes']; | |
- return $this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']; | |
- } | |
- public function _forceToEnqueueStyle($sSRC, $aCustomArgs = array()) { | |
- return $this->_enqueueStyle($sSRC, $aCustomArgs); | |
- } | |
- public function _forceToEnqueueScript($sSRC, $aCustomArgs = array()) { | |
- return $this->_enqueueScript($sSRC, $aCustomArgs); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Resource_Widget extends SeamlessDonationsAdminPageFramework_Resource_Base { | |
+ public function _enqueueStyles($aSRCs, $aCustomArgs = array()) { | |
+ $_aHandleIDs = array(); | |
+ foreach (( array )$aSRCs as $_sSRC) { | |
+ $_aHandleIDs[] = $this->_enqueueStyle($_sSRC, $aCustomArgs); | |
+ } | |
+ return $_aHandleIDs; | |
+ } | |
+ public function _enqueueStyle($sSRC, $aCustomArgs = array()) { | |
+ $sSRC = trim($sSRC); | |
+ if (empty($sSRC)) { | |
+ return ''; | |
+ } | |
+ $sSRC = $this->oUtil->resolveSRC($sSRC); | |
+ $_sSRCHash = md5($sSRC); | |
+ if (isset($this->oProp->aEnqueuingStyles[$_sSRCHash])) { | |
+ return ''; | |
+ } | |
+ $this->oProp->aEnqueuingStyles[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'style', 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedStyleIndex),), self::$_aStructure_EnqueuingResources); | |
+ $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingStyles[$_sSRCHash]['attributes']; | |
+ return $this->oProp->aEnqueuingStyles[$_sSRCHash]['handle_id']; | |
+ } | |
+ public function _enqueueScripts($aSRCs, $aCustomArgs = array()) { | |
+ $_aHandleIDs = array(); | |
+ foreach (( array )$aSRCs as $_sSRC) { | |
+ $_aHandleIDs[] = $this->_enqueueScript($_sSRC, $aCustomArgs); | |
+ } | |
+ return $_aHandleIDs; | |
+ } | |
+ public function _enqueueScript($sSRC, $aCustomArgs = array()) { | |
+ $sSRC = trim($sSRC); | |
+ if (empty($sSRC)) { | |
+ return ''; | |
+ } | |
+ $sSRC = $this->oUtil->resolveSRC($sSRC); | |
+ $_sSRCHash = md5($sSRC); | |
+ if (isset($this->oProp->aEnqueuingScripts[$_sSRCHash])) { | |
+ return ''; | |
+ } | |
+ $this->oProp->aEnqueuingScripts[$_sSRCHash] = $this->oUtil->uniteArrays(( array )$aCustomArgs, array('sSRC' => $sSRC, 'sType' => 'script', 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . (++$this->oProp->iEnqueuedScriptIndex),), self::$_aStructure_EnqueuingResources); | |
+ $this->oProp->aResourceAttributes[$this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']] = $this->oProp->aEnqueuingScripts[$_sSRCHash]['attributes']; | |
+ return $this->oProp->aEnqueuingScripts[$_sSRCHash]['handle_id']; | |
+ } | |
+ public function _forceToEnqueueStyle($sSRC, $aCustomArgs = array()) { | |
+ return $this->_enqueueStyle($sSRC, $aCustomArgs); | |
+ } | |
+ public function _forceToEnqueueScript($sSRC, $aCustomArgs = array()) { | |
+ return $this->_enqueueScript($sSRC, $aCustomArgs); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/model/AdminPageFramework_Property_Widget.php ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/model/AdminPageFramework_Property_Widget.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/factory/AdminPageFramework_Widget/model/AdminPageFramework_Property_Widget.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/factory/AdminPageFramework_Widget/model/AdminPageFramework_Property_Widget.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,15 +1,15 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Property_Widget extends SeamlessDonationsAdminPageFramework_Property_Base { | |
- public $_sPropertyType = 'widget'; | |
- public $sFieldsType = 'widget'; | |
- public $sClassName = ''; | |
- public $sCallerPath = ''; | |
- public $sWidgetTitle = ''; | |
- public $aWidgetArguments = array(); | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Property_Widget extends SeamlessDonationsAdminPageFramework_Property_Base { | |
+ public $_sPropertyType = 'widget'; | |
+ public $sFieldsType = 'widget'; | |
+ public $sClassName = ''; | |
+ public $sCallerPath = ''; | |
+ public $sWidgetTitle = ''; | |
+ public $aWidgetArguments = array(); | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_AdminNotice.php ./seamless-donations/library/apf/utility/AdminPageFramework_AdminNotice.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_AdminNotice.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_AdminNotice.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,43 +1,43 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_AdminNotice { | |
- public function __construct($sNotice, array $aAttributes = array('class' => 'error')) { | |
- $this->sNotice = $sNotice; | |
- $this->aAttributes = $aAttributes + array('class' => 'error',); | |
- $this->aAttributes['class'].= ' admin-page-framework-settings-notice-message'; | |
- if (did_action('admin_notices')) { | |
- $this->_replyToDisplayAdminNotice(); | |
- } else { | |
- add_action('admin_notices', array($this, '_replyToDisplayAdminNotice')); | |
- } | |
- } | |
- public function _replyToDisplayAdminNotice() { | |
- echo "<div " . $this->_getAttributes($this->aAttributes) . ">" . "<p>" . $this->sNotice . "</p>" . "</div>"; | |
- } | |
- private function _getAttributes(array $aAttributes) { | |
- $_sQuoteCharactor = "'"; | |
- $_aOutput = array(); | |
- foreach ($aAttributes as $_sAttribute => $_asProperty) { | |
- if ('style' === $_sAttribute && is_array($_asProperty)) { | |
- $_asProperty = $this->_getInlineCSS($_asProperty); | |
- } | |
- if (in_array(gettype($_asProperty), array('array', 'object', 'NULL'))) { | |
- continue; | |
- } | |
- $_aOutput[] = "{$_sAttribute}={$_sQuoteCharactor}" . esc_attr($_asProperty) . "{$_sQuoteCharactor}"; | |
- } | |
- return trim(implode(' ', $_aOutput)); | |
- } | |
- private function _getInlineCSS(array $aCSSRules) { | |
- $_aOutput = array(); | |
- foreach ($aCSSRules as $_sProperty => $_sValue) { | |
- $_aOutput[] = $_sProperty . ': ' . $_sValue; | |
- } | |
- return implode('; ', $_aOutput); | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_AdminNotice { | |
+ public function __construct($sNotice, array $aAttributes = array('class' => 'error')) { | |
+ $this->sNotice = $sNotice; | |
+ $this->aAttributes = $aAttributes + array('class' => 'error',); | |
+ $this->aAttributes['class'].= ' admin-page-framework-settings-notice-message'; | |
+ if (did_action('admin_notices')) { | |
+ $this->_replyToDisplayAdminNotice(); | |
+ } else { | |
+ add_action('admin_notices', array($this, '_replyToDisplayAdminNotice')); | |
+ } | |
+ } | |
+ public function _replyToDisplayAdminNotice() { | |
+ echo "<div " . $this->_getAttributes($this->aAttributes) . ">" . "<p>" . $this->sNotice . "</p>" . "</div>"; | |
+ } | |
+ private function _getAttributes(array $aAttributes) { | |
+ $_sQuoteCharactor = "'"; | |
+ $_aOutput = array(); | |
+ foreach ($aAttributes as $_sAttribute => $_asProperty) { | |
+ if ('style' === $_sAttribute && is_array($_asProperty)) { | |
+ $_asProperty = $this->_getInlineCSS($_asProperty); | |
+ } | |
+ if (in_array(gettype($_asProperty), array('array', 'object', 'NULL'))) { | |
+ continue; | |
+ } | |
+ $_aOutput[] = "{$_sAttribute}={$_sQuoteCharactor}" . esc_attr($_asProperty) . "{$_sQuoteCharactor}"; | |
+ } | |
+ return trim(implode(' ', $_aOutput)); | |
+ } | |
+ private function _getInlineCSS(array $aCSSRules) { | |
+ $_aOutput = array(); | |
+ foreach ($aCSSRules as $_sProperty => $_sValue) { | |
+ $_aOutput[] = $_sProperty . ': ' . $_sValue; | |
+ } | |
+ return implode('; ', $_aOutput); | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_PluginBootstrap.php ./seamless-donations/library/apf/utility/AdminPageFramework_PluginBootstrap.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_PluginBootstrap.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_PluginBootstrap.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,85 +1,85 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-abstract class SeamlessDonationsAdminPageFramework_PluginBootstrap { | |
- public $sFilePath; | |
- public $bIsAdmin; | |
- public $sHookPrefix; | |
- public function __construct($sPluginFilePath, $sPluginHookPrefix = '', $sSetUpHook = 'plugins_loaded', $iPriority = 10) { | |
- if ($this->_hasLoaded()) { | |
- return; | |
- } | |
- $this->sFilePath = $sPluginFilePath; | |
- $this->bIsAdmin = is_admin(); | |
- $this->sHookPrefix = $sPluginHookPrefix; | |
- $this->sSetUpHook = $sSetUpHook; | |
- $this->iPriority = $iPriority; | |
- $_bValid = $this->start(); | |
- if (false === $_bValid) { | |
- return; | |
- } | |
- $this->setConstants(); | |
- $this->setGlobals(); | |
- $this->_registerClasses(); | |
- register_activation_hook($this->sFilePath, array($this, 'replyToPluginActivation')); | |
- register_deactivation_hook($this->sFilePath, array($this, 'replyToPluginDeactivation')); | |
- if (!$this->sSetUpHook || did_action($this->sSetUpHook)) { | |
- $this->_replyToLoadPluginComponents(); | |
- } else { | |
- add_action($this->sSetUpHook, array($this, '_replyToLoadPluginComponents'), $this->iPriority); | |
- } | |
- add_action('init', array($this, 'setLocalization')); | |
- $this->construct(); | |
- } | |
- protected function _hasLoaded() { | |
- static $_bLoaded = false; | |
- if ($_bLoaded) { | |
- return true; | |
- } | |
- $_bLoaded = true; | |
- return false; | |
- } | |
- protected function _registerClasses() { | |
- if (!class_exists('SeamlessDonationsAdminPageFramework_RegisterClasses')) { | |
- return; | |
- } | |
- new SeamlessDonationsAdminPageFramework_RegisterClasses($this->getScanningDirs(), array(), $this->getClasses()); | |
- } | |
- public function _replyToLoadPluginComponents() { | |
- if ($this->sHookPrefix) { | |
- do_action("{$this->sHookPrefix}_action_before_loading_plugin"); | |
- } | |
- $this->setUp(); | |
- if ($this->sHookPrefix) { | |
- do_action("{$this->sHookPrefix}_action_after_loading_plugin"); | |
- } | |
- } | |
- public function setConstants() { | |
- } | |
- public function setGlobals() { | |
- } | |
- public function getClasses() { | |
- $_aClasses = array(); | |
- return $_aClasses; | |
- } | |
- public function getScanningDirs() { | |
- $_aDirs = array(); | |
- return $_aDirs; | |
- } | |
- public function replyToPluginActivation() { | |
- } | |
- public function replyToPluginDeactivation() { | |
- } | |
- public function setLocalization() { | |
- } | |
- public function setUp() { | |
- } | |
- protected function construct() { | |
- } | |
- public function start() { | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+abstract class SeamlessDonationsAdminPageFramework_PluginBootstrap { | |
+ public $sFilePath; | |
+ public $bIsAdmin; | |
+ public $sHookPrefix; | |
+ public function __construct($sPluginFilePath, $sPluginHookPrefix = '', $sSetUpHook = 'plugins_loaded', $iPriority = 10) { | |
+ if ($this->_hasLoaded()) { | |
+ return; | |
+ } | |
+ $this->sFilePath = $sPluginFilePath; | |
+ $this->bIsAdmin = is_admin(); | |
+ $this->sHookPrefix = $sPluginHookPrefix; | |
+ $this->sSetUpHook = $sSetUpHook; | |
+ $this->iPriority = $iPriority; | |
+ $_bValid = $this->start(); | |
+ if (false === $_bValid) { | |
+ return; | |
+ } | |
+ $this->setConstants(); | |
+ $this->setGlobals(); | |
+ $this->_registerClasses(); | |
+ register_activation_hook($this->sFilePath, array($this, 'replyToPluginActivation')); | |
+ register_deactivation_hook($this->sFilePath, array($this, 'replyToPluginDeactivation')); | |
+ if (!$this->sSetUpHook || did_action($this->sSetUpHook)) { | |
+ $this->_replyToLoadPluginComponents(); | |
+ } else { | |
+ add_action($this->sSetUpHook, array($this, '_replyToLoadPluginComponents'), $this->iPriority); | |
+ } | |
+ add_action('init', array($this, 'setLocalization')); | |
+ $this->construct(); | |
+ } | |
+ protected function _hasLoaded() { | |
+ static $_bLoaded = false; | |
+ if ($_bLoaded) { | |
+ return true; | |
+ } | |
+ $_bLoaded = true; | |
+ return false; | |
+ } | |
+ protected function _registerClasses() { | |
+ if (!class_exists('SeamlessDonationsAdminPageFramework_RegisterClasses')) { | |
+ return; | |
+ } | |
+ new SeamlessDonationsAdminPageFramework_RegisterClasses($this->getScanningDirs(), array(), $this->getClasses()); | |
+ } | |
+ public function _replyToLoadPluginComponents() { | |
+ if ($this->sHookPrefix) { | |
+ do_action("{$this->sHookPrefix}_action_before_loading_plugin"); | |
+ } | |
+ $this->setUp(); | |
+ if ($this->sHookPrefix) { | |
+ do_action("{$this->sHookPrefix}_action_after_loading_plugin"); | |
+ } | |
+ } | |
+ public function setConstants() { | |
+ } | |
+ public function setGlobals() { | |
+ } | |
+ public function getClasses() { | |
+ $_aClasses = array(); | |
+ return $_aClasses; | |
+ } | |
+ public function getScanningDirs() { | |
+ $_aDirs = array(); | |
+ return $_aDirs; | |
+ } | |
+ public function replyToPluginActivation() { | |
+ } | |
+ public function replyToPluginDeactivation() { | |
+ } | |
+ public function setLocalization() { | |
+ } | |
+ public function setUp() { | |
+ } | |
+ protected function construct() { | |
+ } | |
+ public function start() { | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_Requirement.php ./seamless-donations/library/apf/utility/AdminPageFramework_Requirement.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_Requirement.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_Requirement.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,106 +1,106 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Requirement { | |
- private $_aRequirements = array(); | |
- public $aWarnings = array(); | |
- private $_aDefaultRequirements = array('php' => array('version' => '5.2.4', 'error' => 'The plugin requires the PHP version %1$s or higher.',), 'wordpress' => array('version' => '3.3', 'error' => 'The plugin requires the WordPress version %1$s or higher.',), 'mysql' => array('version' => '5.0', 'error' => 'The plugin requires the MySQL version %1$s or higher.',), 'functions' => array(), 'classes' => array(), 'constants' => array(), 'files' => array(),); | |
- public function __construct(array $aRequirements = array(), $sScriptName = '') { | |
- $aRequirements = $aRequirements + $this->_aDefaultRequirements; | |
- $aRequirements = array_filter($aRequirements, 'is_array'); | |
- foreach (array('php', 'mysql', 'wordpress') as $_iIndex => $_sName) { | |
- if (isset($aRequirements[$_sName])) { | |
- $aRequirements[$_sName] = $aRequirements[$_sName] + $this->_aDefaultRequirements[$_sName]; | |
- } | |
- } | |
- $this->_aRequirements = $aRequirements; | |
- $this->_sScriptName = $sScriptName; | |
- } | |
- public function check() { | |
- $_aWarnings = array(); | |
- $_aWarnings[] = $this->_getWarningByType('php'); | |
- $_aWarnings[] = $this->_getWarningByType('wordpress'); | |
- $_aWarnings[] = $this->_getWarningByType('mysql'); | |
- $this->_aRequirements = $this->_aRequirements + array('functions' => array(), 'classes' => array(), 'constants' => array(), 'files' => array(),); | |
- $_aWarnings = array_merge($_aWarnings, $this->_checkFunctions($this->_aRequirements['functions']), $this->_checkClasses($this->_aRequirements['classes']), $this->_checkConstants($this->_aRequirements['constants']), $this->_checkFiles($this->_aRequirements['files'])); | |
- $this->aWarnings = array_filter($_aWarnings); | |
- return count($this->aWarnings); | |
- } | |
- private function _getWarningByType($sType) { | |
- if (!isset($this->_aRequirements[$sType]['version'])) { | |
- return ''; | |
- } | |
- if ($this->_checkPHPVersion($this->_aRequirements[$sType]['version'])) { | |
- return ''; | |
- } | |
- return sprintf($this->_aRequirements[$sType]['error'], $this->_aRequirements[$sType]['version']); | |
- } | |
- private function _checkPHPVersion($sPHPVersion) { | |
- return version_compare(phpversion(), $sPHPVersion, ">="); | |
- } | |
- private function _checkWordPressVersion($sWordPressVersion) { | |
- return version_compare($GLOBALS['wp_version'], $sWordPressVersion, ">="); | |
- } | |
- private function _checkMySQLVersion($sMySQLVersion) { | |
- global $wpdb; | |
- $_sInstalledMySQLVersion = isset($wpdb->use_mysqli) && $wpdb->use_mysqli ? @mysqli_get_server_info($wpdb->dbh) : @mysql_get_server_info(); | |
- return $_sInstalledMySQLVersion ? version_compare($_sInstalledMySQLVersion, $sMySQLVersion, ">=") : true; | |
- } | |
- private function _checkClasses($aClasses) { | |
- return empty($aClasses) ? array() : $this->_getWarningsByFunctionName('class_exists', $aClasses); | |
- } | |
- private function _checkFunctions($aFunctions) { | |
- return empty($aFunctions) ? array() : $this->_getWarningsByFunctionName('function_exists', $aFunctions); | |
- } | |
- private function _checkConstants($aConstants) { | |
- return empty($aConstants) ? array() : $this->_getWarningsByFunctionName('defined', $aConstants); | |
- } | |
- private function _checkFiles($aFilePaths) { | |
- return empty($aFilePaths) ? array() : $this->_getWarningsByFunctionName('file_exists', $aFilePaths); | |
- } | |
- private function _getWarningsByFunctionName($sFuncName, $aSubjects) { | |
- $_aWarnings = array(); | |
- foreach ($aSubjects as $_sSubject => $_sWarning) { | |
- if (!call_user_func_array($sFuncName, array($_sSubject))) { | |
- $_aWarnings[] = sprintf($_sWarning, $_sSubject); | |
- } | |
- } | |
- return $_aWarnings; | |
- } | |
- public function setAdminNotices() { | |
- add_action('admin_notices', array($this, '_replyToPrintAdminNotices')); | |
- } | |
- public function _replyToPrintAdminNotices() { | |
- $_aWarnings = array_unique($this->aWarnings); | |
- if (empty($_aWarnings)) { | |
- return; | |
- } | |
- echo "<div class='error'>" . "<p>" . $this->_getWarnings() . "</p>" . "</div>"; | |
- } | |
- private function _getWarnings() { | |
- $_aWarnings = array_unique($this->aWarnings); | |
- if (empty($_aWarnings)) { | |
- return ''; | |
- } | |
- $_sScripTitle = $this->_sScriptName ? "<strong>" . $this->_sScriptName . "</strong>: " : ''; | |
- return $_sScripTitle . implode('<br />', $_aWarnings); | |
- } | |
- public function deactivatePlugin($sPluginFilePath, $sMessage = '', $bIsOnActivation = false) { | |
- add_action('admin_notices', array($this, '_replyToPrintAdminNotices')); | |
- $this->aWarnings[] = '<strong>' . $sMessage . '</strong>'; | |
- if (!function_exists('deactivate_plugins')) { | |
- if (!@include (ABSPATH . '/wp-admin/includes/plugin.php')) { | |
- return; | |
- } | |
- } | |
- deactivate_plugins($sPluginFilePath); | |
- if ($bIsOnActivation) { | |
- $_sPluginListingPage = add_query_arg(array(), $GLOBALS['pagenow']); | |
- wp_die($this->_getWarnings() . "<p><a href='$_sPluginListingPage'>Go back</a>.</p>"); | |
- } | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Requirement { | |
+ private $_aRequirements = array(); | |
+ public $aWarnings = array(); | |
+ private $_aDefaultRequirements = array('php' => array('version' => '5.2.4', 'error' => 'The plugin requires the PHP version %1$s or higher.',), 'wordpress' => array('version' => '3.3', 'error' => 'The plugin requires the WordPress version %1$s or higher.',), 'mysql' => array('version' => '5.0', 'error' => 'The plugin requires the MySQL version %1$s or higher.',), 'functions' => array(), 'classes' => array(), 'constants' => array(), 'files' => array(),); | |
+ public function __construct(array $aRequirements = array(), $sScriptName = '') { | |
+ $aRequirements = $aRequirements + $this->_aDefaultRequirements; | |
+ $aRequirements = array_filter($aRequirements, 'is_array'); | |
+ foreach (array('php', 'mysql', 'wordpress') as $_iIndex => $_sName) { | |
+ if (isset($aRequirements[$_sName])) { | |
+ $aRequirements[$_sName] = $aRequirements[$_sName] + $this->_aDefaultRequirements[$_sName]; | |
+ } | |
+ } | |
+ $this->_aRequirements = $aRequirements; | |
+ $this->_sScriptName = $sScriptName; | |
+ } | |
+ public function check() { | |
+ $_aWarnings = array(); | |
+ $_aWarnings[] = $this->_getWarningByType('php'); | |
+ $_aWarnings[] = $this->_getWarningByType('wordpress'); | |
+ $_aWarnings[] = $this->_getWarningByType('mysql'); | |
+ $this->_aRequirements = $this->_aRequirements + array('functions' => array(), 'classes' => array(), 'constants' => array(), 'files' => array(),); | |
+ $_aWarnings = array_merge($_aWarnings, $this->_checkFunctions($this->_aRequirements['functions']), $this->_checkClasses($this->_aRequirements['classes']), $this->_checkConstants($this->_aRequirements['constants']), $this->_checkFiles($this->_aRequirements['files'])); | |
+ $this->aWarnings = array_filter($_aWarnings); | |
+ return count($this->aWarnings); | |
+ } | |
+ private function _getWarningByType($sType) { | |
+ if (!isset($this->_aRequirements[$sType]['version'])) { | |
+ return ''; | |
+ } | |
+ if ($this->_checkPHPVersion($this->_aRequirements[$sType]['version'])) { | |
+ return ''; | |
+ } | |
+ return sprintf($this->_aRequirements[$sType]['error'], $this->_aRequirements[$sType]['version']); | |
+ } | |
+ private function _checkPHPVersion($sPHPVersion) { | |
+ return version_compare(phpversion(), $sPHPVersion, ">="); | |
+ } | |
+ private function _checkWordPressVersion($sWordPressVersion) { | |
+ return version_compare($GLOBALS['wp_version'], $sWordPressVersion, ">="); | |
+ } | |
+ private function _checkMySQLVersion($sMySQLVersion) { | |
+ global $wpdb; | |
+ $_sInstalledMySQLVersion = isset($wpdb->use_mysqli) && $wpdb->use_mysqli ? @mysqli_get_server_info($wpdb->dbh) : @mysql_get_server_info(); | |
+ return $_sInstalledMySQLVersion ? version_compare($_sInstalledMySQLVersion, $sMySQLVersion, ">=") : true; | |
+ } | |
+ private function _checkClasses($aClasses) { | |
+ return empty($aClasses) ? array() : $this->_getWarningsByFunctionName('class_exists', $aClasses); | |
+ } | |
+ private function _checkFunctions($aFunctions) { | |
+ return empty($aFunctions) ? array() : $this->_getWarningsByFunctionName('function_exists', $aFunctions); | |
+ } | |
+ private function _checkConstants($aConstants) { | |
+ return empty($aConstants) ? array() : $this->_getWarningsByFunctionName('defined', $aConstants); | |
+ } | |
+ private function _checkFiles($aFilePaths) { | |
+ return empty($aFilePaths) ? array() : $this->_getWarningsByFunctionName('file_exists', $aFilePaths); | |
+ } | |
+ private function _getWarningsByFunctionName($sFuncName, $aSubjects) { | |
+ $_aWarnings = array(); | |
+ foreach ($aSubjects as $_sSubject => $_sWarning) { | |
+ if (!call_user_func_array($sFuncName, array($_sSubject))) { | |
+ $_aWarnings[] = sprintf($_sWarning, $_sSubject); | |
+ } | |
+ } | |
+ return $_aWarnings; | |
+ } | |
+ public function setAdminNotices() { | |
+ add_action('admin_notices', array($this, '_replyToPrintAdminNotices')); | |
+ } | |
+ public function _replyToPrintAdminNotices() { | |
+ $_aWarnings = array_unique($this->aWarnings); | |
+ if (empty($_aWarnings)) { | |
+ return; | |
+ } | |
+ echo "<div class='error'>" . "<p>" . $this->_getWarnings() . "</p>" . "</div>"; | |
+ } | |
+ private function _getWarnings() { | |
+ $_aWarnings = array_unique($this->aWarnings); | |
+ if (empty($_aWarnings)) { | |
+ return ''; | |
+ } | |
+ $_sScripTitle = $this->_sScriptName ? "<strong>" . $this->_sScriptName . "</strong>: " : ''; | |
+ return $_sScripTitle . implode('<br />', $_aWarnings); | |
+ } | |
+ public function deactivatePlugin($sPluginFilePath, $sMessage = '', $bIsOnActivation = false) { | |
+ add_action('admin_notices', array($this, '_replyToPrintAdminNotices')); | |
+ $this->aWarnings[] = '<strong>' . $sMessage . '</strong>'; | |
+ if (!function_exists('deactivate_plugins')) { | |
+ if (!@include (ABSPATH . '/wp-admin/includes/plugin.php')) { | |
+ return; | |
+ } | |
+ } | |
+ deactivate_plugins($sPluginFilePath); | |
+ if ($bIsOnActivation) { | |
+ $_sPluginListingPage = add_query_arg(array(), $GLOBALS['pagenow']); | |
+ wp_die($this->_getWarnings() . "<p><a href='$_sPluginListingPage'>Go back</a>.</p>"); | |
+ } | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_TableOfContents.php ./seamless-donations/library/apf/utility/AdminPageFramework_TableOfContents.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_TableOfContents.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_TableOfContents.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,40 +1,40 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_TableOfContents { | |
- public function __construct($sHTML, $iDepth = 4, $sTitle = '') { | |
- $this->sTitle = $sTitle; | |
- $this->sHTML = $sHTML; | |
- $this->iDepth = $iDepth; | |
- } | |
- public function get() { | |
- return $this->getTOC() . $this->getContents(); | |
- } | |
- public function getContents() { | |
- return $this->sHTML; | |
- } | |
- public function getTOC() { | |
- $iDepth = $this->iDepth; | |
- $this->sHTML = preg_replace_callback('/<h[2-' . $iDepth . ']*[^>]*>.*?<\/h[2-' . $iDepth . ']>/i', array($this, '_replyToInsertNamedElement'), $this->sHTML); | |
- $_aOutput = array(); | |
- foreach ($this->_aMatches as $_iIndex => $_sMatch) { | |
- $_sMatch = strip_tags($_sMatch, '<h1><h2><h3><h4><h5><h6><h7><h8>'); | |
- $_sMatch = preg_replace('/<h([1-' . $iDepth . '])>/', '<li class="toc$1"><a href="#toc_' . $_iIndex . '">', $_sMatch); | |
- $_sMatch = preg_replace('/<\/h[1-' . $iDepth . ']>/', '</a></li>', $_sMatch); | |
- $_aOutput[] = $_sMatch; | |
- } | |
- $this->sTitle = $this->sTitle ? '<p class="toc-title">' . $this->sTitle . '</p>' : ''; | |
- return '<div class="toc">' . $this->sTitle . '<ul>' . implode(PHP_EOL, $_aOutput) . '</ul>' . '</div>'; | |
- } | |
- protected $_aMatches = array(); | |
- public function _replyToInsertNamedElement($aMatches) { | |
- static $_icount = - 1; | |
- $_icount++; | |
- $this->_aMatches[] = $aMatches[0]; | |
- return "<span class='toc_header_link' id='toc_{$_icount}'></span>" . PHP_EOL . $aMatches[0]; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_TableOfContents { | |
+ public function __construct($sHTML, $iDepth = 4, $sTitle = '') { | |
+ $this->sTitle = $sTitle; | |
+ $this->sHTML = $sHTML; | |
+ $this->iDepth = $iDepth; | |
+ } | |
+ public function get() { | |
+ return $this->getTOC() . $this->getContents(); | |
+ } | |
+ public function getContents() { | |
+ return $this->sHTML; | |
+ } | |
+ public function getTOC() { | |
+ $iDepth = $this->iDepth; | |
+ $this->sHTML = preg_replace_callback('/<h[2-' . $iDepth . ']*[^>]*>.*?<\/h[2-' . $iDepth . ']>/i', array($this, '_replyToInsertNamedElement'), $this->sHTML); | |
+ $_aOutput = array(); | |
+ foreach ($this->_aMatches as $_iIndex => $_sMatch) { | |
+ $_sMatch = strip_tags($_sMatch, '<h1><h2><h3><h4><h5><h6><h7><h8>'); | |
+ $_sMatch = preg_replace('/<h([1-' . $iDepth . '])>/', '<li class="toc$1"><a href="#toc_' . $_iIndex . '">', $_sMatch); | |
+ $_sMatch = preg_replace('/<\/h[1-' . $iDepth . ']>/', '</a></li>', $_sMatch); | |
+ $_aOutput[] = $_sMatch; | |
+ } | |
+ $this->sTitle = $this->sTitle ? '<p class="toc-title">' . $this->sTitle . '</p>' : ''; | |
+ return '<div class="toc">' . $this->sTitle . '<ul>' . implode(PHP_EOL, $_aOutput) . '</ul>' . '</div>'; | |
+ } | |
+ protected $_aMatches = array(); | |
+ public function _replyToInsertNamedElement($aMatches) { | |
+ static $_icount = - 1; | |
+ $_icount++; | |
+ $this->_aMatches[] = $aMatches[0]; | |
+ return "<span class='toc_header_link' id='toc_{$_icount}'></span>" . PHP_EOL . $aMatches[0]; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/AdminPageFramework_WPReadmeParser.php ./seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/AdminPageFramework_WPReadmeParser.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/AdminPageFramework_WPReadmeParser.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/AdminPageFramework_WPReadmeParser.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,58 +1,58 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_WPReadmeParser { | |
- static private $_aStructure_Callbacks = array('code_block' => null, '%PLUGIN_DIR_URL%' => null, '%WP_ADMIN_URL%' => null,); | |
- public function __construct($sFilePath = '', array $aReplacements = array(), array $aCallbacks = array()) { | |
- $this->sText = file_exists($sFilePath) ? file_get_contents($sFilePath) : ''; | |
- $this->_aSections = $this->sText ? $this->_getSplitContentsBySection($this->sText) : array(); | |
- $this->aReplacements = $aReplacements; | |
- $this->aCallbacks = $aCallbacks + self::$_aStructure_Callbacks; | |
- } | |
- public function setText($sText) { | |
- $this->sText = $sText; | |
- $this->_aSections = $this->sText ? $this->_getSplitContentsBySection($this->sText) : array(); | |
- } | |
- private function _getSplitContentsBySection($sText) { | |
- return preg_split('/^[\s]*==[\s]*(.+?)[\s]*==/m', $sText, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); | |
- } | |
- public function get($sSectionName = '') { | |
- return $sSectionName ? $this->getSection($sSectionName) : $this->_getParsedText($this->sText); | |
- } | |
- public function getSection($sSectionName) { | |
- $_sContent = $this->getRawSection($sSectionName); | |
- return $this->_getParsedText($_sContent); | |
- } | |
- private function _getParsedText($sContent) { | |
- $_sContent = preg_replace('/`(.*?)`/', '<code>\\1</code>', $sContent); | |
- $_sContent = preg_replace_callback('/`(.*?)`/ms', array($this, '_replyToReplaceCodeBlocks'), $_sContent); | |
- $_sContent = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $_sContent); | |
- $_sContent = str_replace(array_keys($this->aReplacements), array_values($this->aReplacements), $_sContent); | |
- $_oParsedown = new SeamlessDonationsAdminPageFramework_Parsedown(); | |
- return $_oParsedown->text($_sContent); | |
- } | |
- public function _replyToReplaceCodeBlocks($aMatches) { | |
- if (!isset($aMatches[1])) { | |
- return $aMatches[0]; | |
- } | |
- $_sIntact = trim($aMatches[1]); | |
- $_sModified = "<pre><code>" . $this->getSyntaxHighlightedPHPCode($_sIntact) . "</code></pre>"; | |
- return is_callable($this->aCallbacks['code_block']) ? call_user_func_array($this->aCallbacks['code_block'], array($_sModified, $_sIntact)) : $_sModified; | |
- } | |
- public function getRawSection($sSectionName) { | |
- $_iIndex = array_search($sSectionName, $this->_aSections); | |
- return false === $_iIndex ? '' : trim($this->_aSections[$_iIndex + 1]); | |
- } | |
- public function getSyntaxHighlightedPHPCode($sCode) { | |
- $_bHasPHPTag = "<?php" === substr($sCode, 0, 5); | |
- $sCode = $_bHasPHPTag ? $sCode : "<?php " . $sCode; | |
- $sCode = str_replace('"', "'", $sCode); | |
- $sCode = highlight_string($sCode, true); | |
- $sCode = $_bHasPHPTag ? $sCode : preg_replace('/(<|<)\Q?php\E( )?/', '', $sCode, 1); | |
- return $sCode; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_WPReadmeParser { | |
+ static private $_aStructure_Callbacks = array('code_block' => null, '%PLUGIN_DIR_URL%' => null, '%WP_ADMIN_URL%' => null,); | |
+ public function __construct($sFilePath = '', array $aReplacements = array(), array $aCallbacks = array()) { | |
+ $this->sText = file_exists($sFilePath) ? file_get_contents($sFilePath) : ''; | |
+ $this->_aSections = $this->sText ? $this->_getSplitContentsBySection($this->sText) : array(); | |
+ $this->aReplacements = $aReplacements; | |
+ $this->aCallbacks = $aCallbacks + self::$_aStructure_Callbacks; | |
+ } | |
+ public function setText($sText) { | |
+ $this->sText = $sText; | |
+ $this->_aSections = $this->sText ? $this->_getSplitContentsBySection($this->sText) : array(); | |
+ } | |
+ private function _getSplitContentsBySection($sText) { | |
+ return preg_split('/^[\s]*==[\s]*(.+?)[\s]*==/m', $sText, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); | |
+ } | |
+ public function get($sSectionName = '') { | |
+ return $sSectionName ? $this->getSection($sSectionName) : $this->_getParsedText($this->sText); | |
+ } | |
+ public function getSection($sSectionName) { | |
+ $_sContent = $this->getRawSection($sSectionName); | |
+ return $this->_getParsedText($_sContent); | |
+ } | |
+ private function _getParsedText($sContent) { | |
+ $_sContent = preg_replace('/`(.*?)`/', '<code>\\1</code>', $sContent); | |
+ $_sContent = preg_replace_callback('/`(.*?)`/ms', array($this, '_replyToReplaceCodeBlocks'), $_sContent); | |
+ $_sContent = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $_sContent); | |
+ $_sContent = str_replace(array_keys($this->aReplacements), array_values($this->aReplacements), $_sContent); | |
+ $_oParsedown = new SeamlessDonationsAdminPageFramework_Parsedown(); | |
+ return $_oParsedown->text($_sContent); | |
+ } | |
+ public function _replyToReplaceCodeBlocks($aMatches) { | |
+ if (!isset($aMatches[1])) { | |
+ return $aMatches[0]; | |
+ } | |
+ $_sIntact = trim($aMatches[1]); | |
+ $_sModified = "<pre><code>" . $this->getSyntaxHighlightedPHPCode($_sIntact) . "</code></pre>"; | |
+ return is_callable($this->aCallbacks['code_block']) ? call_user_func_array($this->aCallbacks['code_block'], array($_sModified, $_sIntact)) : $_sModified; | |
+ } | |
+ public function getRawSection($sSectionName) { | |
+ $_iIndex = array_search($sSectionName, $this->_aSections); | |
+ return false === $_iIndex ? '' : trim($this->_aSections[$_iIndex + 1]); | |
+ } | |
+ public function getSyntaxHighlightedPHPCode($sCode) { | |
+ $_bHasPHPTag = "<?php" === substr($sCode, 0, 5); | |
+ $sCode = $_bHasPHPTag ? $sCode : "<?php " . $sCode; | |
+ $sCode = str_replace('"', "'", $sCode); | |
+ $sCode = highlight_string($sCode, true); | |
+ $sCode = $_bHasPHPTag ? $sCode : preg_replace('/(<|<)\Q?php\E( )?/', '', $sCode, 1); | |
+ return $sCode; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/AdminPageFramework_Parsedown.php ./seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/AdminPageFramework_Parsedown.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/AdminPageFramework_Parsedown.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/AdminPageFramework_Parsedown.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,689 +1,689 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Parsedown { | |
- function text($text) { | |
- $this->Definitions = array(); | |
- $text = str_replace("\r\n", "\n", $text); | |
- $text = str_replace("\r", "\n", $text); | |
- $text = trim($text, "\n"); | |
- $lines = explode("\n", $text); | |
- $markup = $this->lines($lines); | |
- $markup = trim($markup, "\n"); | |
- return $markup; | |
- } | |
- private $breaksEnabled; | |
- function setBreaksEnabled($breaksEnabled) { | |
- $this->breaksEnabled = $breaksEnabled; | |
- return $this; | |
- } | |
- private $markupEscaped; | |
- function setMarkupEscaped($markupEscaped) { | |
- $this->markupEscaped = $markupEscaped; | |
- return $this; | |
- } | |
- private $urlsLinked = true; | |
- function setUrlsLinked($urlsLinked) { | |
- $this->urlsLinked = $urlsLinked; | |
- return $this; | |
- } | |
- protected $BlockTypes = array('#' => array('Header'), '*' => array('Rule', 'List'), '+' => array('List'), '-' => array('SetextHeader', 'Table', 'Rule', 'List'), '0' => array('List'), '1' => array('List'), '2' => array('List'), '3' => array('List'), '4' => array('List'), '5' => array('List'), '6' => array('List'), '7' => array('List'), '8' => array('List'), '9' => array('List'), ':' => array('Table'), '<' => array('Comment', 'Markup'), '=' => array('SetextHeader'), '>' => array('Quote'), '_' => array('Rule'), '`' => array('FencedCode'), '|' => array('Table'), '~' => array('FencedCode'),); | |
- protected $DefinitionTypes = array('[' => array('Reference'),); | |
- protected $unmarkedBlockTypes = array('Code',); | |
- private function lines(array $lines) { | |
- $CurrentBlock = null; | |
- foreach ($lines as $line) { | |
- if (chop($line) === '') { | |
- if (isset($CurrentBlock)) { | |
- $CurrentBlock['interrupted'] = true; | |
- } | |
- continue; | |
- } | |
- if (strpos($line, "\t") !== false) { | |
- $parts = explode("\t", $line); | |
- $line = $parts[0]; | |
- unset($parts[0]); | |
- foreach ($parts as $part) { | |
- $shortage = 4 - mb_strlen($line, 'utf-8') % 4; | |
- $line.= str_repeat(' ', $shortage); | |
- $line.= $part; | |
- } | |
- } | |
- $indent = 0; | |
- while (isset($line[$indent]) and $line[$indent] === ' ') { | |
- $indent++; | |
- } | |
- $text = $indent > 0 ? substr($line, $indent) : $line; | |
- $Line = array('body' => $line, 'indent' => $indent, 'text' => $text); | |
- if (isset($CurrentBlock['incomplete'])) { | |
- $Block = $this->{'block' . $CurrentBlock['type'] . 'Continue'}($Line, $CurrentBlock); | |
- if (isset($Block)) { | |
- $CurrentBlock = $Block; | |
- continue; | |
- } else { | |
- if (method_exists($this, 'block' . $CurrentBlock['type'] . 'Complete')) { | |
- $CurrentBlock = $this->{'block' . $CurrentBlock['type'] . 'Complete'}($CurrentBlock); | |
- } | |
- unset($CurrentBlock['incomplete']); | |
- } | |
- } | |
- $marker = $text[0]; | |
- if (isset($this->DefinitionTypes[$marker])) { | |
- foreach ($this->DefinitionTypes[$marker] as $definitionType) { | |
- $Definition = $this->{'definition' . $definitionType}($Line, $CurrentBlock); | |
- if (isset($Definition)) { | |
- $this->Definitions[$definitionType][$Definition['id']] = $Definition['data']; | |
- continue 2; | |
- } | |
- } | |
- } | |
- $blockTypes = $this->unmarkedBlockTypes; | |
- if (isset($this->BlockTypes[$marker])) { | |
- foreach ($this->BlockTypes[$marker] as $blockType) { | |
- $blockTypes[] = $blockType; | |
- } | |
- } | |
- foreach ($blockTypes as $blockType) { | |
- $Block = $this->{'block' . $blockType}($Line, $CurrentBlock); | |
- if (isset($Block)) { | |
- $Block['type'] = $blockType; | |
- if (!isset($Block['identified'])) { | |
- $Elements[] = $CurrentBlock['element']; | |
- $Block['identified'] = true; | |
- } | |
- if (method_exists($this, 'block' . $blockType . 'Continue')) { | |
- $Block['incomplete'] = true; | |
- } | |
- $CurrentBlock = $Block; | |
- continue 2; | |
- } | |
- } | |
- if (isset($CurrentBlock) and !isset($CurrentBlock['type']) and !isset($CurrentBlock['interrupted'])) { | |
- $CurrentBlock['element']['text'].= "\n" . $text; | |
- } else { | |
- $Elements[] = $CurrentBlock['element']; | |
- $CurrentBlock = $this->paragraph($Line); | |
- $CurrentBlock['identified'] = true; | |
- } | |
- } | |
- if (isset($CurrentBlock['incomplete']) and method_exists($this, 'block' . $CurrentBlock['type'] . 'Complete')) { | |
- $CurrentBlock = $this->{'block' . $CurrentBlock['type'] . 'Complete'}($CurrentBlock); | |
- } | |
- $Elements[] = $CurrentBlock['element']; | |
- unset($Elements[0]); | |
- $markup = $this->elements($Elements); | |
- return $markup; | |
- } | |
- protected function blockCode($Line, $Block = null) { | |
- if (isset($Block) and !isset($Block['type']) and !isset($Block['interrupted'])) { | |
- return; | |
- } | |
- if ($Line['indent'] >= 4) { | |
- $text = substr($Line['body'], 4); | |
- $Block = array('element' => array('name' => 'pre', 'handler' => 'element', 'text' => array('name' => 'code', 'text' => $text,),),); | |
- return $Block; | |
- } | |
- } | |
- protected function blockCodeContinue($Line, $Block) { | |
- if ($Line['indent'] >= 4) { | |
- if (isset($Block['interrupted'])) { | |
- $Block['element']['text']['text'].= "\n"; | |
- unset($Block['interrupted']); | |
- } | |
- $Block['element']['text']['text'].= "\n"; | |
- $text = substr($Line['body'], 4); | |
- $Block['element']['text']['text'].= $text; | |
- return $Block; | |
- } | |
- } | |
- protected function blockCodeComplete($Block) { | |
- $text = $Block['element']['text']['text']; | |
- $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); | |
- $Block['element']['text']['text'] = $text; | |
- return $Block; | |
- } | |
- protected function blockComment($Line) { | |
- if ($this->markupEscaped) { | |
- return; | |
- } | |
- if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') { | |
- $Block = array('element' => array('text' => $Line['body'],),); | |
- if (preg_match('/-->$/', $Line['text'])) { | |
- $Block['closed'] = true; | |
- } | |
- return $Block; | |
- } | |
- } | |
- protected function blockCommentContinue($Line, array $Block) { | |
- if (isset($Block['closed'])) { | |
- return; | |
- } | |
- $Block['element']['text'].= "\n" . $Line['body']; | |
- if (preg_match('/-->$/', $Line['text'])) { | |
- $Block['closed'] = true; | |
- } | |
- return $Block; | |
- } | |
- protected function blockFencedCode($Line) { | |
- if (preg_match('/^([' . $Line['text'][0] . ']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches)) { | |
- $Element = array('name' => 'code', 'text' => '',); | |
- if (isset($matches[2])) { | |
- $class = 'language-' . $matches[2]; | |
- $Element['attributes'] = array('class' => $class,); | |
- } | |
- $Block = array('char' => $Line['text'][0], 'element' => array('name' => 'pre', 'handler' => 'element', 'text' => $Element,),); | |
- return $Block; | |
- } | |
- } | |
- protected function blockFencedCodeContinue($Line, $Block) { | |
- if (isset($Block['complete'])) { | |
- return; | |
- } | |
- if (isset($Block['interrupted'])) { | |
- $Block['element']['text']['text'].= "\n"; | |
- unset($Block['interrupted']); | |
- } | |
- if (preg_match('/^' . $Block['char'] . '{3,}[ ]*$/', $Line['text'])) { | |
- $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1); | |
- $Block['complete'] = true; | |
- return $Block; | |
- } | |
- $Block['element']['text']['text'].= "\n" . $Line['body'];; | |
- return $Block; | |
- } | |
- protected function blockFencedCodeComplete($Block) { | |
- $text = $Block['element']['text']['text']; | |
- $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); | |
- $Block['element']['text']['text'] = $text; | |
- return $Block; | |
- } | |
- protected function blockHeader($Line) { | |
- if (isset($Line['text'][1])) { | |
- $level = 1; | |
- while (isset($Line['text'][$level]) and $Line['text'][$level] === '#') { | |
- $level++; | |
- } | |
- if ($level > 6 or $Line['text'][$level] !== ' ') { | |
- return; | |
- } | |
- $text = trim($Line['text'], '# '); | |
- $Block = array('element' => array('name' => 'h' . min(6, $level), 'text' => $text, 'handler' => 'line',),); | |
- return $Block; | |
- } | |
- } | |
- protected function blockList($Line) { | |
- list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]'); | |
- if (preg_match('/^(' . $pattern . '[ ]+)(.*)/', $Line['text'], $matches)) { | |
- $Block = array('indent' => $Line['indent'], 'pattern' => $pattern, 'element' => array('name' => $name, 'handler' => 'elements',),); | |
- $Block['li'] = array('name' => 'li', 'handler' => 'li', 'text' => array($matches[2],),); | |
- $Block['element']['text'][] = & $Block['li']; | |
- return $Block; | |
- } | |
- } | |
- protected function blockListContinue($Line, array $Block) { | |
- if ($Block['indent'] === $Line['indent'] and preg_match('/^' . $Block['pattern'] . '[ ]+(.*)/', $Line['text'], $matches)) { | |
- if (isset($Block['interrupted'])) { | |
- $Block['li']['text'][] = ''; | |
- unset($Block['interrupted']); | |
- } | |
- unset($Block['li']); | |
- $Block['li'] = array('name' => 'li', 'handler' => 'li', 'text' => array($matches[1],),); | |
- $Block['element']['text'][] = & $Block['li']; | |
- return $Block; | |
- } | |
- if (!isset($Block['interrupted'])) { | |
- $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); | |
- $Block['li']['text'][] = $text; | |
- return $Block; | |
- } | |
- if ($Line['indent'] > 0) { | |
- $Block['li']['text'][] = ''; | |
- $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); | |
- $Block['li']['text'][] = $text; | |
- unset($Block['interrupted']); | |
- return $Block; | |
- } | |
- } | |
- protected function blockQuote($Line) { | |
- if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) { | |
- $Block = array('element' => array('name' => 'blockquote', 'handler' => 'lines', 'text' => (array)$matches[1],),); | |
- return $Block; | |
- } | |
- } | |
- protected function blockQuoteContinue($Line, array $Block) { | |
- if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) { | |
- if (isset($Block['interrupted'])) { | |
- $Block['element']['text'][] = ''; | |
- unset($Block['interrupted']); | |
- } | |
- $Block['element']['text'][] = $matches[1]; | |
- return $Block; | |
- } | |
- if (!isset($Block['interrupted'])) { | |
- $Block['element']['text'][] = $Line['text']; | |
- return $Block; | |
- } | |
- } | |
- protected function blockRule($Line) { | |
- if (preg_match('/^([' . $Line['text'][0] . '])([ ]*\1){2,}[ ]*$/', $Line['text'])) { | |
- $Block = array('element' => array('name' => 'hr'),); | |
- return $Block; | |
- } | |
- } | |
- protected function blockSetextHeader($Line, array $Block = null) { | |
- if (!isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) { | |
- return; | |
- } | |
- if (chop($Line['text'], $Line['text'][0]) === '') { | |
- $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2'; | |
- return $Block; | |
- } | |
- } | |
- protected function blockMarkup($Line) { | |
- if ($this->markupEscaped) { | |
- return; | |
- } | |
- $attrName = '[a-zA-Z_:][\w:.-]*'; | |
- $attrValue = '(?:[^"\'=<>`\s]+|".*?"|\'.*?\')'; | |
- preg_match('/^<(\w[\d\w]*)((?:\s' . $attrName . '(?:\s*=\s*' . $attrValue . ')?)*)\s*(\/?)>/', $Line['text'], $matches); | |
- if (!$matches or in_array($matches[1], $this->textLevelElements)) { | |
- return; | |
- } | |
- $Block = array('depth' => 0, 'element' => array('name' => $matches[1], 'text' => null,),); | |
- $remainder = substr($Line['text'], strlen($matches[0])); | |
- if (trim($remainder) === '') { | |
- if ($matches[3] or in_array($matches[1], $this->voidElements)) { | |
- $Block['closed'] = true; | |
- } | |
- } else { | |
- if ($matches[3] or in_array($matches[1], $this->voidElements)) { | |
- return; | |
- } | |
- preg_match('/(.*)<\/' . $matches[1] . '>\s*$/i', $remainder, $nestedMatches); | |
- if ($nestedMatches) { | |
- $Block['closed'] = true; | |
- $Block['element']['text'] = $nestedMatches[1]; | |
- } else { | |
- $Block['element']['text'] = $remainder; | |
- } | |
- } | |
- if (!$matches[2]) { | |
- return $Block; | |
- } | |
- preg_match_all('/\s(' . $attrName . ')(?:\s*=\s*(' . $attrValue . '))?/', $matches[2], $nestedMatches, PREG_SET_ORDER); | |
- foreach ($nestedMatches as $nestedMatch) { | |
- if (!isset($nestedMatch[2])) { | |
- $Block['element']['attributes'][$nestedMatch[1]] = ''; | |
- } elseif ($nestedMatch[2][0] === '"' or $nestedMatch[2][0] === '\'') { | |
- $Block['element']['attributes'][$nestedMatch[1]] = substr($nestedMatch[2], 1, -1); | |
- } else { | |
- $Block['element']['attributes'][$nestedMatch[1]] = $nestedMatch[2]; | |
- } | |
- } | |
- return $Block; | |
- } | |
- protected function blockMarkupContinue($Line, array $Block) { | |
- if (isset($Block['closed'])) { | |
- return; | |
- } | |
- if (preg_match('/^<' . $Block['element']['name'] . '(?:\s.*[\'"])?\s*>/i', $Line['text'])) { | |
- $Block['depth']++; | |
- } | |
- if (preg_match('/(.*?)<\/' . $Block['element']['name'] . '>\s*$/i', $Line['text'], $matches)) { | |
- if ($Block['depth'] > 0) { | |
- $Block['depth']--; | |
- } else { | |
- $Block['element']['text'].= "\n"; | |
- $Block['closed'] = true; | |
- } | |
- $Block['element']['text'].= $matches[1]; | |
- } | |
- if (isset($Block['interrupted'])) { | |
- $Block['element']['text'].= "\n"; | |
- unset($Block['interrupted']); | |
- } | |
- if (!isset($Block['closed'])) { | |
- $Block['element']['text'].= "\n" . $Line['body']; | |
- } | |
- return $Block; | |
- } | |
- protected function blockTable($Line, array $Block = null) { | |
- if (!isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) { | |
- return; | |
- } | |
- if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '') { | |
- $alignments = array(); | |
- $divider = $Line['text']; | |
- $divider = trim($divider); | |
- $divider = trim($divider, '|'); | |
- $dividerCells = explode('|', $divider); | |
- foreach ($dividerCells as $dividerCell) { | |
- $dividerCell = trim($dividerCell); | |
- if ($dividerCell === '') { | |
- continue; | |
- } | |
- $alignment = null; | |
- if ($dividerCell[0] === ':') { | |
- $alignment = 'left'; | |
- } | |
- if (substr($dividerCell, -1) === ':') { | |
- $alignment = $alignment === 'left' ? 'center' : 'right'; | |
- } | |
- $alignments[] = $alignment; | |
- } | |
- $HeaderElements = array(); | |
- $header = $Block['element']['text']; | |
- $header = trim($header); | |
- $header = trim($header, '|'); | |
- $headerCells = explode('|', $header); | |
- foreach ($headerCells as $index => $headerCell) { | |
- $headerCell = trim($headerCell); | |
- $HeaderElement = array('name' => 'th', 'text' => $headerCell, 'handler' => 'line',); | |
- if (isset($alignments[$index])) { | |
- $alignment = $alignments[$index]; | |
- $HeaderElement['attributes'] = array('align' => $alignment,); | |
- } | |
- $HeaderElements[] = $HeaderElement; | |
- } | |
- $Block = array('alignments' => $alignments, 'identified' => true, 'element' => array('name' => 'table', 'handler' => 'elements',),); | |
- $Block['element']['text'][] = array('name' => 'thead', 'handler' => 'elements',); | |
- $Block['element']['text'][] = array('name' => 'tbody', 'handler' => 'elements', 'text' => array(),); | |
- $Block['element']['text'][0]['text'][] = array('name' => 'tr', 'handler' => 'elements', 'text' => $HeaderElements,); | |
- return $Block; | |
- } | |
- } | |
- protected function blockTableContinue($Line, array $Block) { | |
- if ($Line['text'][0] === '|' or strpos($Line['text'], '|')) { | |
- $Elements = array(); | |
- $row = $Line['text']; | |
- $row = trim($row); | |
- $row = trim($row, '|'); | |
- $cells = explode('|', $row); | |
- foreach ($cells as $index => $cell) { | |
- $cell = trim($cell); | |
- $Element = array('name' => 'td', 'handler' => 'line', 'text' => $cell,); | |
- if (isset($Block['alignments'][$index])) { | |
- $Element['attributes'] = array('align' => $Block['alignments'][$index],); | |
- } | |
- $Elements[] = $Element; | |
- } | |
- $Element = array('name' => 'tr', 'handler' => 'elements', 'text' => $Elements,); | |
- $Block['element']['text'][1]['text'][] = $Element; | |
- return $Block; | |
- } | |
- } | |
- protected function definitionReference($Line) { | |
- if (preg_match('/^\[(.+?)\]:[ ]*<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches)) { | |
- $Definition = array('id' => strtolower($matches[1]), 'data' => array('url' => $matches[2], 'title' => null,),); | |
- if (isset($matches[3])) { | |
- $Definition['data']['title'] = $matches[3]; | |
- } | |
- return $Definition; | |
- } | |
- } | |
- protected function paragraph($Line) { | |
- $Block = array('element' => array('name' => 'p', 'text' => $Line['text'], 'handler' => 'line',),); | |
- return $Block; | |
- } | |
- protected function element(array $Element) { | |
- $markup = ''; | |
- if (isset($Element['name'])) { | |
- $markup.= '<' . $Element['name']; | |
- if (isset($Element['attributes'])) { | |
- foreach ($Element['attributes'] as $name => $value) { | |
- if ($value === null) { | |
- continue; | |
- } | |
- $markup.= ' ' . $name . '="' . $value . '"'; | |
- } | |
- } | |
- if (isset($Element['text'])) { | |
- $markup.= '>'; | |
- } else { | |
- $markup.= ' />'; | |
- return $markup; | |
- } | |
- } | |
- if (isset($Element['text'])) { | |
- if (isset($Element['handler'])) { | |
- $markup.= $this->$Element['handler']($Element['text']); | |
- } else { | |
- $markup.= $Element['text']; | |
- } | |
- } | |
- if (isset($Element['name'])) { | |
- $markup.= '</' . $Element['name'] . '>'; | |
- } | |
- return $markup; | |
- } | |
- protected function elements(array $Elements) { | |
- $markup = ''; | |
- foreach ($Elements as $Element) { | |
- if ($Element === null) { | |
- continue; | |
- } | |
- $markup.= "\n" . $this->element($Element); | |
- } | |
- $markup.= "\n"; | |
- return $markup; | |
- } | |
- protected $InlineTypes = array('"' => array('QuotationMark'), '!' => array('Image'), '&' => array('Ampersand'), '*' => array('Emphasis'), '<' => array('UrlTag', 'EmailTag', 'Tag', 'LessThan'), '>' => array('GreaterThan'), '[' => array('Link'), '_' => array('Emphasis'), '`' => array('Code'), '~' => array('Strikethrough'), '\\' => array('EscapeSequence'),); | |
- protected $inlineMarkerList = '!"*_&[<>`~\\'; | |
- public function line($text) { | |
- $markup = ''; | |
- $remainder = $text; | |
- $markerPosition = 0; | |
- while ($excerpt = strpbrk($remainder, $this->inlineMarkerList)) { | |
- $marker = $excerpt[0]; | |
- $markerPosition+= strpos($remainder, $marker); | |
- foreach ($this->InlineTypes[$marker] as $inlineType) { | |
- $handler = 'inline' . $inlineType; | |
- $Inline = $this->$handler($excerpt); | |
- if (!isset($Inline)) { | |
- continue; | |
- } | |
- $plainText = substr($text, 0, $markerPosition); | |
- $markup.= $this->unmarkedText($plainText); | |
- $markup.= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']); | |
- $text = substr($text, $markerPosition + $Inline['extent']); | |
- $remainder = $text; | |
- $markerPosition = 0; | |
- continue 2; | |
- } | |
- $remainder = substr($excerpt, 1); | |
- $markerPosition++; | |
- } | |
- $markup.= $this->unmarkedText($text); | |
- return $markup; | |
- } | |
- protected function inlineAmpersand($excerpt) { | |
- if (!preg_match('/^&#?\w+;/', $excerpt)) { | |
- return array('markup' => '&', 'extent' => 1,); | |
- } | |
- } | |
- protected function inlineStrikethrough($excerpt) { | |
- if (!isset($excerpt[1])) { | |
- return; | |
- } | |
- if ($excerpt[1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $excerpt, $matches)) { | |
- return array('extent' => strlen($matches[0]), 'element' => array('name' => 'del', 'text' => $matches[1], 'handler' => 'line',),); | |
- } | |
- } | |
- protected function inlineEscapeSequence($excerpt) { | |
- if (isset($excerpt[1]) and in_array($excerpt[1], $this->specialCharacters)) { | |
- return array('markup' => $excerpt[1], 'extent' => 2,); | |
- } | |
- } | |
- protected function inlineLessThan() { | |
- return array('markup' => '<', 'extent' => 1,); | |
- } | |
- protected function inlineGreaterThan() { | |
- return array('markup' => '>', 'extent' => 1,); | |
- } | |
- protected function inlineQuotationMark() { | |
- return array('markup' => '"', 'extent' => 1,); | |
- } | |
- protected function inlineUrlTag($excerpt) { | |
- if (strpos($excerpt, '>') !== false and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $excerpt, $matches)) { | |
- $url = str_replace(array('&', '<'), array('&', '<'), $matches[1]); | |
- return array('extent' => strlen($matches[0]), 'element' => array('name' => 'a', 'text' => $url, 'attributes' => array('href' => $url,),),); | |
- } | |
- } | |
- protected function inlineEmailTag($excerpt) { | |
- if (strpos($excerpt, '>') !== false and preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $excerpt, $matches)) { | |
- $url = $matches[1]; | |
- if (!isset($matches[2])) { | |
- $url = 'mailto:' . $url; | |
- } | |
- return array('extent' => strlen($matches[0]), 'element' => array('name' => 'a', 'text' => $matches[1], 'attributes' => array('href' => $url,),),); | |
- } | |
- } | |
- protected function inlineTag($excerpt) { | |
- if ($this->markupEscaped) { | |
- return; | |
- } | |
- if (strpos($excerpt, '>') !== false and preg_match('/^<\/?\w.*?>/s', $excerpt, $matches)) { | |
- return array('markup' => $matches[0], 'extent' => strlen($matches[0]),); | |
- } | |
- } | |
- protected function inlineCode($excerpt) { | |
- $marker = $excerpt[0]; | |
- if (preg_match('/^(' . $marker . '+)[ ]*(.+?)[ ]*(?<!' . $marker . ')\1(?!' . $marker . ')/s', $excerpt, $matches)) { | |
- $text = $matches[2]; | |
- $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); | |
- $text = preg_replace("/[ ]*\n/", ' ', $text); | |
- return array('extent' => strlen($matches[0]), 'element' => array('name' => 'code', 'text' => $text,),); | |
- } | |
- } | |
- protected function inlineImage($excerpt) { | |
- if (!isset($excerpt[1]) or $excerpt[1] !== '[') { | |
- return; | |
- } | |
- $excerpt = substr($excerpt, 1); | |
- $Inline = $this->inlineLink($excerpt); | |
- if ($Inline === null) { | |
- return; | |
- } | |
- $Inline['extent']++; | |
- $Inline['element'] = array('name' => 'img', 'attributes' => array('src' => $Inline['element']['attributes']['href'], 'alt' => $Inline['element']['text'], 'title' => $Inline['element']['attributes']['title'],),); | |
- return $Inline; | |
- } | |
- protected function inlineLink($excerpt) { | |
- $Element = array('name' => 'a', 'handler' => 'line', 'text' => null, 'attributes' => array('href' => null, 'title' => null,),); | |
- $extent = 0; | |
- $remainder = $excerpt; | |
- if (preg_match('/\[((?:[^][]|(?R))*)\]/', $remainder, $matches)) { | |
- $Element['text'] = $matches[1]; | |
- $extent+= strlen($matches[0]); | |
- $remainder = substr($remainder, $extent); | |
- } else { | |
- return; | |
- } | |
- if (preg_match('/^\([ ]*([^ ]+?)(?:[ ]+(".+?"|\'.+?\'))?[ ]*\)/', $remainder, $matches)) { | |
- $Element['attributes']['href'] = $matches[1]; | |
- if (isset($matches[2])) { | |
- $Element['attributes']['title'] = substr($matches[2], 1, -1); | |
- } | |
- $extent+= strlen($matches[0]); | |
- } else { | |
- if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) { | |
- $definition = $matches[1] ? $matches[1] : $Element['text']; | |
- $definition = strtolower($definition); | |
- $extent+= strlen($matches[0]); | |
- } else { | |
- $definition = strtolower($Element['text']); | |
- } | |
- if (!isset($this->Definitions['Reference'][$definition])) { | |
- return; | |
- } | |
- $Definition = $this->Definitions['Reference'][$definition]; | |
- $Element['attributes']['href'] = $Definition['url']; | |
- $Element['attributes']['title'] = $Definition['title']; | |
- } | |
- $Element['attributes']['href'] = str_replace(array('&', '<'), array('&', '<'), $Element['attributes']['href']); | |
- return array('extent' => $extent, 'element' => $Element,); | |
- } | |
- protected function inlineEmphasis($excerpt) { | |
- if (!isset($excerpt[1])) { | |
- return; | |
- } | |
- $marker = $excerpt[0]; | |
- if ($excerpt[1] === $marker and preg_match($this->StrongRegex[$marker], $excerpt, $matches)) { | |
- $emphasis = 'strong'; | |
- } elseif (preg_match($this->EmRegex[$marker], $excerpt, $matches)) { | |
- $emphasis = 'em'; | |
- } else { | |
- return; | |
- } | |
- return array('extent' => strlen($matches[0]), 'element' => array('name' => $emphasis, 'handler' => 'line', 'text' => $matches[1],),); | |
- } | |
- protected $unmarkedInlineTypes = array(" \n" => 'Break', '://' => 'Url',); | |
- protected function unmarkedText($text) { | |
- foreach ($this->unmarkedInlineTypes as $snippet => $inlineType) { | |
- if (strpos($text, $snippet) !== false) { | |
- $text = $this->{'unmarkedInline' . $inlineType}($text); | |
- } | |
- } | |
- return $text; | |
- } | |
- protected function unmarkedInlineBreak($text) { | |
- if ($this->breaksEnabled) { | |
- $text = preg_replace('/[ ]*\n/', "<br />\n", $text); | |
- } else { | |
- $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text); | |
- $text = str_replace(" \n", "\n", $text); | |
- } | |
- return $text; | |
- } | |
- protected function unmarkedInlineUrl($text) { | |
- if ($this->urlsLinked !== true) { | |
- return $text; | |
- } | |
- $re = '/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui'; | |
- $offset = 0; | |
- while (strpos($text, '://', $offset) and preg_match($re, $text, $matches, PREG_OFFSET_CAPTURE, $offset)) { | |
- $url = $matches[0][0]; | |
- $urlLength = strlen($url); | |
- $urlPosition = $matches[0][1]; | |
- $markup = '<a href="' . $url . '">' . $url . '</a>'; | |
- $markupLength = strlen($markup); | |
- $text = substr_replace($text, $markup, $urlPosition, $urlLength); | |
- $offset = $urlPosition + $markupLength; | |
- } | |
- return $text; | |
- } | |
- protected function li($lines) { | |
- $markup = $this->lines($lines); | |
- $trimmedMarkup = trim($markup); | |
- if (!in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '<p>') { | |
- $markup = $trimmedMarkup; | |
- $markup = substr($markup, 3); | |
- $position = strpos($markup, "</p>"); | |
- $markup = substr_replace($markup, '', $position, 4); | |
- } | |
- return $markup; | |
- } | |
- static function instance($name = 'default') { | |
- if (isset(self::$instances[$name])) { | |
- return self::$instances[$name]; | |
- } | |
- $instance = new self(); | |
- self::$instances[$name] = $instance; | |
- return $instance; | |
- } | |
- private static $instances = array(); | |
- function parse($text) { | |
- $markup = $this->text($text); | |
- return $markup; | |
- } | |
- protected $Definitions; | |
- protected $specialCharacters = array('\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!',); | |
- protected $StrongRegex = array('*' => '/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s', '_' => '/^__((?:\\\\_|[^_]|_[^_]*_)+?)__(?!_)/us',); | |
- protected $EmRegex = array('*' => '/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s', '_' => '/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us',); | |
- protected $voidElements = array('area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source',); | |
- protected $textLevelElements = array('a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', 'i', 'rp', 'del', 'code', 'strike', 'marquee', 'q', 'rt', 'ins', 'font', 'strong', 's', 'tt', 'sub', 'mark', 'u', 'xm', 'sup', 'nobr', 'var', 'ruby', 'wbr', 'span', 'time',); | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Parsedown { | |
+ function text($text) { | |
+ $this->Definitions = array(); | |
+ $text = str_replace("\r\n", "\n", $text); | |
+ $text = str_replace("\r", "\n", $text); | |
+ $text = trim($text, "\n"); | |
+ $lines = explode("\n", $text); | |
+ $markup = $this->lines($lines); | |
+ $markup = trim($markup, "\n"); | |
+ return $markup; | |
+ } | |
+ private $breaksEnabled; | |
+ function setBreaksEnabled($breaksEnabled) { | |
+ $this->breaksEnabled = $breaksEnabled; | |
+ return $this; | |
+ } | |
+ private $markupEscaped; | |
+ function setMarkupEscaped($markupEscaped) { | |
+ $this->markupEscaped = $markupEscaped; | |
+ return $this; | |
+ } | |
+ private $urlsLinked = true; | |
+ function setUrlsLinked($urlsLinked) { | |
+ $this->urlsLinked = $urlsLinked; | |
+ return $this; | |
+ } | |
+ protected $BlockTypes = array('#' => array('Header'), '*' => array('Rule', 'List'), '+' => array('List'), '-' => array('SetextHeader', 'Table', 'Rule', 'List'), '0' => array('List'), '1' => array('List'), '2' => array('List'), '3' => array('List'), '4' => array('List'), '5' => array('List'), '6' => array('List'), '7' => array('List'), '8' => array('List'), '9' => array('List'), ':' => array('Table'), '<' => array('Comment', 'Markup'), '=' => array('SetextHeader'), '>' => array('Quote'), '_' => array('Rule'), '`' => array('FencedCode'), '|' => array('Table'), '~' => array('FencedCode'),); | |
+ protected $DefinitionTypes = array('[' => array('Reference'),); | |
+ protected $unmarkedBlockTypes = array('Code',); | |
+ private function lines(array $lines) { | |
+ $CurrentBlock = null; | |
+ foreach ($lines as $line) { | |
+ if (chop($line) === '') { | |
+ if (isset($CurrentBlock)) { | |
+ $CurrentBlock['interrupted'] = true; | |
+ } | |
+ continue; | |
+ } | |
+ if (strpos($line, "\t") !== false) { | |
+ $parts = explode("\t", $line); | |
+ $line = $parts[0]; | |
+ unset($parts[0]); | |
+ foreach ($parts as $part) { | |
+ $shortage = 4 - mb_strlen($line, 'utf-8') % 4; | |
+ $line.= str_repeat(' ', $shortage); | |
+ $line.= $part; | |
+ } | |
+ } | |
+ $indent = 0; | |
+ while (isset($line[$indent]) and $line[$indent] === ' ') { | |
+ $indent++; | |
+ } | |
+ $text = $indent > 0 ? substr($line, $indent) : $line; | |
+ $Line = array('body' => $line, 'indent' => $indent, 'text' => $text); | |
+ if (isset($CurrentBlock['incomplete'])) { | |
+ $Block = $this->{'block' . $CurrentBlock['type'] . 'Continue'}($Line, $CurrentBlock); | |
+ if (isset($Block)) { | |
+ $CurrentBlock = $Block; | |
+ continue; | |
+ } else { | |
+ if (method_exists($this, 'block' . $CurrentBlock['type'] . 'Complete')) { | |
+ $CurrentBlock = $this->{'block' . $CurrentBlock['type'] . 'Complete'}($CurrentBlock); | |
+ } | |
+ unset($CurrentBlock['incomplete']); | |
+ } | |
+ } | |
+ $marker = $text[0]; | |
+ if (isset($this->DefinitionTypes[$marker])) { | |
+ foreach ($this->DefinitionTypes[$marker] as $definitionType) { | |
+ $Definition = $this->{'definition' . $definitionType}($Line, $CurrentBlock); | |
+ if (isset($Definition)) { | |
+ $this->Definitions[$definitionType][$Definition['id']] = $Definition['data']; | |
+ continue 2; | |
+ } | |
+ } | |
+ } | |
+ $blockTypes = $this->unmarkedBlockTypes; | |
+ if (isset($this->BlockTypes[$marker])) { | |
+ foreach ($this->BlockTypes[$marker] as $blockType) { | |
+ $blockTypes[] = $blockType; | |
+ } | |
+ } | |
+ foreach ($blockTypes as $blockType) { | |
+ $Block = $this->{'block' . $blockType}($Line, $CurrentBlock); | |
+ if (isset($Block)) { | |
+ $Block['type'] = $blockType; | |
+ if (!isset($Block['identified'])) { | |
+ $Elements[] = $CurrentBlock['element']; | |
+ $Block['identified'] = true; | |
+ } | |
+ if (method_exists($this, 'block' . $blockType . 'Continue')) { | |
+ $Block['incomplete'] = true; | |
+ } | |
+ $CurrentBlock = $Block; | |
+ continue 2; | |
+ } | |
+ } | |
+ if (isset($CurrentBlock) and !isset($CurrentBlock['type']) and !isset($CurrentBlock['interrupted'])) { | |
+ $CurrentBlock['element']['text'].= "\n" . $text; | |
+ } else { | |
+ $Elements[] = $CurrentBlock['element']; | |
+ $CurrentBlock = $this->paragraph($Line); | |
+ $CurrentBlock['identified'] = true; | |
+ } | |
+ } | |
+ if (isset($CurrentBlock['incomplete']) and method_exists($this, 'block' . $CurrentBlock['type'] . 'Complete')) { | |
+ $CurrentBlock = $this->{'block' . $CurrentBlock['type'] . 'Complete'}($CurrentBlock); | |
+ } | |
+ $Elements[] = $CurrentBlock['element']; | |
+ unset($Elements[0]); | |
+ $markup = $this->elements($Elements); | |
+ return $markup; | |
+ } | |
+ protected function blockCode($Line, $Block = null) { | |
+ if (isset($Block) and !isset($Block['type']) and !isset($Block['interrupted'])) { | |
+ return; | |
+ } | |
+ if ($Line['indent'] >= 4) { | |
+ $text = substr($Line['body'], 4); | |
+ $Block = array('element' => array('name' => 'pre', 'handler' => 'element', 'text' => array('name' => 'code', 'text' => $text,),),); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockCodeContinue($Line, $Block) { | |
+ if ($Line['indent'] >= 4) { | |
+ if (isset($Block['interrupted'])) { | |
+ $Block['element']['text']['text'].= "\n"; | |
+ unset($Block['interrupted']); | |
+ } | |
+ $Block['element']['text']['text'].= "\n"; | |
+ $text = substr($Line['body'], 4); | |
+ $Block['element']['text']['text'].= $text; | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockCodeComplete($Block) { | |
+ $text = $Block['element']['text']['text']; | |
+ $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); | |
+ $Block['element']['text']['text'] = $text; | |
+ return $Block; | |
+ } | |
+ protected function blockComment($Line) { | |
+ if ($this->markupEscaped) { | |
+ return; | |
+ } | |
+ if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') { | |
+ $Block = array('element' => array('text' => $Line['body'],),); | |
+ if (preg_match('/-->$/', $Line['text'])) { | |
+ $Block['closed'] = true; | |
+ } | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockCommentContinue($Line, array $Block) { | |
+ if (isset($Block['closed'])) { | |
+ return; | |
+ } | |
+ $Block['element']['text'].= "\n" . $Line['body']; | |
+ if (preg_match('/-->$/', $Line['text'])) { | |
+ $Block['closed'] = true; | |
+ } | |
+ return $Block; | |
+ } | |
+ protected function blockFencedCode($Line) { | |
+ if (preg_match('/^([' . $Line['text'][0] . ']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches)) { | |
+ $Element = array('name' => 'code', 'text' => '',); | |
+ if (isset($matches[2])) { | |
+ $class = 'language-' . $matches[2]; | |
+ $Element['attributes'] = array('class' => $class,); | |
+ } | |
+ $Block = array('char' => $Line['text'][0], 'element' => array('name' => 'pre', 'handler' => 'element', 'text' => $Element,),); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockFencedCodeContinue($Line, $Block) { | |
+ if (isset($Block['complete'])) { | |
+ return; | |
+ } | |
+ if (isset($Block['interrupted'])) { | |
+ $Block['element']['text']['text'].= "\n"; | |
+ unset($Block['interrupted']); | |
+ } | |
+ if (preg_match('/^' . $Block['char'] . '{3,}[ ]*$/', $Line['text'])) { | |
+ $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1); | |
+ $Block['complete'] = true; | |
+ return $Block; | |
+ } | |
+ $Block['element']['text']['text'].= "\n" . $Line['body'];; | |
+ return $Block; | |
+ } | |
+ protected function blockFencedCodeComplete($Block) { | |
+ $text = $Block['element']['text']['text']; | |
+ $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); | |
+ $Block['element']['text']['text'] = $text; | |
+ return $Block; | |
+ } | |
+ protected function blockHeader($Line) { | |
+ if (isset($Line['text'][1])) { | |
+ $level = 1; | |
+ while (isset($Line['text'][$level]) and $Line['text'][$level] === '#') { | |
+ $level++; | |
+ } | |
+ if ($level > 6 or $Line['text'][$level] !== ' ') { | |
+ return; | |
+ } | |
+ $text = trim($Line['text'], '# '); | |
+ $Block = array('element' => array('name' => 'h' . min(6, $level), 'text' => $text, 'handler' => 'line',),); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockList($Line) { | |
+ list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]'); | |
+ if (preg_match('/^(' . $pattern . '[ ]+)(.*)/', $Line['text'], $matches)) { | |
+ $Block = array('indent' => $Line['indent'], 'pattern' => $pattern, 'element' => array('name' => $name, 'handler' => 'elements',),); | |
+ $Block['li'] = array('name' => 'li', 'handler' => 'li', 'text' => array($matches[2],),); | |
+ $Block['element']['text'][] = & $Block['li']; | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockListContinue($Line, array $Block) { | |
+ if ($Block['indent'] === $Line['indent'] and preg_match('/^' . $Block['pattern'] . '[ ]+(.*)/', $Line['text'], $matches)) { | |
+ if (isset($Block['interrupted'])) { | |
+ $Block['li']['text'][] = ''; | |
+ unset($Block['interrupted']); | |
+ } | |
+ unset($Block['li']); | |
+ $Block['li'] = array('name' => 'li', 'handler' => 'li', 'text' => array($matches[1],),); | |
+ $Block['element']['text'][] = & $Block['li']; | |
+ return $Block; | |
+ } | |
+ if (!isset($Block['interrupted'])) { | |
+ $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); | |
+ $Block['li']['text'][] = $text; | |
+ return $Block; | |
+ } | |
+ if ($Line['indent'] > 0) { | |
+ $Block['li']['text'][] = ''; | |
+ $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); | |
+ $Block['li']['text'][] = $text; | |
+ unset($Block['interrupted']); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockQuote($Line) { | |
+ if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) { | |
+ $Block = array('element' => array('name' => 'blockquote', 'handler' => 'lines', 'text' => (array)$matches[1],),); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockQuoteContinue($Line, array $Block) { | |
+ if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) { | |
+ if (isset($Block['interrupted'])) { | |
+ $Block['element']['text'][] = ''; | |
+ unset($Block['interrupted']); | |
+ } | |
+ $Block['element']['text'][] = $matches[1]; | |
+ return $Block; | |
+ } | |
+ if (!isset($Block['interrupted'])) { | |
+ $Block['element']['text'][] = $Line['text']; | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockRule($Line) { | |
+ if (preg_match('/^([' . $Line['text'][0] . '])([ ]*\1){2,}[ ]*$/', $Line['text'])) { | |
+ $Block = array('element' => array('name' => 'hr'),); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockSetextHeader($Line, array $Block = null) { | |
+ if (!isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) { | |
+ return; | |
+ } | |
+ if (chop($Line['text'], $Line['text'][0]) === '') { | |
+ $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2'; | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockMarkup($Line) { | |
+ if ($this->markupEscaped) { | |
+ return; | |
+ } | |
+ $attrName = '[a-zA-Z_:][\w:.-]*'; | |
+ $attrValue = '(?:[^"\'=<>`\s]+|".*?"|\'.*?\')'; | |
+ preg_match('/^<(\w[\d\w]*)((?:\s' . $attrName . '(?:\s*=\s*' . $attrValue . ')?)*)\s*(\/?)>/', $Line['text'], $matches); | |
+ if (!$matches or in_array($matches[1], $this->textLevelElements)) { | |
+ return; | |
+ } | |
+ $Block = array('depth' => 0, 'element' => array('name' => $matches[1], 'text' => null,),); | |
+ $remainder = substr($Line['text'], strlen($matches[0])); | |
+ if (trim($remainder) === '') { | |
+ if ($matches[3] or in_array($matches[1], $this->voidElements)) { | |
+ $Block['closed'] = true; | |
+ } | |
+ } else { | |
+ if ($matches[3] or in_array($matches[1], $this->voidElements)) { | |
+ return; | |
+ } | |
+ preg_match('/(.*)<\/' . $matches[1] . '>\s*$/i', $remainder, $nestedMatches); | |
+ if ($nestedMatches) { | |
+ $Block['closed'] = true; | |
+ $Block['element']['text'] = $nestedMatches[1]; | |
+ } else { | |
+ $Block['element']['text'] = $remainder; | |
+ } | |
+ } | |
+ if (!$matches[2]) { | |
+ return $Block; | |
+ } | |
+ preg_match_all('/\s(' . $attrName . ')(?:\s*=\s*(' . $attrValue . '))?/', $matches[2], $nestedMatches, PREG_SET_ORDER); | |
+ foreach ($nestedMatches as $nestedMatch) { | |
+ if (!isset($nestedMatch[2])) { | |
+ $Block['element']['attributes'][$nestedMatch[1]] = ''; | |
+ } elseif ($nestedMatch[2][0] === '"' or $nestedMatch[2][0] === '\'') { | |
+ $Block['element']['attributes'][$nestedMatch[1]] = substr($nestedMatch[2], 1, -1); | |
+ } else { | |
+ $Block['element']['attributes'][$nestedMatch[1]] = $nestedMatch[2]; | |
+ } | |
+ } | |
+ return $Block; | |
+ } | |
+ protected function blockMarkupContinue($Line, array $Block) { | |
+ if (isset($Block['closed'])) { | |
+ return; | |
+ } | |
+ if (preg_match('/^<' . $Block['element']['name'] . '(?:\s.*[\'"])?\s*>/i', $Line['text'])) { | |
+ $Block['depth']++; | |
+ } | |
+ if (preg_match('/(.*?)<\/' . $Block['element']['name'] . '>\s*$/i', $Line['text'], $matches)) { | |
+ if ($Block['depth'] > 0) { | |
+ $Block['depth']--; | |
+ } else { | |
+ $Block['element']['text'].= "\n"; | |
+ $Block['closed'] = true; | |
+ } | |
+ $Block['element']['text'].= $matches[1]; | |
+ } | |
+ if (isset($Block['interrupted'])) { | |
+ $Block['element']['text'].= "\n"; | |
+ unset($Block['interrupted']); | |
+ } | |
+ if (!isset($Block['closed'])) { | |
+ $Block['element']['text'].= "\n" . $Line['body']; | |
+ } | |
+ return $Block; | |
+ } | |
+ protected function blockTable($Line, array $Block = null) { | |
+ if (!isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) { | |
+ return; | |
+ } | |
+ if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '') { | |
+ $alignments = array(); | |
+ $divider = $Line['text']; | |
+ $divider = trim($divider); | |
+ $divider = trim($divider, '|'); | |
+ $dividerCells = explode('|', $divider); | |
+ foreach ($dividerCells as $dividerCell) { | |
+ $dividerCell = trim($dividerCell); | |
+ if ($dividerCell === '') { | |
+ continue; | |
+ } | |
+ $alignment = null; | |
+ if ($dividerCell[0] === ':') { | |
+ $alignment = 'left'; | |
+ } | |
+ if (substr($dividerCell, -1) === ':') { | |
+ $alignment = $alignment === 'left' ? 'center' : 'right'; | |
+ } | |
+ $alignments[] = $alignment; | |
+ } | |
+ $HeaderElements = array(); | |
+ $header = $Block['element']['text']; | |
+ $header = trim($header); | |
+ $header = trim($header, '|'); | |
+ $headerCells = explode('|', $header); | |
+ foreach ($headerCells as $index => $headerCell) { | |
+ $headerCell = trim($headerCell); | |
+ $HeaderElement = array('name' => 'th', 'text' => $headerCell, 'handler' => 'line',); | |
+ if (isset($alignments[$index])) { | |
+ $alignment = $alignments[$index]; | |
+ $HeaderElement['attributes'] = array('align' => $alignment,); | |
+ } | |
+ $HeaderElements[] = $HeaderElement; | |
+ } | |
+ $Block = array('alignments' => $alignments, 'identified' => true, 'element' => array('name' => 'table', 'handler' => 'elements',),); | |
+ $Block['element']['text'][] = array('name' => 'thead', 'handler' => 'elements',); | |
+ $Block['element']['text'][] = array('name' => 'tbody', 'handler' => 'elements', 'text' => array(),); | |
+ $Block['element']['text'][0]['text'][] = array('name' => 'tr', 'handler' => 'elements', 'text' => $HeaderElements,); | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function blockTableContinue($Line, array $Block) { | |
+ if ($Line['text'][0] === '|' or strpos($Line['text'], '|')) { | |
+ $Elements = array(); | |
+ $row = $Line['text']; | |
+ $row = trim($row); | |
+ $row = trim($row, '|'); | |
+ $cells = explode('|', $row); | |
+ foreach ($cells as $index => $cell) { | |
+ $cell = trim($cell); | |
+ $Element = array('name' => 'td', 'handler' => 'line', 'text' => $cell,); | |
+ if (isset($Block['alignments'][$index])) { | |
+ $Element['attributes'] = array('align' => $Block['alignments'][$index],); | |
+ } | |
+ $Elements[] = $Element; | |
+ } | |
+ $Element = array('name' => 'tr', 'handler' => 'elements', 'text' => $Elements,); | |
+ $Block['element']['text'][1]['text'][] = $Element; | |
+ return $Block; | |
+ } | |
+ } | |
+ protected function definitionReference($Line) { | |
+ if (preg_match('/^\[(.+?)\]:[ ]*<?(\S+?)>?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches)) { | |
+ $Definition = array('id' => strtolower($matches[1]), 'data' => array('url' => $matches[2], 'title' => null,),); | |
+ if (isset($matches[3])) { | |
+ $Definition['data']['title'] = $matches[3]; | |
+ } | |
+ return $Definition; | |
+ } | |
+ } | |
+ protected function paragraph($Line) { | |
+ $Block = array('element' => array('name' => 'p', 'text' => $Line['text'], 'handler' => 'line',),); | |
+ return $Block; | |
+ } | |
+ protected function element(array $Element) { | |
+ $markup = ''; | |
+ if (isset($Element['name'])) { | |
+ $markup.= '<' . $Element['name']; | |
+ if (isset($Element['attributes'])) { | |
+ foreach ($Element['attributes'] as $name => $value) { | |
+ if ($value === null) { | |
+ continue; | |
+ } | |
+ $markup.= ' ' . $name . '="' . $value . '"'; | |
+ } | |
+ } | |
+ if (isset($Element['text'])) { | |
+ $markup.= '>'; | |
+ } else { | |
+ $markup.= ' />'; | |
+ return $markup; | |
+ } | |
+ } | |
+ if (isset($Element['text'])) { | |
+ if (isset($Element['handler'])) { | |
+ $markup.= $this->$Element['handler']($Element['text']); | |
+ } else { | |
+ $markup.= $Element['text']; | |
+ } | |
+ } | |
+ if (isset($Element['name'])) { | |
+ $markup.= '</' . $Element['name'] . '>'; | |
+ } | |
+ return $markup; | |
+ } | |
+ protected function elements(array $Elements) { | |
+ $markup = ''; | |
+ foreach ($Elements as $Element) { | |
+ if ($Element === null) { | |
+ continue; | |
+ } | |
+ $markup.= "\n" . $this->element($Element); | |
+ } | |
+ $markup.= "\n"; | |
+ return $markup; | |
+ } | |
+ protected $InlineTypes = array('"' => array('QuotationMark'), '!' => array('Image'), '&' => array('Ampersand'), '*' => array('Emphasis'), '<' => array('UrlTag', 'EmailTag', 'Tag', 'LessThan'), '>' => array('GreaterThan'), '[' => array('Link'), '_' => array('Emphasis'), '`' => array('Code'), '~' => array('Strikethrough'), '\\' => array('EscapeSequence'),); | |
+ protected $inlineMarkerList = '!"*_&[<>`~\\'; | |
+ public function line($text) { | |
+ $markup = ''; | |
+ $remainder = $text; | |
+ $markerPosition = 0; | |
+ while ($excerpt = strpbrk($remainder, $this->inlineMarkerList)) { | |
+ $marker = $excerpt[0]; | |
+ $markerPosition+= strpos($remainder, $marker); | |
+ foreach ($this->InlineTypes[$marker] as $inlineType) { | |
+ $handler = 'inline' . $inlineType; | |
+ $Inline = $this->$handler($excerpt); | |
+ if (!isset($Inline)) { | |
+ continue; | |
+ } | |
+ $plainText = substr($text, 0, $markerPosition); | |
+ $markup.= $this->unmarkedText($plainText); | |
+ $markup.= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']); | |
+ $text = substr($text, $markerPosition + $Inline['extent']); | |
+ $remainder = $text; | |
+ $markerPosition = 0; | |
+ continue 2; | |
+ } | |
+ $remainder = substr($excerpt, 1); | |
+ $markerPosition++; | |
+ } | |
+ $markup.= $this->unmarkedText($text); | |
+ return $markup; | |
+ } | |
+ protected function inlineAmpersand($excerpt) { | |
+ if (!preg_match('/^&#?\w+;/', $excerpt)) { | |
+ return array('markup' => '&', 'extent' => 1,); | |
+ } | |
+ } | |
+ protected function inlineStrikethrough($excerpt) { | |
+ if (!isset($excerpt[1])) { | |
+ return; | |
+ } | |
+ if ($excerpt[1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $excerpt, $matches)) { | |
+ return array('extent' => strlen($matches[0]), 'element' => array('name' => 'del', 'text' => $matches[1], 'handler' => 'line',),); | |
+ } | |
+ } | |
+ protected function inlineEscapeSequence($excerpt) { | |
+ if (isset($excerpt[1]) and in_array($excerpt[1], $this->specialCharacters)) { | |
+ return array('markup' => $excerpt[1], 'extent' => 2,); | |
+ } | |
+ } | |
+ protected function inlineLessThan() { | |
+ return array('markup' => '<', 'extent' => 1,); | |
+ } | |
+ protected function inlineGreaterThan() { | |
+ return array('markup' => '>', 'extent' => 1,); | |
+ } | |
+ protected function inlineQuotationMark() { | |
+ return array('markup' => '"', 'extent' => 1,); | |
+ } | |
+ protected function inlineUrlTag($excerpt) { | |
+ if (strpos($excerpt, '>') !== false and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $excerpt, $matches)) { | |
+ $url = str_replace(array('&', '<'), array('&', '<'), $matches[1]); | |
+ return array('extent' => strlen($matches[0]), 'element' => array('name' => 'a', 'text' => $url, 'attributes' => array('href' => $url,),),); | |
+ } | |
+ } | |
+ protected function inlineEmailTag($excerpt) { | |
+ if (strpos($excerpt, '>') !== false and preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $excerpt, $matches)) { | |
+ $url = $matches[1]; | |
+ if (!isset($matches[2])) { | |
+ $url = 'mailto:' . $url; | |
+ } | |
+ return array('extent' => strlen($matches[0]), 'element' => array('name' => 'a', 'text' => $matches[1], 'attributes' => array('href' => $url,),),); | |
+ } | |
+ } | |
+ protected function inlineTag($excerpt) { | |
+ if ($this->markupEscaped) { | |
+ return; | |
+ } | |
+ if (strpos($excerpt, '>') !== false and preg_match('/^<\/?\w.*?>/s', $excerpt, $matches)) { | |
+ return array('markup' => $matches[0], 'extent' => strlen($matches[0]),); | |
+ } | |
+ } | |
+ protected function inlineCode($excerpt) { | |
+ $marker = $excerpt[0]; | |
+ if (preg_match('/^(' . $marker . '+)[ ]*(.+?)[ ]*(?<!' . $marker . ')\1(?!' . $marker . ')/s', $excerpt, $matches)) { | |
+ $text = $matches[2]; | |
+ $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); | |
+ $text = preg_replace("/[ ]*\n/", ' ', $text); | |
+ return array('extent' => strlen($matches[0]), 'element' => array('name' => 'code', 'text' => $text,),); | |
+ } | |
+ } | |
+ protected function inlineImage($excerpt) { | |
+ if (!isset($excerpt[1]) or $excerpt[1] !== '[') { | |
+ return; | |
+ } | |
+ $excerpt = substr($excerpt, 1); | |
+ $Inline = $this->inlineLink($excerpt); | |
+ if ($Inline === null) { | |
+ return; | |
+ } | |
+ $Inline['extent']++; | |
+ $Inline['element'] = array('name' => 'img', 'attributes' => array('src' => $Inline['element']['attributes']['href'], 'alt' => $Inline['element']['text'], 'title' => $Inline['element']['attributes']['title'],),); | |
+ return $Inline; | |
+ } | |
+ protected function inlineLink($excerpt) { | |
+ $Element = array('name' => 'a', 'handler' => 'line', 'text' => null, 'attributes' => array('href' => null, 'title' => null,),); | |
+ $extent = 0; | |
+ $remainder = $excerpt; | |
+ if (preg_match('/\[((?:[^][]|(?R))*)\]/', $remainder, $matches)) { | |
+ $Element['text'] = $matches[1]; | |
+ $extent+= strlen($matches[0]); | |
+ $remainder = substr($remainder, $extent); | |
+ } else { | |
+ return; | |
+ } | |
+ if (preg_match('/^\([ ]*([^ ]+?)(?:[ ]+(".+?"|\'.+?\'))?[ ]*\)/', $remainder, $matches)) { | |
+ $Element['attributes']['href'] = $matches[1]; | |
+ if (isset($matches[2])) { | |
+ $Element['attributes']['title'] = substr($matches[2], 1, -1); | |
+ } | |
+ $extent+= strlen($matches[0]); | |
+ } else { | |
+ if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) { | |
+ $definition = $matches[1] ? $matches[1] : $Element['text']; | |
+ $definition = strtolower($definition); | |
+ $extent+= strlen($matches[0]); | |
+ } else { | |
+ $definition = strtolower($Element['text']); | |
+ } | |
+ if (!isset($this->Definitions['Reference'][$definition])) { | |
+ return; | |
+ } | |
+ $Definition = $this->Definitions['Reference'][$definition]; | |
+ $Element['attributes']['href'] = $Definition['url']; | |
+ $Element['attributes']['title'] = $Definition['title']; | |
+ } | |
+ $Element['attributes']['href'] = str_replace(array('&', '<'), array('&', '<'), $Element['attributes']['href']); | |
+ return array('extent' => $extent, 'element' => $Element,); | |
+ } | |
+ protected function inlineEmphasis($excerpt) { | |
+ if (!isset($excerpt[1])) { | |
+ return; | |
+ } | |
+ $marker = $excerpt[0]; | |
+ if ($excerpt[1] === $marker and preg_match($this->StrongRegex[$marker], $excerpt, $matches)) { | |
+ $emphasis = 'strong'; | |
+ } elseif (preg_match($this->EmRegex[$marker], $excerpt, $matches)) { | |
+ $emphasis = 'em'; | |
+ } else { | |
+ return; | |
+ } | |
+ return array('extent' => strlen($matches[0]), 'element' => array('name' => $emphasis, 'handler' => 'line', 'text' => $matches[1],),); | |
+ } | |
+ protected $unmarkedInlineTypes = array(" \n" => 'Break', '://' => 'Url',); | |
+ protected function unmarkedText($text) { | |
+ foreach ($this->unmarkedInlineTypes as $snippet => $inlineType) { | |
+ if (strpos($text, $snippet) !== false) { | |
+ $text = $this->{'unmarkedInline' . $inlineType}($text); | |
+ } | |
+ } | |
+ return $text; | |
+ } | |
+ protected function unmarkedInlineBreak($text) { | |
+ if ($this->breaksEnabled) { | |
+ $text = preg_replace('/[ ]*\n/', "<br />\n", $text); | |
+ } else { | |
+ $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "<br />\n", $text); | |
+ $text = str_replace(" \n", "\n", $text); | |
+ } | |
+ return $text; | |
+ } | |
+ protected function unmarkedInlineUrl($text) { | |
+ if ($this->urlsLinked !== true) { | |
+ return $text; | |
+ } | |
+ $re = '/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui'; | |
+ $offset = 0; | |
+ while (strpos($text, '://', $offset) and preg_match($re, $text, $matches, PREG_OFFSET_CAPTURE, $offset)) { | |
+ $url = $matches[0][0]; | |
+ $urlLength = strlen($url); | |
+ $urlPosition = $matches[0][1]; | |
+ $markup = '<a href="' . $url . '">' . $url . '</a>'; | |
+ $markupLength = strlen($markup); | |
+ $text = substr_replace($text, $markup, $urlPosition, $urlLength); | |
+ $offset = $urlPosition + $markupLength; | |
+ } | |
+ return $text; | |
+ } | |
+ protected function li($lines) { | |
+ $markup = $this->lines($lines); | |
+ $trimmedMarkup = trim($markup); | |
+ if (!in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '<p>') { | |
+ $markup = $trimmedMarkup; | |
+ $markup = substr($markup, 3); | |
+ $position = strpos($markup, "</p>"); | |
+ $markup = substr_replace($markup, '', $position, 4); | |
+ } | |
+ return $markup; | |
+ } | |
+ static function instance($name = 'default') { | |
+ if (isset(self::$instances[$name])) { | |
+ return self::$instances[$name]; | |
+ } | |
+ $instance = new self(); | |
+ self::$instances[$name] = $instance; | |
+ return $instance; | |
+ } | |
+ private static $instances = array(); | |
+ function parse($text) { | |
+ $markup = $this->text($text); | |
+ return $markup; | |
+ } | |
+ protected $Definitions; | |
+ protected $specialCharacters = array('\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!',); | |
+ protected $StrongRegex = array('*' => '/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s', '_' => '/^__((?:\\\\_|[^_]|_[^_]*_)+?)__(?!_)/us',); | |
+ protected $EmRegex = array('*' => '/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s', '_' => '/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us',); | |
+ protected $voidElements = array('area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source',); | |
+ protected $textLevelElements = array('a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', 'i', 'rp', 'del', 'code', 'strike', 'marquee', 'q', 'rt', 'ins', 'font', 'strong', 's', 'tt', 'sub', 'mark', 'u', 'xm', 'sup', 'nobr', 'var', 'ruby', 'wbr', 'span', 'time',); | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/LICENSE.txt ./seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/LICENSE.txt | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/LICENSE.txt 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_WPReadmeParser/library/AdminPageFramework_Parsedown/LICENSE.txt 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,23 +1,23 @@ | |
-Parsedown | |
-http://parsedown.org | |
- | |
-The MIT License (MIT) | |
- | |
-Copyright (c) 2013 Emanuil Rusev, erusev.com | |
- | |
-Permission is hereby granted, free of charge, to any person obtaining a copy of | |
-this software and associated documentation files (the "Software"), to deal in | |
-the Software without restriction, including without limitation the rights to | |
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
-the Software, and to permit persons to whom the Software is furnished to do so, | |
-subject to the following conditions: | |
- | |
-The above copyright notice and this permission notice shall be included in all | |
-copies or substantial portions of the Software. | |
- | |
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | |
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | |
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | |
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
+Parsedown | |
+http://parsedown.org | |
+ | |
+The MIT License (MIT) | |
+ | |
+Copyright (c) 2013 Emanuil Rusev, erusev.com | |
+ | |
+Permission is hereby granted, free of charge, to any person obtaining a copy of | |
+this software and associated documentation files (the "Software"), to deal in | |
+the Software without restriction, including without limitation the rights to | |
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
+the Software, and to permit persons to whom the Software is furnished to do so, | |
+subject to the following conditions: | |
+ | |
+The above copyright notice and this permission notice shall be included in all | |
+copies or substantial portions of the Software. | |
+ | |
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | |
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | |
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | |
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_Zip.php ./seamless-donations/library/apf/utility/AdminPageFramework_Zip.php | |
--- /home/brandthropology/Downloads/seamless-donations/library/apf/utility/AdminPageFramework_Zip.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/library/apf/utility/AdminPageFramework_Zip.php 2015-08-28 11:56:42.430489276 -0400 | |
@@ -1,113 +1,113 @@ | |
-<?php | |
-/** | |
- Admin Page Framework v3.5.6 by Michael Uno | |
- Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
- <http://en.michaeluno.jp/admin-page-framework> | |
- Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
- */ | |
-class SeamlessDonationsAdminPageFramework_Zip { | |
- public $sSource; | |
- public $sDestination; | |
- public $bIncludeDir = false; | |
- public $aCallbacks = array('file_name' => null, 'file_contents' => null, 'directory_name' => null,); | |
- public function __construct($sSource, $sDestination, $bIncludeDir = false, array $aCallbacks = array()) { | |
- $this->sSource = $sSource; | |
- $this->sDestination = $sDestination; | |
- $this->bIncludeDir = $bIncludeDir; | |
- $this->aCallbacks = $aCallbacks + $this->aCallbacks; | |
- } | |
- public function compress() { | |
- if (!$this->isFeasible($this->sSource)) { | |
- return false; | |
- } | |
- if (file_exists($this->sDestination)) { | |
- unlink($this->sDestination); | |
- } | |
- $_oZip = new ZipArchive(); | |
- if (!$_oZip->open($this->sDestination, ZIPARCHIVE::CREATE)) { | |
- return false; | |
- } | |
- $this->sSource = str_replace('\\', '/', realpath($this->sSource)); | |
- $_aMethods = array('unknown' => '_returnFalse', 'directory' => '_compressDirectory', 'file' => '_compressFile',); | |
- $_sMethodName = $_aMethods[$this->_getSourceType($this->sSource) ]; | |
- return call_user_func_array(array($this, $_sMethodName), array($_oZip, $this->sSource, $this->aCallbacks, $this->bIncludeDir)); | |
- } | |
- private function _compressDirectory(ZipArchive $oZip, $sSource, array $aCallbacks = array(), $bIncludeDir = false) { | |
- $_oFilesIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sSource), RecursiveIteratorIterator::SELF_FIRST); | |
- if ($bIncludeDir) { | |
- $this->_addEmptyDir($oZip, $this->_getMainDirectoryName($sSource), $aCallbacks['directory_name']); | |
- $sSource = $this->_getSubSourceDirPath($sSource); | |
- } | |
- foreach ($_oFilesIterator as $_sIterationItem) { | |
- $this->_addArchiveItem($oZip, $sSource, $_sIterationItem, $aCallbacks); | |
- } | |
- return $oZip->close(); | |
- } | |
- private function _addArchiveItem(ZipArchive $oZip, $sSource, $_sIterationItem, array $aCallbacks) { | |
- $_sIterationItem = str_replace('\\', '/', $_sIterationItem); | |
- if (in_array(substr($_sIterationItem, strrpos($_sIterationItem, '/') + 1), array('.', '..'))) { | |
- return; | |
- } | |
- $_sIterationItem = realpath($_sIterationItem); | |
- $_sIterationItem = str_replace('\\', '/', $_sIterationItem); | |
- if (true === is_dir($_sIterationItem)) { | |
- $this->_addEmptyDir($oZip, str_replace($sSource . '/', '', $_sIterationItem . '/'), $aCallbacks['directory_name']); | |
- } else if (true === is_file($_sIterationItem)) { | |
- $this->_addFromString($oZip, str_replace($sSource . '/', '', $_sIterationItem), file_get_contents($_sIterationItem), $aCallbacks); | |
- } | |
- } | |
- private function _getMainDirectoryName($sSource) { | |
- $_aPathParts = explode("/", $sSource); | |
- return $_aPathParts[count($_aPathParts) - 1]; | |
- } | |
- private function _getSubSourceDirPath($sSource) { | |
- $_aPathParts = explode("/", $sSource); | |
- $sSource = ''; | |
- for ($i = 0;$i < count($_aPathParts) - 1;$i++) { | |
- $sSource.= '/' . $_aPathParts[$i]; | |
- } | |
- return substr($sSource, 1); | |
- } | |
- private function _compressFile(ZipArchive $oZip, $sSource, $aCallbacks = null) { | |
- $this->_addFromString($oZip, basename($sSource), file_get_contents($sSource), $aCallbacks); | |
- return $oZip->close(); | |
- } | |
- private function _getSourceType($sSource) { | |
- if (true === is_dir($sSource)) { | |
- return 'directory'; | |
- } | |
- if (true === is_file($sSource)) { | |
- return 'file'; | |
- } | |
- return 'unknown'; | |
- } | |
- private function isFeasible($sSource) { | |
- if (!extension_loaded('zip')) { | |
- return false; | |
- } | |
- if (!file_exists($sSource)) { | |
- return false; | |
- } | |
- return true; | |
- } | |
- private function _returnFalse() { | |
- return false; | |
- } | |
- private function _addEmptyDir(ZipArchive $oZip, $sInsidePath, $oCallable) { | |
- $sInsidePath = $this->_getFilteredArchivePath($sInsidePath, $oCallable); | |
- if (!strlen($sInsidePath)) { | |
- return; | |
- } | |
- $oZip->addEmptyDir($sInsidePath); | |
- } | |
- private function _addFromString(ZipArchive $oZip, $sInsidePath, $sSourceContents = '', array $aCallbacks = array()) { | |
- $sInsidePath = $this->_getFilteredArchivePath($sInsidePath, $aCallbacks['file_name']); | |
- if (!strlen($sInsidePath)) { | |
- return; | |
- } | |
- $oZip->addFromString($sInsidePath, is_callable($aCallbacks['file_contents']) ? call_user_func_array($aCallbacks['file_contents'], array($sSourceContents, $sInsidePath)) : $sSourceContents); | |
- } | |
- private function _getFilteredArchivePath($sArchivePath, $oCallable) { | |
- return is_callable($oCallable) ? call_user_func_array($oCallable, array($sArchivePath,)) : $sArchivePath; | |
- } | |
+<?php | |
+/** | |
+ Admin Page Framework v3.5.6 by Michael Uno | |
+ Generated by PHP Class Files Script Generator <https://github.com/michaeluno/PHP-Class-Files-Script-Generator> | |
+ <http://en.michaeluno.jp/admin-page-framework> | |
+ Copyright (c) 2013-2015, Michael Uno; Licensed under MIT <http://opensource.org/licenses/MIT> | |
+ */ | |
+class SeamlessDonationsAdminPageFramework_Zip { | |
+ public $sSource; | |
+ public $sDestination; | |
+ public $bIncludeDir = false; | |
+ public $aCallbacks = array('file_name' => null, 'file_contents' => null, 'directory_name' => null,); | |
+ public function __construct($sSource, $sDestination, $bIncludeDir = false, array $aCallbacks = array()) { | |
+ $this->sSource = $sSource; | |
+ $this->sDestination = $sDestination; | |
+ $this->bIncludeDir = $bIncludeDir; | |
+ $this->aCallbacks = $aCallbacks + $this->aCallbacks; | |
+ } | |
+ public function compress() { | |
+ if (!$this->isFeasible($this->sSource)) { | |
+ return false; | |
+ } | |
+ if (file_exists($this->sDestination)) { | |
+ unlink($this->sDestination); | |
+ } | |
+ $_oZip = new ZipArchive(); | |
+ if (!$_oZip->open($this->sDestination, ZIPARCHIVE::CREATE)) { | |
+ return false; | |
+ } | |
+ $this->sSource = str_replace('\\', '/', realpath($this->sSource)); | |
+ $_aMethods = array('unknown' => '_returnFalse', 'directory' => '_compressDirectory', 'file' => '_compressFile',); | |
+ $_sMethodName = $_aMethods[$this->_getSourceType($this->sSource) ]; | |
+ return call_user_func_array(array($this, $_sMethodName), array($_oZip, $this->sSource, $this->aCallbacks, $this->bIncludeDir)); | |
+ } | |
+ private function _compressDirectory(ZipArchive $oZip, $sSource, array $aCallbacks = array(), $bIncludeDir = false) { | |
+ $_oFilesIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sSource), RecursiveIteratorIterator::SELF_FIRST); | |
+ if ($bIncludeDir) { | |
+ $this->_addEmptyDir($oZip, $this->_getMainDirectoryName($sSource), $aCallbacks['directory_name']); | |
+ $sSource = $this->_getSubSourceDirPath($sSource); | |
+ } | |
+ foreach ($_oFilesIterator as $_sIterationItem) { | |
+ $this->_addArchiveItem($oZip, $sSource, $_sIterationItem, $aCallbacks); | |
+ } | |
+ return $oZip->close(); | |
+ } | |
+ private function _addArchiveItem(ZipArchive $oZip, $sSource, $_sIterationItem, array $aCallbacks) { | |
+ $_sIterationItem = str_replace('\\', '/', $_sIterationItem); | |
+ if (in_array(substr($_sIterationItem, strrpos($_sIterationItem, '/') + 1), array('.', '..'))) { | |
+ return; | |
+ } | |
+ $_sIterationItem = realpath($_sIterationItem); | |
+ $_sIterationItem = str_replace('\\', '/', $_sIterationItem); | |
+ if (true === is_dir($_sIterationItem)) { | |
+ $this->_addEmptyDir($oZip, str_replace($sSource . '/', '', $_sIterationItem . '/'), $aCallbacks['directory_name']); | |
+ } else if (true === is_file($_sIterationItem)) { | |
+ $this->_addFromString($oZip, str_replace($sSource . '/', '', $_sIterationItem), file_get_contents($_sIterationItem), $aCallbacks); | |
+ } | |
+ } | |
+ private function _getMainDirectoryName($sSource) { | |
+ $_aPathParts = explode("/", $sSource); | |
+ return $_aPathParts[count($_aPathParts) - 1]; | |
+ } | |
+ private function _getSubSourceDirPath($sSource) { | |
+ $_aPathParts = explode("/", $sSource); | |
+ $sSource = ''; | |
+ for ($i = 0;$i < count($_aPathParts) - 1;$i++) { | |
+ $sSource.= '/' . $_aPathParts[$i]; | |
+ } | |
+ return substr($sSource, 1); | |
+ } | |
+ private function _compressFile(ZipArchive $oZip, $sSource, $aCallbacks = null) { | |
+ $this->_addFromString($oZip, basename($sSource), file_get_contents($sSource), $aCallbacks); | |
+ return $oZip->close(); | |
+ } | |
+ private function _getSourceType($sSource) { | |
+ if (true === is_dir($sSource)) { | |
+ return 'directory'; | |
+ } | |
+ if (true === is_file($sSource)) { | |
+ return 'file'; | |
+ } | |
+ return 'unknown'; | |
+ } | |
+ private function isFeasible($sSource) { | |
+ if (!extension_loaded('zip')) { | |
+ return false; | |
+ } | |
+ if (!file_exists($sSource)) { | |
+ return false; | |
+ } | |
+ return true; | |
+ } | |
+ private function _returnFalse() { | |
+ return false; | |
+ } | |
+ private function _addEmptyDir(ZipArchive $oZip, $sInsidePath, $oCallable) { | |
+ $sInsidePath = $this->_getFilteredArchivePath($sInsidePath, $oCallable); | |
+ if (!strlen($sInsidePath)) { | |
+ return; | |
+ } | |
+ $oZip->addEmptyDir($sInsidePath); | |
+ } | |
+ private function _addFromString(ZipArchive $oZip, $sInsidePath, $sSourceContents = '', array $aCallbacks = array()) { | |
+ $sInsidePath = $this->_getFilteredArchivePath($sInsidePath, $aCallbacks['file_name']); | |
+ if (!strlen($sInsidePath)) { | |
+ return; | |
+ } | |
+ $oZip->addFromString($sInsidePath, is_callable($aCallbacks['file_contents']) ? call_user_func_array($aCallbacks['file_contents'], array($sSourceContents, $sInsidePath)) : $sSourceContents); | |
+ } | |
+ private function _getFilteredArchivePath($sArchivePath, $oCallable) { | |
+ return is_callable($oCallable) ? call_user_func_array($oCallable, array($sArchivePath,)) : $sArchivePath; | |
+ } | |
} | |
\ No newline at end of file | |
diff -uar /home/brandthropology/Downloads/seamless-donations/seamless-donations-form.php ./seamless-donations/seamless-donations-form.php | |
--- /home/brandthropology/Downloads/seamless-donations/seamless-donations-form.php 2015-08-27 14:10:45.000000000 -0400 | |
+++ ./seamless-donations/seamless-donations-form.php 2015-08-28 11:44:21.272488588 -0400 | |
@@ -66,6 +66,8 @@ | |
$form['outermost_container']['paypal_section'] = seamless_donations_get_paypal_section (); | |
$form['outermost_container']['submit_section'] = seamless_donations_get_submit_section (); | |
+ $form = apply_filters( 'seamless_donations_form_section_order', $form); | |
+ | |
// build and display the form | |
$html = seamless_donations_forms_engine ( $form ); | |
Only in /home/brandthropology/Downloads/seamless-donations: seamless-donations-payment.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment