Add Pages settings.
This commit is contained in:
@@ -86,6 +86,7 @@ class Opalestate_Admin {
|
||||
'settings/searcharea.php',
|
||||
'settings/general.php',
|
||||
'settings/property.php',
|
||||
'settings/pages.php',
|
||||
] );
|
||||
|
||||
// Get it started
|
||||
|
||||
@@ -115,10 +115,12 @@ class Opalestate_Plugin_Settings {
|
||||
|
||||
$settings = $this->opalestate_settings( null );
|
||||
|
||||
$tabs = [];
|
||||
$tabs['general'] = esc_html__( 'General', 'opalestate-pro' );
|
||||
|
||||
$tabs['property'] = esc_html__( 'Property', 'opalestate-pro' );
|
||||
$tabs = [];
|
||||
$tabs['general'] = esc_html__( 'General', 'opalestate-pro' );
|
||||
$tabs['property'] = esc_html__( 'Property', 'opalestate-pro' );
|
||||
$tabs['pages'] = esc_html__( 'Pages', 'opalestate-pro' );
|
||||
$tabs['3rd_party'] = esc_html__( '3rd Party', 'opalestate-pro' );
|
||||
$tabs['api_keys'] = esc_html__( 'API', 'opalestate-pro' );
|
||||
|
||||
if ( ! empty( $settings['addons']['fields'] ) ) {
|
||||
$tabs['addons'] = esc_html__( 'Add-ons', 'opalestate-pro' );
|
||||
@@ -128,9 +130,6 @@ class Opalestate_Plugin_Settings {
|
||||
$tabs['licenses'] = esc_html__( 'Licenses', 'opalestate-pro' );
|
||||
}
|
||||
|
||||
$tabs['api_keys'] = esc_html__( 'API', 'opalestate-pro' );
|
||||
$tabs['3rd_party'] = esc_html__( '3rd Party', 'opalestate-pro' );
|
||||
|
||||
return apply_filters( 'opalestate_settings_tabs', $tabs );
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
|
||||
}
|
||||
|
||||
public function get_tab_fields( $key = '' ) {
|
||||
$pages = opalestate_cmb2_get_post_options( [
|
||||
'post_type' => 'page',
|
||||
'numberposts' => -1,
|
||||
] );
|
||||
|
||||
return apply_filters( 'opalestate_settings_general', [
|
||||
[
|
||||
'name' => esc_html__( 'General Settings', 'opalestate-pro' ),
|
||||
@@ -46,44 +41,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'before_row' => '<hr>',
|
||||
'after_row' => '<hr>',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'User Management Page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'This is page use User Management Page using for show content of management page such as profile, my properties', 'opalestate-pro' ),
|
||||
'id' => 'user_management_page',
|
||||
'type' => 'select',
|
||||
'options' => $pages,
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Dashboard Logo', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Upload a logo for user dashboard page.', 'opalestate-pro' ),
|
||||
'id' => 'dashboard_logo',
|
||||
'type' => 'file',
|
||||
'preview_size' => [ 100, 100 ],
|
||||
'options' => [
|
||||
'url' => false,
|
||||
],
|
||||
'query_args' => [
|
||||
'type' => [
|
||||
'image/gif',
|
||||
'image/jpeg',
|
||||
'image/png',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'This is page used for login and register an account, or reset password.', 'opalestate-pro' ),
|
||||
'id' => 'user_myaccount_page',
|
||||
'type' => 'select',
|
||||
'options' => $pages,
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Terms and Conditions Page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'This is page used for terms and conditions.', 'opalestate-pro' ),
|
||||
'id' => 'user_terms_page',
|
||||
'type' => 'select',
|
||||
'options' => $pages,
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Login and Redirect to Dashboard page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Redirect to User Management Dashboard page after login.', 'opalestate-pro' ),
|
||||
@@ -104,19 +61,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Enable Message Database', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Allow User send message Contact/Equire via email and saved into database to exchange theirs message direct in User Message Management',
|
||||
'opalestate-pro' ),
|
||||
'id' => 'message_log',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
[
|
||||
'name' => esc_html__( 'Maximum Upload Image Size', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Set maximum volumn size having < x MB', 'opalestate-pro' ),
|
||||
|
||||
176
inc/admin/settings/pages.php
Normal file
176
inc/admin/settings/pages.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/**
|
||||
* $Desc$
|
||||
*
|
||||
* @version $Id$
|
||||
* @package opalestate
|
||||
* @author Opal Team <info@wpopal.com >
|
||||
* @copyright Copyright (C) 2019 wpopal.com. All Rights Reserved.
|
||||
* @license GNU/GPL v2 or later http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* @website http://www.wpopal.com
|
||||
* @support http://www.wpopal.com/support/forum.html
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
class Opalestate_Settings_Pages_Tab extends Opalestate_Settings_Base_Tab {
|
||||
|
||||
public function get_tabnav() {
|
||||
|
||||
}
|
||||
|
||||
public function get_tab_content( $key = '' ) {
|
||||
return [
|
||||
'id' => 'options_page',
|
||||
'opalestate_title' => esc_html__( 'Pages', 'opalestate-pro' ),
|
||||
'show_on' => [ 'key' => 'options-page', 'value' => [ $key, ], ],
|
||||
'fields' => $this->get_tab_fields(),
|
||||
];
|
||||
}
|
||||
|
||||
public function get_tab_fields( $key = '' ) {
|
||||
$pages = opalestate_cmb2_get_post_options( [
|
||||
'post_type' => 'page',
|
||||
'numberposts' => -1,
|
||||
] );
|
||||
|
||||
return apply_filters( 'opalestate_settings_pages', [
|
||||
[
|
||||
'name' => esc_html__( 'Pages Settings', 'opalestate-pro' ),
|
||||
|
||||
'type' => 'opalestate_title',
|
||||
'id' => 'opalestate_title_pages_settings',
|
||||
'before_row' => '<hr>',
|
||||
'after_row' => '<hr>',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'User Management Page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'This is page use User Management Page using for show content of management page such as profile, my properties', 'opalestate-pro' ),
|
||||
'id' => 'user_management_page',
|
||||
'type' => 'select',
|
||||
'options' => $pages,
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Dashboard Logo', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Upload a logo for user dashboard page.', 'opalestate-pro' ),
|
||||
'id' => 'dashboard_logo',
|
||||
'type' => 'file',
|
||||
'preview_size' => [ 100, 100 ],
|
||||
'options' => [
|
||||
'url' => false,
|
||||
],
|
||||
'query_args' => [
|
||||
'type' => [
|
||||
'image/gif',
|
||||
'image/jpeg',
|
||||
'image/png',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'This is page used for login and register an account, or reset password.', 'opalestate-pro' ),
|
||||
'id' => 'user_myaccount_page',
|
||||
'type' => 'select',
|
||||
'options' => $pages,
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Terms and Conditions Page', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'This is page used for terms and conditions.', 'opalestate-pro' ),
|
||||
'id' => 'user_terms_page',
|
||||
'type' => 'select',
|
||||
'options' => $pages,
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Dashboard Settings', 'opalestate-pro' ),
|
||||
|
||||
'type' => 'opalestate_title',
|
||||
'id' => 'opalestate_title_pages_dashboard',
|
||||
'desc' => esc_html__( 'Settings for User Management Dashboard.', 'opalestate-pro' ),
|
||||
'before_row' => '<hr>',
|
||||
'after_row' => '<hr>',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Profile', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Profile menu page.', 'opalestate-pro' ),
|
||||
'id' => 'enable_dashboard_profile',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'default' => 'on',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Favorite', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Favorite menu page.', 'opalestate-pro' ),
|
||||
'id' => 'enable_dashboard_favorite',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'default' => 'on',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Reviews', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Reviews menu page.', 'opalestate-pro' ),
|
||||
'id' => 'enable_dashboard_reviews',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'default' => 'on',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Enable Message Database', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Allow User send message Contact/Equire via email and saved into database to exchange theirs message direct in User Message Management',
|
||||
'opalestate-pro' ),
|
||||
'id' => 'message_log',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Submission', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Submission menu page.', 'opalestate-pro' ),
|
||||
'id' => 'enable_dashboard_submission',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'default' => 'on',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Properties', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show My Properties menu page.', 'opalestate-pro' ),
|
||||
'id' => 'enable_dashboard_properties',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'default' => 'on',
|
||||
],
|
||||
[
|
||||
'name' => esc_html__( 'Show Saved Search', 'opalestate-pro' ),
|
||||
'desc' => esc_html__( 'Show Saved Search menu page.', 'opalestate-pro' ),
|
||||
'id' => 'enable_dashboard_savedsearch',
|
||||
'type' => 'switch',
|
||||
'options' => [
|
||||
'on' => esc_html__( 'Enable', 'opalestate-pro' ),
|
||||
'off' => esc_html__( 'Disable', 'opalestate-pro' ),
|
||||
],
|
||||
'default' => 'on',
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user