File manager - Edit - /home/aussies6/public_html/wp-content/plugins/custom-woocommerce-emails/pages/cwe-admin-page.php
Back
<?php global $wp_scripts, $woocommerce, $woocommerce, $current_user, $email_control_template_collection; ?> <div class="wp-core-ui ec cwe-admin-page pe-in-admin-page"> <!-- Left Column --> <div class="left-column"> <?php // Load WC Emails // ---------------------------------------- // Load mailer if ( class_exists('WC') ) { $mailer = WC()->mailer(); $mails = $mailer->get_emails(); } else{ $mailer = $woocommerce->mailer(); $mails = $mailer->get_emails(); } $show_type = isset($_REQUEST["cwe_email_type"]) ? sanitize_text_field( $_REQUEST["cwe_email_type"] ) : current($mails)->id ; // Load WC Orders // ---------------------------------------- $limit_orders = 800; $order_collection = new WP_Query(array( 'post_type' => 'shop_order', 'post_status' => array_keys( wc_get_order_statuses() ), 'posts_per_page' => $limit_orders, )); $order_collection = $order_collection->posts; $latest_order = ( count( $order_collection ) ) ? current( $order_collection )->ID : FALSE ; $show_order = isset($_REQUEST["cwe_email_order"]) ? sanitize_text_field( $_REQUEST["cwe_email_order"] ) : $latest_order ; $src_url = ""; $src_url .= 'admin.php?'; $src_url .= 'page=custom_woocommerce_email'; $src_url .= '&cwe_render_email=true'; $src_url .= '&cwe_email_type=' . $show_type; if ( $show_order ) { $src_url .= '&cwe_email_order='.$show_order; } ?> <div class="ec-admin-panel ec-admin-panel-controls"> <div class="main-controls-top-button-row"> <?php $backlink = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : admin_url() ; if ( strrpos($backlink,'login')!= -1 ) $backlink = admin_url() ; ?> <a class="button-primary exit-button" href="<?php echo $backlink; ?>"> <span class="dashicons dashicons-arrow-left ec-back-icon"></span> <?php _e( "Back", 'email-control' ); ?> </a> </div> <form class="main-controls-form" id="render_email" name="render_email" data-name="Render Email" action="<?php echo wp_nonce_url( admin_url( $src_url ), 'email-control'); ?>" target="my-iframe" method="post" > <div class="main-controls"> <div class="main-controls-element main-controls-element-heading-block"> <div class="heading-first"> <h2><?php _e( "Custom Woo Emails","email-control"); ?></h2> </div> </div> <div class="main-controls-element"> <label class="controls-label"> <?php _e( "Edit Email","email-control") ; ?> <span class="help-icon" title="<?php _e( 'Choose which email to preview or send.', 'email-control' ); ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> <select class="w-select control-dropdown" id="cwe_email_type" name="cwe_email_type"> <option value=""> Select one... </option> <?php //Customer_Invoice if ( !empty( $mails ) ) { foreach ( $mails as $mail ) { ?> <option value="<?php echo $mail->id ?>" <?php echo ($show_type == $mail->id) ? "selected" : "" ; ?> > <?php echo ucwords($mail->title); ?> </option> <?php } } ?> </select> </div> </div> </div> <?php global $cwe_email_templates; if ( isset($cwe_email_templates) && is_array($cwe_email_templates) ) : ?> <div class="main-controls-element"> <label class="controls-label"> <?php _e( "Edit Template","email-control") ; ?> <span class="help-icon" title="<?php _e( 'Edit the email.', 'email-control' ); ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> <select class="w-select control-dropdown" id="cwe_email_template" name="cwe_email_template"> <option value="woocommerce_original"> <?php _e( 'WooCommerce (original, not editable)', 'email-control' ); ?> </option> <?php $cwe_template_selected = get_option("cwe_template"); foreach ($cwe_email_templates as $cwe_email_template_key => $cwe_email_template_args ) { $name = $cwe_email_template_args['name']; $woocommerce_version_pass = cwe_check_template_version( $cwe_email_template_key ); ?> <option class="template-select" value="<?php echo $cwe_email_template_key; ?>" <?php echo ( $cwe_email_template_key == $cwe_template_selected ) ? "selected" : "" ; ?> > <?php echo $name; ?><?php if ( ! $woocommerce_version_pass ) echo ' ' . __( '(WooCommerce update required)', 'email-control' ) ?> </option> <?php } ?> </select> <input type="hidden" name="cwe_email_template_active" id="cwe_email_template_active" class="cwe_email_template_active" value="<?php echo $cwe_template_selected; ?>" > <input type="hidden" name="cwe_email_template_preview" id="cwe_email_template_preview" class="cwe_email_template_preview"> </div> <div class="controls-inner-row controls-inner-button-row cwe_template_button_row" id="template-commit"> <a class="button" id="cwe_cancel_email_template" href="#"><i class="cxectrl-icon-reply"></i> <?php _e( "Don't Use", 'email-control' ); ?></a> <a class="button-primary" id="cwe_save_email_template" href="#"><i class="cxectrl-icon-check"></i> <?php _e( "Use", 'email-control' ); ?></a> </div> </div> </div> <?php endif; ?> <div class="main-controls-element" id="cwe_edit_content_controls"> <label class="controls-label"> <?php _e( "Customize Template","email-control") ; ?> <span class="help-icon" title="<?php _e( 'Customize the email that you are showing.', 'email-control' ); ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> <a class="button" id="cwe_edit_content" href="#"> <i class="cxectrl-icon-pencil"></i> <?php _e( "Customize", 'email-control' ); ?> </a> </div> </div> <?php if ( false ) : ?> <div class="get_templates button"><?php _e( "Get Customized Templates", 'email-control' ); ?></div> <div class="get_templates_flyout"> <!-- More Templates --> </div> <?php endif; ?> </div> <div class="main-controls-element"> <label class="controls-label"> <?php _e( "Order Preview","email-control") ; ?> <span class="help-icon" title="<?php _e( 'Choose which order to use to populate the email template preview.', 'email-control' ); ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> <select class="w-select control-dropdown" id="cwe_email_order" name="cwe_email_order"> <?php if ( count( $order_collection ) ) { ?> <option value=""> <?php _e( "Select one...", 'email-control' ); ?> </option> <?php } else { ?> <option value=""> <?php _e( "There are no orders to preview...", 'email-control' ); ?> </option> <?php } // Show the orders. foreach ($order_collection as $order_item) { $order = new WC_Order( $order_item->ID ); ?> <!-- <option value="<?php echo "['" . $order_item->ID . "','" . $order->billing_email . "']" ?>" <?php echo ( $order_item->ID == $show_order ) ? "selected" : "" ; ?> > --> <option value="<?php echo $order_item->ID ?>" data-order-email="<?php echo $order->billing_email ?>" <?php echo ( $order_item->ID == $show_order ) ? "selected" : "" ; ?> > <?php echo $order->get_order_number() ?> - <?php echo $order->billing_first_name ?> <?php echo $order->billing_last_name ?> (<?php echo $order->billing_email ?>) </option> <?php } // If more than the orders limit then let the user know. if ( $limit_orders <= count( $order_collection ) ) { ?> <option><?php printf( __( '...Showing the most recent %u orders', 'email-control' ), $limit_orders ); ?></option> <?php } ?> </select> </div> </div> </div> <div class="main-controls-element"> <label class="controls-label"> <?php _e( "Show Header Info", 'email-control' ) ; ?> <span class="help-icon" title="<?php _e( 'Display the email header information.', 'email-control' ); ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> <label for="header_info"> <?php $field_default = "off"; $field_value = get_user_meta( $current_user->ID, "header_info_userspecifc", true); $field_value = ($field_value)? $field_value : $field_default; if ( $field_value == "on" ) $header = true; else $header = false; ?> <input type="checkbox" class="header_info_userspecifc" <?php if ( $field_value == "on" ) echo "checked"; ?> name="header_info_userspecifc" value="on" /> <?php _e( 'Header Info', 'email-control' ) ?> </label> </div> </div> </div> <div class="main-controls-element"> <?php //Load order for Custom Woo Emails Send $order = new WC_Order( $show_order ); ?> <label class="controls-label"> <?php _e( "Send a Test", 'email-control' ) ; ?> <span class="help-icon" title="<?php _e( 'Send a test email to any address. Use a comma separated list to send to multiple addresses', 'email-control' ); ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> <input type="text" class="" id="cwe_send_email" name="cwe_send_email" value="<?php echo $order->billing_email ?>" placeholder="somone@somewhere.com, ..." /> <button id="send_test" class="button send_test" name="send_test" type="button"><i class="cxectrl-icon-mail-alt"></i></button> </div> </div> </div> </div> <input type="hidden" class="" id="cwe_approve_preview" name="cwe_approve_preview" /> </form> </div> <?php global $cwe_email_templates; if ( isset($cwe_email_templates) && is_array($cwe_email_templates) ) : ?> <div class="ec-admin-panel ec-admin-panel-edit-content"> <div class="edit-top-controls"> <span class="edit-top-control close_settings" id="close_edit_settings" > <i class="cxectrl-icon-left-open"></i> </span> <span class="edit-top-control hide_settings"> <i class="cxectrl-icon-eye"></i> </span> </div> <?php // Add so the 'all' fields are shown $cwe_email_types_for_settings = $mails; $cwe_email_types_for_settings[] = (object)array('id'=>'all'); foreach ($cwe_email_templates as $cwe_email_template_key => $cwe_email_template_args ) { $cwe_email_template_id = $cwe_email_template_key; $cwe_email_template_name = $cwe_email_template_args["name"]; if ( !empty($cwe_email_types_for_settings) && cwe_get_settings($cwe_email_template_id) ) { $form_id = "cwe_settings_form_" . $cwe_email_template_id; $form_class = "cwe_settings_form "; $form_class .= "cwe_settings_form_" . $cwe_email_template_id . " "; ?> <form id="<?php echo $form_id ?>" class="<?php echo $form_class ?>" > <input type="button" id="save_edit_settings" class="button-primary save_edit_settings" value='Saved' disabled /> <?php foreach ( $cwe_email_types_for_settings as $mail ) { $cwe_email_template_kind = $mail->id; if ( cwe_get_settings( $cwe_email_template_id, array( 'group' => $cwe_email_template_kind ) ) ) { $cwe_email_template_kind = $cwe_email_template_kind; $form_sub_id = "cwe_settings_form_sub_" . $cwe_email_template_id . "_" . $cwe_email_template_kind; $form_sub_class = "cwe_settings_form_sub "; $form_sub_class .= "cwe_settings_form_sub_" . $cwe_email_template_id . " "; $form_sub_class .= "cwe_settings_form_sub_" . $cwe_email_template_id . "_" . $cwe_email_template_kind . " "; ?> <div id="<?php echo $form_sub_id ?>" class="<?php echo $form_sub_class ?>" > <?php EC_Settings::output_fields( cwe_get_settings($cwe_email_template_id, array( 'group' => $cwe_email_template_kind ) ) ); ?> </div> <?php } } ?> <!-- <input type="hidden" name="cwe_email_type" value="<?php echo $cwe_email_template_kind ?>" > --> <input type="hidden" name="cwe_email_id" value="<?php echo $cwe_email_template_id ?>" > <input type="hidden" name="cwe_action" value="yes" > <div class="main-controls-element forminp-tags ec-allowed-tags"> <label class="controls-label"> <?php _e( 'Allowed Shortcodes:', 'email-control' ); ?> <span class="help-icon" title="<?php echo esc_attr( __( 'Copy & Paste any of these [shortcodes] to use dynamic text in your text.', 'email-control' ) ) ?>" > </span> </label> <div class="controls-field"> <div class="controls-inner-row"> [cwe_order] [cwe_firstname] [cwe_lastname] [cwe_email] [cwe_pay_link] [cwe_customer_note] [cwe_user_login] [cwe_account_link] [cwe_user_password] [cwe_reset_password_link] [cwe_login_link] [cwe_site_name] [cwe_site_link] [cwe_delivery_note]<span class="ec-new-shortcode-badge"><?php _e( 'New', 'email-control' ) ?></span> [cwe_shipping_method]<span class="ec-new-shortcode-badge"><?php _e( 'New', 'email-control' ) ?></span> [cwe_payment_method]<span class="ec-new-shortcode-badge"><?php _e( 'New', 'email-control' ) ?></span> [cwe_custom_field]<span class="ec-new-shortcode-badge"><?php _e( 'New', 'email-control' ) ?></span> <p class="ec-allowed-shortcode-docs-link"><?php echo sprintf( __( 'For more shortcode documentation <a href="%s" target="_blank">click here</a>', 'email-control' ), 'https://www.cxthemes.com/documentation/email-customizer/shortcodes-email-customizer/' ); ?></p> </div> </div> </div> </form> <?php } } ?> </div> <?php endif; ?> </div> <!-- Left Column --> <!-- Main Content --> <iframe id="preview-email-template-iframe" name="my-iframe" border="0" src="<?php echo wp_nonce_url( admin_url( $src_url ), 'email-control'); ?>"></iframe> <?php // include 'cwe-template-page.php'; ?> </div>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings