Changeset 2569846
- Timestamp:
- 07/22/2021 07:48:14 AM (3 years ago)
- Location:
- ada2go-text-modules
- Files:
-
- 9 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ada2go-text-modules/trunk/a2g_tm_result.php
r2568446 r2569846 2 2 global $wpdb; 3 3 ob_start(); 4 $current_file = file_get_contents(ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt');4 $current_file = ); 5 5 6 6 echo "<html> -
ada2go-text-modules/trunk/ada2go-text-modules.php
r2568448 r2569846 2 2 /* 3 3 Plugin Name: Ada2go - Text Modules 4 Description: (DE) ada2go - Text Modules gibt im Frontend ein anklickbares Formular aus um vordefinierten Text auszugeben. Du kannst es beispielsweise für Teilnehmerfeedback, Arbeitszeugnisse oder ähnliches nutzen. (EN)ada2go - Text Modules outputs a clickable form in the frontend to output predefined text. You can use it, for example, for participant feedback, job references or similar.5 Version: 1. 44 Description: ada2go - Text Modules outputs a clickable form in the frontend to output predefined text. You can use it, for example, for participant feedback, job references or similar. 5 Version: 1. 6 6 Author: Heiko von ada2go.de 7 7 Author URI: https://ada2go.de/ 8 8 Text Domain: ada2go-text-modules 9 9 */ 10 10 11 defined( 'ABSPATH' ) or die( 'Huuuuuuh?' ); 11 12 12 /** 13 * ADD FUNCTIONS 14 */ 15 /** 16 * Function: a2g_tm 17 * => Built the Shortcode for the Frontend 18 */ 19 function a2g_tm( $atts ) { 20 global $wpdb; 21 if($_GET["action"]=="result") { include "a2g_tm_result.php"; } else { 22 $a2g_tm_built_return .= "<form action=\"".get_permalink()."?action=result\" method=\"post\" target=\"_blank\">"; 23 $a2g_tm_get_categorys = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."a2g_tm_kategorie ORDER BY catSort"); 13 //====================================================================== 14 //====================================================================== 15 // 16 // FOLLOWING ARE FUNCTIONS FOR BASE WORDPRESS HANDLING 17 // LIKE ACTIVATION, MENU ... 18 // 19 //====================================================================== 20 //====================================================================== 21 22 //----------------------------------------------------- 23 // do = create the shortcode for the form in frontend 24 //----------------------------------------------------- 25 function a2g_tm( $atts ) { 26 global $wpdb; 27 28 if($_GET["action"]=="result") { 29 include "a2g_tm_result.php"; 30 } 31 else { 32 $a2g_tm_built_return .= "<form action=\"" . get_permalink() . "?action=result\" method=\"post\" target=\"_blank\">"; 33 $a2g_tm_get_categorys = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."a2g_tm_kategorie ORDER BY catSort"); 34 24 35 foreach ( $a2g_tm_get_categorys as $a2g_tm_get_category ) { 25 $a2g_tm_built_return .= "<h2>".$a2g_tm_get_category->catName."</h2><small>". html_entity_decode( $a2g_tm_get_category->catDesc )."</small><br><br>"; 26 $a2g_tm_get_texts = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."a2g_tm_text WHERE catID = ".$a2g_tm_get_category->catID.""); 27 $count = 0; 28 foreach ( $a2g_tm_get_texts as $a2g_tm_get_text ) { 29 if(!empty($a2g_tm_get_text->textID)) { 30 $count=md5(rand()); 31 $a2g_tm_built_return .= '<input type="checkbox" name="'.$count.'" value="'.$a2g_tm_get_category->catID.','.$a2g_tm_get_text->textID.'">'.$a2g_tm_get_text->text_ueberschrift; 32 } 33 } 34 $a2g_tm_built_return .= "<hr>"; 35 } 36 $a2g_tm_built_return .= "<br><input type=\"submit\" value=\"".__( 'Abschicken!', 'ada2go-text-modules' )."\"></form>"; 37 } 38 return $a2g_tm_built_return; 36 37 $a2g_tm_built_return .= "<h2>" . $a2g_tm_get_category->catName . "</h2><small>". html_entity_decode( $a2g_tm_get_category->catDesc )."</small><br><br>"; 38 39 $a2g_tm_get_texts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "a2g_tm_text WHERE catID = " . $a2g_tm_get_category->catID . ""); 40 41 $count = 0; 42 43 foreach ( $a2g_tm_get_texts as $a2g_tm_get_text ) { 44 45 if(!empty($a2g_tm_get_text->textID)) { 46 $count=md5(rand()); 47 $a2g_tm_built_return .= '<input type="checkbox" name="' 48 . $count . '" value="' . $a2g_tm_get_category->catID . ',' . $a2g_tm_get_text->textID . '">' . $a2g_tm_get_text->text_ueberschrift; 49 } 50 51 } 52 $a2g_tm_built_return .= "<hr>"; 39 53 } 40 add_shortcode( 'a2gtm', 'a2g_tm' ); 54 $a2g_tm_built_return .= "<br><input type=\"submit\" value=\"".__( 'Abschicken!', 'ada2go-text-modules' )."\"></form>"; 55 } 56 return $a2g_tm_built_return; 57 } 58 59 //----------------------------------------------------- 60 // do = add a option if is not exist to safe simple css code. best solution ;-P 61 //----------------------------------------------------- 62 if (FALSE === get_option('a2g_tm_output_css') && FALSE === update_option('a2g_tm_output_css',FALSE)) { 63 add_option('a2g_tm_output_css','.a2g-out-html { 64 border:1px solid #000; 65 } 66 .a2g-out-body { 67 background-color:black; color:white; 68 }'); 69 } 70 71 //----------------------------------------------------- 72 // do = add submenu to wordpress backend 73 //----------------------------------------------------- 74 function a2g_tm_options_submenu() { 75 add_submenu_page( 76 'options-general.php', 77 'Text Modules', 78 'Text Modules', 79 'administrator', 80 'a2g_tm_settings', 81 'a2g_tm_settings_page' ); 82 } 83 84 //----------------------------------------------------- 85 // do = function for the register_activation_hook 86 // = create database tables 87 //----------------------------------------------------- 88 function a2g_tm_activate() { 89 global $wpdb; 90 $charset = $wpdb->get_charset_collate(); 91 $charset_collate = $wpdb->get_charset_collate(); 92 93 $sql = "CREATE TABLE ".$wpdb->prefix."a2g_tm_kategorie ( 94 `catID` INT(11) NOT NULL AUTO_INCREMENT, 95 `catName` VARCHAR(255) NOT NULL, 96 `catDesc` TEXT NOT NULL , 97 `catSort` TEXT NOT NULL , 98 PRIMARY KEY (`catID`) 99 ) $charset_collate; 100 101 CREATE TABLE ".$wpdb->prefix."a2g_tm_text ( 102 `textID` INT(11) NOT NULL AUTO_INCREMENT , 103 `catID` INT(11) NOT NULL , 104 `text_ueberschrift` TEXT NOT NULL , 105 `text` TEXT NOT NULL , 106 PRIMARY KEY (`textID`) 107 ) $charset_collate;"; 108 109 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 110 dbDelta( $sql ); 111 } 112 113 //----------------------------------------------------- 114 // do = include the require setting file 115 //----------------------------------------------------- 116 function a2g_tm_settings_page() { 117 require "settings_page.php"; 118 } 119 120 //----------------------------------------------------- 121 // do = load individual CSS File 122 //----------------------------------------------------- 123 function a2g_tm_css() { 124 wp_enqueue_style( 'ada2go-text-modules', plugin_dir_url( __FILE__ ) . 'ada2go-text-modules.css' ); 125 } 126 127 //----------------------------------------------------- 128 // do = add actions, shortcode, other 129 //----------------------------------------------------- 130 add_shortcode( 'a2gtm', 'a2g_tm' ); 131 add_action( 'wp_enqueue_scripts', 'a2g_tm_css' ); 132 add_action( 'admin_enqueue_scripts', 'a2g_tm_css'); 133 add_action("admin_menu", "a2g_tm_options_submenu"); 134 register_activation_hook( __FILE__, 'a2g_tm_activate' ); 135 136 //====================================================================== 137 //====================================================================== 138 // 139 // FOLLOWING ARE FUNCTIONS TO GET DATA BY ID OR DATA GENERALLY 140 // 141 //====================================================================== 142 //====================================================================== 143 144 //----------------------------------------------------- 145 // return = get the number of safed categorys in database 146 // why = using for while counting in settings_page.php 147 //----------------------------------------------------- 148 function a2g_tm_get_highest_cat_sort() { 149 global $wpdb; 150 151 $a2g_tm_get_highest_cat = $wpdb->get_var("SELECT MAX(catSort) FROM " . $wpdb->prefix . "a2g_tm_kategorie"); 41 152 42 /** 43 * Add the Submenu to Settings 44 */ 45 function a2g_tm_options_submenu() { 46 add_submenu_page( 47 'options-general.php', 48 'Text Modules', 49 'Text Modules', 50 'administrator', 51 'a2g_tm_settings', 52 'a2g_tm_settings_page' ); 53 } 153 return $a2g_tm_get_highest_cat; 154 } 155 156 //----------------------------------------------------- 157 // att = $a2g_tm_cat is the given category id 158 // return = get the number of safed categorys in database 159 // why = using for while counting in settings_page.php 160 //----------------------------------------------------- 161 function a2g_tm_get_catsort_by_catid( $a2g_tm_cat ) { 162 global $wpdb; 163 164 $a2g_the_cat = $wpdb->get_var("SELECT catSort FROM " . $wpdb->prefix . "a2g_tm_kategorie WHERE catID = $a2g_tm_cat"); 165 166 return $a2g_the_cat; 167 } 168 169 //----------------------------------------------------- 170 // att = $a2g_tm_cat is the given category id 171 // return = select the description of a category id 172 // why = using for output in table and textarea in settings_page.php 173 //----------------------------------------------------- 174 function a2g_tm_edit_cat_by_catid( $a2g_tm_cat ) { 175 global $wpdb; 176 177 $a2g_the_cat = $wpdb->get_var("SELECT catDesc FROM " . $wpdb->prefix . "a2g_tm_kategorie WHERE catID = $a2g_tm_cat"); 178 179 return html_entity_decode( $a2g_the_cat ); 180 } 181 182 //----------------------------------------------------- 183 // att = $a2g_tm_text is the given text id 184 // return = select the text of a text id 185 // why = using for output in table and textarea in settings_page.php 186 //----------------------------------------------------- 187 function a2g_tm_get_text_by_textid( $a2g_tm_text ) { 188 global $wpdb; 189 190 $a2g_the_text = $wpdb->get_var("SELECT text FROM " . $wpdb->prefix . "a2g_tm_text WHERE textID = $a2g_tm_text"); 191 192 return html_entity_decode( $a2g_the_text ); 193 } 194 195 //----------------------------------------------------- 196 // att = $a2g_tm_cat is the given category id 197 // return = select the category name of a category id 198 // why = using for output in table, ids and textarea in settings_page.php 199 //----------------------------------------------------- 200 function a2g_tm_get_cat_by_catid( $a2g_tm_cat ) { 201 global $wpdb; 202 203 $a2g_the_cat = $wpdb->get_var("SELECT catName FROM " . $wpdb->prefix . "a2g_tm_kategorie WHERE catID = $a2g_tm_cat"); 204 205 return html_entity_decode( $a2g_the_cat ); 206 } 207 208 209 //====================================================================== 210 //====================================================================== 211 // 212 // FOLLOWING ARE FUNCTIONS TO CREATE <OPTION> LISTS, TABLES OR DROPDOWNS 213 // 214 //====================================================================== 215 //====================================================================== 216 217 //----------------------------------------------------- 218 // return = generate the html <option> list for sorting dropdown 219 // why = using for dropdown in settings_page.php 220 //----------------------------------------------------- 221 function a2g_tm_get_select_options_for_catsort() { 222 global $wpdb; 223 224 $a2g_tm_db_get_cat_sorts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "a2g_tm_kategorie"); 54 225 55 /** 56 * Require settings_page.php 57 */ 58 function a2g_tm_settings_page() { 59 require "settings_page.php"; 60 } 61 62 /** 63 * LOAD individual CSS File 64 */ 65 function a2g_tm_css() { 66 wp_enqueue_style( 'ada2go-text-modules', plugin_dir_url( __FILE__ ) . 'ada2go-text-modules.css' ); 67 } 68 add_action( 'wp_enqueue_scripts', 'a2g_tm_css' ); 69 add_action( 'admin_enqueue_scripts', 'a2g_tm_css'); 70 71 /** 72 * ADD submenu to Settings 73 */ 74 add_action("admin_menu", "a2g_tm_options_submenu"); 75 76 /** 77 * ACTIVATION 78 * Create Database Table 79 */ 80 function a2g_tm_activate() { 81 global $wpdb; 82 $charset = $wpdb->get_charset_collate(); 83 $charset_collate = $wpdb->get_charset_collate(); 84 85 /** 86 * SET sql String 87 */ 88 $sql = "CREATE TABLE ".$wpdb->prefix."a2g_tm_kategorie ( 89 `catID` INT(11) NOT NULL AUTO_INCREMENT, 90 `catName` VARCHAR(255) NOT NULL, 91 `catDesc` TEXT NOT NULL , 92 `catSort` TEXT NOT NULL , 93 PRIMARY KEY (`catID`) 94 ) $charset_collate; 95 96 CREATE TABLE ".$wpdb->prefix."a2g_tm_text ( 97 `textID` INT(11) NOT NULL AUTO_INCREMENT , 98 `catID` INT(11) NOT NULL , 99 `text_ueberschrift` TEXT NOT NULL , 100 `text` TEXT NOT NULL , 101 PRIMARY KEY (`textID`) 102 ) $charset_collate;"; 103 104 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 105 dbDelta( $sql ); 106 } 107 108 // hook on activation 109 register_activation_hook( __FILE__, 'a2g_tm_activate' ); 110 111 /** 112 * Function: a2g_tm_while_categorys 113 * => Output the Categorys in Table 114 */ 115 function a2g_tm_while_categorys() { 116 global $wpdb; 117 $a2g_tm_get_categorys = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."a2g_tm_kategorie ORDER BY catSort"); 118 foreach ( $a2g_tm_get_categorys as $a2g_tm_get_category ) { 119 $a2g_built_category_table .= '<tr> 120 <td>' . $a2g_tm_get_category->catID . '</td> 121 <td>' . $a2g_tm_get_category->catName . ' 122 <br> 123 <a onclick="return confirm(\''.__( 124 'Kategorie wirklich löschen?', 'ada2go-text-modules' ) . '\')" href="options-general.php?page=a2g_tm_settings&action=delcat&id=' . $a2g_tm_get_category->catID.'">' . __( 125 'löschen', 'ada2go-text-modules' ) . '</a> | <a href="options-general.php?page=a2g_tm_settings&action=editkat&id='.$a2g_tm_get_category->catID.'">'. __( 126 'bearbeiten', 'ada2go-text-modules' ) .'</a></td> 127 <td>' . $a2g_tm_get_category->catDesc . '</td> 128 <td>' . $a2g_tm_get_category->catSort . '</td></tr>'; 129 } 130 return $a2g_built_category_table; 131 } 132 133 /** 134 * Function: a2g_tm_while_textes 135 * => Output the Text in Table 136 */ 137 function a2g_tm_while_textes() { 138 global $wpdb; 139 $a2g_tm_get_textes = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "a2g_tm_text"); 140 foreach ( $a2g_tm_get_textes as $a2g_tm_get_text ) { 141 $a2g_built_text_table .= ' 142 <tr> 143 <td>' . $a2g_tm_get_text->textID . '</td> 144 <td>' . $a2g_tm_get_text->text . ' 145 <br><a onclick="return confirm(\'' . __( 146 'Text wirklich löschen?', 'ada2go-text-modules' ) . '\')" href="options-general.php?page=a2g_tm_settings&action=deltext&id='.$a2g_tm_get_text->textID.'">'.__( 147 'löschen', 'ada2go-text-modules' ).'</a> | <a href="options-general.php?page=a2g_tm_settings&action=edittext&id='.$a2g_tm_get_text->textID.'">'. __( 148 'bearbeiten', 'ada2go-text-modules' ) . '</a></td> 149 <td>' . a2g_tm_get_cat_by_catid($a2g_tm_get_text->catID) . '</td></tr>'; 150 } 151 return $a2g_built_text_table; 226 foreach ( $a2g_tm_db_get_cat_sorts as $a2g_tm_db_get_cat_sort ) { 227 $a2g_tm_return_option_sort .= '<option value="'.$a2g_tm_db_get_cat_sort->catSort.'">'.$a2g_tm_db_get_cat_sort->catSort .'</option>'; 152 228 } 153 229 154 /** 155 * Function: a2g_tm_while_safed_textes 156 * => Output the Text in Table 157 */ 158 function a2g_tm_while_safed_textes() { 159 global $wpdb; 160 $directory = ABSPATH . 'wp-content/plugins/ada2go-text-modules/reslut-safes/'; 161 $files = glob($directory . '*.{html}', GLOB_BRACE); 162 163 foreach($files as $file) 164 { 165 $path = parse_url($file, PHP_URL_PATH); 166 $path = basename($path); 167 echo "<tr><td>Pfad: ".$file." <br><a href='../wp-content/plugins/ada2go-text-modules/reslut-safes/". $path . "' target='_blank'>Datei öffnen</a> | <a href=\"options-general.php?page=a2g_tm_settings&action=deldocument&path=" .$file. "\">Datei löschen</a>" . "</td></tr>"; 168 } 169 return; 230 return $a2g_tm_return_option_sort; 231 } 232 233 //----------------------------------------------------- 234 // return = generate the html table list for showing categorys 235 //----------------------------------------------------- 236 function a2g_tm_while_categorys() { 237 global $wpdb; 238 239 $a2g_tm_get_categorys = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."a2g_tm_kategorie ORDER BY catSort"); 240 241 foreach ( $a2g_tm_get_categorys as $a2g_tm_get_category ) { 242 $a2g_built_category_table .= '<tr> 243 <td>' . $a2g_tm_get_category->catID . '</td> 244 <td>' . $a2g_tm_get_category->catName . ' 245 <br> 246 <a 247 onclick="return confirm(\'' 248 .__('Kategorie wirklich löschen?', 'ada2go-text-modules' ) . '\')" 249 href="options-general.php?page=a2g_tm_settings&action=delcat&id=' . $a2g_tm_get_category->catID . '">' 250 . __('löschen', 'ada2go-text-modules' ) . '</a> | <a 251 href="options-general.php?page=a2g_tm_settings&action=editkat&id=' 252 . $a2g_tm_get_category->catID . '">' 253 . __('bearbeiten', 'ada2go-text-modules' ) .'</a></td> 254 <td>' . wp_trim_words( $a2g_tm_get_category->catDesc, '100', ' ...' ) . '</td> 255 <td>' . $a2g_tm_get_category->catSort . '</td></tr> 256 '; 170 257 } 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 171 312 172 /** 173 * Function: a2g_tm_get_text_by_textid 174 * => Return the text by given ID 175 */ 176 function a2g_tm_get_text_by_textid($a2g_tm_text) { 177 global $wpdb; 178 $a2g_the_text = $wpdb->get_var("SELECT text FROM " . $wpdb->prefix . "a2g_tm_text WHERE textID = $a2g_tm_text"); 179 return html_entity_decode( $a2g_the_text ); 180 } 181 182 /** 183 * Function: a2g_tm_get_cat_by_catid 184 * => Return the category Name by given ID 185 */ 186 function a2g_tm_get_cat_by_catid($a2g_tm_cat) { 187 global $wpdb; 188 $a2g_the_cat = $wpdb->get_var("SELECT catName FROM " . $wpdb->prefix . "a2g_tm_kategorie WHERE catID = $a2g_tm_cat"); 189 return html_entity_decode( $a2g_the_cat ); 190 } 191 192 /** 193 * Function: a2g_tm_edit_text_by_textid 194 * => Return the text of a textID given 195 */ 196 function a2g_tm_edit_text_by_textid($a2g_tm_text) { 197 global $wpdb; 198 $a2g_the_text = $wpdb->get_var("SELECT text FROM " . $wpdb->prefix . "a2g_tm_text WHERE textID = $a2g_tm_text"); 199 return html_entity_decode( $a2g_the_text ); 200 } 201 202 /** 203 * Function: a2g_tm_edit_cat_by_catid 204 * => Return the describtion of a categoryID given 205 */ 206 function a2g_tm_edit_cat_by_catid($a2g_tm_cat) { 207 global $wpdb; 208 $a2g_the_cat = $wpdb->get_var("SELECT catDesc FROM " . $wpdb->prefix . "a2g_tm_kategorie WHERE catID = $a2g_tm_cat"); 209 return html_entity_decode( $a2g_the_cat ); 210 } 211 212 213 /** 214 * Function: a2g_tm_catsort_by_catid 215 * => Return the sort number of a categoryID given 216 */ 217 function a2g_tm_get_catsort_by_catid($a2g_tm_cat) { 218 global $wpdb; 219 $a2g_the_cat = $wpdb->get_var("SELECT catSort FROM " . $wpdb->prefix . "a2g_tm_kategorie WHERE catID = $a2g_tm_cat"); 220 return $a2g_the_cat; 221 } 222 223 224 function a2g_tm_get_select_options_for_catsort() { 225 global $wpdb; 226 $a2g_tm_db_get_cat_sorts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "a2g_tm_kategorie"); 227 foreach ( $a2g_tm_db_get_cat_sorts as $a2g_tm_db_get_cat_sort ) { 228 $a2g_tm_return_option_sort .= '<option value="'.$a2g_tm_db_get_cat_sort->catSort.'">'.$a2g_tm_db_get_cat_sort->catSort .'</option>'; 229 } 230 return $a2g_tm_return_option_sort; 231 } 232 233 234 function a2g_tm_get_highest_cat_sort() { 235 global $wpdb; 236 $a2g_tm_get_highest_cat = $wpdb->get_var("SELECT MAX(catSort) FROM " . $wpdb->prefix . "a2g_tm_kategorie"); 237 return $a2g_tm_get_highest_cat; 238 } 313 //----------------------------------------------------- 314 // att = $a2g_tm_text is the given text id 315 // return = select the text of a text id 316 // why = using for output in table, ids and textarea in settings_page.php 317 //----------------------------------------------------- 318 function a2g_tm_edit_text_by_textid( $a2g_tm_text ) { 319 global $wpdb; 320 321 $a2g_the_text = $wpdb->get_var("SELECT text FROM " . $wpdb->prefix . "a2g_tm_text WHERE textID = $a2g_tm_text"); 322 323 return html_entity_decode( $a2g_the_text ); 324 } -
ada2go-text-modules/trunk/readme.txt
r2568481 r2569846 5 5 Requires at least: 4.7 6 6 Tested up to: 5.8 7 Stable tag: 1. 47 Stable tag: 1. 8 8 Requires PHP: 7.0 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0 11 11 12 (DE) ada2go - Text Modules gibt im Frontend ein anklickbares Formular aus um vordefinierten Text auszugeben. Du kannst es beispielsweise für Teilnehmerfeedback, Arbeitszeugnisse oder Ähnliches nutzen. (EN)ada2go - Text Modules outputs a clickable form in the frontend to output predefined text. You can use it, for example, for participant feedback, job references or similar.12 ada2go - Text Modules outputs a clickable form in the frontend to output predefined text. You can use it, for example, for participant feedback, job references or similar. 13 13 14 14 == Description == … … 16 16 (DE) Text Modules gibt im Frontend ein anklickbares Formular aus um vordefinierten Text auszugeben. Du kannst in den Einstellungen Texte speichern, Kategorien erstelle und im Customizer das Design vollständig anpassen! Wenn du Hilfe benötigst, kontaktiere mich über https://ada2go.de/kontakt/ 17 17 18 (EN) Text Modules outputs a clickable form in the frontend to output predefined text. You can save texts in the settings, create categories and completely adapt the design in the customizer! If you need help, contact me via https://ada2go.de/kontakt/ 19 20 Contact us via Instagram => ada2go! 18 (EN) Text Modules outputs a clickable form in the frontend to output predefined text. You can save texts in the settings, create categories and completely adapt the design in the customizer! If you need help, contact me via https://ada2go.de/kontakt/ - Critical error? Write on Instagram @ ada2go 21 19 22 20 == Frequently Asked Questions == … … 25 23 26 24 With the help of categories and individual text modules, you can create your own text generator for different uses. For example, you can create reviews for customers or participants without having to retype or copy the text over and over again. 25 26 27 28 27 29 28 30 == Screenshots == … … 35 37 36 38 == Changelog == 39 40 41 42 43 37 44 38 45 = 1.4 = 39 * Enjoy! See Bugs or anything else? Contact me. 46 * Enjoy! See Bugs or anything else? Contact me. 40 47 * A bug has been fixed where in edit mode a click anywhere submitted the form 41 48 * The "Sort" Row was added in "Edit Categorys" Table … … 54 61 55 62 = 1.1 = 56 * The translations have been renewed and improved / Die Übersetzungen wurden erneuert und verbessert57 * An error is now showed if a category has not been created / Es wird nun ein Fehler ausgegeben, wenn noch keine Kategorie erstellt wurde58 * It was ensured that the upcoming version 5.8 works / Es wurde sichergestellt das die kommende Version 5.8 funktioniert59 * Small fixes / Kleine Fehler behoben60 * The accordion has been removed / Das Akkordeon wurde entfernt61 * A tab menu was added / Ein Tab-Menü wurde hinzugefügt62 * The "General" text has been adjusted / Der "Allgemein" Text wurde angepasst63 * New CSS classes were implemented and old ones removed / Neue CSS Klassen wurde implementiert und alte entfernt64 * The JavaScript function has been changed for the tabs / Die JavaScript Funktion wurde für die Tabs geändert63 * The translations have been renewed and improved 64 * An error is now showed if a category has not been created 65 * It was ensured that the upcoming version 5.8 works 66 * Small fixes 67 * The accordion has been removed 68 * A tab menu was added 69 * The "General" text has been adjusted 70 * New CSS classes were implemented and old ones removed 71 * The JavaScript function has been changed for the tabs 65 72 66 73 = 1.0 = -
ada2go-text-modules/trunk/settings_page.php
r2568446 r2569846 23 23 array( '%d' ) 24 24 ); 25 echo__('<div class="updated">25 __('<div class="updated"> 26 26 <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p> 27 27 28 </div>'); 28 29 } … … 46 47 ) 47 48 ); 48 echo__('<div class="updated">49 __('<div class="updated"> 49 50 <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p> 51 50 52 </div>'); 53 51 54 } 52 55 … … 55 58 if($_GET['action']=="editoutcss" AND (is_admin())) { 56 59 $a2g_new_css_content = sanitize_text_field( htmlentities( $_POST["css-output"] )); 57 $file = ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt'; 58 $current = file_get_contents($file); 59 $current = $a2g_new_css_content; 60 file_put_contents($file, $current); 61 echo __('<div class="updated"> 60 update_option( 'a2g_tm_output_css', $a2g_new_css_content, $autoload ); 61 $a2g_tm_message_out = __('<div class="updated"> 62 62 <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p> 63 63 64 </div>'); 64 65 } … … 71 72 '<div class="error"> 72 73 <p>' . __( 'Das hat leider nicht geklappt!', 'ada2go-text-modules' ) . '</p> 74 73 75 </div>'; 74 76 } else { 75 echo77 76 78 '<div class="updated"> 77 79 <p>' . __( 'Kategorie wurde erfolgreich gelöscht!', 'ada2go-text-modules' ) . '</p> 80 78 81 </div>'; 79 82 } … … 84 87 $a2g_tm_get_document_to_del = esc_url( $_GET['path'] ); 85 88 unlink($a2g_tm_get_document_to_del); 86 echo89 87 90 '<div class="updated"> 88 91 <p>' . __( 'Dokument wurde erfolgreich gelöscht!', 'ada2go-text-modules' ) . '</p> 92 89 93 </div>'; 90 94 } … … 95 99 $table = $wpdb->prefix . 'a2g_tm_text'; 96 100 if( $wpdb->delete( $table, array( 'textID' => $_GET['id'] ) ) === FALSE) { 97 echo101 98 102 '<div class="error"> 99 103 <p>' . __( 'Das hat leider nicht geklappt!', 'ada2go-text-modules' ) . '</p> 104 100 105 </div>'; 101 106 } else { 102 echo107 103 108 '<div class="updated"> 104 109 <p>' . __( 'Text wurde erfolgreich gelöscht!', 'ada2go-text-modules' ) . '</p> 110 105 111 </div>'; 106 112 } … … 120 126 'catSort' => $a2g_filter_input_catsort 121 127 )); 122 echo'<div class="updated">128 '<div class="updated"> 123 129 <p>' . __( 'Kategorie wurde erfolgreich angelegt!', 'ada2go-text-modules' ) . '</p> 130 124 131 </div>'; 125 132 } … … 136 143 'text_ueberschrift' => $a2g_filter_input_textident 137 144 )); 138 echo'<div class="updated">145 '<div class="updated"> 139 146 <p>' . __( 'Text wurde erfolgreich angelegt!', 'ada2go-text-modules' ) . '</p> 147 140 148 </div>'; 141 149 } … … 161 169 <h1><?php echo esc_html_e('Text Modules - Einstellungen', 'ada2go-text-modules'); ?></h1> 162 170 <?php 171 172 173 174 175 163 176 if($_GET["action"]=="editkat") { 164 177 … … 218 231 <form action="?page=a2g_tm_settings&action=editoutcss" method="post"> 219 232 <?php 220 $current_file = file_get_contents(ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt');233 $current_file = ); 221 234 echo wp_editor( $current_file, 'css-output'); ?> 222 235 <br /> … … 236 249 <table id="a2g-table"> 237 250 <tr> 238 <th style="width: 3%;"><?php echo __( 'ID', 'ada2go-text-modules' ); ?></th>239 <th ><?php echo __( 'Name', 'ada2go-text-modules' ); ?></th>240 <th ><?php echo __( 'Beschreibung', 'ada2go-text-modules' ); ?></th>241 <th ><?php echo __( 'Sortierung', 'ada2go-text-modules' ); ?></th>251 <th style="width:</th> 252 <th</th> 253 <th</th> 254 <th</th> 242 255 </tr> 243 256 <?php echo html_entity_decode ( a2g_tm_while_categorys() ); ?> … … 268 281 <table id="a2g-table"> 269 282 <tr> 270 <th style="width: 3%;"><?php echo __( 'ID', 'ada2go-text-modules' ); ?></th>271 <th ><?php echo __( 'Name', 'ada2go-text-modules' ); ?></th>272 <th ><?php echo __( 'Kategorie', 'ada2go-text-modules' ); ?></th>283 <th style="width:</th> 284 <th</th> 285 <th</th> 273 286 </tr> 274 287 <?php echo html_entity_decode (a2g_tm_while_textes()); ?> … … 306 319 <?php 307 320 echo a2g_tm_while_safed_textes(); 308 309 310 ?> 321 ?> 311 322 </table> 312 323 </div> … … 343 354 evt.currentTarget.className += " active"; 344 355 } 356 357 358 359 360 361 362 363 364 365 366 367 368 369 345 370 </script>
Note: See TracChangeset
for help on using the changeset viewer.