dashboard.php
6 years ago
debug-mode.php
5 years ago
from-headers.php
6 years ago
pagination.php
6 years ago
responsiveness.php
5 years ago
dashboard.php
175 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Dashboard section under the "general" tab. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | * @since 4.0.4 |
| 7 | */ |
| 8 | |
| 9 | $types = array( |
| 10 | 'popup' => array( |
| 11 | 'lowercase' => Opt_In_Utils::get_module_type_display_name( 'popup', true ), |
| 12 | 'capitalize' => Opt_In_Utils::get_module_type_display_name( 'popup', true, true ), |
| 13 | 'setting_prefix' => 'popup', |
| 14 | ), |
| 15 | 'slidein' => array( |
| 16 | 'lowercase' => Opt_In_Utils::get_module_type_display_name( 'slidein', true ), |
| 17 | 'capitalize' => Opt_In_Utils::get_module_type_display_name( 'slidein', true, true ), |
| 18 | 'setting_prefix' => 'slidein', |
| 19 | ), |
| 20 | 'embedded' => array( |
| 21 | 'lowercase' => Opt_In_Utils::get_module_type_display_name( 'embedded', true ), |
| 22 | 'capitalize' => Opt_In_Utils::get_module_type_display_name( 'embedded', true, true ), |
| 23 | 'setting_prefix' => 'embedded', |
| 24 | ), |
| 25 | 'social_sharing' => array( |
| 26 | 'lowercase' => Opt_In_Utils::get_module_type_display_name( 'social_sharing', true ), |
| 27 | 'capitalize' => Opt_In_Utils::get_module_type_display_name( 'social_sharing', true, true ), |
| 28 | 'setting_prefix' => 'social_sharing', |
| 29 | ), |
| 30 | ); |
| 31 | ?> |
| 32 | |
| 33 | <div class="sui-box-settings-row"> |
| 34 | |
| 35 | <div class="sui-box-settings-col-1"> |
| 36 | <span class="sui-settings-label"><?php esc_html_e( 'Dashboard', 'hustle' ); ?></span> |
| 37 | <span class="sui-description"><?php esc_html_e( 'Customize the Hustle dashboard as per your liking.', 'hustle' ); ?></span> |
| 38 | </div> |
| 39 | |
| 40 | <div class="sui-box-settings-col-2"> |
| 41 | |
| 42 | <label id="" class="sui-settings-label"><?php esc_html_e( 'Modules Listing', 'hustle' ); ?></label> |
| 43 | <span id="" class="sui-description"><?php esc_html_e( 'Choose the number of modules and the preferred status you want to see on your Hustle dashboard for each module type.', 'hustle' ); ?></span> |
| 44 | |
| 45 | <div class="sui-tabs sui-tabs-overflow" style="margin-top: 10px;"> |
| 46 | |
| 47 | <div tabindex="-1" class="sui-tabs-navigation" aria-hidden="true"> |
| 48 | <button type="button" class="sui-button-icon sui-tabs-navigation--left"> |
| 49 | <span class="sui-icon-chevron-left"></span> |
| 50 | </button> |
| 51 | <button type="button" class="sui-button-icon sui-tabs-navigation--right"> |
| 52 | <span class="sui-icon-chevron-right"></span> |
| 53 | </button> |
| 54 | </div> |
| 55 | |
| 56 | <div role="tablist" class="sui-tabs-menu"> |
| 57 | |
| 58 | <?php foreach ( $types as $module_type => $data ) : ?> |
| 59 | |
| 60 | <button |
| 61 | type="button" |
| 62 | role="tab" |
| 63 | id="hustle-<?php echo esc_html( $module_type ); ?>-modules-tab" |
| 64 | class="sui-tab-item<?php echo ( 'popup' === $module_type ) ? ' active' : ''; ?>" |
| 65 | aria-controls="hustle-<?php echo esc_html( $module_type ); ?>-modules-content" |
| 66 | aria-selected="<?php echo ( 'popup' === $module_type ) ? 'true' : 'false'; ?>" |
| 67 | <?php echo ( 'popup' === $module_type ) ? '' : 'tabindex="-1"'; ?> |
| 68 | > |
| 69 | <?php echo esc_html( $data['capitalize'] ); ?> |
| 70 | </button> |
| 71 | |
| 72 | <?php endforeach; ?> |
| 73 | |
| 74 | </div> |
| 75 | |
| 76 | <div class="sui-tabs-content"> |
| 77 | |
| 78 | <?php |
| 79 | foreach ( $types as $module_type => $data ) : |
| 80 | $number_label = empty( $data['number_label'] ) ? $data['capitalize'] : $data['number_label']; |
| 81 | $number_description = empty( $data['number_description'] ) ? __( 'recent ', 'hustle' ) . $data['lowercase'] : $data['number_description']; |
| 82 | ?> |
| 83 | |
| 84 | <div |
| 85 | role="tabpanel" |
| 86 | tabindex="0" |
| 87 | id="hustle-<?php echo esc_html( $module_type ); ?>-modules-content" |
| 88 | class="sui-tab-content<?php echo ( 'popup' === $module_type ) ? ' active' : ''; ?>" |
| 89 | aria-labelledby="hustle-<?php echo esc_html( $module_type ); ?>-modules-tab" |
| 90 | <?php echo ( 'popup' === $module_type ) ? '' : 'hidden'; ?> |
| 91 | > |
| 92 | |
| 93 | <div class="sui-form-field"> |
| 94 | |
| 95 | <label |
| 96 | for="hustle-<?php echo esc_html( $module_type ); ?>-number" |
| 97 | id="hustle-<?php echo esc_html( $module_type ); ?>-number-label" |
| 98 | class="sui-settings-label" |
| 99 | > |
| 100 | <?php /* translators: module type in plural */ ?> |
| 101 | <?php printf( esc_html__( 'Number of %s', 'hustle' ), esc_html( $number_label ) ); ?> |
| 102 | </label> |
| 103 | |
| 104 | <span id="hustle-<?php echo esc_html( $module_type ); ?>-number-description" class="sui-description"> |
| 105 | <?php /* translators: module type in plural */ ?> |
| 106 | <?php printf( esc_html__( 'Choose the number of %s to be shown on your dashboard.', 'hustle' ), esc_html( $number_description ) ); ?> |
| 107 | </span> |
| 108 | |
| 109 | <input |
| 110 | type="number" |
| 111 | min="1" |
| 112 | value="<?php echo intval( $settings[ $data['setting_prefix'] . '_on_dashboard' ] ); ?>" |
| 113 | name="<?php echo esc_attr( $data['setting_prefix'] . '_on_dashboard' ); ?>" |
| 114 | id="hustle-<?php echo esc_html( $module_type ); ?>-number" |
| 115 | class="sui-form-control sui-input-sm" |
| 116 | style="max-width: 100px; margin-top: 10px;" |
| 117 | aria-labelledby="hustle-<?php echo esc_html( $module_type ); ?>-number-label" |
| 118 | aria-describedby="hustle-<?php echo esc_html( $module_type ); ?>-number-description" |
| 119 | /> |
| 120 | |
| 121 | </div> |
| 122 | |
| 123 | <div class="sui-form-field"> |
| 124 | |
| 125 | <label id="hustle-<?php echo esc_html( $module_type ); ?>-status-label" class="sui-settings-label"><?php esc_html_e( 'Status', 'hustle' ); ?></label> |
| 126 | |
| 127 | <span id="hustle-<?php echo esc_html( $module_type ); ?>-status-description" class="sui-description" style="margin-bottom: 10px;"> |
| 128 | <?php /* translators: 1. module type in lower case */ ?> |
| 129 | <?php printf( esc_html__( 'By default, we display %1$s with any status. However, you can display %1$s with a specific status only on the dashboard.', 'hustle' ), esc_html( $data['lowercase'] ) ); ?> |
| 130 | </span> |
| 131 | |
| 132 | <label |
| 133 | for="hustle-<?php echo esc_attr( $module_type ); ?>-status--published" |
| 134 | class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm" |
| 135 | > |
| 136 | <input |
| 137 | type="checkbox" |
| 138 | name="published_<?php echo esc_attr( $module_type ); ?>_on_dashboard" |
| 139 | value="1" |
| 140 | id="hustle-<?php echo esc_attr( $module_type ); ?>-status--published" |
| 141 | <?php checked( $settings[ 'published_' . $module_type . '_on_dashboard' ] ); ?> |
| 142 | > |
| 143 | <span aria-hidden="true"></span> |
| 144 | <span><?php esc_html_e( 'Published', 'hustle' ); ?></span> |
| 145 | </label> |
| 146 | |
| 147 | <label |
| 148 | for="hustle-<?php echo esc_attr( $module_type ); ?>-status--drafts" |
| 149 | class="sui-checkbox sui-checkbox-stacked sui-checkbox-sm" |
| 150 | > |
| 151 | <input |
| 152 | type="checkbox" |
| 153 | id="hustle-<?php echo esc_attr( $module_type ); ?>-status--drafts" |
| 154 | name="draft_<?php echo esc_attr( $module_type ); ?>_on_dashboard" |
| 155 | value="1" |
| 156 | <?php checked( $settings[ 'draft_' . $module_type . '_on_dashboard' ] ); ?> |
| 157 | > |
| 158 | <span aria-hidden="true"></span> |
| 159 | <span><?php esc_html_e( 'Drafts', 'hustle' ); ?></span> |
| 160 | </label> |
| 161 | |
| 162 | </div> |
| 163 | |
| 164 | </div> |
| 165 | |
| 166 | <?php endforeach; ?> |
| 167 | |
| 168 | </div> |
| 169 | |
| 170 | </div> |
| 171 | |
| 172 | </div> |
| 173 | |
| 174 | </div> |
| 175 |