Changeset 1368099
- Timestamp:
- 03/10/2016 08:02:50 AM (10 years ago)
- Location:
- php-code-for-posts
- Files:
-
- 37 added
- 1 deleted
- 9 edited
-
tags/2.0.1 (deleted)
-
tags/2.0.2 (added)
-
tags/2.0.2/Classes (added)
-
tags/2.0.2/Classes/Database.php (added)
-
tags/2.0.2/Classes/Install.php (added)
-
tags/2.0.2/Classes/Menu.php (added)
-
tags/2.0.2/Classes/Messages.php (added)
-
tags/2.0.2/Classes/Options.php (added)
-
tags/2.0.2/Classes/PhpCodeForPosts.php (added)
-
tags/2.0.2/Classes/Shortcode.php (added)
-
tags/2.0.2/Classes/Snippet.php (added)
-
tags/2.0.2/Codemirror (added)
-
tags/2.0.2/Codemirror/addon (added)
-
tags/2.0.2/Codemirror/addon/matchbrackets.js (added)
-
tags/2.0.2/Codemirror/lang (added)
-
tags/2.0.2/Codemirror/lang/clike.js (added)
-
tags/2.0.2/Codemirror/lang/css.js (added)
-
tags/2.0.2/Codemirror/lang/htmlmixed.js (added)
-
tags/2.0.2/Codemirror/lang/javascript.js (added)
-
tags/2.0.2/Codemirror/lang/php.js (added)
-
tags/2.0.2/Codemirror/lang/xml.js (added)
-
tags/2.0.2/Codemirror/lib (added)
-
tags/2.0.2/Codemirror/lib/codemirror.css (added)
-
tags/2.0.2/Codemirror/lib/codemirror.js (added)
-
tags/2.0.2/PHPPostCode.js (added)
-
tags/2.0.2/php-code-for-posts.php (added)
-
tags/2.0.2/php-icon.png (added)
-
tags/2.0.2/readme.txt (added)
-
tags/2.0.2/screenshot-1.jpg (added)
-
tags/2.0.2/screenshot-2.jpg (added)
-
tags/2.0.2/style.css (added)
-
tags/2.0.2/templates (added)
-
tags/2.0.2/templates/admin-index-bottom.tpl (added)
-
tags/2.0.2/templates/admin-index-default.tpl (added)
-
tags/2.0.2/templates/admin-index-edit.tpl (added)
-
tags/2.0.2/templates/admin-index-top-edit.tpl (added)
-
tags/2.0.2/templates/admin-index-top.tpl (added)
-
tags/2.0.2/templates/admin-snippet-row.tpl (added)
-
trunk/Classes/Menu.php (modified) (2 diffs)
-
trunk/Classes/Options.php (modified) (1 diff)
-
trunk/Classes/PhpCodeForPosts.php (modified) (3 diffs)
-
trunk/Classes/Shortcode.php (modified) (1 diff)
-
trunk/Classes/Snippet.php (modified) (1 diff)
-
trunk/php-code-for-posts.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/templates/admin-index-default.tpl (modified) (1 diff)
-
trunk/templates/admin-index-edit.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
php-code-for-posts/trunk/Classes/Menu.php
r1367869 r1368099 71 71 } 72 72 73 public function show_menu_page()73 public static function show_menu_page() 74 74 { 75 75 $action = isset( $_GET['action'] ) ? $_GET['action'] : ''; … … 92 92 } 93 93 94 public function show_menu_page_default()94 public static function show_menu_page_default() 95 95 { 96 if(! PhpCodeForPosts_Install::check_plugin_table_exists() ) { 97 PhpCodeForPosts_Install::upgrade_table(); 98 } 96 99 include PhpCodeForPosts::directory_path_it( 'templates/admin-index-default.tpl' ); 97 100 } 98 101 99 public function show_menu_page_edit()102 public static function show_menu_page_edit() 100 103 { 101 104 if(! PhpCodeForPosts::check_nonce( $_REQUEST['actioncode'], $_REQUEST['item'], $_REQUEST['action'] ) ) { -
php-code-for-posts/trunk/Classes/Options.php
r1368087 r1368099 20 20 'sidebar_filter' => 1, 21 21 'table_version' => 0, 22 'ajaxible' => 1, 22 23 ); 23 24 } -
php-code-for-posts/trunk/Classes/PhpCodeForPosts.php
r1367869 r1368099 1 1 <?php 2 3 2 class PhpCodeForPosts { 4 3 … … 240 239 self::__input_name( $key ), 241 240 self::__input_id( $key ), 242 __( $label, PhpCodeforPosts::TEXTDOMAIN ),241 $label, 243 242 checked( self::$options->get_option( $key ), 1, false ) ? : '' 244 243 ); … … 259 258 '<label for="%1$s">%2$s</label> <input type="text" name="%3$s" value="%4$s" id="%1$s" />', 260 259 self::__input_id( $key ), 261 esc_html __( $label, PhpCodeforPosts::TEXTDOMAIN ),260 esc_html( $label, PhpCodeforPosts::TEXTDOMAIN ), 262 261 self::__input_name( $key ), 263 262 esc_attr( $value ) -
php-code-for-posts/trunk/Classes/Shortcode.php
r1367869 r1368099 4 4 const DEFAULT_SHORTCODE = 'php'; 5 5 6 public function get_shortcode()6 public static function get_shortcode() 7 7 { 8 8 $option_value = PhpCodeForPosts::$options->get_option( 'shortcode' ); -
php-code-for-posts/trunk/Classes/Snippet.php
r1367869 r1368099 143 143 $snippet = $snippet_id > 0 ? PhpCodeForPosts_Database::load_single_snippet( $snippet_id ) : new static; 144 144 145 $snippet->set_name( $post_fields['name']);146 $snippet->set_code( $post_fields['code']);147 $snippet->set_description( $post_fields['description']);145 $snippet->set_name( stripslashes($post_fields['name']) ); 146 $snippet->set_code( stripslashes($post_fields['code']) ); 147 $snippet->set_description( stripcslashes($post_fields['description']) ); 148 148 149 149 PhpCodeForPosts_Snippet::$last_saved_snippet = $snippet; -
php-code-for-posts/trunk/php-code-for-posts.php
r1368087 r1368099 3 3 * Plugin Name: PHP Code For Posts 4 4 * Description: Insert and Execute PHP Code in WordPress Content. This plugin also enables shortcodes for the text widget. 5 * Version: 2.0. 15 * Version: 2.0.2 6 6 * Author: Jamie Fraser 7 7 * Author uri: http://www.jamiefraser.co.uk/?utm-campaign=PHPCodeForPosts … … 10 10 **/ 11 11 12 if (function_exists('session_status')) { 13 if (session_status() == PHP_SESSION_NONE) { 14 session_start(); 15 } 16 } else { 17 if(session_id() == '') { 18 session_start(); 19 } 20 } 12 21 global $PHPPC; 13 22 include('Classes/PhpCodeForPosts.php'); -
php-code-for-posts/trunk/readme.txt
r1368087 r1368099 5 5 Requires at least: 3.3.1 6 6 Tested up to: 4.4.2 7 Stable tag: 2.0. 17 Stable tag: 2.0.2 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 93 93 = 2.0.1 = 94 94 * Fixed issue in options class with incompatibility with array accessing a function return i.e. foo()['bar'] 95 = 2.0.2 = 96 * Based on support queries, i have added in an option to disable ajax saving for snippets 95 97 96 98 == Upgrade Notice == … … 110 112 = 2.0.1 = 111 113 * Bug fix 114 = 2.0.2 = 115 * Based on support queries, i have added in an option to disable ajax saving for snippets 116 * Re-added creating the table if it was missing 112 117 113 118 == Screenshots == -
php-code-for-posts/trunk/templates/admin-index-default.tpl
r1367869 r1368099 47 47 <?php echo PhpCodeForPosts::get_hidden_field( 'item', '' ) ?> 48 48 <?php wp_nonce_field( 'updateoptions', PhpCodeForPosts::POSTFIELD_PREFIX . '[actioncode]' ) ?> 49 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'complete_deactivation', 'Remove all options and tables on uninstall' ); ?></p> 50 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'content_filter', 'Parse inline plugin shortcode tags inside post content (HTML Editor Only)' ); ?></p> 51 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'sidebar_filter', 'Parse inline plugin shortcode tags inside sidebar text widgets' ); ?></p> 52 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'enable_richeditor', 'Enable Codemirror\'s rich editor for code snippets' ); ?></p> 53 <p class='formlabel'><?php echo PhpCodeForPosts::get_input_field( 'shortcode', PhpCodeForPosts::$options->get_option('shortcode'), 'Change the shortcode for the plugin (not recommended if you already have snippets!)' ); ?></p> 49 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'complete_deactivation', __('Remove all options and tables on uninstall', PhpCodeforPosts::TEXTDOMAIN ) ); ?></p> 50 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'content_filter', __('Parse inline plugin shortcode tags inside post content (HTML Editor Only)', PhpCodeforPosts::TEXTDOMAIN ) ); ?></p> 51 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'sidebar_filter', __('Parse inline plugin shortcode tags inside sidebar text widgets', PhpCodeforPosts::TEXTDOMAIN ) ); ?></p> 52 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'enable_richeditor', __('Enable Codemirror\'s rich editor for code snippets', PhpCodeforPosts::TEXTDOMAIN ) ); ?></p> 53 <p class='formlabel'><?php echo PhpCodeForPosts::get_checkbox_field( 'ajaxible', __('Use Ajax to save snippets', PhpCodeforPosts::TEXTDOMAIN ) ); ?></p> 54 <p class='formlabel'><?php echo PhpCodeForPosts::get_input_field( 'shortcode', PhpCodeForPosts::$options->get_option('shortcode'), __('Change the shortcode for the plugin (not recommended if you already have snippets!)', PhpCodeforPosts::TEXTDOMAIN ) ); ?></p> 54 55 <div class='clearall'></div> 55 56 <p><input type='submit' class='button-primary' value='<?php _e( 'Save Options', PhpCodeforPosts::TEXTDOMAIN ) ?>' /></p> -
php-code-for-posts/trunk/templates/admin-index-edit.tpl
r1367869 r1368099 8 8 } 9 9 ?></h3> 10 <form action="?page=<?php echo PhpCodeForPosts_Menu::MENU_SLUG?>" method="post" id="codeform" <?php if ($snippet->get_id() ) { echo 'class="ajaxible"'; }?>>10 <form action="?page=<?php echo PhpCodeForPosts_Menu::MENU_SLUG?>" method="post" id="codeform" <?php if ($snippet->get_id() && PhpCodeforPosts::$options->get_option('ajaxible') == 1) { echo 'class="ajaxible"'; }?>> 11 11 <?php 12 12 echo PhpCodeForPosts::get_hidden_field( 'action', 'save');
Note: See TracChangeset
for help on using the changeset viewer.