options_group, $assignment_desk->get_plugin_option_fullname('general'), array(&$this, 'assignment_desk_validate') );
add_settings_section( 'story_pitches', 'Story Pitches', array(&$this, 'story_pitches_setting_section'), $assignment_desk->top_level_page );
add_settings_field( 'pitch_form_enabled', 'Enable pitch forms', array(&$this, 'pitch_form_enabled_option'), $assignment_desk->top_level_page, 'story_pitches' );
add_settings_field( 'default_new_assignment_status', 'Default assignment status', array(&$this, 'default_new_assignment_status_option'), $assignment_desk->top_level_page, 'story_pitches' );
add_settings_field( 'default_workflow_status', 'Default workflow status', array(&$this, 'default_workflow_status_option'), $assignment_desk->top_level_page, 'story_pitches' );
add_settings_field( 'pitch_form_elements', 'Pitch form elements', array(&$this, 'pitch_form_elements_option'), $assignment_desk->top_level_page, 'story_pitches' );
add_settings_section( 'assignment_management', 'Assignment Management', array(&$this, 'assignment_management_setting_section'), $assignment_desk->top_level_page );
add_settings_field( 'assignment_email_notifications_enabled', 'Enable assignment email notifications', array(&$this, 'assignment_email_notifications_enabled_option'), $assignment_desk->top_level_page, 'assignment_management' );
add_settings_field( 'assignment_email_template_subject', 'Subject template for notifications', array(&$this, 'assignment_email_template_subject_option'), $assignment_desk->top_level_page, 'assignment_management' );
add_settings_field( 'assignment_email_template', 'Template for notifications', array(&$this, 'assignment_email_template_option'), $assignment_desk->top_level_page, 'assignment_management' );
add_settings_section( 'public_facing_views', 'Public-Facing Views', array(&$this, 'public_facing_views_setting_section'), $assignment_desk->top_level_page );
add_settings_field( 'public_facing_elements', 'Public-facing elements', array(&$this, 'public_facing_elements_option'), $assignment_desk->top_level_page, 'public_facing_views' );
add_settings_field( 'public_facing_functionality', 'Public-facing functionality', array(&$this, 'public_facing_functionality_option'), $assignment_desk->top_level_page, 'public_facing_views' );
add_settings_section( 'miscellaneous', 'Miscellaneous', array(&$this, 'miscellaneous_setting_section'), $assignment_desk->top_level_page );
add_settings_field( 'google_maps_api_key', 'Google Maps API key', array(&$this, 'google_maps_api_key_option'), $assignment_desk->top_level_page, 'miscellaneous' );
}
function story_pitches_setting_section() {
global $assignment_desk;
echo "Add an Assignment Desk pitch form to any page or post by adding <!--$assignment_desk->pitch_form_key--> where you'd it to appear.";
}
function pitch_form_enabled_option() {
global $assignment_desk;
$options = $assignment_desk->general_options;
echo '';
}
function default_new_assignment_status_option() {
global $assignment_desk;
$options = $assignment_desk->general_options;
$assignment_statuses = $assignment_desk->custom_taxonomies->get_assignment_statuses();
if (count($assignment_statuses)) {
echo '';
} else {
echo "No statuses set. Please custom_taxonomies->assignment_status_label . "'>create at least one assignment status.";
}
}
/**
* Define post status for newly submitted pitches
* @requires Edit Flow
*/
function default_workflow_status_option() {
global $assignment_desk;
if (class_exists('edit_flow')) {
global $edit_flow;
$options = $assignment_desk->general_options;
$post_statuses = $edit_flow->custom_status->get_custom_statuses();
echo ' ';
echo 'Indicate the status in your workflow a new story pitch should be given.';
} else {
echo 'Please enable Edit Flow to define custom workflow statuses. Without Edit Flow, new pitches will be saved with a post status of "draft"';
}
}
/**
* Enable/disable data elements on pitch form
*/
function pitch_form_elements_option() {
global $assignment_desk;
if ($assignment_desk->edit_flow_exists()) {
global $edit_flow;
}
$options = $assignment_desk->general_options;
echo '
';
// Title
echo '
';
// Description
if ($assignment_desk->edit_flow_exists()) {
echo '
';
} else {
echo '
Please enable Edit Flow to allow description field.
';
}
// Categories
echo '
';
// Tags
echo '
';
// Volunteer
echo '
';
// Due date
if ($assignment_desk->edit_flow_exists()) {
echo '
';
} else {
echo '
Please enable Edit Flow to allow due date field.
';
}
// Location
if ($assignment_desk->edit_flow_exists()) {
echo '
';
} else {
echo '
Please enable Edit Flow to allow location field.
';
}
echo '
';
}
function assignment_management_setting_section() {
global $assignment_desk;
}
function assignment_email_notifications_enabled_option() {
global $assignment_desk;
$options = $assignment_desk->general_options;
echo '';
}
function assignment_email_template_subject_option() {
global $assignment_desk;
$options = $assignment_desk->general_options;
?>
general_options;
echo ' ';
echo 'Use tokens like %title%, %location% and %dashboard_link%';
}
function public_facing_views_setting_section() {
global $assignment_desk;
echo "Enable public access to pitches and stories in progress by dropping <!--$assignment_desk->all_posts_key--> in a page.";
}
function public_facing_elements_option() {
global $assignment_desk;
if ($assignment_desk->edit_flow_exists()) {
global $edit_flow;
}
$options = $assignment_desk->general_options;
echo '
';
// Title
echo '
';
// Description
if ($assignment_desk->edit_flow_exists()) {
echo '
';
} else {
echo '
Please enable Edit Flow to allow description field.
';
}
// Due date
if ($assignment_desk->edit_flow_exists()) {
echo '
';
} else {
echo '
Please enable Edit Flow to allow due date field.
';
}
// Location
if ($assignment_desk->edit_flow_exists()) {
echo '
';
} else {
echo '
Please enable Edit Flow to allow location field.
';
}
// Categories
echo '
';
// Tags
echo '
';
echo '
';
}
function public_facing_functionality_option() {
global $assignment_desk;
if ($assignment_desk->edit_flow_exists()) {
global $edit_flow;
}
$options = $assignment_desk->general_options;
echo '
';
// Volunteer
echo '
';
// Voting
echo '
';
// Commenting
echo '
';
echo '
';
}
function google_maps_api_key_option() {
global $assignment_desk;
$options = $assignment_desk->general_options;
echo '';
}
function miscellaneous_setting_section() {
}
/**
* Validation for all of our form elements
*/
function assignment_desk_validate($input) {
// @todo Should we validate all elements?
$input['default_new_assignment_status'] = (int)$input['default_new_assignment_status'];
$input['google_maps_api_key'] = wp_kses($input['google_maps_api_key'], $allowedtags);
return $input;
}
function general_settings() {
global $wpdb, $assignment_desk;
$msg = null;
if ( array_key_exists( 'updated', $_GET ) && $_GET['updated']=='true' ) {
$msg = __('Settings Saved', 'assignment-desk');
}
?>