File: /home/zwafgyp/dodolodge-net/wp-content/themes/hotel-wp/inc/widgets/weather/config.php
<?php
/**
* Thim_Builder Weather config class
*
* @version 1.0.0
* @author ThimPress
* @package Thim_Builder/Classes
* @category Classes
* @author Thimpress, tuanta
*/
/**
* Prevent loading this file directly
*/
defined( 'ABSPATH' ) || exit;
if ( ! class_exists( 'Thim_Builder_Config_Weather' ) ) {
/**
* Class Thim_Builder_Config_Weather
*/
class Thim_Builder_Config_Weather extends Thim_Builder_Abstract_Config {
/**
* Thim_Builder_Config_Weather constructor.
*/
public function __construct() {
// info
self::$base = 'weather';
self::$name = esc_html__( 'Thim: Weather', 'hotel-wp' );
self::$desc = esc_html__( 'Display Weather', 'hotel-wp' );
self::$icon = 'thim-widget-icon thim-widget-icon-timetable';
parent::__construct();
}
/**
* @return array
*/
public function get_options() {
// options
return array(
array(
'type' => 'textfield',
'admin_label' => true,
'heading' => esc_attr__( 'Your API', 'hotel-wp' ),
'param_name' => 'api',
'description' => esc_html__( 'Write the your API (https://home.openweathermap.org/api_keys).', 'hotel-wp' ),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Select Type Location', 'hotel-wp' ),
'param_name' => 'type_location',
'default' => 'address',
'admin_label' => true,
'value' => array(
esc_html__( 'Address', 'hotel-wp' ) => 'address',
esc_html__( 'Coordinate', 'hotel-wp' ) => 'coordinate',
),
'description' => esc_html__( 'Select ty location type of weather', 'hotel-wp' )
),
array(
'type' => 'textfield',
'admin_label' => true,
'heading' => esc_attr__( 'Location', 'hotel-wp' ),
'param_name' => 'location',
'std' => 'London',
'description' => esc_html__( 'Write the your location.', 'hotel-wp' ),
'dependency' => array(
'element' => 'type_location',
'value' => 'address',
),
),
array(
'type' => 'textfield',
'admin_label' => true,
'heading' => esc_attr__( 'Latitude', 'hotel-wp' ),
'param_name' => 'lat',
'std' => '51.5073',
'description' => esc_html__( 'Write the your Latitude.', 'hotel-wp' ),
'dependency' => array(
'element' => 'type_location',
'value' => 'coordinate',
),
),
array(
'type' => 'textfield',
'admin_label' => true,
'heading' => esc_attr__( 'Longitude', 'hotel-wp' ),
'param_name' => 'lng',
'std' => '-0.1277',
'description' => esc_html__( 'Write the your longitude.', 'hotel-wp' ),
'dependency' => array(
'element' => 'type_location',
'value' => 'coordinate',
),
),
array(
'type' => 'dropdown',
'heading' => esc_html__( 'Unit', 'hotel-wp' ),
'param_name' => 'unit',
'admin_label' => true,
'value' => array(
esc_html__( 'C', 'hotel-wp' ) => 'c',
esc_html__( 'F', 'hotel-wp' ) => 'f',
),
'description' => esc_html__( 'Select unit of weather', 'hotel-wp' )
),
);
}
public function get_template_name(){
return 'default';
}
}
}