'0.1.0', // currently used for new fields 'blueprints' => array( 'new' => array( 'label' => __('Your new field', 'zero-conf-mail'), 'type' => 'text', 'must' => false, 'pos' => 0, ), ), 'fields' => array( 'name' => array( 'pos' => 10, 'label' => __('Your name', 'zero-conf-mail'), 'type' => 'text', 'must' => true, ), 'from' => array( 'pos' => 20, 'label' => __('Your email', 'zero-conf-mail'), 'type' => 'email', 'must' => true, ), 'subject' => array( 'pos' => 30, 'label' => __('Subject', 'zero-conf-mail'), 'type' => 'text', 'must' => false, ), 'body' => array( 'pos' => 40, 'label' => __('Your message', 'zero-conf-mail'), 'type' => 'textarea', 'must' => true, ), 'submit' => array( 'pos' => 50, 'label' => __('Send message', 'zero-conf-mail'), 'type' => 'submit', ), ), // FIXME config shouldn't be localized, breaks on language switch 'config' => array( 'to' => $user_email, 'js' => 'Enabled', 'homelink' => 'In the footer', 'messages' => array( 'failure' => __('Please fill out all fields!', 'zero-conf-mail'), 'success' => __('Your message has been sent. Thank you!', 'zero-conf-mail'), ), 'input_types' => array( 'text', 'textarea', 'email', 'submit', ), 'advanced' => 'Disabled', 'homelink_choices' => array( 'Below the form', 'In the footer', 'Nowhere', ), 'enable_choices' => array( 'Enabled', 'Disabled', ), ), ); $default = zcmail_uasort($default); update_option('zcmail', $default ); } /** * Sort field definitions by id * Parameters: (array) field definitions * Return: (array) sorted field definitions */ function zcmail_uasort($data) { uasort($data['fields'], 'zcmail_uasort_callback'); return($data); } /** * Callback for uasort, see http://php.net/manual/function.uasort.php * Parameters: (array) single field definition, (array) single field definition * Return: (int) */ function zcmail_uasort_callback($a, $b) { return ($a['pos'] < $b['pos'] ) ? -1 : 1; } /** * Print the options page * TODO make this more readable... */ function zcmail_options_page() { // Check permissions if (current_user_can('manage_options')) { ?>
Careful! This will delete any customization you have made!') ?>
[zcmail] into the page content." ,'zero-conf-mail' )?>
Careful! This will delete any customization you have made!') ?>