Changeset 2253843
- Timestamp:
- 03/03/2020 07:57:10 PM (6 years ago)
- Location:
- vforce-extensions/trunk
- Files:
-
- 5 edited
-
README.md (modified) (2 diffs)
-
README.txt (modified) (2 diffs)
-
inc/admin-page.php (modified) (2 diffs)
-
inc/functions.php (modified) (3 diffs)
-
vforce-extensions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vforce-extensions/trunk/README.md
r2253675 r2253843 1 1 === Plugin Name === 2 Contributors: iliveinaterminal2 Contributors: Mike Conrad 3 3 Donate link: https://virtualinc.com 4 Tags: comments, spam4 Tags: vforce, salesforce, formassembly, virtual 5 5 Requires at least: 3.0.1 6 6 Tested up to: 3.4 7 Stable tag: 4.37 Stable tag: 2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 11 12 Vforce helper tool. To be used by any organization on the Vforce platform. … … 18 19 19 20 ## Changelog 21 22 ### 1.1 23 * Added Formassembly integration. Now you can simply insert the <code>[vforce_form formid='id']</code> shortcode into a page or post. If you have issues with the form displaying, make sure that the id is in single qoutes. The server url defaults to https://virtual.tfaforms.net. You can change this under VForce Settings->Formassembly Settings. This plugin will not override or interfere with the official Formassembly plugin. 20 24 21 25 ### 1.0 -
vforce-extensions/trunk/README.txt
r2253675 r2253843 1 1 === Plugin Name === 2 Contributors: enxoco2 Contributors: Mike Conrad 3 3 Donate link: https://virtualinc.com 4 Tags: vforce, salesforce, formassembly 4 Tags: vforce, salesforce, formassembly, virtual 5 5 Requires at least: 3.0.1 6 6 Tested up to: 3.4 7 Stable tag: 4.37 Stable tag: 2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 18 18 19 19 == Changelog == 20 ### 1.1 21 * Added Formassembly integration. Now you can simply insert the <code>[vforce_form formid='id']</code> shortcode into a page or post. If you have issues with the form displaying, make sure that the id is in single qoutes. The server url defaults to https://virtual.tfaforms.net. You can change this under VForce Settings->Formassembly Settings. This plugin will not override or interfere with the official Formassembly plugin. 22 23 ### 1.0 24 * Removed Plugin update checker 25 * Submitted to Wordpress Plugins Repo 26 * Added ACF dependency to allow for adding an Association ID override metabox to all pages/posts. 27 * All pages/posts now have an Association ID override box. By default this box is empty. There is a hook that runs just before each page is loaded. This function is in the main plugin file. It checks to see if a value has been set in the override box. If so, it will use the value in the override meta box as the global association id, if not it will use the default site wide Association ID/ 28 29 // This function runs just before the requested page is loaded 30 add_action('template_redirect', 'vforce_hook_before_page_load'); 31 function vforce_hook_before_page_load(){ 32 $vforce_helper = get_option('vforce_helper'); 33 34 wp_enqueue_script( 'init-global', plugin_dir_url( __FILE__ ) . 'inc/js/init-global.js', array('jquery'), '1.0', true ); 35 /* 36 Setting the association ID variable 37 Check to see if a value has been entered into the Association Id override metabox of the page. 38 If so, inject that into our init-global.js as the associationId variable. If it has not been set, 39 we then use the value entered into the plugin settings. 40 The code for the metabox is in functions.php 41 */ 42 wp_localize_script( 'init-global', 'associationId', (get_post_meta( get_the_ID(), 'vforce-metabox-settings-association_id', true) != "") ? get_post_meta( get_the_ID(), 'vforce-metabox-settings-association_id', true) : $vforce_helper['variable']['association-id']); 43 } 44 45 * vforce_helper is now a multidimensional array. 46 47 vforce_helper.variable 48 {association-id: "a00f400000VQ8E6AAL"} 49 vforce_helper.script 50 {formidable_add-to-cart: "true", fa_web-to-case: "true"} 20 51 21 52 = 0.6 = -
vforce-extensions/trunk/inc/admin-page.php
r2253675 r2253843 58 58 --> 59 59 <li id="li-for-panel-3"> 60 <label class="panel-label" for="panel-3-ctrl">Form Assembly Settings</label>60 <label class="panel-label" for="panel-3-ctrl">Formassembly Settings</label> 61 61 </li> 62 62 <label id="close-nav-label" for="nav-ctrl">Close</label> … … 93 93 <section id="panel-3"> 94 94 <main> 95 <?php vforce_create_input_element('Enable Web To Case Script', '', 'checkbox', 'fa_web-to-case', 'script') ;?> 96 <?php vforce_create_input_element('Enable Ballot Hiding', '', 'checkbox', 'fa_ballot-hiding', 'script') ;?> 97 98 <hr class="mb-3"> 99 <hr class="mb-3"> 100 <div class="form-group-row my-3"> 101 <?php wp_editor(get_option('form_assembly_ballot-message', $defaultBallotMessage), 'editFormAssemblyBallot', $wp_editor_settings); ?> 102 <a class="btn btn-primary" onclick="updateFormAssemblyBallotMessage()">Save</a> 95 <?php vforce_create_input_element('Server Url', '', 'text', 'formassembly-server-url', 'variable') ;?> 103 96 </div> 104 97 </main> -
vforce-extensions/trunk/inc/functions.php
r2253675 r2253843 4 4 * 5 5 */ 6 6 7 function vforce_create_input_element($label, $placeholder, $inputType, $id, $optionType) { 7 8 global $vforce_options; … … 56 57 <small>Enter the selector that identifies the hidden input that you want to hold the association id. ie. <i>#tfa_34</i></small> 57 58 <br> 58 59 <br> 60 <!-- 61 <label for="form_assembly_form_id">Formassembly Form Id</label> 62 <input name="form_assembly_form_id" type="text" value="<?php echo esc_html(get_post_meta($object->ID, "form_assembly_form_id", true)); ?>"> 63 --> 59 64 60 65 </div> … … 97 102 update_post_meta($post_id, "form_assembly_hidden_input_id", $vforce_form_assembly_hidden_id); 98 103 104 if(isset($_POST["form_assembly_form_id"])) 105 { 106 $vforce_form_assembly_hidden_id = sanitize_text_field($_POST["form_assembly_form_id"]); 107 } 108 update_post_meta($post_id, "form_assembly_form_id", $vforce_form_assembly_hidden_id); 99 109 } 100 110 -
vforce-extensions/trunk/vforce-extensions.php
r2253675 r2253843 28 28 include 'inc/functions.php'; 29 29 include 'inc/admin-page.php'; 30 include 'inc/formassembly_shortcodes.php'; 30 31 31 32 global $vforce_helper; … … 123 124 124 125 } 125 add_action('admin_enqueue_scripts', 'vforce_load_bootstrap_js');126 add_action('admin_enqueue_scripts', 'vforce_load_bootstrap_js'); 126 127 127 128 ?>129 130 <?php131 128 add_action( 'admin_footer', 'vforce_process_setting_update_ajax' ); // Write our JS below here 132 129 … … 194 191 'status' => 'Success' 195 192 ); 196 echojson_encode($response);193 return json_encode($response); 197 194 198 195 wp_die(); // this is required to terminate immediately and return a proper response
Note: See TracChangeset
for help on using the changeset viewer.