Plugin Directory

Changeset 2569846

Timestamp:
07/22/2021 07:48:14 AM (3 years ago)
Author:
ada2go
Message:

Update to Version 1.5

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  
    22global $wpdb;
    33ob_start();
    4 $current_file = file_get_contents(ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt');
     4$current_file = );
    55
    66echo "<html>
  • ada2go-text-modules/trunk/ada2go-text-modules.php

    r2568448 r2569846  
    22/*
    33Plugin 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&uuml;r Teilnehmerfeedback, Arbeitszeugnisse oder &auml;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.4
     4Description: 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.
     5Version: 1.
    66Author: Heiko von ada2go.de
    77Author URI: https://ada2go.de/
    88Text Domain: ada2go-text-modules
    99*/
     10
    1011defined( 'ABSPATH' ) or die( 'Huuuuuuh?' );
    1112
    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//-----------------------------------------------------
     25function a2g_tm( $atts ) {
     26global $wpdb;
     27
     28if($_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     
    2435      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>";
    3953    }
    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//-----------------------------------------------------
     62if (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//-----------------------------------------------------
     74function 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//-----------------------------------------------------
     88function a2g_tm_activate() {
     89global $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//-----------------------------------------------------
     116function a2g_tm_settings_page() {
     117  require "settings_page.php";
     118}
     119
     120//-----------------------------------------------------
     121// do     = load individual CSS File
     122//-----------------------------------------------------
     123function 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//-----------------------------------------------------
     130add_shortcode( 'a2gtm', 'a2g_tm' );
     131add_action( 'wp_enqueue_scripts', 'a2g_tm_css' ); 
     132add_action( 'admin_enqueue_scripts', 'a2g_tm_css');
     133add_action("admin_menu", "a2g_tm_options_submenu");
     134register_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//-----------------------------------------------------
     148function a2g_tm_get_highest_cat_sort() {
     149global $wpdb;
     150
     151  $a2g_tm_get_highest_cat   =   $wpdb->get_var("SELECT MAX(catSort) FROM " . $wpdb->prefix . "a2g_tm_kategorie");
    41152 
    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//-----------------------------------------------------
     161function a2g_tm_get_catsort_by_catid( $a2g_tm_cat ) {
     162global $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//-----------------------------------------------------
     174function a2g_tm_edit_cat_by_catid( $a2g_tm_cat ) {
     175global $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//-----------------------------------------------------
     187function a2g_tm_get_text_by_textid( $a2g_tm_text ) {
     188global $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//-----------------------------------------------------
     200function a2g_tm_get_cat_by_catid( $a2g_tm_cat ) {
     201global $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//-----------------------------------------------------
     221function a2g_tm_get_select_options_for_catsort() {
     222global $wpdb;
     223
     224  $a2g_tm_db_get_cat_sorts  =   $wpdb->get_results("SELECT *  FROM " . $wpdb->prefix . "a2g_tm_kategorie");
    54225 
    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&ouml;schen?', 'ada2go-text-modules' ) . '\')" href="options-general.php?page=a2g_tm_settings&action=delcat&id=' . $a2g_tm_get_category->catID.'">' . __(
    125         'l&ouml;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&ouml;schen?', 'ada2go-text-modules' ) . '\')" href="options-general.php?page=a2g_tm_settings&action=deltext&id='.$a2g_tm_get_text->textID.'">'.__(
    147         'l&ouml;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>';
    152228    }
    153229   
    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 &ouml;ffnen</a> | <a href=\"options-general.php?page=a2g_tm_settings&action=deldocument&path=" .$file. "\">Datei l&ouml;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//-----------------------------------------------------
     236function a2g_tm_while_categorys() {
     237global $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&ouml;schen?', 'ada2go-text-modules' ) . '\')"
     249                                  href="options-general.php?page=a2g_tm_settings&action=delcat&id=' . $a2g_tm_get_category->catID . '">'
     250                                  . __('l&ouml;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                                  ';
    170257    }
     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
    171312 
    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//-----------------------------------------------------
     318function a2g_tm_edit_text_by_textid( $a2g_tm_text ) {
     319global $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  
    55Requires at least: 4.7
    66Tested up to: 5.8
    7 Stable tag: 1.4
     7Stable tag: 1.
    88Requires PHP: 7.0
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0
    1111
    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.
     12ada2go - 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.
    1313
    1414== Description ==
     
    1616(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/
    1717
    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
    2119
    2220== Frequently Asked Questions ==
     
    2523
    2624With 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
    2729
    2830== Screenshots ==
     
    3537
    3638== Changelog ==
     39
     40
     41
     42
     43
    3744
    3845= 1.4 =
    39 * Enjoy! See Bugs or anything else? Contact me.
     46* Enjoy! See Bugs or anything else? Contact me.
    4047* A bug has been fixed where in edit mode a click anywhere submitted the form
    4148* The "Sort" Row was added in "Edit Categorys" Table
     
    5461
    5562= 1.1 =
    56 * The translations have been renewed and improved / Die Übersetzungen wurden erneuert und verbessert
    57 * An error is now showed if a category has not been created / Es wird nun ein Fehler ausgegeben, wenn noch keine Kategorie erstellt wurde
    58 * It was ensured that the upcoming version 5.8 works / Es wurde sichergestellt das die kommende Version 5.8 funktioniert
    59 * Small fixes / Kleine Fehler behoben
    60 * The accordion has been removed / Das Akkordeon wurde entfernt
    61 * A tab menu was added / Ein Tab-Menü wurde hinzugefügt
    62 * The "General" text has been adjusted / Der "Allgemein" Text wurde angepasst
    63 * New CSS classes were implemented and old ones removed / Neue CSS Klassen wurde implementiert und alte entfernt
    64 * The JavaScript function has been changed for the tabs / Die JavaScript Funktion wurde für die Tabs geändert
     63* 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
    6572
    6673= 1.0 =
  • ada2go-text-modules/trunk/settings_page.php

    r2568446 r2569846  
    2323            array( '%d' )
    2424          );
    25             echo __('<div class="updated">
     25            __('<div class="updated">
    2626              <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
     27
    2728            </div>');
    2829    }
     
    4647                 )
    4748          );
    48             echo __('<div class="updated">
     49            __('<div class="updated">
    4950              <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
     51
    5052            </div>');
     53
    5154    }
    5255   
     
    5558    if($_GET['action']=="editoutcss" AND (is_admin())) {
    5659    $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">
    6262              <p>'.__('Erledigt! Alles gespeichert!', 'ada2go-text-modules').'</p>
     63
    6364            </div>');
    6465    }
     
    7172              '<div class="error">
    7273                <p>' . __( 'Das hat leider nicht geklappt!', 'ada2go-text-modules' ) . '</p>
     74
    7375              </div>';
    7476          } else {
    75               echo
     77             
    7678              '<div class="updated">
    7779                <p>' . __( 'Kategorie wurde erfolgreich gel&ouml;scht!', 'ada2go-text-modules' ) . '</p>
     80
    7881              </div>';
    7982              }
     
    8487    $a2g_tm_get_document_to_del = esc_url( $_GET['path'] );
    8588            unlink($a2g_tm_get_document_to_del);
    86               echo
     89             
    8790              '<div class="updated">
    8891                <p>' . __( 'Dokument wurde erfolgreich gel&ouml;scht!', 'ada2go-text-modules' ) . '</p>
     92
    8993              </div>';
    9094        }
     
    9599        $table = $wpdb->prefix . 'a2g_tm_text';
    96100        if( $wpdb->delete( $table, array( 'textID' => $_GET['id'] ) ) === FALSE) {
    97               echo
     101             
    98102              '<div class="error">
    99103                <p>' . __( 'Das hat leider nicht geklappt!', 'ada2go-text-modules' ) . '</p>
     104
    100105              </div>';
    101106          } else {
    102               echo
     107             
    103108              '<div class="updated">
    104109                <p>' . __( 'Text wurde erfolgreich gel&ouml;scht!', 'ada2go-text-modules' ) . '</p>
     110
    105111              </div>';
    106112              }
     
    120126          'catSort' => $a2g_filter_input_catsort
    121127          ));
    122           echo '<div class="updated">
     128          '<div class="updated">
    123129              <p>' . __( 'Kategorie wurde erfolgreich angelegt!', 'ada2go-text-modules' ) . '</p>
     130
    124131            </div>';
    125132    }
     
    136143          'text_ueberschrift' => $a2g_filter_input_textident               
    137144          ));
    138           echo '<div class="updated">
     145          '<div class="updated">
    139146              <p>' . __( 'Text wurde erfolgreich angelegt!', 'ada2go-text-modules' ) . '</p>
     147
    140148            </div>';
    141149    }
     
    161169<h1><?php echo esc_html_e('Text Modules - Einstellungen', 'ada2go-text-modules'); ?></h1>
    162170<?php
     171
     172
     173
     174
     175
    163176if($_GET["action"]=="editkat") {
    164177   
     
    218231<form action="?page=a2g_tm_settings&action=editoutcss" method="post">
    219232<?php
    220 $current_file = file_get_contents(ABSPATH . 'wp-content/plugins/ada2go-text-modules/a2g-css-output.txt');
     233$current_file = );
    221234echo wp_editor( $current_file, 'css-output'); ?>
    222235<br />
     
    236249<table id="a2g-table">
    237250<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>
    242255</tr>
    243256<?php echo html_entity_decode ( a2g_tm_while_categorys() ); ?>
     
    268281<table id="a2g-table">
    269282<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>
    273286</tr>
    274287<?php echo html_entity_decode (a2g_tm_while_textes()); ?>
     
    306319<?php
    307320echo a2g_tm_while_safed_textes();
    308 
    309 
    310  ?>
     321?>
    311322</table>
    312323</div>
     
    343354  evt.currentTarget.className += " active";
    344355}
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
    345370</script>
Note: See TracChangeset for help on using the changeset viewer.