Changeset 1244416
- Timestamp:
- 09/13/2015 09:23:53 AM (10 years ago)
- File:
-
- 1 edited
-
i-am-human/trunk/iamhuman.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i-am-human/trunk/iamhuman.php
r1244410 r1244416 37 37 38 38 $html = " 39 <div id='iamhuman_container' style='display: none' title='" . get_option( 'description_title') . "'>39 <div id='iamhuman_container' style='display: none' title='" . get_option(IamHumanConstants::IAMHUMAN_OPTION_DESCRIPTION_TITLE) . "'> 40 40 41 41 <div id=\"iamhuman_dialog_contents\"> … … 46 46 47 47 <div id=\"iamhuman_grid\" class='iamhuman_grid'></div> 48 <div class='iamhuman_message'>" . get_option( "incorrect_attempt_message") ."</div>48 <div class='iamhuman_message'>" . get_option(IamHumanConstants::IAMHUMAN_OPTION_INCORRECT_ATTEMPT_MESSAGE) ."</div> 49 49 </div> 50 50 </div> … … 53 53 jQuery(document).ready(function($) { 54 54 55 $('html > head').append($('<style> .colour_bg { background: " . get_option( 'background_colour') . "; }</style>'));56 $('html > head').append($('<style> .colour_one { background: " . get_option( 'colour_one') . "; }</style>'));57 $('html > head').append($('<style> .colour_two { background: " . get_option( 'colour_two') . "; }</style>'));58 $('html > head').append($('<style> .cell_mouse_over { background: " . get_option( 'colour_hover') . "; }</style>'));59 60 foreground = '" . get_option( 'question_colour_one_string') . "';" .61 "guide = '" . get_option( 'question_colour_two_string') . "';" .62 63 "create_grid(\"#iamhuman_grid\", " . get_option( 'grid_size') .");55 $('html > head').append($('<style> .colour_bg { background: " . get_option(IamHumanConstants::IAMHUMAN_OPTION_BACKGROUND_COLOUR) . "; }</style>')); 56 $('html > head').append($('<style> .colour_one { background: " . get_option(IamHumanConstants::IAMHUMAN_OPTION_COLOUR_ONE) . "; }</style>')); 57 $('html > head').append($('<style> .colour_two { background: " . get_option(IamHumanConstants::IAMHUMAN_OPTION_COLOUR_TWO) . "; }</style>')); 58 $('html > head').append($('<style> .cell_mouse_over { background: " . get_option(IamHumanConstants::IAMHUMAN_OPTION_COLOUR_HOVER) . "; }</style>')); 59 60 foreground = '" . get_option(IamHumanConstants::IAMHUMAN_OPTION_QUESTION_COLOUR_ONE_STRING) . "';" . 61 "guide = '" . get_option(IamHumanConstants::IAMHUMAN_OPTION_COLOUR_TWO) . "';" . 62 63 "create_grid(\"#iamhuman_grid\", " . get_option(IamHumanConstants::IAMHUMAN_OPTION_GRID_SIZE) ."); 64 64 65 65 highlight_list(\"#iamhuman_grid\", \"colour_one\", foreground); … … 181 181 function iamhuman_answer_check_ajax_callback() { 182 182 $results = "<result>"; 183 $answer_string = get_option( 'answer_colour_one_string');183 $answer_string = get_option(IamHumanConstants::IAMHUMAN_OPTION_ANSWER_COLOUR_ONE_STRING); 184 184 $test_string = $_POST['answer_string']; 185 185 $results .= "<success>" . (($answer_string === $test_string) ? "true" : "false") . "</success>"; … … 214 214 215 215 if(empty($_POST['iamhuman_answer'])) { 216 wp_die( get_option( "incorrect_attempt_message"));216 wp_die( get_option(IamHumanConstants::IAMHUMAN_OPTION_INCORRECT_ATTEMPT_MESSAGE)); 217 217 } else { 218 218 … … 220 220 221 221 if($test_answer !== $answer_string) { 222 wp_die( get_option( "incorrect_attempt_message"));222 wp_die( get_option(IamHumanConstants::IAMHUMAN_OPTION_INCORRECT_ATTEMPT_MESSAGE)); 223 223 } 224 224 } … … 240 240 function iamhuman_is_enabled() { 241 241 242 return !is_user_logged_in() && get_option('colour_one') !== false && get_option( 'grid_size') !== false &&242 return !is_user_logged_in() && get_option('colour_one') !== false && get_option(IamHumanConstants::IAMHUMAN_OPTION_GRID_SIZE) !== false && 243 243 filter_var(get_option('enable_post_comments'), FILTER_VALIDATE_BOOLEAN); 244 244 }
Note: See TracChangeset
for help on using the changeset viewer.