| @@ -24,10 +24,11 @@ | ||
| 24 | 24 | 'block-keywords'=> "['userswp','profile']", |
| 25 | 25 | 'class_name' => __CLASS__, |
| 26 | 26 | 'base_id' => 'uwp_profile', |
| 27 | 27 | 'name' => __('UWP > Profile','userswp'), |
| 28 | + 'no_wrap' => true, | |
| 28 | 29 | 'widget_ops' => array( |
| 29 | - 'classname' => 'uwp-profile-class', | |
| 30 | + 'classname' => 'uwp-profile-class bsui', | |
| 30 | 31 | 'description' => esc_html__('Displays user profile.','userswp'), |
| 31 | 32 | ), |
| 32 | 33 | 'arguments' => array( |
| 33 | 34 | 'title' => array( |
| @@ -37,8 +38,17 @@ | ||
| 37 | 38 | 'desc_tip' => true, |
| 38 | 39 | 'default' => '', |
| 39 | 40 | 'advanced' => false |
| 40 | 41 | ), |
| 42 | + 'disable_greedy' => array( | |
| 43 | + 'title' => __('Disable Greedy Menu', 'userswp'), | |
| 44 | + 'desc' => __('Greedy menu prevents a large menu falling onto another line by adding a dropdown select.', 'userswp'), | |
| 45 | + 'type' => 'checkbox', | |
| 46 | + 'desc_tip' => true, | |
| 47 | + 'value' => '1', | |
| 48 | + 'default' => '', | |
| 49 | + 'advanced' => true, | |
| 50 | + ), | |
| 41 | 51 | ) |
| 42 | 52 | |
| 43 | 53 | ); |
| 44 | 54 | |
| @@ -47,35 +57,24 @@ | ||
| 47 | 57 | } |
| 48 | 58 | |
| 49 | 59 | public function output( $args = array(), $widget_args = array(), $content = '' ) { |
| 50 | 60 | |
| 51 | - if (!is_user_logged_in()) { | |
| 52 | - return false; | |
| 53 | - } | |
| 54 | - | |
| 55 | 61 | ob_start(); |
| 56 | 62 | |
| 57 | 63 | echo '<div class="uwp_widgets uwp_widget_profile">'; |
| 58 | 64 | |
| 59 | - $temp_obj = new UsersWP_Templates(); | |
| 60 | - | |
| 61 | - $template = $temp_obj->uwp_locate_template('profile'); | |
| 62 | - | |
| 63 | 65 | echo '<div class="uwp_page">'; |
| 64 | 66 | |
| 65 | - if ($template) { | |
| 66 | - include($template); | |
| 67 | - } | |
| 67 | + $design_style = !empty($args['design_style']) ? esc_attr($args['design_style']) : uwp_get_option("design_style",'bootstrap'); | |
| 68 | + $template = $design_style ? $design_style."/profile.php" : "profile.php"; | |
| 68 | 69 | |
| 70 | + uwp_get_template($template, $args); | |
| 71 | + | |
| 69 | 72 | echo '</div>'; |
| 70 | 73 | |
| 71 | 74 | echo '</div>'; |
| 72 | 75 | |
| 73 | - $output = ob_get_contents(); | |
| 74 | - | |
| 75 | - ob_end_clean(); | |
| 76 | - | |
| 77 | - return trim($output); | |
| 76 | + return ob_get_clean(); | |
| 78 | 77 | |
| 79 | 78 | } |
| 80 | 79 | |
| 81 | 80 | } |