Пример #1
0
 function manage_edit_um_directory_columns($columns)
 {
     $admin = new UM_Admin_Metabox();
     $new_columns['cb'] = '<input type="checkbox" />';
     $new_columns['id'] = __('ID') . $admin->_tooltip('Unique ID for each form');
     $new_columns['title'] = __('Title');
     $new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip('Use this shortcode to display the member directory');
     $new_columns['date'] = __('Date');
     return $new_columns;
 }
Пример #2
0
 function manage_edit_um_role_columns($columns)
 {
     $admin = new UM_Admin_Metabox();
     $new_columns['cb'] = '<input type="checkbox" />';
     $new_columns['title'] = __('Role Title', 'ultimatemember');
     $new_columns['count'] = __('No. of Members', 'ultimatemember') . $admin->_tooltip(__('The total number of members who have this role on your site', 'ultimatemember'));
     $new_columns['core'] = __('Core / Built-in', 'ultimatemember') . $admin->_tooltip(__('A core role is installed by default and may not be removed', 'ultimatemember'));
     $new_columns['has_wpadmin_perm'] = __('WP-Admin Access', 'ultimatemember') . $admin->_tooltip(__('Let you know If users of this role can view the WordPress backend or not', 'ultimatemember'));
     return $new_columns;
 }
Пример #3
0
 function manage_users_columns($columns)
 {
     $admin = new UM_Admin_Metabox();
     $columns['um_role'] = __('Community Role', 'ultimatemember') . $admin->_tooltip(__('This is the membership role set by Ultimate Member plugin', 'ultimatemember'));
     return $columns;
 }
