| @@ -13,9 +13,8 @@ | ||
| 13 | 13 | public function add_apps_to_menu() { |
| 14 | 14 | |
| 15 | 15 | $apps = WPDA_App_Model::add_to_dashboard_menu(); |
| 16 | 16 | foreach ( $apps as $app ) { |
| 17 | - | |
| 18 | 17 | $settings = json_decode( $app['app_settings'], true ); |
| 19 | 18 | if ( |
| 20 | 19 | ! isset( |
| 21 | 20 | $settings['rest_api']['authorization'], |
| @@ -38,9 +37,26 @@ | ||
| 38 | 37 | } |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | 40 | $title = $settings['settings']['app_menu_title']; |
| 42 | - if ( is_admin() ) { | |
| 41 | + $icon = 'dashicons-database-view'; | |
| 42 | + switch ($app['app_type']) { | |
| 43 | + case 1: | |
| 44 | + case 3: | |
| 45 | + case 4: | |
| 46 | + $icon = 'dashicons-edit'; | |
| 47 | + break; | |
| 48 | + case 2: | |
| 49 | + $icon = 'dashicons-location'; | |
| 50 | + break; | |
| 51 | + case 6: | |
| 52 | + $icon = 'dashicons-chart-bar'; | |
| 53 | + break; | |
| 54 | + case 7: | |
| 55 | + $icon = 'dashicons-dashboard'; | |
| 56 | + break; | |
| 57 | + } | |
| 58 | + if ( is_admin() ) { | |
| 43 | 59 | // Add app to dashboard menu |
| 44 | 60 | add_menu_page( |
| 45 | 61 | $title, |
| 46 | 62 | $title, |
| @@ -46,9 +62,9 @@ | ||
| 46 | 62 | $title, |
| 47 | 63 | WPDA::get_current_user_capability(), |
| 48 | 64 | $title, |
| 49 | 65 | null, |
| 50 | - 'dashicons-database-view' | |
| 66 | + $icon | |
| 51 | 67 | ); |
| 52 | 68 | |
| 53 | 69 | add_submenu_page( |
| 54 | 70 | $title, |
| @@ -55,14 +71,16 @@ | ||
| 55 | 71 | $title, |
| 56 | 72 | $title, |
| 57 | 73 | WPDA::get_current_user_capability(), |
| 58 | 74 | $title, |
| 59 | - function() use ( $app, $title ) { | |
| 75 | + function() use ( $app, $title, $settings ) { | |
| 60 | 76 | // Style not enqueued from container class. |
| 61 | 77 | // Adding container style manually. |
| 62 | - $args = array( | |
| 78 | + $fullscreen = isset( $settings['settings']['app_start_full_screen'] ) ? $settings['settings']['app_start_full_screen'] : false; | |
| 79 | + $args = array( | |
| 63 | 80 | 'app_id' => $app['app_id'], |
| 64 | 81 | 'feedback' => true, |
| 82 | + 'fullscreen' => $fullscreen, | |
| 65 | 83 | ); |
| 66 | 84 | $app_container = new WPDA_App_Container( $args ); |
| 67 | 85 | ?> |
| 68 | 86 | <div class="wrap wpda-dashboard-app"> |