This commit is contained in:
ThemeLexus
2019-09-28 16:41:11 +07:00
47 changed files with 210 additions and 7723 deletions

View File

@@ -72,11 +72,18 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
],
[
'name' => esc_html__( 'My Account Page', 'opalestate-pro' ),
'desc' => esc_html__( 'This is page use User login and register an account, or reset password.', '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__( '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',

View File

@@ -79,7 +79,7 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
}
$fields[] = [
'name' => esc_html__( 'Show Meta Information in Grid and Single Page', 'opalestate-pro' ),
'name' => esc_html__( 'Show Meta Information in property collection.', 'opalestate-pro' ),
'id' => 'show_property_meta',
'type' => 'multicheck',
'options' => $checkes,

View File

@@ -32,7 +32,7 @@ function opalestate_property_render_field_template( $field, $label, $type = 'sel
case 'input': ?>
<label class="opalestate-label opalestate-label--<?php echo sanitize_html_class( $field ); ?>"><?php echo esc_html( $label ); ?></label>
<div class="input-group-number">
<i class="fa icon-property-<?php echo esc_attr( $field ); ?>"></i>
<i class="<?php echo opalestate_get_property_meta_icon( $field ); ?>"></i>
<input class="form-control" value="1" type="text" name="info[<?php echo $field; ?>]" placeholder="<?php echo esc_attr( $label ); ?>"/>
<div class="btn-actions">
<span class="btn-minus"><i class="fa fa-minus"></i></span>

View File

@@ -1162,3 +1162,54 @@ function opalestate_get_property_statuses() {
'expired' => esc_html__( 'Expired', 'opalestate-pro' ),
] );
}
/**
* Returns property meta icon classes.
*
* @param $key
*/
function opalestate_get_property_meta_icon( $key ) {
$classes = [];
$classes[] = 'icon-property-' . esc_attr( $key );
$prefix = 'far';
$classes[] = $prefix;
switch ( $key ) {
case 'builtyear':
$icon = $prefix . '-' . 'calendar';
break;
case 'parking':
$icon = $prefix . '-' . 'car';
break;
case 'bedrooms':
$icon = $prefix . '-' . 'bed';
break;
case 'bathrooms':
$icon = $prefix . '-' . 'bath';
break;
case 'plotsize':
$icon = $prefix . '-' . 'map';
break;
case 'areasize':
$icon = $prefix . '-' . 'arrows-alt';
break;
case 'orientation':
$icon = $prefix . '-' . 'compass';
break;
case 'livingrooms':
$icon = $prefix . '-' . 'tv';
break;
case 'kitchens':
$icon = $prefix . '-' . 'utensils';
break;
case 'amountrooms':
$icon = $prefix . '-' . 'building';
break;
default:
$icon = $key;
break;
}
$classes[] = apply_filters( 'opalestate_property_meta_icon', $icon, $key );
return esc_attr( implode( ' ', array_map( 'sanitize_html_class', $classes ) ) );
}

View File

@@ -571,11 +571,15 @@ class Opalestate_Property {
return $this->get_metabox_value( 'gallery', true );
}
/**
* Count gallery images.
*
* @return int
*/
public function get_gallery_count() {
$count = $this->get_gallery();
return count( $count );
return is_array( $count ) && $count ? count( $count ) : 0;
}
/**

View File

@@ -142,7 +142,7 @@ function opalestate_management_user_menu_tabs() {
];
$menu['reviews'] = [
'icon' => 'fa fa-star',
'icon' => 'far fa-star',
'link' => 'reviews',
'title' => esc_html__( 'Reviews', 'opalestate-pro' ),
'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0,
@@ -167,7 +167,7 @@ function opalestate_management_user_menu_tabs() {
$statistics = new OpalEstate_User_Statistics();
$menu['myproperties'] = [
'icon' => 'fa fa-building',
'icon' => 'fas fa-building',
'link' => 'submission_list',
'title' => esc_html__( 'My Properties', 'opalestate-pro' ) . '<span class="count">' . $statistics->get_count_properties() . '</span>',
'id' => isset( $opalestate_options['submission_list_page'] ) ? $opalestate_options['submission_list_page'] : 0,