</a></p> <div class="wp_crm_box_content"> <p><?php echo $plugin_data['description']; ?> </p> </div> <div class="wp_crm_box_footer clearfix"> <ul> <?php if ($installed) { ?> <li><?php echo CRM_UD_UI::checkbox("name=wp_crm_settings[installed_features][{$plugin_slug}][disabled]&label=" . __('Disable feature.', 'wp_crm'), $wp_crm['installed_features'][$plugin_slug]['disabled']); ?> </li> <li><?php _e('Feature installed, using version', 'wp_crm'); ?> <?php echo $wp_crm['installed_features'][$plugin_slug]['version']; ?> .</li> <?php } else { ?> <li><?php echo sprintf(__('Please visit <a href="%s">UsabilityDynamics.com</a> to purchase this feature.', 'wp_crm'), 'http://usabilitydynamics.com/products/wp-crm/premium-features/'); ?>
/** * Adds content to the Messages tab on the settings page * * @version 1.0 * Copyright 2011 Andy Potanin, Usability Dynamics, Inc. <*****@*****.**> */ function settings_page_tab_content($wp_crm) { if (empty($wp_crm['wp_crm_contact_system_data'])) { $wp_crm['wp_crm_contact_system_data']['example_form']['title'] = 'Example Contact Form'; $wp_crm['wp_crm_contact_system_data']['example_form']['full_shortcode'] = '[wp_crm_form form=example_contact_form]'; $wp_crm['wp_crm_contact_system_data']['example_form']['current_form_slug'] = 'example_contact_form'; } ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#wp_crm_wp_crm_contact_system_data .slug_setter").live('change', function() { var parent = jQuery(this).parents('.wp_crm_notification_main_configuration'); jQuery(".wp_crm_contact_form_shortcode", parent).val("[wp_crm_form form=" + wp_crm_create_slug(jQuery(this).val()) + "]"); jQuery(".wp_crm_contact_form_current_form_slug", parent).val(wp_crm_create_slug(jQuery(this).val())); }); }); </script> <div class="wp_crm_inner_tab"> <p> <?php _e('Use this section to add and configure new contact forms.', 'wp_crm'); ?> </p> <table id="wp_crm_wp_crm_contact_system_data" class="form-table wp_crm_form_table ud_ui_dynamic_table widefat"> <thead> <tr> <th class="wp_crm_contact_form_header_col"><?php _e('Form Settings', 'wpp'); ?> </th> <th class="wp_crm_contact_form_attributes_col"><?php _e('Fields', 'wpp'); ?> </th> <?php /* <th class="wp_crm_settings_col"><?php _e('Trigger Actions','wpp') ?></th> */ ?> <th class="wp_crm_delete_col"> </th> </tr> </thead> <tbody> <?php foreach ($wp_crm['wp_crm_contact_system_data'] as $contact_form_slug => $data) { $row_hash = rand(100, 999); ?> <tr class="wp_crm_dynamic_table_row" slug="<?php echo $contact_form_slug; ?> " new_row='false'> <td class='wp_crm_contact_form_header_col'> <ul class="wp_crm_notification_main_configuration"> <li> <label for=""><?php _e('Title:', 'wp_crm'); ?> </label> <input type="text" id="title_<?php echo $row_hash; ?> " class="slug_setter regular-text" name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][title]" value="<?php echo $data['title']; ?> " /> </li> <li> <label><?php _e('Shortcode:', 'wp_crm'); ?> </label> <input type="text" READONLY class='regular-text wp_crm_contact_form_shortcode' name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][full_shortcode]" value="<?php echo $data['full_shortcode']; ?> " /> <input type="hidden" class='regular-text wp_crm_contact_form_current_form_slug' name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][current_form_slug]" value="<?php echo $data['current_form_slug']; ?> " /> </li> <li> <label for=""><?php _e('Role:'); ?> </label> <select id="" name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][new_user_role]"> <option value=""> - </option> <?php wp_dropdown_roles($data['new_user_role']); ?> </select> <span class="description"><?php _e('If new user created, assign this role.'); ?> </span> </li> <li class="wp_crm_checkbox_on_left"> <input <?php checked($data['message_field'], 'on'); ?> id="message_<?php echo $row_hash; ?> " type="checkbox" name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][message_field]" value="on" value="<?php echo $data['message_field']; ?> " /> <label for="message_<?php echo $row_hash; ?> "><?php _e('Display textarea for custom message.', 'wp_crm'); ?> </label> </li> <li class="wp_crm_checkbox_on_left"> <input <?php checked($data['notify_with_blank_message'], 'on'); ?> id="blank_message<?php echo $row_hash; ?> " type="checkbox" name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][notify_with_blank_message]" value="on" value="<?php echo $data['notify_with_blank_message']; ?> " /> <label for="blank_message<?php echo $row_hash; ?> "><?php _e('Send message notification even if no message is submitted.', 'wp_crm'); ?> </label> </li> </ul> </td> <td> <?php if (is_array($wp_crm['data_structure']['attributes'])) { ?> <ul class="wp-tab-panel"> <?php foreach ($wp_crm['data_structure']['attributes'] as $attribute_slug => $attribute_data) { if (empty($attribute_data['title'])) { continue; } ?> <li> <input id="field_<?php echo $attribute_slug; ?> _<?php echo $row_hash; ?> " type="checkbox" <?php CRM_UD_UI::checked_in_array($attribute_slug, $data['fields']); ?> name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?> ][fields][]" value="<?php echo $attribute_slug; ?> " /> <label for="field_<?php echo $attribute_slug; ?> _<?php echo $row_hash; ?> "><?php echo $attribute_data['title']; ?> </label> </li> <?php } ?> </ul> <?php } ?> </td> <?php /* <td class="wp_crm_settings_col"> <?php if(is_array($wp_crm['notification_actions'])): ?> <ul class="wp-tab-panel"> <?php foreach($wp_crm['notification_actions'] as $action_slug => $action_title): if(empty($action_title)) { continue; } ?> <li> <input <?php if( $action_slug == $contact_form_slug) echo ' DISABLED checked=true ' ; ?> id="field_<?php echo $action_slug; ?>_<?php echo $row_hash; ?>" type="checkbox" <?php CRM_UD_UI::checked_in_array($action_slug, $data['fire_on_action']); ?> name="wp_crm[wp_crm_contact_system_data][<?php echo $contact_form_slug; ?>][fire_on_action][]" value="<?php echo $action_slug; ?>" /> <label for="field_<?php echo $action_slug; ?>_<?php echo $row_hash; ?>"><?php echo $action_title; ?></label> </li> <?php endforeach; ?> </ul> <?php else: ?> <p><?php _e('You do not have any notification actions yet. ', 'wp_crm'); ?></p> <?php endif; ?> </td> */ ?> <td valign="middle"><span class="wp_crm_delete_row button"><?php _e('Delete', 'wpp'); ?> </span></td> </tr> </tbody> <?php } ?> <tfoot> <tr> <td colspan='4'> <input type="button" class="wp_crm_add_row button-secondary" value="<?php _e('Add Row', 'wpp'); ?> " /> </td> </tr> </tfoot> </table> <p><?php _e('To see list of variables you can use in wp_crm_contact_system_data open up the "Help" tab and view the user data structure. Any variable you see in there can be used in the subject field, to field, BCC field, and the message body. Example: [user_email] would include the recipient\'s e-mail.', 'wp_crm'); ?> </p> <p><?php _e('To add notification actions use the <b>wp_crm_notification_actions</b> filter, then call the action within <b>wp_crm_send_notification()</b> function, and the messages association with the given action will be fired off.', 'wp_crm'); ?> </p> <table class='form-table'> <tr> <th><?php _e('Options'); ?> </th> <td> <ul> <li> <label for="wp_crm_new_contact_role"><?php _e('Default role to use for new contacts: '); ?> </label> <select id="wp_crm_new_contact_role" name="wp_crm[configuration][new_contact_role]"><option value=""> - </option><?php wp_dropdown_roles($wp_crm['configuration']['new_contact_role']); ?> </select> <div class="description"><?php _e('WP-CRM creates user profiles, if only temporary, to store inquiries and messages from contact forms. ', 'wp_crm'); ?> </div> </li> </ul> </td> </table> <?php do_action('wp_crm_settings_notification_tab'); ?> </div> <?php }
?> " new_row='false'> <td><?php echo $role['name']; ?> </td> <td > <ul class="wp-tab-panel"> <?php foreach ($wp_crm['data_structure']['attributes'] as $key => $attribute_data) { ?> <li> <input <?php CRM_UD_UI::checked_in_array($key, !empty($wp_crm['hidden_attributes'][$role_slug]) ? $wp_crm['hidden_attributes'][$role_slug] : array()); ?> id="<?php echo $key; ?> _<?php echo $rand_id; ?> " type="checkbox" name="wp_crm[hidden_attributes][<?php echo $role_slug; ?> ][]" value="<?php echo $key; ?> " /> <label for="<?php