Changeset 1400655
- Timestamp:
- 04/20/2016 06:26:48 PM (10 years ago)
- Location:
- responsive-mobile-friendly-tooltip
- Files:
-
- 4 edited
- 1 copied
-
tags/1.6.2 (copied) (copied from responsive-mobile-friendly-tooltip/trunk)
-
tags/1.6.2/responsive-tooltip-admin-page.php (modified) (4 diffs)
-
tags/1.6.2/responsive-tooltip.php (modified) (1 diff)
-
trunk/responsive-tooltip-admin-page.php (modified) (4 diffs)
-
trunk/responsive-tooltip.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
responsive-mobile-friendly-tooltip/tags/1.6.2/responsive-tooltip-admin-page.php
r713515 r1400655 38 38 global $RMFtooltip_style_settings; 39 39 $RMFtooltip_style_settings = get_option('RMFtooltip_style_settings'); //Gets old options 40 $RMFtooltip_style_settings[ chkbx_use_custom_css] = $RMFtooltip_style_settings[chkbx_use_custom_css] ? 'on' : 'off';40 $RMFtooltip_style_settings['chkbx_use_custom_css'] = $RMFtooltip_style_settings['chkbx_use_custom_css'] ? 'on' : 'off'; 41 41 register_setting( 'RMFtooltip_style_settings', 'RMFtooltip_style_settings', 'RMFtooltip_input_processor' ); //Does all the saving =D 42 42 function RMFtooltip_input_processor ($input) { //Process user data 43 43 global $RMFtooltip_style_settings; 44 if ( $input[ chkbx_use_custom_css] == 'on' && empty($input[textarea_css])) { //Makes sure the textarea isn't empty if it suppose to be full44 if ( $input['chkbx_use_custom_css'] == 'on' && empty($input['textarea_css'])) { //Makes sure the textarea isn't empty if it suppose to be full 45 45 add_settings_error( 'textarea_css', 'textarea_css_empty', "You haven't entered any CSS code, either enter some code or uncheck the use custom CSS box. Your settings will NOT be saved." ); //Output an error 46 46 return $RMFtooltip_style_settings; //Save the old settings again since invalid settings has been entred 47 47 } 48 48 /*----------Save css to file------------*/ 49 if ($input[ chkbx_use_custom_css] == 'on') {50 if ($input[ chkbx_replace_css] == 'on') {51 $css_file = $input[ textarea_css]; //Writes only the new changes49 if ($input['chkbx_use_custom_css'] == 'on') { 50 if ($input['chkbx_replace_css'] == 'on') { 51 $css_file = $input['textarea_css']; //Writes only the new changes 52 52 } else { 53 53 $css_file = file_get_contents(plugin_dir_path(__FILE__) . 'responsive-tooltip.org.css'); 54 $css_file .= "\n{$input[ textarea_css]}"; //Adds the entered code at the end of the original code54 $css_file .= "\n{$input['textarea_css']}"; //Adds the entered code at the end of the original code 55 55 } 56 56 } else { //Else writes the original file … … 86 86 </th> 87 87 <td> 88 <input type="checkbox" id="chkbx_use_custom_css" onclick="chkchng()" name="RMFtooltip_style_settings[ chkbx_use_custom_css]" <?php checked( $RMFtooltip_style_settings[chkbx_use_custom_css], 'on' ); ?> />88 <input type="checkbox" id="chkbx_use_custom_css" onclick="chkchng()" name="RMFtooltip_style_settings['chkbx_use_custom_css']" <?php checked( $RMFtooltip_style_settings['chkbx_use_custom_css'], 'on' ); ?> /> 89 89 <p class="description">Check if you want to use your own custom stylesheet for the tooltip.</p> 90 90 </td> … … 100 100 </th> 101 101 <td> 102 <input type="checkbox" id="chkbx_replace_css" name="RMFtooltip_style_settings[ chkbx_replace_css]" <?php checked( $RMFtooltip_style_settings[chkbx_replace_css], 'on' ); ?> <?php disabled( $RMFtooltip_style_settings[chkbx_use_custom_css], 'off'); ?> />102 <input type="checkbox" id="chkbx_replace_css" name="RMFtooltip_style_settings['chkbx_replace_css']" <?php checked( $RMFtooltip_style_settings['chkbx_replace_css'], 'on' ); ?> <?php disabled( $RMFtooltip_style_settings['chkbx_use_custom_css'], 'off'); ?> /> 103 103 <p class="description">Check if want to replace the default CSS rules rather than add to them</p> 104 104 </td> … … 114 114 </th> 115 115 <td> 116 <textarea id="textarea_css" class="large-text" name="RMFtooltip_style_settings[ textarea_css]" cols="50" rows="15" placeholder="Enter your css code here" <?php disabled( $RMFtooltip_style_settings[chkbx_use_custom_css], 'off'); ?> ><?php echo esc_textarea( $RMFtooltip_style_settings[textarea_css] ); ?></textarea>116 <textarea id="textarea_css" class="large-text" name="RMFtooltip_style_settings['textarea_css']" cols="50" rows="15" placeholder="Enter your css code here" <?php disabled( $RMFtooltip_style_settings['chkbx_use_custom_css'], 'off'); ?> ><?php echo esc_textarea( $RMFtooltip_style_settings['textarea_css'] ); ?></textarea> 117 117 </td> 118 118 </tr> -
responsive-mobile-friendly-tooltip/tags/1.6.2/responsive-tooltip.php
r1303287 r1400655 86 86 /*-------------------- Version Handling --------------------*/ 87 87 $c_version = 1.62; // Current version 88 $o_version = get_option( RMFtooltip_version); //Gets old version88 $o_version = get_option('RMFtooltip_version'); //Gets old version 89 89 if ( $c_version > $o_version ) { 90 90 update_option('RMFtooltip_version', $c_version); 91 91 $RMFtooltip_style_settings = get_option('RMFtooltip_style_settings'); //Genrate user's custom CSS file 92 if ($RMFtooltip_style_settings[ chkbx_use_custom_css] == 'on') {93 if ($RMFtooltip_style_settings[ chkbx_replace_css] == 'on') {94 $css_file = $RMFtooltip_style_settings[ textarea_css]; //Writes only the new changes92 if ($RMFtooltip_style_settings['chkbx_use_custom_css'] == 'on') { 93 if ($RMFtooltip_style_settings['chkbx_replace_css'] == 'on') { 94 $css_file = $RMFtooltip_style_settings['textarea_css']; //Writes only the new changes 95 95 } else { 96 96 $css_file = file_get_contents(plugin_dir_path(__FILE__) . 'responsive-tooltip.org.css'); 97 $css_file .= "\n{$RMFtooltip_style_settings[ textarea_css]}"; //Adds the entered code at the end of the original code97 $css_file .= "\n{$RMFtooltip_style_settings['textarea_css']}"; //Adds the entered code at the end of the original code 98 98 } 99 99 } else { //Else writes the original file -
responsive-mobile-friendly-tooltip/trunk/responsive-tooltip-admin-page.php
r713515 r1400655 38 38 global $RMFtooltip_style_settings; 39 39 $RMFtooltip_style_settings = get_option('RMFtooltip_style_settings'); //Gets old options 40 $RMFtooltip_style_settings[ chkbx_use_custom_css] = $RMFtooltip_style_settings[chkbx_use_custom_css] ? 'on' : 'off';40 $RMFtooltip_style_settings['chkbx_use_custom_css'] = $RMFtooltip_style_settings['chkbx_use_custom_css'] ? 'on' : 'off'; 41 41 register_setting( 'RMFtooltip_style_settings', 'RMFtooltip_style_settings', 'RMFtooltip_input_processor' ); //Does all the saving =D 42 42 function RMFtooltip_input_processor ($input) { //Process user data 43 43 global $RMFtooltip_style_settings; 44 if ( $input[ chkbx_use_custom_css] == 'on' && empty($input[textarea_css])) { //Makes sure the textarea isn't empty if it suppose to be full44 if ( $input['chkbx_use_custom_css'] == 'on' && empty($input['textarea_css'])) { //Makes sure the textarea isn't empty if it suppose to be full 45 45 add_settings_error( 'textarea_css', 'textarea_css_empty', "You haven't entered any CSS code, either enter some code or uncheck the use custom CSS box. Your settings will NOT be saved." ); //Output an error 46 46 return $RMFtooltip_style_settings; //Save the old settings again since invalid settings has been entred 47 47 } 48 48 /*----------Save css to file------------*/ 49 if ($input[ chkbx_use_custom_css] == 'on') {50 if ($input[ chkbx_replace_css] == 'on') {51 $css_file = $input[ textarea_css]; //Writes only the new changes49 if ($input['chkbx_use_custom_css'] == 'on') { 50 if ($input['chkbx_replace_css'] == 'on') { 51 $css_file = $input['textarea_css']; //Writes only the new changes 52 52 } else { 53 53 $css_file = file_get_contents(plugin_dir_path(__FILE__) . 'responsive-tooltip.org.css'); 54 $css_file .= "\n{$input[ textarea_css]}"; //Adds the entered code at the end of the original code54 $css_file .= "\n{$input['textarea_css']}"; //Adds the entered code at the end of the original code 55 55 } 56 56 } else { //Else writes the original file … … 86 86 </th> 87 87 <td> 88 <input type="checkbox" id="chkbx_use_custom_css" onclick="chkchng()" name="RMFtooltip_style_settings[ chkbx_use_custom_css]" <?php checked( $RMFtooltip_style_settings[chkbx_use_custom_css], 'on' ); ?> />88 <input type="checkbox" id="chkbx_use_custom_css" onclick="chkchng()" name="RMFtooltip_style_settings['chkbx_use_custom_css']" <?php checked( $RMFtooltip_style_settings['chkbx_use_custom_css'], 'on' ); ?> /> 89 89 <p class="description">Check if you want to use your own custom stylesheet for the tooltip.</p> 90 90 </td> … … 100 100 </th> 101 101 <td> 102 <input type="checkbox" id="chkbx_replace_css" name="RMFtooltip_style_settings[ chkbx_replace_css]" <?php checked( $RMFtooltip_style_settings[chkbx_replace_css], 'on' ); ?> <?php disabled( $RMFtooltip_style_settings[chkbx_use_custom_css], 'off'); ?> />102 <input type="checkbox" id="chkbx_replace_css" name="RMFtooltip_style_settings['chkbx_replace_css']" <?php checked( $RMFtooltip_style_settings['chkbx_replace_css'], 'on' ); ?> <?php disabled( $RMFtooltip_style_settings['chkbx_use_custom_css'], 'off'); ?> /> 103 103 <p class="description">Check if want to replace the default CSS rules rather than add to them</p> 104 104 </td> … … 114 114 </th> 115 115 <td> 116 <textarea id="textarea_css" class="large-text" name="RMFtooltip_style_settings[ textarea_css]" cols="50" rows="15" placeholder="Enter your css code here" <?php disabled( $RMFtooltip_style_settings[chkbx_use_custom_css], 'off'); ?> ><?php echo esc_textarea( $RMFtooltip_style_settings[textarea_css] ); ?></textarea>116 <textarea id="textarea_css" class="large-text" name="RMFtooltip_style_settings['textarea_css']" cols="50" rows="15" placeholder="Enter your css code here" <?php disabled( $RMFtooltip_style_settings['chkbx_use_custom_css'], 'off'); ?> ><?php echo esc_textarea( $RMFtooltip_style_settings['textarea_css'] ); ?></textarea> 117 117 </td> 118 118 </tr> -
responsive-mobile-friendly-tooltip/trunk/responsive-tooltip.php
r1303287 r1400655 86 86 /*-------------------- Version Handling --------------------*/ 87 87 $c_version = 1.62; // Current version 88 $o_version = get_option( RMFtooltip_version); //Gets old version88 $o_version = get_option('RMFtooltip_version'); //Gets old version 89 89 if ( $c_version > $o_version ) { 90 90 update_option('RMFtooltip_version', $c_version); 91 91 $RMFtooltip_style_settings = get_option('RMFtooltip_style_settings'); //Genrate user's custom CSS file 92 if ($RMFtooltip_style_settings[ chkbx_use_custom_css] == 'on') {93 if ($RMFtooltip_style_settings[ chkbx_replace_css] == 'on') {94 $css_file = $RMFtooltip_style_settings[ textarea_css]; //Writes only the new changes92 if ($RMFtooltip_style_settings['chkbx_use_custom_css'] == 'on') { 93 if ($RMFtooltip_style_settings['chkbx_replace_css'] == 'on') { 94 $css_file = $RMFtooltip_style_settings['textarea_css']; //Writes only the new changes 95 95 } else { 96 96 $css_file = file_get_contents(plugin_dir_path(__FILE__) . 'responsive-tooltip.org.css'); 97 $css_file .= "\n{$RMFtooltip_style_settings[ textarea_css]}"; //Adds the entered code at the end of the original code97 $css_file .= "\n{$RMFtooltip_style_settings['textarea_css']}"; //Adds the entered code at the end of the original code 98 98 } 99 99 } else { //Else writes the original file
Note: See TracChangeset
for help on using the changeset viewer.