public function rtbiz_welcome_panel() { $admin_cap = rtbiz_get_access_role_cap(RTBIZ_TEXT_DOMAIN, 'admin'); $editor_cap = rtbiz_get_access_role_cap(RTBIZ_TEXT_DOMAIN, 'editor'); $welcome_label = __('rtBiz'); $contact_labels = rtbiz_get_contact_labels(); $company_labels = rtbiz_get_company_labels(); //$contact_group_labels = rtbiz_get_contact_group_labels(); ?> <div class="welcome-panel-content"> <h3><?php _e('Welcome to ' . $welcome_label); ?> </h3> <p class="about-description"><?php _e('We’ve assembled some links to get you started:'); ?> </p> <div class="welcome-panel-column-container"> <div class="welcome-panel-column"> <?php if (current_user_can($editor_cap)) { ?> <h4><?php _e('Get Started'); ?> </h4> <a id="rtbiz-customize-biz" class="button button-primary button-hero" href="<?php echo admin_url('admin.php?page=' . Rtbiz_Setting::$page_slug); ?> "><?php echo $welcome_label . ' ' . __('Settings'); ?> </a> <?php } ?> <?php do_action('rtbiz_welcome_panel_addon_link'); ?> </div> <div class="welcome-panel-column"> <h4><?php _e('Next Steps'); ?> </h4> <ul><?php if (current_user_can($editor_cap)) { $rtbiz_setting_url = admin_url('admin.php?page=rt-biz-settings'); echo '<li>'; echo '<a class="welcome-icon welcome-admin-users" href="' . $rtbiz_setting_url . '" style="display: inline-block;" >' . __('Import') . ' ' . strtolower($contact_labels['name']) . '</a>'; echo '</li>'; } if (current_user_can($editor_cap)) { ?> <li><?php printf('<a href="%s" class="welcome-icon welcome-universal-access-alt">' . __('Add new Team & assign them to') . ' ' . strtolower($contact_labels['singular_name']) . '</a>', admin_url('edit-tags.php?taxonomy=' . Rtbiz_Teams::$slug . '&post_type=' . rtbiz_get_contact_post_type())); ?> </li> <?php } if (current_user_can($admin_cap)) { ?> <li><?php printf('<a href="%s" class="welcome-icon welcome-lock">' . __('Define your Access Control for') . ' ' . $welcome_label . '</a>', admin_url('admin.php?page=' . Rtbiz_Access_Control::$page_slug)); ?> </li> <?php } ?> </ul> </div> <div class="welcome-panel-column welcome-panel-last"> <h4><?php _e('Quick Actions'); ?> </h4> <ul> <?php if (current_user_can($editor_cap)) { ?> <li><?php printf('<a id="rtiz-add-contact" href="%s" class="welcome-icon welcome-admin-users">' . __('Add new') . ' ' . $contact_labels['singular_name'] . '</a>', admin_url('post-new.php?post_type=' . rtbiz_get_contact_post_type())); ?> </li> <!--<li><?php /*printf( '<a href="%s" class="welcome-icon welcome-groups">' . __( 'Setup' ) . ' ' . $contact_group_labels['name'] . '</a>', admin_url( 'edit-tags.php?taxonomy=' . Rtbiz_Contact::$user_category_taxonomy . '&post_type=' . rtbiz_get_contact_post_type() ) ); */ ?> </li>--> <li><?php printf('<a href="%s" class="welcome-icon welcome-admin-home">' . __('Add new') . ' ' . $company_labels['singular_name'] . '</a>', admin_url('post-new.php?post_type=' . rtbiz_get_company_post_type())); ?> </li> <li><?php printf('<a href="%s" class="welcome-icon welcome-networking">' . __('Setup Attributes') . '</a>', admin_url('admin.php?page=' . Rtbiz_Attributes::$page_slug)); ?> </li> <?php } else { ?> <li><?php printf('<a href="%s" class="welcome-icon welcome-groups">' . __('View your') . ' ' . $contact_labels['name'] . '</a>', admin_url('edit.php?post_type=' . rtbiz_get_contact_post_type())); ?> </li> <li><?php printf('<a href="%s" class="welcome-icon welcome-admin-home">' . __('View your') . ' ' . $company_labels['name'] . '</a>', admin_url('edit.php?post_type=' . rtbiz_get_company_post_type())); ?> </li> <?php } ?> <li><?php printf('<a href="%s" class="welcome-icon welcome-learn-more">' . __('Learn more about getting started') . '</a>', 'http://docs.rtcamp.com/rtbiz/'); ?> </li> </ul> </div> </div> </div> <?php }
/** * @return bool */ public function rtbiz_set_sections() { $admin_cap = rtbiz_get_access_role_cap(RTBIZ_TEXT_DOMAIN, 'admin'); $editor_cap = rtbiz_get_access_role_cap(RTBIZ_TEXT_DOMAIN, 'editor'); // ACTUAL DECLARATION OF SECTIONS $general_fields = array(array('id' => 'product_plugin', 'title' => __('Product Sync Option'), 'subtitle' => __('Select the plugin you want to use for product sync.'), 'desc' => __('The option you choose here will define which existing products needs to be taken from either WooCommerce or Easy Digital Downloads and synchronize them with the terms of this special attribute taxonomy Products. So that rtBiz / any other plugin can assign these products to any custom post types that are registered with this taxonomy.'), 'type' => 'checkbox', 'options' => array('woocommerce' => __('WooCommerce'), 'edd' => __('Easy Digital Download')), 'default' => 'none')); $this->sections[] = array('icon' => 'el-icon-cogs', 'title' => __('General'), 'permissions' => $admin_cap, 'fields' => $general_fields); $contact_labels = rtbiz_get_contact_labels(); $contact_importer_subtitle = __('<div class="redux_field_th">Import WordPress Users to ' . $contact_labels['name'] . '</div>'); $contact_importer_subtitle .= __('Use this tool to import all current users to ' . $contact_labels['name'] . '. You can also import selected users from '); $contact_importer_subtitle .= '<a href="' . admin_url('users.php') . '">WP users</a> page.'; $contact_importer_subtitle .= __('<br/>All new users will automatically get exported as ' . $contact_labels['name'] . '.<br/> <p class="redux-container-multi_text rtbiz-import-contact-warning"><span class="redux-multi-text-remove">Importing ' . $contact_labels['name'] . ' is a heavy process. So please be patient.</span></p><br/>'); $contact_importer_subtitle .= rtbiz_export_wp_users_to_contacts(); $this->sections[] = array('title' => $contact_labels['singular_name'] . ' ' . __('Importer'), 'icon' => 'el-icon-list-alt', 'permissions' => $editor_cap, 'fields' => array(array('id' => 'rtbiz_import_users_to_contacts', 'type' => 'raw', 'content' => $contact_importer_subtitle))); $this->sections[] = array('icon' => 'el-icon-envelope', 'title' => __('Mailbox List'), 'permissions' => $admin_cap, 'fields' => array(array('id' => 'rtbiz_Mailbox_list', 'type' => 'callback', 'title' => 'Mailbox List', 'subtitle' => __('All Configured Mailbox(s)'), 'callback' => 'rtbiz_mailbox_list_view'))); // If email template addon is active then add new tab called addon in redux setting and also add individual addon on/off setting $addons = array(); $addons = apply_filters('rtbiz_add_addon_settings', $addons); if (!empty($addons)) { $this->sections[] = array('icon' => 'el-icon-adjust-alt', 'title' => __('Add-ons'), 'permissions' => $admin_cap); $this->sections = array_merge($this->sections, $addons); } return true; }
function rtbiz_export_wp_users_to_contacts_dashboard($btnhtml = null) { $nonce = wp_create_nonce('rt-biz-export-all'); $users = new WP_User_Query(array('fields' => 'ID', 'number' => 1)); $contact_labels = rtbiz_get_contact_labels(); ?> <div class="rtbiz-exporter-container"> <?php if (empty($btnhtml)) { ?> <button type="button" class="rtbiz-export-button button button-primary"><?php _e('Import all'); ?> </button> <?php } else { echo $btnhtml; } ?> <img id="rtbiz-import-spinner" style="display: none;" src="<?php echo admin_url() . 'images/spinner.gif'; ?> "/> <input id="rtbiz-contact-import-nonce" type="hidden" value="<?php echo $nonce; ?> "/> <span id="rtbiz-import-message" class="rtbiz-exporter-message"></span> <div class="contact-update" style="display: none;"> <p> <?php echo __('Syncing') . ' ' . $contact_labels['name'] . ' :'; ?> <span id='rtbiz-contact-count-proceed'>0</span></p> </div> <div class="contact-synced" style="display: none;"> <p> <?php _e('All ' . $contact_labels['name'] . ' synced!'); ?> </p> </div> <div id="rtbiz-contact-importer-bar"></div> <input id="rtbiz-contact-count" type="hidden" value="<?php echo $users->get_total(); ?> "/> </div> <?php }