Changeset 3018698
- Timestamp:
- 01/08/2024 10:17:38 AM (2 years ago)
- Location:
- surveyjs/trunk
- Files:
-
- 3 edited
-
ajax_handlers/save_survey.php (modified) (1 diff)
-
initializer.php (modified) (2 diffs)
-
views/editor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
surveyjs/trunk/ajax_handlers/save_survey.php
r3006114 r3018698 11 11 function callback() { 12 12 if($_SERVER['REQUEST_METHOD'] === 'POST') { 13 global $wpdb; 14 $table_name = $wpdb->prefix . 'sjs_my_surveys'; 15 13 16 $id = sanitize_key($_POST['Id']); 14 17 $json = current_user_can( 'unfiltered_html' ) ? $_POST['Json'] : wp_kses_post( $_POST['Json'] ); 15 18 $theme = current_user_can( 'unfiltered_html' ) ? $_POST['Theme'] : wp_kses_post( $_POST['Theme'] ); 16 19 20 // create 'theme' column if not exists 21 $row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = $table_name AND column_name = 'theme'" ); 22 if(empty($row)){ 23 $wpdb->query("ALTER TABLE $table_name ADD theme LONGTEXT"); 24 } 25 // EO create 'theme' column if not exists 26 17 27 if(!!$json) { 18 global $wpdb;19 $table_name = $wpdb->prefix . 'sjs_my_surveys';20 21 28 $result = $wpdb->update( 22 29 $table_name, -
surveyjs/trunk/initializer.php
r3006114 r3018698 174 174 </div> 175 175 <script> 176 let theme; 176 177 jQuery.ajax({ 177 178 url: "<?php echo esc_url($getSurveyJsonUri) ?>", … … 202 203 203 204 const survey<?php echo $id ?> = new Survey.Model(json); 204 survey<?php echo $id ?>.applyTheme(theme); 205 if (!!theme) { 206 survey<?php echo $id ?>.applyTheme(theme); 207 } 205 208 window.survey<?php echo $id ?> = survey<?php echo $id ?>; 206 209 survey<?php echo $id ?> -
surveyjs/trunk/views/editor.php
r3006720 r3018698 91 91 function SurveyCreatorRenderComponent() { 92 92 var CommercialLicense = <?php echo json_encode(file_exists(plugin_dir_path(__FILE__) . 'CommercialLicense.txt')) ?>; 93 var editorOptions = { showThemeTab: true, showLogicTab: true, showEmbededSurveyTab: false, showOptions: true, generateValidJSON : false }; 94 Survey.setLicenseKey( 95 "NDJiZWUxOTktM2M0ZC00MDk2LWE4ODYtOGU1ZTM0ZTFkYjc4OzE9MjAyNC0xMi0wNywyPTIwMjQtMTItMDcsND0yMDI0LTEyLTA3" 96 ); 93 var editorOptions = { showThemeTab: true, showLogicTab: true, showTranslationTab: true, showEmbededSurveyTab: false, showOptions: true, generateValidJSON : false, haveCommercialLicense: CommercialLicense }; 97 94 const editor = new SurveyCreator.SurveyCreator(editorOptions); 98 95 editor.showState = true;
Note: See TracChangeset
for help on using the changeset viewer.