";
echo "
Are You a Human " . $page_opts['title'] . "
";
if ($page_opts['flash_message']) {
echo $page_opts['flash_message'];
}
echo ayah_get_form($action, $page_opts['button']);
echo "";
}
/**
* Sets the page option for the settings page
*/
function ayah_get_settings_page_options() {
$page_opts = array();
$page_opts['title'] = 'PlayThru Settings';
$page_opts['button'] = 'Update Settings';
$page_opts['flash_message'] = null;
// If the form was posted
if (isset($_POST['ayah'])) {
$page_opts['flash_message'] = "Your settings have been saved!";
}
return $page_opts;
}
/**
* Sets the page options for the upgrade page
*/
function ayah_get_upgrade_page_options(&$action) {
$page_opts = array();
$page_opts['title'] = 'Upgrade';
$page_opts['button'] = 'Complete Upgrade';
$page_opts['flash_message'] = "Please take a moment to make sure the following is correct and complete your upgrade.";
// If the form was posted
if (isset($_POST['ayah'])) {
$action = 'settings';
$page_opts = ayah_get_settings_page_options();
$page_opts['flash_message'] = "Your plugin has been successfully upgraded.";
}
return $page_opts;
}
/**
* Sets the page options for the install page
*/
function ayah_get_install_page_options(&$action) {
$page_opts = array();
$page_opts['title'] = "Installation";
$page_opts['button'] = "Complete Installation";
$page_opts['flash_message'] = "To complete your installation:
- Register for an account on Are You a Human.
- Copy and paste the Publisher and Scoring keys into the fields below.
";
// If the form was posted
if (isset($_POST['ayah'])) {
$action = 'settings';
$page_opts = ayah_get_settings_page_options();
$page_opts['flash_message'] = "The plugin has been successfully installed.
";
}
return $page_opts;
}
/**
* Returns the settings page HTML with the settings inputs filled in
*/
function ayah_get_form($action, $button) {
$ayah_options = ayah_get_options();
// Set up our checkbox checked
$chk_enable_register_form = ( $ayah_options['enable_register_form'] ) ? 'checked' : '';
$chk_enable_lost_password_form = ( $ayah_options['enable_lost_password_form'] ) ? 'checked' : '';
$chk_enable_comment_form = ( $ayah_options['enable_comment_form'] ) ? 'checked' : '';
$chk_hide_registered_users = ( $ayah_options['hide_registered_users'] ) ? 'checked' : '';
include('settings_page.php');
}
/**
* Adds a button that allows the settings in the database to be deleted. Used
* for testing/debugging.
*/
function ayah_clear_options_button() {
return "
";
}