function ultimatemember_dynamic_modal_content()
{
    global $ultimatemember;
    $metabox = new UM_Admin_Metabox();
    if (!is_user_logged_in() || !current_user_can('manage_options')) {
        die(__('Please login as administrator', 'ultimatemember'));
    }
    extract($_POST);
    switch ($act_id) {
        default:
            ob_start();
            do_action('um_admin_ajax_modal_content__hook', $act_id);
            do_action("um_admin_ajax_modal_content__hook_{$act_id}");
            $output = ob_get_contents();
            ob_end_clean();
            break;
        case 'um_admin_fonticon_selector':
            ob_start();
            ?>
				
					<div class="um-admin-metabox">
						<p class="_icon_search"><input type="text" name="_icon_search" id="_icon_search" value="" placeholder="<?php 
            _e('Search Icons...', 'ultimatemember');
            ?>
" /></p>
					</div>
				
					<div class="um-admin-icons">
						<?php 
            foreach ($ultimatemember->icons->all as $icon) {
                ?>
						<span data-code="<?php 
                echo $icon;
                ?>
" title="<?php 
                echo $icon;
                ?>
" class="um-admin-tipsy-n"><i class="<?php 
                echo $icon;
                ?>
"></i></span>
						<?php 
            }
            ?>
					</div><div class="um-admin-clear"></div>
			
					<?php 
            $output = ob_get_contents();
            ob_end_clean();
            break;
        case 'um_admin_show_fields':
            ob_start();
            ?>
					
					<h4><?php 
            _e('Setup New Field', 'ultimatemember');
            ?>
</h4>
					<div class="um-admin-btns">
						
						<?php 
            if ($ultimatemember->builtin->core_fields) {
                foreach ($ultimatemember->builtin->core_fields as $field_type => $array) {
                    if (isset($array['in_fields']) && $array['in_fields'] == false) {
                    } else {
                        ?>
						
						<a href="#" class="button" data-modal="UM_add_field" data-modal-size="normal" data-dynamic-content="um_admin_new_field_popup" data-arg1="<?php 
                        echo $field_type;
                        ?>
" data-arg2="<?php 
                        echo $arg2;
                        ?>
"><?php 
                        echo $array['name'];
                        ?>
</a>
						
						<?php 
                    }
                }
            }
            ?>
						
					</div>
					
					<h4><?php 
            _e('Predefined Fields', 'ultimatemember');
            ?>
</h4>
					<div class="um-admin-btns">
						
						<?php 
            if ($ultimatemember->builtin->predefined_fields) {
                foreach ($ultimatemember->builtin->predefined_fields as $field_key => $array) {
                    if (!isset($array['account_only']) && !isset($array['private_use'])) {
                        ?>
						
						<a href="#" class="button" data-silent_action="um_admin_add_field_from_predefined" data-arg1="<?php 
                        echo $field_key;
                        ?>
" data-arg2="<?php 
                        echo $arg2;
                        ?>
"><?php 
                        echo $array['title'];
                        ?>
</a>

						<?php 
                    }
                }
            } else {
                echo '<p>' . __('None', 'ultimatemember') . '</p>';
            }
            ?>
						
					</div>
					
					<h4><?php 
            _e('Custom Fields', 'ultimatemember');
            ?>
</h4>
					<div class="um-admin-btns">
						
						<?php 
            if ($ultimatemember->builtin->custom_fields) {
                foreach ($ultimatemember->builtin->custom_fields as $field_key => $array) {
                    ?>
						
						<a href="#" class="button with-icon" data-silent_action="um_admin_add_field_from_list" data-arg1="<?php 
                    echo $field_key;
                    ?>
" data-arg2="<?php 
                    echo $arg2;
                    ?>
"><?php 
                    echo $array['title'];
                    ?>
<span class="remove"></span></a>
						
						<?php 
                }
            } else {
                echo '<p>' . __('You did not create any custom fields', 'ultimatemember') . '</p>';
            }
            ?>
						
					</div>
					
				<?php 
            $output = ob_get_contents();
            ob_end_clean();
            break;
        case 'um_admin_edit_field_popup':
            ob_start();
            $args = $ultimatemember->builtin->get_core_field_attrs($arg1);
            $form_fields = $ultimatemember->query->get_attr('custom_fields', $arg2);
            $metabox->set_field_type = $arg1;
            $metabox->in_edit = true;
            $metabox->edit_array = $form_fields[$arg3];
            if (!isset($metabox->edit_array['metakey'])) {
                $metabox->edit_array['metakey'] = $metabox->edit_array['id'];
            }
            if (!isset($metabox->edit_array['position'])) {
                $metabox->edit_array['position'] = $metabox->edit_array['id'];
            }
            extract($args);
            if (!isset($col1)) {
                echo '<p>' . __('This field type is not setup correcty.', 'ultimatemember') . '</p>';
            } else {
                ?>
				
				<?php 
                if (isset($metabox->edit_array['in_group'])) {
                    ?>
				<input type="hidden" name="_in_row" id="_in_row" value="<?php 
                    echo $metabox->edit_array['in_row'];
                    ?>
" />
				<input type="hidden" name="_in_sub_row" id="_in_sub_row" value="<?php 
                    echo $metabox->edit_array['in_sub_row'];
                    ?>
" />
				<input type="hidden" name="_in_column" id="_in_column" value="<?php 
                    echo $metabox->edit_array['in_column'];
                    ?>
" />
				<input type="hidden" name="_in_group" id="_in_group" value="<?php 
                    echo $metabox->edit_array['in_group'];
                    ?>
" />
				<?php 
                }
                ?>
				
				<input type="hidden" name="_type" id="_type" value="<?php 
                echo $arg1;
                ?>
" />
				
				<input type="hidden" name="post_id" id="post_id" value="<?php 
                echo $arg2;
                ?>
" />
				
				<input type="hidden" name="action" id="action" value="ultimatemember_admin_update_field" />
				
				<input type="hidden" name="edit_mode" id="edit_mode" value="true" />
				
				<input type="hidden" name="_metakey" id="_metakey" value="<?php 
                echo $metabox->edit_array['metakey'];
                ?>
" />

				<input type="hidden" name="_position" id="_position" value="<?php 
                echo $metabox->edit_array['position'];
                ?>
" />
				
				<?php 
                if (isset($args['mce_content'])) {
                    ?>
<div class="dynamic-mce-content"><?php 
                    echo $metabox->edit_array['content'];
                    ?>
</div><?php 
                }
                ?>

				<?php 
                do_action('um_admin_field_modal_header');
                ?>

				<div class="um-admin-half">
				
					<?php 
                if (isset($col1)) {
                    foreach ($col1 as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
					
				</div>
				
				<div class="um-admin-half um-admin-right">
				
					<?php 
                if (isset($col2)) {
                    foreach ($col2 as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
					
				</div><div class="um-admin-clear"></div>
				
				<?php 
                if (isset($col3)) {
                    foreach ($col3 as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
				
				<div class="um-admin-clear"></div>
				
				<?php 
                if (isset($col_full)) {
                    foreach ($col_full as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
				
				<?php 
                do_action('um_admin_field_modal_footer', $arg2, $args, $metabox->in_edit, isset($metabox->edit_array) ? $metabox->edit_array : '');
                ?>
	
				<?php 
            }
            $output = ob_get_contents();
            ob_end_clean();
            break;
        case 'um_admin_new_field_popup':
            ob_start();
            $args = $ultimatemember->builtin->get_core_field_attrs($arg1);
            $metabox->set_field_type = $arg1;
            extract($args);
            if (!isset($col1)) {
                echo '<p>' . __('This field type is not setup correcty.', 'ultimatemember') . '</p>';
            } else {
                ?>
				
				<?php 
                if ($in_column) {
                    ?>
				<input type="hidden" name="_in_row" id="_in_row" value="_um_row_<?php 
                    echo $in_row + 1;
                    ?>
" />
				<input type="hidden" name="_in_sub_row" id="_in_sub_row" value="<?php 
                    echo $in_sub_row;
                    ?>
" />
				<input type="hidden" name="_in_column" id="_in_column" value="<?php 
                    echo $in_column;
                    ?>
" />
				<input type="hidden" name="_in_group" id="_in_group" value="<?php 
                    echo $in_group;
                    ?>
" />
				<?php 
                }
                ?>
				
				<input type="hidden" name="_type" id="_type" value="<?php 
                echo $arg1;
                ?>
" />
				
				<input type="hidden" name="post_id" id="post_id" value="<?php 
                echo $arg2;
                ?>
" />
				
				<input type="hidden" name="action" id="action" value="ultimatemember_admin_update_field" />

				<?php 
                do_action('um_admin_field_modal_header');
                ?>

				<div class="um-admin-half">
				
					<?php 
                if (isset($col1)) {
                    foreach ($col1 as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
					
				</div>
				
				<div class="um-admin-half um-admin-right">
				
					<?php 
                if (isset($col2)) {
                    foreach ($col2 as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
					
				</div><div class="um-admin-clear"></div>
				
				<?php 
                if (isset($col3)) {
                    foreach ($col3 as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
				
				<div class="um-admin-clear"></div>
				
				<?php 
                if (isset($col_full)) {
                    foreach ($col_full as $opt) {
                        $metabox->field_input($opt);
                    }
                }
                ?>
				
				<?php 
                do_action('um_admin_field_modal_footer', $arg2, $args, $metabox->in_edit, isset($metabox->edit_array) ? $metabox->edit_array : '');
                ?>
	
				<?php 
            }
            $output = ob_get_contents();
            ob_end_clean();
            break;
        case 'um_admin_preview_form':
            $mode = $ultimatemember->query->get_attr('mode', $arg1);
            if ($mode == 'profile') {
                $ultimatemember->fields->editing = true;
            }
            $output = do_shortcode('[ultimatemember form_id=' . $arg1 . ']');
            break;
        case 'um_admin_review_registration':
            um_fetch_user($arg1);
            $ultimatemember->user->preview = true;
            $submitted = um_user('submitted');
            $output = um_user_submitted_registration(true);
            break;
    }
    if (is_array($output)) {
        print_r($output);
    } else {
        echo $output;
    }
    die;
}
Пример #5
0
	<h4><?php 
_e('Apply custom access settings?', 'ultimatemember');
?>
 <?php 
$this->tooltip(__('Switch to yes to override global access settings', 'ultimatemember'), 'e');
?>
</h4>
	
	<p>
		<?php 
$metabox = new UM_Admin_Metabox();
?>
		<span><?php 
$metabox->ui_on_off('_um_custom_access_settings', 0, true, 1, '_um_custom_access_settings', 'xxx');
?>
	</span>
	</p>
	
	<div class="_um_custom_access_settings">
	
		<h4><?php 
_e('Content Availability', 'ultimatemember');
?>
 <?php 
$this->tooltip(__('Who can access this content?', 'ultimatemember'), 'e');
?>
</h4>
		
		<p class="um-conditional-radio-group description" data-cond1="2" data-cond1-show="um-admin-access-roles" data-cond2="1" data-cond2-show="um-admin-access-loggedout">
		
			<?php