public static function output($atts = array()) { // Get the tabs $current_clinet_tab = wpaam_get_current_clients_tab(); $all_tabs = array_keys(wpaam_get_clients_page_tabs()); // Display template if (is_user_logged_in()) { get_wpaam_template('clients.php', array('atts' => $atts, 'user_id' => self::$user->ID, 'current_tab' => $current_clinet_tab, 'all_tabs' => $all_tabs)); // Show login form if not logged in } else { echo wpaam_login_form(); } }
/** * Display login form. * * @since 1.0.0 * @access public * @return string */ function wpaam_login_form($args = array()) { $defaults = array('echo' => true, 'redirect' => wpaam_get_login_redirect_url(), 'form_id' => null, 'label_username' => wpaam_get_username_label(), 'label_password' => __('Password', 'wpaam'), 'label_remember' => __('Remember Me', 'wpaam'), 'label_log_in' => __('Login', 'wpaam'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'login_link' => 'yes', 'psw_link' => 'yes', 'register_link' => 'yes'); // Parse incoming $args into an array and merge it with $defaults $args = wp_parse_args($args, $defaults); // Show already logged in message if (is_user_logged_in()) { get_wpaam_template('already-logged-in.php', array('args' => $args)); // Show login form if not logged in } else { get_wpaam_template('forms/login-form.php', array('args' => $args)); // Display helper links do_action('wpaam_do_helper_links', $args['login_link'], $args['register_link'], $args['psw_link']); } }
/** * Output the form. * */ public static function output($atts = array()) { // Display template if (is_user_logged_in()) { if (isset($_POST['submit_wpaam_payments'])) { // Show errors from fields self::show_errors(); // Show confirmation messages self::show_confirmations(); } get_wpaam_template('forms/payments-form.php', array('atts' => $atts, 'form' => self::$form_name, 'user_id' => self::$user->ID)); // Show login form if not logged in } else { echo wpaam_login_form(); } }
/** * Displays the html of a field within a form. * * @since 1.0.0 * @return mixed */ function wpaam_get_field_input_html($key, $field) { if (wpaam_field_type_exists($field['type'])) { $object = wpaam_get_field_type_object($field['type']); if (method_exists($object->class, "input_html")) { echo call_user_func($object->class . "::input_html", $key, $field); } else { get_wpaam_template('form-fields/' . $field['type'] . '-field.php', array('key' => $key, 'field' => $field)); } } else { echo __('This field type has no output', 'wpaam'); } }
function wpaam_show_add_client_form() { get_wpaam_template('forms/add-client-form.php', array('atts' => $atts, 'form' => $form, 'fields' => $fields, 'user_id' => $user_id)); }
<!-- start directory --> <div id="wpaam-user-directory-<?php echo $directory_args['directory_id']; ?> " class="wpaam-user-directory directory-<?php echo $directory_args['directory_id']; ?> "> <!-- Start Users list --> <?php do_action('wpaam_before_user_directory', $directory_args); if (!empty($directory_args['user_data'])) { echo '<ul class="wpaam-user-listings">'; foreach ($directory_args['user_data'] as $user) { // Load single-user.php template to display each user individually get_wpaam_template("directory/single-user.php", array('user' => $user)); } echo "</ul>"; } else { $args = array('id' => 'wpaam-no-user-found', 'type' => 'notice', 'text' => __('No users have been found', 'wpaam')); $warning = wpaam_message($args, true); } do_action('wpaam_after_user_directory', $directory_args); ?> <!-- end users list --> </div> <!-- end directory -->
/** * Output the form. * * @access public * @since 1.0.0 * @return void */ public static function output($atts = array()) { // Get the tabs $current_tab = wpaam_get_current_invoices_tab(); $all_tabs = array_keys(wpaam_get_invoices_page_tabs()); // Display template if (is_user_logged_in()) { if (isset($_POST['submit_wpaam_invoices'])) { // Show errors from fields self::show_errors(); // Show confirmation messages self::show_confirmations(); } get_wpaam_template('forms/edit-invoice-form.php', array('atts' => $atts, 'form' => self::$form_name, 'author_id' => self::$user->ID, 'current_tab' => $current_tab, 'all_tabs' => $all_tabs)); // Show login form if not logged in } else { echo wpaam_login_form(); } }
/** * Output the form. * * @access public * @since 1.0.0 * @return void */ public static function output($atts = array()) { // Get fields self::get_update_password_fields(); if (isset($_POST['submit_wpaam_update_password'])) { // Show errors from fields self::show_errors(); // Show confirmation messages self::show_confirmations(); } // Display template if (is_user_logged_in()) { get_wpaam_template('forms/password-update-form.php', array('form' => self::$form_name, 'password_fields' => self::get_fields('password_update'))); } else { echo wpaam_login_form(); } }
/** * Load content for the "comments" tab. * * @since 1.0.0 * @access public * @param object $user_data holds WP_User object * @param array $tabs holds all the registered tabs * @param string $current_tab_slug the slug of the current tab * @return void */ function wpaam_profile_tab_content_comments($user_data, $tabs, $current_tab_slug) { echo get_wpaam_template('profile/profile-comments.php', array('user_data' => $user_data, 'tabs' => $tabs, 'slug' => $current_tab_slug)); }
/** * Output the form. * * @access public * @since 1.0.0 * @return void */ public static function output($atts = array()) { // Get the tabs $current_account_tab = wpaam_get_current_account_tab(); $all_tabs = array_keys(wpaam_get_account_page_tabs()); // Display template if (is_user_logged_in() && current_user_can('create_users')) { if (isset($_POST['submit_wpaam_profile'])) { // Show errors from fields self::show_errors(); // Show confirmation messages self::show_confirmations(); } get_wpaam_template('forms/account-form.php', array('atts' => $atts, 'form' => self::$form_name, 'user_id' => self::$user->ID, 'current_tab' => $current_account_tab, 'all_tabs' => $all_tabs)); } elseif (is_user_logged_in() && current_user_can('aam_client')) { get_wpaam_template('client_account.php', array('atts' => $atts, 'form' => self::$form_name, 'user_id' => self::$user->ID, 'current_tab' => $current_account_tab, 'all_tabs' => $all_tabs)); // Show login form if not logged in } else { echo wpaam_login_form(); } }
/** * Display a message loading the message.php template file. * * @since 1.0.0 * @param string $id html ID attribute. * @param string $type message type: success/notice/error. * @param string $text the text of the message. * @return void */ function wpaam_message($args) { $defaults = array('id' => 'wpaam-notice', 'type' => 'success', 'text' => ''); // Parse incoming $args into an array and merge it with $defaults $args = wp_parse_args($args, $defaults); echo get_wpaam_template('message.php', array('id' => $args['id'], 'type' => $args['type'], 'text' => $args['text'])); }
public function wpaam_invoices($atts, $content = null) { $user = wp_get_current_user(); //echo $user->roles[0]; die; //Get the tabs $current_invoices_tab = wpaam_get_current_invoices_tab(); $all_tabs_inv = array_keys(wpaam_get_invoices_page_tabs()); // Display template for aam user's if (is_user_logged_in() && current_user_can('edit_invoice') && current_user_can('publish_invoice')) { get_wpaam_template('invoices.php', array('atts' => $atts, 'form' => 'edit-invoice', 'user_id' => $user->ID, 'current_tab' => $current_invoices_tab, 'all_tabs' => $all_tabs_inv)); // Display Invoices list for client's } elseif (is_user_logged_in() && current_user_can('aam_client')) { get_wpaam_template('client_invoices.php', array('user_id' => $user->ID)); // Show login form if not logged in } else { echo wpaam_login_form(); } }
/** * Output the form. * * @access public * @since 1.0.0 * @return void */ public static function output($atts = array()) { // Get fields self::get_password_fields(); if (isset($_POST['submit_wpaam_password'])) { // Show errors from fields self::show_errors(); // Show confirmation messages self::show_confirmations(); } // Display template if (is_user_logged_in()) { get_wpaam_template('already-logged-in.php', array('args' => $atts)); // Show psw form if not logged in } else { get_wpaam_template('forms/password-form.php', array('atts' => $atts, 'form' => self::$form_name, 'user_fields' => self::get_fields('user'), 'password_fields' => self::get_fields('password'))); } }
/** * Output the form. * * @access public * @since 1.2.0 * @return void */ public static function output($atts = array()) { // Get fields. self::get_group_fields(); if (isset($_POST['submit_wpaam_group_form'])) { // Show errors from fields. self::show_errors(); // Show confirmation messages. self::show_confirmations(); } $args = array('atts' => $atts, 'form' => self::$form_name, 'group_id' => self::get_group_id(), 'group_fields' => self::get_fields('custom-group')); get_wpaam_template('forms/group-form.php', $args); }
/** * Output the form. * * @access public * @since 1.0.0 * @return void */ public static function output($atts = array()) { // Get fields self::get_registration_fields(); if (isset($_POST['submit_wpaam_register'])) { // Show errors from fields self::show_errors(); // Show confirmation messages self::show_confirmations(); } // Display template if (!get_option('users_can_register')) { // Display error message $message = array('id' => 'wpaam-registrations-disabled', 'type' => 'notice', 'text' => __('Registrations are currently disabled.', 'wpaam')); wpaam_message($message); } elseif (is_user_logged_in()) { get_wpaam_template('already-logged-in.php', array('args' => $atts)); // Show register form if not logged in } else { get_wpaam_template('forms/registration-form.php', array('atts' => $atts, 'form' => self::$form_name, 'register_fields' => self::get_fields('register'))); } }
/** * Display overview of the current user profile. * * @since 1.0.0 * @access public * @return void. */ function wpaam_current_user_overview() { $current_user = wp_get_current_user(); get_wpaam_template('user-overview.php', array('current_user' => $current_user)); }
/** * Display user name in profile.php template. * * @since 1.0.0 * @param object $user_data holds WP_User object * @access public * @return void */ function wpaam_profile_show_user_links($user_data) { $output = get_wpaam_template('profile/profile-links.php', array('user_data' => $user_data)); echo $output; }
<?php if (!is_page(wpaam_get_core_page_id('register'))) { ?> <div class="wpaam-uploaded-files"> <?php if (!empty($field['value']) && !is_wp_error($field['value'])) { // Check if we have multiple files. if (wpaam_is_multi_array($field_files)) { foreach ($field_files as $key => $file) { get_wpaam_template('form-fields/uploaded-file-html.php', array('key' => $key, 'name' => 'current_' . $field_name, 'value' => $file['url'], 'field' => $field, 'field_name' => $field_name, 'number' => $key)); } // We have single file. } else { get_wpaam_template('form-fields/uploaded-file-html.php', array('key' => $key, 'name' => 'current_' . $field_name, 'value' => $field_files, 'field' => $field, 'field_name' => $field_name)); } } ?> </div> <?php if (!empty($field_files)) { ?> <a class="wpaam-remove-uploaded-file" href="#" data-remove="<?php echo esc_attr($field_name); ?> ">[<?php _e('remove', 'wpaam');
esc_attr_e($key, 'wpaam'); ?> "> <label for="<?php esc_attr_e($key, 'wpaam'); ?> "><?php echo esc_html($field['label']); ?> </label> <div class="field <?php echo $field['required'] ? 'required-field' : ''; ?> "> <?php get_wpaam_template('form-fields/' . $field['type'] . '-field.php', array('key' => $key, 'field' => $field)); ?> </div> </fieldset> <?php } ?> <!-- End Password User Fields --> <?php } ?> <?php do_action('wpaam_after_inside_password_form_template', $atts); ?>